:root {
  --bg: #eef1f0;
  --surface: #ffffff;
  --ink: #15202b;
  --muted: #566573;
  --rule: #cbd3d6;
  --interval: #2748e8;
  --band: rgba(39, 72, 232, 0.11);
  --band2: rgba(180, 35, 80, 0.10);
  --up: #1b7a58;
  --down: #b45309;
  --flag: #b42350;
  --focus: #2748e8;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1720; --surface: #16212c; --ink: #e6edf3; --muted: #93a1af; --rule: #2a3844;
    --interval: #86a0ff; --band: rgba(134, 160, 255, 0.14); --band2: rgba(255, 122, 158, 0.14);
    --up: #5fd3a0; --down: #f2a650; --flag: #ff7a9e; --focus: #86a0ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
}
.row, .facts dd, .bars, .axis-row, .r-n { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
a { color: var(--interval); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

h1 { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; margin: 28px 0 10px; font-weight: 700; }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.75rem); line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.lede { font-size: clamp(1.05rem, 2.6vw, 1.3rem); line-height: 1.4; max-width: 46rem; margin: 0 0 20px; }
.sub { color: var(--muted); max-width: 46rem; margin: 0 0 16px; }
.note { color: var(--muted); font-size: 0.875rem; max-width: 46rem; margin: 12px 0 0; }

/* Read-first block */
.readfirst { background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--down); border-radius: 4px; padding: 16px 16px 8px; margin-bottom: 8px; }
.readfirst h2 { font-size: 1.1rem; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin: 12px 0 14px; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 0.8125rem; }
.facts dd { margin: 0; font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.limits { margin: 0 0 8px; padding-left: 1.1rem; max-width: 52rem; }
.limits li { margin-bottom: 8px; }

section { padding: 36px 0 8px; }
.top + main section:first-child { padding-top: 28px; }

/* Pair readout */
.pair { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 14px 16px; margin-bottom: 18px; min-height: 5.5rem; }
.pair .verdict { font-size: 1.15rem; font-weight: 600; margin: 0 0 4px; }
.pair .flip { color: var(--flag); font-weight: 700; }
.pair p { margin: 0 0 6px; }
.pair .hint { color: var(--muted); font-size: 0.875rem; }
.pair .dists { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.dist svg { display: block; width: 100%; height: 44px; }
.dist .cap { font-size: 0.8125rem; color: var(--muted); }
.clear { margin-top: 8px; font: inherit; font-size: 0.875rem; background: none; border: 1px solid var(--rule); border-radius: 4px; padding: 4px 10px; color: var(--ink); cursor: pointer; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.legend .dot { width: 9px; height: 9px; background: var(--ink); border-radius: 50%; }
.legend .bar { width: 22px; height: 4px; background: var(--interval); border-radius: 2px; }
.legend .band { width: 14px; height: 12px; background: var(--band); border: 1px solid var(--interval); }

/* Ranking list */
.rows, .bars { list-style: none; margin: 0; padding: 0; }
.axis-row { display: none; }
.row { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 0; border-top: 1px solid var(--rule); padding: 8px 10px; cursor: pointer; display: grid; grid-template-columns: 2.4rem 1fr auto; grid-template-areas: "rank name n" "track track track"; column-gap: 8px; row-gap: 2px; align-items: baseline; }
.rows li:last-child .row { border-bottom: 1px solid var(--rule); }
.row:hover { background: color-mix(in srgb, var(--surface) 85%, var(--interval) 15%); }
.row[aria-pressed="true"] { box-shadow: inset 4px 0 0 var(--interval); }
.row[disabled] { cursor: default; color: var(--muted); }
.row[disabled]:hover { background: var(--surface); }
.r-rank { grid-area: rank; font-weight: 700; }
.r-name { grid-area: name; min-width: 0; overflow-wrap: anywhere; }
.r-name small { color: var(--muted); display: block; font-size: 0.8125rem; }
.r-rng { color: var(--muted); font-size: 0.8125rem; }
.r-n { grid-area: n; color: var(--muted); font-size: 0.8125rem; text-align: right; }
.r-track { grid-area: track; position: relative; height: 22px; }
.r-track .ln { position: absolute; top: 9px; height: 4px; border-radius: 2px; background: var(--interval); opacity: 0.85; }
.r-track .pt { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); }
.r-track .bd { position: absolute; top: -9px; bottom: -9px; background: var(--band); border-left: 1px solid var(--interval); border-right: 1px solid var(--interval); }
.r-track .bd.b2 { background: var(--band2); border-color: var(--flag); }
.r-track .none { position: absolute; left: 0; top: 2px; font-size: 0.8125rem; color: var(--muted); }
.thin-tag { color: var(--down); font-weight: 600; }

/* Bump chart */
.controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.controls select { font: inherit; padding: 6px 8px; border-radius: 4px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); }
.bumpchart { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 8px 4px; overflow: hidden; }
.bumpchart svg { display: block; width: 100%; }
.bumpchart text { font-family: var(--font); font-size: 12px; fill: var(--ink); }
.bumpchart .hd { font-weight: 600; fill: var(--muted); }
.bumpchart .rk { fill: var(--muted); }
.bumpchart .ln { fill: none; stroke-linecap: round; cursor: pointer; }
.bumpchart .grp { cursor: pointer; }
.bumpchart .dim { opacity: 0.28; }

/* Exposure */
.twocol { display: grid; grid-template-columns: 1fr; gap: 28px; }
.bars li { display: grid; grid-template-columns: minmax(6.5rem, 38%) 1fr; gap: 8px; align-items: center; padding: 3px 0; font-size: 0.9375rem; }
.bars .lbl { overflow-wrap: anywhere; line-height: 1.2; }
.bars .track { position: relative; height: 18px; background: color-mix(in srgb, var(--rule) 45%, transparent); border-radius: 2px; }
.bars .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--interval); border-radius: 2px; }
.bars .val { position: absolute; left: 6px; top: 0; line-height: 18px; font-size: 0.75rem; font-weight: 600; color: #fff; white-space: nowrap; mix-blend-mode: normal; }
.bars .val.out { color: var(--ink); }
.bars.compact li { font-size: 0.8125rem; padding: 1px 0; }
.bars.compact .track { height: 14px; }
.bars.compact .val { line-height: 14px; font-size: 0.6875rem; }

/* Limits card */
.card { background: var(--surface); border: 1px solid var(--rule); border-top: 5px solid var(--flag); border-radius: 4px; padding: 20px 16px; margin: 40px 0 0; }
.cannot { padding-left: 1.1rem; max-width: 50rem; }
.cannot li { margin-bottom: 8px; }
.links a { margin-right: 4px; }

.foot { padding: 28px 16px 48px; color: var(--muted); font-size: 0.875rem; }
.foot p { max-width: 46rem; }

/* Wider screens: one-line rows with the interval in a shared axis column */
@media (min-width: 760px) {
  .facts { grid-template-columns: repeat(4, 1fr); }
  .pair .dists { grid-template-columns: 1fr 1fr; }
  .twocol { grid-template-columns: 1fr 1.3fr; }
  .axis-row { display: grid; grid-template-columns: 2.6rem 15rem 1fr 5.5rem; column-gap: 12px; padding: 0 10px; color: var(--muted); font-size: 0.75rem; position: relative; height: 22px; }
  .axis-row .ticks { position: relative; grid-column: 3; }
  .axis-row .tick { position: absolute; top: 0; transform: translateX(-50%); }
  .row { grid-template-columns: 2.6rem 15rem 1fr 5.5rem; grid-template-areas: "rank name track n"; column-gap: 12px; align-items: center; padding: 6px 10px; }
  .r-track { height: 28px; }
  .r-track .ln { top: 12px; }
  .r-track .pt { top: 8px; }
  .r-track .bd { top: -6px; bottom: -6px; }
}
@media (prefers-reduced-motion: no-preference) {
  .r-track .ln, .r-track .pt { transition: opacity 0.15s; }
}
