/* Decoded Map: a calm Earth with dark glass panels. Dark UI only (it's a night-ops look). */
:root {
  --bg: #000000;
  --surface: #050b18;
  --surface-2: #0a1428;
  --line: #16305a;
  --line-bright: #2a5cab;
  --glow: #3f8cff;
  --glow-soft: rgba(63, 140, 255, 0.35);
  --text: #e8f0ff;        /* 17.6:1 on black */
  --muted: #a3b6d6;       /* 9.8:1 on black, 8.6:1 on --surface */
  --accent: #6fb0ff;      /* links: 8.9:1 on black */
  --war: #ff5d5d;
  --political: #c39bff;
  --geopolitical: #4fd1ff;
  --humanitarian: #ffb84d;
  --economic: #5be38c;
  --history: #f2f6ff;
  --countries: #9cc4ff;   /* the light country shading */
  --draft: #ffd24d;
  --radius: 10px;
  --glass: rgba(4, 9, 20, 0.9);      /* menus and panel: #040914 under the blur */
  --glass-line: rgba(140, 180, 255, 0.2);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 48px -12px rgba(0, 0, 0, 0.75);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: auto;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.5 var(--font);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100dvh;
  overflow: hidden;
}
/* Fixed rows, so the map still fills the screen when the (optional) banner is hidden. */
body > .site-header { grid-row: 1; }
body > .banner { grid-row: 2; }
body > main { grid-row: 3; }
body > .site-footer { grid-row: 4; }
body.page { display: block; height: auto; overflow: auto; }
a { color: var(--accent); }
a:hover { color: #a9d0ff; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(63, 140, 255, 0.25); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface-2); color: var(--text); padding: 8px 12px; border: 1px solid var(--glow); border-radius: 6px; }
.skip:focus { top: 8px; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #02050c, #000);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(63, 140, 255, 0.15), 0 8px 24px -12px var(--glow-soft);
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; min-width: 0; }
.brand-name {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none;
  font: 700 18px/1.1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  text-shadow: 0 0 12px var(--glow-soft);
}
.brand-mark { width: 22px; height: 22px; color: var(--glow); filter: drop-shadow(0 0 4px var(--glow)); align-self: center; }
.tagline { margin: 0; color: var(--muted); font-size: 14px; }
.site-nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.site-nav a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.yt-dot { width: 10px; height: 10px; border-radius: 3px; background: #ff3b3b; display: inline-block; }

.btn {
  font: 600 14px/1 var(--font); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-bright);
  padding: 10px 14px; border-radius: 8px; cursor: pointer; min-height: 40px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--glow); }
.btn-primary { background: #0f3d8f; border-color: var(--glow); box-shadow: 0 0 14px -2px var(--glow-soft); color: #fff; }
.btn-primary:hover { background: #1550b8; color: #fff; }

.banner { margin: 0; padding: 6px 18px; font: 600 12.5px/1.4 var(--mono); background: #2a2200; color: var(--draft); border-bottom: 1px solid #5c4a00; }

/* Main area */
main { position: relative; min-height: 0; overflow: hidden; }
.map-view, #map { position: absolute; inset: 0; }
/* Space behind the globe: a few faint stars (CSS only, no images) on near-black with a soft blue haze. */
#map {
  background-color: #01040b;
  background-image:
    radial-gradient(1px 1px at 7% 18%, rgba(220, 232, 255, 0.75) 50%, transparent 51%),
    radial-gradient(1px 1px at 23% 72%, rgba(220, 232, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 9%, rgba(200, 220, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 88%, rgba(220, 232, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 14%, rgba(220, 232, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 81% 61%, rgba(180, 205, 255, 0.65) 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 27%, rgba(220, 232, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 12% 47%, rgba(220, 232, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 92%, rgba(220, 232, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 36%, rgba(220, 232, 255, 0.35) 50%, transparent 51%),
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(31, 79, 168, 0.16), transparent 70%);
  background-size: 310px 290px, 370px 330px, 430px 410px, 290px 350px, 350px 270px, 470px 430px, 330px 390px, 250px 230px, 410px 370px, 270px 310px, 100% 100%;
}
.grid-overlay { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px 0 rgba(0, 0, 0, 0.38); }
body.base-dark #map { background-color: #000206; }
body.base-dark .grid-overlay {
  background-image:
    linear-gradient(rgba(63, 140, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 140, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  box-shadow: inset 0 0 120px 20px #000;
}

/* Glass: the shared look of the pills, menus and panel */
.pill, .menu, .panel, .live-bar, .empty-hint, .pick-hint {
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--glass-shadow);
}

/* Top-left: Spots and Layers */
.map-ui { position: absolute; left: 14px; top: 14px; z-index: 4; display: flex; gap: 8px; }
.map-ui[hidden] { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px 0 13px;
  border-radius: 999px; color: var(--text); font: 600 14px/1 var(--font); cursor: pointer;
}
.pill svg { width: 16px; height: 16px; color: var(--accent); }
.pill:hover { border-color: rgba(140, 180, 255, 0.45); }
.pill[aria-expanded="true"] { background: rgba(15, 61, 143, 0.92); border-color: var(--glow); }
.pill[aria-expanded="true"] svg { color: #fff; }
.pill-count { font: 700 11.5px/1 var(--mono); color: var(--muted); padding: 3px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.pill-count:empty { display: none; }
.pill[aria-expanded="true"] .pill-count { color: #fff; background: rgba(255, 255, 255, 0.16); }

.menu {
  position: absolute; z-index: 5; left: 14px; top: 62px; border-radius: 14px;
  max-height: calc(100% - 78px); overflow-y: auto; overscroll-behavior: contain;
}
.menu[hidden] { display: none; }
.menu-group { border: 0; margin: 0; padding: 10px 12px 12px; min-width: 0; }
.menu-group + .menu-group { border-top: 1px solid rgba(140, 180, 255, 0.12); }
.menu-group legend, .menu-label { padding: 0; margin: 0 0 6px; font: 700 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.menu-group legend { float: left; width: 100%; }
.menu-group legend + * { clear: both; }

/* Layers menu: "What to show" (topic chips + Apply) on top, then the instant "Map look" toggles */
.layers-menu { width: 348px; padding: 4px 0 0; }
.topics { padding-bottom: 14px; }
.topics legend { color: var(--text); }
.menu-help { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  flex: 1 1 auto; display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 38px; padding: 0 8px 0 10px; border-radius: 999px;
  border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.03); color: var(--text);
  font: 600 13.5px/1 var(--font); cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.chip:hover { border-color: rgba(140, 180, 255, 0.5); background: rgba(255, 255, 255, 0.06); }
/* The real checkbox, drawn as a small box in the topic's colour (it's also the colour key) */
.chip input {
  -webkit-appearance: none; appearance: none; margin: 0; flex: none; width: 16px; height: 16px; border-radius: 5px;
  border: 2px solid var(--c); background: transparent; display: inline-grid; place-items: center; cursor: pointer;
  box-shadow: 0 0 7px -1px var(--c);
}
.chip input::after {
  content: ""; width: 4px; height: 8px; border: solid #04101f; border-width: 0 2.2px 2.2px 0;
  transform: translateY(-1px) rotate(45deg); opacity: 0;
}
.chip input:checked { background: var(--c); }
.chip input:checked::after { opacity: 1; }
.chip input:focus-visible { outline: none; box-shadow: 0 0 7px -1px var(--c); }
.chip:has(input:focus-visible) { outline: 2px solid var(--glow); outline-offset: 2px; }
.chip:has(input:checked) {
  border-color: var(--c); color: #fff;
  background: color-mix(in srgb, var(--c) 20%, rgba(4, 9, 20, 0.7));
  box-shadow: 0 0 14px -6px var(--c);
}
.chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-count { margin-left: auto; flex: none; font: 700 11px/1 var(--mono); color: var(--muted); padding: 3px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.chip:has(input:checked) .chip-count { color: #fff; background: rgba(255, 255, 255, 0.16); }
.chip.is-empty:not(:has(input:checked)) .chip-name { color: var(--muted); }
.c-war { --c: var(--war); } .c-political { --c: var(--political); } .c-geopolitical { --c: var(--geopolitical); }
.c-humanitarian { --c: var(--humanitarian); } .c-economic { --c: var(--economic); } .c-history { --c: var(--history); }
.c-history input { border-radius: 3px; transform: rotate(45deg) scale(0.86); }
.c-countries { --c: var(--countries); }
.c-countries input { border-radius: 4px; }
.c-history input::after { transform: rotate(0deg) translate(-0.5px, -1px); }
.topic-actions { display: flex; align-items: center; gap: 2px; margin-top: 12px; }
.link-btn {
  background: transparent; border: 0; padding: 9px 9px; border-radius: 8px; color: var(--accent);
  font: 600 13px/1 var(--font); cursor: pointer;
}
.link-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.link-btn[hidden] { display: none; }
.btn-apply { margin-left: auto; min-width: 112px; justify-content: center; font-size: 14.5px; }
.btn-apply.is-changed { box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.28), 0 0 18px -2px var(--glow); }
.topic-note { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; margin: 8px 0 0; min-height: 30px; color: var(--muted); font-size: 12.5px; }
.topic-note .link-btn { padding: 6px 8px; font-size: 12.5px; }
.map-look { border-top: 1px solid rgba(140, 180, 255, 0.2); background: rgba(255, 255, 255, 0.03); padding-bottom: 4px; }
.look-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; padding: 12px 12px 2px;
  font: 700 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
}
.look-head small { font: 500 11.5px/1.4 var(--font); letter-spacing: 0; text-transform: none; color: var(--muted); }
.map-look .menu-group { padding-top: 8px; }
.map-look .menu-group + .menu-group { border-top: 0; padding-top: 0; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px; margin: 0 -4px; border-radius: 9px; cursor: pointer; }
.opt:hover { background: rgba(255, 255, 255, 0.05); }
.opt input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--glow); flex: none; }
.opt strong { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.opt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.opt:has(input:focus-visible) { outline: 2px solid var(--glow); outline-offset: 0; }
.opt:has(input:checked) strong { color: #fff; }

/* Spots menu: a slim list, grouped by region */
.spots-menu { width: 312px; padding: 0 0 8px; }
.menu-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px 8px 16px; background: linear-gradient(180deg, rgba(4, 9, 20, 0.98) 70%, rgba(4, 9, 20, 0));
}
.menu-head h2 { margin: 0; font: 700 12px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.spots-group { padding: 0 8px; }
.spots-group h3, .spots-history summary {
  margin: 8px 8px 2px; font: 700 10.5px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.spots-history summary { cursor: pointer; padding: 6px 0; }
.spots-group ul, .spot-links { list-style: none; margin: 0; padding: 0; }
.spot-link {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 8px 8px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.spot-link:hover { background: rgba(255, 255, 255, 0.05); }
.spot-link[aria-current="true"] { background: rgba(63, 140, 255, 0.14); border-color: rgba(63, 140, 255, 0.45); }
.spot-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 10px var(--c); }
.spot-dot.d-history { border-radius: 2px; transform: rotate(45deg); width: 8px; height: 8px; box-shadow: 0 0 8px rgba(63, 140, 255, 0.9); }
.d-war { --c: var(--war); } .d-political { --c: var(--political); } .d-geopolitical { --c: var(--geopolitical); }
.d-humanitarian { --c: var(--humanitarian); } .d-economic { --c: var(--economic); } .d-history { --c: var(--history); }
.spot-text { display: grid; min-width: 0; flex: 1; }
.spot-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.spot-sub { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.spot-link .badge-draft { flex: none; font-size: 9.5px; padding: 1px 5px; }

/* Live strip: only while today's clouds or radar are on */
.live-bar {
  position: absolute; z-index: 3; left: 14px; bottom: 34px; border-radius: 12px; padding: 6px 8px 6px 8px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: calc(100% - 28px);
}
.live-bar[hidden], .radar-bar[hidden], .sat-date[hidden], .live-off[hidden] { display: none; }
.radar-bar { display: flex; align-items: center; gap: 8px; font: 600 12.5px/1.3 var(--mono); color: var(--text); }
.radar-play {
  width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-bright); padding: 0;
}
.radar-play[hidden] { display: none; }
.radar-play:hover { border-color: var(--glow); }
.radar-play svg { width: 13px; height: 13px; }
.radar-play svg[hidden] { display: none; }
.sat-date { margin: 0; font: 12px/1.35 var(--mono); color: var(--muted); }
.live-off {
  font: 600 12.5px/1 var(--font); color: var(--accent); background: transparent; border: 1px solid var(--line-bright);
  border-radius: 999px; padding: 8px 11px; cursor: pointer;
}
.live-off:hover { color: #fff; border-color: var(--glow); }
.live-off .sh { display: none; }

.empty-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 44px; transform: translateX(-50%); margin: 0;
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px; color: var(--muted); white-space: nowrap; max-width: calc(100% - 28px);
}
.empty-hint[hidden] { display: none; }

/* The first-time tip on the empty map */
.pick-hint {
  position: absolute; z-index: 2; left: 50%; top: 56%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 16px 22px 18px; border-radius: 16px; max-width: calc(100% - 32px);
}
.pick-hint[hidden], body.menu-layers .pick-hint, body.menu-spots .pick-hint { display: none; }
.pick-title { margin: 0 24px; color: var(--muted); font-size: 13.5px; }
.pick-hint .btn svg { width: 16px; height: 16px; }
.pick-close { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; font-size: 20px; }
body.map-empty #layers-toggle:not([aria-expanded="true"]) { border-color: rgba(63, 140, 255, 0.7); box-shadow: var(--glass-shadow), 0 0 14px -3px var(--glow); }

/* Spots menu when nothing is chosen */
.spots-empty { padding: 2px 16px 10px; }
.spots-empty-title { margin: 2px 0 4px; font-size: 15px; font-weight: 700; }
.spots-empty .tab-empty { font-style: normal; font-size: 13.5px; margin: 0 0 12px !important; }

/* Weather-here popup and panel section */
.wx-popup { z-index: 4; } /* above the map tools card */
.wx-popup .maplibregl-popup-content {
  background: rgba(4, 9, 20, 0.97); color: var(--text); border: 1px solid var(--line-bright); border-radius: 12px;
  padding: 12px 14px 10px; box-shadow: 0 0 30px -6px var(--glow-soft), 0 12px 30px rgba(0, 0, 0, 0.6); font-size: 14px;
}
.wx-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.wx-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.wx-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--line-bright); }
.wx-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.wx-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.wx-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--line-bright); }
.wx-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--line-bright); }
.wx-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--line-bright); }
.wx-popup .maplibregl-popup-close-button { color: var(--text); font-size: 22px; width: 32px; height: 32px; border-radius: 6px; right: 2px; top: 2px; }
.wx-popup .maplibregl-popup-close-button:hover { background: var(--surface-2); }
.wx-title { margin: 0 30px 6px 0; font: 700 12px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.wx p { margin: 0; }
.wx-main { display: flex; align-items: center; gap: 12px; }
.wx-icon { width: 44px; height: 44px; flex: none; }
.wx-temp { font: 700 24px/1.1 var(--font); }
.wx-f { font-size: 15px; font-weight: 600; color: var(--muted); }
.wx-cond { color: var(--text); font-weight: 600; }
.wx-facts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; color: var(--muted); font-size: 13.5px; }
.wx-where { margin-top: 6px !important; color: var(--muted); font: 12px/1.4 var(--mono); }
.wx-credit { margin-top: 8px !important; font-size: 12px; }
.wx-msg { color: var(--muted); }
.panel-wx { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.map-fallback { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); background: var(--surface-2); border: 1px solid var(--line-bright); padding: 16px 20px; border-radius: var(--radius); max-width: 90%; }

/* Markers (real buttons, so they work with the keyboard) */
.marker {
  width: 34px; height: 34px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.marker[hidden] { display: none; }
/* On the far side of the globe (or behind a mountain): hidden, not clickable, not a Tab stop. */
.marker.maplibregl-marker-covered { visibility: hidden; pointer-events: none; }
.marker::before {
  content: ""; grid-area: 1 / 1; width: 14px; height: 14px; border-radius: 50%;
  background: var(--c); border: 2.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 14px 2px var(--c);
  transition: transform 0.18s ease;
}
/* The gentle pulse (turned off for reduced motion at the bottom of this file) */
.marker::after {
  content: ""; grid-area: 1 / 1; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--c); opacity: 0; animation: pulse 3.2s ease-out infinite; pointer-events: none;
}
.marker.m-war { --c: var(--war); }
.marker.m-political { --c: var(--political); }
.marker.m-geopolitical { --c: var(--geopolitical); }
.marker.m-humanitarian { --c: var(--humanitarian); }
.marker.m-economic { --c: var(--economic); }
.marker.m-history { --c: var(--history); width: 26px; height: 26px; }
.marker.m-history::before {
  border-radius: 2px; transform: rotate(45deg); width: 9px; height: 9px; border: 1.5px solid #0b1a33;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 8px 1px rgba(63, 140, 255, 0.9);
}
.marker.m-history::after { display: none; }
.marker.m-history.is-highlight::before { transform: rotate(45deg) scale(1.5); box-shadow: 0 0 0 2px var(--glow), 0 0 14px 3px rgba(63, 140, 255, 0.95); }
.marker.m-history.is-highlight::after { display: block; border-radius: 3px; width: 10px; height: 10px; border-color: var(--glow); }
.marker.is-draft::before { outline: 2px dashed var(--draft); outline-offset: 3px; }
.marker:hover::before, .marker:focus-visible::before { transform: scale(1.18); }
.marker.m-history:hover::before, .marker.m-history:focus-visible::before { transform: rotate(45deg) scale(1.35); }
.marker:focus-visible { outline: none; box-shadow: none; }
.marker:focus-visible::before, .marker.m-spot.is-active::before { box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.9), 0 0 20px 5px var(--c); }
.marker.m-spot.is-active::before { transform: scale(1.25); }
.marker:hover, .marker:focus-visible, .marker.is-active, .marker.is-highlight { z-index: 2; }
/* After Apply: each new marker pops in (staggered from app.js through --pop-delay), with one ring burst */
.marker.is-popping::before { animation: pop-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) var(--pop-delay, 0ms) both; }
.marker.m-history.is-popping::before { animation-name: pop-in-diamond; }
.marker.is-popping::after { animation: pop-ring 0.9s ease-out calc(var(--pop-delay, 0ms) + 120ms) both; }
.marker.is-popping .marker-label { opacity: 0; }
@keyframes pop-in { 0% { transform: scale(0); opacity: 0; } 55% { transform: scale(1.4); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pop-in-diamond { 0% { transform: rotate(45deg) scale(0); opacity: 0; } 55% { transform: rotate(45deg) scale(1.6); opacity: 1; } 100% { transform: rotate(45deg) scale(1); opacity: 1; } }
@keyframes pop-ring { 0% { transform: scale(0.8); opacity: 0.9; } 100% { transform: scale(3.4); opacity: 0; } }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.75; } 70% { opacity: 0; } 100% { transform: scale(2.9); opacity: 0; } }

/* Small label on hover / focus (and on the open spot) */
.marker-label {
  position: absolute; left: 50%; bottom: calc(100% - 2px); transform: translate(-50%, 4px);
  max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; background: rgba(4, 9, 20, 0.92); border: 1px solid var(--glass-line);
  color: var(--text); font: 600 12.5px/1.2 var(--font); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease;
}
.marker:hover .marker-label, .marker:focus-visible .marker-label,
.marker.m-spot.is-active .marker-label, .marker.is-highlight .marker-label { opacity: 1; transform: translate(-50%, 0); }

/* MapLibre controls */
.maplibregl-ctrl-group { background: var(--glass) !important; border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow) !important; border-radius: 10px !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid rgba(140, 180, 255, 0.16); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
.maplibregl-ctrl-top-right { top: 4px; right: 4px; transition: right 0.2s ease; }
body.panel-open .maplibregl-ctrl-top-right { right: 442px; }
.tilt-btn .tilt-ico { display: block; font: 700 11px/29px var(--mono); letter-spacing: 0.04em; color: var(--muted); }
.tilt-btn[aria-pressed="true"] .tilt-ico { color: #fff; text-shadow: 0 0 8px var(--glow); }
.tilt-btn:hover .tilt-ico { color: #fff; }
.maplibregl-ctrl-group button:focus-visible { outline: 2px solid var(--glow); outline-offset: -2px; }
.maplibregl-ctrl-attrib { background: rgba(0, 0, 0, 0.62) !important; color: var(--muted); font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--accent); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

/* Detail panel: side panel on desktop, bottom sheet on phones */
.panel {
  position: absolute; z-index: 6; top: 14px; right: 14px; bottom: 34px; width: min(420px, calc(100% - 28px));
  border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(4, 9, 20, 0.94);
}
.panel[hidden] { display: none; }
.panel-grip { display: none; }
.panel-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 10px;
  background: transparent; color: var(--muted); border: 1px solid transparent; font-size: 24px; line-height: 1; cursor: pointer;
}
.panel-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.panel-head { padding: 18px 22px 10px; outline: none; flex: none; }
.panel-head:focus, .panel-head:focus-visible { outline: none; box-shadow: none; }
.panel-head h2 { margin: 8px 40px 4px 0; font-size: 21px; line-height: 1.25; letter-spacing: -0.005em; }
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 600 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; padding-right: 44px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; font: 700 11px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.t-war { color: var(--war); } .tag.t-political { color: var(--political); } .tag.t-geopolitical { color: var(--geopolitical); }
.tag.t-humanitarian { color: var(--humanitarian); } .tag.t-economic { color: var(--economic); } .tag.t-history { color: var(--history); }
.tag.t-country { color: var(--countries); }
.headlines-label { margin: 0 0 10px; padding: 7px 10px; border-left: 2px solid var(--countries); background: rgba(156, 196, 255, 0.07);
  color: var(--muted); font: 600 12.5px/1.45 var(--mono); letter-spacing: 0.02em; }
.headlines li > a { font-weight: 600; }
.asof-chip { font: 600 11px/1.3 var(--mono); letter-spacing: 0.06em; color: var(--muted); }
.badge-draft { background: var(--draft); color: #000; padding: 2px 8px; border-radius: 4px; font: 800 11px/1.4 var(--mono); letter-spacing: 0.1em; }
.place { margin: 0; color: var(--muted); font-size: 14px; }

/* Tabs */
.tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid rgba(140, 180, 255, 0.14); flex: none; overflow-x: auto; scrollbar-width: none; }
.tabs[hidden] { display: none; }
.tabs [role="tab"] {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 11px 10px 12px; min-height: 44px; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font: 600 14px/1 var(--font);
}
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][hidden] { display: none; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); }
.tabs [role="tab"][aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--glow); box-shadow: 0 0 10px var(--glow);
}
.tabs [role="tab"]:focus-visible { outline-offset: -4px; border-radius: 8px; }
.tab-count { font: 700 11px/1 var(--mono); color: var(--muted); padding: 3px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.tab-count:empty { display: none; }

.panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 22px 22px; }
[role="tabpanel"]:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; border-radius: 6px; box-shadow: none; }
.panel-body h3 { margin: 18px 0 5px; font: 700 11.5px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.panel-body [role="tabpanel"] > h3:first-child, .pin-body > h3:first-child { margin-top: 2px; }
.panel-body p { margin: 0 0 8px; }
.lede { font-size: 15.5px; line-height: 1.55; color: var(--text); }
.tab-intro { color: var(--muted); font-size: 13.5px; }
.tab-empty { color: var(--muted); font-style: italic; margin: 6px 0 !important; }
.sources { margin: 4px 0 0; padding-left: 18px; }
.sources li { margin: 4px 0; }
.sources .src-date { color: var(--muted); font-size: 13px; }
.asof { margin-top: 18px !important; padding-top: 12px; border-top: 1px solid rgba(140, 180, 255, 0.14); color: var(--muted); font: 12.5px/1.4 var(--mono); }
.watch { margin: 10px 0 2px !important; }
.btn-watch { background: #b31313; border-color: #ff5d5d; color: #fff; min-height: 36px; padding: 8px 12px; font-size: 13.5px; }
.btn-watch:hover { background: #d11b1b; color: #fff; }
.nolink { color: var(--muted); font-style: italic; }

/* Source badges (News tab): AllSides' lean label on a plain 5-step scale, always in words too, + "See ratings".
   One neutral colour for the whole scale, so no lean looks "good" or "bad". */
.balance { font-size: 13.5px; color: var(--text); margin: 2px 0 6px !important; }
.balance-k { font-weight: 700; color: var(--muted); }
.balance-how { font-size: 12.5px; white-space: nowrap; }
.balance-warn {
  display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text);
  background: rgba(255, 210, 77, 0.07); border: 1px solid rgba(255, 210, 77, 0.32); border-radius: 8px; padding: 7px 10px;
}
.balance-warn::before {
  content: "!"; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  background: var(--draft); color: #000; font: 800 11px/1 var(--mono);
}
.sources.has-badges li { margin: 8px 0 10px; }
.rbadge { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font: 12px/1.35 var(--mono); color: var(--muted); }
.lean-scale { display: inline-flex; border: 1px solid rgba(140, 180, 255, 0.28); border-radius: 999px; overflow: hidden; }
.ls-step { padding: 1px 5px; font: 700 10px/1.5 var(--mono); letter-spacing: 0.04em; color: #7f93b5; }
.ls-step + .ls-step { border-left: 1px solid rgba(140, 180, 255, 0.16); }
.ls-step.is-on { background: var(--accent); color: #000; }
.rb-text { color: var(--text); }
.rb-unrated .rb-text { color: var(--muted); font-style: italic; }
.rb-more summary { cursor: pointer; color: var(--accent); list-style: none; padding: 2px 0; }
.rb-more summary::-webkit-details-marker { display: none; }
.rb-more summary::after { content: " \25BE"; }
.rb-more[open] summary::after { content: " \25B4"; }
.rb-more[open] { flex-basis: 100%; }
.rb-body { margin-top: 4px; padding: 8px 10px; border: 1px solid rgba(140, 180, 255, 0.16); border-radius: 8px; background: rgba(255, 255, 255, 0.03); font: 12.5px/1.45 var(--font); color: var(--text); }
.rb-body p { margin: 0 0 4px !important; }
.rb-body ul { margin: 0 0 6px; padding-left: 18px; }
.rb-body .rb-note { color: var(--muted); font-size: 12px; }
.rb-credit { margin: 6px 0 0 !important; font-size: 12px; color: var(--muted); }
.live-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.live-actions .btn[hidden] { display: none; }

/* History tab */
.hist-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.hist-item {
  border: 1px solid rgba(140, 180, 255, 0.14); border-radius: 12px; padding: 4px 14px 12px;
  background: rgba(255, 255, 255, 0.02); transition: border-color 0.15s ease, background 0.15s ease;
}
.hist-item.is-highlight { border-color: var(--glow); background: rgba(63, 140, 255, 0.1); box-shadow: 0 0 0 1px rgba(63, 140, 255, 0.3); }
.hist-pick {
  display: grid; gap: 2px; width: calc(100% + 20px); margin: 0 -10px 4px; padding: 8px 10px; text-align: left;
  background: transparent; border: 0; border-radius: 9px; color: var(--text); cursor: pointer; font: inherit;
}
.hist-pick:hover .hist-title { color: var(--accent); }
.hist-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.hist-title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: var(--history); box-shadow: 0 0 6px rgba(63, 140, 255, 0.9); flex: none; }
.hist-meta { font: 12px/1.4 var(--mono); color: var(--muted); padding-left: 16px; }
.hist-place { color: var(--muted); font-size: 13px; }
.hist-summary { font-size: 14px; }

/* Previous / Next */
.panel-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(140, 180, 255, 0.14);
  background: rgba(2, 5, 12, 0.5);
}
.panel-foot[hidden] { display: none; }
.step {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--glass-line); color: var(--text); font: 600 14px/1 var(--font); cursor: pointer;
}
.step span[aria-hidden] { font-size: 18px; line-height: 1; color: var(--accent); }
.step:hover { border-color: var(--glow); background: rgba(63, 140, 255, 0.12); }
.step-pos { font: 600 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.06em; }

/* Footer */
.site-footer { padding: 8px 18px; border-top: 1px solid var(--line); background: #000; color: var(--muted); font-size: 12.5px; position: relative; z-index: 5; }
.site-footer p { margin: 0; }
.footer-links { margin-top: 2px !important; }

/* Signup dialog */
.signup {
  background: var(--surface); color: var(--text); border: 1px solid var(--glow); border-radius: 14px;
  padding: 22px 24px; width: min(440px, calc(100% - 24px));
  box-shadow: 0 0 50px -8px var(--glow-soft);
}
.signup::backdrop { background: rgba(0, 0, 0, 0.75); }
.signup h2 { margin: 0 0 6px; font: 700 18px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.signup label { display: block; margin: 14px 0 6px; font-weight: 600; }
.signup input[type=email] { width: 100%; font: 16px var(--font); color: var(--text); background: #000; border: 1px solid var(--line-bright); border-radius: 8px; padding: 11px 12px; }
.signup .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.form-status { min-height: 1.4em; margin: 10px 0 0; font-weight: 600; }
.form-status.ok { color: var(--economic); }
.form-status.err { color: #ff8a8a; }
.fine { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* Plain pages (About, Thanks, 404) */
.page main.prose { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; overflow: visible; }
.prose h1 { font: 700 26px/1.25 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 0 14px var(--glow-soft); }
.prose h2 { font-size: 19px; margin-top: 32px; color: var(--accent); }
.prose li { margin: 6px 0; }
.prose .note { background: var(--surface-2); border: 1px solid var(--line-bright); border-radius: var(--radius); padding: 12px 16px; }
.page { background-image:
    linear-gradient(rgba(63, 140, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 140, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px; }

/* Phones */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .site-header { flex-wrap: wrap; padding: 8px 12px; gap: 4px 10px; }
  .brand { gap: 1px; flex-direction: column; align-items: flex-start; }
  .brand-name { font-size: 15px; }
  .tagline { font-size: 12.5px; }
  .site-nav { width: 100%; justify-content: space-between; gap: 2px; }
  .site-nav a { padding: 8px 6px; }
  .site-nav .btn { padding: 8px 12px; font-size: 13.5px; min-height: 38px; }
  .map-ui { left: 10px; top: 10px; }
  .pill { height: 38px; font-size: 13.5px; }
  .menu { left: 8px; right: 8px; width: auto; top: 56px; max-height: calc(100% - 66px); z-index: 7; } /* above the bottom sheet */
  /* Phones pinch to zoom; keep just the compass and the tilt button. */
  .maplibregl-ctrl-top-right, body.panel-open .maplibregl-ctrl-top-right { top: 6px; right: 6px; }
  .maplibregl-ctrl-top-right .maplibregl-ctrl-zoom-in, .maplibregl-ctrl-top-right .maplibregl-ctrl-zoom-out { display: none; }
  .maplibregl-ctrl-group .maplibregl-ctrl-compass { border-top: 0; }
  body.menu-spots .maplibregl-ctrl-top-right, body.menu-layers .maplibregl-ctrl-top-right, body.is-live .maplibregl-ctrl-top-right { display: none; }
  .live-bar {
    top: 56px; bottom: auto; left: 10px; right: 10px; max-width: none; padding: 5px 6px 5px 6px;
    display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center;
  }
  .radar-bar { font-size: 11.5px; gap: 6px; min-width: 0; }
  .radar-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sat-date { font-size: 11px; grid-column: 1 / -1; grid-row: 2; padding: 0 2px 2px; }
  .radar-bar[hidden] + .sat-date { grid-column: 1; grid-row: 1; padding: 0 4px; }
  .live-off { grid-column: 2; grid-row: 1; padding: 7px 10px; }
  .live-off .lo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .live-off .sh { display: inline; }
  .banner { font-size: 11.5px; padding: 5px 12px; }
  .empty-hint { bottom: 36px; white-space: normal; text-align: center; width: max-content; }
  .pick-hint { top: 50%; width: max-content; padding: 14px 16px 16px; }
  .layers-menu { width: auto; }
  .chip { min-height: 40px; font-size: 14px; }
  .marker-label { max-width: 220px; }
  .panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 58dvh;
    border-radius: 18px 18px 0 0; border-bottom: 0;
  }
  body.is-live .panel { max-height: 46dvh; } /* leave room to see today's clouds and rain */
  .panel-grip { display: block; flex: none; width: 40px; height: 5px; border-radius: 3px; background: rgba(140, 180, 255, 0.35); margin: 8px auto 0; }
  .panel-close { top: 8px; right: 8px; }
  .panel-head { padding: 4px 18px 6px; }
  .panel-head h2 { font-size: 18.5px; margin-top: 6px; }
  .place { font-size: 13.5px; }
  .tabs { padding: 0 8px; }
  .tabs [role="tab"] { padding: 10px 9px 11px; font-size: 13.5px; }
  .panel-body { padding: 14px 18px 18px; }
  .panel-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .step { min-height: 40px; padding: 0 12px; }
  .site-footer { font-size: 11px; padding: 5px 12px calc(5px + env(safe-area-inset-bottom)); }
  .footer-links { display: none; }
  body.panel-open .site-footer { visibility: hidden; }
}

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