/* Restaurant Tip & Bill Split Calculator — content styles.
   Prefix: --tip-  /  .tip-

   Reference point: the per-person amount is the one figure a group at a
   table actually needs, so it gets a visually larger "hero" treatment
   inside an otherwise equal-weight 3-metric row, rather than a separate
   banner elsewhere on the page.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --tip-surface: #ffffff;
  --tip-panel:   #f6f5f3;
  --tip-line:    #e0dcd4;
  --tip-text:    #191510;
  --tip-muted:   #6b6459;
  --tip-mono:    ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.tip-wrap {
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input panel ─────────────────────────────────────────────────────────── */

.tip-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--tip-line);
  border-radius: 2px;
  background: var(--tip-surface);
}

.tip-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 24rem) {
  .tip-field-grid { grid-template-columns: 1fr; }
}

.tip-field {
  display: grid;
  gap: 0.375rem;
}

.tip-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tip-muted);
}

.tip-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  font-family: var(--tip-mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--tip-text);
  background: var(--tip-surface);
  border: 1px solid var(--tip-line);
  border-radius: 2px;
}

.tip-field input:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.tip-error {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #b3261e;
  background: rgba(179, 38, 30, 0.06);
  border: 1px solid #b3261e;
  border-radius: 2px;
}

.tip-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--tip-line);
  padding-top: 0.875rem;
}

.tip-preset-lbl {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tip-muted);
}

.tip-chip {
  padding: 0.3125rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tip-text);
  background: var(--tip-panel);
  border: 1px solid var(--tip-line);
  border-radius: 2px;
  cursor: pointer;
}

.tip-chip:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

/* ── Primary action button ──────────────────────────────────────────────── */

.tip-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tf-accent-ink);
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.tip-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.tip-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.tip-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Results ─────────────────────────────────────────────────────────────── */

.tip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 30rem) {
  .tip-grid { grid-template-columns: 1fr 1fr; }
  .tip-metric--hero { grid-column: span 2; }
}

.tip-metric {
  padding: 1.125rem 0.75rem;
  border: 1px solid var(--tip-line);
  border-radius: 2px;
  background: var(--tip-panel);
  text-align: center;
}

.tip-metric--hero {
  background: var(--tip-surface);
  border-color: var(--tf-accent);
  border-width: 2px;
}

.tip-metric-label {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  color: var(--tip-muted);
}

.tip-metric-value {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tip-text);
}

.tip-metric--hero .tip-metric-value {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--tf-accent);
}

.tip-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--tip-muted);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.tip-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 38rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .tip-wrap,
  .tip-ad { padding-inline: 1rem; }
  .tip-panel { padding: 1.25rem; }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --tip-surface: var(--tf-surface);
  --tip-panel: var(--tf-surface);
  --tip-line: var(--tf-rule);
  --tip-text: var(--tf-ink);
  --tip-muted: var(--tf-ink-soft);
}
