/* AI Pulse - two news streams and a benchmarks hub.
   Tokens follow the validated data-viz palette (series slots, surfaces, inks);
   dark mode is its own set of steps, applied by the OS setting or the toggle. */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --surface-3: #e8e7e1;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6c6b66;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #1f5fae;
  --accent-wash: rgba(42, 120, 214, 0.09);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --dim: #d4d3cc;
  --good: #0ca30c;
  --good-text: #006300;
  --good-wash: rgba(12, 163, 12, 0.07);
  --warn: #fab219;
  --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px rgba(11, 11, 11, 0.06);
  --h0: #e3eefc; --h1: #cde2fb; --h2: #b7d3f6; --h3: #9ec5f4; --h4: #86b6ef;
  --h5: #5598e7; --h6: #3987e5; --h7: #2a78d6; --h8: #1c5cab;
  --radius: 12px;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242422;
    --surface-3: #2e2e2b;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #a09f98;
    --line: #2c2c2a;
    --line-strong: #444440;
    --ring: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --dim: #3d3d3a;
    --good-text: #3ec43e;
    --good-wash: rgba(12, 163, 12, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --h0: #0d366b; --h1: #104281; --h2: #184f95; --h3: #1c5cab; --h4: #256abf;
    --h5: #2a78d6; --h6: #3987e5; --h7: #5598e7; --h8: #86b6ef;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #242422;
  --surface-3: #2e2e2b;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #a09f98;
  --line: #2c2c2a;
  --line-strong: #444440;
  --ring: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --accent-ink: #86b6ef;
  --accent-wash: rgba(57, 135, 229, 0.16);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --dim: #3d3d3a;
  --good-text: #3ec43e;
  --good-wash: rgba(12, 163, 12, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --h0: #0d366b; --h1: #104281; --h2: #184f95; --h3: #1c5cab; --h4: #256abf;
  --h5: #2a78d6; --h6: #3987e5; --h7: #5598e7; --h8: #86b6ef;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  height: 56px; padding: 0 24px;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; text-decoration: none; letter-spacing: -0.02em; }
.brand__mark { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tabs { display: flex; gap: 4px; }
.tabs a {
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-weight: 500; font-size: 0.92rem;
}
.tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--page); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: 999px; }
.live:hover { background: var(--surface-2); color: var(--ink); }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.live[data-state="ok"] .live__dot { background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.live[data-state="degraded"] .live__dot { background: var(--warn); }
.live[data-state="down"] .live__dot { background: var(--critical); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer;
  font-size: 0.88rem; font-weight: 500;
}
.btn:hover { border-color: var(--ink-2); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn--icon { width: 34px; padding: 0; border-color: transparent; background: transparent; }
.btn--icon:hover { background: var(--surface-2); border-color: transparent; }
.btn--icon svg { width: 18px; height: 18px; fill: var(--ink-2); }
.btn--more { margin: 12px auto 0; display: flex; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.banner {
  margin: 0; padding: 10px 24px; font-size: 0.9rem;
  background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--ink);
}

main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 24px 48px; outline: none; }
.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1320px; width: 100%; margin: 0 auto; padding: 16px 24px 28px;
  color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line);
}
.footer p { margin: 0; }

/* ---------- page heads & controls ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -0.035em; }
.page-sub { margin: 6px 0 0; color: var(--ink-2); max-width: 70ch; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { position: relative; display: inline-flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input {
  width: 240px; height: 36px; padding: 0 12px 0 34px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.finder { margin: 0; }
.finder input { width: 210px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; border-radius: 999px; padding: 5px 12px;
  font-size: 0.85rem; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px var(--ring), 0 0 0 1px var(--ring); }
.seg--streams { display: none; margin-bottom: 14px; }

.labbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 0.84rem; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.chip__n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.78rem; }
.chip[aria-pressed="true"] .chip__n { color: inherit; opacity: 0.75; }

/* ---------- the two streams ---------- */
.streams { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.stream__head { display: flex; align-items: baseline; gap: 10px; }
.stream__head h2 { font-size: 1.12rem; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.stream__icon {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.8rem; font-weight: 700; background: var(--ink); color: var(--page);
}
.stream--rumor .stream__icon { background: var(--surface-3); color: var(--ink); }
.stream__count { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.stream__about { margin: 4px 0 14px; color: var(--muted); font-size: 0.85rem; }
.stream__list { display: flex; flex-direction: column; gap: 10px; }
.day { margin: 12px 0 2px; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.day:first-child { margin-top: 0; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

.story {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px 12px;
}
.story:hover { border-color: var(--line-strong); }
.story--new::before {
  content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.story__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.story__lab { font-weight: 600; color: var(--ink); }
.story__dot::before { content: "\00b7"; }
.story__title { margin: 5px 0 0; font-size: 1.02rem; font-weight: 600; line-height: 1.32; letter-spacing: -0.01em; }
.story__title a { text-decoration: none; }
.story__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.story__summary { margin: 6px 0 0; color: var(--ink-2); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story__models { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.model {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 0.8rem; font-weight: 500;
  text-decoration: none; color: var(--ink);
}
a.model:hover { border-color: var(--accent); background: var(--accent-wash); }
.model__score { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.story__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--ink-2); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.coverage-toggle { border: 0; background: none; padding: 2px 0; color: var(--ink-2); font-size: 0.8rem; cursor: pointer; }
.coverage-toggle:hover { color: var(--ink); text-decoration: underline; }
.coverage { margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); list-style: none; display: grid; gap: 4px; }
.coverage li { display: flex; gap: 8px; font-size: 0.82rem; }
.coverage a { color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage a:hover { color: var(--ink); text-decoration: underline; }
.coverage__src { flex: none; width: 9.5em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; }
.status svg { width: 14px; height: 14px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.status--confirmed { color: var(--good-text); }
.status--confirmed svg { stroke: var(--good); }
.status--open { color: var(--ink-2); font-weight: 500; }
.status--open svg { stroke: var(--muted); }
.status a { color: inherit; }
.rumored { font-size: 0.78rem; color: var(--muted); }

.story--listing { padding: 10px 14px; }
.story--listing .story__title { font-size: 0.93rem; font-weight: 500; }

/* ---------- panels, KPIs, filters (benchmarks) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel--flush { padding: 0; overflow: hidden; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stack { display: grid; gap: 18px; }
.section-title { font-size: 1.05rem; font-weight: 700; margin: 26px 0 12px; }
.section-title:first-child { margin-top: 0; }
.muted { color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi__label { font-size: 0.8rem; color: var(--muted); }
.kpi__value { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; margin-top: 2px; }
.kpi__note { font-size: 0.78rem; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.subtabs { display: flex; gap: 2px; flex-wrap: wrap; }
.subtabs a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.9rem; }
.subtabs a:hover { background: var(--surface-2); color: var(--ink); }
.subtabs a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.filters { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filters label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--ink-2); }
.filters select, .picker select {
  height: 32px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.filters__spacer { flex: 1; }
.filters__count { font-size: 0.82rem; color: var(--muted); }

.bench-body { transition: opacity 0.15s ease; }
.bench-body.is-loading { opacity: 0.55; }
.attribution { margin-top: 26px; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.attribution a { color: var(--ink-2); }
.source-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.source-list span { display: inline-flex; align-items: center; gap: 6px; }
.source-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }
.source-list i.is-cached { background: var(--warn); }
.source-list i.is-off { background: var(--line-strong); }

/* just released: new models and the results published so far */
.section-sub { margin: -6px 0 12px; font-size: 0.82rem; color: var(--muted); max-width: 90ch; }
.fresh { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.fresh-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fresh-card__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fresh-card__swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.fresh-card__swatch.s1 { background: var(--series-1); }
.fresh-card__swatch.s2 { background: var(--series-2); }
.fresh-card__name { font-size: 0.98rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fresh-card__name:hover { text-decoration: underline; }
.fresh-card__meta { margin: 0; font-size: 0.76rem; color: var(--muted); }
.fresh-card__results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.fresh-card__results li { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto; align-items: baseline; gap: 8px; font-size: 0.82rem; }
.fresh-card__rank { font-weight: 700; font-variant-numeric: tabular-nums; }
.fresh-card__rank small { font-size: 0.72rem; font-weight: 400; color: var(--muted); }
.fresh-card__bench { color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fresh-card__bench:hover { color: var(--ink); text-decoration: underline; }
.fresh-card__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.fresh-card__foot { margin: auto 0 0; padding-top: 10px; font-size: 0.75rem; color: var(--muted); }
.fresh-card__foot a { color: var(--ink-2); }
.fresh__more { margin-top: 10px; }

/* category small multiples */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.cat__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cat__title { font-size: 0.95rem; font-weight: 700; }
.cat__bench { font-size: 0.8rem; color: var(--ink-2); text-decoration: none; }
.cat__bench:hover { text-decoration: underline; }
.cat__meta { margin: 2px 0 10px; font-size: 0.76rem; color: var(--muted); }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.mini__row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 0.82rem; }
.mini__name { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini__name:hover { text-decoration: underline; }
.mini__track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.mini__fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.mini__fill.s1 { background: var(--series-1); }
.mini__fill.s2 { background: var(--series-2); }
.mini__value { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.8rem; min-width: 4.2em; text-align: right; }

/* leaderboards */
.board { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.board__nav { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: auto; padding: 12px; }
.board__search { width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); margin-bottom: 8px; }
.board__cat { margin: 12px 4px 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.board__item {
  display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 8px;
  border: 0; border-radius: 7px; background: none; text-align: left; font-size: 0.86rem; color: var(--ink-2); cursor: pointer;
}
.board__item:hover { background: var(--surface-2); color: var(--ink); }
.board__item[aria-current="true"] { background: var(--accent-wash); color: var(--ink); font-weight: 600; }
.board__item .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.78rem; font-weight: 400; }
.bench-head h2 { font-size: 1.35rem; font-weight: 700; }
.bench-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 75ch; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 16px; font-size: 0.83rem; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 600; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.75rem; color: var(--ink-2); }

/* tables */
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.data-table th, .data-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table thead th { position: sticky; top: 0; background: var(--surface); font-size: 0.78rem; font-weight: 600; color: var(--muted); z-index: 1; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table a { text-decoration: none; font-weight: 500; }
.data-table a:hover { text-decoration: underline; }
.sort-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.sort-btn[aria-sort="descending"]::after { content: " \2193"; }
.sort-btn[aria-sort="ascending"]::after { content: " \2191"; }
.weights { font-size: 0.78rem; }
.weights--open { color: var(--ink); }
.weights--open::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--series-2); margin-right: 6px; vertical-align: 0; }
.weights--closed::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--series-1); margin-right: 6px; vertical-align: 0; }

/* model page & compare */
.model-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.model-head h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.scorelist { list-style: none; margin: 0; padding: 0; }
.scorelist li { display: grid; grid-template-columns: minmax(0, 1.6fr) 7em minmax(90px, 1fr) 6.5em; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.scorelist li:last-child { border-bottom: 0; }
.scorelist a { text-decoration: none; }
.scorelist a:hover { text-decoration: underline; }
.scorelist .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.scorelist .rank { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; font-size: 0.8rem; }
.pct { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.pct span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.picked { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 0.85rem; font-weight: 500; }
.picked button { border: 0; background: var(--surface-2); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key.s1 { background: var(--series-1); } .key.s2 { background: var(--series-2); }
.key.s3 { background: var(--series-3); } .key.s4 { background: var(--series-4); }
.cmp { display: grid; gap: 4px; }
.cmp__cat { margin: 16px 0 4px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cmp__row { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: 14px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cmp__name { font-size: 0.86rem; text-decoration: none; }
.cmp__name:hover { text-decoration: underline; }
.cmp__bars { display: grid; gap: 3px; }
.cmp__bar { display: grid; grid-template-columns: minmax(0, 1fr) 5.5em; align-items: center; gap: 8px; font-size: 0.78rem; }
.cmp__track { height: 10px; }
.cmp__fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.cmp__fill.s1 { background: var(--series-1); } .cmp__fill.s2 { background: var(--series-2); }
.cmp__fill.s3 { background: var(--series-3); } .cmp__fill.s4 { background: var(--series-4); }
.cmp__val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.cmp__val.is-best::after { content: " \2605"; color: var(--ink-2); font-weight: 400; }
.cmp__miss { color: var(--muted); font-style: italic; }

/* heatmap */
.heat-wrap { overflow: auto; max-height: 74vh; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 0.8rem; }
.heat th, .heat td { padding: 0; }
.heat thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; vertical-align: bottom; }
.heat__corner { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px !important; }
.heat__colbtn { border: 0; background: none; cursor: pointer; writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 2px; font-size: 0.76rem; color: var(--ink-2); max-height: 150px; text-align: left; }
.heat__colbtn:hover { color: var(--ink); text-decoration: underline; }
.heat__row { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 4px 10px 4px 4px !important; white-space: nowrap; font-weight: 500; z-index: 1; }
.heat__row a { text-decoration: none; }
.heat__row a:hover { text-decoration: underline; }
.heat__sub { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.heat__cell { min-width: 52px; height: 30px; text-align: center; font-variant-numeric: tabular-nums; border-radius: 4px; }
.heat__cell--empty { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--surface-2) 4px 5px); }
.h0 { background: var(--h0); color: var(--ink); } .h1 { background: var(--h1); color: var(--ink); }
.h2 { background: var(--h2); color: var(--ink); } .h3 { background: var(--h3); color: var(--ink); }
.h4 { background: var(--h4); color: #0b0b0b; } .h5 { background: var(--h5); color: #fff; }
.h6 { background: var(--h6); color: #fff; } .h7 { background: var(--h7); color: #fff; }
.h8 { background: var(--h8); color: #fff; }
:root[data-theme="dark"] .h0, :root[data-theme="dark"] .h1, :root[data-theme="dark"] .h2,
:root[data-theme="dark"] .h3, :root[data-theme="dark"] .h4, :root[data-theme="dark"] .h5,
:root[data-theme="dark"] .h6 { color: #fff; }
:root[data-theme="dark"] .h7, :root[data-theme="dark"] .h8 { color: #0b0b0b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .h0, :root:not([data-theme="light"]) .h1, :root:not([data-theme="light"]) .h2,
  :root:not([data-theme="light"]) .h3, :root:not([data-theme="light"]) .h4, :root:not([data-theme="light"]) .h5,
  :root:not([data-theme="light"]) .h6 { color: #fff; }
  :root:not([data-theme="light"]) .h7, :root:not([data-theme="light"]) .h8 { color: #0b0b0b; }
}
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--muted); margin-top: 10px; }
.heat-legend__ramp { display: inline-grid; grid-auto-flow: column; gap: 2px; }
.heat-legend__ramp span { width: 22px; height: 10px; border-radius: 2px; }

/* ---------- charts ---------- */
.viz { margin: 0; }
.viz__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.viz__title { font-size: 1rem; font-weight: 700; }
.viz__subtitle { margin: 3px 0 0; font-size: 0.82rem; color: var(--muted); }
.viz__toggle { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 0.76rem; color: var(--ink-2); cursor: pointer; }
.viz__toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.viz__legend { display: flex; gap: 14px; flex-wrap: wrap; list-style: none; margin: 0 0 8px; padding: 0; font-size: 0.8rem; color: var(--ink-2); }
.viz__legend li { display: inline-flex; align-items: center; gap: 6px; }
.viz__swatch { width: 12px; height: 10px; border-radius: 2px; display: inline-block; }
.viz__swatch--line { height: 2px; border-radius: 1px; width: 16px; }
.viz__swatch.s1 { background: var(--series-1); } .viz__swatch.s2 { background: var(--series-2); }
.viz__swatch.s3 { background: var(--series-3); } .viz__swatch.s4 { background: var(--series-4); }
.viz__swatch.dim { background: var(--dim); }
.viz__plot { position: relative; }
.viz__table { max-height: 480px; overflow: auto; }
.viz__note { margin: 8px 0 0; font-size: 0.76rem; color: var(--muted); }
.viz__empty { margin: 0; padding: 30px 0; text-align: center; color: var(--muted); }
.viz-svg { display: block; overflow: visible; font-family: var(--sans); }
.viz-grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.viz-baseline { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-axis-title { fill: var(--muted); font-size: 11px; font-weight: 600; }
.viz-label { fill: var(--ink); font-size: 12px; }
.viz-value { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-hit { fill: transparent; }
.viz-row { cursor: default; outline: none; }
.viz-row.is-link, .viz-hit.is-link { cursor: pointer; }
.viz-row:hover .viz-hit, .viz-row:focus-visible .viz-hit { fill: var(--surface-2); }
.viz-row:focus-visible .viz-label { font-weight: 600; }
.viz-bar.s1 { fill: var(--series-1); } .viz-bar.s2 { fill: var(--series-2); }
.viz-bar.s3 { fill: var(--series-3); } .viz-bar.s4 { fill: var(--series-4); }
.viz-bar.dim { fill: var(--dim); }
.viz-row.is-dim .viz-label, .viz-row.is-dim .viz-value { fill: var(--muted); }
.viz-ci { stroke: var(--ink-2); stroke-width: 1; }
.viz-marker { stroke: var(--ink-2); stroke-width: 1; opacity: 0.55; }
.viz-marker-label { fill: var(--muted); font-size: 10.5px; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-dot.s1 { fill: var(--series-1); } .viz-dot.s2 { fill: var(--series-2); }
.viz-dot.s3 { fill: var(--series-3); } .viz-dot.dim { fill: var(--dim); }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line.s1 { stroke: var(--series-1); } .viz-line.s2 { stroke: var(--series-2); } .viz-line.s3 { stroke: var(--series-3); }
/* Joins one model's runs (a cost/performance curve): context, never data-loud. */
.viz-line.link { stroke: var(--line-strong); stroke-width: 1; }
/* The surface-coloured halo keeps labels legible where they cross lines or dots. */
.viz-point-label { fill: var(--ink-2); font-size: 11px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.viz-focus-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; pointer-events: none; }
.viz-quadrant { fill: var(--good-wash); }
.viz-quadrant-label { fill: var(--good-text); font-size: 11px; font-weight: 600; }
.viz-hit[tabindex]:focus-visible { outline: none; stroke: var(--accent); stroke-width: 1.5; }
.viz-tip {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  min-width: 140px; max-width: 280px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 0.8rem; line-height: 1.4;
}
.viz-tip__value { font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.viz-tip__line { color: var(--ink-2); }
.viz-tip__key { display: inline-block; width: 12px; height: 2px; margin: 0 6px 3px 0; vertical-align: middle; }
.viz-tip__key.s1 { background: var(--series-1); } .viz-tip__key.s2 { background: var(--series-2); }

/* ---------- source health ---------- */
.health-table td.status-healthy { color: var(--good-text); font-weight: 600; }
.health-table td.status-degraded { color: var(--ink); font-weight: 600; }
.health-table td.status-failing { color: var(--critical); font-weight: 600; }
.health-table td.err { white-space: normal; min-width: 220px; color: var(--ink-2); font-size: 0.8rem; }
.stream-tag { font-size: 0.75rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Only stories that arrived since the last refresh move; content never waits on an animation. */
  .story--new { animation: arrive 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
  @keyframes arrive { from { transform: translateY(-4px); } to { transform: none; } }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .streams { grid-template-columns: minmax(0, 1fr); }
  .seg--streams { display: inline-flex; }
  .streams[data-show="official"] .stream--rumor { display: none; }
  .streams[data-show="rumor"] .stream--official { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .board__nav { position: static; max-height: 280px; }
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { gap: 12px; padding: 0 16px; }
  .live span:last-child { display: none; }
}
@media (max-width: 640px) {
  main { padding: 20px 16px 40px; }
  .brand span { display: none; }
  .tabs a { padding: 6px 10px; font-size: 0.86rem; white-space: nowrap; }
  .wide-only { display: none; }
  #refresh { display: none; }
  .search input { width: 100%; }
  .search, .controls { width: 100%; }
  .scorelist li { grid-template-columns: minmax(0, 1fr) 6em 6em; }
  .scorelist .pctcell { display: none; }
  .cmp__row { grid-template-columns: 1fr; gap: 6px; }
  .coverage__src { width: 7em; }
  .footer { padding: 14px 16px 24px; }
}
