/* Live experiment page. Site tokens plus five category colours; every class is prefixed x- so nothing else changes. */
:root{--x-c1:#4338CA;--x-c2:#0E7490;--x-c3:#B45309;--x-c4:#BE185D;--x-c5:#4D7C0F}
[data-theme="dark"]{--x-c1:#A5B4FC;--x-c2:#67E8F9;--x-c3:#FBBF24;--x-c4:#F9A8D4;--x-c5:#BEF264}

.x-page .wrap{max-width:1040px}
.x-page .intro h1{max-width:18ch;text-wrap:balance}
.x-page .lede{max-width:62ch}
.x-section{margin-top:40px}
.x-section h2{font:700 24px/1.2 var(--display);margin:0 0 6px;text-wrap:balance}
.x-p{color:var(--muted);max-width:66ch;margin:0 0 14px}
.x-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;margin-bottom:12px}
.x-head h2{margin:0}
.x-neg{color:var(--negative)}.x-pos{color:var(--positive)}

.x-live{display:inline-flex;align-items:center;gap:8px;margin:8px 0 0;font:600 13px var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--positive)}
.x-dot{width:9px;height:9px;border-radius:50%;background:var(--positive)}

/* scoreboard */
.x-score{display:grid;grid-template-columns:1.4fr repeat(3,minmax(0,1fr));gap:12px}
.x-big{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px 18px;min-width:0}
.x-hero{border-color:var(--ink)}
.x-k{font:600 12px var(--sans);letter-spacing:.07em;text-transform:uppercase;color:var(--muted);margin:0}
.x-v{font:700 38px/1.1 var(--display);margin:6px 0 2px;font-variant-numeric:tabular-nums;letter-spacing:-.02em;overflow-wrap:anywhere}
.x-hero .x-v{font-size:52px}
.x-s{margin:0;font-size:14px;color:var(--muted)}

/* view switch reuses the site's .seg */
.x-mode{margin:0}

/* legend */
.x-legend{margin-bottom:10px}
.x-sw{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:7px}
.x-legend button{min-height:40px}
.x-legend button[aria-pressed=true]{background:var(--surface);color:var(--ink);border-color:var(--ink)}
[data-theme="dark"] .x-legend button[aria-pressed=true]{color:var(--ink)}
.x-legend button[aria-pressed=false]{opacity:.5}
.k-total{background:var(--ink);stroke:var(--ink);fill:var(--ink)}
.k-1{background:var(--x-c1);stroke:var(--x-c1);fill:var(--x-c1)}
.k-2{background:var(--x-c2);stroke:var(--x-c2);fill:var(--x-c2)}
.k-3{background:var(--x-c3);stroke:var(--x-c3);fill:var(--x-c3)}
.k-4{background:var(--x-c4);stroke:var(--x-c4);fill:var(--x-c4)}
.k-5{background:var(--x-c5);stroke:var(--x-c5);fill:var(--x-c5)}

/* chart */
.x-chartcard{padding:14px 14px 12px}
.x-chart{position:relative;outline-offset:4px;border-radius:8px;touch-action:pan-y}
.x-chart svg{display:block;width:100%;height:auto;overflow:visible}
.x-grid{stroke:var(--border);stroke-width:1}
.x-zero{stroke:var(--muted);stroke-width:1;stroke-dasharray:3 4}
.x-axis{fill:var(--muted);font:500 12px var(--sans);font-variant-numeric:tabular-nums;stroke:none}
.x-line{fill:none;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.x-line.k-total{stroke-width:3.5}
.x-area{fill:var(--accent-soft);stroke:none}
.x-end,.x-cur{stroke:var(--surface);stroke-width:2}
.x-daybar{stroke:none}
.x-cross{stroke:var(--ink);stroke-width:1;opacity:.35}
.x-off{display:none}
.x-read{margin:10px 2px 0;font-size:15px;color:var(--muted);font-variant-numeric:tabular-nums;min-height:3em}
.x-read strong{color:var(--ink);font-weight:600}
.x-read span{white-space:nowrap;margin-right:14px}
.x-read i{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px}

/* category cards */
.x-cats{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.x-cat{all:unset;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:center;
  background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px 18px;border-top-width:4px}
.x-cat:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.x-cat[aria-pressed=true]{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.x-cat.c-1{border-top-color:var(--x-c1)}.x-cat.c-2{border-top-color:var(--x-c2)}.x-cat.c-3{border-top-color:var(--x-c3)}.x-cat.c-4{border-top-color:var(--x-c4)}.x-cat.c-5{border-top-color:var(--x-c5)}
.x-catname{font-weight:600;font-size:16px}
.x-catwin{grid-column:1;font:700 30px/1.1 var(--display);font-variant-numeric:tabular-nums}
.x-catsub{grid-column:1;font-size:14px;color:var(--muted)}
.x-ring{grid-column:2;grid-row:1 / span 3;width:74px;height:74px}
.x-ring circle{fill:none;stroke-width:7}
.x-ring .bg{stroke:var(--track)}
.x-ring .fg{stroke-linecap:round}
.x-ring text{fill:var(--ink);font:700 15px var(--display);stroke:none}

@media (max-width:820px){
  .x-score{grid-template-columns:repeat(2,minmax(0,1fr))}
  .x-hero{grid-column:1 / -1}
  .x-v{font-size:30px}.x-hero .x-v{font-size:44px}
  .x-axis{font-size:20px}
}
@media (prefers-reduced-motion:no-preference){
  .x-dot{animation:x-pulse 2.2s ease-out infinite}
  .x-cat{transition:transform .15s,box-shadow .15s}
  .x-cat:hover{transform:translateY(-2px)}
  .x-ring .fg{transition:stroke-dashoffset .9s cubic-bezier(.2,.7,.2,1)}
  .x-line.draw{stroke-dasharray:var(--len);stroke-dashoffset:var(--len);animation:x-draw 1.3s ease-out forwards}
}
@keyframes x-pulse{0%{box-shadow:0 0 0 0 var(--positive)}70%{box-shadow:0 0 0 9px transparent}100%{box-shadow:0 0 0 0 transparent}}
@keyframes x-draw{to{stroke-dashoffset:0}}
