/* ==========================================================================
   Vision Model Benchmark — Decision Console
   Local, offline static viewer. No external fonts/CDN (household camera data
   stays local). Theme: cool slate ground + blue signal accent; status-colored
   data. Light + dark, driven by prefers-color-scheme and a [data-theme] toggle.
   Colors validated with the dataviz palette validator (see build notes).
   ========================================================================== */

:root {
  color-scheme: light;

  /* NOTE: nothing currently sticks to the viewport below the slim topbar (~48px). If
     something ever does, offset it by the topbar height — but the leaderboard thead does
     NOT count: it sticks inside .tablewrap (its overflow makes it the containing scroller),
     so it keeps top: 0. */

  /* --- surfaces / planes (light) --- */
  --plane:        #eef0ee;   /* page background */
  --surface-1:    #fbfbfa;   /* cards / chart surface */
  --surface-2:    #f4f5f3;   /* insets, table stripes */
  --surface-3:    #e9ebe8;   /* deeper insets */

  /* --- ink (light) --- */
  --ink:          #14161a;
  --ink-2:        #55585f;   /* secondary */
  --ink-3:        #797d86;   /* muted (axes, labels) */

  /* --- lines --- */
  --line:         rgba(20,22,26,0.10);
  --line-strong:  rgba(20,22,26,0.18);
  --grid:         #e1e0d9;

  /* --- brand / interactive (blue signal) --- */
  --accent:       #2a78d6;
  --accent-ink:   #ffffff;
  --chart-label:  #55585f;
  --chart-link:   #2a78d6;
  --accent-wash:  rgba(42,120,214,0.10);
  --accent-wash-2:rgba(42,120,214,0.16);

  /* --- status (data core; fixed, icon+label always) --- */
  --ok:           #0ca30c;   /* overall pass */
  --ok-ink:       #067006;
  --warn:         #d98a00;   /* safety pass, claim fail (partial) */
  --warn-ink:     #9a6200;
  --bad:          #d03b3b;   /* valid but wrong decision */
  --bad-ink:      #b22a2a;
  --void:         #797d86;   /* invalid: schema/provider/harness error */

  --ok-wash:      rgba(12,163,12,0.12);
  --warn-wash:    rgba(217,138,0,0.14);
  --bad-wash:     rgba(208,59,59,0.12);
  --void-wash:    rgba(121,125,134,0.14);

  /* --- provider identity (color reinforces a text label; never alone) --- */
  --prov-google:    #2a78d6;
  --prov-openai:    #4a3aa7;
  --prov-anthropic: #eb6834;
  --prov-local:     #c14b7d;

  /* --- cost class --- */
  --class-api:  #2a78d6;
  --class-local:#c14b7d;
  --class-sub:  #797d86;

  --shadow-1: 0 1px 2px rgba(20,22,26,0.06), 0 1px 3px rgba(20,22,26,0.04);
  --shadow-2: 0 4px 12px rgba(20,22,26,0.10), 0 1px 3px rgba(20,22,26,0.06);
  --shadow-pop: 0 12px 40px rgba(20,22,26,0.22);

  --radius: 10px;
  --radius-sm: 7px;
  --radius-xs: 5px;

  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane:        #0d0e12;
    --surface-1:    #16181d;
    --surface-2:    #1c1f26;
    --surface-3:    #22262e;
    --ink:          #f1f2f5;
    --ink-2:        #a9adb6;
    --ink-3:        #7d818b;
    --line:         rgba(255,255,255,0.10);
    --line-strong:  rgba(255,255,255,0.18);
    --grid:         #2c2c2a;
    --accent:       #3987e5;
    --accent-ink:   #f1f2f5;
    --chart-label:  #b0b4bd;
    --chart-link:   #7dbafb;
    --accent-wash:  rgba(57,135,229,0.16);
    --accent-wash-2:rgba(57,135,229,0.24);
    --ok:           #2bb32b;  --ok-ink:  #7fe07f;
    --warn:         #f0a81a;  --warn-ink:#f5c65e;
    --bad:          #e05656;  --bad-ink: #f08e8e;
    --void:         #8b8f99;
    --ok-wash:      rgba(43,179,43,0.18);
    --warn-wash:    rgba(240,168,26,0.18);
    --bad-wash:     rgba(224,86,86,0.18);
    --void-wash:    rgba(139,143,153,0.18);
    --prov-google:    #3987e5;
    --prov-openai:    #9085e9;
    --prov-anthropic: #d95926;
    --prov-local:     #d55181;
    --class-api:  #3987e5;
    --class-local:#d55181;
    --class-sub:  #8b8f99;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 6px 18px rgba(0,0,0,0.5);
    --shadow-pop: 0 16px 48px rgba(0,0,0,0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane:        #0d0e12;
  --surface-1:    #16181d;
  --surface-2:    #1c1f26;
  --surface-3:    #22262e;
  --ink:          #f1f2f5;
  --ink-2:        #a9adb6;
  --ink-3:        #7d818b;
  --line:         rgba(255,255,255,0.10);
  --line-strong:  rgba(255,255,255,0.18);
  --grid:         #2c2c2a;
  --accent:       #3987e5;
  --accent-ink:   #f1f2f5;
  --chart-label:  #b0b4bd;
  --chart-link:   #7dbafb;
  --accent-wash:  rgba(57,135,229,0.16);
  --accent-wash-2:rgba(57,135,229,0.24);
  --ok:           #2bb32b;  --ok-ink:  #7fe07f;
  --warn:         #f0a81a;  --warn-ink:#f5c65e;
  --bad:          #e05656;  --bad-ink: #f08e8e;
  --void:         #8b8f99;
  --ok-wash:      rgba(43,179,43,0.18);
  --warn-wash:    rgba(240,168,26,0.18);
  --bad-wash:     rgba(224,86,86,0.18);
  --void-wash:    rgba(139,143,153,0.18);
  --prov-google:    #3987e5;
  --prov-openai:    #9085e9;
  --prov-anthropic: #d95926;
  --prov-local:     #d55181;
  --class-api:  #3987e5;
  --class-local:#d55181;
  --class-sub:  #8b8f99;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 6px 18px rgba(0,0,0,0.5);
  --shadow-pop: 0 16px 48px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--plane);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
/* Base icon size: any inline SVG stays small unless a sized container overrides
   it. Without this, an icon with only a viewBox balloons to its default box. */
svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; }
.brand .lens svg { width: 19px; height: 19px; }
.rec-eyebrow svg { width: 14px; height: 14px; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { max-width: 1360px; margin: 0 auto; padding: 0 20px 80px; }

/* Sticky bar is ONE slim row (~52px): brand + tabs + theme toggle. The
   subtitle and dataset chips live in the non-sticky .subbar below so the
   sticky element stays cheap to keep pinned while scrolling. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.topbar-inner { max-width: 1360px; margin: 0 auto; padding: 0 20px; }
.topbar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand h1 {
  font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; margin: 0;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.brand .lens { color: var(--accent); }
.brand .lens svg { width: 16px; height: 16px; }

.iconbtn {
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--ink-2);
  height: 30px; padding: 0 10px; border-radius: var(--radius-sm); margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 550;
}
.iconbtn:hover { color: var(--ink); border-color: var(--accent); }
.iconbtn svg { width: 14px; height: 14px; }

/* subtitle + dataset chips — normal flow, scrolls away below the slim bar */
.subbar { border-bottom: 1px solid var(--line); background: var(--surface-1); }
.subbar-inner { max-width: 1360px; margin: 0 auto; padding: 10px 20px 12px; }
.subbar .sub { color: var(--ink-2); font-size: 12.5px; }
.subbar .sub b { color: var(--ink); font-weight: 600; }

/* dataset switcher (?run=<id> reload) */
.run-picker { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 12px; font-weight: 550; color: var(--ink-2); }
.run-picker select {
  max-width: min(420px, 80vw); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-1); color: var(--ink); font-size: 12px; padding: 4px 8px;
}
/* board-mode rationale list inside the rec card */
.board-rationale { margin: 8px 0 0 18px; display: grid; gap: 6px; }

/* dataset chips + cost-class legend */
.meta-strip {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  margin-top: 10px; font-size: 12px; color: var(--ink-2);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 20px; font-size: 11.5px; white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-sep { width: 1px; height: 16px; background: var(--line-strong); }
.classdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.classdot.api { background: var(--class-api); }
.classdot.local { background: var(--class-local); }
.classdot.sub { background: var(--class-sub); }

/* tabs — inline in the slim sticky bar, next to the brand */
.tabs { display: flex; gap: 2px; }
.tab {
  border: none; background: none; color: var(--ink-2); font-size: 13px; font-weight: 550;
  padding: 6px 12px; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab .tab-count { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Generic pieces
   ========================================================================== */
.view { padding-top: 22px; }
.view[hidden] { display: none; }
.section-h { font-size: 13px; font-weight: 650; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.card {
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.card-pad { padding: 18px 20px; }

.grid { display: grid; gap: 16px; }
@media (min-width: 860px) { .cols-2 { grid-template-columns: 1fr 1fr; } }

/* status pill */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.5;
}
.pill svg { width: 12px; height: 12px; }
.pill.ok   { color: var(--ok-ink);   background: var(--ok-wash);   border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pill.warn { color: var(--warn-ink); background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.bad  { color: var(--bad-ink);  background: var(--bad-wash);  border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pill.void { color: var(--ink-2);    background: var(--void-wash); border-color: var(--line-strong); }
.pill.neutral { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }

/* provider tag */
.prov { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.prov .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prov.google .dot { background: var(--prov-google); }
.prov.openai .dot { background: var(--prov-openai); }
.prov.anthropic .dot { background: var(--prov-anthropic); }
.prov.local .dot { background: var(--prov-local); }

/* class badge */
.classbadge { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--ink-2); white-space: nowrap; }
.classbadge.api   { color: var(--class-api);   border-color: color-mix(in srgb, var(--class-api) 40%, transparent); }
.classbadge.local { color: var(--class-local); border-color: color-mix(in srgb, var(--class-local) 40%, transparent); }
.classbadge.sub   { color: var(--ink-2); border-color: var(--line-strong); }
/* tuned deployment candidate (prompt variant / pinned effort) — provenance sibling of the cost-class badge */
.classbadge.variant { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
/* † on P/composite values whose rows come from a smaller judge cohort than the rest of the board.
   Absolutely positioned (no offsets = static spot, out of flow) so the number keeps the exact
   alignment of its †-less column neighbors — the mark floats in the cell gutter instead of
   shifting digits and breaking the vertical read. */
.cohort-mark { position: absolute; transform: translateY(-3px); margin-left: 2px; color: var(--ink-3); font-size: 10px; cursor: help; }

/* micro bar for rates inside table cells */
.ratecell { display: flex; align-items: center; gap: 8px; }
.ratebar { position: relative; flex: 1; height: 6px; min-width: 46px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.ratebar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }
.ratecell .val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 38px; text-align: right; }

/* ==========================================================================
   Decision view
   ========================================================================== */
.decision-hero {
  display: grid; gap: 18px; margin-bottom: 22px;
}
/* stretch (not start): the tiles column fills the rec-card's height, so wide
   viewports don't show a dead band under the tiles */
@media (min-width: 980px) { .decision-hero { grid-template-columns: 1.15fr 1fr; align-items: stretch; } }

.rec-card { padding: 20px 22px; }
.rec-eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 7px; }
.rec-title { font-size: 21px; font-weight: 650; letter-spacing: -0.015em; margin: 8px 0 2px; line-height: 1.25; }
.rec-title .amp { color: var(--ink-3); font-weight: 400; margin: 0 6px; }
.rec-body { color: var(--ink-2); font-size: 13.5px; margin: 10px 0 0; }
.rec-note {
  margin-top: 14px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--warn-wash); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn-ink); font-size: 12.5px; display: flex; gap: 9px; align-items: flex-start;
}
.rec-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.rec-note b { color: var(--warn-ink); }

/* collapsed full rationale — summary reads as a link, not a form control */
.rec-details { margin-top: 10px; }
.rec-details summary {
  cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 600;
  list-style: none; display: inline-block;
}
.rec-details summary::-webkit-details-marker { display: none; }
.rec-details summary:hover { text-decoration: underline; }
.rec-details[open] summary { margin-bottom: 4px; }

.cand-tiles { display: grid; gap: 12px; }
@media (min-width: 560px) { .cand-tiles { grid-template-columns: 1fr 1fr; } }
.cand {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 15px;
  background: var(--surface-1); position: relative; cursor: pointer; text-align: left; width: 100%;
  /* explicit column flex, top-anchored: a stretched <button> otherwise vertically
     CENTERS its content, so the shorter tile's rows drift out of line with its
     neighbor's and you can't scan label→name→stats straight across */
  display: flex; flex-direction: column; align-items: flex-start;
}
.cand .cand-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.cand .cand-compare { margin-top: auto; padding-top: 9px; width: 100%; }
.cand:hover { border-color: var(--accent); box-shadow: var(--shadow-1); }
.cand .role { font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.cand .name { font-size: 15px; font-weight: 620; margin: 3px 0 1px; letter-spacing: -0.01em; }
.cand .krow { display: flex; gap: 14px; margin-top: 11px; flex-wrap: wrap; }
.cand .k { display: flex; flex-direction: column; }
.cand .k .kv { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cand .k .kl { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.cand-compare { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* evidence strip */
.evidence { margin-top: 6px; }
.ev-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 13px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.ev-row:last-child { border-bottom: none; }
.ev-row:hover { background: var(--surface-2); }
.ev-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ev-icon svg { width: 16px; height: 16px; }
.ev-icon.warn { background: var(--warn-wash); color: var(--warn-ink); }
.ev-icon.bad  { background: var(--bad-wash);  color: var(--bad-ink); }
.ev-title { font-weight: 600; font-size: 13px; }
.ev-sub { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.ev-sub .q { font-style: italic; }
.ev-model { font-size: 11.5px; color: var(--ink-3); text-align: right; white-space: nowrap; }

/* ==========================================================================
   Stat tiles
   ========================================================================== */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.tile .tl { font-size: 11.5px; color: var(--ink-2); }
.tile .tv { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; line-height: 1; }
.tile .tsub { font-size: 11px; color: var(--ink-3); margin-top: 5px; }

/* ==========================================================================
   Charts (inline SVG)
   ========================================================================== */
.chart-card { padding: 14px 16px 12px; }
/* The scatter card sizes to its content: the svg keeps its 1240x340 viewBox aspect at full
   card width (~340px tall). A fixed card height + height:100% letterboxed the svg tiny. */
#dec-scatter .scatter-chart svg { width: 100%; height: auto; display: block; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-title { font-size: 14px; font-weight: 620; }
.chart-sub { font-size: 12px; color: var(--chart-label); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.scatter-chart { width: 100%; }
.axis-label { fill: var(--chart-label); font-size: 11px; }
.axis-title { fill: var(--chart-label); font-size: 11.5px; font-weight: 600; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.frontier-line { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 4 4; opacity: 0.8; }
.pt-label { fill: var(--ink); font-size: 11px; font-weight: 600; }
.pt-label.bg { stroke: var(--surface-1); stroke-width: 3.5; paint-order: stroke; }

.chart-toolbar {
  display: flex; align-items: center; column-gap: 18px; row-gap: 12px; flex-wrap: wrap;
  padding: 10px 0 12px; margin-bottom: 2px; border-bottom: 1px solid var(--line);
}
.control-group { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.control-actions { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.control-label { color: var(--chart-label); font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.toolbar-sep { width: 1px; height: 26px; background: var(--line-strong); align-self: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: none; background: var(--surface-1); color: var(--ink-2); font-size: 12px; font-weight: 550; padding: 6px 12px; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.reset-control {
  border: none; background: transparent; color: var(--chart-link); font-size: 12px; font-weight: 600; padding: 6px 4px;
}
.reset-control:hover { text-decoration: underline; text-underline-offset: 2px; }

.chart-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 11.5px; color: var(--chart-label); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend-label { color: var(--chart-label); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.lg-shape { width: 13px; height: 13px; }
.focus-note { color: var(--chart-label); font-size: 11.5px; margin: 9px 0 1px; }
.focus-note-label { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-right: 5px; }
.focus-note strong { color: var(--ink); font-weight: 600; }
.chart-empty {
  min-height: 260px; display: grid; place-items: center; color: var(--ink-3); font-size: 13px;
}

/* ==========================================================================
   Filters row
   ========================================================================== */
.filters { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .grp { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
select, .inp {
  font-family: inherit; font-size: 12.5px; color: var(--ink);
  background: var(--surface-1); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); height: 32px; padding: 0 9px;
}
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.chart-toolbar .toggle { color: var(--chart-label); }

.table-caption {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 0 2px 8px; color: var(--ink-3); font-size: 11.5px;
}
.table-caption b { color: var(--ink-2); font-weight: 600; }

@media (max-width: 800px) {
  .scatter-chart { overflow-x: auto; padding-bottom: 4px; }
  .scatter-chart svg { width: 760px; max-width: none; }
}

/* ==========================================================================
   Leaderboard table
   ========================================================================== */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow-1); }
table.lb { border-collapse: collapse; width: 100%; min-width: 920px; font-size: 12.5px; }
table.lb th, table.lb td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.lb thead th {
  /* sticky is relative to .tablewrap (its overflow makes it the containing scroller), so top
     must be 0 — a viewport offset here just shoves the header down over row 1. */
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
  font-size: 11px; font-weight: 600; color: var(--ink-2); user-select: none;
  border-bottom: 1px solid var(--line-strong);
}
table.lb thead th.sortable { cursor: pointer; }
table.lb thead th.sortable:hover { color: var(--ink); }
table.lb thead th .arrow { color: var(--accent); font-size: 10px; }
table.lb tbody tr { cursor: pointer; }
table.lb tbody tr:hover { background: var(--surface-2); }
table.lb tbody tr.is-prod { background: color-mix(in srgb, var(--warn) 7%, transparent); }
table.lb tbody tr.is-prod:hover { background: color-mix(in srgb, var(--warn) 12%, transparent); }
table.lb td.num, table.lb th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.lb .rank { color: var(--ink-3); font-variant-numeric: tabular-nums; width: 24px; }
table.lb .mname { font-weight: 600; color: var(--ink); }
table.lb .mtags { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.metric-heat {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.tag-prod { font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--warn-ink); background: var(--warn-wash); padding: 1px 5px; border-radius: 4px; }
.tag-cand { font-size: 9.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--accent); background: var(--accent-wash); padding: 1px 5px; border-radius: 4px; }
.confusion { display: inline-flex; gap: 3px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.confusion b { padding: 0 4px; border-radius: 4px; font-weight: 600; }
.confusion .c-ok { background: var(--ok-wash); color: var(--ok-ink); }
.confusion .c-bad { background: var(--bad-wash); color: var(--bad-ink); }
.confusion .c-void { background: var(--void-wash); color: var(--ink-2); }

/* ==========================================================================
   Matrix (models x cases heatmap)
   ========================================================================== */
.matrix-legend { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; color: var(--ink-2); }
.matrix-legend .mk { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1px solid var(--line-strong); }
.swatch.ok { background: var(--ok); border-color: var(--ok); }
.swatch.warn { background: var(--warn); border-color: var(--warn); }
.swatch.bad { background: var(--bad); border-color: var(--bad); }
.swatch.void { background: var(--void-wash); border: 1px dashed var(--line-strong); background-image: repeating-linear-gradient(45deg, transparent, transparent 3px, var(--void) 3px, var(--void) 4px); }
.swatch.disagree { background: transparent; border: 2px dashed var(--warn); }
/* repeats-disagree cue: a warn-colored corner triangle, distinct from the
   dashed "auto ≠ judge" swatch above — this one flags the 3 repeats themselves diverging. */
.swatch.reps-disagree {
  background: transparent; position: relative; border-color: var(--line-strong);
}
.swatch.reps-disagree::after {
  content: ''; position: absolute; inset: 0 0 auto auto;
  width: 0; height: 0; border-style: solid; border-width: 0 14px 14px 0;
  border-color: transparent var(--warn) transparent transparent;
}
/* inline version for rows (case view / model drawer strip) — a small triangle next
   to the name/case label rather than a corner overlay on a box. */
.rep-disagree-dot {
  display: inline-block; width: 0; height: 0; vertical-align: middle;
  border-style: solid; border-width: 0 7px 7px 0;
  border-color: transparent var(--warn) transparent transparent;
}

.matrixwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow-1); }
table.mx { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.mx th, table.mx td { padding: 0; }
table.mx thead th.case-h {
  vertical-align: bottom; padding: 6px 4px 8px; text-align: center; width: 76px;
  border-bottom: 1px solid var(--line-strong);
}
table.mx thead th.corner {
  position: sticky; left: 0; z-index: 3; background: var(--surface-2);
  text-align: left; padding: 8px 12px; min-width: 240px; border-bottom: 1px solid var(--line-strong);
  font-size: 11px; color: var(--ink-2); font-weight: 600;
}
.case-thumb { width: 58px; height: 40px; border-radius: 5px; object-fit: cover; display: block; margin: 0 auto 5px; border: 1px solid var(--line); background: var(--surface-3); }
.case-h .cid { font-weight: 650; color: var(--ink); font-size: 11px; }
.case-h .cexp { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; color: var(--ink-3); margin-top: 2px; }
.case-h .cexp svg { width: 11px; height: 11px; }
table.mx tbody th.mx-row {
  position: sticky; left: 0; z-index: 1; background: var(--surface-1);
  text-align: left; padding: 7px 12px; min-width: 240px; border-bottom: 1px solid var(--line);
  font-weight: 500; font-size: 12px;
}
table.mx tbody tr:hover th.mx-row { background: var(--surface-2); }
.mx-row .rn { display: flex; align-items: center; gap: 8px; }
.mx-row .mx-scores { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.15; }
.mx-row .ov { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 12px; }
.mx-row .adj { font-variant-numeric: tabular-nums; font-size: 10px; color: var(--ink-3); font-weight: 600; }
table.mx tbody td.cell { border-bottom: 1px solid var(--line); text-align: center; }
.cellbox {
  width: 68px; height: 34px; margin: 3px auto; border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; border: 1px solid transparent; position: relative;
}
.cellbox:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.cellbox.ok   { background: var(--ok-wash);   color: var(--ok-ink); }
.cellbox.warn { background: var(--warn-wash); color: var(--warn-ink); }
.cellbox.bad  { background: var(--bad-wash);  color: var(--bad-ink); }
.cellbox.void {
  color: var(--ink-2);
  background-image: repeating-linear-gradient(45deg, var(--void-wash), var(--void-wash) 4px, transparent 4px, transparent 8px);
  border: 1px dashed var(--line-strong);
}
.cellbox.disagree { box-shadow: inset 0 0 0 2px var(--warn); }
.cellbox.reps-disagree::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 0; height: 0; border-style: solid; border-width: 0 8px 8px 0;
  border-color: transparent var(--warn) transparent transparent;
  border-top-right-radius: 6px;
}
.cellbox svg { width: 15px; height: 15px; }
.cellbox .u-digit {
  position: absolute; right: 4px; bottom: 2px;
  font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  opacity: 0.85; line-height: 1;
}
.u-digit-leg {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; border-radius: 4px;
  font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--ok-wash); color: var(--ok-ink); border: 1px solid var(--ok);
}

/* ==========================================================================
   Cases view
   ========================================================================== */
.case-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.case-btn {
  border: 1px solid var(--line-strong); background: var(--surface-1); border-radius: var(--radius-sm);
  padding: 7px 11px 7px 9px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px;
}
.case-btn:hover { border-color: var(--accent); color: var(--ink); }
.case-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }
.case-btn .cbid { font-weight: 650; color: var(--ink); }
.case-btn .cbdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.case-btn .cbdot.pos { background: var(--accent); }
.case-btn .cbdot.neg { background: var(--ink-3); }

.case-detail { display: grid; gap: 18px; }
@media (min-width: 980px) { .case-detail { grid-template-columns: 380px 1fr; align-items: start; } }
.imgpair { display: grid; gap: 10px; }
.imgframe { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); }
.imgframe img { display: block; width: 100%; height: auto; cursor: zoom-in; background: var(--surface-3); }
.imgcap { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; font-size: 11.5px; color: var(--ink-2); border-top: 1px solid var(--line); }
.imgcap .cam { font-family: var(--mono); color: var(--ink); }
.trig { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent); background: var(--accent-wash); padding: 1px 6px; border-radius: 4px; }

.gt dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.gt dt { color: var(--ink-3); font-size: 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gt dd { margin: 0; font-size: 12.5px; }
.gt .facts { display: flex; flex-direction: column; gap: 3px; }
.gt-desc { color: var(--ink-2); margin: 2px 0 4px; font-size: 13px; line-height: 1.45; }
.gt-caption { font-size: 11px; color: var(--ink-3); margin: 0 0 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gt-meta { margin-bottom: 12px; }
.gt-band {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.gt-band.manual {
  background: var(--warn-wash);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.gt-band.expected {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  margin-bottom: 12px;
}
.gt-band.expected .gt-band-h { color: var(--accent); }
.gt-band-h {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gt-band.manual .gt-band-h { color: var(--warn-ink); }
.gt-band-h svg { width: 13px; height: 13px; }
.gt-band dl { margin: 0; }
.taglist { display: flex; gap: 5px; flex-wrap: wrap; }
.taglist .t { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.taglist .t.req { color: var(--ok-ink); border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: var(--ok-wash); }
.taglist .t.prohib { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: var(--bad-wash); }
.taglist .t.forbid { color: var(--ink-2); border-style: dashed; }
.taglist .t.tippable { cursor: help; }
.taglist .t.tippable:hover, .taglist .t.tippable:focus-visible { border-color: var(--accent); }

.resp-list { display: flex; flex-direction: column; }
.resp {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 0 12px; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; cursor: pointer;
}
.resp:hover { border-color: var(--accent); }
.resp.disagree { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.resp .bar { width: 4px; }
.resp .bar.ok { background: var(--ok); } .resp .bar.warn { background: var(--warn); }
.resp .bar.bad { background: var(--bad); } .resp .bar.void { background: var(--void); }
.resp .body { padding: 10px 0 10px 4px; min-width: 0; }
.resp .rhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resp .rname { font-weight: 620; font-size: 12.5px; }
.resp .rtitle { font-size: 12.5px; margin-top: 4px; }
.resp .rtitle b { font-weight: 600; }
.resp .rstats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.resp .rstats b { color: var(--ink-2); font-weight: 600; }
.resp .rstats b.rstat-bad { color: var(--bad-ink); }
.resp .rdesc { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.resp .rmeta { padding: 10px 12px 10px 0; text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; justify-content: center; }
.resp .rmeta .m { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Detail drawer
   ========================================================================== */
.scrim { position: fixed; inset: 0; background: rgba(10,11,14,0.5); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); z-index: 100;
  background: var(--surface-1); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-pop);
  transform: translateX(100%); transition: transform .2s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head .dh-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.drawer-head .dh-sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.closebtn { border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--ink-2); width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; }
.closebtn:hover { color: var(--ink); border-color: var(--accent); }
.closebtn svg { width: 16px; height: 16px; }
.drawer-body { overflow-y: auto; padding: 16px 18px 40px; }

/* repeat switcher — openModelCase's drill-in defaults to the consensus repeat;
   these tabs re-render the same drawer body for a specific one of the 3 repeats. */
.rep-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.rep-tab {
  border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--ink-2);
  font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 20px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.rep-tab::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ink-3); }
.rep-tab.ok::before   { background: var(--ok); }
.rep-tab.warn::before { background: var(--warn); }
.rep-tab.bad::before  { background: var(--bad); }
.rep-tab.void::before { background: var(--void); }
.rep-tab:hover { color: var(--ink); border-color: var(--accent); }
.rep-tab.active { border-color: var(--accent); color: var(--ink); background: var(--accent-wash); }

.d-sec { margin-bottom: 20px; }
.d-sec > h4 {
  font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 9px;
  display: flex; align-items: center; gap: 6px;
}
.d-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-response { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.d-response .dt { font-size: 15px; font-weight: 620; }
.d-response .dd { font-size: 13px; color: var(--ink-2); margin-top: 5px; }
.d-response .dp { margin-top: 9px; font-size: 12px; }

.gates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gates.gates-wide { grid-template-columns: 1fr; }
.gate-stack { display: flex; flex-direction: column; gap: 12px; }
.gate-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--surface-1);
}
.gate-group-label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 7px 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.gate { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 12px; }
.gate .gi { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; flex: none; }
.gate .gi svg { width: 12px; height: 12px; }
.gate.pass .gi { background: var(--ok-wash); color: var(--ok-ink); }
.gate.fail .gi { background: var(--bad-wash); color: var(--bad-ink); }
.gate.na .gi { background: var(--void-wash); color: var(--ink-2); }
.gate .gl { display: flex; flex-direction: column; }
.gate .gl b { font-weight: 600; }
.gate .gl span { font-size: 10.5px; color: var(--ink-3); }

.info {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: help;
  vertical-align: middle;
  flex: none;
}
.info svg { width: 13px; height: 13px; }
.info:hover, .info:focus-visible { color: var(--accent); }
.lb th .info { margin-left: 2px; }
.kv-grid .kv-i .l { display: flex; align-items: center; gap: 4px; }

.claimrow { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; margin-bottom: 6px; }
.claimrow svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.claimrow.hit svg, .claimrow.miss svg { color: var(--bad); }
.claimrow.matched svg, .claimrow.avoided svg { color: var(--ok); }
.claimrow .cl-note { color: var(--ink-3); font-size: 11.5px; }

.manual-note { background: var(--warn-wash); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; color: var(--ink); }
.manual-note .mh { font-weight: 650; color: var(--warn-ink); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.manual-note .mh svg { width: 13px; height: 13px; }

.expected-gold {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 12.5px;
  line-height: 1.45;
}
.expected-gold .eg-h {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.judge-cmp-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 12px;
  margin-bottom: 8px;
}
.judge-cmp {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--surface-2);
}
.judge-cmp.clash {
  background: var(--warn-wash);
  color: var(--warn-ink);
}
.judge-rationale {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.45;
}

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 8px; }
.kv-grid .kv-i { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); }
.kv-grid .kv-i .l { font-size: 10.5px; color: var(--ink-3); }
.kv-grid .kv-i .v { font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; margin-top: 2px; }

.raw-toggle { margin-top: 10px; }
.raw-toggle summary { cursor: pointer; font-size: 12px; color: var(--ink-2); }
.raw-toggle summary:hover { color: var(--ink); }
.raw-toggle pre { margin: 8px 0 0; padding: 11px 12px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 11.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }

/* image lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8,9,12,0.88); z-index: 200; display: none; place-items: center; padding: 32px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-pop); image-rendering: auto; }

/* tooltip */
#tooltip {
  position: fixed; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .1s ease;
  background: var(--ink); color: var(--plane); font-size: 11.5px; line-height: 1.5;
  padding: 7px 10px; border-radius: 7px; box-shadow: var(--shadow-2); max-width: 300px;
}
#tooltip.show { opacity: 1; }
#tooltip .tt-t { font-weight: 650; margin-bottom: 2px; }
#tooltip .tt-body { opacity: 0.92; }
#tooltip .tt-body + .tt-body { margin-top: 4px; }
#tooltip .tt-body b { font-weight: 650; }
#tooltip .tt-body code {
  font-family: var(--mono); font-size: 10.5px;
  background: color-mix(in srgb, var(--plane) 18%, transparent);
  padding: 0 3px; border-radius: 3px;
}
#tooltip .tt-r { font-variant-numeric: tabular-nums; margin-top: 3px; opacity: 0.85; }

/* loading / error states */
.state { max-width: 620px; margin: 80px auto; text-align: center; color: var(--ink-2); }
.state h2 { color: var(--ink); font-size: 18px; margin: 0 0 8px; }
.state pre { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; color: var(--ink); overflow-x: auto; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

.footnote { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.footnote code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--ink-2); }

@media (max-width: 700px) {
  /* slim bar can't fit brand + tabs + toggle on one line at this width —
     let it wrap to two lines rather than squeezing everything unreadable. */
  .topbar-row { row-gap: 6px; }
  .tabs { order: 3; flex-basis: 100%; }
}

@media (max-width: 620px) {
  .rec-title { font-size: 18px; }
  .chart-card { padding-inline: 12px; }
  .chart-toolbar { align-items: center; column-gap: 14px; row-gap: 12px; }
  .toolbar-sep { display: none; }
  .table-caption { align-items: flex-start; flex-direction: column; gap: 2px; }
}

/* Real bill vs. bench prediction (usageCard) */
.usage-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 4px; font-size: 12px; color: var(--chart-label); }
.usage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.usage-legend .usage-bar { width: 14px; }
.usage-row { display: grid; grid-template-columns: 112px 1fr 64px; gap: 10px; align-items: center; padding: 6px 0; }
.usage-mo { font-size: 13px; font-variant-numeric: tabular-nums; }
.usage-mo span, .usage-v span { display: block; font-size: 11px; color: var(--chart-label); }  /* --ink-3 fails APCA at 11px, and the predicted $ is data */
.usage-bars { display: grid; gap: 3px; }
.usage-bar { display: inline-block; height: 9px; border-radius: 2px; min-width: 2px; }
.usage-bar.actual { background: var(--accent); }
.usage-bar.pred { background: var(--accent-wash-2); box-shadow: inset 0 0 0 1px var(--accent); }
.usage-v { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) {
  /* Month label above the bars, or the bar track shrinks to ~40px at 320px. */
  .usage-row { grid-template-columns: 1fr 64px; }
  .usage-mo { grid-column: 1 / -1; }
}


/* ==========================================================================
   Embed additions (scripts/vision-evals-embed.py). Everything above is the
   original stylesheet.
   ========================================================================== */
.cscene { font-size: 10px; font-weight: 500; color: var(--ink-2); line-height: 1.2; max-width: 64px; margin: 2px auto 0; }
.case-h.has-text { background: var(--accent-wash); }
@media (max-width: 420px) {
  .topbar-inner, .subbar-inner { padding-inline: 12px; }
  main.app { padding-inline: 12px; }
}
