:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8f8f7;
  --line: #ebebea;
  --line-2: #dcdcda;
  --grid: #e9e9e6;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --accent: #6d4aff;
  --accent-soft: #f1edff;
  --up: #067d3a;
  --down: #c8283b;
  --gold: #d6a100;
  --silver: #9aa3ae;
  --bronze: #b8703d;
  --warn-bg: #fff8e6;
  --warn-line: #f3dc9c;
  --warn-ink: #7a5200;
  --div-pos: #2a78d6;
  --div-neg: #d64545;
  --div-mid: #f0efec;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --ev-verified: #0ca30c; --ev-reviewed: #fab219; --ev-unresolved: #b9b8b2;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --panel: #141414; --panel-2: #1a1a19;
    --line: #262625; --line-2: #34342f; --grid: #2c2c2a;
    --text: #ffffff; --text-2: #c3c2b7; --muted: #898781;
    --accent: #9b85ff; --accent-soft: #221c3d;
    --up: #2fbf62; --down: #ff6b7a;
    --gold: #f0c338; --silver: #b7c0cb; --bronze: #d58a52;
    --warn-bg: #2a2210; --warn-line: #5a4715; --warn-ink: #f3cf7a;
    --div-pos: #3987e5; --div-neg: #e66767; --div-mid: #383835;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --ev-unresolved: #5f5e59;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --panel: #141414; --panel-2: #1a1a19;
  --line: #262625; --line-2: #34342f; --grid: #2c2c2a;
  --text: #ffffff; --text-2: #c3c2b7; --muted: #898781;
  --accent: #9b85ff; --accent-soft: #221c3d;
  --up: #2fbf62; --down: #ff6b7a;
  --gold: #f0c338; --silver: #b7c0cb; --bronze: #d58a52;
  --warn-bg: #2a2210; --warn-line: #5a4715; --warn-ink: #f3cf7a;
  --div-pos: #3987e5; --div-neg: #e66767; --div-mid: #383835;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --ev-unresolved: #5f5e59;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.ink2 { color: var(--text-2); }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { width: 24px; height: 24px; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 0 12px; text-decoration: none; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.tabs a[aria-current] svg { color: var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-decoration: none; color: var(--text-2); }
.icon-btn:hover { color: var(--text); background: var(--panel-2); }

/* Shell */
.shell { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
.side { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-size: 14.5px; }
.side a:hover { background: var(--panel-2); color: var(--text); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.side .sep { height: 1px; background: var(--line); margin: 10px 4px; }
main { min-width: 0; }

/* Page head */
.page-head h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 700; }
.page-head p { margin: 0 0 6px; color: var(--text-2); max-width: 720px; }
.page-head .meta { color: var(--muted); font-size: 14px; }
.notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 14px; }
.notice svg { margin-top: 3px; }

/* Sections */
.sec { padding-top: 44px; }
.sec-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-h h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; letter-spacing: -0.015em; margin: 0 0 4px; font-weight: 650; }
.sec-h h2 svg { width: 18px; height: 18px; }
.sec-h p { margin: 0; color: var(--text-2); font-size: 14.5px; max-width: 640px; }
.sec-h p a { color: var(--text); }
.card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 0; font: 500 11px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); flex-wrap: wrap; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.sample, .pill.provisional { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.pill.final { color: var(--up); }
.card-h .pill, .card-h .legend { text-transform: none; letter-spacing: 0; font-size: 12.5px; }

/* Leaders overview */
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.lead-card { display: block; text-decoration: none; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.lead-card:hover { border-color: var(--line-2); box-shadow: 0 4px 16px -8px rgba(0,0,0,0.15); }
.lead-card .t { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.lead-card .who { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; }
.lead-card .name { font-weight: 600; line-height: 1.25; }
.lead-card .by { font-size: 13px; color: var(--muted); }
.lead-card .score { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.lead-card .score small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.lead-card .v { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* Medal + avatar */
.medal { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 700; color: #fff; background: var(--m); flex: none; }
.medal.gold { --m: var(--gold); } .medal.silver { --m: var(--silver); } .medal.bronze { --m: var(--bronze); }
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; flex: none; font-size: 12px; font-weight: 700; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); position: relative; }
.av .medal { position: absolute; right: -6px; bottom: -6px; width: 16px; height: 16px; font-size: 9px; box-shadow: 0 0 0 2px var(--panel); }

/* Ranked two-column list */
.rank-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; margin-top: 8px; }
.rank-list ol { list-style: none; margin: 0; padding: 0; }
.ri { display: grid; grid-template-columns: 28px 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 4px; border-radius: 8px; }
.ri:hover { background: var(--panel-2); }
.ri .n { color: var(--text-2); font-size: 15px; text-align: right; }
.ri .nm { min-width: 0; }
.ri .nm b { display: block; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri .nm span { font-size: 13.5px; color: var(--text-2); }
.ri .val { text-align: right; line-height: 1.35; }
.ri .val b { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.ri .val small { display: block; font-size: 12.5px; color: var(--muted); }
.ri .tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-top: 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }

/* Interval chart */
.ivl { padding: 6px 16px 10px; }
.ivl-row { display: grid; grid-template-columns: 22px minmax(120px, 190px) minmax(0, 1fr); align-items: center; gap: 12px; height: 40px; border-top: 1px solid var(--line); cursor: default; }
.ivl-row.head { border-top: 0; height: 30px; color: var(--muted); font-size: 12px; }
.ivl-row:not(.head):hover { background: var(--panel-2); }
.ivl-row .n { color: var(--text-2); text-align: right; }
.ivl-row .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.ivl-row svg { display: block; width: 100%; height: 40px; overflow: visible; }
.ivl-row.head .ticks { position: relative; height: 100%; }
.ivl-row.head .ticks span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; }
.ivl-row.head .ticks span:first-child { transform: none; }
.ivl-row.head .ticks span:last-child { transform: translateX(-100%); }
.ivl svg .g { stroke: var(--grid); stroke-width: 1; }
.ivl svg .w { stroke: var(--c); stroke-width: 2; stroke-linecap: round; }
.ivl svg .p { fill: var(--c); stroke: var(--panel); stroke-width: 2; }
.ivl svg .lead { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; }
.ivl svg text { font-size: 11.5px; fill: var(--c); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 16px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* Stats table */
.tbl-wrap { overflow-x: auto; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats th { text-align: right; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 12px 12px 8px; white-space: nowrap; }
.stats td { text-align: right; padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats th:nth-child(-n+2), .stats td:nth-child(-n+2) { text-align: left; }
.stats th:first-child, .stats td:first-child { padding-left: 16px; width: 36px; color: var(--text-2); }
.stats td:nth-child(2) { font-weight: 500; }
.stats tbody tr:hover { background: var(--panel-2); }

/* Head-to-head matrix */
.h2h { padding: 14px 16px 16px; overflow-x: auto; }
.h2h table { border-collapse: separate; border-spacing: 3px; margin: 0 auto; }
.h2h th { font-size: 12px; font-weight: 500; color: var(--text-2); padding: 4px 8px; white-space: nowrap; }
.h2h thead th { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 112px; vertical-align: bottom; padding: 0 0 6px; }
.h2h tbody th { text-align: right; }
.h2h .short { display: none; }
.h2h td { width: 62px; height: 44px; text-align: center; border-radius: 6px; font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: default; transition: outline-color .1s; outline: 2px solid transparent; outline-offset: 1px; }
.h2h td.self { background: repeating-linear-gradient(135deg, var(--panel-2) 0 5px, var(--line) 5px 6px); }
.h2h td:not(.self):hover, .h2h td.x { outline-color: var(--text); }
.h2h tr.hl th, .h2h th.hl { color: var(--text); font-weight: 650; }
.legend-ramp { display: flex; align-items: center; gap: 8px; }
.legend-ramp i { display: block; width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--div-neg), var(--div-mid), var(--div-pos)); }

/* Scatter */
.scatter { padding: 8px 12px 4px; }
.scatter svg { display: block; width: 100%; overflow: visible; }
.scatter .g { stroke: var(--grid); }
.scatter .ax { stroke: var(--line-2); }
.scatter text { font-size: 12px; fill: var(--muted); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.scatter text.lbl { fill: var(--text-2); font-size: 12.5px; }
.scatter .pt { fill: var(--c); stroke: var(--panel); stroke-width: 2; cursor: pointer; transition: r .12s; }
.scatter .ci { stroke: var(--c); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .12s; pointer-events: none; }
.scatter g.on .ci { opacity: .55; }
.scatter g.on .pt { r: 9; }
.scatter.dim g.m:not(.on) { opacity: .35; }

/* Evidence bars */
.ev-rows { padding: 8px 16px 14px; }
.ev-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) 64px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ev-row:first-child { border-top: 0; }
.ev-bar { display: flex; gap: 2px; height: 14px; }
.ev-bar span { display: block; height: 100%; min-width: 3px; }
.ev-bar span:first-child { border-radius: 4px 0 0 4px; }
.ev-bar span:last-child { border-radius: 0 4px 4px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* Events table */
table.events { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.events th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 12px 16px 8px; }
.events td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.events td a { font-weight: 500; }
.events .winners { display: flex; flex-direction: column; gap: 4px; }
.events .winners div { display: flex; align-items: center; gap: 7px; white-space: nowrap; }

/* Artifacts */
.art { list-style: none; margin: 0; padding: 0; }
.art li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.art li:first-child { border-top: 0; }
.art code { font: 12px var(--mono); color: var(--muted); overflow-wrap: anywhere; text-align: right; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 14px; font-size: 14px; }
.facts div > span { display: block; font-size: 12px; color: var(--muted); }

/* Tooltip */
.tip { position: fixed; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .08s; min-width: 190px; max-width: 280px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 13px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.25); }
.tip.on { opacity: 1; }
.tip .h { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.tip .r { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.tip .r b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Buttons & misc */
.more { display: flex; justify-content: center; margin-top: 10px; }
.more button { border: 0; background: none; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; }
.more button:hover { color: var(--text); background: var(--panel-2); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Prose (method) */
.prose { max-width: 720px; }
.prose h2 { font-size: 20px; letter-spacing: -0.015em; margin: 36px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 600; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-top: 1px solid var(--line); }
.prose th { font-weight: 500; color: var(--muted); font-size: 12.5px; border-top: 0; }
.prose td { color: var(--text-2); }
.prose td:last-child { color: var(--text); }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
footer .in { max-width: 1240px; margin: 0 auto; padding: 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: var(--text-2); text-decoration: none; }
footer a:hover { color: var(--text); }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; gap: 0; padding-top: 20px; }
  .side { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; scrollbar-width: none; }
  .side a { white-space: nowrap; }
  .side .sep { display: none; }
  .rank-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top-in { padding: 0 16px; gap: 12px; }
  .brand span { display: none; }
  .tabs a { padding: 0 8px; }
  .tabs a svg { display: none; }
  .shell { padding-left: 16px; padding-right: 16px; }
  .ivl { padding: 4px 8px 8px; }
  .ivl-row { grid-template-columns: 16px minmax(0, 1fr) 48%; gap: 8px; }
  .ivl-row .nm .medal { display: none; }
  .ivl-row.head .ticks span:nth-child(even) { display: none; }
  .h2h .full { display: none; }
  .h2h .short { display: inline; }
  .h2h thead th { writing-mode: horizontal-tb; transform: none; height: auto; text-align: center; padding: 0 0 4px; }
  .ivl svg text { display: none; }
  .ev-row { grid-template-columns: 1fr 48px; }
  .ev-row .ev-bar { grid-column: 1 / -1; grid-row: 2; }
  .h2h td { width: 44px; height: 36px; font-size: 12px; }
  .events .opt { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
