:root {
  color-scheme: dark;
  --bg: #080d1b;
  --bg-deep: #050814;
  --surface: #0d1528;
  --surface-strong: #121d34;
  --surface-soft: #0a1121;
  --line: #26334b;
  --line-soft: #1b2740;
  --text: #f2f4f7;
  --text-muted: #9ba9bd;
  --text-faint: #718097;
  --text-signature: #8ea0a2;
  --accent: #f2c66d;
  --accent-soft: #d9ab52;
  --accent-ink: #211707;
  --sky-blue: #55749e;
  --danger-soft: #ae7f69;
  --radius-card: 16px;
  --radius-control: 10px;
  --radius-pill: 999px;
  --shadow-raised: 0 20px 70px rgb(0 0 0 / 0.28);
  --motion-quick: 140ms;
  --motion-standard: 280ms;
  --motion-dialog: 360ms;
  --ease-interface: cubic-bezier(0.2, 0, 0, 1);
  --font-sans: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 73% 4%, rgb(49 71 112 / 0.24), transparent 28rem),
    linear-gradient(145deg, var(--bg-deep), var(--bg) 55%, #0b1222);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
}

body.is-guide-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"] {
  touch-action: manipulation;
}

button {
  min-height: 44px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  color: var(--accent-ink);
  background: var(--accent);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(1600px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 10px 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-block,
.top-actions,
.playback-row,
.event-times,
.control-label-row,
.stage-toolbar,
.headline-metrics,
.knowledge-deck article {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 13px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  overflow: hidden;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgb(205 214 221 / 0.72);
  border-radius: 50%;
  background: #11151b url("assets/moon-lro.jpg") center / 200% 100% no-repeat;
  box-shadow:
    inset 2px 1px 4px rgb(255 255 255 / 0.14),
    0 0 12px rgb(192 207 219 / 0.12);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 36% 30%, transparent 0 38%, rgb(7 11 18 / 0.12) 60%, rgb(4 7 13 / 0.62) 100%);
  pointer-events: none;
}

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

.brand-block h1 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-signature {
  flex: 0 0 auto;
  color: var(--text-signature);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.brand-block p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.top-actions {
  gap: 10px;
}

.model-chip {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: rgb(13 21 40 / 0.74);
  font-size: 12px;
}

.model-chip strong {
  color: var(--text);
}

.quiet-button,
.text-button {
  border: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.quiet-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.quiet-button:hover,
.text-button:hover {
  color: var(--text);
}

.guide-launch-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.guide-launch-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

/* Five-step learning guide: component metrics stay local to this surface. */
.usage-guide {
  --guide-width: 940px;
  --guide-rail-width: 238px;
  --guide-header-height: 78px;
  --guide-footer-height: 78px;
  position: fixed;
  inset: 0;
  width: min(var(--guide-width), calc(100vw - 48px));
  height: min(650px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgb(102 127 168 / 0.55);
  border-top-color: var(--accent);
  border-radius: 20px;
  color: var(--text);
  background: linear-gradient(145deg, #0d172b 0%, #09101f 72%);
  box-shadow: 0 34px 110px rgb(0 0 0 / 0.66);
  opacity: 0;
  transform: translateY(16px) scale(0.985);
}

.usage-guide[open] {
  display: block;
  animation: guide-enter var(--motion-dialog) var(--ease-interface) forwards;
}

.usage-guide.is-closing {
  animation: guide-exit 180ms cubic-bezier(0.3, 0, 1, 1) forwards;
}

.usage-guide::backdrop {
  background:
    radial-gradient(circle at 68% 18%, rgb(70 97 148 / 0.2), transparent 30rem),
    rgb(3 7 16 / 0.88);
  backdrop-filter: blur(14px);
  transition: background 180ms ease-in, backdrop-filter 180ms ease-in;
}

.usage-guide.is-closing::backdrop {
  background: rgb(3 7 16 / 0);
  backdrop-filter: blur(0);
}

.usage-guide-shell {
  position: relative;
  display: grid;
  height: 100%;
  grid-template-rows: var(--guide-header-height) minmax(0, 1fr) var(--guide-footer-height);
  overflow: hidden;
}

.usage-guide-shell::before,
.usage-guide-shell::after {
  position: absolute;
  z-index: 0;
  border: 1px solid rgb(103 137 188 / 0.13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.usage-guide-shell::before {
  top: 116px;
  right: -118px;
  width: 370px;
  height: 370px;
}

.usage-guide-shell::after {
  top: 178px;
  right: -56px;
  width: 245px;
  height: 245px;
  border-color: rgb(242 198 109 / 0.11);
  animation: guide-orbit-drift 12s ease-in-out infinite alternate;
}

.usage-guide-header,
.usage-guide-body,
.usage-guide-footer {
  position: relative;
  z-index: 1;
}

.usage-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 27px;
  border-bottom: 1px solid var(--line-soft);
  background: rgb(8 15 29 / 0.52);
}

.usage-guide-header p {
  margin-bottom: 3px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.usage-guide-header h2 {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 650;
}

.guide-close-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: border-color var(--motion-quick) ease, color var(--motion-quick) ease;
}

.guide-close-button:hover {
  border-color: rgb(242 198 109 / 0.48);
  color: var(--text);
}

.guide-close-button i {
  font-size: 20px;
  font-style: normal;
  font-weight: 300;
  line-height: 1;
}

.usage-guide-body {
  display: grid;
  min-height: 0;
  grid-template-columns: var(--guide-rail-width) minmax(0, 1fr);
}

.usage-guide-nav {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 19px;
  border-right: 1px solid var(--line-soft);
  background: rgb(255 255 255 / 0.018);
}

.usage-guide-nav button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: 34px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--text-faint);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color var(--motion-quick) ease, background var(--motion-quick) ease, border-color var(--motion-quick) ease;
}

.usage-guide-nav button span {
  font-family: var(--font-mono);
  font-size: 10px;
}

.usage-guide-nav button strong {
  font-size: 13px;
  font-weight: 560;
}

.usage-guide-nav button i {
  width: 7px;
  height: 7px;
  border: 1px solid #596880;
  border-radius: 50%;
  transition: background var(--motion-standard) var(--ease-interface), box-shadow var(--motion-standard) var(--ease-interface);
}

.usage-guide-nav button:hover,
.usage-guide-nav button.is-active {
  color: var(--text);
  background: rgb(91 119 164 / 0.11);
}

.usage-guide-nav button.is-active {
  border-left-color: var(--accent);
}

.usage-guide-nav button.is-active i {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 13px rgb(242 198 109 / 0.55);
}

.usage-guide-nav button.is-complete i {
  border-color: #6c89b5;
  background: #6c89b5;
}

.usage-guide-content {
  align-self: center;
  max-width: 650px;
  padding: 30px 46px 28px;
}

.usage-guide-content.is-transitioning {
  animation: guide-step-enter var(--motion-standard) var(--ease-interface);
}

.guide-step-icon {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid rgb(242 198 109 / 0.48);
  border-radius: 50%;
  color: #ffe2a5;
  background: radial-gradient(circle at 34% 30%, rgb(255 235 189 / 0.18), rgb(242 198 109 / 0.04) 60%, transparent 61%);
  box-shadow: 0 0 34px rgb(242 198 109 / 0.09);
  font-family: var(--font-mono);
  font-size: 28px;
}

.guide-step-icon::after {
  position: absolute;
  inset: -7px;
  border: 1px solid rgb(105 138 189 / 0.32);
  border-radius: 50%;
  content: "";
  clip-path: inset(0 0 50% 0);
  transform: rotate(-16deg);
}

.guide-step-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.usage-guide-content h3 {
  max-width: 610px;
  margin-bottom: 10px;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.usage-guide-content h3:focus {
  outline: none;
}

.guide-step-description {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.guide-step-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.guide-step-targets span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: #c7d1df;
  background: rgb(255 255 255 / 0.025);
  font-size: 11px;
}

.guide-step-actions {
  display: grid;
  gap: 8px;
  margin: 19px 0 0;
  padding: 0;
  list-style: none;
}

.guide-step-actions li {
  display: grid;
  min-height: 43px;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  color: #c6cfdd;
  background: rgb(255 255 255 / 0.024);
  font-size: 12px;
  line-height: 1.55;
}

.guide-step-actions li b {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgb(242 198 109 / 0.5);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
}

.usage-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 27px;
  border-top: 1px solid var(--line-soft);
  background: rgb(6 12 24 / 0.64);
}

.guide-progress,
.guide-footer-actions {
  display: flex;
  align-items: center;
}

.guide-progress {
  gap: 5px;
}

.guide-progress i {
  width: 28px;
  height: 2px;
  background: rgb(255 255 255 / 0.12);
  transition: background var(--motion-standard) var(--ease-interface);
}

.guide-progress i.is-active {
  background: var(--accent);
}

.guide-footer-actions {
  gap: 8px;
}

.guide-secondary-button,
.guide-primary-button {
  padding: 0 17px;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: transform var(--motion-quick) ease, border-color var(--motion-quick) ease, background var(--motion-quick) ease;
}

.guide-secondary-button {
  border: 1px solid var(--line);
  color: var(--text-muted);
  background: transparent;
}

.guide-primary-button {
  border: 1px solid rgb(242 198 109 / 0.66);
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 650;
}

.guide-secondary-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.guide-secondary-button:not(:disabled):hover,
.guide-primary-button:hover {
  transform: translateY(-1px);
}

@keyframes guide-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes guide-exit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.992); }
}

@keyframes guide-step-enter {
  from { opacity: 0.35; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes guide-orbit-drift {
  from { transform: translate3d(0, 0, 0) rotate(-8deg); }
  to { transform: translate3d(-12px, 8px, 0) rotate(8deg); }
}

.workspace {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 18px;
  padding-top: 18px;
}

.control-rail,
.stage-column {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgb(15 24 45 / 0.94), rgb(8 14 28 / 0.96));
  box-shadow: var(--shadow-raised);
}

.control-rail {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding: 20px;
}

.rail-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.section-kicker {
  margin-bottom: 5px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.rail-heading h2 {
  margin-bottom: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.control-group {
  min-width: 0;
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
}

.control-group legend,
.control-label-row label,
.location-group label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.phase-option {
  display: grid;
  justify-items: center;
  min-width: 0;
  min-height: 76px;
  padding: 8px 3px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  background: #0a1223;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.phase-option:hover {
  border-color: var(--line);
  color: var(--text);
}

.phase-option.is-active {
  border-color: rgb(242 198 109 / 0.66);
  color: var(--accent);
  background: rgb(242 198 109 / 0.08);
}

.phase-option:active,
.primary-button:active,
.view-tab:active,
.quiet-button:active,
.text-button:active {
  transform: translateY(1px);
}

.phase-option canvas {
  width: 33px;
  height: 33px;
}

.phase-grid.is-southern .phase-option canvas {
  transform: rotate(180deg);
}

.phase-option span {
  overflow: hidden;
  width: 100%;
  margin-top: 5px;
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-label-row {
  justify-content: space-between;
  gap: 12px;
}

.control-label-row output {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 11px 0 1px;
  accent-color: var(--accent);
  cursor: ew-resize;
}

.range-anchors {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  color: var(--text-faint);
  font-size: 9px;
}

.range-anchors span:nth-child(1) {
  text-align: left;
}

.range-anchors span:nth-child(2),
.range-anchors span:nth-child(3),
.range-anchors span:nth-child(4) {
  text-align: center;
}

.range-anchors span:nth-child(5) {
  text-align: right;
}

.playback-row {
  justify-content: space-between;
  gap: 9px;
  padding: 12px 0 18px;
}

.primary-button {
  flex: 1 1 auto;
  padding: 10px 13px;
  border: 1px solid #ffd987;
  border-radius: var(--radius-control);
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.speed-control {
  display: grid;
  gap: 2px;
  color: var(--text-faint);
  font-size: 9px;
}

.speed-control select,
.location-group select {
  min-height: 31px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
}

.location-group {
  display: grid;
  gap: 9px;
}

.location-group select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-control);
}

.location-group p {
  margin: 0;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.55;
}

.inquiry-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgb(242 198 109 / 0.25);
  border-radius: var(--radius-card);
  background: linear-gradient(145deg, rgb(242 198 109 / 0.08), rgb(242 198 109 / 0.02));
}

.inquiry-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.45;
}

.inquiry-card > p:not(.section-kicker):not(.inquiry-answer) {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.text-button {
  min-height: 32px;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
}

.inquiry-answer {
  margin: 9px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgb(242 198 109 / 0.2);
  color: var(--text);
  font-size: 12px;
}

.stage-column {
  min-width: 0;
  overflow: hidden;
}

.stage-toolbar {
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgb(6 11 23 / 0.58);
}

.view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-deep);
}

.view-tab {
  min-width: 106px;
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.view-tab.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 700;
}

.stage-mode-note {
  margin: 0;
  color: var(--text-faint);
  font-size: 11px;
}

.stage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: 24px 28px 18px;
}

.stage-question {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.stage-header h2 {
  margin-bottom: 2px;
  font-size: clamp(27px, 3vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.phase-calendar {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 13px;
}

.headline-metrics {
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: rgb(7 13 27 / 0.52);
}

.headline-metrics div {
  display: grid;
  min-width: 100px;
  padding: 12px 14px;
}

.headline-metrics div + div {
  border-left: 1px solid var(--line-soft);
}

.headline-metrics span,
.event-times span,
.event-strip-intro span {
  color: var(--text-faint);
  font-size: 10px;
}

.headline-metrics strong,
.event-times strong,
.event-strip-intro strong {
  font-family: var(--font-mono);
  font-size: 14px;
}

.view-stack {
  min-height: 470px;
}

.simulation-view {
  display: none;
}

.simulation-view.is-active {
  display: block;
}

.formation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  min-height: 470px;
}

.orbit-zone {
  --orbit-inline-inset: 14%;
  --light-field-left: 9.2%;
  --light-field-width: 2.15%;

  position: relative;
  min-height: 470px;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 5% 50%, rgb(242 198 109 / 0.15), transparent 23%),
    radial-gradient(circle at 50% 50%, rgb(83 110 149 / 0.12), transparent 34%),
    linear-gradient(180deg, #070c18, #091225);
}

.orbit-zone::before,
.sky-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 13% 19%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 36% 71%, #fff 0 0.8px, transparent 1.3px),
    radial-gradient(circle at 67% 18%, #fff 0 0.7px, transparent 1.2px),
    radial-gradient(circle at 79% 64%, #fff 0 0.8px, transparent 1.3px),
    radial-gradient(circle at 92% 30%, #fff 0 0.6px, transparent 1.1px);
  opacity: 0.45;
}

.sun-body {
  position: absolute;
  top: 50%;
  left: 4.5%;
  z-index: 2;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border: 1px solid rgb(255 206 118 / 0.46);
  border-radius: 50%;
  background: #1b0b02 url("assets/sun-sdo-hmi.jpg") center / 112% 112% no-repeat;
  box-shadow:
    0 0 10px rgb(255 172 64 / 0.38),
    0 0 30px rgb(242 149 54 / 0.14);
  filter: saturate(0.92) contrast(1.08);
  transform: translate(-50%, -50%);
}

.sun-body::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 45% 39%, rgb(255 242 185 / 0.06), transparent 34%, rgb(103 31 4 / 0.1) 78%, rgb(45 11 1 / 0.24) 100%);
  pointer-events: none;
}

.sun-body span {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  color: var(--accent);
  font-size: 10px;
  transform: translateX(-50%);
}

.light-field {
  position: absolute;
  top: 27%;
  bottom: 27%;
  left: var(--light-field-left);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--light-field-width);
  pointer-events: none;
}

.light-field i {
  position: relative;
  display: block;
  width: 100%;
  height: 1px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, rgb(242 198 109 / 0.24), rgb(255 221 147 / 0.88));
  box-shadow: 0 0 7px rgb(242 198 109 / 0.16);
}

.light-field i::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3px;
  width: 6px;
  height: 8px;
  background: rgb(255 221 147 / 0.9);
  clip-path: polygon(0 0, 100% 50%, 0 100%, 24% 50%);
  filter: drop-shadow(0 0 3px rgb(242 198 109 / 0.28));
  transform: translateY(-50%);
}

.light-field span {
  position: absolute;
  top: -27px;
  right: -3px;
  width: max-content;
  color: rgb(242 198 109 / 0.78);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.orbit-line {
  position: absolute;
  top: 16%;
  right: var(--orbit-inline-inset);
  bottom: 16%;
  left: var(--orbit-inline-inset);
  z-index: 2;
  border: 1px solid rgb(150 173 205 / 0.48);
  border-radius: 50%;
}

.orbit-direction {
  position: absolute;
  right: 13%;
  bottom: 20%;
  color: var(--text-faint);
  font-size: 10px;
}

.earth-body {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 80px;
  height: 80px;
  overflow: visible;
  transform: translate(-50%, -50%);
}

.earth-sphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgb(142 175 211 / 0.55);
  border-radius: 50%;
  background: #315784;
}

.earth-surface-texture {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("assets/earth-apollo17.jpg") center / 136% 136% no-repeat;
}

.earth-night {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0 44%, rgb(3 7 15 / 0.26) 57%, rgb(3 7 15 / 0.82) 100%);
}

.earth-night::before {
  content: "";
  position: absolute;
  top: 5%;
  bottom: 5%;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgb(214 229 245 / 0.38), transparent);
}

.earth-label,
.moon-orbit-label {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.moon-orbiter {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translate3d(0, 0, 0) translate(-50%, -50%);
  will-change: transform;
}

.orbit-zone.is-playing .moon-orbiter,
.orbit-zone.is-transitioning .moon-orbiter {
  transition: none;
}

.moon-orbiter.is-dragging {
  z-index: 5;
  cursor: grabbing;
  transition: none;
}

.moon-orbiter:focus-visible {
  outline: none;
}

.moon-orbiter:focus-visible .moon-space-disk {
  box-shadow: 0 0 0 3px rgb(242 198 109 / 0.62);
}

.moon-space-disk {
  position: relative;
  display: block;
  overflow: hidden;
  width: 36px;
  height: 36px;
  margin: 6px;
  border: 1px solid #b8bec7;
  border-radius: 50%;
  background: #8d8d8b;
  box-shadow: 0 0 13px rgb(224 226 221 / 0.2);
}

.moon-surface-texture {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("assets/moon-lro.jpg") center / 200% 100% no-repeat;
  transform: rotate(0deg);
  transform-origin: center;
  will-change: transform;
}

.moon-space-disk::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0 42%, rgb(3 5 9 / 0.42) 57%, rgb(3 5 9 / 0.93) 100%);
}

.diagram-notes {
  position: absolute;
  z-index: 4;
  bottom: 15px;
  left: 18px;
  display: grid;
  gap: 2px;
  max-width: min(410px, calc(100% - 36px));
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: var(--text-faint);
  background: rgb(4 8 18 / 0.7);
  font-size: 10px;
}

.diagram-notes strong {
  color: var(--text-muted);
  font-weight: 600;
}

.moon-inspector {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 470px;
  padding: 24px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgb(15 24 45 / 0.72), rgb(7 12 25 / 0.9));
  text-align: center;
}

.inspector-label {
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 11px;
}

#moon-canvas {
  width: min(250px, 100%);
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 15px 32px rgb(0 0 0 / 0.36));
}

.inspector-name {
  margin: 8px 0 3px;
  color: var(--accent);
  font-weight: 700;
}

.inspector-copy {
  max-width: 26ch;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.observation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  min-height: 470px;
  border-top: 1px solid var(--line-soft);
}

.sky-wrap {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line-soft);
  background: #111a2c;
}

#sky-canvas {
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  height: 470px;
}

.sky-legend {
  position: absolute;
  right: 6%;
  bottom: 19px;
  left: 6%;
  display: flex;
  justify-content: space-between;
  color: #d6dde7;
  font-size: 11px;
  pointer-events: none;
}

.observation-readout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
}

.observation-readout > strong {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.25;
}

.observation-readout > p:not(.inspector-label) {
  color: var(--text-muted);
  font-size: 12px;
}

.status-band {
  margin: 11px 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--accent);
  background: rgb(242 198 109 / 0.08);
  font-weight: 700;
}

.status-band.is-muted {
  border-left-color: var(--text-faint);
  color: var(--text-muted);
  background: rgb(113 128 151 / 0.08);
}

.time-ruler {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 20px;
  margin: 16px 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgb(5 10 21 / 0.8);
}

.event-strip-intro {
  display: grid;
  gap: 3px;
}

.event-strip-intro strong {
  color: var(--accent);
  font-size: 13px;
}

.event-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.event-times div {
  display: grid;
  gap: 2px;
  padding: 2px 18px;
  border-left: 1px solid var(--line-soft);
}

.knowledge-deck {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  border-top: 1px solid var(--line-soft);
  background: rgb(5 10 21 / 0.44);
}

.knowledge-deck article,
.knowledge-deck details {
  min-width: 0;
  padding: 18px 20px;
}

.knowledge-deck article + article,
.knowledge-deck details {
  border-left: 1px solid var(--line-soft);
}

.knowledge-deck article {
  align-items: flex-start;
  gap: 11px;
}

.knowledge-index {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
}

.knowledge-deck h3 {
  margin-bottom: 5px;
  font-size: 13px;
}

.knowledge-deck p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.knowledge-deck summary {
  min-height: 44px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}

.model-notes {
  display: grid;
  gap: 10px;
  padding-top: 9px;
}

.model-notes strong {
  color: var(--text);
}

.noscript-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-card);
  color: var(--accent-ink);
  background: var(--accent);
}

.is-loading .stage-column,
.is-loading .control-rail {
  opacity: 0.35;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .control-rail {
    padding: 16px;
  }

  .formation-layout,
  .observation-layout {
    grid-template-columns: minmax(0, 1fr) 235px;
  }

  .stage-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .headline-metrics {
    justify-self: start;
  }

  .time-ruler {
    grid-template-columns: 1fr;
  }

  .event-times {
    grid-column: auto;
  }

  .knowledge-deck {
    grid-template-columns: 1fr 1fr;
  }

  .knowledge-deck details {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

  .model-chip {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .control-rail {
    position: static;
    align-self: auto;
  }

  .inquiry-card {
    margin-top: 0;
  }

  .phase-grid {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .phase-option {
    flex: 0 0 68px;
    scroll-snap-align: start;
  }

  .formation-layout,
  .observation-layout {
    grid-template-columns: 1fr;
  }

  .orbit-zone,
  .moon-inspector,
  .observation-layout {
    min-height: 390px;
  }

  .orbit-zone,
  .sky-wrap {
    border-right: 0;
  }

  .moon-inspector,
  .observation-readout {
    border-top: 1px solid var(--line-soft);
  }

  .moon-inspector {
    min-height: 340px;
  }

  .observation-readout {
    min-height: 240px;
  }

  .view-stack {
    min-height: 0;
  }
}

@media (max-width: 580px) {
  .topbar,
  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    align-self: stretch;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .brand-block p,
  .stage-mode-note {
    display: none;
  }

  .stage-header {
    padding: 20px 18px 15px;
  }

  .headline-metrics {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .headline-metrics div {
    min-width: 0;
    padding: 9px;
  }

  .headline-metrics strong {
    font-size: 12px;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    min-width: 0;
  }

  .orbit-zone {
    min-height: 340px;
  }

  .sun-body {
    left: 6%;
    width: 36px;
    height: 36px;
  }

  .light-field {
    --light-field-left: 10%;
    --light-field-width: 1.6%;
  }

  .earth-body {
    width: 64px;
    height: 64px;
  }

  .moon-orbiter {
    width: 44px;
    height: 44px;
  }

  .moon-space-disk {
    width: 30px;
    height: 30px;
    margin: 7px;
  }

  .time-ruler {
    grid-template-columns: 1fr;
  }

  .event-times {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .event-times div {
    grid-template-columns: 52px 1fr;
    padding: 8px 0 0;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .event-times strong {
    font-size: 12px;
  }

  .knowledge-deck {
    grid-template-columns: 1fr;
  }

  .knowledge-deck article + article,
  .knowledge-deck details {
    grid-column: auto;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .usage-guide {
    --guide-header-height: 68px;
    --guide-footer-height: 72px;
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .usage-guide-header {
    padding: 0 16px;
  }

  .usage-guide-header h2 {
    font-size: 18px;
  }

  .usage-guide-body {
    display: block;
    overflow: auto;
  }

  .usage-guide-nav {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-content: initial;
    gap: 4px;
    padding: 9px 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    background: rgb(9 16 31 / 0.96);
  }

  .usage-guide-nav button {
    min-width: 52px;
    min-height: 44px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0 9px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  .usage-guide-nav button.is-active {
    border-bottom-color: var(--accent);
  }

  .usage-guide-nav button strong,
  .usage-guide-nav button i {
    display: none;
  }

  .usage-guide-content {
    max-width: none;
    padding: 25px 22px 30px;
  }

  .guide-step-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    font-size: 23px;
  }

  .usage-guide-content h3 {
    font-size: 25px;
  }

  .usage-guide-footer {
    padding: 0 14px;
  }

  .guide-progress {
    display: none;
  }

  .usage-guide-footer {
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .guide-close-button span,
  .guide-launch-button > span:last-child {
    display: none;
  }

  .guide-close-button {
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .guide-footer-actions {
    width: 100%;
  }

  .guide-secondary-button,
  .guide-primary-button {
    flex: 1 1 0;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .control-rail,
  .stage-column,
  .stage-toolbar {
    background: var(--surface);
  }
}
