@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg:            #06070f;
  --surface-1:     #0c0e1c;
  --surface-2:     #11142a;
  --surface-3:     #161a38;

  --border:        rgba(120,140,255,0.16);
  --border-strong: rgba(120,140,255,0.34);
  --border-hot:    rgba(120,140,255,0.55);

  --text-primary:   #f1f4ff;
  --text-secondary: #aab4dd;
  --text-tertiary:  #7886ad;
  --text-disabled:  #4a5278;

  --accent:        #6f8cff;
  --accent-bright: #93aaff;
  --accent-dim:    rgba(111,140,255,0.14);
  --accent-glow:   rgba(111,140,255,0.35);

  --risk-critical:    #ff5252;
  --risk-critical-bg: rgba(255,82,82,0.13);
  --risk-critical-bd: rgba(255,82,82,0.4);

  --risk-high:    #ff9d42;
  --risk-high-bg: rgba(255,157,66,0.13);
  --risk-high-bd: rgba(255,157,66,0.38);

  --risk-medium:    #ffd84d;
  --risk-medium-bg: rgba(255,216,77,0.11);
  --risk-medium-bd: rgba(255,216,77,0.32);

  --risk-low:    #4ade80;
  --risk-low-bg: rgba(74,222,128,0.12);
  --risk-low-bd: rgba(74,222,128,0.34);

  --fs-2xs: 10px;
  --fs-xs:  11.5px;
  --fs-sm:  13px;
  --fs-base:14.5px;
  --fs-md:  16px;
  --fs-lg:  19px;
  --fs-xl:  23px;
  --fs-2xl: 29px;
  --fs-3xl: 38px;

  --font-ui:   'Inter', -apple-system, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.02) inset;
  --shadow-pop:  0 12px 40px rgba(0,0,0,0.55);
}

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

::selection { background: var(--accent-glow); color: #fff; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 1200px 800px at 15% -10%, rgba(80,100,220,0.07), transparent 60%),
    radial-gradient(ellipse 900px 700px at 100% 110%, rgba(60,160,220,0.05), transparent 60%);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

#topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 58px;
  background: rgba(8,9,20,0.92);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 20;
  backdrop-filter: blur(14px);
}

#logo-group { display: flex; align-items: center; gap: 10px; min-width: 200px; }

#logo {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--accent-bright);
  letter-spacing: 4px;
  text-transform: uppercase;
}

#live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--risk-low);
  box-shadow: 0 0 0 0 rgba(74,222,128,0.6);
  animation: pulse-live 2.2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@media (prefers-reduced-motion: reduce) {
  #live-dot { animation: none; }
}

#nav { display: flex; gap: 5px; }

.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-btn:hover {
  border-color: var(--border-hot);
  color: var(--accent-bright);
  background: var(--accent-dim);
}

.nav-btn.active {
  background: rgba(111,140,255,0.20);
  border-color: var(--accent);
  color: #e2e8ff;
  box-shadow: 0 0 0 1px rgba(111,140,255,0.15) inset;
}

#stats {
  display: flex;
  gap: 10px;
  min-width: 460px;
  justify-content: flex-end;
}

#stats span {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}

#stat-critical {
  color: var(--risk-critical) !important;
  border-color: var(--risk-critical-bd) !important;
  background: var(--risk-critical-bg) !important;
}

#globe-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

#search-bar {
  position: absolute;
  top: 70px;
  left: 18px;
  width: 280px;
  z-index: 10;
}

#sat-search {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 500;
  outline: none;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s, box-shadow 0.18s;
}

#sat-search:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-card), 0 0 0 3px var(--accent-dim);
}
#sat-search::placeholder { color: var(--text-disabled); }

#search-results {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-pop);
}

.search-result-item {
  padding: 11px 16px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-result-item:hover { background: var(--accent-dim); color: var(--text-primary); }
.search-result-item:last-child { border-bottom: none; }

#filter-panel {
  position: absolute;
  top: 70px;
  left: 312px;
  width: 270px;
  max-height: calc(100vh - 110px);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  z-index: 10;
  overflow-y: auto;
  backdrop-filter: blur(14px);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-card);
}

#filter-panel-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.filter-section { margin-bottom: 18px; }

.filter-section-label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.filter-radio, .filter-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  padding: 6px 2px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.filter-radio:hover, .filter-check:hover { color: var(--text-primary); }

.filter-radio input, .filter-check input {
  accent-color: var(--accent);
  cursor: pointer;
  width: 15px; height: 15px;
}

#filter-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent-bright);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin: 14px 0 12px;
  text-align: center;
}

#btn-filter-reset { width: 100%; text-align: center; }

#globe-display-icons {
  position: relative;
  display: flex;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(12, 15, 28, 0.86);
  border: 1px solid rgba(130, 148, 255, 0.2);
}

.display-icon-btn {
  width: 31px;
  height: 31px;
  border: 1px solid rgba(122, 138, 214, 0.42);
  background: linear-gradient(180deg, rgba(34, 39, 67, 0.95), rgba(19, 22, 40, 0.95));
  border-radius: 7px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8fa4d8;
  position: relative;
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.display-icon-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.display-icon-btn:hover {
  color: #c7dbff;
  border-color: rgba(158, 184, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(120, 156, 255, 0.18) inset;
}

.display-icon-btn.is-active {
  color: #9fe7ff;
  border-color: rgba(98, 192, 227, 0.9);
  box-shadow: 0 0 0 1px rgba(83, 184, 217, 0.28) inset;
}

.display-icon-btn.is-active::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37dc7d;
  box-shadow: 0 0 8px rgba(55, 220, 125, 0.7);
}

/* ── Collision Alerts panel ───────────────────────────── */
#side-panel {
  position: absolute;
  top: 70px;
  right: 18px;
  width: 320px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  z-index: 10;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

/* Panel title is now a clickable toggle button.
   The red dot (::before) is preserved, the chevron sits
   on the right via margin-left: auto on the SVG. */
#panel-title {
  padding: 16px 18px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-bright);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
#panel-title:hover { background: rgba(111,140,255,0.06); }

#panel-title::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--risk-critical);
  box-shadow: 0 0 8px var(--risk-critical);
  flex-shrink: 0;
}

/* Chevron SVG — sits on the far right of the title row.
   Rotates 180° smoothly when the panel expands. */
#alerts-chevron {
  margin-left: auto;
  width: 14px;
  height: 14px;
  stroke: var(--text-tertiary);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 0.3s ease, stroke 0.18s;
  transform: rotate(0deg);
}
#alerts-chevron.expanded {
  transform: rotate(180deg);
  stroke: var(--accent-bright);
}

/* Alert list — collapsed by default (max-height: 0).
   Transitions to full scrollable height when .expanded is added.
   max-height animation is used because CSS cannot transition to
   height: auto — max-height achieves the same visual result. */
#alert-list {
  overflow: hidden;
  max-height: 0;
  padding: 0 10px;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
#alert-list.expanded {
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  padding: 10px;
}

.alert-item {
  padding: 13px 14px;
  margin-bottom: 7px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.7;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-left-width: 4px;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.alert-item:hover { transform: translateX(2px); background: var(--surface-3); }
.alert-item.selected { background: var(--surface-3); border-color: var(--accent); }

.alert-critical {
  border-left-color: var(--risk-critical);
  background: linear-gradient(90deg, var(--risk-critical-bg), var(--surface-2) 40%);
}
.alert-high {
  border-left-color: var(--risk-high);
  background: linear-gradient(90deg, var(--risk-high-bg), var(--surface-2) 40%);
}
.alert-medium {
  border-left-color: var(--risk-medium);
  background: linear-gradient(90deg, var(--risk-medium-bg), var(--surface-2) 40%);
}
.alert-low {
  border-left-color: var(--risk-low);
  background: linear-gradient(90deg, var(--risk-low-bg), var(--surface-2) 40%);
}

.alert-name   { color: var(--text-primary); font-weight: 700; font-size: var(--fs-sm); }
.alert-detail { color: var(--text-tertiary); font-size: var(--fs-xs); }
.alert-risk   { margin-top: 6px; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; }

.alert-risk-critical { color: var(--risk-critical); }
.alert-risk-high     { color: var(--risk-high); }
.alert-risk-medium   { color: var(--risk-medium); }
.alert-risk-low      { color: var(--risk-low); }

.view {
  position: absolute;
  top: 58px;
  left: 0; right: 0; bottom: 32px;
  z-index: 15;
  overflow-y: auto;
  padding: 32px 36px 48px;
  background: var(--bg);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.view.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hidden { display: none !important; }
.hidden-ui { display: none !important; }

.view-title {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.view-header {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--text-primary);
}

#kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto 28px;
}

.kpi-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--kpi-accent, var(--accent));
}

.kpi-label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-sub {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  margin-top: 6px;
}

.kpi-card.kpi-nominal  { --kpi-accent: var(--risk-low); }
.kpi-card.kpi-elevated { --kpi-accent: var(--risk-medium); }
.kpi-card.kpi-critical { --kpi-accent: var(--risk-critical); }
.kpi-card.kpi-nominal  .kpi-value { color: var(--risk-low); }
.kpi-card.kpi-elevated .kpi-value { color: var(--risk-medium); }
.kpi-card.kpi-critical .kpi-value { color: var(--risk-critical); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
}

.chart-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.chart-card:hover { border-color: var(--border-strong); }

.chart-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.chart-card canvas {
  flex: 1;
  min-height: 0 !important;
  max-height: 270px !important;
}

#maneuver-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.export-btn {
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
}
.export-btn:hover { background: rgba(111,140,255,0.26); color: #fff; border-color: var(--accent); }

#maneuver-list { max-width: 1000px; margin: 0 auto; }

.maneuver-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.maneuver-card:hover { border-color: var(--border-strong); }

.maneuver-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.maneuver-sats { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); }

.maneuver-deltav {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  color: var(--accent-bright);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 24px var(--accent-glow);
}

.maneuver-deltav span {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-left: 7px;
  font-weight: 600;
  text-shadow: none;
}

.maneuver-stats {
  display: flex;
  gap: 22px;
  margin-bottom: 16px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  align-items: center;
  flex-wrap: wrap;
}

.maneuver-stats b { color: var(--text-primary); font-weight: 700; font-family: var(--font-mono); }

.maneuver-text {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  line-height: 1.85;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.risk-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.risk-critical { background: var(--risk-critical-bg); color: var(--risk-critical); border: 1px solid var(--risk-critical-bd); }
.risk-high     { background: var(--risk-high-bg);     color: var(--risk-high);     border: 1px solid var(--risk-high-bd); }
.risk-medium   { background: var(--risk-medium-bg);   color: var(--risk-medium);   border: 1px solid var(--risk-medium-bd); }
.risk-low      { background: var(--risk-low-bg);      color: var(--risk-low);      border: 1px solid var(--risk-low-bd); }

#inspector {
  position: absolute;
  bottom: 48px;
  left: 18px;
  width: 340px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: var(--surface-1);
  border: 1px solid var(--border-hot);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  z-index: 15;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-pop);
}

#inspector-close {
  position: absolute;
  top: 14px; right: 16px;
  font-size: var(--fs-md);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.18s;
  line-height: 1;
}
#inspector-close:hover { color: var(--text-primary); }

#inspector-name {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: 16px;
  padding-right: 24px;
}

#inspector-body { font-size: var(--fs-sm); color: var(--text-secondary); }

.insp-section { margin-bottom: 16px; }

.insp-label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.insp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.insp-row:last-child { border-bottom: none; }

.insp-key { color: var(--text-tertiary); font-size: var(--fs-xs); }
.insp-val { color: var(--text-primary); font-weight: 600; font-size: var(--fs-sm); font-family: var(--font-mono); }
.insp-val-dim { color: var(--text-tertiary); font-size: var(--fs-2xs); font-family: var(--font-mono); }

.insp-pill {
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--accent-bright);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 6px;
}

.insp-error {
  color: var(--risk-high);
  font-size: var(--fs-sm);
  background: var(--risk-high-bg);
  border: 1px solid var(--risk-high-bd);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.insp-empty { color: var(--text-disabled); font-size: var(--fs-sm); }

.insp-conj-card {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--risk-critical-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--risk-critical);
}
.insp-conj-card.insp-conj-high { background: var(--risk-high-bg); border-left-color: var(--risk-high); }
.insp-conj-name { color: var(--text-primary); font-weight: 700; font-size: var(--fs-sm); }
.insp-conj-detail { color: var(--text-tertiary); font-size: var(--fs-xs); margin-top: 3px; font-family: var(--font-mono); }
.insp-conj-tca {
  font-size: var(--fs-2xs);
  font-family: var(--font-mono);
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

#sim-block {
  margin-top: 6px;
  padding: 16px;
  background: var(--accent-dim);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
}

.sim-title {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 10px;
}

.sim-partner { font-size: var(--fs-xs); color: var(--text-tertiary); margin-bottom: 10px; }
.sim-partner span { color: var(--text-secondary); font-weight: 600; }

.sim-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-2xs);
  color: var(--text-disabled);
  margin-bottom: 4px;
}

#sim-slider {
  width: 100%;
  margin-bottom: 12px;
  accent-color: var(--accent);
  cursor: pointer;
  height: 6px;
}

.sim-offset-display {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.sim-offset-display span { color: var(--accent-bright); font-weight: 700; font-family: var(--font-mono); }

.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sim-stat-box {
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}
.sim-stat-label { font-size: var(--fs-2xs); color: var(--text-tertiary); margin-bottom: 4px; font-weight: 600; letter-spacing: 0.5px; }
.sim-stat-value { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 700; color: var(--risk-critical); }

.sim-meta-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}
.sim-meta-row b { font-family: var(--font-mono); font-weight: 700; }

.sim-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sim-deltav-label { font-size: var(--fs-xs); color: var(--text-tertiary); }
.sim-deltav-value { color: var(--accent-bright); font-weight: 700; font-family: var(--font-mono); }

.sim-status-badge {
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 11px;
  border-radius: var(--radius-sm);
}
.sim-status-unsafe    { background: var(--risk-critical-bg); color: var(--risk-critical); }
.sim-status-improving { background: var(--risk-high-bg);     color: var(--risk-high); }
.sim-status-reduced   { background: var(--risk-medium-bg);   color: var(--risk-medium); }
.sim-status-safe      { background: var(--risk-low-bg);      color: var(--risk-low); }

#bottombar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 38px;
  background: rgba(8,9,20,0.94);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 18px;
  z-index: 20;
}

#status-msg {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.4px;
  margin-right: 10px;
}

.btn-control {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--fs-2xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.4px;
}

.btn-control:hover {
  background: var(--accent-dim);
  border-color: var(--border-hot);
  color: var(--accent-bright);
}

#time-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

#btn-rotation { margin-left: auto; }

#time-controls .mission-chip,
#btn-rotation.mission-chip {
  width: 30px;
  min-width: 30px;
  height: 29px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(122, 138, 214, 0.42);
  background: linear-gradient(180deg, rgba(34, 39, 67, 0.95), rgba(19, 22, 40, 0.95));
  color: #9db1df;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

#time-controls .mission-chip:hover,
#btn-rotation.mission-chip:hover {
  color: #d7e5ff;
  border-color: rgba(158, 184, 255, 0.76);
  background: linear-gradient(180deg, rgba(43, 51, 84, 0.98), rgba(23, 28, 51, 0.98));
  box-shadow: 0 0 0 1px rgba(120, 156, 255, 0.2) inset;
  transform: translateY(-1px);
}

#time-controls .mission-chip:active,
#btn-rotation.mission-chip:active { transform: translateY(0); }

#time-controls .mission-chip-now {
  color: #9fe7ff;
  border-color: rgba(98, 192, 227, 0.75);
  box-shadow: 0 0 0 1px rgba(83, 184, 217, 0.22) inset;
}

#stat-time.sim-active {
  color: var(--risk-medium) !important;
  border-color: var(--risk-medium-bd) !important;
  background: var(--risk-medium-bg) !important;
}

#forecast-header-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

#forecast-meta {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.3px;
}

.forecast-count-badge {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent-bright);
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 4px 14px;
}

#forecast-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
  gap: 16px;
}

.forecast-item {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border-left: 4px solid var(--text-disabled);
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s;
}

.forecast-critical { border-left-color: var(--risk-critical); background: linear-gradient(160deg, var(--risk-critical-bg), var(--surface-1) 55%); }
.forecast-high     { border-left-color: var(--risk-high);     background: linear-gradient(160deg, var(--risk-high-bg), var(--surface-1) 55%); }
.forecast-medium   { border-left-color: var(--risk-medium);   background: linear-gradient(160deg, var(--risk-medium-bg), var(--surface-1) 55%); }
.forecast-low      { border-left-color: var(--risk-low); }

.forecast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.forecast-names { font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }

.forecast-urgency-badge {
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  white-space: nowrap;
}

.forecast-critical-badge { background: rgba(255,82,82,0.22); color: #ff7575; }
.forecast-high-badge     { background: rgba(255,157,66,0.2);  color: #ffb066; }
.forecast-medium-badge   { background: rgba(255,216,77,0.18); color: #ffe680; }
.forecast-low-badge      { background: var(--accent-dim);     color: var(--text-tertiary); }

.forecast-countdown {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin: 8px 0 6px;
}

.forecast-critical .forecast-countdown { color: var(--risk-critical); text-shadow: 0 0 20px rgba(255,82,82,0.4); }
.forecast-high     .forecast-countdown { color: var(--risk-high); }
.forecast-medium   .forecast-countdown { color: var(--risk-medium); }

.forecast-approach-time {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.forecast-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.forecast-details strong { color: var(--text-secondary); font-family: var(--font-mono); }

.forecast-empty {
  color: var(--text-disabled);
  font-size: var(--fs-md);
  text-align: center;
  padding: 70px 0;
  line-height: 2;
  grid-column: 1 / -1;
}

#alert-list::-webkit-scrollbar,
.view::-webkit-scrollbar,
#search-results::-webkit-scrollbar,
#filter-panel::-webkit-scrollbar,
#inspector::-webkit-scrollbar { width: 5px; }

#alert-list::-webkit-scrollbar-track,
.view::-webkit-scrollbar-track,
#search-results::-webkit-scrollbar-track,
#filter-panel::-webkit-scrollbar-track,
#inspector::-webkit-scrollbar-track { background: transparent; }

#alert-list::-webkit-scrollbar-thumb,
.view::-webkit-scrollbar-thumb,
#search-results::-webkit-scrollbar-thumb,
#filter-panel::-webkit-scrollbar-thumb,
#inspector::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

@media (max-width: 1100px) {
  #kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  #stats { display: none; }
  #globe-display-icons { display: none; }
}