/* Light retains the original palette; dark is the default document theme. */
:root{color-scheme:light;--chart-win:#27866b;--chart-loss:#c08a63;--chart-area:#eef5ec;--chart-live:#79a084;--board-bg:#f2f5ef;--board-grid:#e5ebe0;--board-ghost:#8ba495;--board-ceiling:#b0bdad;--board-empty:#a9b5a4}
.topbar-actions{display:flex;align-items:center;gap:20px}.theme-toggle{border:1px solid var(--line);border-radius:7px;padding:7px 10px;font-size:11px;letter-spacing:0;color:var(--ink);background:var(--paper);white-space:nowrap}.theme-toggle:hover{border-color:var(--green)}
:root[data-theme=dark]{color-scheme:dark;--bg:#101815;--paper:#19241f;--ink:#e2eae3;--muted:#9aac9f;--line:#2b3a32;--green:#79d5b4;--green-light:#203c30;--orange:#e1aa7b;--purple:#b0a3d0;--chart-win:#79d5b4;--chart-loss:#e1aa7b;--chart-area:#203a2c;--chart-live:#7fbd94;--board-bg:#0d1713;--board-grid:#203229;--board-ghost:#829c8c;--board-ceiling:#5c7565;--board-empty:#859b8d}
[data-theme=dark] .sidebar,[data-theme=dark] .topbar{background:#121d18}
[data-theme=dark] .metric{background:var(--paper)}
[data-theme=dark] .brand{color:#a1d8bc}
[data-theme=dark] .nav{color:#a4b5a8}
[data-theme=dark] .nav.active{color:#9ae0be;background:#22392c}
[data-theme=dark] .nav:hover{background:#203226}
[data-theme=dark] .side-piece i{border-color:#78957f}
[data-theme=dark] .side-caption,[data-theme=dark] .side-bottom,[data-theme=dark] .side-bottom small,[data-theme=dark] .topbar,[data-theme=dark] .connection,[data-theme=dark] .eyebrow,[data-theme=dark] .intro,[data-theme=dark] .metric>span,[data-theme=dark] .metric small,[data-theme=dark] .chart-legend,[data-theme=dark] .caption,[data-theme=dark] .subtle,[data-theme=dark] label,[data-theme=dark] .selection-flow small,[data-theme=dark] .selection-flow em,[data-theme=dark] .session-details,[data-theme=dark] .resource-strip,[data-theme=dark] th,[data-theme=dark] .match-counts>div,[data-theme=dark] footer,[data-theme=dark] .arena-heading small,[data-theme=dark] .piece-tray,[data-theme=dark] .board-stats span,[data-theme=dark] .timeline-labels,[data-theme=dark] .record-item small,[data-theme=dark] .record-item>em,[data-theme=dark] .replay-help p:not(.eyebrow),[data-theme=dark] .empty{color:#9bad9f}
[data-theme=dark] .topbar b,[data-theme=dark] .resource-strip b{color:#bccdbf}
[data-theme=dark] input,[data-theme=dark] select,[data-theme=dark] .secondary{color:var(--ink);background:#1b2b22;border-color:#3c5042}
[data-theme=dark] .secondary:hover:not(:disabled){background:#2a3f31}
[data-theme=dark] input[type=range]{background:transparent}
[data-theme=dark] button.primary{background:#23785f;color:#f1fff7}
[data-theme=dark] button.primary:hover:not(:disabled){background:#278069}
[data-theme=dark] .heading-tag{background:#1d3025;border-color:#36513f;color:#a1d7b2}
[data-theme=dark] .panel-heading select{color:#b9ccbc}
[data-theme=dark] .chart text,[data-theme=dark] .live-chart text{fill:#a0b4a5}
[data-theme=dark] .chart-panel>.caption,[data-theme=dark] .selection-flow>div,[data-theme=dark] td,[data-theme=dark] .live-chart{border-color:var(--line)}
[data-theme=dark] .selection-flow b{background:#273a2c;color:#b4cbb8}
[data-theme=dark] .selection-flow .passed b{background:#254936;color:var(--green)}
[data-theme=dark] .selection-flow .failed em{color:var(--orange)}
[data-theme=dark] .selection-note{background:#292c22;color:#c7bf9e}
[data-theme=dark] .text-button,[data-theme=dark] td button,[data-theme=dark] .delta-good,[data-theme=dark] .player-heading>span:last-child{color:var(--green)}
[data-theme=dark] .delta-bad,[data-theme=dark] .pending-line{color:var(--orange)}
[data-theme=dark] .state-pill{color:#b0c1b2;border-color:#425545}
[data-theme=dark] .state-pill.running{color:var(--green);background:#203c2b;border-color:#426a4f}
[data-theme=dark] progress,[data-theme=dark] .match-bar{background:#2b3c2d}
[data-theme=dark] progress::-webkit-progress-bar{background:#2b3c2d}
[data-theme=dark] progress::-webkit-progress-value{background:#72b68d}
[data-theme=dark] progress::-moz-progress-bar{background:#72b68d}
[data-theme=dark] td{color:#c0d0c2}
[data-theme=dark] .match-counts strong,[data-theme=dark] .board-stats b,[data-theme=dark] .event-line{color:#a0d6b0}
[data-theme=dark] .match-counts>div:nth-child(2) strong{color:var(--orange)}
[data-theme=dark] .match-counts>div:nth-child(3) strong{color:#b7c4b5}
[data-theme=dark] .match-bar i{background:#78b28b}
[data-theme=dark] .match-bar i:nth-child(2){background:#ca996f}
[data-theme=dark] .match-bar i:nth-child(3){background:#697e69}
[data-theme=dark] .message{border-color:#745238;background:#352b20;color:#f0c499}
[data-theme=dark] .player canvas{background:var(--board-bg);border-color:#3a5040}
[data-theme=dark] .segmented{background:#101d16}
[data-theme=dark] .segmented button{color:#9fb4a3}
[data-theme=dark] .segmented .active{color:#afe4c2;background:#2a4030;box-shadow:none}
[data-theme=dark] .record-item{background:#19271e;border-color:#344a39}
[data-theme=dark] .record-item:hover{background:#203527}
[data-theme=dark] .record-item.selected{background:#25432f;border-color:#71ad83}
[data-theme=dark] .record-result{background:#2a3b2c;color:#c3d3bb}
[data-theme=dark] .record-result.loss{background:#443427;color:#efbd90}
[data-theme=dark] .verification{background:#243324;color:#b6c8ad}
[data-theme=dark] .verification.success{background:#22432d;color:#a4e0b6}
[data-theme=dark] .verification.error{background:#443124;color:#f0bc92}
@media(max-width:540px){.topbar-actions{gap:10px}.theme-toggle{font-size:10px;padding:5px 8px}.sidebar .side-caption,.sidebar .side-bottom{display:none}.sidebar nav{flex-shrink:0}.sidebar .nav{white-space:nowrap}}
