/* ═══════════════════════════════════════════════
   VirMap v3.0 — Mobile-First App CSS
   virmap.com
═══════════════════════════════════════════════ */

:root {
  --bg0: #04070e;
  --bg1: #070c18;
  --bg2: #0b1222;
  --bg3: #111a2e;
  --bg4: #182236;
  --glass: rgba(7,12,24,0.92);
  --border: rgba(255,255,255,0.06);
  --border-md: rgba(255,255,255,0.10);
  --border-lg: rgba(255,255,255,0.16);
  --t1: #f0f4fc;
  --t2: #8fa3c0;
  --t3: #3d5470;
  --t4: #243348;
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.10);
  --red-dim: #7f1d1d;
  --amber: #f59e0b;
  --amber-bg: rgba(245,158,11,0.10);
  --blue: #60a5fa;
  --blue-bg: rgba(96,165,250,0.10);
  --green: #34d399;
  --green-bg: rgba(52,211,153,0.10);
  --purple: #a78bfa;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Sora', system-ui, sans-serif;
  --r: 8px;
  --rl: 14px;
  --rxl: 20px;
  --tab-h: 64px;
  --hdr-h: 52px;
  --ticker-h: 32px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg0);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  height: 100dvh;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

a { color: var(--blue); text-decoration: none; }
button { cursor: pointer; font-family: var(--sans); border: none; background: none; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

/* ═══ SPLASH ══════════════════════════════════ */
#splash {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg0);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.splash-logo { animation: splash-breathe 2s ease-in-out infinite 0.8s; }
@keyframes splash-breathe { 0%,100%{filter:drop-shadow(0 0 0 rgba(239,68,68,0))} 50%{filter:drop-shadow(0 0 16px rgba(239,68,68,0.5))} }
.splash-brand { font-family: var(--mono); font-size: 28px; font-weight: 700; color: var(--t1); letter-spacing: -1px; }
.splash-tag { font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: 2px; }
.splash-bar { width: 160px; height: 2px; background: var(--bg3); border-radius: 1px; overflow: hidden; }
.splash-fill { height: 100%; width: 0; background: var(--red); border-radius: 1px; animation: splash-load 1.6s cubic-bezier(0.4,0,0.2,1) forwards 0.2s; }
@keyframes splash-load { to { width: 100%; } }

/* ═══ HEADER ═══════════════════════════════════ */
#appHeader {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--hdr-h);
  padding-top: var(--safe-top);
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-md);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 14px; padding-right: 14px; gap: 8px;
}
.hdr-left, .hdr-right { display: flex; align-items: center; gap: 8px; flex: 1; }
.hdr-right { justify-content: flex-end; }
.hdr-center { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hdr-logo { display: flex; align-items: center; gap: 7px; }
.hdr-brand { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--t1); letter-spacing: -0.5px; }
.hdr-updated { font-size: 10px; color: var(--t3); white-space: nowrap; display: none; }

.live-pill {
  display: flex; align-items: center; gap: 5px;
  background: var(--red-bg); border: 1px solid var(--red-dim);
  border-radius: 20px; padding: 4px 10px;
}
.live-dot { width: 6px; height: 6px; background: var(--red); border-radius: 50%; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.15} }
.live-pill span:last-child { font-family: var(--mono); font-size: 9px; font-weight: 700; color: var(--red); letter-spacing: 1.5px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r);
  border: 1px solid var(--border-md); background: var(--bg2);
  color: var(--t2); display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { transform: scale(0.9); background: var(--bg3); }
.icon-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ ALERT TICKER ══════════════════════════════ */
.alert-ticker {
  position: fixed;
  top: var(--hdr-h);
  left: 0; right: 0;
  height: var(--ticker-h);
  z-index: 90;
  background: #180808;
  border-bottom: 1px solid rgba(127,29,29,0.5);
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 12px;
  overflow: hidden;
}
.ticker-icon { color: var(--red); font-size: 12px; flex-shrink: 0; }
.ticker-wrap { flex: 1; overflow: hidden; }
.ticker-text {
  display: inline-block;
  font-size: 11px; color: #fca5a5; white-space: nowrap;
  animation: ticker 40s linear infinite;
}
@keyframes ticker { 0%{ transform: translateX(100vw); } 100%{ transform: translateX(-100%); } }
.ticker-close { color: var(--t3); font-size: 13px; padding: 4px 6px; flex-shrink: 0; border-radius: 4px; }
.ticker-close:active { color: var(--t1); }

/* ═══ APP BODY ══════════════════════════════════ */
#appBody {
  position: fixed;
  top: calc(var(--hdr-h) + var(--ticker-h));
  left: 0; right: 0;
  bottom: calc(var(--tab-h) + var(--safe-bottom));
  overflow: hidden;
}

.tab-page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  display: none;
  padding-bottom: 16px;
  background: var(--bg0);
  animation: tabIn 0.22s ease;
}
.tab-page.active { display: block; }
@keyframes tabIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ═══ STAT CARDS SCROLL ═════════════════════════ */
.stat-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.stat-scroll-wrap::-webkit-scrollbar { display: none; }
.stat-scroll {
  display: flex; gap: 8px; padding: 12px 14px;
  width: max-content;
}
.stat-card {
  border-radius: var(--rl); padding: 12px 16px; min-width: 80px;
  border: 1px solid var(--border); background: var(--bg2);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex-shrink: 0;
}
.stat-card.red    { border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.06); }
.stat-card.amber  { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.06); }
.stat-card.blue   { border-color: rgba(96,165,250,0.25); background: rgba(96,165,250,0.06); }
.stat-card.green  { border-color: rgba(52,211,153,0.25); background: rgba(52,211,153,0.06); }
.sc-num { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.stat-card.red   .sc-num { color: var(--red); }
.stat-card.amber .sc-num { color: var(--amber); }
.stat-card.blue  .sc-num { color: var(--blue); }
.stat-card.green .sc-num { color: var(--green); }
.sc-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--t3); }

/* ═══ MAP TOGGLE ════════════════════════════════ */
.map-toggle-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 8px; gap: 8px; flex-wrap: wrap;
}
.map-toggle-group { display: flex; gap: 4px; }
.mtb {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 6px 12px; border-radius: var(--r);
  border: 1px solid var(--border-md); background: var(--bg2); color: var(--t3);
  transition: all 0.15s;
}
.mtb:active { transform: scale(0.95); }
.mtb.active { background: var(--bg4); color: var(--t1); border-color: var(--border-lg); }
.map-legend-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ml-item { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--t3); }
.ml-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ml-dot.red   { background: var(--red); }
.ml-dot.amber { background: var(--amber); }
.ml-dot.blue  { background: var(--blue); }
.ml-dot.green { background: var(--green); }

/* ═══ MAP ════════════════════════════════════════ */
.map-frame {
  height: 280px; position: relative; margin: 0 0 4px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
#worldMapContainer, #usMapContainer { width: 100%; height: 100%; }
.map-tap-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(4,7,14,0.8); border: 1px solid var(--border-md);
  border-radius: 20px; padding: 4px 12px; font-size: 10px; color: var(--t3);
  pointer-events: none; z-index: 400; white-space: nowrap;
  animation: fadeOut 3s ease 3s forwards;
}
@keyframes fadeOut { to { opacity: 0; } }

/* Leaflet dark */
.leaflet-container { background: var(--bg0) !important; font-family: var(--sans) !important; }
.leaflet-tile { filter: brightness(0.28) saturate(0.3) hue-rotate(190deg); }
.leaflet-control-zoom a { background: var(--bg2) !important; color: var(--t2) !important; border-color: var(--border-md) !important; }
.leaflet-control-zoom a:hover { background: var(--bg3) !important; }
.leaflet-control-attribution { background: rgba(4,7,14,0.7) !important; color: var(--t3) !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: var(--t3) !important; }
.leaflet-popup-content-wrapper { background: var(--bg2) !important; border: 1px solid var(--border-md) !important; border-radius: var(--rl) !important; box-shadow: 0 8px 32px rgba(0,0,0,0.7) !important; color: var(--t1) !important; }
.leaflet-popup-tip { background: var(--bg2) !important; }
.leaflet-popup-close-button { color: var(--t3) !important; }

/* Custom markers */
.vm-marker {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700;
  border: 2px solid rgba(0,0,0,0.5); box-shadow: 0 2px 12px rgba(0,0,0,0.8);
  cursor: pointer;
}

/* ═══ SECTION HEADS ══════════════════════════════ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 6px;
}
.sh-title { font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--t3); }
.sh-badge { font-size: 9px; color: var(--t3); font-family: var(--mono); background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; }

/* ═══ COUNTRY CARDS SCROLL ══════════════════════ */
.country-cards-scroll {
  display: flex; gap: 10px;
  padding: 4px 14px 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.country-cards-scroll::-webkit-scrollbar { display: none; }

.cc-card {
  flex-shrink: 0; width: 150px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 12px;
  cursor: pointer; transition: transform 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column; gap: 6px;
}
.cc-card:active { transform: scale(0.96); border-color: var(--border-lg); }
.cc-flag { font-size: 24px; line-height: 1; }
.cc-name { font-size: 12px; font-weight: 600; color: var(--t1); }
.cc-detail { font-size: 10px; color: var(--t3); line-height: 1.4; }

.status-badge {
  display: inline-block; font-size: 8px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.3px;
}
.status-badge.deceased  { background: #160606; color: #f87171; border: 1px solid #7f1d1d; }
.status-badge.confirmed { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.status-badge.suspected { background: rgba(167,139,250,0.08); color: var(--purple); border: 1px solid rgba(167,139,250,0.25); }
.status-badge.monitoring{ background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(96,165,250,0.2); }
.status-badge.endemic   { background: var(--green-bg); color: var(--green); border: 1px solid rgba(52,211,153,0.2); }

/* ═══ US STATE PILLS ════════════════════════════ */
.us-pills-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 16px;
}
.us-pill {
  font-size: 11px; padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--t2); background: var(--bg2);
}
.us-pill small { display: block; font-size: 9px; color: var(--t3); }
.us-pill.confirmed { border-color: rgba(245,158,11,0.35); color: var(--amber); background: var(--amber-bg); }
.us-pill.monitoring { border-color: rgba(96,165,250,0.2); color: var(--blue); background: var(--blue-bg); }

/* ═══ PAGE HEADER ═══════════════════════════════ */
.page-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 8px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ph-title { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--t1); letter-spacing: -0.3px; }
.ph-badge { font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.ph-badge.red  { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-dim); animation: badge-pulse 1.8s ease-in-out infinite; }
.ph-badge.gray { background: var(--bg3); color: var(--t3); border: 1px solid var(--border); }
@keyframes badge-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ═══ FEED ══════════════════════════════════════ */
.feed-list { padding: 8px 0; }
.feed-item {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  animation: feedIn 0.4s ease both;
}
@keyframes feedIn { from{opacity:0;transform:translateX(12px)} to{opacity:1;transform:none} }
.feed-item:active { background: var(--bg2); }
.feed-item.is-new { border-left: 3px solid var(--red); padding-left: 11px; }
.fi-date { font-family: var(--mono); font-size: 9px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.fi-text { font-size: 13px; color: var(--t2); line-height: 1.55; margin-bottom: 6px; }
.fi-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.fi-tag {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; text-transform: uppercase;
}
.fi-tag.WHO   { background:#1e1b4b; color:#a5b4fc; }
.fi-tag.CDC   { background:#0b1c33; color:#7dd3fc; }
.fi-tag.ECDC  { background:#0f2043; color:#60a5fa; }
.fi-tag.UKHSA { background:#162033; color:#93c5fd; }
.fi-tag.FR    { background:#1a1628; color:#c4b5fd; }
.fi-tag.US    { background:#0c1830; color:#93c5fd; }
.fi-tag.DEATH { background:#1a0606; color:#f87171; }
.fi-tag.ORIGIN{ background:#0a1a12; color:#6ee7b7; }

/* ═══ TIMELINE ══════════════════════════════════ */
.timeline-list { padding: 12px 14px; }
.tl-item {
  display: flex; gap: 12px; padding-bottom: 20px; position: relative;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.tl-item.visible { opacity: 1; transform: none; }
.tl-item:not(:last-child)::before {
  content:''; position: absolute; left: 19px; top: 28px;
  width: 1px; bottom: 0; background: var(--border-md);
}
.tl-left { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; width: 40px; }
.tl-dot-wrap { width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 2px solid var(--bg0); }
.tl-dot-wrap.depart  { background: var(--blue); }
.tl-dot-wrap.sick    { background: var(--amber); }
.tl-dot-wrap.dead    { background: var(--red); }
.tl-dot-wrap.confirm { background: var(--amber); }
.tl-dot-wrap.who     { background: var(--purple); }
.tl-dot-wrap.evac    { background: var(--blue); }
.tl-dot-wrap.now     { background: var(--green); width:17px; height:17px; animation: pulse-now 2s ease-in-out infinite; }
@keyframes pulse-now { 0%,100%{box-shadow:0 0 0 0 rgba(52,211,153,0.5)} 50%{box-shadow:0 0 0 6px rgba(52,211,153,0)} }
.tl-date { font-family: var(--mono); font-size: 9px; color: var(--t3); text-align: center; line-height: 1.3; }
.tl-body { flex: 1; padding-top: 0; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--t1); margin-bottom: 3px; }
.tl-text { font-size: 12px; color: var(--t2); line-height: 1.6; }
.tl-item.is-death .tl-body { padding-left: 10px; border-left: 2px solid rgba(239,68,68,0.4); }
.tl-item.is-now   .tl-body { padding-left: 10px; border-left: 2px solid rgba(52,211,153,0.4); }

/* ═══ DATA CARDS ════════════════════════════════ */
.data-cards-list { padding: 8px 14px; display: flex; flex-direction: column; gap: 8px; }
.dc-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  animation: fadeUp 0.4s ease both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.dc-top { display: flex; align-items: center; justify-content: space-between; }
.dc-country { display: flex; align-items: center; gap: 8px; }
.dc-flag { font-size: 20px; }
.dc-name { font-size: 13px; font-weight: 600; color: var(--t1); }
.dc-nums { display: flex; gap: 16px; }
.dc-num { text-align: center; }
.dc-val { font-family: var(--mono); font-size: 16px; font-weight: 700; }
.dc-val.red { color: var(--red); }
.dc-val.amber { color: var(--amber); }
.dc-lbl { font-size: 9px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px; }
.dc-detail { font-size: 11px; color: var(--t3); line-height: 1.6; }
.dc-monitoring { font-size: 11px; color: var(--t2); }
.dc-source { font-family: var(--mono); font-size: 9px; color: var(--t4); }
.dc-card.type-death   { border-left: 3px solid var(--red); }
.dc-card.type-confirmed { border-left: 3px solid var(--amber); }
.dc-card.type-suspected { border-left: 3px solid var(--purple); }
.dc-card.type-monitoring { border-left: 3px solid var(--blue); }
.dc-card.type-endemic { border-left: 3px solid var(--green); }

/* ═══ OTHER VIRUSES LIST ════════════════════════ */
.other-list { padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ov-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 14px;
  display: flex; align-items: center; gap: 14px;
}
.ov-accent { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.ov-info { flex: 1; }
.ov-name { font-size: 13px; font-weight: 600; color: var(--t1); margin-bottom: 2px; }
.ov-region { font-size: 11px; color: var(--t3); }
.ov-nums { display: flex; gap: 16px; text-align: right; flex-shrink: 0; }
.ov-num { display: flex; flex-direction: column; align-items: flex-end; }
.ov-val { font-family: var(--mono); font-size: 14px; font-weight: 700; }
.ov-lbl { font-size: 9px; color: var(--t3); text-transform: uppercase; }

/* ═══ ABOUT ═════════════════════════════════════ */
.about-list { padding: 8px 14px 24px; display: flex; flex-direction: column; gap: 8px; }
.about-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 16px;
  animation: fadeUp 0.4s ease both;
}
.ac-icon { font-size: 22px; margin-bottom: 8px; }
.about-card h3 { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--t1); margin-bottom: 8px; }
.about-card p { font-size: 12px; color: var(--t2); line-height: 1.75; }

.sources-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.sc-title { font-family: var(--mono); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--t3); margin-bottom: 4px; }
.src-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 12px; color: var(--t2);
  text-decoration: none; transition: color 0.15s;
}
.src-link:last-child { border-bottom: none; padding-bottom: 0; }
.src-link:active { color: var(--blue); }
.src-tag { font-family: var(--mono); font-size: 8px; font-weight: 700; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.src-tag.who { background: #1e1b4b; color: #a5b4fc; }
.src-tag.cdc { background: #0b1c33; color: #7dd3fc; }

.share-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 16px;
}
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sg-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px; border-radius: var(--r); font-size: 12px; font-weight: 500;
  border: 1px solid var(--border-md); color: var(--t1);
  transition: transform 0.15s, opacity 0.15s;
}
.sg-btn:active { transform: scale(0.95); opacity: 0.8; }
.sg-btn.tw { background: rgba(0,0,0,0.4); }
.sg-btn.wa { background: rgba(37,211,102,0.12); }
.sg-btn.fb { background: rgba(24,119,242,0.12); }
.sg-btn.cp { background: var(--bg3); }

.disclaimer-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); padding: 14px;
  font-size: 11px; color: var(--t3); line-height: 1.7;
}

/* ═══ BOTTOM TAB BAR ════════════════════════════ */
#tabBar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-md);
  display: flex; align-items: stretch;
}
.tb-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--t3); padding: 6px 4px;
  transition: color 0.2s; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tb-btn span { font-size: 9px; font-weight: 500; letter-spacing: 0.2px; }
.tb-btn svg { transition: transform 0.2s; }
.tb-btn:active svg { transform: scale(0.85); }
.tb-btn.active { color: var(--red); }
.tb-btn.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 2px;
  background: var(--red); border-radius: 0 0 2px 2px;
}
.tb-icon-wrap { position: relative; }
.tb-badge {
  position: absolute; top: -4px; right: -8px;
  background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 1.5px solid var(--bg0);
}

/* ═══ OVERLAYS & BOTTOM SHEETS ══════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.overlay.open { opacity: 1; visibility: visible; }

.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--bg1);
  border-top: 1px solid var(--border-lg);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(20px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32,0.72,0,1);
}
.bottom-sheet.open { transform: translateY(0); }

.bs-handle { width: 36px; height: 4px; background: var(--bg4); border-radius: 2px; margin: 0 auto 16px; }
.bs-title { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--t1); margin-bottom: 4px; }
.bs-url { font-size: 12px; color: var(--t3); margin-bottom: 20px; }
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.bs-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 10px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); color: var(--t1); font-size: 12px; font-weight: 500;
  transition: transform 0.15s;
}
.bs-btn:active { transform: scale(0.95); }
.bs-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.bs-cancel {
  width: 100%; padding: 14px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--rl); color: var(--t2); font-size: 14px; font-weight: 500;
}
.bs-cancel:active { background: var(--bg3); }

/* Country sheet */
.cs-hdr { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.cs-flag { font-size: 36px; }
.cs-name { font-size: 17px; font-weight: 700; color: var(--t1); }
.cs-status { font-size: 11px; color: var(--t3); margin-top: 2px; }
.cs-stats { display: flex; gap: 24px; margin-bottom: 14px; }
.cs-stat { text-align: center; }
.css-num { font-family: var(--mono); font-size: 28px; font-weight: 700; }
.css-num.red { color: var(--red); }
.css-lbl { font-size: 10px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.cs-body { font-size: 13px; color: var(--t2); line-height: 1.6; margin-bottom: 10px; }
.cs-monitoring { font-size: 11px; color: var(--t3); padding: 8px; background: var(--bg2); border-radius: var(--r); margin-bottom: 8px; }
.cs-src { font-family: var(--mono); font-size: 10px; color: var(--t4); margin-bottom: 16px; }

/* ═══ DESKTOP LAYOUT (≥ 900px) ════════════════ */
@media (min-width: 900px) {
  body { overflow: auto; height: auto; }

  #appHeader { position: sticky; top: 0; }
  .hdr-updated { display: block; }

  .alert-ticker { position: sticky; top: var(--hdr-h); }

  #appBody {
    position: static;
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    grid-template-rows: 1fr;
    height: calc(100vh - var(--hdr-h) - var(--ticker-h));
    overflow: hidden;
  }

  .tab-page {
    display: none !important;
    position: static;
    overflow-y: auto;
    animation: none;
  }

  /* Desktop: show all 3 main panels simultaneously */
  #tab-map, #tab-feed { display: block !important; }

  /* Map tab becomes left + center */
  #tab-map {
    grid-column: 1 / 3;
    display: grid !important;
    grid-template-columns: 260px 1fr;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    background: var(--bg0);
    padding-bottom: 0;
  }

  .stat-scroll-wrap {
    grid-column: 1 / 3;
    overflow-x: visible;
  }
  .stat-scroll { width: 100%; flex-wrap: nowrap; overflow-x: auto; }

  .map-toggle-bar { grid-column: 1 / 3; }

  .map-frame {
    grid-column: 2 / 3;
    grid-row: 2 / 4;
    height: 100%;
    margin: 0;
    border: none;
    border-left: 1px solid var(--border);
  }

  .section-head:first-of-type,
  .country-cards-scroll,
  .section-head:last-of-type,
  .us-pills-wrap {
    grid-column: 1 / 2;
    overflow-y: auto;
  }

  .country-cards-scroll {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    gap: 0;
    padding: 0;
  }

  .cc-card {
    width: 100%;
    flex-direction: row;
    border-radius: 0;
    border-left: none; border-right: none; border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    gap: 10px;
    background: var(--bg1);
  }
  .cc-flag { font-size: 18px; }
  .cc-card .cc-name { font-size: 12px; }
  .cc-card .cc-detail { display: none; }

  /* Feed becomes right sidebar */
  #tab-feed {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    border-left: 1px solid var(--border-md);
    overflow-y: auto;
    display: flex !important;
    flex-direction: column;
  }
  .feed-item { padding: 10px 14px; }
  .fi-text { font-size: 11px; }

  #tabBar { display: none; }

  /* Desktop nav in header */
  #appHeader { padding: 0 20px; }
  .hdr-center { flex: 1; justify-content: center; gap: 4px; }
  .hdr-center::after {
    content: '';
    display: flex;
  }
}

/* Show desktop section nav */
@media (min-width: 900px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  .dn-link {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-radius: var(--r);
    color: var(--t3);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
  }
  .dn-link:hover { color: var(--t2); background: var(--bg3); text-decoration: none; }
}

/* ═══ TABLET TWEAKS (600-900px) ════════════════ */
@media (min-width: 600px) and (max-width: 899px) {
  .stat-scroll { flex-wrap: wrap; width: 100%; }
  .stat-card { flex: 1; min-width: 80px; }
  .map-frame { height: 340px; }
  .country-cards-scroll { gap: 10px; }
  .cc-card { width: 160px; }
  #appBody { padding-bottom: 0; }
}

/* ═══ SMALL PHONES ══════════════════════════════ */
@media (max-width: 380px) {
  .hdr-brand { font-size: 15px; }
  .sc-num { font-size: 17px; }
  .stat-card { min-width: 70px; padding: 10px 12px; }
  .map-frame { height: 240px; }
  .tb-btn span { font-size: 8px; }
}

/* ═══ SAFE AREA / NOTCH ════════════════════════ */
@supports (padding-top: env(safe-area-inset-top)) {
  #appHeader { padding-top: calc(env(safe-area-inset-top) + 0px); height: calc(var(--hdr-h) + env(safe-area-inset-top)); }
  #appBody { top: calc(var(--hdr-h) + var(--ticker-h) + env(safe-area-inset-top)); }
  .alert-ticker { top: calc(var(--hdr-h) + env(safe-area-inset-top)); }
}

/* ═══ PULL-TO-REFRESH HINT ══════════════════════ */
.ptr-hint {
  text-align: center; font-size: 11px; color: var(--t3);
  padding: 8px; font-family: var(--mono);
}

/* ═══ SKELETON LOADER ═══════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══ TOAST ════════════════════════════════════ */
.toast {
  position: fixed; bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg3); border: 1px solid var(--border-lg);
  border-radius: 20px; padding: 8px 16px; font-size: 12px; color: var(--t1);
  z-index: 500; white-space: nowrap; opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 900px) {
  .toast { bottom: 20px; }
}
