:root {
  --bg: #020308;
  --glass: rgba(8, 11, 20, 0.62);
  --glass-strong: rgba(8, 12, 22, 0.80);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef3fb;
  --text-muted: rgba(206, 218, 238, 0.64);
  --text-dim: rgba(180, 196, 220, 0.44);
  --cyan: #5ce4ff;
  --gold: #ffbe64;
  --flare: #ff7e47;
  --danger: #ff5b6b;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#gl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
}

#gl-canvas:active {
  cursor: grabbing;
}

/* Cinema mode hides all HUD gracefully */
body.cinema-mode .hud-fade {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}

.hud-fade {
  transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ------------------------------------------------------------------------- */
/* Top-Left Masthead & Relativistic Dual Chronometer                         */
/* ------------------------------------------------------------------------- */
.masthead {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 190, 100, 0.9), 0 0 2px #fff;
  animation: pulseGlow 2.8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.84); }
}

.brand-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

.brand-divider {
  color: var(--text-dim);
  font-size: 12px;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

.chronometer-bar {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  width: fit-content;
}

.chrono-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chrono-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.chrono-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.chrono-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.accent-cyan {
  color: var(--cyan);
}

.accent-gold {
  color: var(--gold);
}

.scene-caption {
  font-size: 11px;
  color: rgba(214, 226, 244, 0.56);
  letter-spacing: 0.015em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.92);
  max-width: 390px;
  line-height: 1.35;
}

.icon-btn.tour-accent {
  background: linear-gradient(135deg, rgba(255, 190, 100, 0.20), rgba(255, 126, 71, 0.12));
  border-color: rgba(255, 190, 100, 0.44);
  color: #fff2dc;
}

.icon-btn.tour-accent:hover {
  background: linear-gradient(135deg, rgba(255, 190, 100, 0.34), rgba(255, 126, 71, 0.22));
  border-color: rgba(255, 206, 130, 0.78);
  box-shadow: 0 0 16px rgba(255, 190, 100, 0.24);
}

.icon-btn.tour-accent[aria-pressed='true'] {
  background: rgba(255, 190, 100, 0.28);
  border-color: rgba(255, 210, 140, 0.78);
}

.status-safe {
  color: #6df0b5;
}

.status-warn {
  color: var(--gold);
}

.status-danger {
  color: #ff6b7a;
}

/* ------------------------------------------------------------------------- */
/* Live 3D Museum Anatomy Callouts Overlay                                   */
/* ------------------------------------------------------------------------- */
.annotations-layer {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.32s ease;
}

.annotations-layer.visible {
  opacity: 1;
}

.annotations-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ann-line {
  fill: none;
  stroke-width: 1.15;
  stroke-dasharray: 2 2;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.ann-line.accent-gold { stroke: rgba(255, 196, 112, 0.78); }
.ann-line.accent-cyan { stroke: rgba(92, 228, 255, 0.82); }
.ann-line.accent-flare { stroke: rgba(255, 138, 86, 0.78); }
.ann-line.accent-violet { stroke: rgba(182, 154, 255, 0.78); }
.ann-line.accent-danger { stroke: rgba(255, 102, 118, 0.78); }

.ann-dot-outer {
  fill: none;
  stroke-width: 1.2;
  opacity: 0.65;
}

.ann-dot-outer.accent-gold { stroke: var(--gold); }
.ann-dot-outer.accent-cyan { stroke: var(--cyan); }
.ann-dot-outer.accent-flare { stroke: var(--flare); }
.ann-dot-outer.accent-violet { stroke: #b89aff; }
.ann-dot-outer.accent-danger { stroke: var(--danger); }

.ann-dot-inner {
  fill: #ffffff;
}

.annotations-pins {
  position: absolute;
  inset: 0;
}

.ann-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 218px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(7, 11, 20, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left-width: 2.5px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s ease;
  will-change: transform;
}

.ann-card.accent-gold { border-left-color: var(--gold); }
.ann-card.accent-cyan { border-left-color: var(--cyan); }
.ann-card.accent-flare { border-left-color: var(--flare); }
.ann-card.accent-violet { border-left-color: #b89aff; }
.ann-card.accent-danger { border-left-color: var(--danger); }

.ann-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 2px;
}

.ann-desc {
  font-size: 10.8px;
  line-height: 1.35;
  color: rgba(214, 226, 244, 0.76);
}

/* ------------------------------------------------------------------------- */
/* Draggable Einstein vs. Flat Space Split-Screen Curtain                    */
/* ------------------------------------------------------------------------- */
.split-curtain {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.split-curtain[hidden] {
  display: none;
}

.split-badge {
  position: absolute;
  top: 132px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.split-badge.left {
  left: 24px;
  border-left: 2.5px solid rgba(210, 224, 245, 0.55);
}

.split-badge.right {
  right: 24px;
  text-align: right;
  border-right: 2.5px solid var(--gold);
}

.split-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #eef4ff;
}

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

.split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.split-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08),
    rgba(255, 214, 148, 0.85) 22%,
    rgba(255, 255, 255, 0.92) 50%,
    rgba(92, 228, 255, 0.85) 78%,
    rgba(255, 255, 255, 0.08)
  );
  box-shadow: 0 0 14px rgba(255, 200, 115, 0.45);
}

.split-handle {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 15, 28, 0.88);
  border: 1.5px solid rgba(255, 214, 148, 0.78);
  color: #ffffff;
  font-size: 14px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 22px rgba(255, 190, 100, 0.35), 0 6px 18px rgba(0, 0, 0, 0.6);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.split-divider:hover .split-handle,
.split-divider.dragging .split-handle {
  transform: scale(1.12);
  border-color: #ffffff;
}

/* ------------------------------------------------------------------------- */
/* Subtle First-Visit Welcome Card                                           */
/* ------------------------------------------------------------------------- */
.welcome-card {
  position: fixed;
  left: 24px;
  bottom: 84px;
  z-index: 24;
  width: 418px;
  max-width: calc(100vw - 48px);
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(8, 12, 23, 0.78);
  border: 1px solid rgba(255, 190, 100, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.welcome-card[hidden] {
  display: none;
}

.welcome-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.welcome-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--gold);
}

.welcome-close {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}

.welcome-close:hover {
  color: #ffffff;
}

.welcome-text {
  font-size: 12.2px;
  line-height: 1.48;
  color: rgba(232, 240, 252, 0.86);
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.welcome-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.welcome-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--border-strong);
}

.welcome-btn.primary {
  background: linear-gradient(135deg, rgba(255, 190, 100, 0.26), rgba(255, 130, 68, 0.18));
  border-color: rgba(255, 190, 100, 0.54);
  color: #fff5e6;
}

.welcome-btn.primary:hover {
  background: linear-gradient(135deg, rgba(255, 190, 100, 0.40), rgba(255, 130, 68, 0.28));
}

/* ------------------------------------------------------------------------- */
/* Choreographed Guided Tour Lower-Third Bar                                 */
/* ------------------------------------------------------------------------- */
.tour-bar {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  width: 680px;
  max-width: calc(100vw - 32px);
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.84);
  border: 1px solid rgba(255, 190, 100, 0.30);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.tour-bar[hidden] {
  display: none;
}

.tour-progress-track {
  width: 100%;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.08);
}

.tour-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  transition: width 0.1s linear;
}

.tour-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px 13px;
}

.tour-copy {
  flex: 1;
  min-width: 0;
}

.tour-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 3px;
}

.tour-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.tour-body {
  font-size: 12px;
  line-height: 1.48;
  color: var(--text-muted);
}

.tour-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.tour-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tour-dot.done {
  background: rgba(92, 228, 255, 0.55);
}

.tour-dot.active {
  width: 20px;
  background: var(--gold);
}

.tour-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-btn.primary {
  background: rgba(92, 228, 255, 0.16);
  border-color: rgba(92, 228, 255, 0.45);
  color: #e6fbff;
}

.mini-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.exp-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.exp-run-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text-muted);
}

.exp-run-btn.secondary:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-strong);
  box-shadow: none;
}

/* ------------------------------------------------------------------------- */
/* Top-Right Actions                                                         */
/* ------------------------------------------------------------------------- */
.top-actions {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perf-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(6, 9, 18, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn[aria-pressed='true'],
.icon-btn[aria-expanded='true'] {
  background: rgba(92, 228, 255, 0.16);
  border-color: rgba(92, 228, 255, 0.48);
  color: #ffffff;
}

.icon-btn.primary-outline {
  border-color: rgba(255, 190, 100, 0.34);
}

.icon-btn.primary-outline:hover {
  border-color: rgba(255, 190, 100, 0.65);
  background: rgba(255, 190, 100, 0.12);
}

#btn-audio:not([aria-pressed='true']) .audio-wave {
  opacity: 0.25;
}

.cinema-exit-pill {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 40;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(8, 11, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: opacity 0.25s ease, background 0.2s ease;
}

.cinema-exit-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ------------------------------------------------------------------------- */
/* Toast Banner                                                              */
/* ------------------------------------------------------------------------- */
.toast-banner {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translate(-50%, -10px);
  z-index: 35;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(10, 15, 28, 0.84);
  border: 1px solid rgba(255, 190, 100, 0.35);
  color: #f8fbff;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.toast-banner.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------------- */
/* Bottom Observatory Floating Dock                                          */
/* ------------------------------------------------------------------------- */
.bottom-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.dock-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 15px;
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  flex-wrap: nowrap;
  justify-content: center;
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.dock-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 3px;
}

.dock-btn {
  height: 31px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.dock-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.dock-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.action-btn .action-glyph {
  font-size: 13px;
  line-height: 1;
}

.action-btn.flare {
  background: linear-gradient(135deg, rgba(255, 132, 68, 0.24), rgba(255, 190, 96, 0.14));
  border-color: rgba(255, 166, 92, 0.42);
  color: #ffe8cf;
}

.action-btn.flare:hover {
  background: linear-gradient(135deg, rgba(255, 132, 68, 0.38), rgba(255, 190, 96, 0.26));
  border-color: rgba(255, 188, 118, 0.72);
  box-shadow: 0 0 18px rgba(255, 140, 68, 0.26);
}

.action-btn.cyan {
  background: rgba(92, 228, 255, 0.12);
  border-color: rgba(92, 228, 255, 0.34);
  color: #dff8ff;
}

.action-btn.cyan:hover {
  background: rgba(92, 228, 255, 0.24);
  border-color: rgba(92, 228, 255, 0.62);
  box-shadow: 0 0 16px rgba(92, 228, 255, 0.22);
}

.action-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--border-strong);
}

.action-btn[aria-pressed='true'] {
  background: rgba(154, 128, 255, 0.24);
  border-color: rgba(176, 152, 255, 0.58);
  color: #ffffff;
}

.action-btn:active {
  transform: scale(0.96);
}

.dock-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(196, 210, 232, 0.50);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  transition: opacity 0.6s ease;
}

.dock-hint kbd {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  font-family: inherit;
  font-size: 9.5px;
  color: rgba(235, 243, 255, 0.78);
}

/* ------------------------------------------------------------------------- */
/* Collapsible Right Astrophysics Lab Drawer                                 */
/* ------------------------------------------------------------------------- */
.lab-drawer {
  position: fixed;
  top: 66px;
  right: 24px;
  bottom: 92px;
  width: 344px;
  max-width: calc(100vw - 32px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;

  transform: translateX(calc(100% + 36px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.lab-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

body.cinema-mode .lab-drawer.open {
  opacity: 0;
  pointer-events: none;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 2px;
}

.drawer-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.section-tag {
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.section-hint {
  color: var(--gold);
  letter-spacing: 0.02em;
  font-size: 9.5px;
}

/* Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tel-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.tel-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.tel-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.tel-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Effective Potential Graph */
.potential-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(3, 5, 11, 0.8);
}

#potential-canvas {
  display: block;
  width: 100%;
  height: 148px;
  cursor: crosshair;
}

.probe-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.mini-btn {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
}

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

/* Precision Sliders */
.control-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

.control-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--gold);
  box-shadow: 0 0 10px rgba(255, 190, 100, 0.65);
  transition: transform 0.12s ease;
}

input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

/* Toggle Chips */
.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.toggle-chip {
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.toggle-chip:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.toggle-chip.active {
  background: rgba(92, 228, 255, 0.14);
  border-color: rgba(92, 228, 255, 0.45);
  color: #e6fbff;
}

/* Segmented Controls */
.segmented-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seg-label {
  font-size: 11.5px;
  color: var(--text-muted);
  min-width: 56px;
}

.seg-group {
  display: flex;
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  flex: 1;
  padding: 5px 4px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn:hover {
  color: #ffffff;
}

.seg-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* ------------------------------------------------------------------------- */
/* Observatory Field Guide Modal                                             */
/* ------------------------------------------------------------------------- */
.guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 4, 10, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeInBackdrop 0.22s ease;
}

.guide-backdrop[hidden] {
  display: none;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guide-dialog {
  width: 780px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(8, 12, 22, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  animation: modalRise 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalRise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.guide-eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 3px;
}

.guide-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #ffffff;
}

.guide-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.guide-tab {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.guide-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.guide-tab.active {
  color: #ffffff;
  background: rgba(92, 228, 255, 0.14);
  border-color: rgba(92, 228, 255, 0.42);
}

.guide-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px 22px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.guide-panel {
  display: none;
}

.guide-panel.active {
  display: block;
}

.guide-lead {
  font-size: 12.6px;
  line-height: 1.52;
  color: var(--text-muted);
  margin-bottom: 13px;
}

/* Interactive Experiments Grid */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exp-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.085);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.16s ease;
}

.exp-card:hover {
  background: rgba(255, 255, 255, 0.052);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.exp-card.wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.exp-wide-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.exp-card.wide .exp-run-btn {
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.exp-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.exp-badge.gold {
  color: var(--gold);
  background: rgba(255, 190, 100, 0.12);
  border-color: rgba(255, 190, 100, 0.28);
}

.exp-badge.flare {
  color: #ffb085;
  background: rgba(255, 126, 71, 0.14);
  border-color: rgba(255, 126, 71, 0.30);
}

.exp-badge.cyan {
  color: var(--cyan);
  background: rgba(92, 228, 255, 0.12);
  border-color: rgba(92, 228, 255, 0.28);
}

.exp-badge.violet {
  color: #c6b0ff;
  background: rgba(156, 124, 255, 0.14);
  border-color: rgba(156, 124, 255, 0.30);
}

.exp-card h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}

.exp-card p {
  font-size: 12px;
  line-height: 1.54;
  color: var(--text-muted);
  flex: 1;
}

.exp-card code,
.physics-item code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #e2f5ff;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 4px;
}

.exp-run-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(92, 228, 255, 0.36);
  background: rgba(92, 228, 255, 0.12);
  color: #e6fbff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.exp-run-btn:hover {
  background: rgba(92, 228, 255, 0.24);
  border-color: rgba(92, 228, 255, 0.68);
  box-shadow: 0 0 16px rgba(92, 228, 255, 0.20);
}

/* Physics Inside Tab */
.physics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.physics-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.physics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.physics-head h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.eq-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  background: rgba(255, 190, 100, 0.10);
  border: 1px solid rgba(255, 190, 100, 0.26);
  padding: 3px 9px;
  border-radius: 999px;
}

.physics-item p {
  font-size: 12.2px;
  line-height: 1.58;
  color: var(--text-muted);
}

/* Controls & Shortcuts Tab */
.controls-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.controls-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.controls-card h3 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px;
}

.shortcut-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shortcut-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.shortcut-list kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.kbd-combo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
}

.guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.guide-foot-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .dock-shell {
    flex-wrap: wrap;
  }
  .dock-divider {
    display: none;
  }
}

@media (max-width: 720px) {
  .exp-grid,
  .controls-columns {
    grid-template-columns: 1fr;
  }
  .exp-card.wide {
    flex-direction: column;
    align-items: flex-start;
  }
  .exp-card.wide .exp-run-btn {
    align-self: flex-start;
  }
  .guide-foot-note {
    display: none;
  }
}

@media (max-width: 820px) {
  .masthead {
    top: 12px;
    left: 12px;
  }
  .top-actions {
    top: 12px;
    right: 12px;
  }
  .perf-pill,
  .dock-hint,
  .brand-divider,
  .brand-sub {
    display: none;
  }
  .lab-drawer {
    top: 56px;
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
  }
}
