/* Only base-map tiles are reversed. Territory SVGs, pins and arcs retain their colours. */
html[data-theme=dark]{color-scheme:dark}
[data-theme=dark] body{background:#191d21;color:#edf0f2}
[data-theme=dark] main{background:#191d21}
[data-theme=dark] aside{background:#202529;border-color:#41494f}
[data-theme=dark] .canvas,[data-theme=dark] .canvas.map-has-modes,[data-theme=dark] #map{background:#24292e}
[data-theme=dark] #map .leaflet-tile-pane{filter:grayscale(1) invert(1) contrast(.82) brightness(.85)}
[data-theme=dark] h1,[data-theme=dark] #detail h2,[data-theme=dark] .record strong{color:#edf0f2}
[data-theme=dark] .intro,[data-theme=dark] .stats span,[data-theme=dark] .record small,[data-theme=dark] .source,[data-theme=dark] #postcodeStatus,[data-theme=dark] #territoryStatus,[data-theme=dark] .territory-help,[data-theme=dark] #detail p,[data-theme=dark] .maptop span{color:#bdc6cc}
[data-theme=dark] .stats,[data-theme=dark] .postcode-search,[data-theme=dark] .territory-controls,[data-theme=dark] .record,[data-theme=dark] #detail hr{border-color:#41494f}
[data-theme=dark] main input[type=search],[data-theme=dark] main input[type=text],[data-theme=dark] .postcode-row input,[data-theme=dark] main select{background:#2b3238;border-color:#536069;color:#f1f3f5}
[data-theme=dark] main input::placeholder{color:#b2bdc5;opacity:1}
[data-theme=dark] main button{background:#2b3238;color:#edf0f2;border-color:#536069}
[data-theme=dark] main button:hover{background:#39434b}
[data-theme=dark] .record{background:transparent}
[data-theme=dark] .record:hover{background:#303a42}
[data-theme=dark] .postcode-row button{background:#ae3417;border-color:#ae3417;color:white}
[data-theme=dark] .postcode-row button:hover{background:#ae3417;filter:brightness(1.1)}
[data-theme=dark] #detail,[data-theme=dark] .legend,[data-theme=dark] .mapnote,[data-theme=dark] .maptop>div:not(.map-actions),[data-theme=dark] .map-notice{background:#242a2ff5;color:#edf0f2;border-color:#536069;box-shadow:0 4px 22px #0004}
[data-theme=dark] .map-actions a{background:#2b3238;color:#edf0f2;border-color:#536069}
[data-theme=dark] .map-actions a:hover{background:#39434b}
[data-theme=dark] #detail button,[data-theme=dark] #detail .tag,[data-theme=dark] .map-notice a{color:#ae3417}
[data-theme=dark] .map-notice button{background:transparent;color:#edf0f2}
[data-theme=dark] .leaflet-bar a{background:#2b3238;color:#edf0f2;border-color:#536069}
[data-theme=dark] .leaflet-bar a:hover{background:#39434b}
[data-theme=dark] .leaflet-bar a.leaflet-disabled{color:#7e8a94}
[data-theme=dark] .leaflet-control-attribution{background:#202529e8;color:#bdc6cc}
[data-theme=dark] .leaflet-control-attribution a,[data-theme=dark] .leaflet-popup-content a{color:#bed1e2}
[data-theme=dark] .leaflet-popup-content-wrapper,[data-theme=dark] .leaflet-popup-tip,[data-theme=dark] .leaflet-tooltip,[data-theme=dark] .pin-tooltip{background:#242a2f;color:#edf0f2;border-color:#536069}
[data-theme=dark] .leaflet-tooltip-top:before{border-top-color:#242a2f}[data-theme=dark] .leaflet-tooltip-bottom:before{border-bottom-color:#242a2f}[data-theme=dark] .leaflet-tooltip-left:before{border-left-color:#242a2f}[data-theme=dark] .leaflet-tooltip-right:before{border-right-color:#242a2f}
[data-theme=dark] .network-pin:focus .pin-head,[data-theme=dark] .network-pin:hover .pin-head{stroke:#fff;stroke-width:3}
/* The header retains its existing colours and control styling in both themes. */
@media(max-width:480px){.header-actions{gap:3px}.header-actions>button{width:32px}.brand img{width:100px}.header-actions .view-toggle button{width:25px}}
