:root {
  color-scheme: dark;
  --bg: #070d19;
  --panel: #101a2b;
  --panel-2: #172339;
  --text: #f6f3e8;
  --muted: #aeb4bd;
  --line: #313742;
  /* Interactive component boundaries (inputs, ghost/mode buttons) need >=3:1 against
     their fills (WCAG 1.4.11 non-text contrast); --line at 1.45–1.65:1 is for
     decorative hairlines only. #616a7c measures 3.2:1 vs #181a20 and 3.6:1 vs #090b0f. */
  --line-strong: #616a7c;
  --gold: #eec575;
  --amber: #ff6f3c;
  --teal: #40d6c8;
  --magenta: #d958a7;
  --green: #8fd17f;
  --danger: #ff5964;
  --focus-ring: #7cc4ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

[hidden] { display: none !important; }
.skip-link { position: absolute; top: -8rem; left: 1rem; z-index: 100; padding: .75rem; background: var(--panel); color: var(--text); }
.skip-link:focus { top: .5rem; }
.app-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.5rem; white-space: nowrap; }
.brand span { color: var(--gold); }
.app-header .mode-nav { margin: 0; }
.app-header .mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 30rem; gap: .35rem; }
.app-header .mode-button { min-width: 0; min-height: 44px; padding: .6rem .8rem; text-align: center; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; gap: .5rem 1rem; font-size: .875rem; }
.header-actions > a, .header-actions > button { flex-shrink: 0; }
.header-actions a { color: var(--text); }
.view-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.5rem .5rem; }
.view-heading h1 { margin: .25rem 0; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; }
.view-heading .insight { margin: .4rem 0; max-width: 80ch; font-size: 1rem; }
.view-evidence { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sources-limits { margin: 1rem 1.5rem 2rem; padding: 1rem; border: 1px solid var(--line-strong); background: var(--panel); }
.sources-limits summary { cursor: pointer; min-height: 44px; }
.score-scale { display: block; flex-basis: 100%; color: #bcebd0; font-size: .8rem; }

button,
input {
  font: inherit;
}

/* Accessible focus indicator: one high-contrast ring for every keyboard-focused
   control. Components must NOT set `outline: none` — a same-colour border change
   is invisible (that was the bug). The 2px offset sits the ring on the dark panel
   behind the control, so it stays >=3:1 even over the gold button fills. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  background: radial-gradient(circle at 35% 35%, #221309 0, #060608 38rem);
  overflow-x: hidden; /* keep the collapsed (slid-out) panel from adding a horizontal scrollbar */
}

.stage-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem);
  grid-template-areas: "visual inspector" "timeline inspector";
  grid-template-rows: minmax(32rem, calc(100dvh - 17rem)) auto;
  gap: 1.25rem;
  /* The Sun is the hero: the first section fills the screen so the disk is
     above the fold. The text column scrolls inside its own cell instead of
     stretching the visual column into a void. dvh tracks iOS Safari's dynamic
     toolbar (100vh overflows while the toolbar is visible); vh is the fallback. */
  height: auto;
  min-height: 34rem;
  align-items: stretch;
  padding: 1rem;
  position: relative; /* containing block for the slid-out panel when collapsed */
}

.viewport {
  grid-area: visual;
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  border: 1px solid #1f232c;
  background: #050507;
  overflow: hidden;
}

#solarCanvas {
  width: min(60vh, 100%);
  max-width: 58rem;
  aspect-ratio: 1 / 1;
  display: block;
  cursor: crosshair;
}

.scene-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  max-width: min(26rem, calc(100% - 2rem));
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(247, 183, 51, 0.55);
  background: rgba(7, 8, 10, 0.76);
  color: var(--text);
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.stage-rail {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 0.3rem;
  max-width: calc(100% - 2rem);
  padding: 0.35rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 8, 10, 0.74);
  backdrop-filter: blur(8px);
}

.stage-step {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
}

.stage-step.active {
  color: #1a1206;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 800;
}

.base-label {
  position: absolute;
  top: 3.9rem;
  left: 1rem;
  z-index: 2;
  max-width: calc(100% - 2rem);
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 8, 10, 0.74);
  color: #dce2e6;
  font-size: 0.74rem;
  backdrop-filter: blur(8px);
  overflow-wrap: anywhere;
}

.base-label.observed {
  border-color: rgba(64, 214, 200, 0.6);
  color: #dffaf7;
}

.base-label.synthetic {
  border-color: rgba(247, 183, 51, 0.6);
  color: #f7e4b2;
}

.status-strip {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 9, 12, 0.78);
  backdrop-filter: blur(10px);
}

.control-panel {
  grid-area: inspector;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  /* Liquid glass: translucent + a backdrop blur of whatever is behind it (the 3-D view on the orrery
     surface, where the panel overlays the full-bleed canvas). */
  background: rgba(16, 18, 26, 0.55);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  position: relative;
  z-index: 5;
  transition: transform 0.28s ease, opacity 0.22s ease;
}
.control-panel > header { padding: 0; }
.control-panel > header h2 { margin: .1rem 0; }

/* Collapsed: the panel slides out and the viewport takes the full width. The panel is pulled OUT of
   grid flow (absolute) so the now-single-column stage-band can't stack it into a second row beneath
   the viewport — that row, though slid out and transparent, left a tall scrollable void (the
   app-shell gradient) under the Sun on the 2-D surfaces. */
body.panel-collapsed .stage-band { grid-template-columns: minmax(0, 1fr); grid-template-areas: "visual" "timeline"; }
body.panel-collapsed .control-panel {
  display: none;
}

/* Floating pin/collapse toggle. */
.panel-toggle {
  position: static;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 22, 30, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  color: #e8e6dd;
  cursor: pointer;
  font: 600 0.85rem "Segoe UI", system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.panel-toggle:hover { background: rgba(40, 44, 56, 0.72); }

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.insight {
  color: #e9e2cc;
  line-height: 1.45;
}

.summary-panel {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  background: #101316;
}

.summary-panel strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.02rem;
  line-height: 1.25;
}

.summary-panel p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.state-pill,
.timeline-link,
.legend-chip {
  min-height: 1.8rem;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  background: #090b0f;
  color: #dce2e6;
  font-size: 0.78rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.state-pill.live,
.state-pill.cached,
.state-pill.research-ready {
  border-color: rgba(64, 214, 200, 0.65);
  color: #dffaf7;
}

.state-pill.fixture,
.state-pill.research-only {
  border-color: rgba(247, 183, 51, 0.72);
  color: #f7e4b2;
}

.state-pill.degraded,
.state-pill.blocked {
  border-color: rgba(255, 89, 100, 0.72);
  color: #ffd4d8;
}

.timeline-link {
  border-color: rgba(246, 243, 232, 0.22);
}

.mode-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mode-group-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

/* The top-level destination nav: three equal columns (The Sun · My Sky · Solar System). */
.mode-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-button {
  min-height: 2.6rem;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.mode-button.active {
  border-color: var(--gold);
  background: #2b1f10;
}

.layer-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.layer-controls label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  color: #e3e6e8;
}

.layer-legend {
  display: grid;
  gap: 0.45rem;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.legend-chip.synthetic {
  border-color: rgba(247, 183, 51, 0.58);
}

.legend-chip.observed {
  border-color: rgba(64, 214, 200, 0.62);
}

.legend-chip.blended,
.legend-chip.inferred {
  border-color: rgba(217, 88, 167, 0.58);
}

.legend-chip.degraded {
  border-color: rgba(255, 89, 100, 0.62);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.metric-grid > div {
  min-height: 4.4rem;
  padding: 0.75rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric-grid > div:nth-child(2n) {
  border-right: 0;
}

.metric-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.metric-grid strong,
.status-strip strong {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

.mode-copy,
.application-panel {
  padding: 0.85rem;
  border-left: 3px solid var(--teal);
  background: #10161a;
}

.application-panel {
  border-left-color: var(--gold);
}

.application-panel strong {
  display: block;
  margin-top: 0.25rem;
}

.application-panel p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.signal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.signal-chip {
  min-height: 1.7rem;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.48rem;
  border: 1px solid rgba(247, 183, 51, 0.42);
  background: #090b0f;
  color: #f1e5c4;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.selection-panel {
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: #0e1217;
}

.selection-panel.selected {
  border-color: rgba(247, 183, 51, 0.72);
  background: #15120c;
}

.selection-panel strong {
  display: block;
  margin-top: 0.25rem;
  line-height: 1.25;
}

.selection-panel p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.mode-copy p,
.timeline-copy p,
.research-list dd {
  color: var(--muted);
  line-height: 1.45;
}

.research-panel {
  border: 1px solid var(--line);
  background: #0d0f13;
}

.research-panel summary {
  min-height: 2.8rem;
  padding: 0.8rem;
  cursor: pointer;
}

.equation-block {
  display: grid;
  gap: 0.5rem;
  padding: 0 0.8rem 0.8rem;
}

.equation-block code {
  display: block;
  padding: 0.75rem;
  overflow-x: auto;
  background: #050507;
  color: #f2d481;
  border: 1px solid #252b34;
}

.research-list {
  margin: 0;
  padding: 0 0.8rem 0.8rem;
}

.research-list div {
  padding: 0.65rem 0;
  border-top: 1px solid #242933;
}

.research-list dt {
  font-weight: 700;
}

.research-list dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.research-list a {
  color: #dffaf7;
}

.status-checklist {
  display: grid;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.status-checklist-item {
  display: grid;
  grid-template-columns: 4.7rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem;
  border: 1px solid #242933;
  background: #090b0f;
}

.status-checklist-item.pass {
  border-color: rgba(64, 214, 200, 0.42);
}

.status-checklist-item.blocked {
  border-color: rgba(255, 89, 100, 0.42);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  padding: 0.12rem 0.35rem;
  border: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 800;
}

.status-badge.pass {
  border-color: rgba(64, 214, 200, 0.7);
  color: #dffaf7;
}

.status-badge.blocked {
  border-color: rgba(255, 89, 100, 0.7);
  color: #ffd4d8;
}

.status-copy {
  display: grid;
  gap: 0.2rem;
}

.status-copy span {
  color: var(--muted);
}

.timeline-band {
  grid-area: timeline;
  padding: 1rem;
  background: #0b0d10;
  border-top: 1px solid #222833;
}

.timeline-inner {
  display: grid;
  grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

#butterflyCanvas {
  width: 100%;
  height: clamp(8rem, 22vw, 13rem);
  border: 1px solid #2b303b;
  background: #08090c;
  cursor: crosshair;
}

.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.time-scrubber {
  flex: 1;
  min-width: 6rem;
  accent-color: var(--gold);
  cursor: pointer;
}

.time-btn {
  min-height: 2.2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--gold);
  background: #2b1f10;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.time-btn.ghost {
  border-color: var(--line-strong);
  background: var(--panel-2);
  font-weight: 400;
}

.time-btn:hover,
.time-btn:focus-visible {
  border-color: var(--gold);
}

.time-frame-label {
  margin: 0.55rem 0 0;
  color: var(--gold);
  font-size: 0.85rem;
}

.live-engine {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.live-engine .time-frame-label {
  color: var(--teal);
}

/* Keyboard/AT-accessible active-region picker (mirrors clicking a disk marker). */
.region-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.2rem;
}

.object-search { display: grid; gap: 0.4rem; margin-top: 0.8rem; }
.object-search input { min-width: 0; width: 100%; min-height: 44px; padding: 0.55rem; border: 1px solid var(--line); border-radius: 0.4rem; background: var(--panel-2); color: var(--text); }
.release-status { flex-basis: 100%; max-width: 22rem; font-size: 0.72rem; color: var(--muted); }
#viewEvidenceJson { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 24rem; overflow: auto; }
.snapshot-status { grid-column: 1 / -1; padding: 0.75rem; border-left: 3px solid var(--gold); color: var(--text); background: var(--panel-2); }

.region-chip {
  min-height: 2.1rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.region-chip:hover {
  border-color: var(--gold);
}

.region-chip.selected {
  border-color: var(--gold);
  background: #2b1f10;
  font-weight: 700;
}

/* Sky "Up now" rows are focusable buttons (keyboard preview + pin). */
.sky-row[role="button"] {
  cursor: pointer;
}

/* Solar System control groups — the Sun panel's <details> disclosure ported here so
   the orrery's dense controls aren't one flat wall. Own class (not .sun-section,
   which is display:none on this surface) but visually identical. */
.orrery-group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 0.6rem;
}

.orrery-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.8rem;
  font: 600 0.9rem "Segoe UI", system-ui, sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.orrery-group > summary::-webkit-details-marker { display: none; }

.orrery-group > summary::after {
  content: "▸";
  color: rgba(247, 183, 51, 0.85);
  transition: transform 0.15s ease;
}

.orrery-group[open] > summary::after { transform: rotate(90deg); }
.orrery-group > summary:hover { background: rgba(255, 255, 255, 0.04); }

.orrery-group-body {
  padding: 0 0.8rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.orrery-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}

.orrery-camera-row {
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.orrery-focus-label { gap: 0.4rem; }
.orrery-focus-select { width: auto; }
.orrery-field { display: grid; gap: 0.4rem; min-width: 0; }
.orrery-field select { width: 100%; min-width: 0; }

/* ---- My Sky surface ---- */
#skyCanvas {
  width: min(78vh, 100%);
  max-width: 58rem;
  aspect-ratio: 1 / 1;
  display: none;
  cursor: default;
}

body[data-surface="sky"] #skyCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
}

/* Hover tooltip for a sky object (rise/transit/set + trajectory note). */
.sky-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  max-width: 17rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(247, 183, 51, 0.5);
  border-radius: 0.35rem;
  background: rgba(8, 10, 16, 0.92);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.35;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}
.sky-tooltip strong { color: #ffe39a; font-size: 0.92rem; }
.sky-tooltip .tt-line { color: rgba(228, 234, 246, 0.86); }
.sky-tooltip .muted { color: rgba(170, 180, 200, 0.7); }

.sky-row.sky-subhead {
  margin-top: 0.4rem;
  color: rgba(247, 183, 51, 0.8);
  font: 600 0.74rem "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sky-row.sky-hoverable { cursor: pointer; }
.sky-row.sky-hoverable:hover { background: rgba(247, 183, 51, 0.08); }

/* Live accuracy / validity readout under the time controls. */
.epoch-accuracy {
  margin: 0.4rem 0 0;
  padding: 0.3rem 0.5rem;
  border-left: 3px solid var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  color: rgba(220, 226, 240, 0.8);
  background: rgba(255, 255, 255, 0.03);
}
.epoch-accuracy:empty { display: none; }
.epoch-accuracy.acc-good { border-left-color: #4caf72; }
.epoch-accuracy.acc-ok { border-left-color: #d8b24a; }
.epoch-accuracy.acc-rough { border-left-color: #d8744a; }

.sky-panel {
  display: none;
}

body[data-surface="sky"] #skyCanvas {
  display: block;
}

body[data-surface="sky"] .sky-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Hide the Sun-centric chrome when the sky view is active. */
body[data-surface="sky"] #solarCanvas,
body[data-surface="sky"] #stageRail,
body[data-surface="sky"] #baseLabel,
body[data-surface="sky"] .status-strip,
body[data-surface="sky"] .control-panel > header,
body[data-surface="sky"] .summary-panel,
body[data-surface="sky"] .sun-section,
body[data-surface="sky"] .wavelength-panel,
body[data-surface="sky"] .timeline-band {
  display: none !important;
}

/* The top-down orbit view is now a camera toggle inside the 3-D View surface (orrery.js);
   the standalone Solar System surface was folded in to remove the duplicate of the same data. */
.sys-range {
  width: 100%;
  margin-top: 0.35rem;
}

.sys-zoom-row {
  display: block;
  margin-top: 0.75rem;
}

/* ---- 3-D View (WebGPU orrery) ---- */
#orreryCanvas {
  width: min(78vh, 100%);
  max-width: 58rem;
  aspect-ratio: 1 / 1;
  display: none;
  cursor: grab;
  background: #04060c;
  touch-action: none;
}

#orreryCanvas:active {
  cursor: grabbing;
}

.orrery-panel {
  display: none;
}

/* Projected planet name labels overlaid on the WebGPU/WebGL2 canvas. */
.orrery-labels {
  position: absolute;
  pointer-events: none;
  display: none;
  z-index: 2;
}

body[data-surface="orrery"] .orrery-labels {
  display: block;
}

.orrery-label {
  position: absolute;
  transform: translate(0.5rem, -50%);
  color: rgba(232, 238, 255, 0.88);
  font: 600 0.72rem "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
  text-shadow: 0 1px 3px #000, 0 0 2px #000;
}

/* Celestial-backdrop marker labels (pulsars, galaxies, bright stars). */
.orrery-label.sky-pulsar {
  color: rgba(140, 240, 255, 0.92);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}
.orrery-label.sky-galaxy {
  color: rgba(216, 196, 255, 0.85);
  font-weight: 500;
  font-size: 0.66rem;
}
.orrery-label { overflow: hidden; text-overflow: ellipsis; }
.orrery-label.label-callout { background: #142131; outline: 1px solid #adcae4; border-radius: 3px; }
#orreryPositions { max-height: 22rem; overflow-y: auto; }
#orrerySearch, #orreryObjectGroup { width: 100%; min-width: 0; }
#orreryObjectCount, #orrerySelectedEpoch { font-variant-numeric: tabular-nums; }
.cycle-frame-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.cycle-frame-table th, .cycle-frame-table td { text-align: left; padding: .35rem; border-bottom: 1px solid #314253; overflow-wrap: anywhere; }

.orrery-label.sky-star {
  color: rgba(232, 236, 246, 0.7);
  font-weight: 500;
  font-size: 0.64rem;
}

/* 3-D View control checkboxes. */
.orrery-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: rgba(232, 238, 255, 0.82);
  cursor: pointer;
  white-space: nowrap;
}
.orrery-check input {
  accent-color: #f7b733;
}

body[data-surface="orrery"] #orreryCanvas {
  display: block;
  /* Fill the whole viewport instead of a centred 78vh square — the perspective camera uses the
     canvas aspect ratio, so a full-bleed rectangle just shows more sky. Absolute inset:0 against the
     position:relative .viewport sidesteps grid/flex percentage-height quirks. Filling also raises the
     backing-store resolution (ensureSized scales it by devicePixelRatio off the displayed size). */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
}

body[data-surface="orrery"] .orrery-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

body[data-surface="orrery"] #solarCanvas,
body[data-surface="orrery"] #stageRail,
body[data-surface="orrery"] #baseLabel,
body[data-surface="orrery"] .status-strip,
body[data-surface="orrery"] .control-panel > header,
body[data-surface="orrery"] .summary-panel,
body[data-surface="orrery"] .sun-section,
body[data-surface="orrery"] .wavelength-panel,
body[data-surface="orrery"] .timeline-band {
  display: none !important;
}

/* ---- Solar wavelength selector (the Sun, filterable by SDO channel) ---- */
.wavelength-panel {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.wavelength-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.wl-chip {
  border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.3));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #e8e6dd;
  font: 600 0.74rem "Segoe UI", system-ui, sans-serif;
  padding: 0.28rem 0.6rem;
  min-height: 1.5rem; /* 24px touch-target floor */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.wl-chip::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--wl, #f6aa45);
}
.wl-chip:hover { background: rgba(255, 255, 255, 0.07); }
.wl-chip.active {
  border-color: var(--wl, var(--gold, #f7b733));
  background: rgba(247, 183, 51, 0.12);
  color: #fff;
}

/* ---- "Inside the Sun" cutaway cross-section ---- */
.sun-cutaway svg { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.layer-list { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.7rem; }
.layer-row { display: flex; gap: 0.55rem; font-size: 0.82rem; line-height: 1.4; color: rgba(220, 226, 240, 0.82); }
.layer-row strong { color: #f0ede4; }
.layer-row .muted { color: rgba(220, 226, 240, 0.62); }
.layer-rad { color: rgba(220, 226, 240, 0.9); }
.layer-dot {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.28rem;
  border-radius: 50%;
  background: var(--c, #fff);
  box-shadow: 0 0 6px var(--c, #fff);
}

/* ---- "The Sun" surface: one destination, depth revealed in progressive-disclosure drawers ---- */
.sun-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 0.75rem;
  overflow: hidden;
}
.sun-section > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0.9rem;
  font: 600 0.92rem "Segoe UI", system-ui, sans-serif;
  color: #f0ede4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.sun-section > summary::-webkit-details-marker { display: none; }
.sun-section > summary::after {
  content: "▸";
  color: rgba(247, 183, 51, 0.85);
  transition: transform 0.15s ease;
}
.sun-section[open] > summary::after { transform: rotate(90deg); }
.sun-section > summary:hover { background: rgba(255, 255, 255, 0.04); }
.sun-section > .sun-section-body {
  padding: 0 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
/* Sections nested in a drawer drop their own outer chrome — the drawer provides it. */
.sun-section .layer-controls,
.sun-section .layer-legend,
.sun-section .metric-grid,
.sun-section .selection-panel,
.sun-section .application-panel {
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0.7rem 0 0;
  font-size: 0.86rem;
}

.detail-grid dt {
  color: #7d8fa6;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.detail-grid dd {
  margin: 0;
  color: #eef2f6;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

#orreryDetail .system-detail.sky-row {
  background: none;
  border: 0;
  padding: 0.15rem 0 0.4rem;
  box-shadow: none;
}

#orreryDetail .system-detail > strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #f4f1ea;
}

#orreryDetail .system-detail > .time-frame-label {
  color: #8b9db2;
  font-size: 0.74rem;
  line-height: 1.5;
  max-width: 42ch;
}

.inspector-chapter {
  margin: 1.15rem 0 0.45rem;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d7f96;
}

.orrery-panel > .inspector-chapter:first-of-type { margin-top: 0.35rem; }

.sky-header h1 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin-bottom: 0.5rem;
}

.sky-observer,
.sky-source,
.sky-time {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: #10161a;
}

.sky-input-wide {
  width: auto;
  flex: 1 1 11rem;
  min-width: 9rem;
}

.sky-source {
  border-left-color: var(--gold);
}

.time-btn.active {
  background: var(--gold);
  color: #15110a;
  border-color: var(--gold);
}

.sky-loc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.sky-input {
  width: 5.5rem;
  min-height: 2.2rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line-strong);
  background: #090b0f;
  color: var(--text);
}

.sky-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.sky-row {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  background: #0e1217;
}

.sky-row strong {
  display: block;
}

.sky-row .muted {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Aurora outlook — the location-aware verdict inside the space-weather drawer. The left
   accent encodes the verdict tier without relying on color alone (the headline says it). */
.aurora-outlook {
  margin: 0.5rem 0 0.65rem;
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.86rem;
  line-height: 1.45;
}
.aurora-outlook strong { display: block; margin-bottom: 0.15rem; }
.aurora-outlook.aurora-overhead { border-left-color: #6fd08c; }
.aurora-outlook.aurora-horizon { border-left-color: var(--gold); }
.aurora-outlook.aurora-unlikely { border-left-color: var(--line-strong); }
.aurora-outlook.aurora-unknown { border-left-color: var(--muted); color: var(--muted); }

/* Glossary term affordance + tooltip (plain-language help on hover/focus/tap). */
.term {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 24px minimum touch target (WCAG 2.5.8) — 1.15rem ≈ 18px was below the floor. */
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.15rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #090b0f;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.term:hover,
.term:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

.legend-chip[data-term] {
  cursor: help;
}

.legend-chip[data-term]:hover,
.legend-chip[data-term]:focus-visible {
  border-color: var(--gold);
}

.term-tip {
  position: fixed;
  z-index: 50;
  max-width: 18rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--gold);
  background: rgba(10, 11, 15, 0.97);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.term-tip strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--gold);
}

.term-tip[hidden] {
  display: none;
}

/* Progressive disclosure: panels hidden on a given surface get this class in JS.
   "Today" is the beginner glance; depth is revealed on Explore/Weather/Research. */
.surface-hide {
  display: none !important;
}

.stage-step[data-term] {
  cursor: help;
}

/* Onboarding tour CTA + guided overlay. */
.tour-cta {
  align-self: start;
  margin-top: 0.2rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--gold);
  background: #2b1f10;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.tour-cta:hover,
.tour-cta:focus-visible {
  background: #3a2912;
}

.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

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

.tour-spot {
  position: fixed;
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(4, 5, 8, 0.72);
  transition: all 0.18s ease;
  pointer-events: none;
}

.tour-spot.hidden {
  display: none;
}

.tour-card {
  position: fixed;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border: 1px solid var(--gold);
  background: rgba(12, 13, 17, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.tour-card strong {
  display: block;
  margin: 0.1rem 0 0.35rem;
  font-size: 1.05rem;
}

.tour-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tour-step-count {
  margin: 0 0 0.2rem;
  color: var(--gold);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.tour-spacer {
  flex: 1;
}

.tour-btn {
  min-height: 2.1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.tour-btn.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #1a1206;
  font-weight: 700;
}

.tour-btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.tour-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 880px) {
  .stage-band,
  .timeline-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-band {
    grid-template-areas: "visual" "timeline" "inspector";
    grid-template-rows: auto;
    height: auto;
    min-height: auto;
    gap: 0.8rem;
  }

  .stage-rail,
  .base-label {
    position: static;
    transform: none;
    align-self: stretch;
    max-width: none;
    margin-bottom: 0.55rem;
  }

  .stage-rail {
    justify-content: center;
    flex-wrap: wrap;
  }

  .control-panel {
    order: 0;
  }

  .viewport {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    height: auto;
    min-height: 24rem;
    padding: 0.75rem;
  }

  .status-strip {
    position: static;
    width: 100%;
    margin-top: 0.6rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0.65rem;
  }

  .scene-badge {
    position: static;
    align-self: stretch;
    width: 100%;
    max-width: none;
    margin-bottom: 0.55rem;
  }

  #solarCanvas {
    width: min(100%, 34rem, 42vh);
  }

  .control-panel {
    max-height: none;
    height: auto;
    overflow: visible;
    gap: 0.7rem;
  }

  .control-panel header {
    display: grid;
    gap: 0.25rem;
  }

  .insight {
    margin-bottom: 0;
  }

  .summary-panel {
    padding: 0.7rem;
  }

  .mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metric-grid > div,
  .metric-grid > div:nth-child(2n),
  .metric-grid > div:nth-last-child(-n + 2) {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .metric-grid > div:last-child {
    border-right: 0;
  }
}

@media (max-width: 520px) {
  .app-header { grid-template-columns: auto minmax(0, 1fr); padding: .5rem .65rem; gap: .5rem; }
  .brand { font-size: 1.15rem; }
  .brand span { display: none; }
  .app-header .mode-button { padding: .4rem .25rem; font-size: .78rem; }
  .header-actions { grid-column: 1 / -1; justify-content: flex-start; gap: .35rem .75rem; }
  .header-actions .time-btn { min-height: 44px; max-width: 100%; padding: .3rem .5rem; white-space: normal; }
  .release-status { max-width: none; }
  .timeline-controls .time-btn { min-height: 44px; }
  .timeline-controls .time-scrubber { flex-basis: 8rem; min-height: 44px; }
  .view-heading { padding: .8rem .65rem .2rem; display: block; }
  .view-heading .panel-toggle { margin-top: .6rem; }
  .view-heading .eyebrow { font-size: .65rem; }
  .sources-limits { margin: 1rem .65rem; }
  .stage-band,
  .timeline-band {
    padding: 0.65rem;
  }

  .control-panel {
    padding: 0.8rem;
  }

  h1 {
    font-size: 1.35rem;
    line-height: 1.12;
  }

  .viewport {
    height: auto;
    padding: 0.55rem;
  }

  #solarCanvas {
    width: min(100%, 24rem);
  }

  .status-strip {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.55rem;
  }

  .status-strip > div {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    align-items: baseline;
    gap: 0.45rem;
  }

  .mode-grid,
  .layer-controls {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-grid > div:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .metric-grid > div:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .metric-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

.physical-source-controls { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border, #26313d); }
.physical-source-controls p { font-size: .75rem; line-height: 1.55; color: #b9c4d1; }
.physical-source-controls label, .physical-source-controls output { display: block; font-size: .72rem; line-height: 1.5; margin: .65rem 0 .35rem; }
.physical-source-controls input[type="range"] { width: 100%; min-height: 32px; accent-color: #e8b766; }
.physical-source-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.physical-source-actions button { min-height: 44px; }
#orreryPhysicalStatus { color: #c4cbd5; }

/* Respect the OS motion preference: no decorative transitions/animations for users who
   asked for reduced motion. (The 3-D view's auto-animation is gated in JS — orrery.js
   checks the same media query at init.) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Print: browsers strip dark backgrounds by default, which left pale-grey text on white.
   Flip to a light scheme and drop the interactive chrome. */
@media print {
  :root {
    color-scheme: light;
  }

  body,
  .app-shell {
    background: #fff !important;
    color: #111 !important;
  }

  .control-panel,
  .summary-panel,
  .sky-panel,
  .orrery-panel {
    color: #111 !important;
  }

  .panel-toggle,
  .tour-cta,
  .tour-layer,
  .term-tip,
  canvas {
    display: none !important;
  }
}

/* Text-alternative rows for the 3-D view are buttons so keyboard users can select a body;
   they must still read as list rows, not as chunky form controls. */
#orreryPositions .sky-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
#orreryPositions .sky-row:hover,
#orreryPositions .sky-row:focus-visible { background: rgba(255, 255, 255, 0.06); }
#orreryPositions .orrery-pos-moon { padding-left: 1.1rem; opacity: 0.85; }

/* My Sky: native keyed controls and inline precise-location disclosure. */
#skyList { max-height: 32rem; overflow: auto; overscroll-behavior: contain; }
#skyList .sky-object-row { width: 100%; text-align: left; color: inherit; font: inherit; background: none; border: 0; cursor: pointer; }
#skyList .sky-object-row[aria-pressed="true"] { outline: 1px solid currentColor; outline-offset: -2px; }
#skyList .sky-object-row:focus-visible { outline: 2px solid var(--gold, #f7b733); outline-offset: -2px; }
#skyList .sky-object-row[hidden], .sky-disclosure[hidden] { display: none; }
.sky-disclosure { padding: .75rem; margin-block: .75rem; border: 1px solid currentColor; border-radius: .5rem; overflow-wrap: anywhere; }
#skySelectedFacts { padding: .5rem 0; overflow-wrap: anywhere; }
#skySelectedFacts p { font-size: .85rem; line-height: 1.5; }

/* SOL workspace: persistent destinations, a generous scientific canvas and optional tools.
   Layout state only changes disclosure; evidence and consent retain their own semantics. */
.app-shell { background: radial-gradient(ellipse at 45% 0%, #14233b 0, #070d19 65%); }
.app-header { background: #0c1423; border-color: #273349; }
.brand { letter-spacing: .14em; text-transform: uppercase; }
.brand span { display: inline; margin-right: .3rem; }
.app-header .mode-button { border-radius: .5rem; color: #c3ccdb; background: transparent; }
.app-header .mode-button.active { color: #ffe0a3; border-color: #a68a55; background: #302a20; box-shadow: inset 3px 0 0 var(--gold); }
.header-actions a { text-underline-offset: .3em; }
.view-heading { flex-wrap: wrap; padding: 1.5rem 1.5rem .65rem; }
.view-heading > div:first-child { flex: 1 1 30rem; min-width: 0; }
.view-heading h1 { font-weight: 500; letter-spacing: -.035em; font-size: clamp(1.7rem, 2.6vw, 2.6rem); }
.view-heading .eyebrow { color: #dcc491; letter-spacing: .1em; }
.view-heading .insight { color: #c1cada; max-width: 85ch; }
.workspace-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.workspace-actions button { min-height: 44px; border: 1px solid var(--line-strong); border-radius: .45rem; white-space: normal; }
.workspace-actions button[aria-expanded="true"], #focusToggle[aria-pressed="true"] { border-color: var(--gold); color: #ffe0a3; }
.view-evidence { gap: .45rem .9rem; margin-top: .85rem; font-size: .78rem; }
.view-evidence > * { overflow-wrap: anywhere; }
.stage-band { padding: .75rem 1.5rem 1.25rem; gap: 1rem; grid-template-rows: minmax(32rem, calc(100dvh - 19rem)) auto; }
.viewport { border-radius: .85rem; border: 1px solid #2a3850; background: radial-gradient(ellipse at center, #0c1728, #030711 80%); }
.control-panel { background: #101a2bf5; border-color: #344058; border-radius: .75rem; box-shadow: 0 12px 36px #0005; max-height: calc(100dvh - 12rem); scrollbar-gutter: stable; }
.inspector-close { align-self: flex-end; }
.timeline-band { border: 1px solid #344058; border-radius: .75rem; background: #101a2b; }
.sources-limits { border-color: #596880; border-radius: .6rem; background: #0d1727; }
.sources-limits, .control-panel { overflow-wrap: anywhere; }
body.focus-mode .stage-band { grid-template-rows: minmax(35rem, calc(100dvh - 15rem)) auto; }
body.focus-mode .view-heading h1 { font-size: 1.5rem; }
.workspace-availability { font-size: .75rem; color: var(--muted); margin: .45rem 0; }
.solar-runtime { font-size: .75rem; }
body[data-surface="sky"] .solar-runtime, body[data-surface="orrery"] .solar-runtime { display: none; }
/* The source, epoch, readiness notice, navigation, Help and exit control remain visible in focus. */
@media (min-width: 1100px) {
  .app-shell { padding-left: 12rem; }
  .app-header { position: fixed; inset: 0 auto 0 0; width: 12rem; z-index: 20; display: flex; flex-direction: column; align-items: stretch; gap: 2.75rem; padding: 2rem 1rem 1.25rem; border-right: 1px solid #273349; border-bottom: 0; overflow-y: auto; }
  .brand { padding: 0 .65rem; font-size: 1.6rem; }
  .app-header .mode-grid { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .app-header .mode-button { text-align: left; padding: .9rem .8rem; }
  .header-actions { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: .85rem; font-size: .8rem; }
  .header-actions > a { padding: .5rem; }
  .header-actions > button { white-space: normal; }
  .release-status { max-width: none; padding: .5rem; }
}
@media (min-width: 881px) {
  .status-strip { width: auto; max-width: calc(100% - 2rem); right: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .status-strip strong { font-size: .85rem; }
}
@media (max-width: 1099px) {
  .app-header { grid-template-columns: auto minmax(0, 1fr); gap: .7rem 1rem; }
  .header-actions { grid-column: 1 / -1; }
  .app-header .mode-grid { max-width: none; }
  .stage-band { grid-template-columns: minmax(0, 1fr); grid-template-areas: "visual" "timeline" "inspector"; }
  .control-panel { max-height: none; height: auto; overflow: visible; }
}
@media (max-width: 520px) {
  .app-header { padding: .75rem .65rem; grid-template-columns: minmax(0, 1fr); }
  .brand { font-size: 1rem; }
  .app-header .mode-button { font-size: .8rem; }
  .header-actions { gap: .25rem .7rem; font-size: .75rem; }
  .view-heading { padding: 1rem .65rem .5rem; }
  .workspace-actions { margin-top: .75rem; gap: .4rem; }
  .workspace-actions .panel-toggle { margin-top: 0; }
  .workspace-actions button { font-size: .78rem; padding: .5rem; }
  .stage-band { padding: .5rem .65rem; grid-template-rows: auto; }
  body.focus-mode .stage-band { grid-template-rows: auto; }
  .viewport { min-height: 22rem; }
  body[data-surface="orrery"] .viewport { min-height: 30rem; }
  .view-heading .eyebrow { font-size: .62rem; }
  .view-heading .insight { font-size: .9rem; }
  .timeline-inner { min-width: 0; }
  .sky-loc-row > *, .sky-input, .sys-range { max-width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .control-panel, .mode-button, .workspace-actions button { transition: none; }
}

/* Observation-led explorer. Research remains a separate, explicit workspace. */
body { background: #060b12; }
.app-shell { background: radial-gradient(ellipse at 42% 15%, #101b2a 0, #060b12 66%); }
.app-header { background: #080e17; }
.brand { display: flex; align-items: center; justify-content: center; gap: .75rem; }
.brand .brand-word { color: #f4f0e8; font-size: 1rem; font-weight: 500; letter-spacing: .23em; }
.brand .brand-orbit { display: block; width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid #e9c889; border-radius: 50%; box-shadow: 0 0 9px #d797444a, inset 0 0 6px #b2723325; margin: 0; }
.nav-symbol { display: block; font-family: Georgia, serif; font-size: 1.8rem; line-height: 1.2; margin-bottom: .4rem; color: #a5b6cd; }
.nav-sun { color: #ffd997; text-shadow: 0 0 16px #f4a42c80; }
.app-header .mode-button { border: 1px solid transparent; background: transparent; box-shadow: none; border-radius: .65rem; font-size: .7rem; font-weight: 500; }
.app-header .mode-button.active { color: #f5ddb4; background: linear-gradient(135deg, #4f3a204d, #2130483d); border-color: #6c5c426e; box-shadow: none; }
.app-header .mode-button:hover { background-color: #ffffff09; }
.header-actions .time-btn, .offline-menu summary { border: 0; background: transparent; font-size: .75rem; font-weight: 400; color: #b8c5d7; padding: .5rem 0; box-shadow: none; }
.header-actions a { text-decoration: none; color: #b8c5d7; }
.offline-menu { position: relative; text-align: center; }
.offline-menu summary { cursor: pointer; min-height: 44px; list-style: none; }
.offline-menu[open] { background: #142033; border-radius: .5rem; }
.offline-menu .release-status { display: block; font-size: .66rem; overflow-wrap: anywhere; }
.offline-menu #releaseUpdate { color: #f1cc8d; }
.view-heading { align-items: center; gap: 1rem; padding: 1.5rem 2rem .85rem; }
.view-heading > div:first-child { flex: 1 1 34rem; }
.view-heading .eyebrow { font-size: .58rem; letter-spacing: .19em; color: #92a2ba; margin: 0 0 .7rem; }
.brand-tagline { display: inline-block; margin-left: 1.4rem; color: #687f9f; text-transform: none; letter-spacing: .08em; }
.view-heading h1 { font-weight: 450; font-size: 1.85rem; line-height: 1.15; letter-spacing: -.025em; margin: 0; }
.view-heading .insight { font-size: .84rem; color: #aebed0; margin: .4rem 0; max-width: 80ch; }
.view-evidence { gap: .75rem; margin-top: .7rem; font-size: .65rem; color: #9eafc5; }
#viewSource { padding: 0; background: none; border: 0; text-transform: none; font-weight: 400; }
#viewSource::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: .5rem; border-radius: 50%; background: #eac987; }
.workspace-availability { font-size: .65rem; }
.workspace-actions { gap: .65rem; align-self: center; }
.workspace-actions button { font-size: .75rem; background: #131e2d66; min-height: 40px; border-color: #51627b; }
.experience-switch { display: flex; padding: 3px; border: 1px solid #344255; border-radius: 30px; background: #080f1a; }
.experience-switch button { padding: .55rem 1.1rem; border: 0; min-height: 36px; border-radius: 25px; background: transparent; color: #a8b7cb; }
.experience-switch button[aria-pressed="true"] { color: #f9e7c8; background: #243044; box-shadow: inset 0 1px 0 #ffffff0c; }
#focusToggle { padding: .5rem .8rem; color: #b7c7dc; border-color: transparent; background: transparent; }
.stage-band { padding: 0 1.5rem 1rem; gap: .85rem; grid-template-rows: minmax(36rem, calc(100dvh - 13rem)) auto; }
.viewport { border-color: #2e3e5470; border-radius: .9rem; background: #03060a; }
body[data-surface="today"][data-experience="observe"] .stage-band { grid-template-columns: minmax(0, 1fr); grid-template-areas: "visual"; grid-template-rows: minmax(39rem, calc(100dvh - 11.5rem)); }
body[data-surface="today"][data-experience="observe"] #solarCanvas,
body[data-surface="today"][data-experience="observe"] #stageRail,
body[data-surface="today"][data-experience="observe"] #baseLabel,
body[data-surface="today"][data-experience="observe"] .status-strip,
body[data-surface="today"][data-experience="observe"] .solar-runtime,
body[data-surface="today"][data-experience="observe"] #viewAvailability,
body[data-surface="today"][data-experience="observe"] .research-control,
body[data-surface="today"][data-experience="observe"] #viewInspector,
body[data-surface="today"][data-experience="observe"] #timeline { display: none !important; }
body:not([data-surface="today"]) .experience-switch { display: none; }
.solar-observation { position: absolute; inset: 0; background: #03060a; }
.observation-image-wrap { position: absolute; inset: 1rem 21.5rem 3.7rem 0; display: flex; align-items: center; justify-content: center; background: #000; }
#observationImage { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-channel { position: absolute; top: 1.3rem; left: 1.5rem; padding: .6rem .8rem; border: 1px solid #5c513f; border-radius: .5rem; background: #101722e8; font-size: .75rem; color: #f4d5a0; }
.image-channel > span:last-child { color: #9cacc0; border-left: 1px solid #4d4d4d; margin-left: .6rem; padding-left: .6rem; }
.channel-dot { display: inline-block; width: 7px; height: 7px; margin-right: .5rem; border-radius: 50%; background: #f4ba5f; box-shadow: 0 0 12px #ec8b265e; }
.explorer-overview { position: absolute; top: 1.25rem; right: 1.2rem; width: 19.5rem; padding: 1.35rem 1.4rem 1.5rem; border: 1px solid #243140; border-radius: .75rem; background: #0b121cf2; box-shadow: none; }
.card-kicker { font-size: .52rem; font-weight: 500; letter-spacing: .12em; color: #6d7f96; margin: 0 0 .35rem; }
.explorer-overview h2 { font-size: 2rem; font-weight: 500; letter-spacing: -.04em; line-height: 1.05; color: #f4f1ea; margin: 0 0 .45rem; }
.card-intro { color: #93a4b8; font-size: .8rem; line-height: 1.55; margin: 0 0 1rem; }
.overview-tabs { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #273547; font-size: .68rem; }
.overview-tabs > span { padding: .7rem 0; color: #f3dbae; border-bottom: 2px solid #d7b273; }
.overview-tabs a { color: #a4b8d3; text-decoration: none; padding: .7rem 0; }
.sun-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem .8rem; padding: 1.25rem 0; }
.sun-facts strong { display: block; font-size: .83rem; font-weight: 500; letter-spacing: -.025em; }
.sun-facts span { display: block; color: #9caac0; font-size: .6rem; margin-top: .35rem; }
.observation-story { color: #acbcd0; font-size: .75rem; line-height: 1.8; margin: .25rem 0 1rem; }
.observation-details { font-size: .7rem; color: #b8c8de; border-top: 1px solid #29374a; }
.observation-details summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; min-height: 44px; }
.observation-details p { line-height: 1.7; }
.observation-details a { color: #d5b880; }
.research-entry { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: .7rem .95rem; min-height: 44px; color: #f3ddb4; background: #16130d; border: 1px solid #c4a36a; border-radius: .4rem; font-size: .8rem; cursor: pointer; margin-top: 1.05rem; }
.observation-context { display: flex; align-items: flex-start; gap: .7rem; border-top: 1px solid #273547; padding-top: 1.2rem; margin-top: 1.5rem; }
.context-icon { font-size: 1.8rem; line-height: 1; color: #779abc; }
.observation-context strong { font-size: .7rem; font-weight: 500; }
.observation-context p { font-size: .64rem; line-height: 1.7; color: #8fa4bf; margin: .4rem 0 0; }
.observation-caption { position: absolute; bottom: 0; left: 0; right: 0; min-height: 3.7rem; display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.25rem; padding: .9rem 1.5rem; border-top: 1px solid #23324480; background: #080f18; font-size: .65rem; color: #8fa4c0; }
.archive-label { font-size: .54rem; letter-spacing: .13em; color: #ead1a6; }
#observationCredit { margin-left: auto; }
.observation-loading { position: absolute; left: 1.5rem; right: 1.5rem; top: 45%; margin: 0; text-align: center; color: #c5d3e6; font-size: .85rem; line-height: 1.6; }
.observation-unavailable { position: absolute; inset: 30% 10%; text-align: center; background: #0a111bef; padding: 1.5rem; border: 1px solid #495a73; border-radius: .7rem; }
.observation-unavailable h2 { font-size: 1.1rem; font-weight: 400; }
.sources-limits { border: 0; border-top: 1px solid #273445; border-radius: 0; background: transparent; color: #98aac3; margin: 0 1.5rem 1rem; padding: .75rem .5rem; font-size: .75rem; }
.sources-limits > summary { min-height: 32px; }
.control-panel { background: #0c1522f5; border-color: #35445a; border-radius: .7rem; box-shadow: none; }
.control-panel > header h2 { font-size: 1.2rem; font-weight: 450; }
.control-panel .summary-panel { background: transparent; border-left: 0; padding: 0 0 1rem; border-bottom: 1px solid #2b3a50; }
.summary-panel #solarExport { float: none; display: block; margin: 0 0 1rem; font-size: .72rem; }
body.focus-mode .explorer-overview { display: none; }
body.focus-mode .observation-image-wrap { right: 0; }
@media (min-width: 1100px) {
  .app-shell { padding-left: 6.3rem; }
  .app-header { width: 6.3rem; padding: 1.5rem .7rem 1rem; gap: 2.75rem; }
  .brand { flex-direction: column; gap: .6rem; }
  .app-header .mode-grid { gap: .65rem; }
  .app-header .mode-button { padding: .8rem .2rem; text-align: center; }
  .header-actions { gap: .25rem; font-size: .64rem; text-align: center; }
}
@media (max-width: 1099px) {
  .app-header { padding: .75rem 1rem; grid-template-columns: auto 1fr; }
  .brand .brand-orbit { width: 23px; height: 23px; flex-basis: 23px; }
  .app-header .mode-grid { max-width: 28rem; margin-left: auto; }
  .nav-symbol { display: none; }
  .app-header .mode-button { font-size: .8rem; min-height: 44px; }
  .header-actions { display: none; }
  .view-heading { padding: 1.2rem 1rem .75rem; }
  .brand-tagline { display: none; }
  .workspace-actions { gap: .2rem; }
  .stage-band { padding: 0 .75rem .75rem; }
  .explorer-overview { width: 17rem; padding: 1.1rem; right: .85rem; }
  .observation-image-wrap { right: 18rem; }
  .sun-facts { gap: 1rem .7rem; }
  .observation-context { margin-top: 1rem; padding-top: 1rem; }
}
@media (max-width: 760px) {
  .view-heading { align-items: flex-start; }
  .view-heading > div:first-child { flex-basis: 100%; }
  .view-heading h1 { font-size: 1.6rem; }
  .view-heading .eyebrow { font-size: .52rem; }
  .view-evidence { font-size: .6rem; row-gap: .3rem; }
  .workspace-actions { margin-top: .1rem; justify-content: flex-start; width: 100%; }
  .workspace-actions button { min-height: 44px; }
  .experience-switch button { min-height: 38px; }
  body[data-surface="today"][data-experience="observe"] .stage-band { grid-template-rows: auto; }
  body[data-surface="today"][data-experience="observe"] .viewport { min-height: 0; height: auto; }
  .solar-observation { position: relative; width: 100%; display: flex; flex-direction: column; }
  .observation-image-wrap { position: relative; inset: auto; width: 100%; aspect-ratio: 1; padding-top: 2.5rem; }
  #observationImage { width: 100%; height: auto; max-height: 100%; }
  .image-channel { top: .6rem; left: .6rem; padding: .45rem .65rem; font-size: .65rem; }
  .explorer-overview { position: relative; inset: auto; width: auto; margin: 0 .65rem .65rem; padding: 1.2rem; order: 3; }
  .observation-caption { position: relative; inset: auto; padding: .8rem; gap: .4rem; order: 2; font-size: .57rem; border-bottom: 1px solid #23324480; margin-bottom: .8rem; }
  #observationStatus { flex-basis: 100%; }
  #observationCredit { margin-left: 0; }
  .sources-limits { margin: 0 .75rem 1rem; }
  .header-actions { display: flex; grid-column: 1/-1; margin: 0; padding: 0; justify-content: flex-end; font-size: .62rem; }
  .header-actions > a, .header-actions > button { padding: .1rem .4rem; min-height: 32px; }
  .offline-menu { display: block; flex: 0 1 13rem; max-width: 55%; }
  .offline-menu summary { padding: .5rem .4rem; }
  .offline-menu[open] { padding: 0 .5rem .5rem; }
  .offline-menu #releaseUpdate { min-height: 44px; white-space: normal; }
  body.focus-mode .observation-image-wrap { inset: auto; }
}
@media (prefers-reduced-motion: reduce) { .solar-observation * { scroll-behavior: auto; transition: none; } }
/* Keep the overview complete above the caption; expanded source details scroll locally. */
.explorer-overview { max-height: calc(100% - 6rem); overflow: auto; scrollbar-width: thin; scrollbar-color: #40536c transparent; }
.sun-facts strong { font-size: .88rem; }
.sun-facts span { font-size: .65rem; }
.observation-story { font-size: .8rem; }
.earth-context-link { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-top: .7rem; padding: .5rem 0; background: transparent; border: 0; color: #9fb9da; font-size: .7rem; text-align: left; cursor: pointer; }
@media (max-width: 760px) { .explorer-overview { max-height: none; overflow: visible; } }
@media (min-width: 761px) and (max-width: 1099px) {
  .header-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; margin: 0; font-size: .7rem; gap: .75rem; }
}

/* Sky and System share the observation view's hierarchy, with a separate context card. */
.destination-overview { grid-area: overview; align-self: start; min-width: 0; max-height: calc(100dvh - 15rem); overflow: auto; scrollbar-width: thin; padding: 1.35rem 1.4rem 1.5rem; border: 1px solid #243140; border-radius: .75rem; background: #0b121c; }
.destination-overview .eyebrow { color: #6d7f96; font-size: .52rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .35rem; }
.destination-overview h2 { font-size: 2rem; font-weight: 500; letter-spacing: -.04em; line-height: 1.05; color: #f4f1ea; margin: 0 0 .55rem; }
.destination-story { color: #93a4b8; font-size: .8rem; line-height: 1.55; margin: 0 0 1rem; max-width: 36ch; }
.destination-facts { display: flex; flex-direction: column; gap: 0; border-top: 1px solid #243140; margin: 0 0 1.1rem; padding: 0; }
.destination-facts:empty { display: none; }
.destination-facts div { display: grid; grid-template-columns: minmax(6.5rem, 42%) 1fr; gap: .7rem; align-items: baseline; min-width: 0; padding: .62rem 0; border-bottom: 1px solid #1b2734; }
.destination-facts dt { color: #7d8fa6; font-size: .62rem; letter-spacing: .03em; margin: 0; }
.destination-facts dd { margin: 0; font-size: .92rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: #eef2f6; text-align: right; overflow-wrap: anywhere; }
.destination-note { color: #7f91a6; font-size: .7rem; line-height: 1.6; }
.earth-ice-legend { margin: .75rem 0; }
.earth-ice-legend img { display: block; width: 100%; height: auto; max-width: 420px; background: #fff; border-radius: .25rem; }
.earth-ice-legend figcaption { color: #b9cde4; font-size: .75rem; line-height: 1.6; margin-top: .5rem; }
.destination-overview .overview-cta { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-top: .15rem; padding: .45rem 0; border: 0; border-radius: 0; background: none; color: #8fa4bc; font-size: .74rem; font-weight: 450; text-align: left; cursor: pointer; }
.destination-overview .overview-cta:hover, .destination-overview .overview-cta:focus-visible { color: #d7e3f0; }
.destination-overview #destinationFocus.overview-cta { margin-top: 1.05rem; padding: .7rem .95rem; border: 1px solid #c4a36a; border-radius: .4rem; background: #16130d; color: #f3ddb4; font-size: .8rem; font-weight: 500; }
.destination-overview #destinationFocus.overview-cta:hover, .destination-overview #destinationFocus.overview-cta:focus-visible { border-color: #e0c48a; color: #fff4d6; }
.destination-actions { display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; margin-top: .35rem; }
.destination-actions button { min-height: 44px; padding: .4rem 0; color: #7f93aa; background: none; border: 0; font-size: .72rem; text-align: left; cursor: pointer; }
.destination-actions button:hover, .destination-actions button:focus-visible { color: #d5e1ee; }
.destination-preview { border-block: 1px solid #2b3a4b; margin: 1rem 0; font-size: .73rem; color: #b9cde4; }
.destination-preview summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.destination-preview img { display: block; width: 100%; max-height: 180px; object-fit: contain; background: #020407; }
.destination-preview a { display: block; color: #b9cde4; margin-bottom: .75rem; overflow-wrap: anywhere; }
.destination-caption { display: none; grid-area: 2 / 1; position: relative; z-index: 4; padding: .9rem 1.2rem; background: #080f19ed; border-top: 1px solid #283544; color: #bdd0e7; font-size: .67rem; pointer-events: none; }
.destination-caption p { margin: 0; }
.destination-caption p + p:not(:empty) { margin-top: .3rem; color: #f2d497; }
.system-jumps { position: absolute; z-index: 5; display: none; flex-wrap: wrap; gap: .4rem; inset: 1rem auto auto 1rem; max-width: calc(100% - 2rem); }
body[data-surface="orrery"] .system-jumps { display: flex; }
.system-jumps button { background: #101c2aeb; color: #c5d7ee; border: 1px solid #65768b; border-radius: .5rem; padding: .5rem .75rem; font-size: .73rem; min-height: 44px; cursor: pointer; }
.system-jumps button[aria-pressed="true"] { border-color: #d3b278; color: #f9dfb0; background: #302719e8; }
body:not([data-surface="today"]) .destination-caption { display: block; }
body:not([data-surface="today"]) .stage-band { grid-template-rows: auto auto; }
body:not([data-surface="today"]).panel-collapsed:not(.focus-mode) .stage-band { grid-template-columns: minmax(0, 1fr) 20rem; grid-template-areas: "visual overview"; }
/* Sampling warnings can gain or lose lines during playback. Give the scene its
   own definite height; let the full caption grow below it without resizing the
   canvas or covering the view. Reset legacy mobile flex/min-height rules too. */
body:not([data-surface="today"]) .viewport {
  display: grid; height: auto; min-height: 0; padding: 0; align-self: start;
  grid-template-rows: max(32rem, calc(100dvh - 18rem)) auto; place-items: stretch;
}
body[data-surface="sky"] #skyCanvas, body[data-surface="orrery"] #orreryCanvas { grid-area: 1 / 1; position: relative; inset: auto; width: 100%; height: 100%; min-height: 0; }
body:not([data-surface="today"]) .control-panel { padding: 1.3rem; background: #0e1724; box-shadow: none; }
.destination-control-group, .orrery-group { border: 0; border-bottom: 1px solid #334154; border-radius: 0; padding: .5rem 0; margin-block: 0 .5rem; background: none; }
.destination-control-group > summary, .orrery-group > summary { min-height: 44px; padding: .6rem 0; color: #e6e8e9; cursor: pointer; font-size: .85rem; }
.destination-control-group[open] > summary { color: #f5d9a7; }
.control-panel .time-frame-label { color: #b0c4dd; }
.control-panel .sky-header h1 { font-size: 1.5rem; font-weight: 450; }
.control-panel .time-btn { border-radius: .4rem; font-size: .76rem; min-height: 44px; padding: .5rem .7rem; }
.control-panel .sky-input, .control-panel select { border-radius: .35rem; min-height: 40px; font-size: .78rem; }
@media (max-width: 1099px) {
  body:not([data-surface="today"]).panel-collapsed:not(.focus-mode) .stage-band { grid-template-columns: minmax(0, 1fr); grid-template-areas: "visual" "overview"; }
  .destination-overview { width: 100%; max-height: none; overflow: visible; }
}
@media (max-width: 520px) {
  body:not([data-surface="today"]) .viewport { grid-template-rows: 27rem auto; }
  .destination-overview { padding: 1.25rem; }
  .destination-caption { padding: .7rem .8rem; font-size: .64rem; }
  .system-jumps { inset: .6rem auto auto .6rem; max-width: calc(100% - 1.2rem); gap: .3rem; }
  .system-jumps button { font-size: .67rem; padding: .45rem .6rem; }
}
