/* ============================================================
   Tier 1 - primitives (raw palette, theme-independent)
   ============================================================ */
:root {
  /* OU crimson family */
  --p-crimson-400: #d2596a; /* bright - for text/lines on dark */
  --p-crimson-500: #a81f32;
  --p-crimson-600: #841617; /* official OU crimson */
  --p-crimson-700: #5c0d12; /* deep maroon */
  --p-cream: #fdf9d8;
  --p-indigo-400: #818cf8;
  --p-teal-400: #2dd4bf;
  --p-teal-500: #14b8a6;
  --p-green-400: #34d399;
  --p-amber-400: #fbbf24;
  --p-amber-500: #f5a524;
  --p-orange-400: #fb923c;
  --p-red-400: #f87171;
  --p-red-600: #dc2626;
  --p-white: #ffffff;

  --font-body: "Fira Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-sm: 11px;
  --rail-w: 90px;

  /* density (tier 1, overridden by [data-density]) */
  --pad-card: 18px 20px;
  --pad-cell: 14px 20px;
  --kpi-size: 25px;
}

/* ============================================================
   Tier 2 - semantic tokens (DARK is the designed default)
   ============================================================ */
:root,
:root[data-theme="dark"] {
  --bg: #111b29;
  --surface: #1a2636;
  --surface-2: #213044;
  --surface-3: #2a3c54;
  --rail: #0c1320;
  --rail-2: #141f30;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef3fa;
  --muted: #9fadc2;
  --faint: #748399;
  --accent: var(--p-crimson-600);
  --accent-2: var(--p-crimson-400);
  --accent-soft: rgba(210, 89, 106, 0.16);
  --accent-line: rgba(210, 89, 106, 0.42);
  --amber: var(--p-amber-500);
  --ok: var(--p-green-400);
  --ok-soft: rgba(52, 211, 153, 0.14);
  --warn: var(--p-amber-400);
  --warn-soft: rgba(251, 191, 36, 0.14);
  --alert: var(--p-red-400);
  --alert-soft: rgba(248, 113, 113, 0.16);
  --site: var(--p-indigo-400);
  --source: var(--p-teal-400);
  --on-fill: #ffffff;
  --field-bg: rgba(255, 255, 255, 0.05);
  --raise: rgba(255, 255, 255, 0.045);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
  --glow: 0 0 0 1px rgba(210, 89, 106, 0.38), 0 0 24px rgba(210, 89, 106, 0.2);
  --scrim: rgba(2, 5, 10, 0.6);
  --topbar-bg: rgba(8, 13, 21, 0.72);
}

/* ---- LIGHT theme (semantic remap; rail/map stay dark) ---- */
:root[data-theme="light"] {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef2f7;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #16202e;
  --muted: #566174;
  --faint: #8a94a4;
  --accent: var(--p-crimson-600);
  --accent-2: var(--p-crimson-600);
  --accent-soft: rgba(132, 22, 23, 0.1);
  --accent-line: rgba(132, 22, 23, 0.3);
  --amber: #c47914;
  --ok: #1f9d74;
  --ok-soft: rgba(31, 157, 116, 0.14);
  --warn: #b9770f;
  --warn-soft: rgba(196, 121, 20, 0.16);
  --alert: #d4351c;
  --alert-soft: rgba(212, 53, 28, 0.12);
  --site: #6366f1;
  --source: var(--p-teal-500);
  --field-bg: #ffffff;
  --raise: #f6f8fb;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 14px 40px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 30px 70px rgba(15, 23, 42, 0.2);
  --glow: 0 0 0 1px rgba(132, 22, 23, 0.3), 0 0 18px rgba(132, 22, 23, 0.14);
  --scrim: rgba(15, 23, 42, 0.4);
  --topbar-bg: rgba(255, 255, 255, 0.85);
}

/* ---- compact density ---- */
:root[data-density="compact"] {
  --pad-card: 12px 14px;
  --pad-cell: 9px 14px;
  --kpi-size: 21px;
  --radius: 13px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100dvh;
}

body {
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 78% -8%, var(--accent-soft), transparent 60%),
    var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.muted {
  color: var(--muted);
}

/* ---------- shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100dvh;
  padding: 18px 12px;
  background: linear-gradient(180deg, var(--rail-2), var(--rail));
  border-right: 1px solid var(--border);
  color: #95a3b8;
}

.rail-brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 52px;
  margin-bottom: 16px;
}

.brand-ou {
  width: 40px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(92, 13, 18, 0.55));
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.rail-btn {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 13px 6px;
  color: #95a3b8;
  background: transparent;
  border: 0;
  border-radius: 13px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.rail-btn svg {
  width: 22px;
  height: 22px;
}

.rail-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.rail-btn.is-active {
  color: #fff;
  background: linear-gradient(160deg, rgba(168, 31, 50, 0.42), rgba(132, 22, 23, 0.18));
  box-shadow: inset 0 0 0 1px rgba(210, 89, 106, 0.45);
}

.rail-btn.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 3px;
  height: 26px;
  background: var(--p-crimson-400);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  box-shadow: 0 0 12px var(--p-crimson-400);
}

.rail-foot {
  margin-top: auto;
}

.rail-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--p-crimson-500), var(--p-crimson-700));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 16px 26px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.topbar-title {
  display: flex;
  gap: 13px;
  align-items: center;
}

.topbar-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
}

.topbar-icon svg {
  width: 22px;
  height: 22px;
}

.topbar-title h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.tab {
  padding: 8px 18px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(160deg, var(--p-crimson-500), var(--p-crimson-700));
  box-shadow: var(--shadow-sm);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search:focus-within {
  border-color: var(--accent-line);
  box-shadow: var(--glow);
}

.search svg {
  width: 16px;
  height: 16px;
  color: var(--faint);
  flex: none;
}

.search input {
  width: 190px;
  border: 0;
  background: transparent;
  outline: none;
}

.search input::placeholder {
  color: var(--faint);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn.ghost {
  color: var(--text);
  background: var(--field-bg);
  border-color: var(--border-strong);
}

.btn.ghost:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.btn.icon-only {
  width: 40px;
  padding: 0;
  color: var(--muted);
  background: var(--field-bg);
  border-color: var(--border-strong);
}

.btn.icon-only:hover {
  color: var(--text);
  border-color: var(--accent-line);
}

.btn.icon-only svg {
  width: 18px;
  height: 18px;
}

.btn.mini {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

/* ---------- views ---------- */
.view-area {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 26px 56px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.tabpanel {
  display: grid;
  gap: 18px;
}

/* ---------- filter bar ---------- */
.filter-bar {
  display: grid;
  grid-template-columns: 180px 170px auto minmax(200px, 1fr);
  gap: 18px;
  align-items: end;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.field {
  display: grid;
  gap: 8px;
}

.sat-selects {
  display: flex;
  gap: 8px;
}

.sat-selects select {
  min-width: 0;
}

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

select,
input[type="search"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select option {
  color: var(--text);
  background: var(--surface-2);
}

select:focus,
input:focus {
  border-color: var(--accent-line);
  box-shadow: var(--glow);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-field span {
  color: var(--accent-2);
  font-weight: 600;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ---------- kpi strip (chips) ---------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.chip {
  display: grid;
  gap: 5px;
  padding: var(--pad-card);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.chip strong {
  font-family: var(--font-mono);
  font-size: var(--kpi-size);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- kpi cards (recon/report) ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi {
  position: relative;
  display: grid;
  gap: 7px;
  padding: var(--pad-card);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
}

.kpi strong {
  font-family: var(--font-mono);
  font-size: var(--kpi-size);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kpi-meta {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 17px 22px;
  background: var(--raise);
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.panel-head-tools {
  display: flex;
  gap: 18px;
  align-items: center;
}

.zoom-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.pill {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ---------- globe ---------- */
.legend {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.legend-ramp {
  width: 120px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #facc15, #fb923c, #f87171);
}

.globe-frame {
  position: relative;
  height: min(62dvh, 600px);
  min-height: 420px;
  background: #0a1422;
}

#cesiumContainer {
  width: 100%;
  height: 100%;
}

.cesium-viewer-bottom,
.cesium-credit-logoContainer,
.cesium-widget-credits {
  display: none !important;
}

.map-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(6, 12, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.map-controls-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9fb0c6;
}

.map-controls label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #e8eef7;
  cursor: pointer;
}

.globe-skeleton {
  position: absolute;
  inset: 0;
  z-index: 6;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 70%),
    #0a1422;
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.map-fallback {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 5;
  max-width: 520px;
  padding: 11px 14px;
  color: #f4f8ff;
  background: rgba(6, 12, 22, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  font-size: 13px;
}

.map-fallback.is-hidden {
  display: none;
}

/* ---------- tables ---------- */
.table-wrap {
  max-height: 460px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--pad-cell);
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}

td {
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  cursor: pointer;
  transition: background-color 130ms ease;
}

tbody tr:hover,
tbody tr:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

tbody tr.is-selected {
  background: var(--accent-soft);
}

tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--accent-2);
}

td .sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

#assetTable td:nth-child(4),
#assetTable td:nth-child(5),
#reconTable td:nth-child(3),
#reconTable td:nth-child(4) {
  font-family: var(--font-mono);
  text-align: right;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  font-family: var(--font-mono);
  background: var(--field-bg);
  border-radius: 9px;
  font-weight: 600;
}

.count-alert {
  color: var(--alert);
  background: var(--alert-soft);
}

.obs-cell {
  min-width: 210px;
}

.obs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-size: 12px;
  color: var(--muted);
}

.obs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.obs-satellite {
  background: var(--site);
}

.obs-aircraft {
  background: var(--source);
}

.obs-drone {
  background: var(--source);
}

.obs-ground {
  background: var(--amber);
}

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.badge-normal {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: rgba(52, 211, 153, 0.3);
}

.badge-elevated {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(251, 191, 36, 0.3);
}

.badge-flagged {
  color: var(--alert);
  background: var(--alert-soft);
  border-color: rgba(248, 113, 113, 0.35);
}

.badge-muted {
  color: var(--muted);
  background: var(--field-bg);
  border-color: var(--border-strong);
}

/* ---------- chart ---------- */
.chart-shell {
  padding: 20px 22px;
}

#trendChart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--accent-2);
  stroke-width: 2;
}

.chart-label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ---------- detail drawer ---------- */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--scrim);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.drawer-scrim.is-open {
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(760px, 94vw);
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 20px 24px;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  height: 36px;
  padding: 0 13px;
}

.drawer-id h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.drawer-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.drawer-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.drawer-kpis div {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  background: var(--raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.drawer-kpis strong {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
}

/* timeline */
.drawer-timeline {
  border-bottom: 1px solid var(--border);
}

.timeline-shell {
  padding: 6px 18px 0;
}

#eventTimeline {
  display: block;
  width: 100%;
  height: auto;
}

.timeline-axis {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.timeline-stem {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.timeline-node {
  cursor: pointer;
}

.timeline-hit {
  fill: transparent;
}

.timeline-dot {
  stroke: var(--surface);
  stroke-width: 2;
  transition: r 120ms ease;
}

.tl-open {
  fill: var(--alert);
}

.tl-in-progress {
  fill: var(--warn);
}

.tl-closed {
  fill: var(--ok);
}

.tl-false-alarm {
  fill: var(--faint);
}

.timeline-node.is-active .timeline-dot {
  stroke: var(--accent-2);
  stroke-width: 3;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px 18px;
}

.status-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 6px 12px;
  color: var(--muted);
  background: var(--field-bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.status-chip span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

.status-chip:hover {
  color: var(--text);
  border-color: var(--accent-line);
}

.status-chip.is-active {
  color: var(--on-fill);
  background: var(--accent);
  border-color: var(--accent);
}

.status-chip.is-active span {
  color: rgba(255, 255, 255, 0.8);
}

.drawer-body {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  flex: 1;
  min-height: 0;
}

.drawer-events {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
}

.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.event-list {
  overflow: auto;
}

.event-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 15px 20px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 130ms ease;
}

.event-row:hover {
  background: var(--raise);
}

.event-row.is-active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.event-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.event-row-stats {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.event-detail {
  padding: 20px 24px;
  overflow: auto;
}

.event-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.event-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px;
  background: var(--raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.event-flow div {
  display: grid;
  gap: 4px;
}

.event-flow strong {
  font-family: var(--font-mono);
  font-size: 14px;
}

.event-flow-mid {
  text-align: center;
  color: var(--accent-2);
}

.event-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.event-stats div {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  background: var(--raise);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.event-stats strong {
  font-family: var(--font-mono);
  font-size: 16px;
}

.event-obs {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.event-obs p:not(.eyebrow) {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
  font-size: 13px;
  color: var(--muted);
}

.plume-thumb {
  display: block;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.plume-thumb:hover {
  border-color: var(--accent, #818cf8);
  transform: translateY(-1px);
}

.plume-thumb img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* ---------- bars (reconciliation + reporting) ---------- */
.bar-board {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.bar-line {
  display: grid;
  grid-template-columns: minmax(120px, 230px) 1fr auto;
  gap: 16px;
  align-items: center;
  font-size: 13px;
}

.bar-line-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  background: var(--field-bg);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.bar-line-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.bar-pair {
  display: grid;
  gap: 5px;
  min-width: 160px;
}

.bar {
  display: block;
  height: 9px;
  border-radius: 999px;
}

.bar-site {
  background: var(--site);
}

.bar-source {
  background: var(--source);
}

.delta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ok);
}

.delta-alert {
  color: var(--alert);
}

.bar-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.bar-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.swatch-site {
  background: var(--site);
}

.swatch-source {
  background: var(--source);
}

/* ---------- mission ---------- */
.mission-hero {
  padding: 48px 40px;
  background:
    radial-gradient(700px 320px at 85% -20%, var(--accent-soft), transparent 60%),
    var(--surface);
}

.ou-tag {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  padding: 7px 14px 7px 8px;
  background: var(--field-bg);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ou-tag-mark {
  width: 22px;
  height: auto;
  display: block;
}

.mission-hero h1 {
  max-width: 780px;
  margin: 16px 0 18px;
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 700px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

.mission-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.mission-metrics div {
  display: grid;
  gap: 8px;
  padding: 20px;
  background: var(--raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mission-metrics strong {
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
}

.mission-block {
  margin-top: 18px;
  padding-bottom: 8px;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 22px;
}

.mission-grid.method {
  grid-template-columns: repeat(4, 1fr);
}

.mission-grid article {
  display: grid;
  gap: 11px;
  align-content: start;
  padding: 20px;
  background: var(--raise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mission-grid h3 {
  font-size: 16px;
  font-weight: 600;
}

.mission-grid p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.method-index {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mission-grid,
  .mission-grid.method,
  .mission-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  :root {
    --rail-w: 74px;
  }
  .rail-btn span {
    display: none;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .topbar-actions {
    margin-left: auto;
  }
  .drawer-body {
    grid-template-columns: 1fr;
  }
  .drawer-events {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .panel-head-tools {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .view-area {
    padding: 16px 14px 40px;
  }
  .kpi-strip,
  .kpi-row,
  .filter-bar,
  .drawer-kpis,
  .mission-grid,
  .mission-grid.method,
  .mission-metrics {
    grid-template-columns: 1fr;
  }
  .search input {
    width: 110px;
  }
  .bar-line {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .bar-line-value {
    text-align: left;
  }
}

/* ============================================================
   Tier 4 - motion system + micro-interactions
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.82); }
  60% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes grow-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

@keyframes dot-in {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes ramp-flow {
  to { background-position: 200% 0; }
}

@keyframes aurora-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4%, 3%, 0) scale(1.12); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- ambient aurora background ---- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.aurora::before {
  top: -22vw;
  right: -14vw;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  animation: aurora-drift 22s ease-in-out infinite;
}

.aurora::after {
  bottom: -26vw;
  left: -18vw;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.16), transparent 68%);
  animation: aurora-drift 28s ease-in-out infinite reverse;
}

:root[data-theme="light"] .aurora::before,
:root[data-theme="light"] .aurora::after {
  opacity: 0.7;
}

/* ---- entrance utilities (JS-triggered, replayable) ---- */
.anim-rise {
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--d, 0ms);
}

tbody.anim-rows tr {
  animation: rise 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
tbody.anim-rows tr:nth-child(1) { animation-delay: 20ms; }
tbody.anim-rows tr:nth-child(2) { animation-delay: 55ms; }
tbody.anim-rows tr:nth-child(3) { animation-delay: 90ms; }
tbody.anim-rows tr:nth-child(4) { animation-delay: 125ms; }
tbody.anim-rows tr:nth-child(5) { animation-delay: 160ms; }
tbody.anim-rows tr:nth-child(6) { animation-delay: 195ms; }
tbody.anim-rows tr:nth-child(7) { animation-delay: 230ms; }
tbody.anim-rows tr:nth-child(8) { animation-delay: 265ms; }
tbody.anim-rows tr:nth-child(n + 9) { animation-delay: 300ms; }

/* ---- live status tag ---- */
.live-tag {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  align-self: center;
  margin-left: 4px;
  padding: 5px 11px 5px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 999px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  animation: live-pulse 2s ease-out infinite;
}

/* ---- card hover lift ---- */
.chip,
.kpi,
.mission-metrics div,
.mission-grid article {
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 200ms ease, border-color 200ms ease;
  will-change: transform;
}

.chip:hover,
.kpi:hover,
.mission-metrics div:hover,
.mission-grid article:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
}

.chip strong,
.kpi strong {
  font-variant-numeric: tabular-nums;
}

/* sheen sweep on KPI cards */
.kpi {
  isolation: isolate;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.07) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform 700ms ease;
  pointer-events: none;
}

.kpi:hover::before {
  transform: translateX(120%);
}

/* ---- panel reveal on hover ---- */
.panel {
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

/* ---- rail interactions ---- */
.rail-btn {
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.rail-btn:active {
  transform: scale(0.94);
}

.rail-btn svg {
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rail-btn:hover svg {
  transform: translateY(-2px) scale(1.08);
}

.rail-btn.is-active svg {
  animation: pop-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rail-btn.is-active::before {
  animation: rise 0.3s ease both;
}

/* ---- button shine + press ---- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn.icon-only svg {
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#themeToggle:hover svg {
  transform: rotate(-22deg) scale(1.08);
}

#densityToggle:hover svg {
  transform: scaleY(0.8);
}

/* ---- tabs ---- */
.tab {
  transition: background-color 200ms ease, color 200ms ease, transform 160ms ease;
}

.tab:active {
  transform: scale(0.96);
}

.tab.is-active {
  animation: pop-in 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---- animated legend ramp ---- */
.legend-ramp {
  background: linear-gradient(90deg, #34d399, #facc15, #fb923c, #f87171, #34d399);
  background-size: 200% 100%;
  animation: ramp-flow 6s linear infinite;
}

/* ---- pills / badges / counts ---- */
.pill,
.badge {
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.count-alert {
  animation: pop-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.status-chip:active {
  transform: scale(0.95);
}

/* ---- table row affordance ---- */
tbody tr {
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

tbody tr:hover {
  transform: translateX(2px);
}

/* ---- bars: grow on render ---- */
.bar-fill,
.bar {
  transform-origin: left center;
  animation: grow-x 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.bar-board .bar-line:nth-child(1) .bar-fill { animation-delay: 40ms; }
.bar-board .bar-line:nth-child(2) .bar-fill { animation-delay: 90ms; }
.bar-board .bar-line:nth-child(3) .bar-fill { animation-delay: 140ms; }
.bar-board .bar-line:nth-child(4) .bar-fill { animation-delay: 190ms; }
.bar-board .bar-line:nth-child(5) .bar-fill { animation-delay: 240ms; }
.bar-board .bar-line:nth-child(6) .bar-fill { animation-delay: 290ms; }
.bar-board .bar-line:nth-child(n + 7) .bar-fill { animation-delay: 330ms; }

.bar-track {
  position: relative;
  overflow: hidden;
}

.bar-fill {
  position: relative;
}

.bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.28) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: bar-sheen 2.4s ease-in-out 0.7s infinite;
}

@keyframes bar-sheen {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(220%); }
}

/* ---- chart line draw + dots ---- */
.chart-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-line 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.chart-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: dot-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ---- timeline pop ---- */
.timeline-node {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.timeline-node:nth-child(2) { animation-delay: 40ms; }
.timeline-node:nth-child(3) { animation-delay: 80ms; }
.timeline-node:nth-child(4) { animation-delay: 120ms; }
.timeline-node:nth-child(5) { animation-delay: 160ms; }
.timeline-node:nth-child(n + 6) { animation-delay: 200ms; }

.timeline-dot {
  transition: r 160ms cubic-bezier(0.2, 0.8, 0.2, 1), stroke-width 160ms ease;
}

.timeline-node:hover .timeline-dot {
  r: 9;
}

/* ---- drawer content stagger ---- */
.detail-drawer.is-open .drawer-head { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.06s; }
.detail-drawer.is-open .drawer-kpis { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.12s; }
.detail-drawer.is-open .drawer-timeline { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.18s; }
.detail-drawer.is-open .drawer-body { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.24s; }

.drawer-kpis div {
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.drawer-kpis div:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
}

.event-row {
  transition: background-color 130ms ease, box-shadow 130ms ease, padding-left 160ms ease;
}

.event-row:hover {
  padding-left: 24px;
}

/* ---- method index spin-ready ---- */
.method-index {
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 220ms ease;
}

.mission-grid article:hover .method-index {
  transform: rotate(360deg);
  background: var(--accent);
  color: #fff;
}

/* ---- topbar icon ---- */
.topbar-icon {
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease;
}

.topbar-icon:hover {
  transform: translateY(-1px) rotate(-4deg);
  box-shadow: var(--glow);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .globe-skeleton,
  .aurora::before,
  .aurora::after,
  .legend-ramp,
  .live-dot,
  .bar-fill::after {
    animation: none !important;
  }
  .chart-line {
    stroke-dashoffset: 0;
  }
  .chip:hover,
  .kpi:hover,
  .mission-metrics div:hover,
  .mission-grid article:hover,
  tbody tr:hover {
    transform: none;
  }
}

/* ============================================================
   OU maroon topbar (theme-independent crimson treatment)
   ============================================================ */
.topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 42%),
    linear-gradient(135deg, var(--p-crimson-600) 0%, var(--p-crimson-700) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.32);
  box-shadow: 0 8px 26px rgba(92, 13, 18, 0.38);
}

.topbar h1 {
  color: #fff;
}

.topbar .eyebrow {
  color: rgba(253, 249, 216, 0.82);
}

.topbar-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.topbar-icon:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 20px rgba(0, 0, 0, 0.25);
}

.topbar .tabs {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.18);
}

.topbar .tab {
  color: rgba(255, 255, 255, 0.74);
}

.topbar .tab:hover {
  color: #fff;
}

.topbar .tab.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.topbar .search {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.topbar .search svg {
  color: rgba(255, 255, 255, 0.72);
}

.topbar .search input {
  color: #fff;
}

.topbar .search input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.topbar .search:focus-within {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.topbar .btn.ghost,
.topbar .btn.icon-only {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.topbar .btn.ghost:hover,
.topbar .btn.icon-only:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.42);
}

.topbar .live-tag {
  color: #eafff5;
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.45);
}

/* ============================================================
   Frameless globe (Earth floats directly on the page)
   ============================================================ */
.globe-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.globe-panel:hover {
  box-shadow: none;
}

.globe-panel .panel-head {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  border-bottom: 0;
}

.globe-frame {
  background: transparent;
  border-radius: var(--radius);
}

.globe-skeleton {
  border-radius: var(--radius);
}

/* ============================================================
   Monitoring source selector
   ============================================================ */
.source-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  height: 40px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--field-bg);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, opacity 160ms ease, transform 140ms ease;
}

.source-toggle:hover {
  color: var(--text);
  border-color: var(--accent-line);
}

.source-toggle.is-on {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.source-toggle:not(.is-on) {
  opacity: 0.5;
}

.source-toggle:not(.is-on) .src-mark {
  filter: grayscale(1);
}

.source-toggle:active {
  transform: scale(0.96);
}

.src-mark {
  flex: none;
  width: 12px;
  height: 12px;
  display: inline-block;
}

.src-mark.src-ground {
  border-radius: 50%;
  background: var(--amber);
}

.src-mark.src-satellite {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--site);
  transform: rotate(45deg);
}

.src-mark.src-aircraft {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid var(--source);
}

/* ============================================================
   Primary button + dataset tag + CSV import modal
   ============================================================ */
.btn.primary {
  gap: 8px;
  color: #fff;
  background: linear-gradient(160deg, var(--p-crimson-500), var(--p-crimson-700));
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.btn.primary svg {
  width: 17px;
  height: 17px;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.dataset-pill {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 200ms ease;
}

.modal-scrim.is-open {
  opacity: 1;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(740px, 94vw);
  max-height: 88dvh;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
}

.modal.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: 20px 22px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: var(--raise);
  border-top: 1px solid var(--border);
}

.modal-foot-right {
  display: flex;
  gap: 10px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 34px 24px;
  text-align: center;
  background: var(--field-bg);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-drag {
  border-color: var(--accent-2);
  background: var(--accent-soft);
  outline: none;
}

.dropzone.is-drag {
  transform: scale(1.01);
}

.dropzone svg {
  width: 34px;
  height: 34px;
  color: var(--accent-2);
}

.dropzone p {
  font-size: 13px;
}

.map-title {
  margin-bottom: 10px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin-bottom: 6px;
}

.map-row {
  display: grid;
  gap: 6px;
}

.map-row label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.map-row .req {
  color: var(--accent-2);
}

.map-row select {
  height: 36px;
}

.import-msg {
  margin: 14px 0;
  font-size: 13px;
  min-height: 18px;
}

.import-msg.error {
  color: var(--alert);
}

.import-msg.ok {
  color: var(--ok);
}

.preview-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table.preview th,
table.preview td {
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

table.preview td {
  font-family: var(--font-mono);
  color: var(--muted);
}

.modal.is-open .dropzone,
.modal.is-open #mapSection {
  animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.08s;
}

@media (max-width: 600px) {
  .map-grid {
    grid-template-columns: 1fr;
  }
}
