:root{color-scheme:light;--chart-secondary:#282725;--chart-gold:#b99b70;--chart-blue:#6c8290}.theme-toggle{width:34px;height:34px;display:inline-grid;place-items:center;flex:none;padding:7px;border:1px solid #484641;background:transparent;color:#eee9df;cursor:pointer;border-radius:50%;margin-left:14px}.theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.theme-sun{display:none}:root[data-theme=dark]{color-scheme:dark;--ink:#eee9e0;--paper:#191b1d;--muted:#a2a39f;--line:#373b3e;--red:#ff625b;--soft-red:#392623;--white:#222528;--chart-secondary:#e6e9eb;--chart-gold:#d4b782;--chart-blue:#93b8cb}:root[data-theme=dark] .theme-moon{display:none}:root[data-theme=dark] .theme-sun{display:block}
:root[data-theme=dark] .topbar,:root[data-theme=dark] .admin-header{background:#101112;color:#eee9e0}:root[data-theme=dark] .sidebar{background:#202326;border-color:var(--line)}:root[data-theme=dark] .main-panel{background:var(--paper)}
:root[data-theme=dark] :is(.side-intro p,.side-label,.eyebrow,.page-meta,.heading-row p,.chart-heading p,.chart-key,.chart-bottom,.candidate-party,.candidate-rank,.candidate-count,.progress-foot,.progress-detail,.timeline-end,.timeline-rail>span:last-child,.method p,.sidebar-bottom small,.ad-disclosure,.ad-copy p,.traffic-privacy,footer){color:var(--muted)}:root[data-theme=dark] .eyebrow.red{color:var(--red)}
:root[data-theme=dark] :is(.race-tab,.race-tab:last-child,.sidebar-bottom a,.page-meta,.candidate-row,.results-heading,.chart-wrap,.timeline-rail,.progress-zone,.sync-controls,.ad-slot,.region-control select,.mode-switch,.round-switch,.round-tag){border-color:var(--line)}:root[data-theme=dark] .race-tab{color:var(--muted)}:root[data-theme=dark] .race-tab.active{color:var(--red)}
:root[data-theme=dark] :is(.mode-switch,.round-switch,.region-control select,.method,.method-icon){background:#25292c}:root[data-theme=dark] .region-control select{color:var(--ink)}:root[data-theme=dark] .mode-button,:root[data-theme=dark] .round-button{color:var(--muted)}:root[data-theme=dark] :is(.mode-button.active,.round-button.active){background:#e5e1d8;color:#191b1d}
:root[data-theme=dark] .progress-track{background:#383c3f}:root[data-theme=dark] .candidate-mobile-votes{color:#c6c7c3}:root[data-theme=dark] .chart-empty{color:var(--muted)}:root[data-theme=dark] .chart-empty strong{color:var(--ink)}:root[data-theme=dark] .empty-orbit{color:#667075}:root[data-theme=dark] .candidate-share small{color:var(--muted)}
:root[data-theme=dark] input[type=search]{color:var(--ink);background:transparent;border-color:var(--line)}:root[data-theme=dark] .ad-banner-link img{background:#25292c}:root[data-theme=dark] :is(.ad-button,.primary,#return-live){background:#e5e1d8;color:#191b1d}:root[data-theme=dark] :is(.ad-button:hover,.primary:hover){background:#ff625b;color:#191b1d}
:root[data-theme=dark] :is(.admin-header .brand,.brand span){color:#eee9e0}:root[data-theme=dark] .brand strong{color:#ff625b}:root[data-theme=dark] .admin-header .theme-toggle{border-color:#484641;color:#eee9df;padding:7px;border-radius:50%}:root[data-theme=dark] :is(.login-section input,.editor input,.editor textarea,.editor select){background:#222629;color:var(--ink);border-color:var(--line)}:root[data-theme=dark] :is(.campaign-row button,.preview-switch button){background:#25292c;color:var(--ink);border-color:var(--line)}:root[data-theme=dark] .preview-switch button.selected{background:#e5e1d8;color:#191b1d}
@media(max-width:800px){.topbar .header-right{margin-left:auto}.topbar #header-election{display:none}.topbar .theme-toggle{width:30px;height:30px;margin-left:12px;padding:6px}.topbar{gap:0}:root[data-theme=dark] .race-tab.active{background:#e5e1d8;color:#191b1d;border-color:#e5e1d8!important}:root[data-theme=dark] .view-controls .mode-switch{background:transparent}:root[data-theme=dark] .replay-active #mode-live{color:var(--ink)}:root[data-theme=dark] .race-tab.active .tab-icon{color:#b52f2b}}
@media(max-width:360px){.topbar .header-right #connection-label{display:none}.topbar .header-right{overflow:visible;width:8px}.topbar .theme-toggle{margin-left:12px}}

:root{--chart-projection-bg:#e6e1d7}:root[data-theme=dark]{--chart-projection-bg:#283035}:root[data-theme=dark] .brand .brand-mark{color:#ff625b}.admin-header .theme-toggle{padding:7px;border-radius:50%;margin-left:0;flex:none}
@media(max-width:800px){.chart-bottom{flex-direction:column;gap:5px}.chart-bottom span:last-child{text-align:left;font-size:9px;line-height:1.5}}

/* Chart palette has its own contrast levels, separate from interface accents. */
:root{--chart-primary:var(--red);--chart-axis:var(--muted);--chart-grid:var(--line);--chart-forecast-opacity:.7;--chart-label-link-opacity:.6;--chart-bar-opacity:.8}
:root[data-theme=dark]{--chart-primary:#ff8178;--chart-secondary:#dce6f1;--chart-gold:#e6c47b;--chart-blue:#7bd5db;--chart-axis:#b7c2cc;--chart-grid:#3e474f;--chart-projection-bg:#202a32;--chart-forecast-opacity:.95;--chart-label-link-opacity:.85;--chart-bar-opacity:1}
:root[data-theme=dark] .chart-key,:root[data-theme=dark] .chart-bottom,:root[data-theme=dark] .analytics-bar-date{color:var(--chart-axis)}
:root[data-theme=dark] .key-line,:root[data-theme=dark] .key-dash{border-color:var(--chart-primary)}:root[data-theme=dark] .key-dash{opacity:var(--chart-forecast-opacity)}
.analytics-bar{background:var(--chart-primary,var(--red));opacity:var(--chart-bar-opacity,.8)}.analytics-bar.empty{background:var(--chart-grid,var(--line));opacity:1}

:root[data-theme=dark] .creator-footer{background:#252b30;border-color:#46515a;color:#e1e7ec}:root[data-theme=dark] .creator-footer .creator-separator{color:#8997a2}

/* Municipal hue identifies the leader; saturation follows sections totalized. */
:root{--municipal-lula:#cb213a;--municipal-flavio:#1e50cf}
:root[data-theme=dark]{--municipal-lula:#e33b50;--municipal-flavio:#397de0}
