:root {
  --bg: #05070d;
  --glass: rgba(14, 18, 30, 0.62);
  --glass-strong: rgba(14, 18, 30, 0.86);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef2ff;
  --muted: #94a0bd;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --live: #4ade80;
  --warn: #fbbf24;
  --radius: 22px;
  --gutter: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }

#map {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 12%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 66% 44%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 80%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 8%, #fff4 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #fff5 50%, transparent 51%),
    radial-gradient(ellipse at 50% 40%, #0d1426 0%, var(--bg) 70%);
}
.maplibregl-canvas { outline: none; }
.wind { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.wind[hidden] { display: none; }

/* Glass surfaces */
.glass, .status, .fab, .panel, .hint, .brand, .loading, .legend {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* Loading bar */
.progress {
  --p: 0;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  z-index: 20;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px rgba(94, 234, 212, .6);
  transform-origin: left;
  /* A sliver shows straight away so it reads as "started". */
  transform: scaleX(calc(0.04 + var(--p) * 0.96));
  opacity: 0;
  transition: transform .3s ease-out, opacity .3s;
}
.progress.on { opacity: 1; }

/* Top bar */
.topbar {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  left: var(--gutter);
  right: calc(var(--gutter) + 56px);
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px;
  font-weight: 650; letter-spacing: .2px;
}
.brand svg { width: 22px; height: 22px; }
.status {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  border-radius: 999px;
  font-size: 13px; color: var(--muted);
  min-width: 0;
}
#status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .dot {
  flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.status.live .dot { background: var(--live); box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: pulse 2s infinite; }
.status.live { color: var(--text); }
.status.stale .dot { background: var(--warn); }
.loading {
  flex: none;
  display: flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 13px 0 11px;
  border-radius: 999px;
  font-size: 13px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.loading[hidden] { display: none; }
.loading svg { width: 18px; height: 18px; fill: none; stroke-width: 2.6; transform: rotate(-90deg); }
.loading circle:first-child { stroke: rgba(255, 255, 255, .14); }
#loading-ring {
  --p: 0;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - max(6, var(--p) * 100));
  transition: stroke-dashoffset .3s ease-out;
}
/* Before any tiles are requested: an indeterminate spinning arc. */
.loading.waiting svg { animation: spin 1s linear infinite; }
.loading.waiting #loading-ring { stroke-dashoffset: 75; }
#loading-pct:empty { display: none; }
@keyframes spin { to { transform: rotate(270deg); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }

/* Floating buttons */
.fabs {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  right: var(--gutter);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 10;
}
.fab {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  padding: 0;
  transition: transform .15s, background .2s;
}
.fab:active { transform: scale(.92); }
.fab svg, .step svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fab[aria-expanded="true"], .fab[aria-pressed="true"] { background: rgba(94, 234, 212, .22); border-color: rgba(94, 234, 212, .5); color: var(--accent); }
.fab { position: relative; }
.fab[hidden], .menu-row[hidden] { display: none; }
.badge {
  position: absolute; top: -4px; right: -6px;
  min-width: 18px; padding: 2px 5px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1.2;
  color: #06121a; background: var(--accent);
  font-variant-numeric: tabular-nums;
}
.badge[hidden] { display: none; }

/* Display menu */
.menu {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  right: calc(var(--gutter) + 54px);
  width: min(270px, calc(100% - 2 * var(--gutter) - 54px));
  z-index: 12;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  animation: pop .18s ease;
}
.menu[hidden] { display: none; }
.menu { max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px); overflow-y: auto; overscroll-behavior: contain; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu-row + .menu-row, input + .menu-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.menu-row.stacked { flex-direction: column; align-items: stretch; gap: 8px; }
#weather-toggles .menu-row, #weather-toggles + .menu-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.menu-head {
  margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11px; font-weight: 650; letter-spacing: .9px; text-transform: uppercase; color: var(--muted);
}
.menu-head + .menu-row { margin-top: 0; padding-top: 0; border-top: 0; }
.menu .link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
#bright { --track: linear-gradient(90deg, #1f2937, #e5e7eb); }
.toggle { cursor: pointer; }
.toggle small { display: block; font-size: 11.5px; color: var(--muted); }
.toggle input {
  -webkit-appearance: none; appearance: none;
  width: 42px; height: 24px; margin: 0; flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  position: relative;
  cursor: pointer;
  transition: background .2s;
}
.toggle input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .2s;
}
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.07); }
.seg button { border: 0; background: none; border-radius: 9px; padding: 7px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: rgba(255,255,255,.14); color: var(--text); }

/* Hint toast */
.hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--panel-h, 240px) + var(--safe-bottom) + 22px);
  transform: translateX(-50%);
  max-width: calc(100% - 2 * var(--gutter));
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 10;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: rise .3s ease;
}
.hint button { background: none; border: 0; padding: 0 0 0 6px; color: var(--accent); font-weight: 600; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

/* Bottom panel */
.panel {
  position: fixed;
  left: max(var(--gutter), 50% - 240px);
  right: max(var(--gutter), 50% - 240px);
  bottom: calc(var(--safe-bottom) + 12px);
  z-index: 10;
  border-radius: var(--radius);
  padding: 2px 16px 12px;
  background: var(--glass-strong);
  touch-action: manipulation;
}
.handle {
  display: block;
  width: 100%;
  height: 18px;
  background: none;
  border: 0;
  padding: 0;
}
.handle span { display: block; width: 38px; height: 4px; margin: 0 auto; border-radius: 4px; background: rgba(255,255,255,.22); }
.handle { touch-action: none; }
.handle b { display: none; }

/* Folded away: just a small tab naming what's on screen. */
.panel.collapsed {
  left: 50%; right: auto;
  transform: translateX(-50%);
  width: auto; max-width: calc(100% - 2 * var(--gutter));
  padding: 4px 16px 9px;
  border-radius: 999px;
}
.panel.collapsed .mode-head, .panel.collapsed .detail, .panel.collapsed .collapsible, .panel.collapsed .when-bar { display: none; }
.panel.collapsed .handle { height: auto; }
.panel.collapsed .handle span { width: 28px; margin-bottom: 4px; }
.panel.collapsed .handle b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mode-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mode-head h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .1px; }
.mode-head p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.res {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 650;
  color: #06121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-variant-numeric: tabular-nums;
}

/* Detail slider */
.detail { margin-top: 10px; }
.detail-ends { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); margin-bottom: 0; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px;
  background: var(--track, rgba(255,255,255,.14));
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--track, rgba(255,255,255,.14)); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; margin-top: -10px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.45), 0 0 0 5px rgba(94,234,212,.18);
}
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
#detail { --track: linear-gradient(90deg, var(--live), var(--accent) 40%, var(--accent-2)); }

.ticks { display: grid; grid-template-columns: repeat(4, 1fr); margin: 2px -6px 0; }
.ticks button {
  background: none; border: 0;
  padding: 2px 0 4px;
  font-size: 12.5px; font-weight: 550;
  color: var(--muted);
  transition: color .2s;
}
.ticks button:first-child { text-align: left; padding-left: 6px; }
.ticks button:last-child { text-align: right; padding-right: 6px; }
.ticks button[aria-current="true"] { color: var(--text); }

.collapsible { overflow: hidden; }

.ctx { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.ctx[hidden] { display: none; }

.scrub-row { display: flex; align-items: center; gap: 12px; }
.play {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.1);
}
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play .i-pause, .play.on .i-play { display: none; }
.play.on .i-pause { display: block; }
.play:active { transform: scale(.94); }

.time-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.time-row strong { color: var(--text); font-size: 15px; font-weight: 650; }
.live-btn {
  border: 1px solid var(--line); background: none;
  border-radius: 999px; padding: 3px 11px;
  font-size: 12px; font-weight: 650; letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted);
}
.live-btn.on { color: #06210f; background: var(--live); border-color: transparent; }

.chips { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  font-size: 11.5px; line-height: 1;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip b { color: var(--text); font-weight: 600; margin-right: 4px; }
.chip.stale b { color: var(--warn); }
.chip.off { opacity: .5; }
.chip.bolt b { color: #fde047; }
#bolt-chips { margin-top: 6px; }
#bolt-chips[hidden] { display: none; }

/* Time travel bar: only shown while viewing the past */
.when-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 10px; padding: 6px 6px 6px 10px;
  border-radius: 14px;
  background: rgba(129, 140, 248, .16);
  border: 1px solid rgba(129, 140, 248, .35);
  font-size: 13px;
}
.when-bar[hidden] { display: none; }
.when-open {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: none; border: 0; padding: 0; text-align: left; color: var(--muted);
}
.when-open span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when-open strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.when-open svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--accent-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.when-bar .live-btn { flex: none; color: var(--text); }

.when-input {
  display: block; width: 100%; height: 46px;
  padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.07); color: var(--text);
  font: inherit; font-size: 16px; font-variant-numeric: tabular-nums;
  color-scheme: dark;
}
.when-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.when-quick button {
  border: 1px solid var(--line); background: rgba(255,255,255,.06);
  border-radius: 999px; padding: 6px 11px; font-size: 12.5px; color: var(--muted);
}
.when-quick button:active { background: rgba(255,255,255,.14); color: var(--text); }
dialog .when-limits { margin: 4px 0 18px; }
dialog .when-limits dt { font-size: 13.5px; }
dialog .when-limits dd { font-size: 12.5px; }
.when-actions { display: flex; gap: 10px; }
.when-actions .ghost {
  flex: 1; height: 44px;
  border: 1px solid var(--line); border-radius: 14px;
  background: none; font-weight: 650;
}
.when-actions .ghost[hidden] { display: none; }
.when-actions .close { flex: 1; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.step {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%; border: 0;
  background: rgba(255,255,255,.1);
  display: grid; place-items: center;
}
.step:disabled { opacity: .3; }
.step-label { text-align: center; display: flex; flex-direction: column; }
.step-label strong { font-size: 15px; }
.step-label span { font-size: 12.5px; color: var(--muted); }

.note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.ctx > .note:first-child { margin-top: 0; }
.note strong { color: var(--text); font-weight: 600; }

.attrib { margin: 8px 0 0; font-size: 10.5px; color: rgba(148,160,189,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Capture time of the imagery in the middle of the view */
.captured {
  margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.captured[hidden] { display: none; }
.captured::before {
  content: ""; display: inline-block; vertical-align: -1px; margin-right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  box-shadow: inset 0 0 0 2px var(--glass-strong), inset 0 0 0 4px var(--accent);
}
.captured strong { color: var(--text); font-weight: 600; }

/* Selected flight */
.flight {
  position: fixed;
  top: calc(var(--safe-top) + 60px);
  left: var(--gutter);
  width: min(300px, calc(100% - 2 * var(--gutter) - 56px));
  z-index: 11;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  animation: pop .18s ease;
}
.flight[hidden] { display: none; }
.flight-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.flight-head strong { display: block; font-size: 17px; letter-spacing: .3px; }
.flight-head span { font-size: 12.5px; color: var(--muted); }
.x { flex: none; width: 30px; height: 30px; margin: -4px -6px 0 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.flight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; margin: 10px 0 0; }
.flight-grid dt { font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.flight-grid dd { margin: 1px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flight-src { margin: 10px 0 0; font-size: 11px; color: var(--muted); }

/* Place search */
.search {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  right: calc(var(--gutter) + 54px);
  width: min(340px, calc(100% - 2 * var(--gutter) - 54px));
  z-index: 12;
  border-radius: 18px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: pop .18s ease;
}
.search[hidden] { display: none; }
.search input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 0; outline: none; background: none;
  color: var(--text); font: inherit; font-size: 16px;
}
.search ul { list-style: none; margin: 0; padding: 0; }
.search li { padding: 9px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.search li[aria-selected="true"], .search li:hover { background: rgba(255,255,255,.07); }
.search li strong { display: block; font-weight: 600; font-size: 14px; }
.search li span { font-size: 12px; color: var(--muted); }
.search li.empty { color: var(--muted); font-size: 13px; cursor: default; }

/* Before/after comparison */
.compare { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.compare[hidden], .divider[hidden], .compare-bar[hidden] { display: none; }
.divider {
  position: fixed; top: 0; bottom: 0; left: 50%;
  width: 36px; margin-left: -18px;
  z-index: 2;
  cursor: ew-resize; touch-action: none;
}
.divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: 17px; width: 2px; background: rgba(255,255,255,.85); box-shadow: 0 0 8px rgba(0,0,0,.5); }
.divider span {
  position: absolute; top: 50%; left: 4px;
  width: 28px; height: 28px; margin-top: -14px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.divider span::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; color: #0b1220; font-weight: 700; font-size: 14px; letter-spacing: 2px; }
.compare-bar {
  position: fixed;
  top: calc(var(--safe-top) + 60px);
  left: 50%; transform: translateX(-50%);
  z-index: 11;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,.45);
  font-size: 13px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.compare-bar .tag { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; }
.compare-bar .tag.after { margin-left: 8px; }
.compare-bar .tag b { color: var(--text); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 13px; }
.compare-bar .x { margin: 0; }
.step.sm { width: 28px; height: 28px; }
.step.sm svg { width: 16px; height: 16px; }
.pill-btn {
  margin-top: 8px;
  border: 1px solid var(--line); background: rgba(255,255,255,.06);
  border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
}

/* Weather legend */
.legend {
  position: fixed;
  left: var(--gutter);
  bottom: calc(var(--panel-h, 240px) + var(--safe-bottom) + 22px);
  width: 200px;
  z-index: 9;
  padding: 8px 10px 6px;
  border-radius: 14px;
  font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.legend[hidden] { display: none; }
.legend-item + .legend-item { margin-top: 8px; }
.legend-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.legend-head strong { color: var(--text); font-weight: 600; }
.legend-bar { height: 8px; border-radius: 4px; }
.legend-ticks { display: flex; justify-content: space-between; margin-top: 3px; }

/* Map popups (temperature readout) */
.maplibregl-popup-content {
  padding: 7px 11px; border-radius: 12px;
  background: var(--glass-strong); color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  font-size: 13px;
}
.maplibregl-popup-tip { display: none; }
.wx-tip {
  position: fixed; top: 0; left: 0;
  z-index: 8;
  padding: 6px 10px; border-radius: 10px;
  background: var(--glass-strong); color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  font-size: 13px; white-space: nowrap;
  pointer-events: none;
}
.wx-tip[hidden] { display: none; }
.wx-value { display: block; }
.wx-value + .wx-value { margin-top: 2px; }
.wx-value strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.wx-value span { color: var(--muted); font-size: 11.5px; margin-left: 4px; }

/* User location */
.me { width: 16px; height: 16px; border-radius: 50%; background: #60a5fa; border: 2.5px solid #fff; box-shadow: 0 0 0 6px rgba(96,165,250,.3); }

/* Info dialog */
dialog {
  width: min(520px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100% - var(--safe-top) - var(--safe-bottom) - 40px);
  padding: 22px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 16, 27, .96);
  color: var(--text);
  overflow: auto;
}
dialog::backdrop { background: rgba(2, 4, 10, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 6px; font-size: 19px; }
dialog p { color: var(--muted); margin: 0 0 14px; }
dialog dl { margin: 0; }
dialog dt { font-weight: 650; margin-top: 12px; display: flex; justify-content: space-between; gap: 10px; }
dialog dt span { color: var(--accent); font-weight: 550; font-size: 12.5px; }
dialog dd { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
dialog .small { font-size: 11.5px; margin-top: 16px; }
dialog .close {
  width: 100%; height: 44px;
  border: 0; border-radius: 14px;
  font-weight: 650; color: #06121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* On phones the logo pill only takes room from the status. */
@media (max-width: 719px) {
  .brand { display: none; }
}
@media (max-width: 459px) {
  .compare-bar .tag.after { display: none; }
}
@media (max-width: 719px) {
  /* Middle of the map that's visible above the panel. */
  .divider span { top: calc((100% - var(--panel-h, 240px)) / 2); }
}

@media (min-width: 720px) {
  .panel { left: auto; right: var(--gutter); width: 400px; bottom: calc(var(--safe-bottom) + var(--gutter)); }
  .panel.collapsed { left: auto; right: var(--gutter); transform: none; }
  .fabs { top: calc(var(--safe-top) + 10px); }
  .hint { left: calc(100% - 216px - var(--gutter)); bottom: calc(var(--panel-h, 240px) + var(--gutter) + 12px); }
  .legend { bottom: calc(var(--safe-bottom) + var(--gutter)); width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
