/* Reverse VAT & Sales Tax Calculator — content styles.
   Prefix: --rvat-  /  .rvat-

   Reference point: a receipt breakdown — net, tax, and gross as three
   equal-weight figures in one row, since a tax reversal is fundamentally
   about seeing all three parts of the same price at once, not picking a
   single "answer." A mode toggle up top makes explicit which direction
   the entered amount is being read in, since that's the one thing easy
   to get backwards with a reverse-tax calculation.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --rvat-surface: #ffffff;
  --rvat-panel:   #f5f6f8;
  --rvat-line:    #dde1e6;
  --rvat-text:    #161a1f;
  --rvat-muted:   #5c6570;
  --rvat-mono:    ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.rvat-wrap {
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input panel ─────────────────────────────────────────────────────────── */

.rvat-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--rvat-line);
  border-radius: 2px;
  background: var(--rvat-surface);
}

.rvat-mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.125rem;
  padding-bottom: 1.125rem;
  border-bottom: 1px solid var(--rvat-line);
}

.rvat-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--rvat-text);
  cursor: pointer;
}

.rvat-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 26rem) {
  .rvat-field-grid { grid-template-columns: 1fr; }
}

.rvat-field {
  display: grid;
  gap: 0.375rem;
}

.rvat-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rvat-muted);
}

.rvat-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  font-family: var(--rvat-mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--rvat-text);
  background: var(--rvat-surface);
  border: 1px solid var(--rvat-line);
  border-radius: 2px;
}

.rvat-field input:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.rvat-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;
}

.rvat-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--rvat-line);
  padding-top: 0.875rem;
}

.rvat-preset-lbl {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rvat-muted);
}

.rvat-chip {
  padding: 0.3125rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rvat-text);
  background: var(--rvat-panel);
  border: 1px solid var(--rvat-line);
  border-radius: 2px;
  cursor: pointer;
}

.rvat-chip:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

/* ── Primary action button ──────────────────────────────────────────────── */

.rvat-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;
}

.rvat-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.rvat-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.rvat-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Results ─────────────────────────────────────────────────────────────── */

.rvat-mode-note {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--rvat-muted);
  text-align: center;
}

.rvat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 26rem) {
  .rvat-grid { grid-template-columns: 1fr; }
}

.rvat-metric {
  padding: 1.125rem 0.75rem;
  border: 1px solid var(--rvat-line);
  border-radius: 2px;
  background: var(--rvat-panel);
  text-align: center;
}

.rvat-metric-label {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  color: var(--rvat-muted);
}

.rvat-metric-value {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--tf-accent);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.rvat-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 38rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .rvat-wrap,
  .rvat-ad { padding-inline: 1rem; }
  .rvat-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"] {
  --rvat-surface: var(--tf-surface);
  --rvat-panel: var(--tf-surface);
  --rvat-line: var(--tf-surface);
  --rvat-text: var(--tf-ink);
  --rvat-muted: var(--tf-ink-soft);
}
