/* ========================================
   Iran War Tracker v2 — style.css
   Full viewport dashboard, D3 map center
   ======================================== */

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

/* ---------- CSS CUSTOM PROPERTIES ---------- */
:root {
  /* Fonts */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Semantic colors */
  --crimson: #dc2626;
  --crimson-soft: rgba(220, 38, 38, 0.15);
  --steel: #3b82f6;
  --steel-soft: rgba(59, 130, 246, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --teal: #14b8a6;
  --teal-soft: rgba(20, 184, 166, 0.15);
  --emerald: #10b981;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Grid layout */
  --nav-h: 44px;
  --bottom-h: 30px;
  --left-w: 280px;
  --right-w: 320px;
}

/* ---------- DARK THEME (default) ---------- */
[data-theme="dark"] {
  --bg: #060610;
  --bg-subtle: #0a0a1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --surface-active: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.60);
  --text-muted: rgba(255, 255, 255, 0.38);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 20px;
  --nav-bg: rgba(6, 6, 16, 0.85);
  --bottom-bg: rgba(6, 6, 16, 0.90);
  --map-water: #060610;
  --map-land: rgba(255, 255, 255, 0.06);
  --map-stroke: rgba(255, 255, 255, 0.15);
  --map-iran: rgba(220, 38, 38, 0.22);
  --map-iran-stroke: rgba(220, 38, 38, 0.45);
  --map-coalition: rgba(59, 130, 246, 0.13);
  --map-coalition-stroke: rgba(59, 130, 246, 0.35);
  --map-affected: rgba(245, 158, 11, 0.12);
  --map-affected-stroke: rgba(245, 158, 11, 0.30);
  --map-label: rgba(255, 255, 255, 0.45);
  --shadow-panel: 0 4px 30px rgba(0,0,0,0.4);
  --scrollbar-bg: rgba(255,255,255,0.04);
  --scrollbar-thumb: rgba(255,255,255,0.12);
  color-scheme: dark;
}

/* ---------- LIGHT THEME ---------- */
[data-theme="light"] {
  --bg: #f0f0f5;
  --bg-subtle: #e8e8f0;
  --surface: rgba(255, 255, 255, 0.70);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --surface-active: rgba(255, 255, 255, 0.95);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text-primary: rgba(0, 0, 0, 0.88);
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-muted: rgba(0, 0, 0, 0.35);
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-blur: 20px;
  --nav-bg: rgba(240, 240, 245, 0.88);
  --bottom-bg: rgba(240, 240, 245, 0.92);
  --map-water: #c8cad6;
  --map-land: #dddee6;
  --map-stroke: rgba(0, 0, 0, 0.18);
  --map-iran: rgba(220, 38, 38, 0.25);
  --map-iran-stroke: rgba(220, 38, 38, 0.55);
  --map-coalition: rgba(59, 130, 246, 0.20);
  --map-coalition-stroke: rgba(59, 130, 246, 0.45);
  --map-affected: rgba(245, 158, 11, 0.20);
  --map-affected-stroke: rgba(245, 158, 11, 0.40);
  --map-label: rgba(0, 0, 0, 0.55);
  --shadow-panel: 0 4px 30px rgba(0,0,0,0.08);
  --scrollbar-bg: rgba(0,0,0,0.04);
  --scrollbar-thumb: rgba(0,0,0,0.12);
  color-scheme: light;
}

/* ---------- BASE STYLES ---------- */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- DASHBOARD GRID ---------- */
.dashboard {
  display: grid;
  grid-template-rows: var(--nav-h) 1fr var(--bottom-h);
  grid-template-columns: var(--left-w) 1fr var(--right-w);
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

/* ---------- TOP NAV ---------- */
.top-nav {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  gap: var(--sp-3);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.nav-logo { color: var(--text-primary); flex-shrink: 0; }

.nav-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  white-space: nowrap;
}

.nav-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.live-badge {
  background: var(--crimson);
  color: #fff;
  animation: livePulse 2s ease infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.day-badge {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s var(--ease-smooth), color 0.2s;
}
.theme-toggle:hover { background: var(--surface-hover); color: var(--text-primary); }

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ---------- LEFT PANEL ---------- */
.left-panel {
  grid-row: 2;
  grid-column: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  border-right: 1px solid var(--glass-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-inner {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

/* KPI Row */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-2);
}

.kpi-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) var(--sp-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.2s;
}
.kpi-mini:hover { background: var(--surface-hover); }

.kpi-val {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
}

.kpi-highlight-red .kpi-val { color: var(--crimson); }

.kpi-lbl {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Casualties List */
.casualty-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.casualty-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2);
  border-radius: 4px;
  transition: background 0.15s;
}
.casualty-item:hover { background: var(--surface-hover); }

.casualty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.casualty-dot.red { background: var(--crimson); }
.casualty-dot.blue { background: var(--steel); }
.casualty-dot.amber { background: var(--amber); }

.casualty-label {
  flex: 1;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.casualty-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.casualty-note {
  font-size: 9px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

/* Military Tabs */
.mil-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border-radius: 5px;
  padding: 2px;
  margin-bottom: var(--sp-2);
}

.mil-tab {
  flex: 1;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.mil-tab.active {
  background: var(--surface-active);
  color: var(--text-primary);
}
.mil-tab:hover:not(.active) { color: var(--text-secondary); }

.mil-content { display: flex; flex-direction: column; gap: var(--sp-1); }

.mil-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-1) var(--sp-2);
  font-size: 11px;
}
.mil-stat-label { color: var(--text-secondary); }
.mil-stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Country Chips */
.country-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bloc-chips-row, .country-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Bloc filter chips */
.bloc-chip {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
  white-space: nowrap;
}
.bloc-chip:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
}
.bloc-chip.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--amber);
  color: var(--amber);
}

.country-chip {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
  white-space: nowrap;
}
.country-chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.country-chip.active {
  background: var(--steel-soft);
  border-color: var(--steel);
  color: var(--steel);
}

/* ---------- MAP AREA ---------- */
.map-area {
  grid-row: 2;
  grid-column: 2;
  position: relative;
  overflow: hidden;
  background: var(--map-water);
}

/* Subtle vignette overlay on map */
.map-area::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, var(--bg) 100%);
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
}

.map-container {
  width: 100%;
  height: 100%;
  cursor: grab;
}
.map-container:active { cursor: grabbing; }

.map-container svg {
  width: 100%;
  height: 100%;
}

/* Country paths */
.country {
  fill: var(--map-land);
  stroke: var(--map-stroke);
  stroke-width: 0.4;
  transition: fill 0.3s, stroke 0.3s;
  cursor: pointer;
}
.country:hover {
  fill: var(--surface-hover);
  stroke: var(--text-muted);
  stroke-width: 0.8;
}

/* Light theme: strengthen hover on regular countries */
[data-theme="light"] .country:hover {
  fill: rgba(0, 0, 0, 0.12);
}
.country.iran {
  fill: var(--map-iran);
  stroke: var(--map-iran-stroke);
  stroke-width: 1;
}
.country.iran:hover {
  fill: rgba(220, 38, 38, 0.35);
}
.country.coalition {
  fill: var(--map-coalition);
  stroke: var(--map-coalition-stroke);
  stroke-width: 0.7;
}
.country.coalition:hover {
  fill: rgba(59, 130, 246, 0.25);
}
.country.affected {
  fill: var(--map-affected);
  stroke: var(--map-affected-stroke);
  stroke-width: 0.6;
}
.country.affected:hover {
  fill: rgba(245, 158, 11, 0.25);
}

/* Map Labels */
.map-label {
  font-family: var(--font-body);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.08em;
  fill: var(--map-label);
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}

.map-label-lg  { font-size: 10px; font-weight: 700; opacity: 0.7; }
.map-label-md  { font-size: 8px;  font-weight: 600; opacity: 0.6; }
.map-label-sm  { font-size: 7px;  font-weight: 500; opacity: 0.5; }
.map-label-xs  { font-size: 5.5px; font-weight: 500; opacity: 0.4; letter-spacing: 0.06em; }

.map-label-highlight {
  fill: var(--crimson);
  opacity: 0.85;
  font-weight: 700;
}

/* Hotspot dots */
.hotspot {
  cursor: pointer;
  transition: r 0.2s;
}
.hotspot:hover { r: 5; }

/* Pulsing animation */
.pulse-ring {
  fill: none;
  stroke-width: 1;
  pointer-events: none;
}

/* Pulse animation handled via JS for SVG elements */

/* Attack lines */
.attack-line {
  fill: none;
  stroke-dasharray: 6 4;
  stroke-linecap: round;
  pointer-events: none;
}

@keyframes dashFlow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -20; }
}

.attack-line-label {
  font-family: var(--font-body);
  font-size: 5px;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
  opacity: 0.7;
  letter-spacing: 0.03em;
}

/* Map tooltip */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: var(--sp-2) var(--sp-3);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 60;
  max-width: 220px;
}
.map-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.tooltip-role {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.tooltip-deaths {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--crimson);
  margin-top: 3px;
}

/* Map controls */
.map-controls {
  position: absolute;
  bottom: var(--sp-4);
  left: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
}

.map-ctrl-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.map-ctrl-btn:hover { background: var(--surface-hover); color: var(--text-primary); }

/* Map legend */
.map-legend {
  position: absolute;
  bottom: var(--sp-4);
  right: var(--sp-4);
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  z-index: 30;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-iran { background: var(--crimson); }
.legend-coalition { background: var(--steel); }
.legend-affected { background: var(--amber); }

.legend-line {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}
.legend-attack-blue { background: var(--steel); }
.legend-attack-red { background: var(--crimson); }

/* ---------- RIGHT PANEL ---------- */
.right-panel {
  grid-row: 2;
  grid-column: 3;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Right panel tabs */
.right-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.right-tab {
  flex: 1;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: var(--sp-3) 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.right-tab:hover { color: var(--text-secondary); }
.right-tab.active { color: var(--text-primary); }
.right-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--steel);
  border-radius: 1px;
}

.right-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-3);
}
.right-tab-content.active { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Feed disclaimer */
.feed-disclaimer {
  font-size: 9px;
  color: var(--text-muted);
  padding: var(--sp-2);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 4px;
  line-height: 1.4;
  flex-shrink: 0;
}

/* Voices / Quote Cards */
.voice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--sp-3);
  transition: background 0.15s, border-color 0.15s;
}
.voice-card:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.voice-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.voice-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.voice-avatar.coalition { background: var(--steel); }
.voice-avatar.iran { background: var(--crimson); }
.voice-avatar.international { background: var(--teal); }
.voice-avatar.opposition { background: var(--amber); }
.voice-avatar.media { background: rgba(255,255,255,0.20); color: var(--text-primary); }

.voice-meta { flex: 1; min-width: 0; }
.voice-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-role {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-badge {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.voice-badge.coalition { background: var(--steel-soft); color: var(--steel); }
.voice-badge.iran { background: var(--crimson-soft); color: var(--crimson); }
.voice-badge.international { background: var(--teal-soft); color: var(--teal); }
.voice-badge.opposition { background: var(--amber-soft); color: var(--amber); }
.voice-badge.media { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }

/* Voice tone/reliability badges */
.voice-tone-row {
  margin-bottom: var(--sp-2);
}

.voice-tone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: default;
}

.voice-tone-icon {
  font-size: 9px;
  line-height: 1;
}

.voice-tone.verified {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.voice-tone.partial {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.voice-tone.unconfirmed {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.voice-tone.opinion {
  background: rgba(168, 85, 247, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.voice-quote {
  font-size: 11px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--sp-2);
  border-left: 2px solid var(--border-strong);
  padding-left: var(--sp-2);
}

.voice-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 9px;
  color: var(--text-muted);
}
.voice-footer a { font-size: 9px; color: var(--steel); }
.voice-footer a:hover { text-decoration: underline; }

/* Timeline */
.timeline-filters {
  display: flex;
  gap: 4px;
  margin-bottom: var(--sp-2);
  flex-shrink: 0;
}

.tl-filter {
  font-size: 9px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tl-filter:hover { color: var(--text-secondary); }
.tl-filter.active {
  background: var(--steel-soft);
  border-color: var(--steel);
  color: var(--steel);
}

.timeline-entry {
  position: relative;
  padding-left: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.timeline-entry::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 1.5px solid var(--bg);
}
.timeline-entry.military::before { background: var(--steel); }
.timeline-entry.civilian::before { background: var(--crimson); }
.timeline-entry.political::before { background: var(--amber); }
.timeline-entry.today { border-left-color: var(--crimson); }
.timeline-entry.today::before { background: var(--crimson); box-shadow: 0 0 6px var(--crimson); }

.tl-date {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.tl-cat-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 2px;
  margin-bottom: 3px;
}
.tl-cat-badge.military { background: var(--steel-soft); color: var(--steel); }
.tl-cat-badge.civilian { background: var(--crimson-soft); color: var(--crimson); }
.tl-cat-badge.political { background: var(--amber-soft); color: var(--amber); }

.tl-event {
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.4;
  cursor: pointer;
}
.tl-event:hover { color: var(--text-secondary); }

.tl-details {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: var(--sp-1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out);
}
.timeline-entry.expanded .tl-details { max-height: 120px; }

/* Infrastructure */
.infra-card {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.15s;
}
.infra-card:hover { background: var(--surface-hover); }

.infra-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.infra-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.infra-desc {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Military base variant */
.infra-military {
  border-left: 2px solid var(--steel);
  background: rgba(59, 130, 246, 0.06);
}
.infra-military:hover {
  background: rgba(59, 130, 246, 0.12);
}
.mil-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--steel);
  vertical-align: middle;
  margin-left: 4px;
}
.infra-mil-chip {
  border-color: rgba(59, 130, 246, 0.3);
}
.infra-mil-chip.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--steel);
  color: var(--steel);
}

/* ---------- BOTTOM BAR ---------- */
.bottom-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  background: var(--bottom-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  font-size: 9px;
  color: var(--text-muted);
  gap: var(--sp-3);
  z-index: 100;
}

.bottom-left {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.disclaimer-icon { flex-shrink: 0; opacity: 0.5; }

.bottom-center {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.bottom-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.source-badges {
  display: flex;
  gap: 3px;
}

.source-badge {
  font-size: 8px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.source-badge:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.pplx-link {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s;
}
.pplx-link:hover { color: var(--text-primary); text-decoration: underline; }

/* ---------- ACTIVE FILTER BAR ---------- */
.active-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  min-height: 0;
}

.active-filter-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--steel);
  letter-spacing: 0.02em;
}

.clear-filter-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--crimson);
  background: var(--crimson-soft);
  color: var(--crimson);
  cursor: pointer;
  transition: all 0.15s;
}
.clear-filter-btn:hover {
  background: var(--crimson);
  color: #fff;
}

/* ---------- RELIABILITY BADGES ---------- */
.tl-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 2px;
}

.tl-reliability {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  cursor: help;
  flex-shrink: 0;
}

.tl-rel-icon {
  font-size: 8px;
  line-height: 1;
}

.tl-reliability.verified {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tl-reliability.partial {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tl-reliability.unconfirmed {
  background: var(--crimson-soft);
  color: var(--crimson);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Reliability legend (in timeline tab) */
.reliability-legend {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-1) 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-1);
}

.rel-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  color: var(--text-muted);
  cursor: help;
}

.rel-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rel-legend-dot.verified { background: var(--emerald); }
.rel-legend-dot.partial { background: var(--amber); }
.rel-legend-dot.unconfirmed { background: var(--crimson); }

.rel-legend-label {
  font-size: 8px;
  letter-spacing: 0.02em;
}

/* ---------- INFRA COUNTRY CHIPS ---------- */
.infra-country-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  flex-shrink: 0;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-1);
}

.infra-country-chip {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
  white-space: nowrap;
}
.infra-country-chip:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.infra-country-chip.active {
  background: var(--steel-soft);
  border-color: var(--steel);
  color: var(--steel);
}

/* Infra country group header */
.infra-country-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-1) var(--sp-2);
  margin-top: var(--sp-1);
}

.infra-country-name {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.infra-country-count {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  font-style: italic;
}

/* ---------- ORIENTATION GATE ---------- */
.orientation-gate {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.orientation-message {
  text-align: center;
  padding: var(--sp-8);
}

.rotate-icon {
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.orientation-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
  line-height: 1.4;
}

.orientation-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Old orientation gate removed — mobile responsive now handles all screen sizes */

/* ---------- LOADING OVERLAY ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

[data-theme="light"] .loading-overlay {
  background: rgba(245, 245, 250, 0.92);
}

.loading-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  min-width: 280px;
}

/* Pulsing logo icon */
.loading-logo-pulse svg {
  filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.3));
}

.loading-arc {
  animation: arcDraw 2s ease-in-out infinite;
  transform-origin: center;
}

@keyframes arcDraw {
  0%   { stroke-dashoffset: 126; }
  50%  { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 126; }
}

.loading-core {
  animation: corePulse 1.5s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { r: 4; opacity: 1; }
  50%      { r: 6; opacity: 0.6; }
}

/* Progress bar */
.loading-progress-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  max-width: 260px;
  margin-top: var(--sp-2);
}

.loading-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .loading-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}

.loading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--crimson), #ef4444);
  border-radius: 2px;
  transition: width 0.3s ease-out;
  position: relative;
}

.loading-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -1px;
  width: 8px;
  height: 6px;
  border-radius: 3px;
  background: #fff;
  opacity: 0.6;
  filter: blur(2px);
}

.loading-percent {
  font-size: 13px;
  font-weight: 600;
  color: var(--crimson);
  min-width: 36px;
  text-align: right;
  letter-spacing: 0.04em;
}

.loading-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  transition: opacity 0.3s ease;
}

.loading-subtext {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-muted);
  transition: opacity 0.3s ease;
}

/* Completed state */
.loading-overlay.complete .loading-progress-fill {
  background: linear-gradient(90deg, var(--teal), var(--emerald));
}

.loading-overlay.complete .loading-percent {
  color: var(--emerald);
}

.loading-overlay.complete .loading-arc {
  stroke: var(--emerald);
  animation: none;
  stroke-dashoffset: 0;
  transition: stroke 0.4s, stroke-dashoffset 0.6s ease;
}

.loading-overlay.complete .loading-core {
  fill: var(--emerald);
  animation: none;
  transition: fill 0.4s;
}

/* ---------- DATA STATUS BADGE ---------- */
.data-status-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: default;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.data-status-badge.status-live {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.data-status-badge.status-cache {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.data-status-badge.status-stale {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.data-status-badge.status-fallback {
  background: rgba(220, 38, 38, 0.12);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* ---------- GLOBAL IMPACT ---------- */
.global-impact-section {
  margin-bottom: 8px;
}

.global-impact-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.impact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 11px;
}

.impact-label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.impact-value {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  max-width: 160px;
  text-align: right;
  line-height: 1.3;
}

.threat-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.threat-badge.low { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.threat-badge.medium { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.threat-badge.high { background: rgba(220, 38, 38, 0.15); color: #dc2626; }
.threat-badge.critical { background: rgba(220, 38, 38, 0.3); color: #ff4444; animation: pulse-threat 1.5s ease-in-out infinite; }

@keyframes pulse-threat {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---------- "NOVO" DIFF BADGES ---------- */
.novo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  margin-left: 6px;
  border-radius: 3px;
  background: var(--crimson);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  vertical-align: middle;
  animation: novoPulse 2s ease-in-out 3;
}

@keyframes novoPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.voice-card-new {
  border-left: 2px solid var(--crimson);
}

.tl-entry-new {
  border-left: 2px solid var(--crimson);
}

/* ---------- AUTO-REFRESH COUNTDOWN ---------- */
.refresh-countdown {
  display: none; /* shown by JS when active */
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
  white-space: nowrap;
  cursor: default;
}

.refresh-countdown svg { opacity: 0.5; flex-shrink: 0; }

.countdown-text {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  min-width: 38px;
  text-align: center;
}

/* ---------- SHARE BUTTON ---------- */
.nav-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.nav-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

[data-theme="light"] .nav-action-btn {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .nav-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Share toast */
.share-toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  z-index: 20000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.share-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ---------- KEYBOARD SHORTCUTS MODAL ---------- */
.kbd-modal {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.kbd-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .kbd-modal {
  background: rgba(245, 245, 250, 0.7);
}

.kbd-modal-inner {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  min-width: 280px;
  max-width: 340px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.kbd-modal-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.kbd-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kbd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.kbd-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0;
}

[data-theme="light"] .kbd-row kbd {
  background: rgba(0, 0, 0, 0.05);
}

.kbd-dismiss {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

/* Hint in footer */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.04em;
}

.kbd-hint:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

[data-theme="light"] .kbd-hint {
  background: rgba(0, 0, 0, 0.03);
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== INFRA IMPROVEMENTS ========== */
.infra-cat-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.infra-country-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.infra-stats-bar {
  display: flex;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-muted);
  align-items: center;
}
.infra-stat-num {
  color: var(--text-primary);
  font-weight: 600;
  margin-right: 2px;
}
.infra-stat-mil { color: #f97316; }
.infra-stat-civ { color: #3b82f6; }
.infra-stat-nuc { color: #a855f7; }
.infra-nuclear {
  border-left: 2px solid #a855f7;
}
.infra-nuclear:hover {
  background: rgba(168, 85, 247, 0.06);
}
.nuc-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  vertical-align: middle;
  margin-left: 4px;
}
.infra-loc-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  vertical-align: middle;
  margin-left: 4px;
}
.infra-body {
  flex: 1;
  min-width: 0;
}

/* ========== MAP OVERLAY STATS ========== */
.map-overlay-stats {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  pointer-events: none;
}
.map-stat-item {
  display: flex;
  flex-direction: column;
  background: rgba(6, 6, 16, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 5px 8px;
  min-width: 90px;
}
.map-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.map-stat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  line-height: 1.2;
}
.map-stat-strikes .map-stat-val { color: #3b82f6; }
.map-stat-missiles .map-stat-val { color: #dc2626; }
.map-stat-drones .map-stat-val { color: #f97316; }

/* ========== DIPLOMATIC PULSE ========== */
.diplomatic-pulse {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  pointer-events: none;
}
.diplo-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 6, 16, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 6px 10px;
}
.diplo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: diplo-pulse 1.5s ease-in-out infinite;
}
@keyframes diplo-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.6; box-shadow: 0 0 8px 2px currentColor; }
}
.diplo-indicator.critical .diplo-dot {
  animation: diplo-pulse-critical 0.8s ease-in-out infinite;
}
@keyframes diplo-pulse-critical {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 #dc2626; }
  50% { opacity: 0.5; box-shadow: 0 0 12px 4px rgba(220,38,38,0.5); }
}
.diplo-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.diplo-level {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.diplo-indicator.low .diplo-level { color: #14b8a6; }
.diplo-indicator.medium .diplo-level { color: #f59e0b; }
.diplo-indicator.high .diplo-level { color: #f97316; }
.diplo-indicator.critical .diplo-level { color: #ff4444; }

/* ================================================================
   MOBILE RESPONSIVE — All styles scoped to mobile breakpoints.
   DESKTOP STAYS COMPLETELY UNCHANGED.
   ================================================================ */

/* --- Hide mobile-only elements on desktop --- */
.mobile-header,
.mobile-kpi-strip,
.mobile-nav,
.mobile-panel-overlay,
.mobile-panel {
  display: none;
}

/* =============================================================
   MOBILE BREAKPOINT — Both portrait and landscape on phones/tablets
   ============================================================= */
@media (max-width: 1024px) {

  /* --- Remove the orientation gate that blocks everything --- */
  .orientation-gate { display: none !important; }

  /* --- Override html/body overflow for mobile --- */
  html, body { overflow: hidden; height: 100dvh; }

  /* --- Show mobile UI elements --- */
  .mobile-header { display: flex; }
  .mobile-nav { display: flex; }

  /* --- Hide desktop-only elements --- */
  .dashboard .top-nav { display: none; }
  .dashboard .left-panel { display: none; }
  .dashboard .right-panel { display: none; }
  .dashboard .bottom-bar { display: none; }

  /* --- Reconfigure dashboard grid for mobile --- */
  .dashboard {
    display: flex !important;
    flex-direction: column;
    grid-template-rows: none;
    grid-template-columns: none;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    padding-top: 40px;   /* mobile header height */
    padding-bottom: 56px; /* mobile nav height */
  }

  /* --- Map area fills the remaining space --- */
  .dashboard .map-area {
    grid-row: unset;
    grid-column: unset;
    flex: 1;
    width: 100%;
    min-height: 0;
    position: relative;
  }

  /* --- Map controls repositioned for mobile --- */
  .map-controls {
    bottom: 8px;
    left: 8px;
  }
  .map-ctrl-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  /* --- Map legend: horizontal, compact, at bottom --- */
  .map-legend {
    bottom: 8px;
    right: 8px;
    gap: var(--sp-2);
    padding: 4px 8px;
    font-size: 7px;
  }
  .legend-item { font-size: 7px; gap: 2px; }
  .legend-dot { width: 5px; height: 5px; }
  .legend-line { width: 10px; }

  /* --- Map overlay stats: hidden on mobile to avoid overlap with KPI strip --- */
  /* Military data (missiles, drones, targets) is available in the "Dados" tab */
  .map-overlay-stats {
    display: none;
  }

  /* --- Diplomatic pulse: smaller --- */
  .diplomatic-pulse { top: 4px; right: 4px; }
  .diplo-indicator { padding: 4px 8px; gap: 4px; }
  .diplo-label { font-size: 7px; }
  .diplo-level { font-size: 9px; }
  .diplo-dot { width: 6px; height: 6px; }

  /* KPI strip visibility controlled via body.mobile-tab-* classes */

  /* ================================================================
     MOBILE HEADER
     ================================================================ */
  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    touch-action: manipulation;
  }

  .mobile-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-header-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    white-space: nowrap;
  }

  .mobile-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-header .theme-toggle {
    width: 28px;
    height: 28px;
  }

  .mobile-header .nav-badge {
    font-size: 8px;
    padding: 1px 5px;
  }

  /* ================================================================
     MOBILE KPI STRIP — Floating over map
     ================================================================ */
  .mobile-kpi-strip {
    position: fixed;
    top: 44px;
    left: 8px;
    right: 8px;
    z-index: 150;
    display: none;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(6, 6, 16, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    justify-content: space-around;
  }

  [data-theme="light"] .mobile-kpi-strip {
    background: rgba(240, 240, 245, 0.88);
    border-color: rgba(0, 0, 0, 0.06);
  }

  .mobile-kpi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    flex: 1;
  }

  .mobile-kpi-val {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    white-space: nowrap;
  }

  .mobile-kpi-red .mobile-kpi-val { color: var(--crimson); }

  .mobile-kpi-lbl {
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }

  /* ================================================================
     MOBILE BOTTOM NAVIGATION
     ================================================================ */
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 500;
    display: flex;
    align-items: stretch;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    touch-action: manipulation;
  }

  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    position: relative;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }

  .mobile-nav-btn svg,
  .mobile-nav-btn span {
    pointer-events: none;
  }

  .mobile-nav-btn svg {
    transition: transform 0.2s, color 0.2s;
    width: 18px;
    height: 18px;
  }

  .mobile-nav-btn span {
    font-family: var(--font-body);
  }

  .mobile-nav-btn.active {
    color: var(--text-primary);
  }

  .mobile-nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--steel);
    border-radius: 0 0 2px 2px;
  }

  .mobile-nav-btn:active {
    background: var(--surface);
  }

  /* ================================================================
     MOBILE PANEL SYSTEM — Bottom sheet for data views
     ================================================================ */
  .mobile-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .mobile-panel-overlay.visible {
    display: block;
    opacity: 1;
  }

  .mobile-panel {
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    z-index: 350;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: calc(100dvh - 40px - 56px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
  }

  .mobile-panel.visible {
    transform: translateY(0);
    pointer-events: auto;
    opacity: 1;
  }

  .mobile-panel-handle {
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 8px auto 4px;
    opacity: 0.4;
    flex-shrink: 0;
  }

  .mobile-panel-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 12px 72px 12px; /* extra bottom padding for safe area */
    -webkit-overflow-scrolling: touch;
  }

  /* --- Panel section styling --- */
  .mobile-panel .section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 12px 0 8px 0;
  }
  .mobile-panel .section-label:first-child {
    margin-top: 0;
  }

  /* Clone section styles inside mobile panel */
  .mobile-panel .kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
  }
  .mobile-panel .kpi-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
  }
  .mobile-panel .kpi-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .mobile-panel .kpi-highlight-red .kpi-val { color: var(--crimson); }
  .mobile-panel .kpi-lbl {
    font-size: 8px;
    font-weight: 500;
    color: var(--text-muted);
  }

  /* Mobile panel info card rows */
  .mobile-panel .impact-row {
    font-size: 10px;
    padding: 4px 8px;
  }
  .mobile-panel .impact-label { font-size: 9px; }
  .mobile-panel .impact-value { font-size: 10px; max-width: 140px; }

  .mobile-panel .casualty-item { padding: 6px 6px; }
  .mobile-panel .casualty-label { font-size: 10px; }
  .mobile-panel .casualty-value { font-size: 11px; }
  .mobile-panel .casualty-note { font-size: 8px; }

  .mobile-panel .mil-tabs {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border-radius: 5px;
    padding: 2px;
    margin-bottom: 8px;
  }
  .mobile-panel .mil-tab {
    flex: 1;
    font-size: 10px;
    font-weight: 600;
    padding: 5px 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
  }
  .mobile-panel .mil-tab.active {
    background: var(--surface-active);
    color: var(--text-primary);
  }

  .mobile-panel .country-chips { margin-bottom: 8px; }

  /* Voices / Timeline / Infra in mobile panel */
  .mobile-panel .voice-card { padding: 10px; margin-bottom: 8px; }
  .mobile-panel .voice-quote { font-size: 11px; }

  .mobile-panel .timeline-entry { padding-left: 14px; }
  .mobile-panel .tl-event { font-size: 11px; }

  .mobile-panel .infra-card { padding: 8px; margin-bottom: 6px; }

  .mobile-panel .feed-disclaimer {
    font-size: 9px;
    margin-bottom: 8px;
  }

  .mobile-panel .timeline-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }

  .mobile-panel .infra-country-chips {
    flex-wrap: wrap;
    margin-bottom: 8px;
  }

  .mobile-panel .infra-cat-row,
  .mobile-panel .infra-country-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .mobile-panel .infra-stats-bar {
    font-size: 10px;
    gap: 6px;
    padding: 4px 6px;
  }

  /* ================================================================
     MOBILE MAP TAB — Show map fullscreen with KPI strip
     ================================================================ */
  body.mobile-tab-map .mobile-kpi-strip { display: flex; }
  body.mobile-tab-map .dashboard .map-area { display: block; }
  body.mobile-tab-map .mobile-panel { transform: translateY(100%); }

  /* ================================================================
     MOBILE INFO/FEED/TIMELINE/INFRA TABS — Show panel
     ================================================================ */
  body.mobile-tab-info .mobile-panel,
  body.mobile-tab-feed .mobile-panel,
  body.mobile-tab-timeline .mobile-panel,
  body.mobile-tab-infra .mobile-panel {
    display: flex;
    transform: translateY(0);
  }

  body.mobile-tab-info .mobile-kpi-strip,
  body.mobile-tab-feed .mobile-kpi-strip,
  body.mobile-tab-timeline .mobile-kpi-strip,
  body.mobile-tab-infra .mobile-kpi-strip {
    display: none;
  }

  /* ================================================================
     LOADING OVERLAY MOBILE ADJUSTMENTS
     ================================================================ */
  .loading-overlay {
    z-index: 10000;
  }
}

/* =============================================================
   LANDSCAPE-SPECIFIC mobile tweaks (phone in landscape)
   ============================================================= */
@media (max-width: 1024px) and (orientation: landscape) {
  .mobile-header { height: 36px; }

  .dashboard {
    padding-top: 36px;
    padding-bottom: 44px;
  }

  .mobile-nav {
    height: 44px;
  }

  .mobile-nav-btn svg {
    width: 16px;
    height: 16px;
  }

  .mobile-nav-btn span {
    font-size: 8px;
  }

  .mobile-kpi-strip {
    top: 38px;
    padding: 4px 6px;
  }

  .mobile-kpi-val { font-size: 11px; }
  .mobile-kpi-lbl { font-size: 7px; }

  /* Panel takes less height in landscape */
  .mobile-panel {
    max-height: calc(100dvh - 36px - 44px);
    border-radius: 12px 12px 0 0;
    bottom: 44px;
  }

  .mobile-panel-content {
    padding-bottom: 12px;
  }

  /* Map overlay stats: hidden on mobile (data in Dados tab) */
  .map-overlay-stats { display: none; }

  .diplomatic-pulse { top: 2px; right: 2px; }
  .diplo-indicator { padding: 3px 6px; }
  .diplo-label { font-size: 6px; }
  .diplo-level { font-size: 8px; }
}

/* =============================================================
   PORTRAIT-SPECIFIC mobile tweaks (phone in portrait)
   ============================================================= */
@media (max-width: 1024px) and (orientation: portrait) {
  /* Panel takes up more of the screen in portrait */
  .mobile-panel {
    max-height: calc(100dvh - 40px - 56px);
    bottom: 56px;
  }

  /* Map legend wraps in portrait */
  .map-legend {
    flex-wrap: wrap;
    max-width: 200px;
    gap: 4px 8px;
    font-size: 7px;
    bottom: 6px;
    right: 6px;
    padding: 3px 6px;
  }

  /* Country chips scroll horizontally */
  .mobile-panel .country-chips {
    flex-direction: column;
    gap: 4px;
  }
  .mobile-panel .bloc-chips-row,
  .mobile-panel .country-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
}

/* =============================================================
   VERY SMALL screens (< 375px width)
   ============================================================= */
@media (max-width: 374px) {
  .mobile-header-title { font-size: 9px; }
  .mobile-kpi-val { font-size: 11px; }
  .mobile-nav-btn span { font-size: 8px; }
  .mobile-nav-btn svg { width: 16px; height: 16px; }
}
