/* srbf results frontend — a standalone, polished results explorer (not the docs site). */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #12141c;
  --ink-soft: #4a4f5e;
  --ink-faint: #868c9c;
  --line: #e6e8f0;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18, 20, 28, .04), 0 8px 24px rgba(18, 20, 28, .06);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
/* Dark tokens. Auto (the default, no data-theme attribute) follows the device; the header
   toggle sets html[data-theme="light"|"dark"] as an explicit override. The two blocks below
   must stay identical: one serves the manual override, one the auto path. */
html[data-theme="dark"] {
  --bg: #0c0e14;
  --surface: #151824;
  --ink: #eef0f6;
  --ink-soft: #b7bdcc;
  --ink-faint: #7c8397;
  --line: #232838;
  --accent: #8b8bff;
  --accent-soft: #1c2136;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0c0e14;
    --surface: #151824;
    --ink: #eef0f6;
    --ink-soft: #b7bdcc;
    --ink-faint: #7c8397;
    --line: #232838;
    --accent: #8b8bff;
    --accent-soft: #1c2136;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .9em; background: var(--accent-soft); color: var(--ink); padding: .08em .38em; border-radius: 6px; }
.wrap { width: min(1080px, 92vw); margin: 0 auto; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: .35rem 0; gap: .6rem; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 26px; height: 26px; border-radius: 7px; display: block; }
.brand-mark { font-family: var(--mono); font-weight: 600; font-size: 1.2rem; color: var(--accent); letter-spacing: -.02em; }
.brand-mark.small { font-size: 1rem; }
.brand-sub { color: var(--ink-soft); font-weight: 500; font-size: .92rem; }
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: flex-end; row-gap: .1rem; margin-left: auto; }
.site-nav a { color: var(--ink-soft); font-weight: 500; font-size: .92rem; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: .38rem; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .82rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { display: block; }
@media (max-width: 680px) { .brand-sub { display: none; } }
@media (max-width: 560px) {
  .site-nav { gap: .7rem; }
  .theme-toggle { padding: .3rem .45rem; }
  .theme-toggle .theme-name { display: none; }   /* icon says it on tight screens */
}

/* long series labels wrap inside their pill instead of overflowing the page */
@media (max-width: 560px) {
  .series-pill, .series-toggle { max-width: 100%; min-width: 0; }
  .series-name { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
}

/* wide formulas scroll inside their own box, never the page */
.katex-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding-bottom: .2rem; }

/* hero */
.hero { padding: 3rem 0 1.5rem; }
.kicker {
  margin: 0 0 .5rem; font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent);
}
.hero h1 { margin: 0 0 .6rem; font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; }
.lede { margin: 0; color: var(--ink-soft); font-size: 1.05rem; }
.lede strong { color: var(--ink); font-weight: 600; }
.lede-axes { margin: .7rem 0; padding-left: 1.2rem; color: var(--ink-soft); font-size: 1.02rem; }
.lede-axes li { margin: .3rem 0; }
.lede-axes strong { color: var(--ink); font-weight: 600; }

.va-wrap { margin: 1.4rem 0 0; }
.visual-abstract { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: var(--shadow); }
/* on narrow screens the abstract keeps a readable width and scrolls in its own box */
@media (max-width: 700px) {
  .va-wrap { overflow-x: auto; border-radius: 18px; }
  .visual-abstract { min-width: 760px; }
}

/* Inline visual abstract (#va): the palette of assets/brand/visual-abstract.svg, scoped and
   theme-switched here so the graphic follows the site theme (manual toggle included). Same
   two-block structure as the page tokens; keep the values in sync with the standalone SVG. */
#va {
  aspect-ratio: 1200 / 320;
  --va-bg: #ffffff;      --va-bg-line: #e6e8f0;
  --va-panel: #f6f7fb;   --va-panel-line: #e6e8f0;
  --va-panel2: #eef0fe;  --va-panel2-line: #dfe3fc;
  --va-cell: #ffffff;    --va-cell-line: #e6e8f0;
  --va-ink: #12141c;     --va-soft: #4a4f5e;     --va-faint: #868c9c;
  --va-accent: #4f46e5;  --va-grid: #d7dae4;     --va-grey: #9aa1b4;
}
html[data-theme="dark"] #va {
  --va-bg: #0c0e14;      --va-bg-line: #232838;
  --va-panel: #151824;   --va-panel-line: #232838;
  --va-panel2: #1c2136;  --va-panel2-line: #2a3050;
  --va-cell: #10131c;    --va-cell-line: #232838;
  --va-ink: #eef0f6;     --va-soft: #b7bdcc;     --va-faint: #7c8397;
  --va-accent: #8b8bff;  --va-grid: #333a4f;     --va-grey: #65788a;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #va {
    --va-bg: #0c0e14;      --va-bg-line: #232838;
    --va-panel: #151824;   --va-panel-line: #232838;
    --va-panel2: #1c2136;  --va-panel2-line: #2a3050;
    --va-cell: #10131c;    --va-cell-line: #232838;
    --va-ink: #eef0f6;     --va-soft: #b7bdcc;     --va-faint: #7c8397;
    --va-accent: #8b8bff;  --va-grid: #333a4f;     --va-grey: #65788a;
  }
}
#va .bg     { fill: var(--va-bg); stroke: var(--va-bg-line); }
#va .panel  { fill: var(--va-panel); stroke: var(--va-panel-line); }
#va .panel2 { fill: var(--va-panel2); stroke: var(--va-panel2-line); }
#va .cell   { fill: var(--va-cell); stroke: var(--va-cell-line); }
#va .ink    { fill: var(--va-ink); }
#va .soft   { fill: var(--va-soft); }
#va .faint  { fill: var(--va-faint); }
#va .accent { fill: var(--va-accent); }
#va .accent-stroke { stroke: var(--va-accent); }
#va .grid   { stroke: var(--va-grid); }
#va .grey   { fill: var(--va-grey); }
#va .grey-stroke { stroke: var(--va-grey); }

/* explorer panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem 1.7rem;
  margin: .5rem 0 2rem;
}
.explorer .loading { color: var(--ink-faint); padding: 5rem 0; text-align: center; }

/* controls emitted by explorer.js */
.results-controls { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: flex-start; margin: 0 0 1.1rem; }
.results-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; max-width: 100%; }
.results-field-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--ink-faint); }
.results-controls select {
  appearance: none; -webkit-appearance: none;
  padding: .5rem 2rem .5rem .7rem; min-width: min(14rem, 100%); max-width: 100%;
  font: inherit; font-size: .92rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23868c9c' d='M3 4.5 6 8l3-3.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.results-controls select:hover { border-color: var(--accent); }
.results-controls select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* series toggles as pills */
.results-series { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .4rem; }
.results-series label {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
  font-size: .84rem; font-weight: 500; color: var(--ink-soft);
  padding: .32rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); user-select: none; transition: background .15s, border-color .15s, color .15s;
}
.results-series label:hover { border-color: var(--accent); color: var(--ink); }
.results-series input { accent-color: var(--accent); margin: 0; }
.results-series input:checked ~ .results-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor; }
.results-swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; }

#results-plot { margin-top: .3rem; }

/* provenance / notes */
.notes { margin: 0 0 2.5rem; }
.provenance {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: .3rem 1.2rem; box-shadow: var(--shadow);
}
.provenance summary { cursor: pointer; font-weight: 600; padding: .8rem 0; color: var(--ink); }
.provenance summary::marker { color: var(--ink-faint); }
.provenance p { margin: .2rem 0 1rem; color: var(--ink-soft); font-size: .94rem; }

/* series groups + pills with colour swatch */
.series-area { display: flex; flex-direction: column; gap: .7rem; margin: 0 0 .5rem; }
.series-group { display: flex; flex-direction: column; gap: .35rem; }
.series-group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--ink-faint); }
.series-pill { display: inline-flex; }
.series-toggle {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
  font-size: .84rem; font-weight: 500; color: var(--ink-soft);
  padding: .28rem .55rem .28rem .5rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); user-select: none; transition: background .15s, border-color .15s, color .15s;
}
.series-toggle:hover { border-color: var(--accent); color: var(--ink); }
.series-toggle input[type="checkbox"] { accent-color: var(--accent); margin: 0; cursor: pointer; }
.series-name { white-space: nowrap; }
.series-swatch {
  width: 1.05rem; height: 1.05rem; padding: 0; border: 1px solid var(--line); border-radius: 4px;
  background: none; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.series-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.series-swatch::-webkit-color-swatch { border: none; border-radius: 3px; }
.series-swatch::-moz-color-swatch { border: none; border-radius: 3px; }
/* in Curves × Paired the baseline pill is the parked reference, not a toggle */
.series-pill.is-baseline .series-toggle {
  border-color: var(--accent); background: var(--accent-soft); color: var(--ink); cursor: default;
}
.series-pill.is-baseline input[type="checkbox"] { cursor: default; }
.baseline-tag {
  font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 5px; padding: .04em .32em; margin-left: .15em; white-space: nowrap;
}
.series-reset {
  display: none; align-items: center; justify-content: center;
  width: 1.05rem; height: 1.05rem; padding: 0; margin-left: -.15rem;
  border: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: .8rem; line-height: 1; cursor: pointer;
}
.series-reset:hover { background: var(--accent); color: #fff; }

.ablation-details { border: 1px dashed var(--line); border-radius: 12px; padding: .1rem .8rem .6rem; }
.ablation-details > summary { cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--ink-soft); padding: .55rem 0; list-style-position: inside; }
.ablation-details[open] > summary { margin-bottom: .3rem; }
.ablation-details .series-group { margin-top: .3rem; }

/* colour tools + cookie notice */
.colour-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin: 1rem 0 .2rem; }
.reset-all {
  font: inherit; font-size: .82rem; font-weight: 500; color: var(--ink-soft);
  padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.reset-all:hover { border-color: var(--accent); color: var(--accent); }
.cookie-notice { display: none; font-size: .78rem; color: var(--ink-faint); max-width: 62ch; }
.cookie-notice.visible { display: inline; }

/* prose sections: About these numbers + Metrics */
.prose { margin: 0 0 3rem; scroll-margin-top: 76px; }
.prose h2 {
  margin: 0 0 1rem; font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 800;
  letter-spacing: -.02em;
}
.prose h3 {
  margin: 2rem 0 .6rem; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em;
}
.prose > p, .prose > ol, .prose > ul { margin: 0 0 1rem; color: var(--ink-soft); font-size: .96rem; }
.prose > ol { padding-left: 1.3rem; }
.prose > ol li { margin: 0 0 .7rem; }
.prose strong, .prose li strong { color: var(--ink); font-weight: 600; }

.metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 1rem 1.3rem 1.05rem; margin: 0 0 .9rem;
}
.metric h4 {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin: 0 0 .4rem; font-size: 1rem; font-weight: 700; letter-spacing: -.01em;
}
.metric p { margin: .4rem 0 0; color: var(--ink-soft); font-size: .93rem; }
.dir {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  padding: .18rem .55rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-faint); white-space: nowrap;
}
.dir.up { color: #0f7b45; border-color: color-mix(in srgb, #0f7b45 35%, var(--line)); background: color-mix(in srgb, #0f7b45 7%, var(--surface)); }
.dir.down { color: #9a4f0b; border-color: color-mix(in srgb, #9a4f0b 35%, var(--line)); background: color-mix(in srgb, #9a4f0b 7%, var(--surface)); }
.dir.one { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
html[data-theme="dark"] .dir.up { color: #4ade80; }
html[data-theme="dark"] .dir.down { color: #fbbf24; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .dir.up { color: #4ade80; }
  html:not([data-theme="light"]) .dir.down { color: #fbbf24; }
}

/* KaTeX display blocks: card-friendly and scrollable on narrow screens */
.prose .katex-display { margin: .7rem 0; overflow-x: auto; overflow-y: hidden; padding: .2rem 0; }
.prose .katex { font-size: 1.02em; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; gap: .4rem 2rem; justify-content: space-between; padding: 1.4rem 0; color: var(--ink-faint); font-size: .88rem; }
.footer-inner .brand-mark.small { vertical-align: baseline; }

/* --- Paired views (WP1.D): tabs, Δ verdicts, matrix ------------------------------------ */
.view-tabs { display: flex; gap: 1.4rem; margin: 0 0 1rem; flex-wrap: wrap; align-items: stretch; }
/* the two toggles form one 2×2 system: a rule separates them from each other (labels stay) */
.view-toggle + .view-toggle { border-left: 1px solid var(--line); padding-left: 1.4rem; }
.view-tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  padding: .45rem .95rem; border-radius: 999px; font: inherit; font-size: .92rem; cursor: pointer;
}
.view-tab:hover { border-color: var(--accent); color: var(--ink); }
.view-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.paired-foot { margin-top: 1rem; }
.paired-verdicts {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 1rem 1.2rem; font-size: .92rem; color: var(--ink-soft);
}
.paired-verdicts-title { font-weight: 600; color: var(--ink); margin-bottom: .5rem; }
.paired-verdict-row { padding: .3rem 0; border-top: 1px dashed var(--line); line-height: 1.5; }
.paired-verdict-row:first-of-type { border-top: none; }
.paired-verdict-row .fam { color: var(--ink-faint); font-size: .85em; }

.matrix-wrap { overflow-x: auto; }
.matrix-warning {
  border: 1px solid #eab308; background: rgba(234, 179, 8, .12); color: var(--ink);
  border-radius: 10px; padding: .55rem .9rem; margin-bottom: .8rem; font-size: .92rem;
}
.paired-matrix { border-collapse: collapse; font-size: .82rem; }
.paired-matrix th, .paired-matrix td {
  border: 1px solid var(--line); padding: .3rem .5rem; text-align: center; white-space: nowrap;
}
.paired-matrix thead th { position: sticky; top: 0; background: var(--surface); font-weight: 600; }
.paired-matrix tbody th { text-align: left; background: var(--surface); font-weight: 600; position: sticky; left: 0; z-index: 2; }
.paired-matrix thead th:first-child { position: sticky; left: 0; z-index: 3; }
.paired-matrix td { cursor: help; position: relative; min-width: 4.2rem; }
.paired-matrix td[data-cell] { cursor: pointer; }
.paired-matrix td[data-cell]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* pinned cell: inset ink ring */
.paired-matrix td.selected { box-shadow: inset 0 0 0 2.5px var(--ink); }
.paired-matrix td.diag { color: var(--ink-faint); background: var(--bg); cursor: default; }
.paired-matrix td.missing { color: var(--ink-faint); background: var(--bg); font-style: italic; }
/* four verdict states — equivalent and undecided must NEVER share a look */
.paired-matrix td.v-better { background: rgba(22, 163, 74, .18); }
.paired-matrix td.v-worse { background: rgba(220, 38, 38, .18); }
.paired-matrix td.v-equivalent { background: rgba(37, 99, 235, .16); }
.paired-matrix td.v-undecided {
  background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(134, 140, 156, .12) 4px 8px);
  color: var(--ink-faint);
}
/* confirmatory cells carry only the small C badge (user decision 2026-07-03: the earlier
   accent outline + badge read as clutter); the pinned detail panel spells the status out */
.cell-badge {
  font-size: .62em; font-weight: 600; color: var(--accent); opacity: .75;
  vertical-align: super; margin-left: .2em;
}
/* tap/click-pinned full record of one matrix cell (hover titles are unreachable on touch) */
.matrix-detail {
  margin-top: .7rem; padding: .75rem 1rem; font-size: .9rem; line-height: 1.55;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; background: var(--bg);
}
.matrix-detail:empty { display: none; }
.matrix-detail-title { font-weight: 600; margin-bottom: .25rem; }
.matrix-detail .fam { color: var(--ink-faint); font-size: .85em; }

.plot-caption { font-size: .85rem; color: var(--ink-faint); line-height: 1.5; margin: .2rem 0 1rem; }

.matrix-legend { margin-top: .7rem; font-size: .85rem; color: var(--ink-soft); line-height: 1.6; }
.matrix-legend .v-better { color: #16a34a; font-weight: 600; }
.matrix-legend .v-worse { color: #dc2626; font-weight: 600; }
.matrix-legend .v-equivalent { color: #2563eb; font-weight: 600; }
.matrix-legend .v-undecided { color: var(--ink-faint); font-weight: 600; }

.results-field-hint { display: block; font-size: .72rem; color: var(--ink-faint); max-width: 15rem; line-height: 1.35; margin-top: .3rem; }

/* budget slider: the pre-declared grid on a log axis — snap points only */
.budget-slider { display: flex; flex-direction: column; min-width: 17rem; }
.budget-value { font-size: .92rem; color: var(--ink); padding: .15rem 0 .05rem; }
.budget-slider input[type="range"] { width: 100%; margin: .3rem 0 .2rem; accent-color: var(--accent); cursor: pointer; }
.budget-ticks { position: relative; height: 1.05rem; }
.budget-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  background: none; border: none; padding: 0 .15rem; font: inherit; font-size: .72rem;
  color: var(--ink-faint); cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.budget-tick.first { transform: none; }
.budget-tick.last { transform: translateX(-100%); }
.budget-tick:hover { color: var(--ink); }
.budget-tick.active { color: var(--accent); font-weight: 600; }
.budget-desc-tag {
  font-size: .68em; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-faint); border: 1px solid var(--line); border-radius: 6px;
  padding: .05em .4em; margin-left: .35em; vertical-align: middle;
}

/* compact controls on phones: toggles keep their headings and share one row (the divider
   spans both label and buttons), the budget slider gets the full width */
@media (max-width: 560px) {
  .view-tabs { gap: .5rem; }
  .view-toggle + .view-toggle { padding-left: .5rem; }
  .view-toggle-group { gap: .18rem; }
  .view-tab { padding: .26rem .34rem; font-size: .74rem; }
  .results-field:has(.budget-slider) { flex: 1 1 100%; }
  .budget-slider { min-width: 0; width: 100%; }
}

/* free slider positions: descriptive reads of the plotted curves, never verdicts */
.desc-banner {
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .9rem; margin: .2rem 0 .8rem; font-size: .85rem; color: var(--ink-soft);
  line-height: 1.5;
}
.paired-matrix td.desc { background: var(--bg); }
.cell-verdict { font-size: .7em; margin-left: .3em; color: var(--ink-faint); }

/* 2×2 view toggles */
.view-toggle { display: flex; flex-direction: column; gap: .3rem; }
.view-toggle-group { display: flex; gap: .35rem; }
.view-tab.disabled { opacity: .35; pointer-events: none; }

.tap-hint { font-size: .78rem; color: var(--ink-faint); margin: .45rem 0 0; }
.key-band {
  display: inline-block; width: 1.1em; height: .8em; vertical-align: -0.08em;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 2px;
}

.metric-badge { margin-left: .55rem; vertical-align: baseline; text-transform: uppercase; }

/* contextual help: ?-links on control labels, tap-to-define terms, collapsed fine print */
.help-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15em; height: 1.15em; margin-left: .45em; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink-faint); font-size: .85em;
  text-decoration: none; line-height: 1; vertical-align: baseline;
}
.help-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.term { border-bottom: 1px dotted var(--ink-faint); cursor: help; }
.term:hover { border-bottom-color: var(--accent); }
/* floating hint card: fixed at body level so revealed content never reflows the page */
.term-pop {
  position: fixed; z-index: 60; margin: 0; padding: .6rem .85rem; max-width: 34rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; box-shadow: var(--shadow);
  font-size: .84rem; color: var(--ink); line-height: 1.5;
  font-weight: 400; text-transform: none; letter-spacing: normal;
}
.fine-print { margin-top: .45rem; }
.fine-print > summary {
  cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--ink-faint);
  list-style-position: inside;
}
.fine-print > summary:hover { color: var(--accent); }
.fine-print > div { margin-top: .4rem; }

/* rank-league chips */
.rank-primary {
  font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: .05em .45em;
}
.rank-exploratory {
  font-size: .78em; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); border: 1px solid var(--line); border-radius: 6px; padding: .05em .45em;
}

/* Table × Absolute leaderboard */
.abs-table th, .abs-table td { text-align: left; white-space: nowrap; }
.abs-table tbody th { font-weight: 500; }
.abs-table .lb-value b { font-weight: 600; }
.abs-table .lb-x, .abs-table .lb-n { color: var(--ink-soft); }
.lb-flag {
  font-size: .68em; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-faint); border: 1px solid var(--line); border-radius: 6px;
  padding: .05em .4em; margin-left: .4em; vertical-align: middle;
}
.lb-swatch {
  display: inline-block; width: .7em; height: .7em; border-radius: 50%;
  margin-right: .45em; vertical-align: baseline;
}
