:root {
  color-scheme: light dark;
  --surface: #fff;
  --panel: #f5f7fa;
  --text: #26333c;
  --muted: #566575;
  --border: #dee2e6;
  --accent: #d65020;
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
html[data-theme=dark] {
  color-scheme: dark;
  --surface: #1b2028;
  --panel: #272e39;
  --text: #e4e8ee;
  --muted: #bbc6d3;
  --border: #3b4553;
  --accent: #f0784a;
}
html[data-theme=light] { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--surface); }
[hidden] { display: none !important; }
main { min-width: 0; }
.standalone-map main { max-width: 1250px; margin: auto; padding: 10px; }
.weather-controls, .map-details { display: flex; flex-wrap: wrap; gap: 6px; }
button, select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: 5px 8px; }
button[aria-pressed=true], #play { background: var(--accent); color: #fff; }
button:disabled { opacity: .55; cursor: default; }
.map-frame { position: relative; height: clamp(365px, 64vw, 550px); border-radius: 8px; overflow: hidden; background: #c6d9dc; container-type: inline-size; }
.desktop-map .map-frame { border-radius: 0; }
.map-expanded main { display: flex; flex-direction: column; height: 100dvh; }
.map-expanded .map-frame { flex: 1; height: auto; min-height: 0; }
.map-expanded main > :not(.map-frame) { flex-shrink: 0; }
.desktop-map .weather-controls, .desktop-map .precipitation-effects, .desktop-map #source-note,
.desktop-map .map-details > a, .desktop-map .map-details:has(#retry[hidden]) { display: none; }
.map-home-control #reset-view, .map-home-control .map-animation-button { padding: 0; font-size: 23px; line-height: 1; }
.map-home-control .map-animation-button { color: #566575; }
.map-home-control .map-animation-button[aria-pressed=true] { color: var(--accent); background: #fff3ed; }
#map { position: absolute; inset: 0; isolation: auto; }
#russia-particles { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-watermark { position: absolute; z-index: 1; inset: 50% auto auto 50%; transform: translate(-50%, -50%); font-size: 15cqw; font-weight: 700; color: rgb(255 255 255 / .14); -webkit-text-stroke: 1px rgb(24 49 63 / .16); white-space: nowrap; pointer-events: none; }
.weather-controls { position: absolute; z-index: 3; top: 9px; right: 9px; justify-content: end; max-width: calc(100% - 58px); }
.weather-controls > * { min-height: 34px; font-size: .8rem; box-shadow: 0 1px 5px #19344826; }
.maplibregl-ctrl-top-left, .maplibregl-ctrl-top-right { z-index: 4; }
.status { position: absolute; z-index: 3; top: 80px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 80%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; pointer-events: none; }
.map-city-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.map-city { position: absolute; top: 0; left: 0; width: max-content; color: #16303f; }
.map-city::before { content: ''; position: absolute; width: 8px; height: 8px; border: 1.5px solid #244353; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); }
.map-city-capital::before { width: 12px; height: 12px; background: #244353; border-color: #fff; outline: 1px solid #244353; }
.map-city-selected { z-index: 1; }
.map-city-selected::before { width: 11px; height: 11px; background: #ff5600; border-color: #fff; outline: 1px solid #ff5600; }
.russia-city-content { display: grid; justify-items: start; width: max-content; margin: -8px 0 0 7px; }
.russia-city-name { font-size: 11px; white-space: nowrap; text-shadow: 0 0 2px white, 1px 1px white, -1px -1px white; }
.russia-city-left .russia-city-content { transform: translateX(calc(-100% - 14px)); justify-items: end; }
.map-city-capital .russia-city-name { font-size: .98rem; }
.map-city-value { padding: 1px 4px; background: #f8fbfcEB; border-radius: 4px; font-size: .67rem; font-weight: 600; }
.russia-map-legend { display: flex; justify-content: center; padding: 5px 8px; background: var(--panel); }
#legend { width: min(100%, 410px); list-style: none; margin: 0; padding: 0; font-size: .8rem; line-height: 1.15; }
#legend li { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 8px; padding: 2px 0; }
.precipitation-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; text-align: center; }
.precipitation-scale[aria-hidden] { overflow: hidden; border-radius: 5px; }
.precipitation-scale[aria-hidden] > span { height: 12px; }
.timeline { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.desktop-map .timeline { border-radius: 0; }
#play { flex: none; min-width: 36px; height: 36px; }
.time-control { flex: 1; min-width: 0; }
#selected-time { display: block; text-align: center; font-size: .78rem; }
.rail { height: 24px; }
#time { display: block; width: 100%; height: 24px; margin: 0; accent-color: var(--accent); touch-action: none; }
.hours { position: relative; height: 15px; margin-inline: 8px; color: var(--muted); font-size: .67rem; }
.hours span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.hours span:first-child { transform: translateX(-8px); }
.hours span:last-child { transform: translateX(calc(-100% + 8px)); }
.hours .missing { color: #ac472e; text-decoration: line-through; }
.map-details { align-items: center; padding: 6px 1px; color: var(--muted); font-size: .78rem; column-gap: 12px; }
.map-details a { color: inherit; margin-inline-start: auto; }
.map-details button { padding-block: 2px; }
.precipitation-effects { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.precipitation-effects input { margin: 0; accent-color: var(--accent); }
#source-note[data-demo] { color: var(--accent); font-weight: 700; }
@media (max-width: 380px) {
  .weather-controls > * { font-size: .72rem; padding-inline: 5px; }
}

.demo-badge { position: absolute; z-index: 3; bottom: 8px; left: 8px; padding: 3px 7px; border-radius: 4px; background: #923b28; color: white; font-size: .75rem; font-weight: 650; pointer-events: none; }
