.theme-switch{display:flex;gap:3px;flex-shrink:0;border:1px solid #dce3ec;border-radius:9px;background:#edf1f6;padding:4px}
.theme-switch button{display:flex;align-items:center;justify-content:center;gap:6px;background:none;border:0;border-radius:6px;min-height:36px;padding:7px 10px;font-size:11px;font-weight:600;color:#5b6d86}
.theme-switch button[aria-pressed=true]{background:white;color:#2157b8;box-shadow:0 2px 5px #152c4917}
.theme-switch svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.7}
@media(max-width:760px){header{height:auto;min-height:112px;flex-wrap:wrap;gap:12px;padding-top:12px;padding-bottom:12px}header .brand{flex:1}header nav{order:3;width:100%;height:30px;justify-content:center}header nav button{font-size:11px}header nav button span{font-size:13px}.theme-switch{margin-left:auto}.theme-switch button{min-height:36px;padding:7px 9px}}
@media screen{
 html[data-theme=dark]{color-scheme:dark;--bg:#0c1421;--ink:#e6edf7;--muted:#a2b2c7;--line:#2a3a50;--accent:#8bb7ff;--green:#65d7b2;--red:#ff9aa8;--navy:#101923}
 html[data-theme=dark] :is(header,.history-card,.detail-panel,.results,.regions-panel,dialog,.search-results){background:#151f2e;border-color:var(--line)}
 html[data-theme=dark] :is(.state-tag,.eyebrow,.card-label,.detail-eyebrow,.city-location,.vote-hero-label,.mini-stats span,.mini-stats small,.delta-context,.detail-title span,.bar-col span,.table-bottom,footer p,.footer-brand,.text-button){color:#a2b2c7}
 html[data-theme=dark] .theme-switch{background:#0d1726;border-color:#34475f}
 html[data-theme=dark] .theme-switch button{color:#aebed2}
 html[data-theme=dark] .theme-switch button[aria-pressed=true]{background:#2c4668;color:#eef6ff;box-shadow:none}
 html[data-theme=dark] .button:not(.primary){background:#1c2c40;border-color:#39516c;color:#e6edf7}
 html[data-theme=dark] .history-card.active{border-color:#7aaaff;box-shadow:0 0 0 1px #7aaaff33}
 html[data-theme=dark] :is(.selected-badge,.city-location>span){background:#233e66;color:#b8d4ff}
 html[data-theme=dark] .year-switch{background:#101b2b;border-color:#33465f}
 html[data-theme=dark] .year-switch button{color:#a5b6cd}
 html[data-theme=dark] .year-switch button.active{background:#2c4668;color:#eaf3ff;box-shadow:none}
 html[data-theme=dark] :is(.search-wrap,.detail-note,.overview-summary>div){background:#101b2b;border-color:#30435b}
 html[data-theme=dark] :is(.vote-hero,.mini-stats,.mini-stats>div+div,.bar-col span){border-color:#304159}
 html[data-theme=dark] :is(.detail-note,.detail-note strong,dialog p){color:#b2c2d7}
 html[data-theme=dark] .rank-pill{color:#e4bf72}
 html[data-theme=dark] .delta-pill{background:#263348;color:#c3d0e2}
 html[data-theme=dark] .delta-pill.negative{background:#422631;color:#ffafba}
 html[data-theme=dark] .delta-pill.positive{background:#183e36;color:#86e2c3}
 html[data-theme=dark] .bar-fill{background:#38557c}
 html[data-theme=dark] .bar-col.active .bar-fill{background:#81acff}
 html[data-theme=dark] .bar-col.active span{color:#a2c5ff}
 html[data-theme=dark] :is(.search-results button:hover,.table-selected,tbody tr:hover){background:#203552}
 html[data-theme=dark] .search-results button{border-color:#2a3a50}
 html[data-theme=dark] :is(.table-selected td:nth-child(2) button,.detail-eyebrow button,dialog a){color:#a7caff}
 html[data-theme=dark] :is(.table-controls select,.region-year-controls select,.smart-search>input){background:#101b2b;border-color:#344b66;color:#e2ebf9}
 html[data-theme=dark] input::placeholder{color:#94a8c2;opacity:1}
 html[data-theme=dark] .smart-search>input:focus{background:#1c2c40}
 html[data-theme=dark] :is(thead,tfoot){background:#1a2a3e}
 html[data-theme=dark] :is(th,td,tfoot td){border-color:#2b3d55}
 html[data-theme=dark] th{color:#b5c5dc}
 html[data-theme=dark] :is(td.year-active,th.year-active){background:#213b5e;color:#b5d4ff}
 html[data-theme=dark] :is(.smart-search>p,.smart-search details p,.smart-search summary,.regions-panel .section-head a){color:#b0c7e3}
 html[data-theme=dark] .smart-search details{border-color:#34465d}
 html[data-theme=dark] .search-examples button{background:#20344e;border-color:#3a5372;color:#c1dcff}@media(hover:hover) and (pointer:fine){
 html[data-theme=dark] .search-examples button:hover{background:#2c4668}}
 html[data-theme=dark] :is(.smart-search .search-error,#regionList .region-change.negative,#regionSummary>.region-change.negative){color:#ffacb8}
 html[data-theme=dark] :is(#regionList .region-change.positive,#regionSummary>.region-change.positive){color:#85e4c4}
 html[data-theme=dark] #regionSummary{background:#101b2b}
 html[data-theme=dark] #regionSummary .region-year-total small{color:#adbed4}
 html[data-theme=dark] #regionSummary .is-current{background:#254d7b;border-color:#79b1f4}
 html[data-theme=dark] #regionSummary .is-current small{color:#e0edff}
 html[data-theme=dark] #regionList button{background:#172538;border-color:#324761;color:#e6edf7}html[data-theme=dark] #regionList button[aria-pressed=true]{background:#223f61;border-color:#87b9ff}@media(hover:hover) and (pointer:fine){
 html[data-theme=dark] #regionList button:hover{background:#223f61;border-color:#87b9ff}}
 html[data-theme=dark] #regionList small{color:#adbed4}
 html[data-theme=dark] :is(#regionList .region-votes,#regionList .region-share){color:#a2ccff}
 html[data-theme=dark] #mapExplorer .search-wrap{background:#101b2b}
 html[data-theme=dark] #loading{background:#0c1421;color:#b8d4ff}
 html[data-theme=dark] #tooltip{background:#1b2e46;color:#edf5ff;border:1px solid #496686}
 html[data-theme=dark] #tooltip small{color:#bfd0e5}
 html[data-theme=dark] :is(.search-wrap kbd,.smart-search input[aria-invalid=true]){border-color:#5a7394}
}
@media print{.theme-switch{display:none!important}}
