/* Layout: a policy-room console. Wide chart + decision rail on the right,
   the AD-AS diagram underneath, a newspaper band across the top.
   Palette: banknote green-greys, one engraving-green accent; chart series
   colors are validated for color-vision deficiency on these surfaces. */
:root {
  --bg: #edf1ed;
  --surface: #fbfcfa;
  --surface-2: #f3f6f2;
  --ink: #13201a;
  --ink-2: #46564e;
  --muted: #74817a;
  --line: #dbe2dc;
  --axis: #b9c3bc;
  --accent: #1d5c47;
  --accent-hover: #164a39;
  --accent-ink: #ffffff;
  --accent-soft: #dde9e1;
  --term: rgba(29, 92, 71, 0.055);
  --pi: #eb6834;
  --u: #2a78d6;
  --i: #1baf7a;
  --ad: #6250d6;
  --sras: #008300;
  --good: #0ca30c;
  --good-ink: #006300;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --crit: #d03b3b;
  --zlb-ink: #c0352f;
  --zlb-soft: rgba(208, 59, 59, 0.08);
  --zlb-soft-2: rgba(208, 59, 59, 0.15);
  --shadow: 0 1px 2px rgba(19, 32, 26, 0.06), 0 4px 16px rgba(19, 32, 26, 0.05);
  --font-ui: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-news: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --r: 10px;
  --fs-xs: 0.75rem;
  --fs-s: 0.8125rem;
  --fs-m: 0.9375rem;
  --fs-l: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-xxl: 2.5rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b100e;
    --surface: #141b18;
    --surface-2: #19221e;
    --ink: #e5ebe7;
    --ink-2: #b1bdb6;
    --muted: #7e8b84;
    --line: #26302b;
    --axis: #3b4741;
    --accent: #63b892;
    --accent-hover: #7ccaa5;
    --accent-ink: #07130d;
    --accent-soft: #1a2a22;
    --term: rgba(99, 184, 146, 0.06);
    --pi: #d95926;
    --u: #3987e5;
    --i: #199e70;
    --ad: #9085e9;
    --sras: #199e70;
    --good-ink: #39c06a;
    --warn-ink: #f2bb4a;
    --zlb-ink: #f08a84;
    --zlb-soft: rgba(240, 138, 132, 0.10);
    --zlb-soft-2: rgba(240, 138, 132, 0.18);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b100e;
  --surface: #141b18;
  --surface-2: #19221e;
  --ink: #e5ebe7;
  --ink-2: #b1bdb6;
  --muted: #7e8b84;
  --line: #26302b;
  --axis: #3b4741;
  --accent: #63b892;
  --accent-hover: #7ccaa5;
  --accent-ink: #07130d;
  --accent-soft: #1a2a22;
  --term: rgba(99, 184, 146, 0.06);
  --pi: #d95926;
  --u: #3987e5;
  --i: #199e70;
  --ad: #9085e9;
  --sras: #199e70;
  --good-ink: #39c06a;
  --warn-ink: #f2bb4a;
  --zlb-ink: #f08a84;
  --zlb-soft: rgba(240, 138, 132, 0.10);
  --zlb-soft-2: rgba(240, 138, 132, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-m)/1.5 var(--font-ui);
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
b { font-weight: 600; }
kbd {
  font: 600 var(--fs-xs)/1 var(--font-ui);
  padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; background: var(--surface-2); color: var(--ink-2);
}
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  max-width: 1320px;
  margin: 0 auto;
  padding-block: 16px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 14px;
}

/* ---------- top bar ---------- */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); display: grid; }
.brand-name { font: 700 var(--fs-xl)/1.1 var(--font-news); letter-spacing: -0.01em; }
.brand { min-width: 0; }
.brand-sub { font-size: var(--fs-s); color: var(--ink-2); max-width: 36ch; }
.homelink { font-size: var(--fs-s); margin-bottom: -6px; }
.homelink a { color: var(--ink-2); text-decoration: none; border-radius: 4px; }
.homelink a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.term { justify-self: center; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.term-label { font-size: var(--fs-s); color: var(--ink-2); text-align: center; }
.term-label > span:first-child { font-weight: 600; color: var(--ink); }
.term-left { margin-left: 6px; }
.pips { list-style: none; padding: 0; margin: 0; display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.pips li { width: 14px; height: 6px; border-radius: 2px; background: var(--line); }
.pips li.done { background: var(--accent); }
.pips li.now { background: var(--accent); opacity: 0.45; }
.pips li.year { margin-left: 5px; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  border: 1px solid transparent; border-radius: 8px; padding: 7px 12px;
  font-size: var(--fs-s); font-weight: 600; cursor: pointer; background: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn.ghost { color: var(--ink-2); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- news band ---------- */
.news {
  background: var(--surface);
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px 12px;
}
.news-inner { display: grid; gap: 2px; }
.news-meta {
  display: flex; gap: 12px; align-items: baseline;
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.news-paper { font: 700 var(--fs-s)/1 var(--font-news); letter-spacing: 0.02em; text-transform: none; color: var(--ink); }
.news-head { font: 600 clamp(1.25rem, 1rem + 1.1vw, 1.75rem)/1.2 var(--font-news); letter-spacing: -0.005em; text-wrap: balance; }
.news-deck { color: var(--ink-2); font-size: var(--fs-m); max-width: 95ch; }
.news.flash .news-head { animation: ink 0.6s ease-out; }
@keyframes ink { from { opacity: 0.25; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- main layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-areas:
    "ts side"
    "adas side"
    "table table";
  gap: 14px;
  align-items: start;
}
.chart-card { grid-area: ts; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 14px; position: sticky; top: max(12px, env(safe-area-inset-top, 0px)); }
.adas-card { grid-area: adas; }
.table-card { grid-area: table; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  min-width: 0;
}
.card h2 { font-size: var(--fs-m); font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 6px; }
.eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.card h2.eyebrow { font-size: var(--fs-xs); }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-s); color: var(--ink-2); }
.legend li, .compare-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 16px; height: 0; border-top: 2.5px solid var(--ink); border-radius: 2px; }
.key-pi { border-color: var(--pi); }
.key-u { border-color: var(--u); }
.key-i { border-color: var(--i); }
.key-goal { border-top: 1.5px dashed var(--muted); }
.key-ad { border-color: var(--ad); }
.key-sras { border-color: var(--sras); }
.key-lras { border-color: var(--ink); }
.key-ghost { border-top: 1.5px dashed var(--muted); }
.key-you { border-color: var(--ink); border-top-width: 3px; }
.key-taylor { border-color: var(--accent); }
.key-hold { border-top: 2px dashed var(--muted); }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
#tsChart { min-height: 240px; }
.chart-note { font-size: var(--fs-s); color: var(--ink-2); margin-top: 4px; }

/* svg text and marks */
.ax text, .lbl { fill: var(--muted); font: 400 11px var(--font-ui); font-variant-numeric: tabular-nums; }
.ax line.grid { stroke: var(--line); stroke-width: 1; }
.ax line.base { stroke: var(--axis); stroke-width: 1; }
.ax .title { fill: var(--ink-2); font-size: 12px; font-weight: 500; }
.term-shade { fill: var(--term); }
.term-tag { fill: var(--accent); font: 600 11px var(--font-ui); letter-spacing: 0.04em; }
.goal { stroke-width: 1.25; stroke-dasharray: 5 4; fill: none; }
.goal.pi { stroke: var(--pi); }
.goal.u { stroke: var(--u); }
.series { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.series.pi { stroke: var(--pi); }
.series.u { stroke: var(--u); }
.series.i { stroke: var(--i); }
.dot { stroke: var(--surface); stroke-width: 2; }
.dot.pi { fill: var(--pi); }
.dot.u { fill: var(--u); }
.dot.i { fill: var(--i); }
.endlbl, .eqm-lbl, .goalpt-lbl, .curve-lbl, .shock-lbl, .qe-lbl, .term-tag {
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
.endlbl { font: 600 12px var(--font-ui); fill: var(--ink); font-variant-numeric: tabular-nums; }
.endlbl .nm { font-weight: 400; fill: var(--ink-2); }
.qe-tick { fill: var(--i); opacity: 0.35; }
.qe-lbl { fill: var(--ink-2); font: 500 10px var(--font-ui); }
.shock-line { stroke: var(--crit); stroke-width: 1.25; }
.shock-lbl { fill: var(--crit); font: 600 11px var(--font-ui); }
.cross { stroke: var(--ink-2); stroke-width: 1; opacity: 0.5; }
.hit { fill: transparent; cursor: crosshair; }

.curve { fill: none; stroke-width: 2.25; stroke-linecap: round; }
.curve.ad { stroke: var(--ad); }
.curve.sras { stroke: var(--sras); }
.curve.lras { stroke: var(--ink); }
.curve.ghost { stroke-width: 1.25; stroke-dasharray: 4 4; opacity: 0.6; }
.curve-lbl { font: 700 12px var(--font-ui); }
.curve-lbl.ad { fill: var(--ad); }
.curve-lbl.sras { fill: var(--sras); }
.curve-lbl.lras { fill: var(--ink); }
.eqm { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.trail { fill: var(--ink-2); }
.trail-line { stroke: var(--ink-2); stroke-width: 1; fill: none; opacity: 0.35; }
.goalpt { fill: none; stroke: var(--good); stroke-width: 2; }
.goalpt-lbl { fill: var(--good-ink); font: 600 11px var(--font-ui); }
.eqm-lbl { fill: var(--ink); font: 600 11px var(--font-ui); font-variant-numeric: tabular-nums; }
.cmp-you { stroke: var(--ink); stroke-width: 2.5; fill: none; }
.cmp-taylor { stroke: var(--accent); stroke-width: 1.75; fill: none; }
.cmp-hold { stroke: var(--muted); stroke-width: 1.75; stroke-dasharray: 5 4; fill: none; }
.cmp-goal { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 2 3; }

/* ---------- decision panel ---------- */
.decide { display: flex; flex-direction: column; gap: 12px; }
.rate-row { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; }
.rate-btn {
  height: 64px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; align-content: center; gap: 0; cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, transform 0.06s;
}
.rate-btn span { font: 500 1.75rem/1 var(--font-ui); }
.rate-btn small { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.rate-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.rate-btn:active { transform: translateY(1px); }
.rate-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rate-readout { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.rate-readout output { font: 700 var(--fs-xxl)/1 var(--font-ui); letter-spacing: -0.02em; }
.rate-sub { font-size: var(--fs-s); color: var(--ink-2); min-height: 1.5em; }
.rate-sub.up { color: var(--pi); }
.rate-sub.down { color: var(--u); }
/* At the zero lower bound the cut button becomes QE and turns red; while QE
   is selected the rate readout is red too. */
.rate-btn.qe { border-color: var(--zlb-ink); background: var(--zlb-soft); color: var(--zlb-ink); }
.rate-btn.qe small { color: var(--zlb-ink); }
.rate-btn.qe:hover { border-color: var(--zlb-ink); background: var(--zlb-soft-2); }
.rate-readout.qe output, .rate-readout.qe .rate-sub { color: var(--zlb-ink); }
.name-note { border-top: 1px solid var(--line); padding-top: 12px; }
.go { padding: 12px 14px; font-size: var(--fs-m); }
.hint { font-size: var(--fs-xs); color: var(--muted); text-align: center; }

/* ---------- stat tiles ---------- */
.stats { display: flex; flex-direction: column; gap: 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.tile { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.tile dt { font-size: var(--fs-xs); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tile dt .swatch { width: 10px; height: 0; border-top: 2.5px solid; border-radius: 2px; }
.tile dd { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.tile .v { font: 700 var(--fs-xl)/1.15 var(--font-ui); }
.tile .dlt { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile .chip { font-size: var(--fs-xs); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.chip svg { flex: none; }
.chip.good { color: var(--good-ink); }
.chip.warn { color: var(--warn-ink); }
.chip.crit { color: var(--crit); }
.tile.minor .v { font-size: var(--fs-l); }
.cred { display: flex; flex-direction: column; gap: 4px; }
.cred-top { display: flex; justify-content: space-between; font-size: var(--fs-s); color: var(--ink-2); }
.cred-top b { color: var(--ink); }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 80%; background: var(--accent); border-radius: 3px; transition: width 0.4s; }
.cred-note { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- AD-AS ---------- */
.adas-wrap { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.adas-explain { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.curves { margin: 0; display: grid; gap: 10px; }
.curves > div { display: grid; grid-template-columns: 48px 1fr; gap: 2px 8px; align-items: baseline; }
.curves dt { font-weight: 700; font-size: var(--fs-s); }
.curves dt.ad { color: var(--ad); }
.curves dt.sras { color: var(--sras); }
.curves dd { margin: 0; font-size: var(--fs-s); color: var(--ink-2); }
.curves dd b { color: var(--ink); font-variant-numeric: tabular-nums; }
.shift-note { font-size: var(--fs-s); line-height: 1.5; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }

/* ---------- table ---------- */
.table-card { padding: 0; }
.table-card summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: baseline; padding: 12px 16px; }
.table-card summary::-webkit-details-marker { display: none; }
.table-card summary::before { content: "\25B8"; color: var(--muted); transition: transform 0.15s; display: inline-block; }
.table-card details[open] summary::before { transform: rotate(90deg); }
.table-card summary h2 { display: inline; }
.summary-hint { font-size: var(--fs-s); color: var(--muted); }
.table-scroll { overflow-x: auto; }
.table-card .table-scroll { padding: 0 16px; }
table.data { border-collapse: collapse; width: 100%; font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { color: var(--ink-2); font-weight: 600; font-size: var(--fs-xs); }
table.data tr.pre td { color: var(--muted); }
.table-actions { display: flex; gap: 6px; align-items: center; padding: 10px 12px 12px; flex-wrap: wrap; }
.copy-msg { font-size: var(--fs-s); color: var(--good-ink); }

.foot { font-size: var(--fs-xs); color: var(--muted); max-width: 90ch; }

/* ---------- dialogs ---------- */
.dlg {
  border: 1px solid var(--line); border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--ink);
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.dlg-wide { width: min(980px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(8, 14, 11, 0.55); }
.dlg-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font: 700 var(--fs-xl)/1.2 var(--font-news); }
.dlg h3 { font-size: var(--fs-m); font-weight: 700; }
.dlg .lede { color: var(--ink-2); max-width: 75ch; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.small { font-size: var(--fs-s); color: var(--ink-2); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.help-grid p { font-size: var(--fs-m); color: var(--ink-2); margin-top: 4px; }
.eq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
.eq { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; min-width: 0; }
.eq-name { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.eq code { font-size: 0.98rem; color: var(--ink); overflow-x: auto; white-space: nowrap; }
.eq p { font-size: var(--fs-s); color: var(--ink-2); }
table.params td:nth-child(2) { font-weight: 600; }
table.params td:last-child { text-align: left; white-space: normal; color: var(--ink-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-s); color: var(--ink-2); font-weight: 600; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 8px; grid-column: 1 / -1; font-weight: 500; }
.form-grid input[type="number"], .form-grid select {
  padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 400;
}
#shareLink { word-break: break-all; }
.range-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
.range-field label { font-size: var(--fs-s); color: var(--ink-2); font-weight: 600; }
.range-field label.check-inline { display: flex; flex-direction: row; justify-content: flex-start; text-align: left; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.range-field input[type="range"]:disabled { opacity: 0.4; }
.cred.off .meter span { width: 0 !important; }
.range-field input[type="range"] { width: 100%; accent-color: var(--accent); margin: 2px 0 0; }
.range-ends { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); }
.range-field output { font-size: var(--fs-s); color: var(--ink); }
.range-field output b { font-weight: 700; }
.lag-note { font-size: var(--fs-xs); color: var(--ink-2); text-align: center; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); }

.verdict { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.grade {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  font: 700 2.4rem/1 var(--font-news); border: 3px solid var(--good); color: var(--good-ink);
}
.grade.bad { border-color: var(--crit); color: var(--crit); }
#endSummary { color: var(--ink-2); margin-top: 4px; }
.shock-reveal { padding: 12px 14px; background: var(--surface-2); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.shock-reveal h3 { font: 700 var(--fs-l)/1.2 var(--font-news); }
.shock-kind { font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); }
.lesson { font-size: var(--fs-s); border-left: 3px solid var(--accent); padding-left: 10px; margin-top: 4px; }
.compare-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-s); color: var(--ink-2); }
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.compare figure { margin: 0; min-width: 0; }
.compare figcaption { font-size: var(--fs-s); font-weight: 600; margin-bottom: 2px; }
.score-table td.best { font-weight: 700; }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: var(--fs-s);
  min-width: 150px;
}
.tooltip .tt-h { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 4px; }
.tooltip .tt-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 6px; align-items: center; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; text-align: right; }
.tooltip .tt-row span:nth-child(2) { color: var(--ink-2); }
.tooltip .tt-key { width: 12px; border-top: 2.5px solid; border-radius: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .topbar { grid-template-columns: 1fr auto; }
  .term { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .adas-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "ts" "side" "adas" "table";
  }
  .side { position: static; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .help-grid, .eq-list, .form-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { grid-template-columns: 1fr; }
  .topnav { justify-content: flex-start; }
  .dlg-body { padding: 18px 16px; }
  .rate-readout output { font-size: 2rem; }
  .news { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
