/* Tone colours run red (negative) through neutral grey to blue (positive). In the dark theme the
   strongest readings are the brightest, so they still stand out from the page. */
:root {
  --bg: #f6f5fa; --surface: rgba(255, 255, 255, .82); --raised: #eceaf3; --line: rgba(30, 20, 60, .12); --ink: #14121c; --muted: #55516a; --faint: #7b7790;
  --accent: #5b46d6; --grad: linear-gradient(100deg, #c9402c, #7a4fd6 52%, #2a78d6); --blob-a: rgba(122, 79, 214, .16); --blob-b: rgba(42, 120, 214, .14);
  --n4: #a82a20; --n3: #d6604c; --n2: #e99a85; --n1: #f4c7bb; --z: #cbc9d6; --p1: #c3d9f4; --p2: #8fbbea; --p3: #4b8fdb; --p4: #1b58a6; --none: #e8e6ef;
  --series: #5b46d6; --world: #8f8ca3; --land-line: rgba(20, 18, 28, .28);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0b0a12; --surface: rgba(22, 20, 34, .74); --raised: #211e33; --line: rgba(255, 255, 255, .09); --ink: #f1eff8; --muted: #aaa6bf; --faint: #827e99; --accent: #9d8cf5; --grad: linear-gradient(100deg, #f08a73, #a594f7 52%, #7fb4f2); --blob-a: rgba(122, 79, 214, .2); --blob-b: rgba(42, 120, 214, .14); --n4: #f48d74; --n3: #c9543f; --n2: #8f382f; --n1: #5e2a26; --z: #4a4860; --p1: #1e3d66; --p2: #2a5c9c; --p3: #3f86d9; --p4: #86b9f5; --none: #1c1a2b; --series: #9d8cf5; --world: #6f6c85; --land-line: rgba(255, 255, 255, .22); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0b0a12; --surface: rgba(22, 20, 34, .74); --raised: #211e33; --line: rgba(255, 255, 255, .09); --ink: #f1eff8; --muted: #aaa6bf; --faint: #827e99; --accent: #9d8cf5; --grad: linear-gradient(100deg, #f08a73, #a594f7 52%, #7fb4f2); --blob-a: rgba(122, 79, 214, .2); --blob-b: rgba(42, 120, 214, .14); --n4: #f48d74; --n3: #c9543f; --n2: #8f382f; --n1: #5e2a26; --z: #4a4860; --p1: #1e3d66; --p2: #2a5c9c; --p3: #3f86d9; --p4: #86b9f5; --none: #1c1a2b; --series: #9d8cf5; --world: #6f6c85; --land-line: rgba(255, 255, 255, .22); color-scheme: dark; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60vmax 40vmax at 6% -8%, var(--blob-a), transparent 70%), radial-gradient(54vmax 36vmax at 98% -6%, var(--blob-b), transparent 70%); }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 max(16px, calc(50% - 620px)); background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; text-decoration: none; margin-right: auto; }
.brand img { border-radius: 8px; }
.updated { font-size: 12.5px; color: var(--faint); margin-right: 4px; }
.icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.icon:hover { border-color: var(--accent); }
.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }

.page { max-width: 1240px; margin: 0 auto; padding: 18px 16px; display: grid; gap: 14px; }
.panel, .dial { background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.panel { min-width: 0; padding: 16px; border-radius: 20px; }
.head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.025em; }
h3 { font-size: 14.5px; font-weight: 750; letter-spacing: -.01em; margin: 16px 0 6px; }
.note { font-size: 12.5px; color: var(--faint); }
.para { margin: -2px 0 8px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.two.inner { gap: 4px 24px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 24px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.hero-main { display: flex; flex-direction: column; justify-content: center; padding: 8px 4px; min-width: 0; }
.eyebrow { font-weight: 700; color: var(--accent); }
h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; color: var(--muted); }
h1 b { display: block; width: fit-content; font-size: clamp(76px, 11vw, 132px); line-height: 1.02; font-weight: 850; letter-spacing: -.06em; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin-top: 8px; color: var(--muted); max-width: 60ch; }
.dials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dial { padding: 12px 14px; border-radius: 18px; min-width: 0; text-align: left; }
button.dial:hover { border-color: var(--accent); }
.dial small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dial b { display: block; font-size: 25px; line-height: 1.25; font-weight: 800; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dial span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--none)); }

.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.seg { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--raised); border: 1px solid var(--line); }
.seg button { padding: 6px 13px; border: 0; border-radius: 10px; background: none; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }

.scale { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; margin-bottom: 8px; font-size: 12px; line-height: 12px; color: var(--muted); }
.bands { display: flex; gap: 2px; padding-bottom: 16px; }
.band { position: relative; width: 36px; }
.band i { display: block; height: 12px; background: var(--c); }
.band:first-child i { border-radius: 4px 0 0 4px; }
.band:last-child i { border-radius: 0 4px 4px 0; }
.band small { position: absolute; top: 16px; right: -1px; transform: translateX(50%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.scale .gap { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.scale .gap i { display: block; width: 14px; height: 12px; border-radius: 3px; background: var(--c); outline: 1px solid var(--line); }
.map { position: relative; }
.map svg { display: block; width: 100%; height: auto; }
.map path { fill: var(--c, var(--none)); stroke: var(--land-line); stroke-width: .5; cursor: pointer; }
.map path:hover, .map path.on { stroke: var(--ink); stroke-width: 1.4; }
.tip { position: absolute; top: 4px; z-index: 3; min-width: 150px; padding: 6px 9px; border-radius: 9px; font-size: 12.5px; background: var(--raised); border: 1px solid var(--line); pointer-events: none; box-shadow: 0 8px 22px -10px #000; }
.tip div { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tip div span { margin-left: auto; padding-left: 12px; font-weight: 650; color: var(--ink); }
.tip .key { flex: none; width: 12px; height: 0; border-top: 2px solid var(--k); }

.rank { display: grid; grid-template-columns: 22px minmax(0, 1.1fr) minmax(0, 1fr) 46px; align-items: center; gap: 10px; width: 100%; padding: 4.5px 4px; border: 0; border-radius: 8px; background: none; font-size: 13.5px; text-align: left; }
.rank:hover { background: var(--raised); }
.rank small { color: var(--faint); font-variant-numeric: tabular-nums; }
.rank .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank .who small { font-weight: 400; margin-left: 6px; }
.rank b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 12px; }
.bar::after { content: ''; position: absolute; top: -3px; bottom: -3px; left: 50%; width: 1px; background: var(--faint); }
.bar i { position: absolute; top: 0; bottom: 0; background: var(--c); }
.bar i.neg { right: 50%; border-radius: 4px 0 0 4px; }
.bar i.pos { left: 50%; border-radius: 0 4px 4px 0; }

select, input[type="search"] { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); max-width: 100%; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { padding: 10px 13px; border-radius: 14px; background: var(--raised); min-width: 0; }
.tile small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tile b { display: block; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.legend { display: flex; flex-wrap: wrap; gap: 3px 14px; min-height: 19px; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .key { width: 16px; height: 0; border-top: 2px solid var(--k); }
.legend .key.dash { border-top-style: dashed; }
.chart { position: relative; width: 100%; height: 220px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart text { font-size: 11.5px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); }
.chart .zero { stroke: var(--faint); }
.chart .cross { stroke: var(--faint); }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.world { stroke: var(--world); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .pt { fill: var(--series); stroke: var(--bg); stroke-width: 2; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; }

.pair { display: grid; grid-template-columns: minmax(90px, 190px) minmax(0, 1fr) 50px; align-items: center; gap: 10px; padding: 3.5px 0; font-size: 13px; }
.pair .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pair .who.me { font-weight: 750; }
.pair .track { height: 12px; }
.pair .track i { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--c); }
.pair b { text-align: right; font-variant-numeric: tabular-nums; }
.pair small { color: var(--faint); font-variant-numeric: tabular-nums; }
.heads { list-style: none; }
.heads li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.heads li:first-child { border-top: 0; }
.heads .score { display: flex; align-items: center; gap: 5px; height: 20px; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.heads a { text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.heads a:hover { text-decoration: underline; }
.heads small { display: block; color: var(--faint); font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { font-size: 12.5px; font-weight: 650; color: var(--muted); text-align: left; white-space: nowrap; padding: 4px 8px; border-bottom: 1px solid var(--line); }
th button { border: 0; background: none; font-weight: 650; color: var(--muted); padding: 2px 0; }
th button:hover, th button[data-on] { color: var(--ink); }
th button[data-on]::after { content: ' ↓'; }
th button[data-on="up"]::after { content: ' ↑'; }
td { padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.on { background: var(--raised); }
tbody tr.thin td { color: var(--faint); }
td .cell { display: inline-flex; align-items: center; gap: 7px; }
td button { border: 0; background: none; font-weight: 600; text-align: left; padding: 0; }
.spark { display: block; width: 96px; height: 22px; }
.spark path { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark line { stroke: var(--line); }

.foot { max-width: 1240px; margin: 0 auto; padding: 4px 16px 32px; font-size: 12px; color: var(--faint); }
.foot p + p { margin-top: 4px; }
@media (max-width: 900px) { .hero, .two, .three { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .updated { display: none; } .seg { width: 100%; } .seg button { flex: 1; padding: 6px 8px; font-size: 12.5px; } .rank { grid-template-columns: 18px minmax(0, 1.3fr) minmax(0, .8fr) 42px; gap: 7px; } .rank .who small { display: none; } .band { width: 26px; } h1 b { font-size: 76px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
