:root {
  color-scheme: light;
  --surface: #fcfcfb; --panel: #ffffff; --ink: #0b0b0b; --ink2: #52514e; --muted: #6b6a66;
  --line: #e4e3df; --grid: #ececE8; --accent: #2a78d6; --hover: #f2f1ee;
  --c2026: #2a78d6; --c2022: #eb6834; --c2018: #1baf7a; --c2024: #6250d6;
  --k1: #2a78d6; --k2: #eb6834; --k3: #1baf7a; --k4: #eda100; --k5: #e87ba4; --k6: #008300;
  --good: #0a7a0a; --bad: #b32f2f;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface: #1a1a19; --panel: #222221; --ink: #f0efec; --ink2: #c3c2b7; --muted: #a09f98;
    --line: #383835; --grid: #2e2e2c; --accent: #3987e5; --hover: #2b2b29;
    --c2026: #3987e5; --c2022: #d95926; --c2018: #199e70; --c2024: #9085e9;
    --k1: #3987e5; --k2: #d95926; --k3: #199e70; --k4: #c98500; --k5: #d55181; --k6: #2f9e2f;
    --good: #5fd05f; --bad: #ee7b7b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a19; --panel: #222221; --ink: #f0efec; --ink2: #c3c2b7; --muted: #a09f98;
  --line: #383835; --grid: #2e2e2c; --accent: #3987e5; --hover: #2b2b29;
  --c2026: #3987e5; --c2022: #d95926; --c2018: #199e70; --c2024: #9085e9;
  --k1: #3987e5; --k2: #d95926; --k3: #199e70; --k4: #c98500; --k5: #d55181; --k6: #2f9e2f;
  --good: #5fd05f; --bad: #ee7b7b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--panel); padding: 6px 10px; z-index: 20; }
a { color: var(--accent); }
code { font-size: .9em; background: var(--hover); padding: 0 4px; border-radius: 3px; }

.top { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 12px; }
h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.asof { margin: 2px 0 0; color: var(--ink2); font-size: .9rem; }
.nav { display: flex; gap: 4px 14px; overflow-x: auto; padding-top: 6px; padding-bottom: 8px; white-space: nowrap; }
.nav a { color: var(--ink2); text-decoration: none; font-size: .9rem; padding: 2px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.btn, select, input[type=search], .seg button { font: inherit; font-size: .9rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.btn { cursor: pointer; } .btn:hover, .seg button:hover { background: var(--hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

section { padding: 28px 0 8px; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
h2 { margin: 0 0 6px; font-size: 1.3rem; }
h3 { margin: 22px 0 6px; font-size: 1.05rem; }
.lede { color: var(--ink2); margin: 0 0 14px; max-width: 78ch; }
.src, .fine { color: var(--muted); font-size: .85rem; max-width: 90ch; }
.note { background: var(--hover); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 4px; }
.note.err { border-left-color: var(--bad); }

.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 8px 0 12px; }
.controls label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); max-width: 100%; }
.controls label select, .controls label input { color: var(--ink); }
.controls .grow { flex: 1 1 200px; }
.controls select { max-width: 100%; }
.seg { display: inline-flex; padding: 0; border: 0; gap: 0; }
.seg button { border-radius: 0; margin-left: -1px; cursor: pointer; }
.seg button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; } .seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; position: relative; z-index: 1; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.card .lbl { font-size: .8rem; color: var(--muted); }
.card .big { font-size: 1.9rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.card .cmp { font-size: .9rem; color: var(--ink2); margin-top: 2px; }
.card .also { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.up { color: var(--good); } .down { color: var(--bad); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.tablewrap.tall { max-height: 560px; overflow-y: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 6px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); }
table.data thead th { position: sticky; top: 0; background: var(--panel); z-index: 2; font-weight: 600; color: var(--ink2); font-size: .8rem; }
table.data thead th:first-child { z-index: 3; }
table.data thead tr.grp th { text-align: center; border-bottom: 0; padding-bottom: 0; }
table.data tr.tot td { font-weight: 650; }
table.data tbody tr:hover td { background: var(--hover); }
table.sortable th[data-k] { cursor: pointer; user-select: none; }
table.sortable th[data-k]:hover { color: var(--ink); }
table.sortable th[aria-sort="ascending"]::after { content: " \25B2"; font-size: .7em; }
table.sortable th[aria-sort="descending"]::after { content: " \25BC"; font-size: .7em; }
td.sup, td.na { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .85rem; color: var(--ink2); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { width: 26px; height: 8px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.panels.one { grid-template-columns: minmax(0, 1fr); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 4px; min-width: 0; }
.panel h4 { margin: 2px 4px 0; font-size: .9rem; font-weight: 600; }
.panel svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.panel svg text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.panel svg .gl { stroke: var(--grid); stroke-width: 1; }
.panel svg .ax { stroke: var(--line); }
.panel svg .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.panel svg .cross { stroke: var(--ink2); stroke-width: 1; stroke-dasharray: 3 3; }
.panel svg .dot { stroke: var(--panel); stroke-width: 2; }
.panel svg text.dl { font-weight: 600; }
.panel svg:focus { outline: 2px solid var(--accent); }
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: .82rem; box-shadow: 0 4px 14px rgba(0,0,0,.18); max-width: 260px; }
.tip .th { color: var(--muted); font-size: .75rem; margin-bottom: 2px; }
.tip .tr { display: flex; align-items: center; gap: 6px; }
.tip .tr svg { width: 14px; height: 6px; flex: none; }
.tip .tv { font-weight: 650; margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.tip .tl { color: var(--ink2); }

details.tbl { margin: 10px 0; } details.tbl summary { cursor: pointer; color: var(--ink2); font-size: .9rem; }
details.tbl table { margin: 8px 0 14px; } details.tbl h5 { margin: 12px 0 2px; font-size: .85rem; }

.kout { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.kout .card.main { border-left: 4px solid var(--c2026); } .kout .card.bench { border-left: 4px solid var(--c2022); }
.sentence { margin: 8px 0; max-width: 80ch; }

.stack { margin: 8px 0 4px; }
.stack .row { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; margin: 4px 0; }
.stack .yr { font-weight: 600; font-size: .9rem; }
.stack .bar { display: flex; gap: 2px; height: 30px; }
.stack .seg2 { height: 100%; min-width: 1px; border-radius: 2px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 600; overflow: hidden; }
.stack .seg2:hover { filter: brightness(1.12); outline: 2px solid var(--ink); outline-offset: -2px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.two h4 { margin: 0 0 4px; font-size: .9rem; }
td.diag { font-weight: 650; }

.prose { max-width: 80ch; } .prose h3 { margin-top: 18px; } .prose p, .prose li { color: var(--ink2); }
.foot { color: var(--muted); font-size: .8rem; padding-bottom: 40px; }
@media (max-width: 560px) {
  h1 { font-size: 1.25rem; } .panels { grid-template-columns: minmax(0, 1fr); }
  .card .big { font-size: 1.6rem; } section { padding-top: 22px; }
  .controls label { flex: 1 1 44%; } .controls label select { width: 100%; }
}
@media (forced-colors: active) { .panel svg .ln { stroke: CanvasText; } }
