/* GoldFlower Comp Shop — design system ("Harbor", chosen by the owner 2026-09-08).
   Chrome: deep navy band on a cool near-white page. Data: ONE chromatic series — gold for "us" —
   a slate grey for the field, a muted grey for the sheet reference, a single-hue TEAL sequential
   ramp, a teal↔plum diverging pair, violet only as the third hue of the extract ladder, reserved
   status colours on chips only. Every set was validated with dataviz/validate_palette.js on these
   surfaces (#ffffff light / #121b2e dark). Text never wears a series colour. Tokens resolve as a
   set in both themes; SVG marks read the tokens, so charts re-theme without a re-render. */

:root {
  color-scheme: light;
  --paper:#f3f5f9; --surface:#ffffff; --surface-2:#e9edf4; --surface-3:#dde3ec;
  --ink:#101a2b; --ink-2:#3a4a62; --ink-3:#66748b; --ink-4:#97a3b6;
  --rule:#dce2ec; --rule-2:#c5cfdc;
  --accent:#1c3d6e; --accent-ink:#ffffff; --accent-soft:#e3eaf5; --tint:#e8eef8;
  --header:#142c52; --header-ink:#f2f6fc; --header-eyebrow:#9dbaf0; --header-rule:rgba(242,246,252,.14);
  --scale-ink:#231f1c;
  --shadow:0 1px 2px rgba(16,26,43,.06), 0 12px 32px -20px rgba(16,26,43,.35);
  --radius:8px; --radius-s:6px;

  --viz-surface:#ffffff; --viz-grid:#e1e6ee; --viz-axis:#c5cfdc; --viz-muted:#66748b;
  --viz-text:#101a2b; --viz-text-2:#3a4a62;
  --us:#a16207; --us-soft:rgba(161,98,7,.12); --us-ring:#101a2b;
  --field:#8b98ab; --reference:#6b7889;
  --cat2:#0b8f80; --cat3:#6d28d9;
  --series:var(--us); --series-soft:var(--us-soft); --context:var(--field); --alt1:var(--cat2); --alt2:var(--cat3);
  /* sequential + ordinal teals validated on #ffffff (light end 2.25:1, adjacent ΔL ≥ 0.06) */
  --seq-0:#45bfb0; --seq-1:#1fa093; --seq-2:#0b8072; --seq-3:#075f54; --seq-4:#04463d; --seq-5:#022e28;
  --seq-ink-0:#0b0b0b; --seq-ink-1:#0b0b0b; --seq-ink-2:#ffffff; --seq-ink-3:#ffffff; --seq-ink-4:#ffffff; --seq-ink-5:#ffffff;
  --seq-ink-lo:#0b0b0b; --seq-ink-hi:#ffffff;
  --ord-1:#45bfb0; --ord-2:#1fa093; --ord-3:#0b8072; --ord-4:#075f54;
  --ord-ink-1:#0b0b0b; --ord-ink-2:#0b0b0b; --ord-ink-3:#ffffff; --ord-ink-4:#ffffff;
  --div-below:#0b8f80; --div-below-2:#7fcfc4; --div-below-1:#cdeeea;
  --div-above:#a21caf; --div-above-2:#e08ae9; --div-above-1:#f5d8f8; --div-mid:#eef0f4;
  --div-pos:var(--div-above); --div-neg:var(--div-below);
  --good-text:#006300; --good:#0ca30c; --warn:#fab219; --serious:#ec835a; --critical:#d03b3b;
  --bad-text:#b3261e;
  --hatch:rgba(16,26,43,.28);
  --sale:var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper:#0b1220; --surface:#121b2e; --surface-2:#1a2540; --surface-3:#243252;
    --ink:#e7edf7; --ink-2:#b5c0d3; --ink-3:#8290a6; --ink-4:#5d6a80;
    --rule:#26324b; --rule-2:#34435f;
    --accent:#8fb6ff; --accent-ink:#0b1220; --accent-soft:#1c2b47; --tint:#1f2f4f;
    --header:#0e1a33; --header-ink:#e7edf7; --header-eyebrow:#8fb6ff; --header-rule:rgba(231,237,247,.12);
    --scale-ink:#171412;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 32px -20px rgba(0,0,0,.8);
    --viz-surface:#121b2e; --viz-grid:#26324b; --viz-axis:#34435f; --viz-muted:#8290a6;
    --viz-text:#ffffff; --viz-text-2:#b5c0d3;
    --us:#c98500; --us-soft:rgba(201,133,0,.18); --us-ring:#e7edf7;
    --field:#5f6b80; --reference:#8a95a8;
    --cat2:#1fa093; --cat3:#8b5cf6;
    --seq-0:#0b7a6d; --seq-1:#149185; --seq-2:#22a89a; --seq-3:#45bfb0; --seq-4:#7cd5ca; --seq-5:#b5e8e1;
    --seq-ink-0:#ffffff; --seq-ink-1:#ffffff; --seq-ink-2:#0b0b0b; --seq-ink-3:#0b0b0b; --seq-ink-4:#0b0b0b; --seq-ink-5:#0b0b0b;
    --seq-ink-lo:#ffffff; --seq-ink-hi:#0b0b0b;
    --ord-1:#0b7a6d; --ord-2:#149185; --ord-3:#22a89a; --ord-4:#45bfb0;
    --ord-ink-1:#ffffff; --ord-ink-2:#ffffff; --ord-ink-3:#0b0b0b; --ord-ink-4:#0b0b0b;
    --div-below:#22a89a; --div-below-2:#17766c; --div-below-1:#164a45;
    --div-above:#c65cd6; --div-above-2:#8a3f96; --div-above-1:#4a2a52; --div-mid:#2a3650;
    --good-text:#0ca30c; --bad-text:#e66767;
    --good:#0ca30c; --warn:#fab219; --serious:#ec835a; --critical:#e66767;
    --hatch:rgba(231,237,247,.28);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:#0b1220; --surface:#121b2e; --surface-2:#1a2540; --surface-3:#243252;
  --ink:#e7edf7; --ink-2:#b5c0d3; --ink-3:#8290a6; --ink-4:#5d6a80;
  --rule:#26324b; --rule-2:#34435f;
  --accent:#8fb6ff; --accent-ink:#0b1220; --accent-soft:#1c2b47; --tint:#1f2f4f;
  --header:#0e1a33; --header-ink:#e7edf7; --header-eyebrow:#8fb6ff; --header-rule:rgba(231,237,247,.12);
  --scale-ink:#171412;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 32px -20px rgba(0,0,0,.8);
  --viz-surface:#121b2e; --viz-grid:#26324b; --viz-axis:#34435f; --viz-muted:#8290a6;
  --viz-text:#ffffff; --viz-text-2:#b5c0d3;
  --us:#c98500; --us-soft:rgba(201,133,0,.18); --us-ring:#e7edf7;
  --field:#5f6b80; --reference:#8a95a8;
  --cat2:#1fa093; --cat3:#8b5cf6;
  --seq-0:#0b7a6d; --seq-1:#149185; --seq-2:#22a89a; --seq-3:#45bfb0; --seq-4:#7cd5ca; --seq-5:#b5e8e1;
  --seq-ink-0:#ffffff; --seq-ink-1:#ffffff; --seq-ink-2:#0b0b0b; --seq-ink-3:#0b0b0b; --seq-ink-4:#0b0b0b; --seq-ink-5:#0b0b0b;
  --seq-ink-lo:#ffffff; --seq-ink-hi:#0b0b0b;
  --ord-1:#0b7a6d; --ord-2:#149185; --ord-3:#22a89a; --ord-4:#45bfb0;
  --ord-ink-1:#ffffff; --ord-ink-2:#ffffff; --ord-ink-3:#0b0b0b; --ord-ink-4:#0b0b0b;
  --div-below:#22a89a; --div-below-2:#17766c; --div-below-1:#164a45;
  --div-above:#c65cd6; --div-above-2:#8a3f96; --div-above-1:#4a2a52; --div-mid:#2a3650;
  --good-text:#0ca30c; --bad-text:#e66767;
  --good:#0ca30c; --warn:#fab219; --serious:#ec835a; --critical:#e66767;
  --hatch:rgba(231,237,247,.28);
}

*, *::before, *::after { box-sizing:border-box; }
html { margin:0; scroll-behavior:smooth; font-variant-numeric:tabular-nums; }
body {
  margin:0; background:var(--paper); color:var(--ink);
  font-family:"Source Sans 3", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
h1, h2, h3, h4 { text-wrap:balance; margin:0; }
code, .mono { font-family:"IBM Plex Mono", Consolas, monospace; }
a { color:var(--accent); }
button { font:inherit; }
.num { font-variant-numeric:tabular-nums; }
[hidden] { display:none !important; }
.hatched { background-image:repeating-linear-gradient(45deg, transparent 0 3px, var(--hatch) 3px 4px); }
.muted { color:var(--ink-3); }
.small { font-size:12.5px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* ── app shell ─────────────────────────────────────────────────────────── */
.app { max-width:1320px; margin:0 auto; padding:0 24px 80px; }
/* the header band: brand, controls and the tab strip on the navy chrome; content stays on paper */
.head { background:var(--header); color:var(--header-ink); margin:0 -24px; padding:0 24px; }
.topbar { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:12px 24px; padding:18px 0 10px; }
.brand .eyebrow { margin:0; color:var(--header-eyebrow); }
.brand h1 { font-family:Archivo, "Segoe UI", sans-serif; font-weight:700; font-size:22px; letter-spacing:-.02em; color:var(--header-ink); }
.brand .run { font-size:13px; color:var(--header-ink); opacity:.78; }
.topbar-right { display:flex; gap:8px; align-items:center; }
.head .iconbtn { background:transparent; color:var(--header-ink); border-color:var(--header-rule); }
.head .iconbtn:hover { background:rgba(255,255,255,.08); color:var(--header-ink); }
.eyebrow { font-family:Archivo, "Segoe UI", sans-serif; font-size:12.5px; font-weight:600; color:var(--accent); margin:0 0 4px; }

.brand h1 { font-size:26px; }
.tabs { display:flex; gap:2px; padding:6px 0 0; overflow-x:auto; scrollbar-width:none; align-items:stretch; }
.tabs::-webkit-scrollbar { display:none; }
.tabs a { font-family:Archivo, "Segoe UI", sans-serif; font-size:13.5px; font-weight:600; color:var(--header-ink); opacity:.72; text-decoration:none; padding:11px 14px; border-bottom:3px solid transparent; white-space:nowrap; min-height:44px; display:inline-flex; align-items:center; }
.tabs a:hover { opacity:1; background:rgba(255,255,255,.06); }
.tabs a[aria-current="page"] { opacity:1; border-bottom-color:var(--header-ink); }   /* gold stays exclusively "us" */
.tabs .tab-gap { width:1px; margin:12px 8px; background:var(--header-rule); }
.tabs a .badge { display:inline-block; margin-left:6px; font-size:10.5px; padding:1px 7px; border-radius:9px; background:rgba(255,255,255,.18); color:var(--header-ink); font-weight:700; }
.tabs a .badge.warn { background:var(--warn); color:#16201b; }
.tabs a:focus-visible { outline:2px solid var(--header-ink); outline-offset:-2px; }

/* the sticky row: run stepper, compare, options — 44px, on surface-2 so it reads as a bar when stuck */
.ctxbar { position:sticky; top:0; z-index:20; display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:6px 0; background:var(--surface-2); border-bottom:1px solid var(--rule-2); margin:0 -24px 24px; padding-left:24px; padding-right:24px; min-height:44px; }
.ctl { display:flex; flex-direction:column; gap:4px; }
.ctl.row { flex-direction:row; align-items:center; gap:6px; }
.ctl.row > span { margin-right:2px; }
.ctl.grow { flex:1 1 180px; }
.ctl > span { font-family:Archivo, "Segoe UI", sans-serif; font-size:12.5px; font-weight:600; color:var(--ink-3); }
.ctl > small { font-size:12px; color:var(--ink-3); max-width:36ch; line-height:1.35; }
.ctl select, .ctl input { font:inherit; font-size:13.5px; padding:5px 9px; border:1px solid var(--rule-2); border-radius:var(--radius-s); background:var(--surface); color:var(--ink); min-width:130px; height:34px; max-width:100%; }
.ctl input[type="search"] { width:100%; }
.iconbtn.step { min-width:34px; justify-content:center; font-size:16px; padding:0 8px; }
.opt-wrap { position:relative; }
#opt-btn .badge { display:inline-block; margin-left:4px; font-size:10.5px; padding:1px 6px; border-radius:9px; background:var(--accent); color:var(--accent-ink); }
.options { position:absolute; top:calc(100% + 6px); left:0; z-index:40; width:min(420px, calc(100vw - 32px)); background:var(--surface); border:1px solid var(--rule-2); border-radius:var(--radius); box-shadow:var(--shadow); padding:14px 16px 12px; display:grid; gap:14px; }
.options .opt-head { display:flex; justify-content:space-between; align-items:center; font-family:Archivo, "Segoe UI", sans-serif; }
.options .opt-link { font-size:13px; color:var(--accent); }
.opt-chip { border:1px solid var(--rule-2); background:var(--surface); cursor:pointer; }
.opt-chip:hover { border-color:var(--accent); color:var(--accent); }
.warn-text { color:var(--bad-text); font-weight:600; }
.seg { display:inline-flex; border:1px solid var(--rule-2); border-radius:var(--radius-s); overflow:hidden; height:32px; }
.seg button { font-size:12px; font-weight:600; padding:5px 10px; border:0; border-right:1px solid var(--rule-2); background:var(--surface); color:var(--ink-2); cursor:pointer; white-space:nowrap; }
.seg button:last-child { border-right:0; }
.seg button[aria-pressed="true"] { background:var(--accent); color:var(--accent-ink); }
.seg button:hover:not([aria-pressed="true"]) { background:var(--accent-soft); }
.seg.small { height:28px; }
.seg.small button { font-size:11.5px; padding:3px 9px; }
.iconbtn { border:1px solid var(--rule-2); background:var(--surface); color:var(--ink-2); border-radius:var(--radius-s); padding:5px 10px; font-size:12px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; min-height:32px; }
.iconbtn:hover { background:var(--accent-soft); color:var(--accent); }
.iconbtn[disabled] { opacity:.5; cursor:default; }

/* ── page structure ─────────────────────────────────────────────────────── */
.page-head { margin:0 0 20px; display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:8px 24px; }
.page-head h2 { font-family:Archivo, "Segoe UI", sans-serif; font-weight:800; font-size:30px; letter-spacing:-.02em; line-height:1.1; }
.page-head .lede { margin:6px 0 0; color:var(--ink-2); font-size:14.5px; max-width:84ch; line-height:1.55; }
.section { margin:0 0 24px; scroll-margin-top:calc(var(--sticky-h, 44px) + 12px); background:var(--surface); border:1px solid transparent; border-radius:10px; box-shadow:var(--shadow); }
.section.plain { background:var(--surface-2); box-shadow:none; }
.sec-head { display:flex; align-items:center; gap:10px; padding:10px 20px; background:var(--surface-2); border-bottom:1px solid var(--rule); border-radius:10px 10px 0 0; user-select:none; }
.section[data-collapsed="true"] .sec-head { border-bottom:0; border-radius:10px; }
.sec-head h3 { font-family:Archivo, "Segoe UI", sans-serif; font-weight:700; font-size:18px; letter-spacing:-.01em; color:var(--ink); }
.sec-head .sec-sub { font-size:12.5px; color:var(--ink-3); flex:1 1 auto; }
.sec-head .sec-right { margin-left:auto; }
.sec-head .chev { margin-left:auto; width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; color:var(--ink-3); border:0; background:none; cursor:pointer; border-radius:6px; font-size:14px; transition:transform .2s; }
.sec-head .sec-right + .chev { margin-left:0; }
.sec-head .chev:hover { background:var(--surface-3); color:var(--ink); }
.section[data-collapsed="true"] .chev { transform:rotate(-90deg); }
.section[data-collapsed="true"] .sec-body { display:none; }
.sec-body { padding:14px 20px 18px; }
.sec-body > .phone-sub { display:none; }
.sec-body > p.section-sub { margin:0 0 12px; }
.section-sub { margin:0 0 14px; color:var(--ink-2); font-size:13.5px; max-width:90ch; }
.section-title { font-family:Archivo, "Segoe UI", sans-serif; font-weight:600; font-size:18px; letter-spacing:-.01em; margin:0 0 4px; }
.grid-2 { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:16px; }
.grid-3 { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:16px; }
.grid-main { display:grid; grid-template-columns:minmax(0, 2fr) minmax(300px, 1fr); gap:16px; }
@media (max-width: 900px) { .grid-main { grid-template-columns:1fr; } }
.card { background:var(--surface); border:1px solid var(--rule); border-radius:10px; padding:16px 18px 14px; min-width:0; }
.card.inset { background:var(--paper); }
.section .card { box-shadow:none; }
.card-h { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:0 0 8px; flex-wrap:wrap; }
.card-h h3, .card-h h4 { font-family:Archivo, "Segoe UI", sans-serif; font-size:14px; font-weight:600; }
.card-h h4 { color:var(--ink-2); }
.card-h .twin { font-size:12px; color:var(--accent); text-decoration:none; white-space:nowrap; }
.card-h .twin:hover { text-decoration:underline; }
.card-note { font-size:12.5px; color:var(--ink-3); margin:10px 0 0; }
.foot-note { font-size:12px; color:var(--ink-3); margin:10px 0 0; max-width:100ch; }
.empty { color:var(--ink-3); font-size:13.5px; border-left:2px solid var(--rule-2); padding-left:12px; margin:0; }
.busy { opacity:.55; transition:opacity .15s; }
.loading-bar { height:2px; background:linear-gradient(90deg, var(--accent), transparent); animation:load 1.2s linear infinite; }
@keyframes load { from { background-position:-200px 0 } to { background-position:200px 0 } }
@keyframes grow { from { transform:scaleX(0); } to { transform:scaleX(1); } }
@media (prefers-reduced-motion: reduce) { * { transition:none !important; animation:none !important; } }
.err-box { border:1px solid var(--critical); border-radius:var(--radius); padding:14px 16px; background:var(--surface); }
.err-box code { font-size:12px; }

/* ── chips ──────────────────────────────────────────────────────────────── */
.chip { display:inline-flex; align-items:center; gap:4px; font-size:12px; line-height:1; padding:4px 8px; border-radius:999px; background:var(--surface-2); color:var(--ink-2); white-space:nowrap; font-variant-numeric:tabular-nums; }
.chip b { font-weight:600; color:var(--ink); }
.chip.us { background:var(--us-soft); color:var(--ink); border:1px solid var(--us); }
/* deltas: the glyph carries the hue, the number stays in ink (series hues fall under 4.5:1 as text) */
.chip.delta.up, .chip.delta.down { color:var(--ink); }
.chip.delta.up::before { content:"▲"; font-size:9px; color:var(--div-above); }
.chip.delta.down::before { content:"▼"; font-size:9px; color:var(--div-below); }
.chip.good { background:rgba(12,163,12,.12); color:var(--ink); }
.chip.warn { background:rgba(250,178,25,.18); color:var(--ink); }
.chip.hatched { border:1px dashed var(--rule-2); }
.chip.gate { background:var(--surface-3); color:var(--ink-2); }
.chips { display:flex; flex-wrap:wrap; gap:6px; }
/* the one tag that matters: a finding that needs a decision. Good/worth-knowing cards carry no tag —
   the sentence says it, and the quiet rail colour is the only other cue. */
.verdict { display:inline-flex; align-items:center; gap:5px; font-family:Archivo, "Segoe UI", sans-serif; font-size:12px; font-weight:600; padding:2px 8px; border-radius:6px; color:var(--ink); white-space:nowrap; }
.verdict.decide { background:var(--serious); color:#fff; }
.verdict.good { background:var(--good-soft, var(--surface-2)); color:var(--ink); }
.verdict.note { background:var(--surface-2); color:var(--ink-2); }
.i-since { margin-left:auto; font-size:12px; color:var(--ink-3); font-weight:400; }
.i-since.new { color:var(--accent); font-weight:600; }
.pill { display:inline-block; font-size:11px; padding:1px 7px; border-radius:9px; background:var(--surface-2); color:var(--ink-2); white-space:nowrap; }
.pill.sale { background:var(--surface-3); color:var(--ink); }
.pill.new { background:var(--accent-soft); color:var(--accent); }
.pill.us { background:var(--us-soft); color:var(--ink); border:1px solid var(--us); }
.pill.suspect { border:1px solid var(--div-above); color:var(--ink); background:none; }
.pill.smalls { border:1px dashed var(--rule-2); }
.struck { text-decoration:line-through; color:var(--ink-3); margin-right:4px; }

/* ── hero + KPI tiles ──────────────────────────────────────────────────── */
/* the opening paragraph: written like a person's morning note, not a scoreboard */
.hero { padding:18px 22px 14px; border-left:4px solid var(--us); background:var(--surface); box-shadow:var(--shadow); }
.hero.decide { border-left-color:var(--serious); }
.hero .h-eyebrow { font-family:Archivo, "Segoe UI", sans-serif; font-size:13px; font-weight:600; color:var(--ink-3); }
.hero .h-value { font-family:Archivo, "Segoe UI", sans-serif; font-size:20px; font-weight:700; line-height:1.3; margin:8px 0 6px; color:var(--ink); text-wrap:balance; }
.hero .h-value a { color:var(--serious); }
.hero .h-sub { font-size:15px; color:var(--ink); line-height:1.5; margin:6px 0 0; }
.hero .h-line { font-size:15px; margin:8px 0 0; color:var(--ink-2); line-height:1.55; }
.hero .h-line b { color:var(--ink); font-weight:600; }
.hero .h-more { margin-top:10px; font-size:12.5px; color:var(--ink-2); }
.hero .h-more summary { cursor:pointer; color:var(--accent); font-weight:600; }
.hero .h-more ul { margin:6px 0 0; padding-left:18px; }
.hero .h-delta { font-size:12.5px; color:var(--ink-2); margin:8px 0 0; display:flex; flex-wrap:wrap; gap:6px 12px; }
.hero .h-spark { margin-top:10px; }
.hero .h-spark svg { display:block; width:100%; height:52px; overflow:visible; }
.hero .h-foot { font-size:11.5px; color:var(--ink-3); margin-top:8px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:12px; }
.tile { background:var(--surface); border:1px solid var(--rule); border-radius:var(--radius); padding:12px 14px 10px; display:grid; grid-template-columns:1fr auto; gap:2px 10px; }
.tile.hero { grid-column:span 2; }
.tile .t-label { grid-column:1 / -1; font-size:12.5px; color:var(--ink-2); }
.tile .t-value { font-family:Archivo, "Segoe UI", sans-serif; font-size:28px; font-weight:600; line-height:1.05; color:var(--ink); }
.tile.hero .t-value { font-size:44px; }
.tile .t-delta { font-size:12.5px; color:var(--ink-2); align-self:end; text-align:right; }
.tile .t-delta.up { color:var(--good-text); }
.tile .t-delta.down { color:var(--bad-text); }
.tile .t-spark { grid-column:1 / -1; margin-top:6px; }
.tile .t-note { grid-column:1 / -1; font-size:11.5px; color:var(--ink-3); }
.tile svg { display:block; width:100%; height:36px; overflow:visible; }
.kpi { background:var(--surface); border:1px solid transparent; box-shadow:var(--shadow); border-radius:10px; padding:14px 16px 12px; cursor:pointer; text-align:left; color:inherit; font:inherit; min-width:0; display:flex; flex-direction:column; }
.kpi:hover { border-color:var(--rule-2); }
.kpi.active { border-color:var(--us); box-shadow:inset 0 0 0 1px var(--us), var(--shadow); }
.kpi .k-cap { font-family:Archivo, "Segoe UI", sans-serif; font-size:12.5px; font-weight:600; color:var(--ink-2); display:flex; justify-content:space-between; gap:8px; }
.kpi .k-val { font-family:Archivo, "Segoe UI", sans-serif; font-size:30px; font-weight:700; line-height:1.05; margin:6px 0 6px; letter-spacing:-.01em; }
.kpi .k-val small { font-size:14px; color:var(--ink-3); font-weight:500; margin-left:4px; }
.kpi .k-chips { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:6px; }
.kpi .k-spark { margin-top:auto; padding-top:8px; }
.kpi .k-spark svg { display:block; width:100%; height:32px; overflow:visible; }
.kpi .k-pol { font-size:13px; color:var(--ink-2); line-height:1.4; }
.kpi.none .k-val { color:var(--ink-3); font-size:20px; }

/* ── overview composition ─────────────────────────────────────────────── */
.ov { display:grid; grid-template-columns:repeat(12, minmax(0, 1fr)); gap:16px; }
.ov .ov-hero { grid-column:span 7; }
.ov .ov-moved { grid-column:span 5; }
.ov .ov-tiles { grid-column:1 / -1; display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; align-content:start; }
.ov .ov-wide { grid-column:1 / -1; }
.ov .ov-half { grid-column:span 6; }
.ov .section { margin:0; }
.ov .ov-moved .section, .ov .ov-moved .sec-body { height:100%; }
.ov .ev-name.wrap { white-space:normal; font-weight:500; }
@media (max-width: 1100px) {
  .ov .ov-hero, .ov .ov-moved, .ov .ov-half { grid-column:1 / -1; }
  .ov .ov-tiles { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) { .ov .ov-tiles { grid-template-columns:1fr; } }

/* ── insight cards ─────────────────────────────────────────────────────── */
.insights { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:12px; }
.insight { background:var(--surface); border:1px solid var(--rule); border-left:5px solid var(--rule-2); border-radius:10px; padding:12px 14px; }
.insight.decide { border-left-color:var(--serious); }
.insight.good { border-left-color:var(--good); }
.insight.note { border-left-color:var(--warn); }
.insight .i-kicker { font-family:Archivo, "Segoe UI", sans-serif; font-size:12px; font-weight:600; color:var(--ink-3); margin-bottom:6px; display:flex; gap:8px; align-items:center; }
.insight .i-head { font-size:14.5px; line-height:1.4; margin:0; }
.insight .i-head strong { font-weight:600; }
.insight .i-foot { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-top:8px; }
.insight .i-link { font-size:12px; color:var(--accent); text-decoration:none; }
.insight .i-math { border:0; background:none; color:var(--ink-3); font-size:11.5px; cursor:pointer; padding:0; font-family:"IBM Plex Mono", Consolas, monospace; }
.insight .i-math:hover { color:var(--accent); text-decoration:underline; }
.trace { margin-top:8px; padding:8px 10px; background:var(--paper); border-radius:var(--radius-s); font-size:12px; color:var(--ink-2); }
.trace .tr-h { font-family:"IBM Plex Mono", Consolas, monospace; font-size:11px; color:var(--ink-3); margin-bottom:4px; }
.trace .tr-cells { margin:0 0 6px; padding-left:16px; }
.trace .tr-cells li { margin:1px 0; }
.trace .tr-cells code { font-size:11px; }
.trace .tr-cells code.muted { color:var(--ink-3); }
.trace .tr-vals { display:grid; grid-template-columns:auto 1fr; gap:1px 10px; margin:0; }
.trace .tr-vals dt { color:var(--ink-3); font-family:"IBM Plex Mono", Consolas, monospace; font-size:11px; }
.trace .tr-vals dd { margin:0; font-variant-numeric:tabular-nums; }
.trace .tr-rows { color:var(--ink-3); margin-top:4px; }

/* ── bullet rows ───────────────────────────────────────────────────────── */
.bullets { display:grid; gap:2px; }
.bullet { display:grid; grid-template-columns:minmax(120px, 190px) 1fr auto; gap:0 12px; align-items:center; min-height:36px; padding:2px 6px; border-radius:var(--radius-s); }
.bullet:hover, .bullet:focus-visible { background:var(--surface-2); outline:none; }
.bullet .b-label { font-size:13px; color:var(--ink); display:flex; flex-direction:column; line-height:1.2; }
.bullet .b-label small { color:var(--ink-3); font-size:11px; }
.bullet .b-track { position:relative; height:26px; }
.bullet .b-track::before { content:""; position:absolute; left:0; right:0; top:9px; height:8px; background:var(--surface-3); border-radius:4px; }
.bullet .b-parity { position:absolute; top:7px; height:12px; background:var(--surface-2); border:1px dashed var(--rule-2); border-radius:3px; }
.bullet .b-band { position:absolute; top:9px; height:8px; background:var(--field); opacity:.55; border-radius:4px; }
.bullet .b-tick { position:absolute; top:4px; width:2px; height:18px; margin-left:-1px; background:var(--reference); }
.bullet .b-tick.field { background:repeating-linear-gradient(180deg, var(--reference) 0 3px, transparent 3px 5px); }
.bullet .b-dot { position:absolute; top:8px; width:10px; height:10px; margin-left:-5px; border-radius:50%; background:var(--us); box-shadow:0 0 0 2px var(--surface), 0 0 0 3px var(--us-ring); }
.bullet .b-axis { position:absolute; left:0; right:0; top:-2px; display:flex; justify-content:space-between; font-size:9.5px; color:var(--ink-4); pointer-events:none; }
.bullet .b-none { font-size:12px; color:var(--ink-3); padding:4px 0 0 4px; }
.bullet.hatched .b-track::before { background-image:repeating-linear-gradient(45deg, transparent 0 3px, var(--hatch) 3px 4px); }
.bullet .b-right { display:flex; gap:4px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.bullet .b-val { font-family:Archivo, "Segoe UI", sans-serif; font-weight:600; font-size:14px; min-width:64px; text-align:right; }
.bullet-legend { display:flex; flex-wrap:wrap; gap:14px; font-size:11.5px; color:var(--ink-3); margin-top:8px; }
.bullet-legend i { display:inline-block; vertical-align:middle; margin-right:5px; }
.bullet-legend .l-band { width:16px; height:8px; background:var(--field); opacity:.55; border-radius:4px; }
.bullet-legend .l-sheet { width:2px; height:14px; background:var(--reference); }
.bullet-legend .l-field { width:2px; height:14px; background:repeating-linear-gradient(180deg, var(--reference) 0 3px, transparent 3px 5px); }
.bullet-legend .l-us { width:10px; height:10px; border-radius:50%; background:var(--us); box-shadow:0 0 0 2px var(--surface), 0 0 0 3px var(--us-ring); }
.bullet-legend .l-parity { width:16px; height:10px; background:var(--surface-2); border:1px dashed var(--rule-2); }

/* ── charts ────────────────────────────────────────────────────────────── */
.legend { display:flex; flex-wrap:wrap; gap:14px; font-size:12px; color:var(--ink-2); margin:0 0 10px; }
.legend span { display:inline-flex; align-items:center; gap:6px; }
.legend i { display:inline-block; width:14px; height:2px; border-radius:1px; background:currentColor; }
.legend i.bar { height:10px; width:10px; border-radius:2px; }
.legend i.series, .legend i.us { background:var(--us); }
.legend i.context, .legend i.field { background:var(--field); }
.legend i.reference { background:var(--reference); }
.legend i.dashed { background:repeating-linear-gradient(90deg, var(--reference) 0 3px, transparent 3px 5px); }
.legend i.alt1, .legend i.cat2 { background:var(--cat2); }
.legend i.alt2, .legend i.cat3 { background:var(--cat3); }
.legend i.above { background:var(--div-above); }
.legend i.below { background:var(--div-below); }
.legend i.hatch { height:10px; width:14px; background-image:repeating-linear-gradient(45deg, transparent 0 3px, var(--hatch) 3px 4px); border:1px solid var(--rule-2); }

.bars { display:grid; grid-template-columns:auto 1fr auto; gap:4px 10px; align-items:center; font-size:13px; }
.bars .name { color:var(--ink-2); white-space:nowrap; display:flex; align-items:center; gap:6px; }
.bars .name.focus { color:var(--ink); font-weight:600; }
.bars .name small { color:var(--ink-3); font-size:11px; }
.bars .track { position:relative; height:24px; }
.bars .bar { position:absolute; left:0; top:5px; height:14px; background:var(--field); border-radius:0 4px 4px 0; transform-origin:left; animation:grow .3s ease-out; }
.bars .bar.focus { background:var(--us); box-shadow:inset 0 0 0 2px var(--us-ring); }
.bars .name.focus { border-left:4px solid var(--us); padding-left:6px; margin-left:-10px; }
.bars .bar.dim { opacity:.45; }
.bars .bar.hatch { background-image:repeating-linear-gradient(45deg, transparent 0 3px, var(--hatch) 3px 4px); }
.bars .track:hover .bar, .bars .track:focus-visible .bar { filter:brightness(1.06); }
.bars .track:focus-visible { outline:none; }
.bars .ref { position:absolute; top:1px; bottom:1px; width:2px; margin-left:-1px; background:var(--reference); }
.bars .ref.dashed { background:repeating-linear-gradient(180deg, var(--reference) 0 3px, transparent 3px 5px); }
.bars .ref-label { position:absolute; top:-14px; font-size:9.5px; color:var(--ink-3); transform:translateX(-50%); white-space:nowrap; }
.bars .val { font-variant-numeric:tabular-nums; color:var(--ink); text-align:right; white-space:nowrap; display:flex; gap:6px; align-items:center; justify-content:flex-end; }
.bars .val.none { color:var(--ink-3); }
.bars .val small { color:var(--ink-3); font-size:11px; }
.bars.compact .track { height:18px; }
.bars.compact .bar { top:3px; height:12px; }

svg .grid { stroke:var(--viz-grid); stroke-width:1; }
svg .refline { stroke:var(--reference); stroke-width:1.5; }
svg .refline.dashed { stroke-dasharray:4 3; }
svg .ytick, svg .xtick { fill:var(--viz-muted); font-size:9.5px; font-family:inherit; }
svg .quad { fill:var(--viz-muted); font-size:10px; font-family:Archivo, "Segoe UI", sans-serif; font-weight:600; letter-spacing:.04em; text-transform:uppercase; }
svg .line { fill:none; stroke:var(--us); stroke-width:2.5; stroke-linejoin:round; stroke-linecap:round; }
svg .line.ref { stroke:var(--reference); stroke-width:1.5; stroke-dasharray:4 3; }
svg .line.field { stroke:var(--field); stroke-width:1.5; }
svg .line.ctx { stroke:var(--field); stroke-width:1.5; opacity:.7; }
svg .line.roll { stroke:var(--reference); stroke-width:1; stroke-dasharray:2 3; }
svg .line.alt1, svg .line.cat2 { stroke:var(--cat2); stroke-width:2; }
svg .line.alt2, svg .line.cat3 { stroke:var(--cat3); stroke-width:2; }
svg .area { fill:var(--us-soft); }
svg .dot { fill:var(--us); stroke:var(--viz-surface); stroke-width:2; }
svg .dot.ref { fill:var(--reference); }
svg .dot.field { fill:var(--field); }
svg .dot.ctx { fill:var(--field); }
svg .dot.alt1, svg .dot.cat2 { fill:var(--cat2); }
svg .dot.alt2, svg .dot.cat3 { fill:var(--cat3); }
svg .dot.focus { fill:var(--us); stroke:var(--us-ring); }
svg .dot.sale { stroke:var(--ink); stroke-dasharray:2 1; }
svg .dot.suspect { stroke:var(--div-above); stroke-width:2; }
svg .dot.hollow { fill:var(--viz-surface); stroke:var(--field); }
svg .dot.hollow.focus { stroke:var(--us); }
svg .xhair { stroke:var(--viz-axis); stroke-width:1; }
svg .hit { fill:transparent; cursor:crosshair; }
svg .endlabel { fill:var(--viz-text); font-size:10px; font-weight:600; font-family:inherit; }
svg .statmark { stroke:var(--viz-text-2); stroke-width:2; }
svg .statmark.focus { stroke:var(--us); }
svg .slabel { fill:var(--viz-text-2); font-size:10.5px; font-family:inherit; }
svg .slabel.focus { fill:var(--viz-text); font-weight:600; }
svg .hbar.ctx { fill:var(--field); }
svg .hbar.focus { fill:var(--us); }
svg .sdot.ctx { fill:var(--field); stroke:var(--viz-surface); stroke-width:1.5; }
svg .sdot.focus { fill:var(--us); stroke:var(--us-ring); stroke-width:2; }
svg .dlink { stroke:var(--field); stroke-width:2; }
svg .dlink.up { stroke:var(--div-above); }
svg .dlink.down { stroke:var(--div-below); }
svg .dlink.focus { stroke-width:3; }
svg .band { fill:var(--surface-2); }
svg .slope-row .line.ctx { opacity:.45; }
svg .slope-row .line.up { stroke:var(--div-above); opacity:1; stroke-width:2; }
svg .slope-row .line.down { stroke:var(--div-below); opacity:1; stroke-width:2; }
svg .slope-row .line.series { stroke:var(--us); }
svg .slope-row .dot.up { fill:var(--div-above); }
svg .slope-row .dot.down { fill:var(--div-below); }
svg .step { fill:none; stroke:var(--us); stroke-width:2; }
.linechart, .strip, .slope, .hist, .scatter { display:block; width:100%; height:auto; overflow:visible; }
.scatter { max-width:760px; }

svg.strip, svg.linechart, svg.scatter, svg.hist, svg.spark { min-width:0; max-width:100%; }
svg.slope { min-width:0; max-width:min(560px, 100%); }   /* the before/after chart must not scale to the section width */
.strip-row { display:grid; grid-template-columns:120px minmax(0, 1fr) auto; gap:10px; align-items:center; margin:2px 0; min-width:0; }
.strip-row > * { min-width:0; }
@media (max-width: 767px) { .strip-row { grid-template-columns:1fr; gap:4px; } }
.strip-wrap { display:grid; grid-template-columns:auto minmax(0, 1fr); gap:0 10px; align-items:start; }
.strip-labels { padding-top:var(--top); display:grid; grid-auto-rows:var(--row); }
.strip-label { font-size:12.5px; color:var(--ink-2); line-height:var(--row); white-space:nowrap; }
.strip-label.focus { color:var(--ink); font-weight:600; }
.strip-svg { min-width:0; }

.facets { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px; }
.facet { background:var(--surface); border:1px solid var(--rule); border-radius:var(--radius-s); padding:10px 10px 6px; min-height:120px; }
.facet h4 { margin:0 0 2px; font-size:13px; font-weight:600; color:var(--ink); display:flex; justify-content:space-between; gap:8px; }
.facet h4 .last { font-weight:500; color:var(--ink-2); font-variant-numeric:tabular-nums; }
.facet.focus { border-color:var(--us); background:var(--us-soft); }
.facet svg { display:block; width:100%; height:auto; overflow:visible; }
.facet .axis-x { display:flex; justify-content:space-between; font-size:10.5px; color:var(--ink-3); margin-top:2px; }

.stack100 { display:grid; grid-template-columns:auto 1fr auto; gap:3px 10px; align-items:center; font-size:12.5px; }
.stack100 .st-label { color:var(--ink-2); white-space:nowrap; }
.stack100 .st-label.focus { color:var(--ink); font-weight:600; }
.stack100 .st-label small { color:var(--ink-3); }
.stack100 .st-bar { display:flex; gap:2px; height:16px; }
.stack100 .st-seg { height:100%; border-radius:2px; color:#fff; font-size:10px; line-height:16px; text-align:center; overflow:hidden; min-width:0; }
.stack100 .st-seg.o1 { background:var(--ord-1); color:var(--ord-ink-1); }
.stack100 .st-seg.o2 { background:var(--ord-2); color:var(--ord-ink-2); }
.stack100 .st-seg.o3 { background:var(--ord-3); color:var(--ord-ink-3); }
.stack100 .st-seg.o4 { background:var(--ord-4); color:var(--ord-ink-4); }
.stack100 .st-val { font-variant-numeric:tabular-nums; color:var(--ink-2); white-space:nowrap; text-align:right; }
.stack100 .st-bar.ref { opacity:.7; }
.ord-legend i.o1 { background:var(--ord-1); } .ord-legend i.o2 { background:var(--ord-2); } .ord-legend i.o3 { background:var(--ord-3); } .ord-legend i.o4 { background:var(--ord-4); }

.heat { overflow-x:auto; }
.heat table { border-collapse:separate; border-spacing:2px; font-size:12px; }
.heat th { font-family:Archivo, "Segoe UI", sans-serif; font-size:10px; font-weight:600; color:var(--ink-2); text-align:left; padding:2px 4px; vertical-align:bottom; line-height:1.2; position:sticky; top:0; background:var(--surface); z-index:2; }
.heat th.col { writing-mode:vertical-rl; transform:rotate(180deg); text-align:left; height:110px; white-space:nowrap; }
.heat td { padding:0; }
.heat .cell { min-width:64px; height:32px; display:flex; align-items:center; justify-content:center; gap:3px; font-family:"IBM Plex Mono", Consolas, monospace; font-size:12px; font-variant-numeric:tabular-nums; border-radius:2px; color:var(--ink); background:var(--surface); border:1px solid var(--viz-grid); cursor:default; }
.heat .cell small { font-size:9px; color:inherit; opacity:.75; }
.heat .cell.empty { color:var(--ink-3); border-style:dashed; }
.heat .cell.sq0 { background:var(--seq-0); color:var(--seq-ink-0); } .heat .cell.sq1 { background:var(--seq-1); color:var(--seq-ink-1); } .heat .cell.sq2 { background:var(--seq-2); color:var(--seq-ink-2); }
.heat .cell.sq3 { background:var(--seq-3); color:var(--seq-ink-3); } .heat .cell.sq4 { background:var(--seq-4); color:var(--seq-ink-4); } .heat .cell.sq5 { background:var(--seq-5); color:var(--seq-ink-5); }
.heat .cell.dvm3 { background:var(--div-below); color:#fff; } .heat .cell.dvm2 { background:var(--div-below-2); color:var(--ink); } .heat .cell.dvm1 { background:var(--div-below-1); color:var(--ink); }
.heat .cell.dv0 { background:var(--div-mid); color:var(--ink); }
.heat .cell.dvp1 { background:var(--div-above-1); color:var(--ink); } .heat .cell.dvp2 { background:var(--div-above-2); color:var(--ink); } .heat .cell.dvp3 { background:var(--div-above); color:#fff; }
.heat .cell.lo { box-shadow:inset 0 0 0 2px var(--div-below); }
.heat .cell.hi { box-shadow:inset 0 0 0 2px var(--div-above); }
.heat .cell.hatch { background-image:repeating-linear-gradient(45deg, transparent 0 3px, var(--hatch) 3px 4px); border-style:dashed; }
.heat .cell:hover, .heat .cell:focus-visible { outline:2px solid var(--viz-text); outline-offset:-2px; }
.heat .row-name { font-weight:600; color:var(--ink); padding-right:8px; white-space:nowrap; position:sticky; left:0; background:var(--surface); z-index:1; }
.heat .row-name.focus { color:var(--ink); border-left:3px solid var(--us); padding-left:6px; }
.heat .totals .cell { font-weight:600; border-color:var(--viz-axis); }
.heat tr.hl td .cell, .heat td.hl .cell { filter:brightness(.94); }
.ramp { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--ink-2); margin:10px 0 0; flex-wrap:wrap; }
.ramp i { display:inline-block; width:22px; height:10px; border-radius:2px; }
.ramp i.sq0 { background:var(--seq-0); } .ramp i.sq1 { background:var(--seq-1); } .ramp i.sq2 { background:var(--seq-2); } .ramp i.sq3 { background:var(--seq-3); } .ramp i.sq4 { background:var(--seq-4); } .ramp i.sq5 { background:var(--seq-5); }
.ramp i.dvm3 { background:var(--div-below); } .ramp i.dvm2 { background:var(--div-below-2); } .ramp i.dvm1 { background:var(--div-below-1); } .ramp i.dv0 { background:var(--div-mid); border:1px solid var(--rule-2); } .ramp i.dvp1 { background:var(--div-above-1); } .ramp i.dvp2 { background:var(--div-above-2); } .ramp i.dvp3 { background:var(--div-above); }
.ramp i.lo { box-shadow:inset 0 0 0 2px var(--div-below); background:none; } .ramp i.hi { box-shadow:inset 0 0 0 2px var(--div-above); background:none; }

.cal table { border-collapse:separate; border-spacing:2px; }
.cal th { font-size:10px; color:var(--ink-3); font-weight:600; text-align:left; padding:0 2px; white-space:nowrap; }
.cal th.cal-d { font-family:"IBM Plex Mono", Consolas, monospace; font-weight:400; }
.cal .cal-cell { width:14px; height:14px; border-radius:2px; background:var(--surface-2); }
.cal .cal-cell.lv0 { background:var(--seq-0); } .cal .cal-cell.lv1 { background:var(--seq-1); } .cal .cal-cell.lv2 { background:var(--seq-2); } .cal .cal-cell.lv3 { background:var(--seq-3); } .cal .cal-cell.lv4 { background:var(--seq-4); } .cal .cal-cell.lv5 { background:var(--seq-5); }
.cal .cal-cell.missing { background-image:repeating-linear-gradient(45deg, transparent 0 2px, var(--hatch) 2px 3px); }
.cal .cal-cell.none { background:var(--surface-2); }
.runs-cal { display:flex; flex-wrap:wrap; gap:2px; }
.runs-cal i { width:10px; height:14px; border-radius:2px; background:var(--seq-3); display:block; }
.runs-cal i.miss { background:var(--surface-3); background-image:repeating-linear-gradient(45deg, transparent 0 2px, var(--hatch) 2px 3px); }
.runs-cal i.few { background:var(--seq-1); }

/* ── data tables ───────────────────────────────────────────────────────── */
.dt-wrap { overflow-x:auto; max-height:70vh; }
.dt { width:100%; border-collapse:collapse; font-size:13px; }
.dt th { text-align:left; font-family:Archivo, "Segoe UI", sans-serif; font-size:12px; font-weight:600; color:var(--ink-3); padding:6px 8px; border-bottom:1.5px solid var(--rule-2); white-space:nowrap; cursor:pointer; user-select:none; position:sticky; top:0; background:var(--surface); z-index:2; }
.dt th.num, .dt td.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.dt th[aria-sort] { color:var(--accent); }
.dt td { padding:6px 8px; border-bottom:1px solid var(--rule); vertical-align:middle; height:32px; }
.dt td:first-child, .dt th:first-child { position:sticky; left:0; background:var(--surface); z-index:1; }
.dt th:first-child { z-index:3; }
.dt tr.focus td { background:var(--us-soft); }
.dt tr.focus td.store { color:var(--ink); font-weight:600; box-shadow:inset 4px 0 0 var(--us); }
.dt td.store { font-weight:600; white-space:nowrap; }
.dt td.muted { color:var(--ink-3); }
.dt td.lo { box-shadow:inset 2px 0 0 var(--div-below); }
.dt td.hi { box-shadow:inset 2px 0 0 var(--div-above); }
.dt td.hatch { background-image:repeating-linear-gradient(45deg, transparent 0 3px, var(--hatch) 3px 4px); color:var(--ink-3); }
.dt tr:hover td { background:var(--accent-soft); }
.dt tr.ref td { color:var(--ink-2); font-style:italic; border-top:1.5px solid var(--rule-2); }
.dt .dbar { position:relative; height:12px; width:120px; display:inline-block; vertical-align:middle; }
.dt .dbar i { position:absolute; top:2px; height:8px; border-radius:2px; }
.dt .dbar i.pos { background:var(--div-above); left:50%; }
.dt .dbar i.neg { background:var(--div-below); right:50%; }
.dt .dbar::before { content:""; position:absolute; left:50%; top:0; bottom:0; width:1px; background:var(--viz-axis); }
.dt .rbar { display:inline-block; height:8px; background:var(--field); border-radius:0 3px 3px 0; vertical-align:middle; margin-right:6px; }
.dt .rbar.focus { background:var(--us); }
.dt-tools { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; margin:0 0 10px; font-size:12.5px; color:var(--ink-2); }
.dt-tools input[type="search"] { font:inherit; font-size:13px; padding:5px 9px; border:1px solid var(--rule-2); border-radius:var(--radius-s); background:var(--surface); color:var(--ink); min-width:220px; }
.dt-tools label { display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.dt-tools select { font:inherit; font-size:12.5px; padding:3px 6px; border:1px solid var(--rule-2); border-radius:var(--radius-s); background:var(--surface); color:var(--ink); }
.dt-foot { font-size:12px; color:var(--ink-3); margin:8px 0 0; display:flex; gap:8px; align-items:center; }
.filters { display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center; margin:0 0 12px; font-size:12.5px; }
.filters .fchip { border:1px solid var(--rule-2); background:var(--surface); color:var(--ink-2); border-radius:999px; padding:3px 10px; cursor:pointer; font-size:12px; }
.filters .fchip[aria-pressed="true"] { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }

/* ── rows-behind-the-cell ─────────────────────────────────────────────── */
.rows-store { border:1px solid var(--rule); border-radius:var(--radius-s); margin:0 0 8px; background:var(--surface); }
.rows-store > summary { list-style:none; cursor:pointer; display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; padding:8px 12px; font-size:13.5px; }
.rows-store > summary::-webkit-details-marker { display:none; }
.rows-store > summary b { font-weight:600; }
.rows-store.focus > summary { border-left:3px solid var(--us); }
.rows-store .rows-body { padding:0 12px 12px; }
.trace-badge { display:inline-flex; gap:6px; align-items:center; font-family:"IBM Plex Mono", Consolas, monospace; font-size:11px; padding:2px 8px; border-radius:999px; border:1px solid var(--good); color:var(--ink-2); }
.trace-badge.bad { border-color:var(--critical); color:var(--bad-text); font-weight:600; }
.trace-badge.na { border-color:var(--rule-2); color:var(--ink-3); }

/* ── event feed ────────────────────────────────────────────────────────── */
.feed { display:grid; gap:2px; }
.ev { display:grid; grid-template-columns:auto 1fr auto; gap:2px 12px; align-items:center; padding:6px 10px; border-radius:var(--radius-s); font-size:13px; min-height:36px; }
.ev:hover { background:var(--surface-2); }
.ev.missing { background:var(--surface-3); }
.ev .ev-type { font-family:Archivo, "Segoe UI", sans-serif; font-size:11.5px; font-weight:600; color:var(--ink-3); padding:2px 7px; border-radius:6px; background:var(--surface-2); white-space:nowrap; }
.ev .ev-type.up { background:var(--div-above-1); color:var(--ink); } .ev .ev-type.down { background:var(--div-below-1); color:var(--ink); }
.ev .ev-main { min-width:0; }
.ev .ev-name { font-weight:600; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ev .ev-name small { font-weight:400; color:var(--ink-3); }
.ev .ev-sub { font-size:12px; color:var(--ink-2); display:flex; flex-wrap:wrap; gap:4px 8px; }
.ev .ev-delta { font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; }
.ev .ev-delta.up, .ev .ev-delta.down { color:var(--ink); }
.ev .ev-delta.up::before { content:"▲ "; color:var(--div-above); font-size:9px; } .ev .ev-delta.down::before { content:"▼ "; color:var(--div-below); font-size:9px; }
.ev-group { margin:0 0 14px; }
.ev-group h4 { font-family:Archivo, "Segoe UI", sans-serif; font-size:13px; font-weight:600; margin:0 0 4px; display:flex; gap:8px; align-items:baseline; }
.ev-group h4 small { color:var(--ink-3); font-weight:400; }
.ev.us { box-shadow:inset 4px 0 0 var(--us); background:var(--us-soft); }
.alerts { background:color-mix(in srgb, var(--warn) 12%, var(--surface)); border-left-width:5px; }

/* ── standing strip ────────────────────────────────────────────────────── */
.standing { display:flex; flex-wrap:wrap; gap:8px 24px; align-items:baseline; padding:14px 20px; }
.standing .s-main { font-family:Archivo, "Segoe UI", sans-serif; font-size:36px; font-weight:700; line-height:1.05; letter-spacing:-.01em; cursor:help; }
.standing .s-main small { font-size:14px; color:var(--ink-2); font-weight:500; margin-left:6px; font-family:"Source Sans 3", "Segoe UI", sans-serif; }
.standing .s-facts { font-size:14px; color:var(--ink-2); display:flex; flex-wrap:wrap; gap:4px 12px; }
.standing .s-facts b { color:var(--ink); font-weight:600; }
.standing .s-chips { display:flex; flex-wrap:wrap; gap:6px; width:100%; }
.s-delta { width:100%; font-size:12.5px; color:var(--ink-2); display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; margin-top:8px; }
.s-delta > span { display:inline-flex; align-items:center; gap:4px; }
.standing .s-foot { width:100%; font-size:11.5px; color:var(--ink-3); }
.standing.two { display:grid; grid-template-columns:1fr 1fr; gap:16px 24px; }
.standing.two > div { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:baseline; }
.standing.two h4 { width:100%; font-family:Archivo, "Segoe UI", sans-serif; font-size:13.5px; font-weight:600; color:var(--ink-2); }
@media (max-width: 767px) { .standing.two { grid-template-columns:1fr; } }

/* ── the sheet (faithful render) ───────────────────────────────────────── */
.plate { margin:0 0 40px; }
.plate-head { margin-bottom:10px; }
.plate-head .eyebrow { display:flex; gap:10px; align-items:center; }
.rng { font-family:"IBM Plex Mono", Consolas, monospace; font-weight:400; letter-spacing:.02em; text-transform:none; color:var(--ink-3); }
.plate h3 { font-family:Archivo, "Segoe UI", sans-serif; font-weight:600; font-size:19px; letter-spacing:-.01em; }
.block-label { font-family:Archivo, "Segoe UI", sans-serif; font-size:13px; font-weight:600; color:var(--ink-2); margin:16px 0 6px; padding-bottom:4px; border-bottom:1px solid var(--rule); }
.scroll { overflow-x:auto; border:1px solid var(--rule-2); background:var(--surface); border-radius:var(--radius); }
.sheet table { border-collapse:separate; border-spacing:0; width:100%; }
.sheet th, .sheet td { padding:5px 8px; text-align:right; white-space:nowrap; border-bottom:1px solid var(--rule); border-right:1px solid var(--rule); font-variant-numeric:tabular-nums; }
.sheet th { font-family:Archivo, "Segoe UI", sans-serif; font-size:10.5px; font-weight:600; line-height:1.25; letter-spacing:.03em; color:var(--ink-2); vertical-align:bottom; background:var(--surface-2); border-bottom:1.5px solid var(--rule-2); position:sticky; top:0; z-index:3; }
.sheet th.tint { background:var(--tint); }
.sheet td { font-family:"IBM Plex Mono", Consolas, monospace; font-size:12.5px; }
.sheet th.stub, .sheet td.stub { text-align:left; position:sticky; left:0; z-index:2; background:var(--surface-2); border-right:1.5px solid var(--rule-2); font-family:Archivo, "Segoe UI", sans-serif; font-size:12.5px; font-weight:600; color:var(--ink); }
.sheet th.stub { z-index:4; }
.sheet th.gap, .sheet td.gap { width:10px; padding:0; background:var(--paper); }
.sheet tbody tr:hover td:not(.scaled):not(.gap) { background:var(--accent-soft); }
.sheet tr.totals td { border-top:1.5px solid var(--rule-2); background:var(--surface-2); font-weight:600; border-bottom:none; }
.sheet td.scaled { background:var(--sc); color:var(--scale-ink); font-weight:500; }
.sheet td.na { color:var(--ink-3); font-style:italic; font-size:11.5px; }
.sheet td.err { color:var(--bad-text); font-weight:600; }
.sheet td.blank { color:var(--rule-2); }
.sheet tr.focus td { background:var(--us-soft); }
.sheet tr.focus td.stub { color:var(--ink); box-shadow:inset 4px 0 0 var(--us); }
body.show-f .sheet td[data-f] { position:relative; padding-bottom:16px; }
body.show-f .sheet td[data-f]::after { content:attr(data-f); position:absolute; left:8px; right:8px; bottom:2px; font-size:8.5px; line-height:1.1; color:var(--ink-3); text-align:right; overflow:hidden; text-overflow:ellipsis; }
body.show-f .sheet td.scaled::after { color:var(--scale-ink); opacity:.72; }
.note { margin:10px 0 0; font-size:13px; color:var(--ink-2); max-width:90ch; border-left:2px solid var(--rule-2); padding-left:12px; }
.toggle { display:inline-flex; align-items:center; gap:6px; font-weight:600; font-size:13px; cursor:pointer; }
.toggle input { accent-color:var(--accent); }

/* ── alerts, methods ───────────────────────────────────────────────────── */
.alerts { border:1px solid var(--rule-2); border-left:3px solid var(--warn); border-radius:var(--radius); background:var(--surface); padding:10px 14px; font-size:13px; }
.alerts h4 { font-family:Archivo, "Segoe UI", sans-serif; font-size:13px; font-weight:600; color:var(--ink-2); margin:0 0 6px; }
.alerts ul { margin:0; padding-left:18px; color:var(--ink-2); }
.alerts li { margin:2px 0; }
.pinned { border:1px dashed var(--rule-2); border-radius:var(--radius-s); padding:8px 12px; font-size:12.5px; color:var(--ink-2); background:var(--paper); }
.focus-banner { border:1px solid var(--us); border-left:4px solid var(--us); background:var(--us-soft); color:var(--ink); font-size:13.5px; margin:0 0 16px; }
.focus-banner a { margin-left:6px; white-space:nowrap; }
.methods dl { display:grid; grid-template-columns:minmax(120px, 220px) 1fr; gap:6px 16px; margin:0; font-size:13.5px; }
.methods dt { font-weight:600; color:var(--ink); }
.methods dd { margin:0; color:var(--ink-2); }
.methods dd code { font-size:12px; }
.rule-table td { vertical-align:top; }
.rule-table td.rule-id { font-family:"IBM Plex Mono", Consolas, monospace; font-weight:600; white-space:nowrap; }
.prose { font-size:14px; color:var(--ink-2); max-width:90ch; }
.prose b { color:var(--ink); }
.prose ul { padding-left:20px; margin:6px 0; }
.kv { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:13px; color:var(--ink-2); }
.kv b { color:var(--ink); font-weight:600; }

/* ── tooltip ───────────────────────────────────────────────────────────── */
.tip { position:fixed; z-index:50; pointer-events:none; max-width:320px; background:var(--ink); color:var(--paper); border-radius:6px; padding:8px 10px; font-size:12.5px; line-height:1.35; box-shadow:0 6px 20px -8px rgba(0,0,0,.5); }
.tip .tip-h { font-weight:600; margin-bottom:4px; opacity:.9; }
.tip .tip-row { display:flex; justify-content:space-between; gap:14px; }
.tip .tip-row b { font-weight:600; font-variant-numeric:tabular-nums; }
.tip .tip-row span { display:inline-flex; align-items:center; gap:6px; opacity:.85; }
.tip .tip-row i { display:inline-block; width:12px; height:2px; background:currentColor; }
.tip .tip-row i.series, .tip .tip-row i.us { background:var(--us); }
.tip .tip-row i.reference { background:var(--reference); }
.tip .tip-row i.alt1, .tip .tip-row i.cat2 { background:var(--cat2); }
.tip .tip-row i.alt2, .tip .tip-row i.cat3 { background:var(--cat3); }
@media (max-width: 767px) {
  .tip { left:8px !important; right:8px; top:auto !important; bottom:8px; max-width:none; pointer-events:auto; }   /* tappable, so a tap on it closes it */
}

footer { border-top:1px solid var(--rule); padding-top:16px; margin-top:24px; font-size:12.5px; color:var(--ink-3); max-width:100ch; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) { .tiles { grid-template-columns:repeat(2, 1fr); } }
@media (max-width: 767px) {
  .app { padding:0 12px 60px; }
  .head { margin:0 -12px; padding:0 12px; }
  .brand .eyebrow, #print-btn { display:none; }
  .brand h1 { font-size:20px; }
  .brand .run { font-size:12px; }
  .tabs { mask-image:linear-gradient(90deg, #000 88%, transparent); -webkit-mask-image:linear-gradient(90deg, #000 88%, transparent); }
  .ctxbar { position:static; gap:6px 8px; margin:0 -12px 16px; padding-left:12px; padding-right:12px; }   /* scrolls away on a phone instead of holding a fifth of the screen */
  .ctxbar .ctl.row > span { display:none; }
  #win-ctl { display:none; }
  .ctl select { min-width:0; font-size:15px; }
  .options { position:fixed; left:8px; right:8px; bottom:8px; top:auto; width:auto; }
  .sec-head { flex-wrap:wrap; padding:10px 14px; }
  .sec-head .sec-sub { display:none; }
  .sec-body > .phone-sub { display:block; }
  .sec-head h3 { font-size:16px; }
  .ctl > span, .i-kicker, .ev-type, .verdict, .dt th, .heat th, .block-label { font-size:12.5px; }
  .b-axis, .ref-label, svg .ytick, svg .xtick, .facet .axis-x { font-size:11px; }
  .pill, .k-pol, .trace-badge, .bars .name small, .bars .val small, .hero .h-foot, .standing .s-foot { font-size:12px; }
  .chip { font-size:13px; padding:6px 10px; }
  .seg button, .fchip, .iconbtn, .ctl select, .dt-tools select, .filters select, .i-link, .i-math, .twin, .rows-store > summary, details > summary { min-height:44px; display:inline-flex; align-items:center; }
  .seg { height:auto; }
  .card-h, .insight .i-foot { min-height:44px; }
  .k-spark, .h-spark { display:none; }
  .hero { padding:16px 14px; }
  .hero .h-value { font-size:18px; }
  .standing .s-main { font-size:30px; }
  .ev { grid-template-columns:1fr auto; grid-template-areas:"name delta" "sub sub" "type type"; }
  .ev .ev-type { grid-area:type; justify-self:start; }
  .ev .ev-main { grid-area:name; }
  .ev .ev-sub { grid-area:sub; }
  .ev .ev-delta { grid-area:delta; }
  .ev .ev-name { white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .ov .ev-name.wrap { display:block; -webkit-line-clamp:unset; overflow:visible; }   /* a report sentence is read whole, never cut with an ellipsis */
  #theme-btn { display:none; }   /* a phone follows its own light/dark setting; the button only ate a row of the header */
  .seg-select { font:inherit; font-size:15px; height:44px; padding:6px 10px; border:1px solid var(--rule-2); border-radius:var(--radius-s); background:var(--surface); color:var(--ink); }
  .tile.hero { grid-column:span 1; }
  .tile .t-value { font-size:24px; }
  .hero .h-value { font-size:20px; }
  .grid-2, .grid-3 { grid-template-columns:1fr; }
  .bars .name { font-size:12px; }
  .bullet { grid-template-columns:1fr auto; grid-template-areas:"label right" "track track"; gap:2px 10px; padding:6px 6px 8px; }
  .bullet .b-label { grid-area:label; }
  .bullet .b-right { grid-area:right; }
  .bullet .b-track { grid-area:track; }
  .section { scroll-margin-top:150px; }
  .sec-head { padding:10px 14px; }
  .sec-body { padding:0 14px 14px; }
  .heat.phone-hide { display:none; }
  .ev { grid-template-columns:1fr auto; }
  .ev .ev-type { grid-row:2; justify-self:start; }
  .desktop-only { display:none !important; }
}
@media (min-width: 768px) { .phone-only { display:none !important; } }

/* ── print ─────────────────────────────────────────────────────────────── */
@media print {
  /* the theme blocks are (0,2,0) selectors, so the print palette must match that specificity to win over Dark */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme:light; --paper:#fff; --surface:#fff; --surface-2:#f2f2ee; --surface-3:#e8e8e2; --ink:#111; --ink-2:#333; --ink-3:#666; --ink-4:#999; --rule:#ccc; --rule-2:#bbb;
    --accent:#1c3d6e; --accent-ink:#fff; --accent-soft:#e3eaf5; --tint:#e8eef8; --header:#fff; --header-ink:#111; --header-eyebrow:#1c3d6e; --header-rule:#bbb;
    --viz-surface:#fff; --viz-grid:#e1e6ee; --viz-axis:#c5cfdc; --viz-muted:#666; --viz-text:#111; --viz-text-2:#333;
    --us:#a16207; --us-soft:rgba(161,98,7,.12); --us-ring:#111; --field:#8b98ab; --reference:#6b7889; --cat2:#0b8f80; --cat3:#6d28d9;
    --seq-0:#45bfb0; --seq-1:#1fa093; --seq-2:#0b8072; --seq-3:#075f54; --seq-4:#04463d; --seq-5:#022e28;
    --seq-ink-0:#0b0b0b; --seq-ink-1:#0b0b0b; --seq-ink-2:#fff; --seq-ink-3:#fff; --seq-ink-4:#fff; --seq-ink-5:#fff;
    --ord-1:#45bfb0; --ord-2:#1fa093; --ord-3:#0b8072; --ord-4:#075f54; --ord-ink-1:#0b0b0b; --ord-ink-2:#0b0b0b; --ord-ink-3:#fff; --ord-ink-4:#fff;
    --div-below:#0b8f80; --div-below-2:#7fcfc4; --div-below-1:#cdeeea; --div-above:#a21caf; --div-above-2:#e08ae9; --div-above-1:#f5d8f8; --div-mid:#eef0f4;
    --good-text:#006300; --bad-text:#b3261e; --good:#0ca30c; --warn:#fab219; --serious:#ec835a; --critical:#d03b3b; --hatch:rgba(0,0,0,.28);
  }
  .head { background:#fff; color:#111; border-bottom:2px solid #111; }
  .brand h1, .brand .run { color:#111; }
  body { font-size:12px; }
  .app { max-width:none; padding:0; }
  .tabs, .ctxbar, .topbar-right, .loading-bar, .i-math, .trace, .sec-head .chev, .iconbtn, footer { display:none !important; }
  .section { break-inside:avoid; border:0; margin:0 0 10px; box-shadow:none; }
  .section[data-collapsed="true"] { display:none; }
  .print-hide, .lazy-pending, .opt-wrap, #opt-chips { display:none !important; }
  .ov { gap:8px; }
  .hero { box-shadow:none; }
  .hero .h-value { font-size:18px; }
  .insights { grid-template-columns:1fr 1fr; }
  .ov .ov-half { display:none; }
  a { text-decoration:none; color:inherit; }
}
