/* ==========================================================================
   Space Tracker — Deep Space Telemetry Glassmorphic Design System
   Prepared for local dev & slothworks.studio (Cloudflare Pages)
   ========================================================================== */

:root {
  --bg-void: #030610;
  --glass-bg: rgba(8, 14, 28, 0.72);
  --glass-bg-strong: rgba(6, 11, 23, 0.86);
  --glass-border: rgba(148, 197, 255, 0.16);
  --glass-border-bright: rgba(125, 211, 252, 0.36);
  --text-primary: #eef4ff;
  --text-secondary: #9cb0cf;
  --text-muted: #6c80a1;
  --accent: #38bdf8;
  --accent-warm: #f59e0b;
  --status-active: #34d399;
  --status-en-route: #38bdf8;
  --status-planned: #a78bfa;
  --status-completed: #94a3b8;
  --status-natural: #a3e635;
  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 7px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
}

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

button,
input,
select {
  font-family: inherit;
  color: inherit;
}

/* ---------- 3D Viewport & Projected Labels ---------- */

#viewport {
  position: fixed;
  inset: 0;
  z-index: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#viewport canvas {
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#labels-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  touch-action: none;
}

.map-label {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: rgba(5, 10, 22, 0.62);
  backdrop-filter: blur(8px);
  color: #dbe8ff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.map-label--planet {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9cb2d6;
  background: rgba(5, 10, 22, 0.48);
  border-color: rgba(148, 197, 255, 0.12);
}

.map-label--sun {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
}

.map-label:hover,
.map-label.is-hovered {
  border-color: rgba(125, 211, 252, 0.65);
  background: rgba(12, 24, 48, 0.85);
  color: #ffffff;
  z-index: 20;
}

.map-label.is-selected {
  border-color: #38bdf8;
  background: rgba(14, 42, 74, 0.92);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
  z-index: 30;
}

.map-label__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.au-ring-label {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(125, 211, 252, 0.72);
  background: rgba(3, 8, 20, 0.58);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.22);
}

/* ---------- Top Translucent Quick Views Bar ---------- */

.topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 20;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

.topbar__left,
.topbar__center,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__center {
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar__center::-webkit-scrollbar {
  display: none;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  padding: 2px 4px;
}

.brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  align-self: center;
}

.brand__name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.brand__sub {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tb-divider {
  width: 1px;
  height: 18px;
  background: var(--glass-border);
  margin: 0 2px;
}

.qv-btn,
.toggle-chip {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.qv-btn:hover,
.toggle-chip:hover {
  background: rgba(148, 197, 255, 0.12);
  color: var(--text-primary);
}

.qv-btn.is-active,
.toggle-chip.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
}

.qv-btn--accent {
  border-color: rgba(56, 189, 248, 0.25);
  color: #bae6fd;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: rgba(148, 197, 255, 0.14);
  color: var(--text-primary);
}

/* ---------- Left Translucent Mission Catalog Drawer ---------- */

.sidebar {
  position: fixed;
  top: 72px;
  left: 12px;
  bottom: 84px;
  width: 326px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.sidebar.is-collapsed {
  transform: translateX(-350px);
  opacity: 0;
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.panel-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.panel-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

.count-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(3, 8, 20, 0.65);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}

.search-wrap input:focus {
  border-color: var(--accent);
}

.search-kbd {
  position: absolute;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pill {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 197, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.14s;
}

.pill:hover {
  border-color: rgba(148, 197, 255, 0.35);
  color: var(--text-primary);
}

.pill.is-active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.filter-row select,
.sort-row select,
.horizons-row select {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(4, 10, 22, 0.78);
  color: var(--text-primary);
  font-size: 11.5px;
  outline: none;
}

.mission-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 3px;
}

.mission-list::-webkit-scrollbar,
.detail-overlay::-webkit-scrollbar,
.dossier-overlay::-webkit-scrollbar {
  width: 5px;
}

.mission-list::-webkit-scrollbar-thumb,
.detail-overlay::-webkit-scrollbar-thumb,
.dossier-overlay::-webkit-scrollbar-thumb {
  background: rgba(148, 197, 255, 0.22);
  border-radius: 999px;
}

.mission-item {
  width: 100%;
  text-align: left;
  padding: 9px 10px 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 197, 255, 0.11);
  border-left: 3px solid var(--item-accent, var(--accent));
  background: rgba(10, 18, 36, 0.48);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.mission-item:hover {
  background: rgba(18, 32, 62, 0.72);
  border-color: rgba(148, 197, 255, 0.3);
  border-left-color: var(--item-accent, var(--accent));
}

.mission-item.is-selected {
  background: rgba(16, 42, 76, 0.78);
  border-color: rgba(56, 189, 248, 0.55);
  border-left-color: var(--item-accent, var(--accent));
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.16);
}

.mission-item__top,
.mission-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mission-item__name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.mission-item__name mark {
  background: rgba(56, 189, 248, 0.32);
  color: #ffffff;
  border-radius: 3px;
  padding: 0 1px;
}

.mission-item__meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.agency-tag {
  color: #dbeafe;
  font-weight: 500;
}

.meta-sep {
  opacity: 0.45;
}

.mission-item__year {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.mission-item__dist {
  font-size: 11px;
  color: #7dd3fc;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--active {
  background: var(--status-active);
  box-shadow: 0 0 8px var(--status-active);
}
.status-dot--en_route {
  background: var(--status-en-route);
  box-shadow: 0 0 8px var(--status-en-route);
}
.status-dot--planned {
  background: var(--status-planned);
}
.status-dot--completed {
  background: var(--status-completed);
}
.status-dot--natural {
  background: var(--status-natural);
}

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

/* ---------- Right Translucent Mission Detail Overlay ---------- */

.detail-overlay {
  position: fixed;
  top: 72px;
  right: 12px;
  bottom: 84px;
  width: 368px;
  z-index: 16;
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(145%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateX(395px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.detail-overlay.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 197, 255, 0.12);
}

.overlay-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(148, 197, 255, 0.12);
  border: 1px solid rgba(148, 197, 255, 0.22);
  color: #dbeafe;
}

.badge--active {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}
.badge--en_route {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}
.badge--planned {
  background: rgba(167, 139, 250, 0.16);
  border-color: rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}
.badge--completed {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}
.badge--natural {
  background: rgba(163, 230, 53, 0.16);
  border-color: rgba(163, 230, 53, 0.45);
  color: #d9f99d;
}

.overlay-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.overlay-sub {
  font-size: 12px;
  color: #7dd3fc;
  margin-top: -6px;
}

.overlay-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12.8px;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.tele-cell {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(4, 10, 24, 0.56);
  border: 1px solid rgba(148, 197, 255, 0.11);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.tele-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.overlay-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 197, 255, 0.1);
}

.section-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.small-note {
  font-size: 10.5px;
  color: var(--text-muted);
}

.muted-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(148, 197, 255, 0.08);
}

.kv-row > span:first-child {
  color: var(--text-muted);
  flex-shrink: 0;
}

.kv-row > span:last-child {
  text-align: right;
  color: var(--text-primary);
}

.goals-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12.2px;
}

.life-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 197, 255, 0.14);
  overflow: hidden;
}

.life-bar--lg {
  height: 10px;
}

.life-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
}

.life-bar__fill.is-extended {
  background: linear-gradient(90deg, #34d399, #f59e0b);
}

.mini-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-ms {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 197, 255, 0.1);
  background: rgba(4, 10, 24, 0.42);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}

.mini-ms:hover {
  background: rgba(20, 40, 74, 0.65);
  border-color: rgba(56, 189, 248, 0.45);
}

.mini-ms__dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.mini-ms.is-reached .mini-ms__dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.mini-ms__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-ms__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.mini-ms__top .mono {
  font-size: 10.5px;
  color: #7dd3fc;
}

.mini-ms__desc {
  font-size: 11px;
  color: var(--text-muted);
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.related-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(12, 22, 44, 0.6);
  font-size: 11.5px;
  cursor: pointer;
}

.related-chip:hover {
  border-color: var(--accent);
}

.related-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.related-ag {
  font-size: 10px;
  color: var(--text-muted);
}

.overlay-actions {
  position: sticky;
  bottom: -16px;
  margin: auto -16px -16px;
  padding: 11px 14px;
  background: rgba(6, 12, 26, 0.94);
  backdrop-filter: blur(14px);
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  border-top: 1px solid rgba(148, 197, 255, 0.16);
}

.overlay-actions .btn--primary {
  flex: 1;
  padding: 0 10px;
  white-space: nowrap;
}

.overlay-actions .btn--ghost {
  padding: 0 9px;
  white-space: nowrap;
}

.btn {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn--primary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.88), rgba(37, 99, 235, 0.88));
  border-color: rgba(125, 211, 252, 0.5);
  color: #ffffff;
}

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

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.btn--ghost:hover,
.btn--ghost.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
}

/* ---------- Bottom Translucent Timeline Scrubber HUD ---------- */

.timeline-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  height: 60px;
  padding: 0 14px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 16px;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.tl-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.tl-btn:hover {
  background: rgba(148, 197, 255, 0.14);
}

.tl-btn.is-active {
  background: rgba(56, 189, 248, 0.24);
  border-color: var(--accent);
}

.tl-btn--play {
  width: 36px;
  padding: 0;
}

.tl-btn--live.is-live {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
}

.timeline-scrubber {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timeline-markers {
  position: relative;
  height: 10px;
  width: 100%;
}

.tl-pip {
  position: absolute;
  top: 1px;
  width: 7px;
  height: 7px;
  border: 1px solid #030610;
  border-radius: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  padding: 0;
}

.timeline-scrubber input[type='range'] {
  width: 100%;
  height: 4px;
  margin: 2px 0 4px;
  appearance: none;
  background: rgba(148, 197, 255, 0.24);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.timeline-scrubber input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.75);
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
}

.timeline-readout {
  text-align: right;
  flex-shrink: 0;
  min-width: 122px;
}

.timeline-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-jd {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ---------- Dedicated Mission Dossier Page (#/mission/:id) ---------- */

.dossier-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  background: rgba(3, 6, 16, 0.78);
  backdrop-filter: blur(22px) saturate(135%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.dossier-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.dossier-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 22px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dossier-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.dossier-nav__actions,
.dossier-pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dossier-hero {
  padding: 26px 28px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(12, 22, 44, 0.84), rgba(6, 12, 26, 0.86));
  border: 1px solid var(--glass-border);
  border-top: 3px solid var(--dossier-accent, var(--accent));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dossier-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dossier-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.dossier-destination {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.dossier-summary {
  margin: 2px 0 8px;
  max-width: 78ch;
  font-size: 15px;
  color: #cddaf0;
}

.dossier-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 197, 255, 0.14);
}

.d-stat {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(3, 8, 20, 0.6);
  border: 1px solid rgba(148, 197, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.d-stat__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.d-stat__value {
  font-size: 15px;
  font-weight: 600;
  color: #e0f2fe;
}

.dossier-card {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: rgba(8, 15, 32, 0.76);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dossier-card h2 {
  margin: 0;
  font-size: 17px;
}

.card-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.lifecycle-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}

.lifecycle-node {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lifecycle-node__rail {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.lifecycle-node__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--phase-color, var(--accent));
  background: var(--bg-void);
  flex-shrink: 0;
}

.lifecycle-node.is-reached .lifecycle-node__dot {
  background: var(--phase-color, var(--accent));
  box-shadow: 0 0 12px var(--phase-color, var(--accent));
}

.lifecycle-node__line {
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, var(--phase-color, var(--accent)), rgba(148, 197, 255, 0.16));
  opacity: 0.65;
}

.lifecycle-node__content {
  flex: 1;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: rgba(4, 10, 24, 0.56);
  border: 1px solid rgba(148, 197, 255, 0.12);
  border-top: 2px solid var(--phase-color, var(--accent));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lifecycle-node__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.phase-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--phase-color, var(--accent));
  border: 1px solid var(--phase-color, var(--accent));
}

.lifecycle-node__date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.lifecycle-node__content h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
}

.lifecycle-node__content p {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 12.8px;
}

.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.dossier-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
}

.dossier-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dossier-goals {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #cddaf0;
  font-size: 13.5px;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inst-chip {
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  font-size: 11.5px;
  font-family: var(--font-mono);
}

.life-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.dossier-note {
  margin: 0;
  color: var(--text-secondary);
}

.disposition-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(4, 10, 24, 0.6);
  border: 1px solid rgba(148, 197, 255, 0.12);
}

.disposition-box p {
  margin: 4px 0 0;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: #7dd3fc;
  text-decoration: none;
  font-size: 12px;
}

.source-link:hover {
  border-color: var(--accent);
}

.schema-details summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.code-box {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(2, 6, 14, 0.85);
  border: 1px solid rgba(148, 197, 255, 0.16);
  color: #bae6fd;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 260px;
}

/* ---------- Data / Horizons API Modal ---------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-root.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 14, 0.72);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(740px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-bright);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 19px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-box {
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(4, 10, 24, 0.72);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.stat-box span {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #7dd3fc;
}

.stat-box label {
  font-size: 10.5px;
  color: var(--text-muted);
}

.modal-desc {
  margin: 4px 0;
  color: var(--text-secondary);
}

.modal-desc code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

.horizons-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

/* ---------- HUD Hint Chip ---------- */

.hud-hint {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(5, 10, 22, 0.56);
  border: 1px solid rgba(148, 197, 255, 0.14);
  backdrop-filter: blur(10px);
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

.zoom-controls {
  position: fixed;
  right: 12px;
  bottom: 84px;
  z-index: 12;
  display: none;
  flex-direction: column;
  gap: 6px;
}

.zoom-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--glass-border-bright);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.zoom-btn:active {
  background: rgba(56, 189, 248, 0.28);
}

@media (hover: none) and (pointer: coarse), (max-width: 760px) {
  .zoom-controls {
    display: flex;
  }
}

/* ---------- Responsive Tweaks ---------- */

@media (max-width: 1080px) {
  .brand__sub,
  .hud-hint {
    display: none;
  }
  .sidebar {
    width: 290px;
  }
  .detail-overlay {
    width: 320px;
  }
  .dossier-telemetry-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .dossier-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 6px;
    padding: 0 8px;
  }
  .topbar__center {
    display: flex;
    gap: 4px;
    overflow: visible;
  }
  .topbar__center .qv-btn:not([data-view='top-down']):not([data-view='overview']),
  .topbar__center .tb-divider,
  .topbar__right .toggle-chip:not([data-toggle='labels']),
  .topbar__right #tb-data,
  .brand__dot {
    display: none;
  }
  .brand__name {
    font-size: 11px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .qv-btn,
  .toggle-chip {
    padding: 0 7px;
    font-size: 11px;
  }
  .sidebar,
  .detail-overlay {
    width: calc(100vw - 24px);
    max-height: 58vh;
    bottom: 84px;
    top: auto;
  }
  .sidebar.is-collapsed {
    transform: translateY(120%);
  }
  .detail-overlay {
    transform: translateY(120%);
  }
  .detail-overlay.is-open {
    transform: translateY(0);
  }
  .timeline-bar {
    gap: 8px;
    padding: 0 10px;
  }
  .timeline-readout {
    min-width: 92px;
  }
  .timeline-date {
    font-size: 11px;
  }
  #tl-rev,
  #tl-speed {
    display: none;
  }
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
