/* Earth Radar themes: Slate (default) and Light Pro. Loaded after each page's own styles. */
:root,html[data-theme="slate"]{
  --bg:#0f172a; --bg2:#152036; --panel:#172236; --panel2:#1e293b;
  --line:rgba(148,163,184,.15); --line2:rgba(148,163,184,.26);
  --ink:#f1f5f9; --body:#dbe3ee; --muted:#9fb0c6; --faint:#7d8ca3;
  --amber:#60a5fa; --amber2:#93c5fd; --amber-deep:#3b82f6; --primary:#3b82f6; --primary-foreground:#0f172a;
  --shadow:0 1px 2px rgba(2,6,23,.25), 0 8px 24px rgba(2,6,23,.28);
  color-scheme:dark;
}
html[data-theme="slate"] body{ background:#0f172a; }
html[data-theme="slate"] body::before{ background:radial-gradient(900px 420px at 12% -8%, rgba(59,130,246,.10), transparent 55%), radial-gradient(700px 360px at 100% 0%, rgba(56,189,248,.05), transparent 50%); }
html[data-theme="slate"] .card{ background:var(--panel); border-color:var(--line); }
html[data-theme="slate"] .topbar{ background:rgba(15,23,42,.82); border-bottom-color:var(--line); }

html[data-theme="light"]{
  --bg:#f7f8fa; --bg2:#ffffff; --panel:#ffffff; --panel2:#f1f5f9;
  --line:rgba(15,23,42,.09); --line2:rgba(15,23,42,.16);
  --ink:#0f172a; --body:#1e293b; --muted:#4b5b72; --faint:#66768c;
  --amber:#2563eb; --amber2:#1d4ed8; --amber-deep:#1e40af; --primary:#2563eb; --primary-foreground:#ffffff;
  --red:#dc2626; --green:#059669; --teal:#0284c7;
  --shadow:0 1px 2px rgba(15,23,42,.05), 0 6px 18px rgba(15,23,42,.06);
  color-scheme:light;
}
html[data-theme="light"] body{ background:#f7f8fa; color:var(--body); }
html[data-theme="light"] body::before{ background:radial-gradient(900px 420px at 12% -8%, rgba(37,99,235,.06), transparent 55%); }
html[data-theme="light"] .topbar{ background:rgba(255,255,255,.88); border-bottom:1px solid var(--line); box-shadow:0 1px 0 rgba(15,23,42,.03); }
html[data-theme="light"] .card, html[data-theme="light"] .pz, html[data-theme="light"] .clock, html[data-theme="light"] .menu-drop{ background:#fff; border-color:var(--line); box-shadow:var(--shadow); }
html[data-theme="light"] .menu-btn, html[data-theme="light"] .lang-sw, html[data-theme="light"] .theme-btn, html[data-theme="light"] .btn, html[data-theme="light"] .more-btn, html[data-theme="light"] .sel, html[data-theme="light"] select{ background:#fff; color:var(--body); border-color:var(--line2); }
html[data-theme="light"] .lang-sw a[aria-current="page"]{ background:rgba(15,23,42,.07); }
html[data-theme="light"] .tag{ color:var(--muted); border-color:var(--line2); background:#f8fafc; }
html[data-theme="light"] .fdot[data-tip]:hover::after, html[data-theme="light"] .fdot.show::after{ background:#fff; color:var(--body); border-color:var(--line2); box-shadow:var(--shadow); }
html[data-theme="light"] .v2-pop{ background:rgba(255,255,255,.96); color:var(--body); box-shadow:0 10px 30px rgba(15,23,42,.18); }
html[data-theme="light"] .v2-raw{ background:#f8fafc; color:var(--body); }
html[data-theme="light"] .v2-seg button.on{ background:rgba(37,99,235,.10); color:#1e3a8a; }
html[data-theme="light"] .v2-ev:hover, html[data-theme="light"] .v2-ev.on{ background:rgba(15,23,42,.05); }
html[data-theme="light"] .v2-wave{ color:#0369a1; }
html[data-theme="light"] .ftime.y{ color:#a16207; }
html[data-theme="light"] .sat-ph{ background:#f8fafc; }
html[data-theme="light"] ::selection{ background:rgba(37,99,235,.18); }
/* the globe and maps stay "night sky": keep their stage dark in both themes */
html[data-theme="light"] .globe-stage, html[data-theme="light"] #globeStage{ background:radial-gradient(ellipse at 50% 40%, #13213b 0%, #0b1426 70%); border-radius:0 0 18px 18px; }
html[data-theme="light"] .hero .hero-copy, html[data-theme="light"] .hero-text{ color:#e2e8f0; }
.mi{ width:8px; height:8px; border-radius:50%; display:inline-block; flex:none; }

.menu-drop{
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background-color: var(--panel);
}

/* toggle */
.hdr-r{ justify-self:end; display:inline-flex; align-items:center; gap:6px; }
.hdr .hdr-r .lang-sw{ margin:0; }
.theme-btn{ display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; min-height:30px; padding:0; border-radius:999px; border:1px solid var(--line); background:transparent; color:var(--muted); cursor:pointer; }
.theme-btn:hover{ color:var(--ink); }
.theme-btn .i-sun{ display:none; } html[data-theme="light"] .theme-btn .i-sun{ display:block; } html[data-theme="light"] .theme-btn .i-moon{ display:none; }
/* Light Pro: the globe stage keeps its dark "space" palette so overlay text stays readable */
html[data-theme="light"] .globe-stage, html[data-theme="light"] #globeStage{
  --ink:#f1f5f9; --body:#dbe3ee; --muted:#a9b8cc; --faint:#8b9ab0;
  --line:rgba(148,163,184,.2); --line2:rgba(148,163,184,.32);
  --panel:#172236; --panel2:#1e293b; --amber:#60a5fa; --amber2:#93c5fd; --primary:#3b82f6;
  color:var(--body);
}

/* MapLibre CSS is injected after page styles and sets .maplibregl-popup-content{background:#fff}
   without a color, so Slate's light text sat on a white card and became unreadable. !important
   wins over the late-loaded vendor stylesheet. */
.maplibregl-popup{ z-index:5; max-width:min(280px, calc(100vw - 24px)) !important; }
.maplibregl-popup-content{
  background:#0b1224 !important;
  background-color:#0b1224 !important;
  color:#f8fafc !important;
  border:1px solid rgba(148,163,184,.28) !important;
  border-radius:10px !important;
  font-family:Inter, ui-sans-serif, system-ui, sans-serif;
  font-size:13px;
  line-height:1.45;
  padding:10px 28px 10px 12px !important;
  box-shadow:0 10px 28px rgba(0,0,0,.45) !important;
}
.maplibregl-popup-content b{ color:#93c5fd !important; font-weight:600; }
.maplibregl-popup-close-button{
  color:#f8fafc !important;
  font-size:18px !important;
  line-height:18px !important;
  width:28px;
  height:28px;
  padding:0 !important;
  right:0;
  top:0;
}
.maplibregl-popup-close-button:hover{ background:rgba(255,255,255,.08) !important; color:#fff !important; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{ border-top-color:#0b1224 !important; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{ border-bottom-color:#0b1224 !important; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip{ border-right-color:#0b1224 !important; }
.maplibregl-popup-anchor-right .maplibregl-popup-tip{ border-left-color:#0b1224 !important; }

html[data-theme="light"] .maplibregl-popup-content{
  background:#fff !important;
  background-color:#fff !important;
  color:#0f172a !important;
  border-color:rgba(15,23,42,.14) !important;
  box-shadow:0 10px 28px rgba(15,23,42,.16) !important;
}
html[data-theme="light"] .maplibregl-popup-content b{ color:#1d4ed8 !important; }
html[data-theme="light"] .maplibregl-popup-close-button{ color:#0f172a !important; }
html[data-theme="light"] .maplibregl-popup-close-button:hover{ background:rgba(15,23,42,.06) !important; color:#0f172a !important; }
html[data-theme="light"] .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
html[data-theme="light"] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
html[data-theme="light"] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{ border-top-color:#fff !important; }
html[data-theme="light"] .maplibregl-popup-anchor-top .maplibregl-popup-tip,
html[data-theme="light"] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
html[data-theme="light"] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{ border-bottom-color:#fff !important; }
html[data-theme="light"] .maplibregl-popup-anchor-left .maplibregl-popup-tip{ border-right-color:#fff !important; }
html[data-theme="light"] .maplibregl-popup-anchor-right .maplibregl-popup-tip{ border-left-color:#fff !important; }

/* Sticky chrome: full-width bar (menu + optional clocks + alert). */
.site-head{
  position:sticky; top:0; z-index:60; width:100%;
  background:rgba(15,23,42,.88);
  backdrop-filter:blur(16px) saturate(1.2); -webkit-backdrop-filter:blur(16px) saturate(1.2);
  border-bottom:1px solid var(--line);
}
.site-head .topbar{
  position:static; margin:0; padding:8px 16px;
  background:transparent !important; border-bottom:0; box-shadow:none;
  backdrop-filter:none; -webkit-backdrop-filter:none;
}
.clock-strip{
  display:flex; align-items:baseline; justify-content:center; gap:0;
  max-width:1200px; margin:0 auto; padding:0 16px 8px;
  overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.clock-strip::-webkit-scrollbar{ display:none; }
.clock-strip .ck{
  display:flex; align-items:baseline; gap:7px;
  padding:0 16px; border-right:1px solid var(--line);
  flex:none; white-space:nowrap;
}
.clock-strip .ck:first-child{ padding-left:0; }
.clock-strip .ck:last-child{ border-right:0; padding-right:0; }
.clock-strip .ck-code{ font-size:10px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.clock-strip .ck-time{ font-size:13px; font-weight:500; color:var(--ink); font-variant-numeric:tabular-nums; font-feature-settings:"tnum","lnum"; letter-spacing:-0.02em; }
.clock-strip .ck-day{ font-size:10px; color:var(--faint); font-variant-numeric:tabular-nums; }
html[data-theme="light"] .site-head{ background:rgba(255,255,255,.94); box-shadow:0 1px 0 rgba(15,23,42,.05); }
html[data-theme="light"] .pulse .pz{
  background:linear-gradient(180deg, #fff, #f8fafc);
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
html[data-theme="light"] .pz .ps.up{ color:#047857; }
html[data-theme="light"] .pz .ps.down{ color:#b91c1c; }
@media (max-width:640px){
  .clock-strip{ justify-content:space-between; padding:0 14px 8px; overflow-x:auto; }
  .clock-strip .ck{ padding:0 10px; gap:6px; }
  .clock-strip .ck-day{ display:none; }
  .clock-strip .ck-time{ font-size:12.5px; }
}
/* reserve the clock strip's height before alerts.js fills it (no layout shift) */
.clock-strip{ min-height:27.5px; box-sizing:border-box; }
@media (max-width:640px){ .clock-strip{ min-height:26.75px; } }
/* VN hero: reserve room for the live chips (2 rows on phones) and the date line, filled by JS */
html[lang^="vi"] .hero-foot{ min-height:18px; }
@media (max-width:520px){ html[lang^="vi"] .hero .live-chips{ min-height:70px; align-content:flex-start; } }
/* reserve hero overlay height for the layer buttons + legend that v2.js adds (no layout shift on phones) */
@media (max-width:767px){ html[lang^="en"] .hero .globe-overlay{ min-height:275px; } html[lang^="vi"] .hero .globe-overlay{ min-height:182px; } }
@media (max-width:519px){ html[lang^="en"] .hero .globe-overlay{ min-height:334px; } }
@media (max-width:429px){ html[lang^="vi"] .hero .globe-overlay{ min-height:212px; } }
@media (max-width:389px){ html[lang^="vi"] .hero .globe-overlay{ min-height:230px; } }
@media (max-width:374px){ html[lang^="en"] .hero .globe-overlay{ min-height:376px; } }
