/* ===== Artemis -- Light Theme (matches site) ===== */
/* CLS fix: isolate layout inside bordered-section */
.artemis-wrapper .bordered-section {
  contain: layout style;
}
.artemis-wrapper {
  min-height: 80vh;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}
.artemis-wrapper h1,
.artemis-wrapper h2 {
  font-family: 'Orbitron', sans-serif;
  color: #333;
  letter-spacing: 1px;
}
.artemis-wrapper h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.artemis-wrapper h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.artemis-wrapper .lede {
  color: #495057;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.55;
}
.artemis-wrapper .lede p {
  margin-bottom: 0.5rem;
}
.artemis-wrapper .lede p:last-child {
  margin-bottom: 0;
}
.artemis-wrapper .lede em {
  color: #6c757d;
}
.lede-mobile-wrap .lede-short { display: inline; }
.lede-mobile-wrap .lede-full { display: none; }
.lede-mobile-wrap.expanded .lede-short { display: none; }
.lede-mobile-wrap.expanded .lede-full { display: block; }
.lede-more-toggle {
  color: #0d6efd;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}

/* ===== Header bar (mission selector + status) ===== */
.artemis-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.artemis-header select {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
}
.artemis-header select:focus {
  outline: 2px solid #0d6efd;
  outline-offset: -1px;
}
.live-badge {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  letter-spacing: 1px;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.status-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  letter-spacing: 0.5px;
  background: #e9ecef;
  color: #6c757d;
}
.status-badge.completed { background: #d1ecf1; color: #0c5460; }

/* ===== Canvas row: map + side panel ===== */
.artemis-canvas-row {
  display: flex;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #dee2e6;
}
.artemis-canvas-container {
  position: relative;
  flex: 1;
  min-width: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #03071a;
}
.artemis-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.fullscreen-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
}
.fullscreen-btn:hover { background: rgba(255,255,255,0.15); }

/* ===== Live viewer count overlay ===== */
.viewer-overlay {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.4s;
}
.viewer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 4px rgba(74,222,128,0.6);
}
.viewer-peak {
  opacity: 0.5;
  font-size: 0.6rem;
  margin-left: 4px;
}
@media (max-width: 767px) {
  .viewer-peak { display: none !important; }
}

/* ===== Zoom controls ===== */
.zoom-controls {
  position: absolute;
  bottom: 0.75rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
}
.zoom-btn {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.zoom-btn:hover { background: rgba(255,255,255,0.18); }
.zoom-btn:active { background: rgba(255,255,255,0.25); }
.zoom-reset { font-size: 1rem; }

/* ===== Unit toggle ===== */
.unit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}
.unit-toggle input { display: none; }
.unit-label { font-size: 0.7rem; color: #6b7280; transition: color 0.15s; }
.unit-label.active { color: #e0e4e8; font-weight: 600; }
.unit-slider {
  width: 28px; height: 14px;
  background: rgba(255,255,255,0.12);
  border-radius: 7px;
  position: relative;
  transition: background 0.15s;
}
.unit-slider::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 10px; height: 10px;
  background: #6ee7f7;
  border-radius: 50%;
  transition: transform 0.15s;
}
.unit-toggle input:checked + .unit-slider::after {
  transform: translateX(14px);
}

/* ===== Side panel ===== */
.artemis-side-panel {
  width: 260px;
  flex-shrink: 0;
  background: #0d1b2a;
  color: #e0e4e8;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sp-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sp-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.sp-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 6px;
  color: #fff;
}
.sp-badge.live { background: #dc2626; }
.sp-badge.reentry { background: #f97316; color: #fff; animation: pulse-badge 1.5s ease-in-out infinite; }
.sp-badge.completed-recently { background: #22c55e; color: #fff; }
.sp-badge.completed { background: rgba(13,202,240,0.25); color: #0dcaf0; }
@keyframes pulse-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.sp-status-line {
  display: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  margin-top: 4px;
  line-height: 1.3;
  white-space: nowrap;
}
.sp-status-line.active { display: block; }
.sp-section {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
/* CLS fix: collapsible sections use height:0 instead of display:none */
.sp-collapsible {
  overflow: hidden;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sp-collapsible.sp-visible {
  height: auto;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.sp-label {
  opacity: 0.5;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.sp-val {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.78rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.sp-next {
  color: #0dcaf0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.75rem;
  text-align: right;
  line-height: 1.4;
}
.sp-next-name {
  display: block;
  white-space: nowrap;
}
.sp-next-time {
  display: block;
  white-space: nowrap;
}
.sp-met-section { padding: 8px 16px; }
.sp-met-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sp-met-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.5;
}
.sp-met-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
/* DSN section */
.sp-dsn-section { padding: 6px 16px; }
.sp-dsn-section .sp-row { margin-bottom: 1px; }
.sp-dsn-signal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dsn-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dsn-dot.green { background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.dsn-dot.red { background: #ef4444; box-shadow: 0 0 4px #ef4444; }
.dsn-dot.grey { background: #6b7280; }
.sp-crew {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sp-crew-tag {
  font-size: 0.65rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  padding: 1px 5px;
  color: #e0e4e8;
}
.sp-legend {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2px 8px;
}
.sp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  color: #c0c4c8;
  white-space: nowrap;
}
.sp-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}



/* Freshness indicator */
.freshness-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.freshness-dot.green { background: #198754; }
.freshness-dot.amber { background: #ffc107; }
.freshness-dot.red { background: #dc3545; }

/* ===== Old standalone timeline (kept for fullscreen overlay) ===== */
.artemis-timeline {
  margin-top: 1rem;
  padding: 0.75rem 2rem;
}
.timeline-phase {
  position: absolute;
  top: 0;
  height: 100%;
  opacity: 0.3;
}
.timeline-handle {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 40px;
  background: #0d6efd;
  border-radius: 2px;
  cursor: grab;
  z-index: 5;
  box-shadow: 0 0 8px rgba(13, 110, 253, 0.4);
}
.timeline-handle:active { cursor: grabbing; }
.timeline-ticks {
  position: relative;
  width: 100%;
  height: 18px;
  padding: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: #6b7280;
}
.timeline-ticks .tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}
.timeline-ticks .tick::before {
  content: '';
  display: block;
  margin: 0 auto;
  width: 1px;
  height: 4px;
  background: rgba(255,255,255,0.18);
}
.timeline-ticks .tick.major::before {
  height: 6px;
  background: rgba(255,255,255,0.35);
}
.timeline-ticks .tick.minor span { display: none; }
.timeline-ticks .tick span {
  display: block;
  text-align: center;
  white-space: nowrap;
  font-size: 0.55rem;
}

/* ===== Inline timeline (inside side panel) ===== */
.sp-timeline-section {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sp-timeline-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.5;
  margin-bottom: 5px;
}
.timeline-bar {
  position: relative;
  width: 100%;
  height: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}
.sp-timeline-section .timeline-handle {
  top: -2px;
  width: 3px;
  height: 24px;
  background: #0dcaf0;
  box-shadow: 0 0 6px rgba(13, 202, 240, 0.5);
}
.sp-timeline-section .timeline-phase {
  opacity: 0.5;
}
.sp-timeline-section .timeline-ticks {
  height: 16px;
  font-size: 0.5rem;
  color: rgba(255,255,255,0.35);
}
.sp-playback {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: nowrap;
}
.sp-playback button {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: #e0e4e8;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1.3;
}
.sp-playback button:hover { background: rgba(255,255,255,0.12); }
.sp-playback button.active {
  background: rgba(13, 202, 240, 0.2);
  border-color: #0dcaf0;
  color: #0dcaf0;
}
.sp-playback .speed-group {
  display: flex;
  gap: 2px;
  align-items: center;
}
.sp-playback .speed-label {
  font-size: 0.55rem;
  color: rgba(255,255,255,0.4);
  margin-right: 1px;
}
/* Playback controls (legacy, kept for reference) */
.artemis-playback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.artemis-playback button {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.artemis-playback button:hover { background: #e9ecef; }
.artemis-playback button.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}
.artemis-playback .speed-group {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.artemis-playback .speed-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: 0.2rem;
}


/* Error/info banners. Rendered as an absolute overlay over the top of the canvas
   container so toggling visibility does NOT shift surrounding content (CLS fix). */
.artemis-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px 4px 0 0;
  margin-bottom: 0;
  pointer-events: none;
}
.artemis-banner.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.artemis-banner.warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.artemis-banner.reentry { background: #1a1a2e; color: #f97316; border: 1px solid #f97316; }
.artemis-banner.reentry strong { color: #fb923c; }
.artemis-banner.success { background: #0d2818; color: #22c55e; border: 1px solid #22c55e; }
.artemis-banner.success strong { color: #4ade80; }

/* ===== Fullscreen mode ===== */
/* Body-level: hide everything except the canvas container */
.artemis-fullscreen-active .site-header,
.artemis-fullscreen-active .title-bar,
.artemis-fullscreen-active .context-menu-wrapper,
.artemis-fullscreen-active .mobile-menu-bar { display: none !important; }
.artemis-fullscreen-active { overflow: hidden !important; }
.artemis-fullscreen-active .artemis-wrapper {
  padding: 0 !important; margin: 0 !important;
  min-height: 100vh !important;
  background: #000 !important;
}
.artemis-fullscreen-active .main-content-container {
  max-width: none !important; padding: 0 !important; margin: 0 !important;
}
.artemis-fullscreen-active .bordered-section {
  border: none !important; border-radius: 0 !important;
  padding: 0 !important; margin: 0 !important;
  max-width: none !important; background: #000 !important;
}
.artemis-fullscreen-active .artemis-header,
.artemis-fullscreen-active .lede,
.artemis-fullscreen-active .artemis-banner,
.artemis-fullscreen-active #itinerary-section,
.artemis-fullscreen-active #gallery-section,
.artemis-fullscreen-active #audit-log-section,
.artemis-fullscreen-active #faq-wrapper { display: none !important; }
/* Show reentry/success banners even in fullscreen */
.artemis-fullscreen-active .artemis-banner.reentry,
.artemis-fullscreen-active .artemis-banner.success {
  display: block !important;
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 10001; max-width: 90vw; text-align: center;
  border-radius: 8px; font-size: 0.9rem;
}

/* Canvas row: fill viewport */
.artemis-fullscreen-active .artemis-canvas-row {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 9999 !important;
}
.artemis-fullscreen-active .artemis-canvas-container {
  flex: 1 !important;
  aspect-ratio: auto !important;
  height: 100% !important;
  max-height: none !important;
  border-radius: 0 !important;
  background: #000 !important;
  overflow: visible !important;
}
.artemis-fullscreen-active .artemis-canvas-container canvas {
  border-radius: 0 !important;
}
.artemis-fullscreen-active .artemis-side-panel {
  width: 280px;
  max-height: 100vh;
  border-radius: 0;
}

/* Title overlay */
.artemis-fs-title {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.1rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: .3em;
  color: #fff;
  text-shadow: 0 3px 10px rgba(0,0,0,.55), 0 0 18px rgba(0,123,255,.35);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  display: none;
  z-index: 20;
}
.artemis-fullscreen-active .artemis-fs-title { display: none; }

/* Exit button */
.artemis-fs-exit {
  display: none;
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
}
.artemis-fs-exit:hover { background: rgba(255,255,255,0.2); }
.artemis-fullscreen-active .artemis-fs-exit { display: flex; align-items: center; justify-content: center; }
.artemis-fullscreen-active .fullscreen-btn { display: none; }
@media (max-width: 1100px) {
  .artemis-fs-title { letter-spacing: .22em; font-size: clamp(1rem, 3.2vw, 2rem); }
}
@media (max-width: 780px) {
  .artemis-fs-title { font-size: 1.4rem; top: 10px; }
}

/* ===== Controls help button + modal ===== */
.controls-help-btn {
  position: absolute;
  top: 12px;
  right: 52px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
}
.controls-help-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.artemis-fullscreen-active .controls-help-btn { display: none; }

/* NASA TV button */
.nasatv-btn {
  position: absolute;
  top: 12px;
  right: 92px;
  height: 32px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  padding: 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  transition: background 0.15s;
}
.nasatv-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.nasatv-btn.active { background: rgba(220,38,38,0.3); border-color: #dc2626; color: #f87171; }

/* NASA TV mini player */
.nasatv-player {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 15;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  background: #111;
}
.nasatv-player.open { display: block; }
.nasatv-player.collapsed .nasatv-video { width: 200px; height: 1px; overflow: hidden; opacity: 0.01; }
.nasatv-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.85);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: #f87171;
  cursor: pointer;
  user-select: none;
}
.nasatv-label { flex: 1; }
.nasatv-expand, .nasatv-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 0.8rem; cursor: pointer; padding: 0 2px; line-height: 1;
}
.nasatv-expand:hover, .nasatv-close:hover { color: #fff; }
.nasatv-player.collapsed .nasatv-expand { transform: rotate(0deg); }
.nasatv-player:not(.collapsed) .nasatv-expand { transform: rotate(90deg); }
.nasatv-video { width: 200px; height: 113px; }
.nasatv-video iframe { width: 100%; height: 100%; border: none; }

/* Fullscreen: keep player visible, move button */
/* Fullscreen: keep player visible */
.artemis-fullscreen-active .nasatv-player { z-index: 10002; }

@media (max-width: 780px) {
  .nasatv-btn { right: 52px; top: 8px; font-size: 0.6rem; height: 28px; padding: 0 8px; }
  .nasatv-video { width: 160px; height: 90px; }
}

.controls-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.controls-modal-overlay.open { display: flex; }
.controls-modal {
  background: #0d1b2a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 1.25rem 1.5rem 1rem;
  max-width: 380px;
  width: 92vw;
  color: rgba(255,255,255,0.85);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.controls-modal h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.controls-modal table {
  width: 100%;
  border-collapse: collapse;
}
.controls-modal td {
  padding: 0.3rem 0;
  vertical-align: top;
}
.controls-modal td:first-child {
  white-space: nowrap;
  padding-right: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  width: 1%;
}
.controls-modal .section-label {
  color: #0dcaf0;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-top: 0.6rem;
  padding-bottom: 0.15rem;
}
.controls-modal-close {
  display: block;
  margin: 0.75rem auto 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 0.35rem 1.5rem;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
}
.controls-modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .artemis-canvas-row { flex-direction: column; }
  .artemis-side-panel {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    overflow-y: visible;
  }
  .sp-header { flex-basis: 100%; }
  .sp-section { flex: 1; min-width: 180px; }
  .sp-met-section { flex-basis: 100%; }
  .sp-timeline-section { flex-basis: 100%; }
}
@media (max-width: 768px) {
  .artemis-wrapper { padding-top: 0.75rem; }
  .artemis-wrapper h1 { font-size: 1.15rem; }
  .artemis-canvas-container { aspect-ratio: 4 / 3; }
  .fullscreen-btn { display: none; }
  .controls-help-btn { right: 12px; top: 12px; }
  .artemis-fullscreen-active .artemis-side-panel { display: none; }
  .sp-val { font-size: 0.7rem; }
  .sp-label { font-size: 0.6rem; }
  .sp-met-value { font-size: 0.95rem; }
  .sp-section { padding: 7px 12px; }
  .sp-timeline-section { padding: 7px 12px; }
  .sp-header { padding: 10px 12px 7px; }
  .sp-met-section { padding: 8px 12px; }
  /* Condense legends to two columns on mobile */
  .sp-legend {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 10px;
  }
  .sp-legend-item { font-size: 0.6rem; }
}

/* ===== Mission Itinerary Timeline ===== */
.itinerary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.itinerary-header h2 {
  margin: 0;
  font-size: 1rem;
}
.itinerary-arrow {
  font-size: 0.8rem;
  color: #6b7280;
  transition: transform 0.2s;
}
.section-summary {
  flex: 1;
  margin-left: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itinerary-timeline {
  position: relative;
  padding: 0.5rem 0 0.5rem 2rem;
  margin-top: 0.75rem;
}
.itinerary-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #d1d5db;
}
.itin-phase-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0.4rem -2rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}
.itin-phase-header:first-child {
  margin-top: 0;
}
.itin-event {
  position: relative;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.itin-event--completed {
  opacity: 0.55;
}
.itin-event--active {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2), 0 2px 8px rgba(129, 140, 248, 0.15);
  opacity: 1;
}
.itin-event--upcoming {
  opacity: 1;
}
.itin-dot {
  position: absolute;
  left: calc(8px - 2rem);
  top: 0.7rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
  transform: translateX(-50%);
}
.itin-event--active .itin-dot {
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.4), 0 0 8px rgba(129, 140, 248, 0.5);
  animation: itinPulse 2s ease-in-out infinite;
}
@keyframes itinPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.4), 0 0 8px rgba(129, 140, 248, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(129, 140, 248, 0.2), 0 0 14px rgba(129, 140, 248, 0.4); }
}
.itin-time {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 2px;
}
.itin-time-met {
  font-weight: 600;
  color: #374151;
}
.itin-time-utc {
  font-size: 0.62rem;
  color: #9ca3af;
}
.itin-time-local {
  font-size: 0.62rem;
  color: #6b7280;
}
.itin-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.itin-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: 0.01em;
}
.itin-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.4;
}
.itin-badge--maneuver { background: #ef476f; }
.itin-badge--crew { background: #06d6a0; color: #064e3b; }
.itin-badge--science { background: #118ab2; }
.itin-badge--comms { background: #d69e2e; color: #744210; }
.itin-badge--milestone { background: #7b2ff7; }
.itin-badge--rest { background: #9ca3af; color: #1f2937; }
.itin-badge--duration {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #6b7280;
}
.itin-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #374151;
  margin: 0;
}
.itin-crew-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.itin-crew-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.6rem;
  color: #4338ca;
}
.itin-empty {
  color: #6b7280;
  font-size: 0.8rem;
  padding: 0.5rem 0;
}
.itin-scroll-btn {
  display: none;
  margin-top: 0.5rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid #818cf8;
  border-radius: 4px;
  background: #eef2ff;
  color: #4338ca;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  transition: background 0.15s;
}
.itin-scroll-btn:hover {
  background: #c7d2fe;
}

/* Responsive itinerary */
@media (max-width: 768px) {
  .itinerary-timeline { padding-left: 1.5rem; }
  .itin-phase-header { margin-left: -1.5rem; font-size: 0.62rem; }
  .itin-dot { left: calc(8px - 1.5rem); width: 10px; height: 10px; }
  .itin-title { font-size: 0.72rem; }
  .itin-desc { font-size: 0.72rem; }
  .itin-time { font-size: 0.62rem; }
  .itin-badge { font-size: 0.5rem; }
  .itin-crew-tag { font-size: 0.55rem; }
}

/* Fullscreen: hide itinerary */
.artemis-fullscreen-active #itinerary-section { display: none !important; }
.artemis-fullscreen-active #gallery-section { display: none !important; }

/* ===== Mission Gallery ===== */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.gallery-header h2 {
  margin: 0;
  font-size: 1rem;
}
.gallery-arrow {
  font-size: 0.8rem;
  color: #6b7280;
  transition: transform 0.2s;
}

/* Hero image */
.gallery-hero {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
  cursor: pointer;
  background: #111;
}
.gallery-hero img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 400px;
  transition: transform 0.4s ease;
}
.gallery-hero:hover img {
  transform: scale(1.02);
}
.gallery-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
}
.gallery-hero-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}
.gallery-hero-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
}

/* Day strips */
.gallery-days {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.gallery-day-strip {
  margin-bottom: 0;
}
.gallery-day-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #e5e7eb;
}
.gallery-day-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1e293b;
}
.gallery-day-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: #6b7280;
}
.gallery-day-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.gallery-phase-tag {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.55rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.gallery-day-count {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  color: #9ca3af;
}
.gallery-scroll-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Thumbnail cards */
.gallery-thumb {
  flex: 0 0 auto;
  width: 200px;
  height: 140px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #f3f4f6;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.gallery-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-color: #818cf8;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}
.gallery-thumb img[data-src] {
  opacity: 0;
}
.gallery-thumb img.gallery-loaded {
  opacity: 1;
}
.gallery-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.35rem 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  pointer-events: none;
}
.gallery-thumb-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-thumb-met {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  color: rgba(255,255,255,0.7);
}
.gallery-show-more {
  flex: 0 0 100%;
  height: auto;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.gallery-show-more:hover {
  background: #eef2ff;
  color: #4338ca;
  border-color: #818cf8;
}

/* Expanded grid layout (after show-more click) */
.gallery-load-more {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  cursor: pointer;
  border-radius: 6px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.gallery-load-more:hover {
  background: #eef2ff;
  color: #4338ca;
  border-color: #818cf8;
}
.gallery-load-more-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  color: #9ca3af;
}
.gallery-day-actions {
  flex: 0 0 100%;
  display: flex;
  gap: 0.5rem;
}
.gallery-day-actions .gallery-load-more {
  flex: 1 1 auto;
}
.gallery-collapse {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  border-radius: 6px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.gallery-collapse:hover {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Empty state */
.gallery-empty {
  color: #6b7280;
  font-size: 0.8rem;
  padding: 0.5rem 0;
}

/* ===== Lightbox ===== */
.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox.gallery-lb-open {
  display: flex;
}
.gallery-lb-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10002;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s;
}
.gallery-lb-close:hover { color: #fff; }
.gallery-lb-download {
  position: absolute;
  top: 12px;
  right: 52px;
  z-index: 10002;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s;
}
.gallery-lb-download:hover { color: #818cf8; }
.gallery-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10001;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.gallery-lb-nav:hover { background: rgba(255,255,255,0.15); color: #fff; }
.gallery-lb-prev { left: 12px; }
.gallery-lb-next { right: 12px; }
.gallery-lb-img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lb-img {
  max-width: 90vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transition: opacity 0.25s;
}
.gallery-lb-spinner {
  display: none;
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: gallerySpinAnim 0.8s linear infinite;
}
@keyframes gallerySpinAnim {
  to { transform: rotate(360deg); }
}
.gallery-lb-caption {
  text-align: center;
  max-width: 700px;
  padding: 0.75rem 1rem 0;
  color: #fff;
}
.gallery-lb-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}
.gallery-lb-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.75);
  max-height: 3.5em;
  overflow: hidden;
}
.gallery-lb-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.3rem;
}

/* Gallery responsive */
@media (max-width: 768px) {
  .gallery-thumb {
    width: calc(33.333% - 0.334rem);
    height: 90px;
  }
  .gallery-show-more {
    font-size: 0.6rem;
    padding: 0.5rem 0;
  }
  .gallery-load-more {
    font-size: 0.6rem;
    padding: 0.5rem 0;
  }
  .gallery-collapse {
    font-size: 0.6rem;
    padding: 0.5rem 0.8rem;
  }
  .gallery-hero img { max-height: 240px; }
  .gallery-hero-title { font-size: 0.8rem; }
  .gallery-day-label { font-size: 0.7rem; }
  .gallery-phase-tag { font-size: 0.5rem; }
  .gallery-lb-nav {
    padding: 0.5rem 0.75rem;
    font-size: 1.2rem;
  }
  .gallery-lb-prev { left: 4px; }
  .gallery-lb-next { right: 4px; }
  .gallery-lb-caption { padding: 0.5rem 0.75rem 0; }
  .gallery-lb-title { font-size: 0.75rem; }
  .gallery-lb-desc { font-size: 0.65rem; max-height: 2.5em; }
}

/* ===== Server-rendered static itinerary (SEO) ===== */
.itinerary-static {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.itinerary-static .itin-phase-group {
  margin-bottom: 1rem;
}
.itinerary-static .itin-phase-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.4rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e5e7eb;
}
.itinerary-static .itin-events {
  list-style: none;
  padding: 0;
  margin: 0;
}
.itinerary-static .itin-event {
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.8rem;
  color: #374151;
}
.itinerary-static .itin-met {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: 0.25rem;
}
.itinerary-static .itin-utc {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-right: 0.5rem;
}

/* ===== FAQ Section (SEO) ===== */
.faq-section h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
}
.faq-item {
  border-bottom: 1px solid #e5e7eb;
  padding: 0;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-question {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 0;
  cursor: pointer;
  color: #1f2937;
  list-style: none;
}
.faq-question::-webkit-details-marker {
  display: none;
}
.faq-question::before {
  content: '\25B6';
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.6rem;
  transition: transform 0.2s;
  color: #6b7280;
}
.faq-item[open] .faq-question::before {
  transform: rotate(90deg);
}
.faq-answer {
  padding: 0 0 0.6rem 1.1rem;
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.6;
}
.faq-answer p {
  margin: 0;
}
