/* ==========================================================================
   穹苍星图 · COSMOS ATLAS — Observatory Deep-Space Aesthetic System
   Designed like Stellarium / SpaceEngine / JWST Telemetry Instrument
   ========================================================================== */

:root {
  --bg-void: #020308;
  --glass-bg: rgba(7, 11, 22, 0.72);
  --glass-bg-strong: rgba(6, 10, 20, 0.88);
  --glass-hover: rgba(140, 190, 255, 0.1);
  --hairline: rgba(175, 208, 255, 0.15);
  --hairline-bright: rgba(175, 208, 255, 0.34);

  --text-primary: #eef4ff;
  --text-secondary: rgba(215, 228, 250, 0.72);
  --text-muted: rgba(165, 186, 220, 0.5);

  --accent-gold: #e6c587;
  --accent-cyan: #76ccff;
  --accent-rose: #e88fa3;
  --accent-emerald: #6ee7b7;

  --font-sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Consolas", "SF Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}

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

.hidden {
  display: none !important;
}

/* ---------- Fullscreen 3D Cosmos Viewport ---------- */
#cosmos-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #060916 0%, #020308 100%);
  cursor: grab;
}

#cosmos-viewport:active {
  cursor: grabbing;
}

#cosmos-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.optical-vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 58%, rgba(1, 2, 6, 0.52) 100%);
  z-index: 2;
}

/* ---------- 3D Star-Chart Labels & Reticles ---------- */
#star-labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.star-marker {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.25s ease;
  will-change: transform, opacity;
}

.star-reticle {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(180, 215, 255, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.star-reticle::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(230, 240, 255, 0.85);
}

.star-marker.discovered .star-reticle {
  border-color: rgba(230, 197, 135, 0.65);
}

.star-marker.discovered .star-reticle::before {
  background: var(--accent-gold);
}

.star-marker.focused .star-reticle {
  width: 28px;
  height: 28px;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(118, 204, 255, 0.45), inset 0 0 8px rgba(118, 204, 255, 0.2);
}

.star-marker.focused .star-reticle::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(118, 204, 255, 0.4);
  animation: reticleSpin 18s linear infinite;
}

.star-marker.mission-target .star-reticle {
  width: 26px;
  height: 26px;
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(230, 197, 135, 0.6);
  animation: pulseRing 2s ease-in-out infinite;
}

.star-marker:hover .star-reticle {
  transform: scale(1.28);
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.45);
}

.star-tag {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95), 0 0 16px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

.star-tag-name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(236, 244, 255, 0.92);
}

.star-marker.focused .star-tag-name {
  color: #ffffff;
  font-weight: 600;
}

.star-marker.mission-target .star-tag-name {
  color: var(--accent-gold);
}

.star-tag-sub {
  font-size: 10px;
  color: rgba(168, 196, 232, 0.66);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

@keyframes reticleSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 10px rgba(230, 197, 135, 0.35); }
  50% { box-shadow: 0 0 22px rgba(230, 197, 135, 0.85); }
}

/* ---------- Off-Screen Guided Compass Beacon ---------- */
.guide-beacon {
  position: fixed;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 8px;
  background: rgba(12, 16, 28, 0.82);
  border: 1px solid rgba(230, 197, 135, 0.55);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(230, 197, 135, 0.25);
}

.guide-beacon-arrow {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--accent-gold);
}

.guide-beacon-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.guide-beacon-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
}

.guide-beacon-name {
  font-size: 11px;
  color: #fff;
  font-weight: 500;
}

/* ---------- Loading Screen ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 45%, #0a1024 0%, #020308 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-astrolabe {
  position: relative;
  width: 78px;
  height: 78px;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
}

.loader-ring.r1 {
  border-top-color: var(--accent-gold);
  border-right-color: rgba(230, 197, 135, 0.22);
  animation: reticleSpin 2.4s linear infinite;
}

.loader-ring.r2 {
  inset: 10px;
  border-bottom-color: var(--accent-cyan);
  border-left-color: rgba(118, 204, 255, 0.25);
  animation: reticleSpin 3.6s linear infinite reverse;
}

.loader-ring.r3 {
  inset: 22px;
  border-top-color: rgba(255, 255, 255, 0.65);
  animation: reticleSpin 1.8s linear infinite;
}

.loader-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 18px 4px rgba(230, 197, 135, 0.7);
}

.loader-title {
  font-size: 16px;
  letter-spacing: 0.28em;
  font-weight: 500;
  color: var(--text-primary);
}

.loader-subtitle {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* ---------- HUD Root ---------- */
#hud-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#hud-root.pure-hidden {
  opacity: 0;
  pointer-events: none !important;
}

#hud-root.pure-hidden * {
  pointer-events: none !important;
}

/* ---------- Top-Left Telemetry Header ---------- */
.hud-top-left {
  position: fixed;
  top: 18px;
  left: 22px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(640px, calc(100vw - 320px));
}

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

.brand-glyph {
  color: var(--accent-gold);
  font-size: 14px;
  text-shadow: 0 0 12px rgba(230, 197, 135, 0.65);
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #ffffff;
}

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

.hud-divider {
  width: 1px;
  height: 12px;
  background: var(--hairline-bright);
  margin: 0 2px;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(12, 18, 34, 0.65);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--accent-gold);
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, background 0.2s;
}

.rank-pill:hover {
  border-color: rgba(230, 197, 135, 0.55);
  background: rgba(230, 197, 135, 0.1);
}

.rank-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

#hud-discovery-count {
  color: var(--text-secondary);
  font-size: 10.5px;
}

.scale-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.crumb-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

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

.crumb-btn.active {
  color: var(--accent-cyan);
  font-weight: 500;
}

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

.telemetry-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.telemetry-line .sep {
  opacity: 0.4;
}

/* ---------- Top-Center Focus Exit & Return Pill ---------- */
.focus-exit-bar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(7, 12, 26, 0.86);
  border: 1px solid rgba(118, 204, 255, 0.42);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 22px rgba(118, 204, 255, 0.16);
  z-index: 30;
  animation: toastSlide 0.25s ease;
}

.focus-pill-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  padding: 0 6px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exit-pill-sep {
  width: 1px;
  height: 14px;
  background: var(--hairline-bright);
}

.exit-pill-btn {
  height: 26px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}

.exit-pill-btn:hover {
  background: rgba(118, 204, 255, 0.16);
  border-color: var(--accent-cyan);
  color: #fff;
}

.exit-pill-btn.primary {
  background: rgba(118, 204, 255, 0.18);
  border-color: rgba(118, 204, 255, 0.6);
  color: #d6f0ff;
  font-weight: 500;
}

.exit-pill-btn.primary:hover {
  background: rgba(118, 204, 255, 0.32);
  color: #ffffff;
}

.exit-pill-btn.gold {
  border-color: rgba(230, 197, 135, 0.45);
  color: var(--accent-gold);
}

.exit-pill-btn.gold:hover {
  background: rgba(230, 197, 135, 0.18);
  border-color: var(--accent-gold);
  color: #fff;
}

/* ---------- Top-Right Actions & Mission Tracker ---------- */
.hud-top-right {
  position: fixed;
  top: 18px;
  right: 22px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.top-action-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  background: var(--glass-bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.hud-icon-btn:hover {
  border-color: var(--hairline-bright);
  background: rgba(20, 30, 52, 0.85);
}

.hud-icon-btn.accent {
  border-color: rgba(230, 197, 135, 0.4);
  color: var(--accent-gold);
}

.hud-icon-btn.accent:hover {
  background: rgba(230, 197, 135, 0.14);
  border-color: rgba(230, 197, 135, 0.72);
}

.hud-icon-btn.obs-switch {
  border-color: rgba(118, 204, 255, 0.55);
  background: rgba(24, 52, 92, 0.55);
  color: #b8e6ff;
  font-weight: 500;
}

.hud-icon-btn.obs-switch:hover,
.hud-icon-btn.obs-switch.active {
  background: rgba(118, 204, 255, 0.24);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(118, 204, 255, 0.28);
}

/* ---------- Earth Ground Observatory Mode HUD ---------- */
.obs-labels-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}

.obs-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

.obs-eyepiece-ring {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(circle at 50% 50%, transparent 32%, rgba(2, 4, 10, 0.58) 44%, rgba(1, 2, 6, 0.94) 54%);
}

.eyepiece-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 380px;
  height: 380px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(118, 204, 255, 0.28);
  box-shadow: 0 0 40px rgba(118, 204, 255, 0.12);
}

.eyepiece-crosshair::before,
.eyepiece-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(118, 204, 255, 0.22);
}

.eyepiece-crosshair::before {
  left: 50%; top: -24px; bottom: -24px; width: 1px;
}

.eyepiece-crosshair::after {
  top: 50%; left: -24px; right: -24px; height: 1px;
}

.obs-site-info {
  position: fixed;
  top: 18px;
  left: 22px;
  max-width: 420px;
  pointer-events: auto;
  padding: 12px 16px;
  background: rgba(6, 11, 24, 0.74);
  border: 1px solid rgba(118, 204, 255, 0.24);
  border-left: 2px solid var(--accent-cyan);
  border-radius: 5px;
  backdrop-filter: blur(14px);
}

.obs-site-badge {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.obs-site-name {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 3px;
}

.obs-site-coords {
  font-size: 11px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.obs-site-desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.obs-live-tele {
  font-size: 11px;
  color: var(--accent-gold);
  padding-top: 6px;
  border-top: 1px solid var(--hairline);
}

.obs-bottom-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 14px;
  background: rgba(6, 10, 22, 0.82);
  border: 1px solid var(--hairline-bright);
  border-radius: 9px;
  backdrop-filter: blur(16px);
  max-width: calc(100vw - 28px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
}

.obs-dock-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.obs-row-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  min-width: 72px;
}

.obs-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.obs-pill {
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.18s;
}

.obs-pill:hover {
  border-color: var(--accent-cyan);
  color: #fff;
  background: rgba(118, 204, 255, 0.14);
}

.obs-pill.active {
  background: rgba(230, 197, 135, 0.18);
  border-color: var(--accent-gold);
  color: #fff;
  font-weight: 500;
}

.obs-actions-row {
  padding-top: 4px;
  border-top: 1px solid var(--hairline);
  justify-content: center;
}

/* ---------- Compact Top-Right Secondary Time Speed Pill ---------- */
.top-time-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  background: rgba(7, 11, 22, 0.62);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.dock-btn.mini {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

/* ---------- Signature Prominent Bottom Observatory Launchpad ---------- */
.obs-hero-group {
  gap: 6px;
}

.obs-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  background: linear-gradient(135deg, rgba(230, 197, 135, 0.28) 0%, rgba(118, 204, 255, 0.26) 100%);
  border: 1px solid rgba(230, 197, 135, 0.78);
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(230, 197, 135, 0.26), inset 0 0 12px rgba(118, 204, 255, 0.16);
  transition: all 0.22s ease;
}

.obs-hero-btn:hover {
  transform: translateY(-1px);
  border-color: #ffffff;
  background: linear-gradient(135deg, rgba(230, 197, 135, 0.44) 0%, rgba(118, 204, 255, 0.38) 100%);
  box-shadow: 0 0 28px rgba(230, 197, 135, 0.48);
}

.obs-hero-icon {
  font-size: 14px;
}

.obs-quick-sites {
  display: flex;
  align-items: center;
  gap: 4px;
}

.obs-quick-chip {
  height: 26px;
  padding: 0 8px;
  background: rgba(118, 204, 255, 0.08);
  border: 1px solid rgba(118, 204, 255, 0.28);
  border-radius: 4px;
  color: #cdeaff;
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s;
}

.obs-quick-chip:hover {
  background: rgba(118, 204, 255, 0.24);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

/* ---------- 3D Interactive Observatory Site Pins on Earth Globe ---------- */
.earth-site-pin {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 5px;
  background: rgba(8, 15, 32, 0.78);
  border: 1px solid rgba(230, 197, 135, 0.62);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 14px rgba(230, 197, 135, 0.3);
  transition: transform 0.16s ease, border-color 0.2s, background 0.2s;
  will-change: transform;
  z-index: 8;
}

.earth-site-pin:hover {
  border-color: #ffffff;
  background: rgba(230, 197, 135, 0.28);
  box-shadow: 0 0 22px rgba(230, 197, 135, 0.65);
}

.site-pin-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
  animation: pulseRing 2.2s ease-in-out infinite;
}

.site-pin-label {
  font-size: 10.5px;
  font-weight: 500;
  color: #fff6e0;
  white-space: nowrap;
}

/* Hide space-only HUD widgets cleanly while in Earth Observatory Mode */
#hud-root.observatory-mode .hud-top-left,
#hud-root.observatory-mode .top-time-bar,
#hud-root.observatory-mode .scale-ruler,
#hud-root.observatory-mode .hud-bottom-bar,
#hud-root.observatory-mode .interaction-hint,
#hud-root.observatory-mode #focus-exit-bar {
  display: none !important;
}

.hud-icon-btn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--hairline);
  color: var(--text-muted);
}

/* Mission Tracker Strip */
.mission-tracker {
  width: 288px;
  padding: 12px 14px;
  background: var(--glass-bg-strong);
  border: 1px solid rgba(230, 197, 135, 0.32);
  border-left: 2px solid var(--accent-gold);
  border-radius: 4px;
  backdrop-filter: blur(14px);
}

.mission-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.mission-tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  padding: 1px 6px;
  border: 1px solid rgba(230, 197, 135, 0.35);
  border-radius: 2px;
}

.mission-name {
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
  flex: 1;
}

.mission-desc {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.mission-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mission-footer .mono {
  font-size: 11px;
  color: var(--text-muted);
}

.mission-btns {
  display: flex;
  gap: 6px;
}

/* ---------- Right-Edge Logarithmic Scale Ruler ---------- */
.scale-ruler {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 22;
}

.ruler-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.ruler-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.ruler-power {
  font-size: 11px;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.ruler-track {
  position: relative;
  width: 28px;
  height: 290px;
  cursor: ns-resize;
  display: flex;
  justify-content: flex-end;
}

.ruler-track::before {
  content: "";
  position: absolute;
  right: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(230, 197, 135, 0.55) 0%,
    rgba(118, 204, 255, 0.45) 50%,
    rgba(110, 231, 183, 0.5) 100%
  );
  border-radius: 2px;
  opacity: 0.45;
}

.ruler-fill {
  position: absolute;
  right: 7px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to top, var(--accent-cyan), var(--accent-gold));
  border-radius: 2px;
  pointer-events: none;
}

.ruler-thumb {
  position: absolute;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(118, 204, 255, 0.85);
  transform: translateY(-50%);
  pointer-events: none;
  transition: box-shadow 0.2s;
}

.ruler-notches {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ruler-notch {
  position: absolute;
  right: 13px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
  cursor: pointer;
  padding: 2px 0;
}

.ruler-notch-text {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.18s;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.ruler-notch-tick {
  width: 6px;
  height: 1px;
  background: rgba(185, 215, 255, 0.35);
  transition: width 0.18s, background 0.18s;
}

.ruler-notch:hover .ruler-notch-text,
.ruler-notch.active .ruler-notch-text {
  color: #ffffff;
}

.ruler-notch:hover .ruler-notch-tick,
.ruler-notch.active .ruler-notch-tick {
  width: 11px;
  background: var(--accent-gold);
}

.ruler-zoom-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ruler-btn {
  width: 24px;
  height: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.ruler-btn:hover {
  border-color: var(--hairline-bright);
  background: rgba(118, 204, 255, 0.14);
}

/* ---------- Slide-Out Observatory Dossier Drawer (NOT a Card Page) ---------- */
.dossier-drawer {
  position: fixed;
  left: 22px;
  top: 94px;
  bottom: 92px;
  width: 348px;
  max-width: calc(100vw - 44px);
  pointer-events: auto;
  background: linear-gradient(165deg, rgba(8, 13, 27, 0.86) 0%, rgba(4, 7, 15, 0.92) 100%);
  border: 1px solid var(--hairline);
  border-left: 2px solid rgba(118, 204, 255, 0.55);
  border-radius: 4px;
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.dossier-drawer.collapsed {
  transform: translateX(calc(-100% - 36px));
  opacity: 0;
  pointer-events: none;
}

.dossier-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 6px;
}

.dossier-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
}

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

.mini-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
}

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

.dossier-title-block {
  padding: 2px 16px 12px;
}

.dossier-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #ffffff;
  margin-bottom: 4px;
}

.dossier-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.dossier-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px 12px;
}

.scan-btn {
  flex: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: rgba(230, 197, 135, 0.13);
  border: 1px solid rgba(230, 197, 135, 0.5);
  border-radius: 4px;
  color: var(--accent-gold);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.scan-btn:hover {
  background: rgba(230, 197, 135, 0.22);
  box-shadow: 0 0 16px rgba(230, 197, 135, 0.25);
}

.scan-btn.scanned {
  background: rgba(110, 231, 183, 0.1);
  border-color: rgba(110, 231, 183, 0.45);
  color: var(--accent-emerald);
}

.hairline-btn {
  height: 30px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.hairline-btn:hover {
  border-color: var(--hairline-bright);
  background: rgba(118, 204, 255, 0.12);
}

.hairline-btn.primary {
  border-color: rgba(118, 204, 255, 0.5);
  color: var(--accent-cyan);
}

/* Segmented Hairline Tabs */
.dossier-tabs {
  display: flex;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 0 10px;
}

.dossier-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

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

.dossier-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  font-weight: 500;
}

/* Scrollable Dossier Content */
.dossier-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(175, 208, 255, 0.22) transparent;
}

.dossier-body::-webkit-scrollbar {
  width: 4px;
}

.dossier-body::-webkit-scrollbar-thumb {
  background: rgba(175, 208, 255, 0.24);
  border-radius: 4px;
}

.tab-panel {
  display: none;
}

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

.dossier-lead {
  font-size: 12.5px;
  line-height: 1.72;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hairline);
}

.section-label:first-child {
  margin-top: 0;
}

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

.lore-urban-label {
  color: var(--accent-rose);
}

/* Crisp Telemetry Grid (No boxy cards, clean hairline table) */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-bottom: 14px;
}

.tele-item {
  border-bottom: 1px solid rgba(175, 208, 255, 0.08);
  padding-bottom: 6px;
}

.tele-item dt {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.tele-item dd {
  font-size: 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

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

.inline-body-link {
  background: rgba(118, 204, 255, 0.07);
  border: 1px solid rgba(118, 204, 255, 0.22);
  border-radius: 3px;
  padding: 4px 9px;
  color: var(--text-primary);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.inline-body-link:hover {
  background: rgba(118, 204, 255, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
}

.editorial-prose {
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(226, 236, 252, 0.88);
  user-select: text;
}

.editorial-prose p {
  margin-bottom: 10px;
}

.lore-block {
  margin-bottom: 16px;
}

/* Quiz Panel */
.quiz-intro {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.quiz-question {
  font-size: 13.5px;
  line-height: 1.65;
  color: #fff;
  font-weight: 500;
  margin-bottom: 12px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.quiz-opt-btn {
  text-align: left;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: rgba(118, 204, 255, 0.1);
}

.quiz-opt-btn.correct {
  border-color: var(--accent-emerald);
  background: rgba(110, 231, 183, 0.14);
  color: var(--accent-emerald);
}

.quiz-opt-btn.wrong {
  border-color: var(--accent-rose);
  background: rgba(232, 143, 163, 0.12);
  color: var(--accent-rose);
}

.quiz-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent-gold);
  background: rgba(230, 197, 135, 0.08);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-primary);
}

/* ---------- Bottom Stellarium Control Dock ---------- */
.hud-bottom-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  padding: 6px 10px;
  background: var(--glass-bg);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  max-width: calc(100vw - 28px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.hud-bottom-bar::-webkit-scrollbar {
  display: none;
}

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

.dock-sep {
  width: 1px;
  height: 18px;
  background: var(--hairline);
  flex-shrink: 0;
}

.dock-btn {
  width: 28px;
  height: 26px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-btn:hover {
  border-color: var(--accent-cyan);
}

.speed-selector {
  display: flex;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}

.speed-btn {
  background: transparent;
  border: none;
  padding: 4px 7px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s;
}

.speed-btn:hover {
  color: #fff;
}

.speed-btn.active {
  background: rgba(118, 204, 255, 0.18);
  color: var(--accent-cyan);
}

.dock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.18s;
}

.dock-toggle .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(175, 208, 255, 0.25);
}

.dock-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.dock-toggle.active {
  color: var(--text-primary);
  border-color: rgba(118, 204, 255, 0.26);
  background: rgba(118, 204, 255, 0.08);
}

.dock-toggle.active .dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.scale-jump-btn {
  padding: 4px 8px;
  background: rgba(230, 197, 135, 0.06);
  border: 1px solid rgba(230, 197, 135, 0.22);
  border-radius: 4px;
  color: var(--accent-gold);
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s;
}

.scale-jump-btn:hover {
  background: rgba(230, 197, 135, 0.18);
  border-color: var(--accent-gold);
  color: #fff;
}

/* ---------- Subtle Hint & Toast ---------- */
#obs-target-pill {
  top: 66px;
}

.interaction-hint {
  position: fixed;
  bottom: 106px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(185, 206, 238, 0.5);
  letter-spacing: 0.05em;
  pointer-events: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  transition: opacity 1s ease;
  white-space: nowrap;
}

.discovery-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(8, 13, 27, 0.9);
  border: 1px solid rgba(230, 197, 135, 0.55);
  border-radius: 6px;
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(230, 197, 135, 0.2);
  z-index: 40;
  animation: toastSlide 0.35s ease;
}

.toast-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 13px;
}

.toast-kicker {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
}

.toast-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.restore-hud-pill {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: 50;
  padding: 6px 14px;
  background: rgba(8, 12, 24, 0.72);
  border: 1px solid var(--hairline-bright);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

/* ---------- Command Palette Search & Odyssey Overlays ---------- */
.overlay-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 4, 10, 0.62);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-panel,
.odyssey-panel {
  width: min(620px, calc(100vw - 32px));
  background: rgba(7, 12, 24, 0.94);
  border: 1px solid var(--hairline-bright);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
}

.search-glyph {
  font-size: 17px;
  color: var(--accent-cyan);
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
}

#search-input::placeholder {
  color: var(--text-muted);
}

.search-input-row kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--text-muted);
}

.search-scale-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
}

.filter-chip {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
}

.filter-chip.active {
  background: rgba(118, 204, 255, 0.16);
  border-color: var(--accent-cyan);
  color: #fff;
}

.search-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px 0;
}

.search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 1px solid rgba(175, 208, 255, 0.06);
  transition: background 0.15s;
}

.search-row:hover {
  background: rgba(118, 204, 255, 0.1);
}

.search-row-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-row-name {
  font-size: 13.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-row-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.search-row-right {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-gold);
  text-align: right;
}

/* Odyssey Panel */
.odyssey-panel {
  padding: 20px 22px;
}

.odyssey-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.odyssey-header h2 {
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  margin-top: 4px;
}

.odyssey-intro {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.odyssey-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
}

.odyssey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.18s;
}

.odyssey-item:hover {
  background: rgba(230, 197, 135, 0.07);
}

.odyssey-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 3px;
}

.odyssey-item-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.odyssey-item-stops {
  font-size: 10.5px;
  color: var(--accent-gold);
  margin-top: 4px;
}

.odyssey-codex-bar {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.odyssey-codex-bar > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.codex-progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

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

@media (max-width: 900px) {
  .interaction-hint {
    display: none;
  }
}

@media (max-width: 820px) {
  .dossier-drawer {
    width: calc(100vw - 24px);
    left: 12px;
    top: 86px;
    bottom: 70px;
  }
  .scale-ruler {
    right: 10px;
  }
  .ruler-notch-text {
    display: none;
  }
  .hud-top-left {
    left: 12px;
    top: 12px;
  }
  .hud-top-right {
    right: 12px;
    top: 12px;
  }
}

/* ---------- Floating Observatory Constellation Labels & Category Tabs ---------- */
.obs-const-label {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  user-select: none;
  opacity: 0.62;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.92);
}

.obs-const-zh {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(168, 212, 255, 0.88);
  font-weight: 400;
}

.obs-const-en {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(142, 182, 224, 0.56);
  font-style: italic;
}

.obs-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.obs-cat-tabs {
  display: flex;
  gap: 4px;
}

.obs-cat-tab {
  background: rgba(12, 20, 36, 0.65);
  border: 1px solid rgba(130, 178, 235, 0.22);
  color: rgba(182, 206, 236, 0.72);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.obs-cat-tab:hover {
  color: #fff;
  border-color: rgba(130, 198, 255, 0.55);
}

.obs-cat-tab.active {
  background: rgba(110, 188, 255, 0.22);
  border-color: rgba(138, 208, 255, 0.75);
  color: #eaf5ff;
}

/* ==========================================================================
   FULL MULTI-DEVICE RESPONSIVE DESIGN (iPhone / Android / iPad / Touch!)
   ========================================================================== */
html, body, #cosmos-viewport, #cosmos-canvas {
  touch-action: none;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.obs-mobile-toggle {
  display: none;
  width: 100%;
  background: rgba(12, 22, 42, 0.72);
  border: 1px solid rgba(130, 196, 255, 0.28);
  color: rgba(212, 232, 255, 0.9);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 6px;
}

/* iPad & Tablet Breakpoint */
@media (max-width: 1080px) {
  .obs-bottom-dock {
    max-width: calc(100vw - 24px);
    padding: 10px 12px;
  }
  .bottom-dock {
    max-width: calc(100vw - 24px);
  }
  .obs-info-card {
    max-width: 300px;
  }
}

/* iPhone & Android Phone Portrait / Compact Landscape Breakpoint */
@media (max-width: 768px) {
  .hud-top-left {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 10px;
    max-width: 60vw;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-en,
  .hud-divider,
  .rank-pill,
  .telemetry-line,
  .scale-breadcrumb {
    display: none;
  }
  .hud-top-right {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 10px;
    gap: 5px;
  }
  .top-action-row {
    gap: 4px;
  }
  .hud-icon-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .hud-icon-btn kbd {
    display: none;
  }
  .top-time-bar {
    padding: 3px 5px;
  }
  .speed-btn {
    font-size: 10px;
    padding: 2px 5px;
  }

  /* Compact Focus Exit Pill below top controls */
  .focus-exit-bar {
    top: calc(54px + env(safe-area-inset-top, 0px));
    max-width: calc(100vw - 20px);
    padding: 5px 8px;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .focus-exit-bar::-webkit-scrollbar { display: none; }
  .exit-pill-btn {
    font-size: 11px;
    padding: 4px 8px;
    white-space: nowrap;
  }
  .focus-pill-name {
    font-size: 12px;
    white-space: nowrap;
  }

  /* Compact Right Scale Ruler for Touch */
  .scale-ruler {
    right: 8px;
    top: 46%;
  }
  .ruler-track {
    height: 185px;
  }
  .ruler-notch-text {
    display: none;
  }

  /* Bottom Space Mode Dock: clean horizontal scrollable strips + iPhone Home Bar safe area */
  .bottom-dock {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 16px);
    padding: 8px 10px;
    gap: 6px;
  }
  .obs-hero-strip,
  .dock-toggles,
  .scale-jump-row {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .obs-hero-strip::-webkit-scrollbar,
  .dock-toggles::-webkit-scrollbar,
  .scale-jump-row::-webkit-scrollbar { display: none; }
  .obs-hero-btn,
  .obs-quick-chip,
  .dock-toggle,
  .scale-jump-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
  }

  /* Observatory Mode Phone Layout: Compact Header (below top-right action strip, zero overlap!) + Collapsible Dock */
  .obs-info-card {
    top: calc(50px + env(safe-area-inset-top, 0px));
    left: 10px;
    max-width: calc(100vw - 20px);
    padding: 7px 10px;
  }
  .obs-site-title {
    font-size: 14px;
  }
  .obs-site-desc {
    display: none;
  }
  .obs-site-coords,
  .obs-telemetry {
    font-size: 10px;
  }

  .obs-mobile-toggle {
    display: block;
  }
  .obs-bottom-dock {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 16px);
    padding: 8px 10px;
    gap: 6px;
  }
  .obs-bottom-dock.mobile-collapsed .obs-dock-collapsible {
    display: none;
  }
  .obs-pill-group,
  .obs-actions-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .obs-pill-group::-webkit-scrollbar,
  .obs-actions-row::-webkit-scrollbar { display: none; }
  .obs-pill,
  .obs-actions-row .dock-toggle,
  .obs-actions-row .hairline-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 10px;
  }

  /* Full-Width Bottom-Sheet Dossier Drawer on Phones */
  .dossier-drawer {
    left: 8px;
    right: 8px;
    width: auto;
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    height: 62vh;
    border-radius: 14px;
  }
  .search-panel,
  .odyssey-panel {
    width: calc(100vw - 20px);
    max-height: 82vh;
  }
}
