@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Orbitron:wght@400;600;700;900&display=swap');

/* ══════════════════════════════════════════
   FLY-VIEW · ORION  |  Design System v3
   Palette: Black · Orange #FF6600 · Yellow #FFD700 · White
══════════════════════════════════════════ */

:root {
  --black:         #000000;
  --black-1:       #0a0a0a;
  --black-2:       #111111;
  --white:         #ffffff;
  --white-50:      rgba(255,255,255,0.5);
  --white-30:      rgba(255,255,255,0.3);
  --white-10:      rgba(255,255,255,0.1);
  --white-05:      rgba(255,255,255,0.05);
  --yellow:        #FFD700;
  --yellow-40:     rgba(255,215,0,0.4);
  --yellow-15:     rgba(255,215,0,0.15);
  --yellow-08:     rgba(255,215,0,0.08);
  --orange:        #FF6600;
  --orange-60:     rgba(255,102,0,0.6);
  --orange-30:     rgba(255,102,0,0.3);
  --orange-15:     rgba(255,102,0,0.15);
  --orange-08:     rgba(255,102,0,0.08);
  --red:           #FF2200;
  --red-20:        rgba(255,34,0,0.2);
  --panel-bg:      rgba(4,4,4,0.96);
  --border:        rgba(255,102,0,0.22);
  --border-faint:  rgba(255,255,255,0.06);
  --font:          'Space Mono', 'Courier New', monospace;
  --font-display:  'Orbitron', 'Space Mono', monospace;
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.45, 0, 0.55, 1);
  --bar-h:         54px;
  --stat-h:        38px;
  --panel-w:       430px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─────────────────── GLOBE ─────────────────── */
#cesiumContainer { position: fixed; inset: 0; z-index: 0; }
.cesium-widget-credits,
.cesium-credit-logoContainer,
.cesium-credit-expand-link { display: none !important; }

/* ─────────────────── OVERLAYS ─────────────────── */
/* scanlines */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 1;
  background: repeating-linear-gradient(
    0deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 4px
  );
  pointer-events: none;
}
/* vignette */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 1;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 40%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

/* ─────────────────── LOADING SCREEN ─────────────────── */
#loadingOverlay {
  position: fixed; inset: 0; z-index: 999;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
}
#loadingOverlay.hidden { display: none; }

/* animated grid behind loading */
#loadingOverlay::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--orange-08) 1px, transparent 1px),
    linear-gradient(90deg, var(--orange-08) 1px, transparent 1px);
  background-size: 70px 70px;
  animation: gridDrift 12s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 70px 70px, 70px 70px; }
}

.loading-inner {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; gap: 22px;
  padding: 0 20px;
}

.loading-logo-wrap { position: relative; display: inline-block; }

.loading-logo {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--white);
  animation: logoBuildIn 0.8s var(--ease-out) both;
}
.loading-logo .sep { color: var(--orange); }

@keyframes logoBuildIn {
  from { opacity: 0; letter-spacing: 0.5em; filter: blur(12px); }
  to   { opacity: 1; letter-spacing: 0.12em; filter: blur(0); }
}

/* glitch layers */
.loading-logo::before,
.loading-logo::after {
  content: 'FLY-VIEW';
  position: absolute; inset: 0;
  background: transparent;
}
.loading-logo::before {
  color: var(--orange);
  clip-path: polygon(0 25%, 100% 25%, 100% 45%, 0 45%);
  animation: glitch1 4s infinite;
}
.loading-logo::after {
  color: var(--yellow);
  clip-path: polygon(0 62%, 100% 62%, 100% 78%, 0 78%);
  animation: glitch2 4s infinite;
}
@keyframes glitch1 {
  0%,88%,100% { transform: none; opacity: 0; }
  89% { transform: translateX(-5px); opacity: 0.6; }
  91% { transform: translateX(4px);  opacity: 0.6; }
  93% { transform: none; opacity: 0; }
}
@keyframes glitch2 {
  0%,83%,100% { transform: none; opacity: 0; }
  84% { transform: translateX(4px);  opacity: 0.45; }
  86% { transform: translateX(-3px); opacity: 0.45; }
  88% { transform: none; opacity: 0; }
}

.loading-sub {
  font-size: 0.55rem;
  letter-spacing: 0.45em;
  color: rgba(255,255,255,0.25);
  margin-top: -14px;
  text-transform: uppercase;
}

.loading-bars { width: 260px; display: flex; flex-direction: column; gap: 6px; }
.loading-bar {
  width: 100%; height: 1px;
  background: rgba(255,255,255,0.06);
  overflow: hidden; position: relative;
}
.loading-bar::after {
  content: '';
  position: absolute; top: 0; left: -55%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  animation: barScan 1.8s ease-in-out infinite;
}
.loading-bar:nth-child(2)::after { animation-duration: 1.4s; animation-delay: 0.3s; }
.loading-bar:nth-child(3)::after { animation-duration: 2.1s; animation-delay: 0.6s; opacity: 0.4; }
@keyframes barScan { to { left: 105%; } }

#loadingText {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.3);
  min-height: 18px;
  text-align: center;
}

.loading-dots { display: flex; gap: 8px; }
.loading-dot {
  width: 4px; height: 4px;
  background: var(--orange); border-radius: 50%;
  animation: dotBlink 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink { 0%,80%,100% { opacity: 0.15; transform: scale(0.75); } 40% { opacity: 1; transform: scale(1.2); } }

.loading-tagline {
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  color: rgba(255,102,0,0.4);
  font-style: italic;
}

/* ─────────────────── TOP BAR ─────────────────── */
#topBar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--bar-h); z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(0,0,0,0.97) 0%, rgba(0,0,0,0.75) 100%);
  border-bottom: 1px solid var(--border);
}

/* animated accent line */
#topBar::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--orange) 40%, transparent 100%);
  animation: accentSlide 5s ease-in-out infinite;
  opacity: 0.5;
}
@keyframes accentSlide { 0%,100% { opacity: 0.3; } 50% { opacity: 0.7; } }

/* LOGO */
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; user-select: none; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.22em; color: var(--white);
}
.logo-text span { color: var(--orange); }
.logo-sub {
  font-size: 0.42rem; letter-spacing: 0.3em;
  color: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2px 5px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  animation: liveBlink 1.6s ease-in-out infinite;
}
@keyframes liveBlink { 0%,100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

.bar-div { width: 1px; height: 26px; background: var(--border); flex-shrink: 0; }

/* SEARCH */
.search-wrap { display: flex; flex: 1; max-width: 400px; position: relative; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,0.2); font-size: 0.75rem; pointer-events: none; z-index: 1;
}
#searchInput {
  flex: 1; height: 32px;
  background: var(--white-05);
  border: 1px solid var(--border); border-right: none;
  color: var(--white); font-family: var(--font); font-size: 0.62rem;
  padding: 0 10px 0 28px; letter-spacing: 0.08em; outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
#searchInput::placeholder { color: rgba(255,255,255,0.18); }
#searchInput:focus {
  border-color: var(--orange);
  background: var(--orange-08);
  box-shadow: inset 0 0 16px var(--orange-08);
}
#searchBtn {
  height: 32px; padding: 0 16px;
  background: var(--orange); color: var(--black);
  border: 1px solid var(--orange);
  font-family: var(--font-display); font-size: 0.5rem; font-weight: 700;
  letter-spacing: 0.18em; cursor: pointer; white-space: nowrap;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
#searchBtn:hover { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 18px rgba(255,215,0,0.25); }
#searchBtn:active { transform: scale(0.96); }

/* MODE BADGE */
#modeBadge {
  font-family: var(--font-display); font-size: 0.48rem; font-weight: 700;
  letter-spacing: 0.22em; padding: 4px 10px;
  border: 1px solid; flex-shrink: 0;
  transition: all 0.3s var(--ease-out);
}
.mode-atlas  { border-color: var(--yellow-40); color: var(--yellow); background: var(--yellow-08); }
.mode-storm  { border-color: rgba(255,34,0,0.5); color: var(--red); background: var(--red-20); animation: stormPulse 0.9s ease-in-out infinite; }
.mode-transit{ border-color: var(--yellow-40); color: var(--yellow); background: var(--yellow-08); animation: transitPulse 1.4s ease-in-out infinite; }
@keyframes stormPulse   { 0%,100% { box-shadow: 0 0 8px rgba(255,34,0,0.4); } 50% { box-shadow: none; } }
@keyframes transitPulse { 0%,100% { box-shadow: 0 0 8px rgba(255,215,0,0.3); } 50% { box-shadow: none; } }

/* MODE BUTTONS */
.mode-wrap { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.mode-btn {
  height: 28px; padding: 0 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.3);
  font-family: var(--font-display); font-size: 0.48rem; font-weight: 700;
  letter-spacing: 0.18em; cursor: pointer;
  transition: all 0.2s var(--ease-out);
  clip-path: polygon(5px 0%, 100% 0%, calc(100% - 5px) 100%, 0% 100%);
}
.mode-btn:hover { border-color: var(--orange); color: var(--white); background: var(--orange-08); }
.mode-btn.active { border-color: var(--orange); color: var(--orange); background: var(--orange-15); box-shadow: 0 0 14px var(--orange-15); }

/* REFRESH BUTTON */
#refreshBtn {
  width: 30px; height: 30px;
  background: transparent; border: 1px solid var(--border);
  color: rgba(255,255,255,0.35); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
#refreshBtn:hover { border-color: var(--yellow); color: var(--yellow); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────── MODE DESCRIPTION BAR ─────────────────── */
#modeBar {
  position: fixed; top: var(--bar-h); left: 0; right: 0;
  height: 26px; z-index: 48;
  display: flex; align-items: center;
  padding: 0 18px; gap: 12px;
  background: rgba(0,0,0,0.8);
  border-bottom: 1px solid var(--border-faint);
}
#modeDesc {
  font-size: 0.48rem; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.22);
  transition: opacity 0.3s ease;
  flex: 1;
}
.ticker-wrap {
  display: flex; align-items: center; gap: 8px;
  flex: 1; overflow: hidden; justify-content: flex-end;
}
.ticker-label {
  font-size: 0.42rem; letter-spacing: 0.2em;
  color: var(--orange); opacity: 0.7; flex-shrink: 0;
}
#tickerText {
  font-size: 0.48rem; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ─────────────────── STATS BAR ─────────────────── */
#statsBar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--stat-h); z-index: 50;
  display: flex; align-items: center;
  background: linear-gradient(0deg, rgba(0,0,0,0.97), rgba(0,0,0,0.7));
  border-top: 1px solid var(--border);
}
#statsBar::before {
  content: '';
  position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--orange-60), transparent);
  opacity: 0.3;
  animation: accentSlide 7s ease-in-out infinite reverse;
}

.stat-seg {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px; height: 100%;
  border-right: 1px solid var(--border-faint);
  flex-shrink: 0;
}
.stat-seg:last-child { border-right: none; margin-left: auto; }

.stat-pip {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}
.pip-yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); animation: liveBlink 1.8s ease-in-out infinite; }
.pip-orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); animation: liveBlink 1.4s ease-in-out infinite; }

.stat-label { font-size: 0.46rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.28); }
.stat-value {
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.04em; line-height: 1;
}
.stat-seg.seg-flights .stat-value { color: var(--yellow); text-shadow: 0 0 10px rgba(255,215,0,0.4); }
.stat-seg.seg-threats .stat-value { color: var(--orange); text-shadow: 0 0 10px rgba(255,102,0,0.4); }
.stat-seg.seg-time    .stat-value { color: rgba(255,255,255,0.65); }
.stat-tag { font-size: 0.42rem; letter-spacing: 0.12em; color: rgba(255,102,0,0.35); }

/* ─────────────────── CORNER MARKS ─────────────────── */
.corner-mark {
  position: fixed; z-index: 5; width: 22px; height: 22px;
  opacity: 0.3; pointer-events: none;
  animation: cornerPulse 4s ease-in-out infinite;
}
.corner-mark.tl { top: 3px; left: 3px; border-top: 1px solid var(--orange); border-left: 1px solid var(--orange); }
.corner-mark.tr { top: 3px; right: 3px; border-top: 1px solid var(--orange); border-right: 1px solid var(--orange); }
.corner-mark.bl { bottom: 3px; left: 3px; border-bottom: 1px solid var(--orange); border-left: 1px solid var(--orange); }
.corner-mark.br { bottom: 3px; right: 3px; border-bottom: 1px solid var(--orange); border-right: 1px solid var(--orange); }
@keyframes cornerPulse { 0%,100% { opacity: 0.25; } 50% { opacity: 0.55; } }

/* ─────────────────── LEFT PANEL — DATA WIDGETS ─────────────────── */
#leftPanel {
  position: fixed;
  left: 18px;
  top: calc(var(--bar-h) + 26px + 16px);
  z-index: 10;
  display: flex; flex-direction: column; gap: 10px;
  width: 200px;
  pointer-events: none;
}

/* MINI STAT CARDS */
.mini-card {
  background: rgba(0,0,0,0.82);
  border: 1px solid var(--border-faint);
  border-left: 2px solid var(--orange);
  padding: 10px 14px;
  pointer-events: all;
  transition: border-color 0.2s, background 0.2s;
  position: relative; overflow: hidden;
}
.mini-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--orange-08), transparent 60%);
  pointer-events: none;
}
.mini-card:hover { background: rgba(0,0,0,0.92); border-color: var(--orange-30); }

.mini-card.yellow-card { border-left-color: var(--yellow); }
.mini-card.yellow-card::before { background: linear-gradient(135deg, var(--yellow-08), transparent 60%); }

.mini-card-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mini-card-icon { font-size: 0.7rem; opacity: 0.7; }
.mini-card-label { font-size: 0.46rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.35); flex: 1; }
.mini-card-value {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 900;
  letter-spacing: 0.02em; line-height: 1;
}
.yellow-card .mini-card-value { color: var(--yellow); }
.mini-card:not(.yellow-card) .mini-card-value { color: var(--orange); }
.mini-card-sub { font-size: 0.46rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.22); margin-top: 2px; }

/* LEGEND CARD */
.legend-card {
  background: rgba(0,0,0,0.82);
  border: 1px solid var(--border-faint);
  padding: 10px 14px;
  pointer-events: all;
}
.legend-card-title {
  font-family: var(--font-display); font-size: 0.44rem;
  letter-spacing: 0.25em; color: var(--orange);
  margin-bottom: 8px; opacity: 0.8;
}
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.legend-item:last-child { margin-bottom: 0; }
.legend-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 5px currentColor;
}
.legend-text { font-size: 0.5rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.4); }

/* CORRIDOR CARD */
.corridor-card {
  background: rgba(0,0,0,0.82);
  border: 1px solid var(--border-faint);
  padding: 10px 14px;
  pointer-events: all;
}
.corridor-card-title {
  font-family: var(--font-display); font-size: 0.44rem;
  letter-spacing: 0.25em; color: var(--yellow);
  margin-bottom: 8px; opacity: 0.8;
}
.corridor-item {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px; opacity: 0; transition: opacity 0.3s, transform 0.3s;
}
.corridor-item:last-child { margin-bottom: 0; }
.corridor-name { font-size: 0.5rem; letter-spacing: 0.06em; color: rgba(255,255,255,0.45); min-width: 72px; }
.corridor-bar-wrap { flex: 1; height: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.corridor-bar { height: 100%; background: var(--yellow); opacity: 0.6; transition: width 0.8s var(--ease-out); }
.corridor-count { font-size: 0.5rem; color: var(--yellow); opacity: 0.7; min-width: 20px; text-align: right; }

/* KEY HINTS */
.keys-card {
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--border-faint);
  padding: 8px 14px; pointer-events: all;
}
.keys-card-title {
  font-family: var(--font-display); font-size: 0.42rem;
  letter-spacing: 0.2em; color: rgba(255,255,255,0.25); margin-bottom: 6px;
}
.key-row { display: flex; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.key-item { display: flex; align-items: center; gap: 5px; }
.key-badge {
  font-size: 0.4rem; letter-spacing: 0.05em;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 1px 5px; color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.03);
}
.key-desc { font-size: 0.44rem; letter-spacing: 0.08em; color: rgba(255,255,255,0.2); }

/* ─────────────────── INTEL PANEL ─────────────────── */
#intelPanel {
  position: fixed;
  top: 0; right: calc(-1 * var(--panel-w) - 4px);
  width: var(--panel-w); height: 100%;
  z-index: 60;
  background: var(--panel-bg);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: right 0.5s var(--ease-out);
  overflow: hidden;
}
/* grid texture */
#intelPanel::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,102,0,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,102,0,0.012) 1px, transparent 1px);
  background-size: 44px 44px;
}
/* left accent stripe */
#intelPanel::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 2px; height: 100%;
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-30) 50%, transparent 100%);
  z-index: 1;
}
#intelPanel.open { right: 0; }

/* PANEL HEADER */
.intel-header {
  padding: 22px 20px 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255,102,0,0.07) 0%, transparent 100%);
  position: relative; z-index: 1;
}
.intel-chip {
  font-family: var(--font-display); font-size: 0.42rem;
  letter-spacing: 0.3em; color: var(--orange);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.intel-chip-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  animation: liveBlink 1.4s ease-in-out infinite;
}

.intel-header-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px; margin-bottom: 12px;
}

#intelCountry {
  font-family: var(--font-display); font-size: 1.15rem;
  font-weight: 700; letter-spacing: 0.08em;
  color: var(--white); line-height: 1.2;
}
#intelCoords {
  font-size: 0.52rem; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3); margin-top: 5px;
}

.intel-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#intelClose {
  background: none; border: 1px solid var(--border);
  color: rgba(255,255,255,0.35); font-family: var(--font); font-size: 0.52rem;
  padding: 4px 12px; cursor: pointer; letter-spacing: 0.1em;
  transition: all 0.2s; white-space: nowrap;
}
#intelClose:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-08); }

/* Severity ring */
#intelRing {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  transition: border-color 0.4s, box-shadow 0.4s;
  position: relative;
}
#intelRing::before {
  content: '';
  position: absolute; inset: 4px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.06);
}
.ring-val { font-family: var(--font-display); font-size: 1.05rem; font-weight: 900; color: var(--orange); line-height: 1; }
.ring-lbl { font-size: 0.38rem; letter-spacing: 0.12em; color: rgba(255,255,255,0.28); }

/* Meta row */
.intel-meta { display: flex; gap: 0; border-top: 1px solid var(--border-faint); padding-top: 10px; }
.intel-meta-seg {
  flex: 1; display: flex; flex-direction: column; gap: 3px;
  padding-right: 12px; border-right: 1px solid var(--border-faint);
  margin-right: 12px;
}
.intel-meta-seg:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.intel-meta-key { font-size: 0.42rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.25); }
.intel-meta-val { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; color: var(--white); }

/* PANEL BODY */
.intel-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 20px;
  position: relative; z-index: 1;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.intel-body::-webkit-scrollbar { width: 2px; }
.intel-body::-webkit-scrollbar-thumb { background: var(--border); }

.intel-section { display: flex; flex-direction: column; gap: 8px; }
.section-header {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 7px; border-bottom: 1px solid var(--border-faint);
}
.section-icon { font-size: 0.75rem; opacity: 0.7; flex-shrink: 0; }
.section-title {
  font-family: var(--font-display); font-size: 0.5rem;
  letter-spacing: 0.22em; color: var(--orange); flex: 1; text-transform: uppercase;
}
.section-badge {
  font-family: var(--font-display); font-size: 0.48rem; font-weight: 700;
  background: var(--orange-15); color: var(--orange);
  border: 1px solid var(--border); padding: 2px 7px;
  min-width: 24px; text-align: center;
}

/* FLIGHT CARDS */
.flight-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--yellow-08);
  border: 1px solid rgba(255,215,0,0.1);
  border-left: 2px solid rgba(255,215,0,0.45);
  transition: background 0.15s, border-color 0.15s;
  cursor: default;
  opacity: 0;
}
.flight-card:hover { background: var(--yellow-15); border-color: rgba(255,215,0,0.35); }
.flight-card-left { flex-shrink: 0; }
.flight-callsign {
  font-family: var(--font-display); font-size: 0.7rem; font-weight: 700;
  color: var(--yellow); letter-spacing: 0.06em;
}
.flight-icao { font-size: 0.44rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.25); margin-top: 2px; }
.flight-card-stats { display: flex; gap: 10px; flex: 1; justify-content: flex-end; }
.flight-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fstat-label { font-size: 0.4rem; letter-spacing: 0.15em; color: rgba(255,255,255,0.25); }
.fstat-val { font-family: var(--font-display); font-size: 0.6rem; color: rgba(255,255,255,0.7); }
.flight-dir-arrow { font-size: 0.7rem; color: var(--yellow); opacity: 0.5; flex-shrink: 0; transition: transform 0.3s; }

/* THREAT CARDS */
.threat-card {
  padding: 11px 13px;
  background: var(--orange-08);
  border: 1px solid var(--border);
  border-left: 2px solid var(--orange);
  display: flex; flex-direction: column; gap: 7px;
  opacity: 0;
  position: relative; overflow: hidden;
}
.threat-card.critical { border-left-color: var(--red); background: var(--red-20); }
.threat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 30%; height: 100%;
  background: linear-gradient(to left, rgba(255,102,0,0.04), transparent);
  pointer-events: none;
}
.threat-card-header { display: flex; align-items: center; gap: 8px; }
.threat-type-badge {
  font-size: 0.5rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 2px 8px; border: 1px solid; border-radius: 0;
}
.threat-sev-num { font-family: var(--font-display); font-size: 0.6rem; font-weight: 700; margin-left: auto; }
.threat-bar-wrap { width: 100%; height: 2px; background: rgba(255,255,255,0.05); overflow: hidden; }
.threat-bar-fill { height: 100%; transition: width 0.8s var(--ease-out); }
.threat-desc { font-size: 0.58rem; color: rgba(255,255,255,0.5); line-height: 1.6; letter-spacing: 0.03em; }
.threat-iocs { font-size: 0.46rem; letter-spacing: 0.12em; color: rgba(255,255,255,0.22); }

/* NEWS CARDS */
.news-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: var(--white-05);
  border: 1px solid var(--border-faint);
  border-left: 2px solid rgba(255,255,255,0.1);
  text-decoration: none; color: inherit;
  transition: all 0.2s var(--ease-out);
  opacity: 0;
}
.news-card:hover { background: rgba(255,255,255,0.07); border-left-color: var(--orange); }
.news-card-num {
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 900;
  color: rgba(255,255,255,0.08); flex-shrink: 0; line-height: 1.2;
}
.news-card-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.news-card-title { font-size: 0.62rem; line-height: 1.55; color: rgba(255,255,255,0.75); letter-spacing: 0.02em; }
.news-card:hover .news-card-title { color: var(--white); }
.news-card-meta { display: flex; gap: 8px; align-items: center; }
.news-card-time { font-size: 0.46rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.22); }
.news-card-src  { font-size: 0.46rem; letter-spacing: 0.1em; color: rgba(255,102,0,0.5); }
.news-card-arrow { font-size: 0.9rem; color: rgba(255,255,255,0.15); flex-shrink: 0; transition: color 0.2s, transform 0.2s; }
.news-card:hover .news-card-arrow { color: var(--orange); transform: translate(2px, -2px); }

/* EMPTY STATE */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px; text-align: center;
}
.empty-icon { font-size: 1.4rem; opacity: 0.2; }
.empty-msg { font-size: 0.55rem; letter-spacing: 0.15em; color: rgba(255,255,255,0.18); }

/* ─────────────────── SEARCH RESULTS ─────────────────── */
#searchResults {
  position: fixed;
  top: calc(var(--bar-h) + 26px + 6px);
  left: 50%; transform: translateX(-50%);
  width: 400px; z-index: 55;
  background: rgba(3,3,3,0.98);
  border: 1px solid var(--border);
  display: none; flex-direction: column;
  max-height: 300px; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.8), 0 0 24px var(--orange-08);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
#searchResults.visible { display: flex; animation: srIn 0.2s var(--ease-out); }
@keyframes srIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.sr-header {
  font-family: var(--font-display); font-size: 0.42rem; letter-spacing: 0.28em;
  color: var(--orange); padding: 8px 14px 6px;
  border-bottom: 1px solid var(--border-faint);
  background: var(--orange-08); flex-shrink: 0;
}
.sr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border-faint);
  cursor: pointer; transition: background 0.12s;
  opacity: 0;
}
.sr-item:hover { background: var(--orange-08); }
.sr-item:last-child { border-bottom: none; }
.sr-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 5px var(--yellow); flex-shrink: 0; }
.sr-callsign { font-family: var(--font-display); font-size: 0.68rem; color: var(--yellow); letter-spacing: 0.06em; min-width: 80px; }
.sr-detail { font-size: 0.52rem; color: rgba(255,255,255,0.3); letter-spacing: 0.05em; flex: 1; }
.sr-arrow { font-size: 0.7rem; color: rgba(255,255,255,0.2); }
.sr-empty { padding: 16px 14px; font-size: 0.58rem; color: rgba(255,255,255,0.22); letter-spacing: 0.15em; text-align: center; }

/* ─────────────────── TOAST ─────────────────── */
#toast {
  position: fixed; top: calc(var(--bar-h) + 26px + 10px); right: 18px;
  z-index: 80;
  background: rgba(4,4,4,0.97);
  border: 1px solid var(--border); border-left: 3px solid var(--orange);
  padding: 10px 16px;
  font-size: 0.58rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.8);
  display: none; min-width: 240px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7);
  transition: border-left-color 0.2s;
}
#toast.visible { display: block; animation: toastIn 0.3s var(--ease-out); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }

/* ─────────────────── LIVE FEED PANEL ─────────────────── */
#feedPanel {
  position: fixed;
  bottom: var(--stat-h);
  right: 0;
  width: 360px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(2,2,2,0.96);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  transition: height 0.35s var(--ease-out);
  height: 300px;
  max-height: 300px;
}
#feedPanel.collapsed { height: 34px; max-height: 34px; overflow: hidden; }

#feedPanel::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 2px; height: 100%;
  background: linear-gradient(180deg, var(--orange), transparent);
  z-index: 1;
}

.feed-header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  height: 34px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-faint);
  background: rgba(0,0,0,0.6);
  position: relative; z-index: 2;
}
.feed-header-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 6px var(--orange);
  animation: liveBlink 1.4s ease-in-out infinite; flex-shrink: 0;
}
.feed-header-title {
  font-family: var(--font-display); font-size: 0.46rem;
  letter-spacing: 0.25em; color: var(--orange); flex: 1;
}
.feed-header-count {
  font-family: var(--font-display); font-size: 0.5rem;
  color: rgba(255,255,255,0.25); letter-spacing: 0.1em;
}
#feedToggle {
  background: none; border: none;
  color: rgba(255,255,255,0.3); font-size: 0.6rem;
  cursor: pointer; padding: 0 4px;
  transition: color 0.2s; line-height: 1;
}
#feedToggle:hover { color: var(--orange); }

#feedList {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  padding: 4px 0;
}
#feedList::-webkit-scrollbar { width: 2px; }
#feedList::-webkit-scrollbar-thumb { background: var(--border); }

.feed-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 5px 12px 5px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
  cursor: default;
  flex-shrink: 0;
}
.feed-item:hover { background: rgba(255,255,255,0.025); }

/* Left colour bar */
.feed-item::before {
  content: '';
  position: absolute; left: 0;
  width: 2px; height: 100%;
  opacity: 0;
}

.feed-time {
  font-size: 0.46rem; letter-spacing: 0.05em;
  color: rgba(255,255,255,0.2);
  white-space: nowrap; flex-shrink: 0;
  padding-top: 1px;
  font-family: var(--font);
}

.feed-msg {
  font-size: 0.54rem; letter-spacing: 0.04em;
  line-height: 1.55; word-break: break-word;
}

/* Type colouring */
.feed-flight .feed-msg  { color: rgba(255,215,0,0.85); }
.feed-threat .feed-msg  { color: rgba(255,102,0,0.9); }
.feed-news   .feed-msg  { color: rgba(255,255,255,0.55); }
.feed-system .feed-msg  { color: rgba(255,255,255,0.3); }

.feed-flight { border-left: 1px solid rgba(255,215,0,0.15); }
.feed-threat { border-left: 1px solid rgba(255,102,0,0.25); background: rgba(255,102,0,0.025); }
.feed-news   { border-left: 1px solid rgba(255,255,255,0.06); }
.feed-system { border-left: 1px solid rgba(255,255,255,0.04); }

/* ─────────────────── ANIMATION HELPER ─────────────────── */
.anim-pulse { animation: elemPulse 0.5s ease; }
@keyframes elemPulse { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ─────────────────── SCROLLBAR ─────────────────── */
::-webkit-scrollbar { width: 2px; height: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 1px; }
::selection { background: var(--orange-30); color: var(--orange); }

/* ─────────────────── UTIL ─────────────────── */
.hidden { display: none !important; }

/* Feed panel shifts left when intel panel opens */
#intelPanel.open ~ #feedPanel,
body.intel-open #feedPanel {
  right: var(--panel-w);
  transition: right 0.45s var(--ease-out), height 0.35s var(--ease-out);
}

/* ─────────────────── RESPONSIVE ─────────────────── */
@media (max-width: 768px) {
  :root { --panel-w: 100vw; }
  #topBar { padding: 0 10px; gap: 8px; }
  .logo-sub, #modeBadge, .mode-wrap, #refreshBtn { display: none; }
  .search-wrap { max-width: 200px; }
  #leftPanel { display: none; }
  #modeBar { display: none; }
  #feedPanel { width: 100%; }
}
