:root {
  color-scheme: dark;
  --bg: #080d17;
  --panel: #0d1421;
  --panel-raised: #111b2a;
  --panel-soft: #0a111d;
  --line: rgba(157, 181, 208, 0.14);
  --line-strong: rgba(157, 181, 208, 0.24);
  --text: #eaf1f8;
  --muted: #8e9caf;
  --quiet: #627187;
  --accent: #79e5ff;
  --accent-soft: rgba(121, 229, 255, 0.13);
  --accent-line: rgba(121, 229, 255, 0.32);
  --danger: #ffb4a7;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 18% 0%, rgba(32, 67, 91, 0.16), transparent 42%), var(--bg); }
.topbar { min-height: 72px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 23, 0.94); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 13px; background: linear-gradient(145deg, rgba(121,229,255,.12), rgba(121,229,255,.02)); flex: 0 0 auto; }
.brand-mark svg { width: 31px; height: 31px; }
.eyebrow { color: #8192a8; font-size: 9px; letter-spacing: .16em; font-weight: 750; line-height: 1.3; }
h1 { margin: 3px 0 0; font-size: 18px; line-height: 1.15; letter-spacing: -.035em; font-weight: 760; }
h1 span { color: #a8b8c9; font-weight: 480; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: #a9b8c9; font-size: 10px; letter-spacing: .11em; font-weight: 700; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(121,229,255,.65); }
.status-dot.paused { background: #8090a3; box-shadow: none; }
.topbar-divider { height: 16px; width: 1px; background: var(--line-strong); margin: 0 3px; }
.topbar-tag { color: #74859a; font-size: 9px; }
.workspace { flex: 1; min-height: 0; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 12px; }
.visual-area { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; }
.stage { position: relative; min-height: 300px; overflow: hidden; border: 1px solid rgba(142, 173, 202, .16); border-radius: 16px; background: #080e19; box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 16px 44px rgba(0,0,0,.16); }
#spaceCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-topline { position: absolute; z-index: 2; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.stage-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(166, 193, 218, .17); border-radius: 7px; color: #a8b8c9; background: rgba(8, 14, 25, .72); backdrop-filter: blur(8px); font-size: 9px; letter-spacing: .12em; font-weight: 720; }
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
#regimeChip { color: var(--accent); border-color: var(--accent-line); }
.stage-legend { position: absolute; z-index: 2; top: 58px; left: 18px; display: flex; flex-wrap: wrap; gap: 14px; color: #8798ad; font-size: 9px; letter-spacing: .04em; pointer-events: none; }
.stage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stage-legend i { display: inline-block; width: 13px; height: 2px; border-radius: 3px; }
.legend-sun { background: #d5e9f5; opacity: .8; }
.legend-orbit { background: var(--accent); }
.legend-drift { background: var(--accent); transform: rotate(-30deg); }
.stage-readout-row { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; pointer-events: none; }
.stage-readout { min-width: 0; padding: 9px 11px 8px; border: 1px solid rgba(154, 181, 208, .14); border-radius: 9px; background: rgba(8, 14, 25, .76); backdrop-filter: blur(10px); }
.stage-readout span { display: block; color: #77899f; font-size: 8px; letter-spacing: .13em; font-weight: 720; white-space: nowrap; }
.stage-readout strong { display: block; margin-top: 4px; font-size: 14px; font-weight: 720; letter-spacing: -.02em; }
.stage-readout em { display: block; margin-top: 2px; color: #718198; font-size: 8px; font-style: normal; }
.caption-bar { min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(100deg, rgba(121,229,255,.06), rgba(13,20,33,.92) 42%); }
.caption-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 9px; font-size: 17px; }
.caption-kicker { margin-bottom: 3px; color: #8294aa; font-size: 8px; font-weight: 750; letter-spacing: .15em; }
.caption-bar p { margin: 0; color: #d2deea; font-size: 11px; line-height: 1.45; }
.transport-bar { min-height: 50px; padding: 7px 9px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13, 20, 33, .88); }
.transport-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.transport-group-right { justify-content: flex-end; }
.control-button { min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(152, 178, 204, .18); border-radius: 8px; background: rgba(255,255,255,.025); color: #b6c5d5; font-size: 10px; font-weight: 680; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease; }
.control-button:hover { border-color: var(--accent-line); background: rgba(121,229,255,.07); color: #effaff; }
.control-button:active { transform: translateY(1px); }
.primary-button { color: #06131a; border-color: var(--accent); background: var(--accent); }
.primary-button:hover { color: #06131a; background: #a0efff; border-color: #a0efff; }
.button-icon { width: 11px; text-align: center; font-size: 12px; font-weight: 900; }
.step-mark { color: var(--accent); font-size: 17px; line-height: 0; }
.trace-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 0 6px; color: #a8b8c9; font-size: 10px; cursor: pointer; user-select: none; }
.trace-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 26px; height: 15px; padding: 2px; display: inline-flex; align-items: center; border: 1px solid rgba(145, 169, 194, .28); border-radius: 99px; background: #172335; transition: background .18s ease; }
.toggle-track span { width: 9px; height: 9px; border-radius: 50%; background: #8293a7; transition: transform .18s ease, background .18s ease; }
.trace-toggle input:checked + .toggle-track { background: rgba(121,229,255,.22); border-color: var(--accent-line); }
.trace-toggle input:checked + .toggle-track span { transform: translateX(10px); background: var(--accent); }
.trace-toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.compact-button { min-width: 88px; }
.screenshot-button { color: var(--accent); border-color: var(--accent-line); }
.camera-icon { width: 12px; height: 9px; position: relative; display: inline-block; border: 1px solid currentColor; border-radius: 2px; }
.camera-icon:before { content: ""; position: absolute; left: 3px; top: -4px; width: 4px; height: 3px; border: 1px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
.camera-icon:after { content: ""; position: absolute; left: 3px; top: 1px; width: 4px; height: 4px; border: 1px solid currentColor; border-radius: 50%; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(180deg, rgba(16,25,40,.96), rgba(11,18,30,.98)); scrollbar-width: thin; scrollbar-color: #304258 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 8px; margin-bottom: 13px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.035em; }
.panel-index { color: #607187; font-size: 9px; letter-spacing: .12em; font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.metric-card { min-width: 0; padding: 10px 11px 9px; border: 1px solid rgba(147, 175, 203, .13); border-radius: 10px; background: rgba(7,13,23,.46); }
.metric-card-wide { grid-column: 1 / -1; }
.metric-topline { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: #8a9bb0; font-size: 8px; letter-spacing: .12em; font-weight: 760; }
.metric-topline small { font-size: 9px; color: #c5d5e5; font-style: italic; }
.metric-tag { color: #62748a; font-size: 7px; letter-spacing: .09em; white-space: nowrap; }
.metric-card strong { display: block; margin-top: 5px; color: #f0f7ff; font-size: 21px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-card strong small { color: #9aadc1; font-size: 11px; font-weight: 560; letter-spacing: 0; }
.metric-foot { margin-top: 3px; display: flex; justify-content: space-between; gap: 6px; color: #74869b; font-size: 8px; }
.metric-foot span:last-child { color: var(--accent); }
.metric-card-ecc { padding-bottom: 10px; }
.metric-card-ecc strong { font-size: 18px; }
.ecc-track { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 9px; background: #1b2a3c; }
.ecc-track span { display: block; width: 6.7%; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.control-section, .time-control-block, .preset-block { margin-top: 17px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-title-row h3 { margin: 0; color: #d8e4ef; font-size: 11px; letter-spacing: .01em; font-weight: 720; }
.section-title-row > span { color: #6f8197; font-size: 7px; letter-spacing: .13em; font-weight: 760; }
.section-title-row .scaled-tag { color: var(--accent); }
.range-control { display: block; margin: 0 0 14px; }
.range-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #aebdcd; font-size: 10px; font-weight: 600; }
.range-heading i { color: #d7e5f2; }
.range-heading output { color: var(--accent); font-size: 10px; font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 15px; margin: 7px 0 2px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 9px; background: linear-gradient(90deg, rgba(121,229,255,.62), rgba(121,229,255,.2)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 9px; background: linear-gradient(90deg, rgba(121,229,255,.62), rgba(121,229,255,.2)); }
input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; appearance: none; -webkit-appearance: none; border: 2px solid #dffaff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(121,229,255,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #dffaff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(121,229,255,.12); }
.range-ends { display: flex; justify-content: space-between; color: #6c7e94; font-size: 8px; }
.range-hint { display: block; margin-top: 5px; color: #74859a; font-size: 8px; line-height: 1.4; }
.time-control-block { padding: 12px 11px 1px; border: 1px solid rgba(121,229,255,.15); border-radius: 10px; background: rgba(121,229,255,.035); }
.time-control-block .range-control { margin-bottom: 11px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; min-height: 54px; padding: 8px; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid rgba(147,175,203,.16); border-radius: 9px; background: rgba(7,13,23,.42); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover, .preset-button.active { border-color: var(--accent-line); background: rgba(121,229,255,.07); }
.preset-arrow { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent); border-radius: 7px; background: var(--accent-soft); font-size: 15px; }
.preset-arrow-in { transform: rotate(90deg); }
.preset-button strong { display: block; color: #d9e6f2; font-size: 9px; font-weight: 720; }
.preset-button small { display: block; margin-top: 3px; color: #7d8ea3; font-size: 7px; line-height: 1.2; }
.audit-card { margin-top: 15px; padding: 11px; border: 1px solid rgba(121,229,255,.2); border-radius: 10px; background: linear-gradient(130deg, rgba(121,229,255,.07), rgba(7,13,23,.42)); }
.audit-header { display: flex; align-items: center; gap: 8px; }
.audit-check { width: 22px; height: 22px; display: grid; place-items: center; color: #07131a; border-radius: 7px; background: var(--accent); font-size: 12px; font-weight: 900; }
.audit-header strong { display: block; color: #dce9f4; font-size: 10px; }
.audit-header small { display: block; margin-top: 2px; color: #7d90a5; font-size: 8px; }
.audit-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.audit-values div { min-width: 0; }
.audit-values span, .audit-diff span { display: block; color: #7f91a7; font-size: 8px; }
.audit-values strong { display: block; margin-top: 3px; color: #e6f0fa; font-size: 12px; font-variant-numeric: tabular-nums; }
.audit-diff { margin-top: 9px; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(147,175,203,.13); }
.audit-diff strong { color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.audit-note { margin: 7px 0 0; color: #74869b; font-size: 8px; line-height: 1.4; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(6,12,21,.36); }
.science-panel summary { min-height: 43px; padding: 0 11px; display: flex; align-items: center; gap: 8px; color: #dce7f2; font-size: 10px; font-weight: 720; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 21px; height: 21px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 6px; font-size: 12px; }
.summary-chevron { margin-left: auto; color: #8193a8; font-size: 16px; transition: transform .18s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 13px; color: #9aabbd; font-size: 9px; line-height: 1.55; }
.science-content h4 { margin: 12px 0 6px; color: #d7e3ee; font-size: 9px; letter-spacing: .03em; }
.science-content p { margin: 5px 0 8px; }
.equation-intro { color: #a9b9c9; }
.equation { margin: 6px 0; padding: 7px 8px; overflow-wrap: anywhere; border-left: 2px solid var(--accent-line); border-radius: 0 6px 6px 0; background: rgba(121,229,255,.045); color: #d8f3fa; font-family: Georgia, "Times New Roman", serif; font-size: 11px; }
.equation-large { font-size: 10px; }
.science-note { color: #8193a8; font-size: 8px; }
.science-list { margin: 5px 0 8px; padding-left: 15px; }
.science-list li { margin: 5px 0; }
.science-list b { color: #c9d8e6; font-weight: 650; }
.science-list em { color: var(--accent); font-size: 8px; font-style: normal; }
.panel-bottom-note { margin-top: 13px; display: flex; align-items: center; gap: 7px; color: #65778c; font-size: 7px; letter-spacing: .13em; font-weight: 720; }
.tiny-orbit { width: 12px; height: 7px; display: inline-block; border: 1px solid var(--accent-line); border-radius: 50%; transform: rotate(-25deg); }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .workspace { min-height: 0; }
@media (max-width: 960px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .control-panel { padding: 13px; }
  .transport-bar { gap: 6px; }
  .control-button { padding-left: 9px; padding-right: 9px; }
}
@media (max-width: 780px) {
  .topbar { min-height: 60px; padding: 9px 12px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-mark svg { width: 27px; height: 27px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 16px; }
  .topbar-status { gap: 7px; font-size: 8px; }
  .topbar-tag, .topbar-divider { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(250px, 39%) minmax(0, 1fr); padding: 8px; gap: 8px; }
  .visual-area { gap: 7px; }
  .stage { min-height: 0; border-radius: 12px; }
  .stage-topline { top: 10px; left: 10px; right: 10px; }
  .stage-chip { padding: 6px 8px; font-size: 8px; }
  .stage-legend { top: 45px; left: 11px; gap: 9px; font-size: 8px; }
  .stage-readout-row { left: 9px; right: 9px; bottom: 8px; gap: 5px; }
  .stage-readout { padding: 6px 7px 5px; border-radius: 7px; }
  .stage-readout span { font-size: 6px; letter-spacing: .09em; }
  .stage-readout strong { margin-top: 3px; font-size: 11px; }
  .stage-readout em { font-size: 6px; }
  .caption-bar { min-height: 50px; padding: 7px 9px; gap: 8px; border-radius: 9px; }
  .caption-icon { width: 25px; height: 25px; font-size: 14px; }
  .caption-kicker { font-size: 7px; }
  .caption-bar p { font-size: 9px; }
  .transport-bar { min-height: 42px; padding: 5px; border-radius: 9px; }
  .transport-group { gap: 4px; }
  .control-button { min-height: 30px; padding: 0 7px; font-size: 9px; }
  .trace-toggle { gap: 5px; padding: 0 3px; font-size: 9px; }
  .toggle-track { width: 24px; height: 14px; }
  .toggle-track span { width: 8px; height: 8px; }
  .trace-toggle input:checked + .toggle-track span { transform: translateX(9px); }
  .control-panel { padding: 12px; border-radius: 12px; }
  .panel-heading { margin-bottom: 10px; }
  .panel-heading h2 { font-size: 15px; }
}
@media (max-width: 430px) {
  .topbar-status { font-size: 7px; }
  .workspace { grid-template-rows: minmax(300px, 46%) minmax(0, 1fr); }
  .stage-legend { gap: 7px; }
  .stage-legend span { gap: 4px; }
  .stage-readout-scale { display: none; }
  .stage-readout-row { grid-template-columns: 1fr 1fr; }
  .transport-bar { justify-content: flex-start; }
  .transport-group-right { margin-left: auto; }
  .screenshot-button { font-size: 0; width: 31px; padding: 0; }
  .screenshot-button .camera-icon { margin: 0; }
  .compact-button { min-width: 75px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
