/* UI-only theme. No filter ever targets flags, diagrams, polygons or coverage. */
.top-actions{display:flex;align-items:center;gap:16px;margin-left:auto;flex-shrink:0}
.theme-toggle{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);border-radius:50%;color:var(--ink);flex-shrink:0}
.theme-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-sun{display:none}[data-theme=dark] .theme-moon{display:none}[data-theme=dark] .theme-sun{display:block}
:root[data-theme=dark]{color-scheme:dark;color:#e3e6e9;background:#202428;--ink:#e5e8ec;--muted:#aab3bd;--line:#41484f;--accent:#f29b72;--soft:#292f35;--green:#9fc7b6;--surface:#24292e;--raised:#343c43;--surface-alt:#2b3239}
[data-theme=dark] :is(.topbar,.rail,.panel-shell,#suggestions,.profile-tabs,dialog,.comparison-table thead th,.hover-card,.rec-close,.skip){background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(.floating,.leaflet-tooltip,.leaflet-popup-content-wrapper,.leaflet-popup-tip){background:#262c32f5;color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(input,select,textarea,.search-wrap input,.mini-select,.control-group select,.select-full,.notes){background:#1d2329;color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(.country-row,.suggestion,.profile-actions button,.secondary,.icon-btn,.rec-facts,.rec-footer,.rec-language-grid>.rec-unverified,.rec-pointer,.rec-large-visual,.rec-tile,.rec-language-item,.rec-close,.tag,.clue-number,.empty,.coverage-layer-card){border-color:var(--line)}
[data-theme=dark] :is(.profile-actions button,.secondary,.rec-large-visual,.language-sample,.visual-card,.variant-card,.signage-example,.shared-clues,.layer-option .layer-icon,.comparison-table tr.different,.tag,.badge){background:var(--surface-alt);color:var(--ink)}
[data-theme=dark] :is(.suggestion:hover,.suggestion[aria-selected=true],.nav-item:hover,.nav-item.active,.country-row:hover,.icon-btn:hover,.profile-actions button:hover,.secondary:hover,.regional-card:hover,.layer-option.active,.rec-overview button:hover,.theme-toggle:hover){background:var(--raised);color:var(--ink);border-color:#729b84}
[data-theme=dark] .lead-card{background:linear-gradient(125deg,#313b3c,#252d31);border-color:var(--line)}
[data-theme=dark] :is(.lead-card button,.primary){background:#8ac7ac;color:#102b20}
[data-theme=dark] :is(.note-box,.badge.gray){background:#263a2b;color:#c8d7c2;border-color:#688569}
[data-theme=dark] :is(.note-box.amber,.badge.amber,.tile-warning){background:#392e20;color:#ecd2a8;border-color:#8b714a}
[data-theme=dark] :is(.brand small,.nav-item,.icon-btn,.chevron,.legend p,.map-caption,.lead-card p,.lead-card .eyebrow,.profile-tabs button,.fact .mini,.plate-row>span,.language-sample small,.category-checks span,.missing,.layer-option small,.reason,.count-label,.hover-title small,.hover-card footer,.empty p,.note-saved,.comparison-table th:first-child,.evidence,.evidence-status,.table-scroll-hint,.plate-color-example small,.rec-identity small,.rec-facts small,.rec-label>span,.rec-language-item small,.rec-tile>small:first-child,.rec-plate-face>small,.rec-note,.rec-unverified,.rec-pointer small,.rec-footer small,.rec-native-detail small,.rec-back,.map-loading>span:last-child){color:var(--muted)}
[data-theme=dark] :is(.rec-overview,.language-sample .script,.signage-word,.regional-card .direction,.clue .weight,.category-checks .done,.profile-tabs button.active){color:var(--ink)}
[data-theme=dark] .rec-script mark{background:#3c4d56;color:#eef3f6}
[data-theme=dark] .coverage-launch{background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme=dark] .coverage-launch.is-on{background:#3b2529;color:#ffb4b7;border-color:#d46973}
[data-theme=dark] :is(.coverage-alert,.coverage-retry){background:#352528;color:#ffd1d4}
[data-theme=dark] .coverage-opacity{accent-color:#e26774}
[data-theme=dark] :is(#map,.map-stage){background:#06080b}
[data-theme=dark] .map-loading{background:#22282ef5}
/* Local SVG palette over the same downloaded raster tiles; only this pane is affected. */
[data-theme=dark] .leaflet-basemap-pane .leaflet-tile{filter:url(#atlas-night-map)}
[data-theme=dark] .leaflet-control-attribution{background:#20262dea!important;color:#c5cbd3}
[data-theme=dark] .leaflet-control-scale-line{background:#20262dce!important;color:#e0e4ea!important;border-color:#aab3bd!important}
[data-theme=dark] .city-label{color:#e5e8ec;text-shadow:0 1px 3px #171c23,0 -1px 2px #171c23}
[data-theme=dark] :is(#panel,.profile-tabs,*){scrollbar-color:#626e7b #24292e}
[data-theme=dark] dialog::backdrop{background:#020c09b5}
[data-theme=dark] .toast{background:#315944;color:#eff8f0}
@media(max-width:800px){.top-actions{gap:10px}.topbar .top-actions{grid-column:2;grid-row:1}.top-actions .guide-btn{grid-column:auto;grid-row:auto}.theme-toggle{width:34px;height:34px}}

[data-theme=dark] .leaflet-control-attribution a{color:#a9c6dc}
