/* Mars Rover Interactive Globe — restrained mission-console styling. */

:root {
  --bg: #07080b;
  --bg-2: #0d1016;
  --surface: #121722;
  --surface-2: #182030;
  --line: #2a3446;
  --text: #e8ecf2;
  --text-dim: #a9b3c2;
  --accent: #56d9ff;
  --accent-soft: rgba(86, 217, 255, 0.18);
  --plan: #ffc35c;
  --mars: #c1592f;
  --warn: #ffb35c;
  --error: #ff7a6b;
  --ok: #7dffb0;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --panel-w: min(420px, 38vw);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 30% 20%, #131a28 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: #9ae9ff; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.num, time { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { top: 8px; }

/* Header ------------------------------------------------------------------ */
.site-header {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 4px 24px;
  padding: 14px clamp(16px, 3vw, 32px) 10px;
  border-bottom: 1px solid var(--line);
}
.brand-kicker { margin: 0; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.7rem); letter-spacing: 0.01em; }
.intro { margin: 0; color: var(--text-dim); max-width: 46ch; font-size: 0.95rem; }
.noscript { padding: 16px; margin: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.site-footer { padding: 12px clamp(16px, 3vw, 32px) 20px; color: var(--text-dim); font-size: 0.8rem; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; max-width: 90ch; }

/* Layout ------------------------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 150px);
}
.layout[data-panel="open"] { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
.globe-region { display: flex; flex-direction: column; min-width: 0; padding: 12px clamp(12px, 2vw, 24px); gap: 10px; }

/* Navigator --------------------------------------------------------------- */
.mission-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mission-nav:focus { outline: none; }
.nav-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 52px; padding: 8px 12px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}
.nav-btn:hover { border-color: #3f5170; }
.nav-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px var(--accent-soft); }
.nav-name { font-weight: 650; line-height: 1.2; }
.nav-site { font-size: 0.8rem; color: var(--text-dim); }

/* Stage ------------------------------------------------------------------- */
.globe-stage {
  position: relative; flex: 1 1 auto; min-height: 360px; height: calc(100vh - 290px);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #151b28 0%, #07090d 70%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}
.globe-stage:focus-visible { outline-offset: -3px; }
.globe-canvas, .poi-layer { position: absolute; inset: 0; }
.globe-canvas canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.globe-canvas canvas:active { cursor: grabbing; }
.poi-layer { pointer-events: none; overflow: hidden; }

.globe-status { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.status {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%;
  padding: 4px 10px; font-size: 0.78rem; border-radius: 999px;
  background: rgba(10, 13, 19, 0.82); border: 1px solid var(--line); color: var(--text-dim);
}
.status button { pointer-events: auto; }
.status--warn { border-color: rgba(255, 179, 92, 0.6); color: #ffd7a8; }
.status--error { border-color: rgba(255, 122, 107, 0.7); color: #ffc2ba; }
.status--ok { border-color: rgba(125, 255, 176, 0.45); }
.stage-message {
  position: absolute; inset: auto 16px 16px 16px; padding: 14px 16px; border-radius: var(--radius);
  background: rgba(12, 15, 22, 0.94); border: 1px solid var(--line);
}
.stage-message p { margin: 0 0 10px; }
.data-error { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--error); border-radius: var(--radius); }
.data-error p { margin: 0; }

/* POI markers -------------------------------------------------------------- */
.poi {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0;
  pointer-events: auto; cursor: pointer; background: transparent; border: 0; border-radius: 50%;
  will-change: transform;
}
.poi[hidden] { display: none; }
.poi-dot {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 10px var(--accent);
}
.poi-ring { position: absolute; inset: 8px; border-radius: 50%; }
.poi-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent);
  animation: radar 2.4s ease-out infinite;
}
.poi-label {
  position: absolute; left: 36px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  padding: 2px 7px; font-size: 0.75rem; font-weight: 600; border-radius: 6px;
  background: rgba(7, 9, 13, 0.78); border: 1px solid rgba(86, 217, 255, 0.35); color: var(--text);
}
.poi:hover .poi-dot, .poi:focus-visible .poi-dot { transform: scale(1.2); }
.poi:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.poi.is-selected .poi-dot { background: var(--accent); border-color: #fff; }
.has-journey .poi.is-selected .poi-label { display: none; }
.poi.is-selected .poi-label { border-color: var(--accent); background: rgba(10, 30, 40, 0.92); }
@keyframes radar {
  0% { transform: scale(0.45); opacity: 0.95; }
  100% { transform: scale(1.6); opacity: 0; }
}

.journey-label {
  position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; will-change: transform;
  font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.journey-label[hidden] { display: none; }
.journey-label--step, .journey-label--plan {
  display: grid; place-items: center; min-width: 20px; height: 20px; margin: -30px 0 0 -10px; padding: 0 4px;
  border-radius: 10px; background: rgba(6, 18, 26, 0.9); border: 1.5px solid var(--accent); color: #dff7ff;
}
.journey-label--plan { border-style: dashed; border-color: var(--plan); color: #ffe7bd; }
.journey-label--scale {
  margin: 8px 0 0 0; transform-origin: 0 0; padding: 2px 8px; border-radius: 4px;
  background: rgba(7, 9, 13, 0.85); border: 1px solid var(--line); color: var(--text); letter-spacing: 0.02em;
  translate: -50% 0;
}

/* Toolbar ------------------------------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  min-height: 40px; min-width: 40px; padding: 6px 14px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  transition: border-color 140ms, background 140ms;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn[aria-pressed="true"] { border-color: var(--accent); background: #10303d; }
.btn-small { min-height: 28px; padding: 2px 10px; font-size: 0.78rem; }
.help { margin: 0; color: var(--text-dim); font-size: 0.82rem; }

/* Panel -------------------------------------------------------------------- */
.panel {
  position: relative; min-width: 0; padding: 18px 20px 28px;
  background: linear-gradient(180deg, rgba(20, 26, 38, 0.97), rgba(12, 15, 22, 0.98));
  border-left: 1px solid var(--line);
  opacity: 0; transform: translateX(24px);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.panel.is-open { opacity: 1; transform: none; }
.layout[data-panel="open"] .panel { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; overscroll-behavior: contain; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.eyebrow { margin: 0; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.panel h2 { margin: 2px 0 0; font-size: 1.45rem; line-height: 1.2; }
.panel h2:focus { outline: none; }
.panel h2:focus-visible { outline: 3px solid var(--accent); }
.site-name { margin: 2px 0 0; font-weight: 600; color: #ffd1bd; }
.site-context, .coords { margin: 8px 0 0; color: var(--text-dim); font-size: 0.92rem; }
.coords .label { color: var(--text-dim); }
.icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; font-size: 1.4rem; line-height: 1;
  background: var(--surface-2); border: 1px solid var(--line);
}
.icon-btn:hover { border-color: var(--accent); }
.panel h3 { margin: 22px 0 8px; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.panel h4 { margin: 12px 0 6px; font-size: 0.98rem; }
.panel ul, .panel ol { margin: 0; padding-left: 1.1rem; }
.panel li { margin: 4px 0; }
.cite { font-size: 0.75rem; color: var(--text-dim); white-space: normal; }
.cite a { color: #8fdcf5; }
.note { margin: 8px 0 0; font-size: 0.82rem; color: var(--text-dim); }

.metrics { margin-top: 14px; display: grid; gap: 10px; }
.dates { margin: 0; display: grid; gap: 4px; }
.date-row { display: grid; grid-template-columns: minmax(0, 11ch) minmax(0, 1fr); gap: 10px; font-size: 0.9rem; }
.date-row dt { color: var(--text-dim); }
.date-row dd { margin: 0; }
.basis { color: var(--text-dim); }
.metric-hero {
  display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(86, 217, 255, 0.07); border: 1px solid rgba(86, 217, 255, 0.35);
}
.metric-hero.is-muted { background: transparent; border-color: var(--line); }
.metric-label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.metric-value { font-size: 1.3rem; font-weight: 700; }
.is-muted .metric-value { font-size: 1rem; font-weight: 500; color: var(--text-dim); }

/* Media frames -------------------------------------------------------------- */
.media { margin: 16px 0 0; }
.media-frame {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px;
  background: linear-gradient(135deg, #1b2130, #0e1118);
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 1px rgba(86, 217, 255, 0.35), 0 10px 30px rgba(0, 0, 0, 0.45);
}
.media-frame::before, .media-frame::after {
  content: ""; position: absolute; width: 16px; height: 16px; z-index: 1; pointer-events: none;
  border-color: var(--accent); border-style: solid;
}
.media-frame::before { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.media-frame::after { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }
.media-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-detail .media-frame { aspect-ratio: 16 / 9; }
.media-placeholder { display: grid; place-items: center; height: 100%; color: var(--text-dim); font-size: 0.9rem; letter-spacing: 0.05em; }
.media figcaption { display: grid; gap: 2px; margin-top: 6px; font-size: 0.8rem; color: var(--text-dim); }
.cap-text { color: var(--text); }
.kenburns { animation: kenburns 28s ease-in-out infinite alternate; transform-origin: 50% 55%; }
@keyframes kenburns {
  from { transform: scale(1.03) translate(0, 0); }
  to { transform: scale(1.13) translate(-2.5%, -2%); }
}

/* Journey ----------------------------------------------------------------- */
.journey-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.journey-head h3 { margin: 0; }
.scale-badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.journey-intro { margin: 6px 0 0; font-size: 0.85rem; color: var(--text-dim); }
.journey-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-plan[aria-pressed="true"] { border-color: var(--plan); background: #3a2a0d; border-style: dashed; }
.legend { list-style: none; padding: 0 !important; margin: 10px 0 0 !important; display: grid; gap: 4px; font-size: 0.82rem; color: var(--text-dim); }
.legend li { display: flex; align-items: center; gap: 8px; }
.swatch { display: inline-block; width: 28px; height: 0; border-top: 3px solid var(--accent); }
.swatch-bounce { border-top: 3px dotted #bfefff; }
.swatch-plan { border-top: 3px dashed var(--plan); }
.path-block { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.path-block.is-plan { border-style: dashed; border-color: rgba(255, 195, 92, 0.55); }
.path-block h4 { margin-top: 0; }
.path-kind { font-weight: 400; font-size: 0.8rem; color: var(--text-dim); }
.steps { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.steps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.step-num {
  flex: none; display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 700; border: 1.5px solid var(--accent); font-variant-numeric: tabular-nums;
}
.is-plan .step-num { border-style: dashed; border-color: var(--plan); }
.path-distances { margin-top: 8px !important; font-size: 0.88rem; }
.bounce { margin: 8px 0 0; font-size: 0.88rem; }

/* Distance comparison -------------------------------------------------------- */
.bars { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 1fr; gap: 3px; }
.bar-label { font-size: 0.88rem; }
.bar-label .tag { color: var(--accent); }
.bar-track { display: block; height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: repeating-linear-gradient(90deg, #3c8fae 0 6px, #347c97 6px 8px); }
.is-current .bar-fill { background: repeating-linear-gradient(90deg, var(--accent) 0 6px, #3fb9df 6px 8px); }
.bar-value { font-size: 0.85rem; color: var(--text-dim); }
.src-host { color: var(--text-dim); font-size: 0.8rem; }
.sources li { margin: 6px 0; }

/* Narrow screens: panel becomes an in-flow region under the globe ---------- */
@media (max-width: 860px) {
  .layout, .layout[data-panel="open"] { grid-template-columns: minmax(0, 1fr); }
  .globe-stage { height: 62vh; min-height: 300px; }
  .layout[data-panel="open"] .panel { position: relative; max-height: none; overflow: visible; }
  .panel { border-left: 0; border-top: 1px solid var(--line); transform: translateY(28px); }
  .panel.is-open { transform: none; }
}
@media (max-width: 520px) {
  .mission-nav { grid-template-columns: 1fr; }
  .nav-btn { min-height: 44px; flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .globe-stage { height: 56vh; }
  .poi-label { display: none; }
  .poi.is-selected .poi-label, .poi:focus-visible .poi-label { display: block; }
  .panel { padding: 16px 16px 24px; }
  .date-row { grid-template-columns: 1fr; gap: 0; }
}

/* Motion preferences ------------------------------------------------------- */
.motion-paused .poi-ring::before, .motion-paused .kenburns { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .poi-ring::before, .kenburns { animation: none; }
  .poi-ring::before { opacity: 0.5; transform: scale(1); }
  .panel, .nav-btn, .btn { transition: none; }
  .panel { transform: none; }
}

/* ======================================================================
   Upgrade: rover replays, callouts, evidence, comparison graphics
   ====================================================================== */

.btn-primary { background: linear-gradient(180deg, #1b5f78, #12485c); border-color: var(--accent); font-weight: 650; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #227494, #165a72); }
.watch { margin-top: 14px; padding: 12px; border-radius: var(--radius); border: 1px solid rgba(86, 217, 255, 0.35); background: rgba(86, 217, 255, 0.06); }
.watch .btn-primary { width: 100%; min-height: 46px; font-size: 1.02rem; }
.watch-icon { display: inline-block; margin-right: 4px; }
.watch .note { margin-top: 6px; }

/* Stage fade between globe and close-up, and marker highlight */
.stage-fade { position: absolute; inset: 0; background: #07080b; opacity: 0; pointer-events: none; transition: opacity 190ms ease; }
.globe-stage.is-fading .stage-fade { opacity: 1; }
.globe-stage.is-surface .globe-canvas canvas { cursor: default; }
.poi.is-highlight .poi-dot { animation: highlight 0.8s ease-in-out 3; }
.poi.is-highlight .poi-label { border-color: var(--plan); }
@keyframes highlight { 50% { transform: scale(1.9); box-shadow: 0 0 0 6px rgba(255, 195, 92, 0.45), 0 0 18px var(--plan); } }

/* Floating callout inside the stage (one at a time) */
.callout {
  position: absolute; left: 0; top: 0; max-width: min(280px, 70%); pointer-events: none; will-change: transform;
  padding: 6px 10px; border-radius: 8px; font-size: 0.86rem; font-weight: 600; line-height: 1.3;
  background: rgba(7, 12, 18, 0.9); border: 1px solid var(--accent); color: #eaf9ff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  animation: callout-in 260ms var(--ease);
}
.callout::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: inherit; border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); }
@keyframes callout-in { from { opacity: 0; } to { opacity: 1; } }

/* Replay section */
.replay { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(20, 26, 38, 0.95), rgba(12, 15, 22, 0.95)); animation: rise 280ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.replay-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.replay-title { margin: 0; font-size: 1.02rem; }
.replay-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.model-badge:empty { display: none; }
.replay-caption { min-height: 3.2em; padding: 8px 12px; border-left: 3px solid var(--accent); background: rgba(86, 217, 255, 0.06); border-radius: 0 8px 8px 0; }
.replay-caption-text { margin: 0; font-weight: 600; }
.replay-caption .cite { margin: 2px 0 0; }
/* When the callout floats in the canvas, keep the region's size but hide the duplicate text. */
.replay-caption.is-floating .replay-caption-text { visibility: hidden; }
.replay-progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.replay-progress-fill { display: block; height: 100%; width: 0; background: var(--accent); }
.replay-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scrub { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 0; }
.scrub-label { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }
.scrub input { flex: 1; min-width: 0; accent-color: var(--accent); height: 32px; }
.replay-time { font-size: 0.85rem; color: var(--text-dim); min-width: 8ch; text-align: right; }
.replay-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: none; }
.stop-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; font-size: 0.85rem; color: var(--text);
  transition: border-color 200ms, background 200ms;
}
.stop-btn:hover { border-color: var(--accent); }
.stop-idx { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; border: 1.5px solid var(--text-dim); }
.replay-stops li.is-past .stop-idx { border-color: var(--accent); background: rgba(86, 217, 255, 0.2); }
.stop-btn[aria-current="step"] { border-color: var(--accent); background: #10303d; box-shadow: 0 0 0 1px var(--accent), 0 0 14px var(--accent-soft); }
.stop-btn[aria-current="step"] .stop-idx { background: var(--accent); color: #032430; border-color: var(--accent); }
.replay-chips-wrap { display: grid; gap: 4px; }
.replay-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: grid; gap: 1px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-size: 0.82rem; color: var(--text); }
.chip-btn { cursor: pointer; transition: border-color 200ms, background 200ms, transform 200ms; }
.chip-btn:hover { border-color: var(--accent); }
.chip.is-active { border-color: var(--plan); background: #33270f; transform: translateY(-1px); }
.chip-label { color: var(--text-dim); font-size: 0.75rem; }
.chip-value { font-weight: 700; }
.chip-src { font-size: 0.72rem; }
.chip.is-plan { border-style: dashed; border-color: rgba(255, 195, 92, 0.55); }
.replay-plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.replay-plan-row .note { margin: 0; }

/* Mission comparison: bars grow from a shared zero */
.bar-fill { width: 0; transition: width 1100ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.disp-graphic { margin: 12px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.disp-svg { display: block; width: 100%; height: auto; }
.disp-ground { stroke: #6b5446; stroke-width: 2; }
.disp-path { fill: none; stroke: #bfefff; stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.85; }
.disp-tick { stroke: var(--text-dim); stroke-width: 1.5; }
.disp-label { fill: var(--text-dim); font: 10px var(--font); }
.disp-dot { fill: #e8dcc0; stroke: #fff; offset-distance: 0%; }
.disp-graphic.is-run .disp-path { animation: draw 3.2s ease-out forwards; }
.disp-graphic.is-run .disp-dot { animation: travel 3.2s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes travel { to { offset-distance: 100%; } }
.disp-graphic figcaption { margin-top: 6px; font-size: 0.82rem; color: var(--text-dim); }

/* Evidence section */
.evidence { margin: 0 clamp(12px, 2vw, 24px) 20px; padding: 16px clamp(14px, 2vw, 22px); border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, rgba(18, 23, 34, 0.9), rgba(10, 13, 19, 0.9)); }
.evidence h2 { margin: 0; font-size: 1.15rem; }
.evidence-intro { margin: 4px 0 12px; color: var(--text-dim); font-size: 0.92rem; max-width: 80ch; }
.evidence-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; cursor: pointer; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 0.9rem; }
.ev-tab.is-selection { border-style: dashed; }
.ev-tab[aria-selected="true"] { border-color: var(--accent); background: #10303d; }
.ev-tab.is-selection[aria-selected="true"] { border-color: var(--plan); background: #33270f; }
.ev-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; border: 1.5px solid currentColor; }
.ev-card { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.ev-card.is-finding { border-left: 4px solid var(--accent); }
.ev-card.is-selection { border-left: 4px dashed var(--plan); }
.ev-card.is-entering { animation: rise 260ms var(--ease); }
.ev-card h3 { margin: 2px 0 6px; font-size: 1.05rem; }
.ev-badge { margin: 0; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.is-selection .ev-badge { color: var(--plan); }
.ev-text { margin: 0; }
.ev-who { margin: 6px 0 0; font-size: 0.85rem; color: var(--text-dim); }
.ev-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }

@media (max-width: 520px) {
  .replay-controls .btn { flex: 1 1 auto; }
  .scrub { flex-basis: 100%; }
  .replay-time { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .stop-btn, .chip-btn { transition: none; }
  .replay, .ev-card.is-entering, .callout { animation: none; }
  .disp-graphic .disp-path { stroke-dashoffset: 0; animation: none !important; }
  .disp-graphic .disp-dot { offset-distance: 100%; animation: none !important; }
  .poi.is-highlight .poi-dot { animation: none; box-shadow: 0 0 0 4px var(--plan); }
  .stage-fade { transition: none; }
}
.motion-paused .disp-path, .motion-paused .disp-dot { animation-play-state: paused; }
/* While a replay is open, keep the close-up and its controls on screen together. */
.layout.is-replay .globe-stage { height: min(58vh, calc(100vh - 330px)); min-height: 300px; }
.surface-badge { display: none; position: absolute; left: 10px; top: 10px; margin: 0; padding: 4px 10px; font-size: 0.78rem; font-weight: 600; border-radius: 999px; background: rgba(10, 13, 19, 0.85); border: 1px solid var(--line); color: var(--text); pointer-events: none; }
.globe-stage.is-surface .surface-badge { display: block; }
.globe-stage.is-surface .globe-status { display: none; }
.site-footer .build { margin-bottom: 4px; color: var(--accent); }

/* ======================================================================
   Version 3: Neo's guided expedition
   ====================================================================== */

/* Entry: Explore with Neo (primary) and Explore the globe (secondary) */
/* Landing entry (Round 2): one large central, recommended Explore with Neo button, the
   description directly beneath; "Explore the globe yourself" appears after a first entry. */
.entry { display: grid; justify-items: center; gap: 14px; padding: 22px 18px 20px; text-align: center; border: 1px solid rgba(86, 217, 255, 0.35); border-radius: 14px; background: linear-gradient(180deg, rgba(22, 44, 66, 0.6), rgba(12, 18, 28, 0.55)); }
.entry-primary { display: grid; justify-items: center; gap: 10px; width: 100%; }
.entry-reco { margin: 0; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #a8ecff; }
.btn-hero { min-height: 56px; padding: 12px 34px; font-size: 1.2rem; font-weight: 750; border-radius: 12px; }
.entry .btn-hero { min-width: min(340px, 100%); }
.btn-primary.btn-hero { background: linear-gradient(180deg, #2f95c9, #1b6592); border-color: #9feaff; color: #fff; box-shadow: 0 0 22px rgba(86, 217, 255, 0.3); }
.btn-primary.btn-hero:hover:not(:disabled) { background: linear-gradient(180deg, #38a6dd, #2073a4); }
.btn-hero:focus-visible { outline: 4px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 8px rgba(86, 217, 255, 0.45); }
.entry-desc { margin: 0; color: var(--text); font-size: 0.98rem; max-width: 52ch; }
.btn-secondary { min-height: 48px; padding: 10px 22px; }
.btn-secondary:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.entry.is-first { padding-block: 30px 28px; }
@media (max-width: 640px) { .entry .btn-hero, .btn-secondary { width: 100%; } .entry { padding: 18px 14px; } }

/* Tour strip */
.tour { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(20, 26, 38, 0.96), rgba(12, 15, 22, 0.96)); animation: rise 280ms var(--ease); }
.tour-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tour-title { margin: 0; font-size: 1.05rem; }
.tour-chapter { margin: 2px 0 0; color: var(--accent); font-size: 0.85rem; letter-spacing: 0.04em; }
.tour-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tour-stop { margin: 0; font-size: 0.85rem; color: var(--text-dim); }
.tour-caption { padding: 10px 12px; border-left: 3px solid var(--accent); background: rgba(86, 217, 255, 0.06); border-radius: 0 8px 8px 0; display: grid; gap: 4px; }
.tour-speaker { margin: 0; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.tour-line { margin: 0; font-size: 1.02rem; line-height: 1.45; min-height: 2.9em; }
.tour-label { margin: 0; font-size: 0.85rem; color: #ffe2b0; min-height: 1.2em; }
.tour-label .cite, .tour-label a { font-size: 0.75rem; }
.tour.label-floating .tour-label-text { visibility: hidden; }
.tour-sources { font-size: 0.82rem; color: var(--text-dim); }
.tour-sources summary { cursor: pointer; }
.tour-sources ul { margin: 4px 0 0; padding-left: 1.1rem; }
.tour-error { padding: 8px 12px; border: 1px solid var(--error); border-radius: 8px; color: #ffc2ba; }
.tour-inspect-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tour-inspect-row:not(:has(:not([hidden]))) { display: none; }
.btn-inspect { border-color: var(--plan); background: #3a2a0d; font-weight: 650; animation: nudge 1.2s ease-out 2; }
@keyframes nudge { 30% { box-shadow: 0 0 0 4px rgba(255, 195, 92, 0.35); } 100% { box-shadow: none; } }
.tour-progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.tour-progress-fill { display: block; height: 100%; width: 0; background: var(--accent); }
.tour-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tour-controls #tour-listen[aria-pressed="true"] { border-color: var(--ok); }
.tour-plan-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tour-plan-row:not(:has(:not([hidden]))) { display: none; }
.tour-plan-row .note { margin: 0; }
.tour-end { padding: 14px; border-radius: 10px; border: 1px solid var(--accent); background: rgba(86, 217, 255, 0.08); animation: rise 280ms var(--ease); }
.tour-end h3 { margin: 0 0 10px; font-size: 1.05rem; }
.tour-end-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tour-skipped { font-size: 0.8rem; color: var(--text-dim); }
.tour-skipped ul { margin: 4px 0 0; padding-left: 1.1rem; }
.tour-still { margin: 0; max-width: 420px; }
.tour-still img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.tour-still-ph { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: 8px; color: var(--text-dim); }
.tour-still figcaption { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }
.tour-neo-still { display: flex; gap: 12px; align-items: center; }
.tour-neo-still p { margin: 0; font-size: 0.85rem; color: var(--text-dim); }
.neo-crop { flex: none; width: 84px; height: 108px; border-radius: 10px; background: #fff url("../Neospritesheet2.jpeg") no-repeat; background-size: 336px auto; background-position: -10px -14px; }

/* Stage overlays during the tour */
.tour-banner { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 24px); padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; background: rgba(10, 13, 19, 0.85); border: 1px solid var(--plan); color: #ffe7bd; pointer-events: none; text-align: center; }
.tour-cards { position: absolute; right: 10px; top: 48px; display: grid; gap: 8px; width: min(300px, 46%); pointer-events: none; }
.tour-card { pointer-events: auto; padding: 10px 12px; border-radius: 10px; background: rgba(8, 12, 18, 0.9); border: 1px solid var(--line); animation: rise 300ms var(--ease); }
.tour-card h3 { margin: 0 0 4px; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.tour-card .card-text { margin: 0; font-size: 0.92rem; }
.tour-card.is-date .card-text { font-size: 1.15rem; font-weight: 700; color: #eaf9ff; }
.tour-card .card-src { margin: 4px 0 0; font-size: 0.72rem; color: var(--text-dim); }
.cmp { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cmp li { display: grid; gap: 2px; }
.cmp-name { font-size: 0.82rem; }
.cmp-track { display: block; height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.cmp-fill { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 6px, #3fb9df 6px 8px); transition: width 1200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.cmp-val { font-size: 0.82rem; color: var(--text-dim); }
.neo-tag { position: absolute; left: 0; top: 0; margin: 0; font-size: 0.68rem; text-align: center; color: #cfe9ff; pointer-events: none; text-shadow: 0 1px 2px #000; }
.poi.is-tour-highlight .poi-ring::before { border-color: var(--plan); animation-duration: 1.4s; }
.poi.is-tour-highlight .poi-dot { background: var(--plan); }
@media (max-width: 600px) {
  .tour-cards { left: 10px; right: auto; top: 70px; width: auto; max-width: 64%; }
  .tour-banner { font-size: 0.72rem; top: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour, .tour-end, .tour-card { animation: none; }
  .cmp-fill { transition: none; }
  .btn-inspect { animation: none; }
}

/* ======================================================================
   Version 4: Neo's speech bubble, in-view actions and required checkpoints
   ====================================================================== */

/* Speech bubble attached to Neo's corner (aria-hidden; #tour-line is the accessible caption). */
.neo-bubble {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  padding: 10px 14px 12px; border-radius: 16px;
  background: #fbfdff; color: #0b1626; border: 2px solid #12284a;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  font-size: 1rem; line-height: 1.4; font-weight: 550;
  animation: bubble-in 220ms var(--ease);
}
.neo-bubble::after {
  content: ""; position: absolute; bottom: -12px; width: 18px; height: 18px;
  background: #fbfdff; border-right: 2px solid #12284a; border-bottom: 2px solid #12284a;
  transform: rotate(45deg); right: 26px;
}
.neo-bubble[data-side="left"]::after { right: auto; left: 26px; }
.neo-bubble-name { display: block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #1b5f86; font-weight: 800; margin-bottom: 2px; }
.neo-bubble.is-prompt { background: #fff6dc; border-color: #8a5a00; }
.neo-bubble.is-prompt::after { background: #fff6dc; border-color: #8a5a00; }
.neo-bubble.is-prompt .neo-bubble-text { font-size: 1.12rem; font-weight: 800; color: #3a2500; }
@keyframes bubble-in { from { opacity: 0; transform-origin: bottom; } to { opacity: 1; } }

/* Docked caption strip directly under the canvas (narrow screens, or when the bubble would cover the subject). */
.neo-dock {
  display: flex; gap: 10px; align-items: baseline; margin-top: -4px;
  padding: 10px 14px; border-radius: 0 0 12px 12px;
  background: #fbfdff; color: #0b1626; border: 2px solid #12284a; border-top: 0;
  font-size: 1rem; line-height: 1.4; font-weight: 550; min-height: 3.2em;
}
.neo-dock .neo-bubble-name { flex: none; margin: 0; }
.neo-dock.is-prompt { background: #fff6dc; border-color: #8a5a00; }
.neo-dock.is-prompt .neo-dock-text { font-weight: 800; color: #3a2500; }

/* Sound toggle by Neo's corner, and the one-time audio note. */
.neo-sound {
  position: absolute; left: 0; top: 0; z-index: 7; min-height: 40px; padding: 6px 12px; cursor: pointer;
  border-radius: 999px; font-size: 0.85rem; font-weight: 650;
  background: rgba(8, 12, 18, 0.88); color: #eaf9ff; border: 1px solid var(--accent);
}
.neo-sound[aria-pressed="false"] { border-color: var(--line); color: var(--text-dim); }
/* Audio problem state (blocked, failed, stalled) with Retry / Continue with text. */
.neo-audio-alert {
  position: absolute; left: 50%; top: 46px; transform: translateX(-50%); z-index: 8; margin: 0;
  display: grid; gap: 8px; justify-items: center; text-align: center;
  max-width: min(460px, calc(100% - 24px)); padding: 10px 14px; border-radius: 12px; font-size: 0.88rem;
  background: rgba(8, 12, 18, 0.95); border: 1px solid var(--warn); color: #ffe2b8;
}
.neo-audio-alert p { margin: 0; }
.neo-audio-alert.is-quiet { border-color: var(--line); color: var(--text-dim); padding: 6px 12px; }
.neo-audio-alert-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.neo-audio-alert-actions .btn { min-height: 44px; }
.neo-audio-alert-actions .btn[hidden] { display: none; }

/* Mission-day counter (sols) inside the view. */
.tour-counter {
  position: absolute; bottom: 74px; z-index: 5; display: grid; grid-template-columns: auto auto; gap: 0 10px; align-items: baseline;
  padding: 8px 14px; border-radius: 12px; background: rgba(8, 12, 18, 0.9); border: 1px solid var(--line); pointer-events: none;
}
.tour-counter[data-side="right"], .tour-counter:not([data-side]) { left: 12px; }
.tour-counter[data-side="left"] { right: 12px; }
.tour-counter-label { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.tour-counter-n { font-size: 1.6rem; font-weight: 800; color: #eaf9ff; }
.tour-counter.is-beyond .tour-counter-n { color: #ffc35c; }
.tour-counter-note { grid-column: 1 / -1; font-size: 0.78rem; color: #ffe7bd; }

/* Card variants: lists, montage, labeled illustrations. */
.tour-card .card-items { margin: 4px 0 0; padding-left: 1.05rem; font-size: 0.86rem; display: grid; gap: 3px; }
.tour-card .card-figure svg { display: block; width: 100%; height: auto; border-radius: 6px; background: #1a1210; margin: 2px 0 6px; }
.card-montage { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card-montage li { display: grid; gap: 2px; font-size: 0.72rem; }
.card-montage img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; filter: saturate(0.6) brightness(0.85); }
.card-montage-name { font-weight: 700; font-size: 0.76rem; }
.card-montage-note { color: var(--text-dim); }
.card-montage-ph { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--surface-2); }
@media (max-width: 600px) {
  .tour-counter { bottom: auto; top: 76px; padding: 6px 10px; }
  .tour-counter-n { font-size: 1.25rem; }
}

/* Required checkpoint: big tap hotspot over the object, with a pulsing ring and a hand. */
.tour-hotspot {
  position: absolute; left: 0; top: 0; z-index: 6; width: 76px; height: 76px; margin: -38px 0 0 -38px; padding: 0;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer; pointer-events: auto;
}
.hotspot-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 4px solid #ffc35c;
  background: rgba(255, 195, 92, 0.18); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 195, 92, 0.7);
  animation: hotspot-pulse 1.3s ease-in-out infinite;
}
.hotspot-hand {
  position: absolute; width: 38px; height: 38px; right: -18px; bottom: -22px; fill: #fff; stroke: #12284a; stroke-width: 1.4;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); animation: hotspot-tap 1.3s ease-in-out infinite;
}
.hotspot-label {
  position: absolute; left: 50%; top: calc(100% + 16px); transform: translateX(-50%); white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; font-size: 0.95rem; font-weight: 800;
  background: #ffc35c; color: #2a1a00; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.tour-hotspot:focus-visible { outline: none; }
.tour-hotspot:focus-visible .hotspot-ring { outline: 4px solid #fff; outline-offset: 4px; }
@keyframes hotspot-pulse { 50% { transform: scale(1.18); background: rgba(255, 195, 92, 0.32); } }
@keyframes hotspot-tap { 0%, 100% { transform: translate(0, 0); } 45% { transform: translate(-8px, -8px) scale(0.92); } }
/* Docked: target off screen/occluded, or no 3D view — a large labelled button in the view. */
.tour-hotspot.is-docked {
  left: 50%; top: auto; bottom: 74px; width: auto; height: auto; margin: 0; transform: translateX(-50%) !important;
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 22px 10px 16px;
  border-radius: 999px; background: #ffc35c; color: #2a1a00; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  animation: hotspot-pulse 1.3s ease-in-out infinite;
}
.tour-hotspot.is-docked .hotspot-ring { display: none; }
.tour-hotspot.is-docked .hotspot-hand { position: static; width: 30px; height: 30px; fill: #2a1a00; stroke: none; filter: none; }
.tour-hotspot.is-docked .hotspot-label { position: static; transform: none; padding: 0; background: none; box-shadow: none; font-size: 1.05rem; }
.globe-stage.is-waiting .tour-banner { border-color: #ffc35c; }

/* In-view actions: optional inspect, and Continue after a close look. */
.stage-action {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 6;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; max-width: calc(100% - 24px);
}
.stage-action .btn { min-height: 48px; padding: 10px 20px; font-size: 1rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.btn-continue { font-weight: 800; }
.stage-note { padding: 6px 10px; border-radius: 8px; font-size: 0.85rem; background: rgba(8, 12, 18, 0.88); color: var(--text); }

/* Transport bar inside the view, on the side away from Neo. */
.stage-hud {
  position: absolute; bottom: 12px; z-index: 6; display: flex; gap: 6px; padding: 6px; border-radius: 14px;
  background: rgba(8, 12, 18, 0.82); border: 1px solid var(--line); backdrop-filter: blur(4px);
}
.stage-hud[data-side="right"] { left: 12px; }
.stage-hud[data-side="left"] { right: 12px; }
.stage-hud:not([data-side]) { left: 12px; }
.hud-btn { min-width: 44px; min-height: 44px; padding: 6px 12px; cursor: pointer; border-radius: 10px; font-size: 0.95rem; font-weight: 650; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.hud-btn:hover { border-color: var(--accent); }
.hud-play { min-width: 104px; border-color: var(--accent); }

/* Chapter record inside the view. */
.stage-end {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9;
  width: min(460px, calc(100% - 24px)); padding: 18px; text-align: center;
  background: rgba(8, 14, 22, 0.95); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.stage-end .tour-end-actions { justify-content: center; }

/* Cards sit on the side away from Neo. */
.tour-cards[data-side="right"] { right: auto; left: 10px; }
.tour-cards[data-side="left"] { left: auto; right: 10px; }

.stop-tap { margin-left: 4px; font-size: 0.72rem; color: #ffd27a; }

@media (max-width: 600px) {
  .tour-hotspot.is-docked { bottom: 70px; max-width: calc(100% - 24px); }
  .stage-action { bottom: 70px; }
  .hud-btn { padding: 6px 10px; }
  .hud-play { min-width: 92px; }
  .neo-sound { font-size: 0.78rem; padding: 4px 10px; }
  .tour-cards[data-side] { left: 10px; right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hotspot-ring, .hotspot-hand, .tour-hotspot.is-docked { animation: none; }
  .neo-bubble { animation: none; }
}
.motion-paused .hotspot-ring, .motion-paused .hotspot-hand { animation-play-state: paused; }
.neo-tag.is-covered { visibility: hidden; }
/* The 3D-unavailable message (with Retry) sits mid-view, above the in-view controls. */
.stage-message { inset: auto 16px auto 16px; top: 50%; transform: translateY(-50%); z-index: 10; }
@media (max-width: 600px) {
  .hud-txt { display: none; }
  .hud-play { min-width: 48px; }
  .stage-hud { gap: 4px; padding: 4px; bottom: 10px; }
  .stage-hud[data-side="right"] { left: 8px; right: auto; }
  .stage-hud[data-side="left"] { right: 8px; left: auto; }
  .neo-tag.is-narrow { display: none; }
}
@media (max-width: 600px) {
  .neo-audio-alert { top: 8px; left: 8px; right: 8px; transform: none; max-width: none; padding: 6px 8px; font-size: 0.78rem; line-height: 1.3; }
}

/* v6 · Landing states (fresh / resume / unlocked), Rover Rush, leave confirmation */
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35em; text-decoration: none; }
.btn-rush { background: linear-gradient(180deg, #e2733f, #b44a1f) !important; border-color: #ffc59e !important; box-shadow: 0 0 24px rgba(255, 140, 80, 0.35) !important; color: #fff; }
.btn-rush:hover { background: linear-gradient(180deg, #ef8350, #c45626) !important; }
.entry .btn-hero { min-height: 64px; font-size: 1.3rem; }
.entry-resume { display: grid; justify-items: center; gap: 6px; width: 100%; padding-top: 12px; border-top: 1px solid rgba(86, 217, 255, 0.25); }
.btn-resume { min-height: 52px; min-width: min(300px, 100%); padding: 10px 26px; font-size: 1.08rem; font-weight: 700; border: 2px solid var(--accent); background: rgba(86, 217, 255, 0.14); color: #e6f9ff; border-radius: 12px; }
.btn-resume:hover { background: rgba(86, 217, 255, 0.24); }
.btn-resume:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.resume-where { margin: 0; font-size: 0.88rem; color: var(--text-dim); max-width: 52ch; }
.entry-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.entry-more:not(:has(> :not([hidden]))) { display: none; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover:not(:disabled) { color: var(--text); border-color: transparent; }
.leave-dialog { max-width: min(440px, calc(100vw - 32px)); padding: 24px 22px 20px; border: 1px solid rgba(86, 217, 255, 0.45); border-radius: 14px; background: linear-gradient(180deg, #142233, #0c121b); color: var(--text); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.leave-dialog::backdrop { background: rgba(3, 5, 9, 0.68); }
.leave-title { margin: 0 0 8px; font-size: 1.3rem; }
.leave-desc { margin: 0 0 18px; color: var(--text-dim); }
.leave-actions { display: grid; gap: 10px; justify-items: center; }
.leave-actions .btn { width: 100%; }
@media (max-width: 640px) { .btn-resume { width: 100%; } }
