:root {
  color-scheme: dark;
  --bg: #070c14;
  --panel: #0c1420;
  --panel-2: #101b29;
  --line: rgba(166, 190, 211, .12);
  --line-strong: rgba(166, 190, 211, .2);
  --text: #e9f0f5;
  --muted: #8a9aaa;
  --dim: #5e7183;
  --accent: #73e5cb;
  --accent-soft: rgba(115, 229, 203, .12);
  --accent-line: rgba(115, 229, 203, .35);
  --warm: #f2d99b;
  --planet: #91bce6;
  --radius: 13px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; background: var(--bg); }
body { overflow: 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 { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 78px minmax(0, 1fr) 25px; overflow: hidden; background: radial-gradient(ellipse at 22% 8%, rgba(27, 57, 72, .18), transparent 38%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); min-width: 0; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-symbol { width: 42px; height: 42px; display: grid; place-items: center; color: var(--accent); flex: 0 0 auto; }
.brand-symbol svg { width: 38px; height: 38px; }
.brand-copy { min-width: 0; }
.eyebrow { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.4; }
.eyebrow span { color: var(--accent); padding: 0 3px; }
.brand-copy h1 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.035em; line-height: 1.1; font-weight: 650; }
.brand-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .01em; }
.topbar-meta { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 10px; letter-spacing: .12em; font-weight: 700; white-space: nowrap; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: #b8c8d3; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(115,229,203,.7); }
.meta-divider { height: 16px; width: 1px; background: var(--line-strong); }
.system-name b { color: var(--accent); font-weight: 500; padding: 0 3px; }
.workspace { min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 14px; padding: 14px 14px 12px; }
.visual-panel, .control-panel { min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16,27,41,.9), rgba(8,14,23,.96)); overflow: hidden; }
.visual-panel { display: grid; grid-template-rows: 48px minmax(0,1fr) 82px; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); min-width: 0; }
.stage-context { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.context-label { color: var(--accent); font-size: 9px; letter-spacing: .16em; font-weight: 800; white-space: nowrap; }
.context-detail { color: #a5b5c3; font-size: 10px; white-space: nowrap; }
.context-detail em { color: var(--dim); font-style: normal; padding: 0 3px; }
.stage-actions { display: flex; gap: 7px; align-items: center; }
.quiet-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); border-radius: 7px; height: 29px; padding: 0 9px; display: inline-flex; align-items: center; gap: 7px; color: #a8b8c5; font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; white-space: nowrap; }
.quiet-button:hover { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
.trace-button.is-active { border-color: var(--accent-line); color: var(--accent); background: rgba(115,229,203,.07); }
.trace-glyph { width: 13px; height: 8px; border-top: 1.5px solid currentColor; border-radius: 50%; transform: rotate(-19deg); position: relative; }
.trace-glyph:after { content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%; right: 0; top: -3px; background: currentColor; }
.screenshot-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.canvas-stage { min-height: 0; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 50%, rgba(19,41,55,.36), transparent 65%), #070e18; }
#spaceCanvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.canvas-top-left { position: absolute; left: 16px; top: 13px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.frame-chip { display: inline-flex; align-items: center; gap: 7px; width: max-content; padding: 5px 8px; border: 1px solid rgba(115,229,203,.18); border-radius: 5px; background: rgba(6,13,21,.64); color: #b9c9d2; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.frame-chip b { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.scale-note { color: #65798b; font-size: 8px; letter-spacing: .1em; font-weight: 650; }
.scale-note i { font-style: normal; color: var(--accent); padding: 0 3px; }
.canvas-top-right { position: absolute; right: 15px; top: 15px; display: flex; gap: 12px; color: #8fa1b0; font-size: 9px; pointer-events: none; }
.canvas-top-right span { display: inline-flex; align-items: center; gap: 5px; }
.canvas-top-right i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-sun { background: var(--warm); box-shadow: 0 0 7px rgba(242,217,155,.6); }
.legend-planet { background: var(--planet); }
.legend-asteroid { background: var(--accent); }
.phase-caption { position: absolute; left: 15px; bottom: 14px; max-width: min(590px, calc(100% - 30px)); display: flex; align-items: flex-start; gap: 9px; padding: 9px 12px; border: 1px solid rgba(149,178,196,.13); border-radius: 7px; background: rgba(6,13,21,.78); backdrop-filter: blur(8px); color: #c0cbd3; font-size: 10px; line-height: 1.45; pointer-events: none; }
.caption-mark { width: 5px; height: 5px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(115,229,203,.6); }
.toast { position: absolute; right: 15px; bottom: 15px; padding: 8px 10px; border: 1px solid var(--accent-line); border-radius: 6px; background: rgba(8,22,27,.92); color: var(--accent); font-size: 9px; opacity: 0; transform: translateY(5px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1px solid var(--line); background: rgba(9,16,26,.7); }
.readout-cell { min-width: 0; padding: 13px 15px 9px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.readout-cell:last-child { border-right: 0; }
.readout-label { color: #7e91a1; font-size: 8px; letter-spacing: .12em; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-cell strong { color: #e7f0f4; font-size: 20px; letter-spacing: -.035em; line-height: 1.05; font-weight: 570; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-cell strong small { font-size: 11px; color: #9aabb8; font-weight: 500; letter-spacing: 0; }
.readout-kind { color: #586e7e; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.control-panel { background: linear-gradient(160deg, rgba(15,25,38,.98), rgba(9,15,24,.98)); }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(130,157,175,.3) transparent; padding: 17px 16px 14px; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(130,157,175,.25); border-radius: 10px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.035em; font-weight: 630; }
.model-status { color: var(--accent); font-size: 8px; letter-spacing: .12em; border: 1px solid var(--accent-line); background: var(--accent-soft); padding: 5px 7px; border-radius: 5px; }
.subsection-label { display: flex; justify-content: space-between; align-items: center; color: #879aaa; font-size: 8px; font-weight: 800; letter-spacing: .13em; margin-bottom: 9px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; height: 57px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); display: flex; align-items: center; gap: 7px; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover { border-color: var(--accent-line); }
.preset-button.is-selected { border-color: var(--accent-line); background: rgba(115,229,203,.07); }
.preset-icon { width: 29px; height: 29px; flex: 0 0 auto; border: 1px solid rgba(151,177,192,.18); border-radius: 50%; display: grid; place-items: center; }
.preset-icon i { display: block; width: 16px; height: 9px; border: 1.4px solid #8fa5b4; border-radius: 50%; transform: rotate(-26deg); }
.horseshoe-icon i { width: 19px; height: 16px; border-bottom-color: transparent; border-radius: 50%; transform: rotate(8deg); }
.is-selected .preset-icon { border-color: var(--accent-line); }
.is-selected .preset-icon i { border-color: var(--accent); border-bottom-color: transparent; }
.preset-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.preset-copy b { font-size: 10px; font-weight: 700; color: #dbe5eb; }
.preset-copy small { color: #8294a2; font-size: 8px; white-space: nowrap; }
.preset-arrow { color: #657a8b; font-size: 11px; margin-left: auto; align-self: flex-start; }
.controls-section { margin-top: 18px; }
.controls-label span { color: #5d7383; font-size: 7px; letter-spacing: .09em; }
.control-block { padding: 10px 0 9px; border-top: 1px solid var(--line); }
.control-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.control-title-row label { color: #d0dce4; font-size: 10px; font-weight: 620; }
.control-title-row output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 15px; margin: 7px 0 1px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) 0%, rgba(115,229,203,.35) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: rgba(115,229,203,.35); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #07110f; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(115,229,203,.23), 0 0 9px rgba(115,229,203,.35); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #07110f; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(115,229,203,.23); }
.range-ends { display: flex; align-items: center; justify-content: space-between; color: #65798a; font-size: 7px; letter-spacing: .03em; }
.control-block p { margin: 6px 0 0; color: #788b9b; font-size: 8px; line-height: 1.45; }
.playback-section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.time-row { margin-top: 2px; }
.time-row output { color: var(--accent); }
.scaled-tag { color: var(--accent); font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.transport-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 6px; margin-top: 11px; }
.transport-button { height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255,255,255,.025); color: #b6c5ce; font-size: 8px; letter-spacing: .1em; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.transport-button:hover { border-color: var(--accent-line); background: rgba(115,229,203,.06); }
.transport-button.primary { color: #071713; border-color: var(--accent); background: var(--accent); }
.transport-button.primary:hover { background: #9af0dd; }
.pause-symbol { width: 8px; height: 10px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.step-symbol { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; position: relative; }
.step-symbol:after { content: ""; position: absolute; right: -4px; top: -5px; height: 10px; border-right: 1.5px solid currentColor; }
.play-triangle { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; }
.reset-symbol { font-size: 15px; line-height: 1; }
.quality-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.quality-label { color: #718595; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.quality-toggle { border: 0; background: transparent; padding: 3px 0 3px 7px; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .1em; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.quality-toggle i { display: block; width: 18px; height: 10px; border-radius: 8px; background: rgba(115,229,203,.28); position: relative; }
.quality-toggle i:after { content: ""; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transition: transform .18s ease; }
.quality-toggle[aria-pressed="false"] { color: #92a3b1; }
.quality-toggle[aria-pressed="false"] i { background: rgba(140,158,172,.22); }
.quality-toggle[aria-pressed="false"] i:after { transform: translateX(-8px); background: #91a3b1; }
.audit-card { margin-top: 14px; padding: 10px 11px 9px; border: 1px solid rgba(115,229,203,.2); border-radius: 8px; background: linear-gradient(120deg, rgba(115,229,203,.06), rgba(115,229,203,.015)); }
.audit-topline { display: flex; align-items: center; gap: 6px; color: #a7b9c3; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.audit-icon { width: 14px; height: 14px; display: grid; place-items: center; border-radius: 50%; background: rgba(115,229,203,.15); color: var(--accent); font-size: 9px; }
.audit-type { margin-left: auto; color: #638a84; font-size: 6px; }
.audit-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 9px; }
.audit-main div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.audit-main span, .audit-foot span { color: #8194a1; font-size: 7px; }
.audit-main strong { color: #e1ecef; font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.audit-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; margin-top: 7px; border-top: 1px solid rgba(115,229,203,.12); }
.audit-foot b { color: var(--accent); font-size: 9px; font-variant-numeric: tabular-nums; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); }
.science-panel summary { min-height: 39px; padding: 0 10px; display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; color: #d5e0e6; font-size: 10px; font-weight: 700; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-summary-icon { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; background: rgba(115,229,203,.1); color: var(--accent); font-size: 12px; }
.summary-hint { margin-left: auto; color: #617585; font-size: 6px; letter-spacing: .1em; font-weight: 800; }
.summary-chevron { color: #7f95a4; font-size: 13px; transition: transform .18s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 11px; color: #95a7b4; font-size: 8px; line-height: 1.55; }
.science-content h3 { margin: 8px 0 4px; color: #d7e2e8; font-size: 9px; font-weight: 700; }
.science-content p { margin: 5px 0 8px; }
.equation-block { margin: 8px 0; padding: 8px; border-left: 2px solid var(--accent); border-radius: 0 5px 5px 0; background: rgba(115,229,203,.045); display: flex; flex-direction: column; gap: 3px; }
.equation-label { color: #6f928b; font-size: 6px; font-weight: 800; letter-spacing: .1em; }
.equation-block code { color: #d2e7e3; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.equation-block small { color: #80949f; font-size: 7px; }
.constant-note { margin: 8px 0; padding: 7px 8px; border: 1px solid rgba(145,166,181,.12); border-radius: 5px; color: #879aa8; font-size: 7px; line-height: 1.55; }
.constant-note b { color: #7ca79f; font-size: 6px; letter-spacing: .1em; }
.science-content ul { padding-left: 15px; margin: 5px 0 8px; }
.science-content li { margin: 3px 0; }
.science-content li b { color: #c4d3dc; }
.simplification-note { padding: 7px 8px; background: rgba(255,255,255,.025); border-radius: 5px; }
.disclaimer { color: #748d99; font-style: italic; }
.keyboard-hint { margin: 10px 1px 0; color: #647887; font-size: 7px; display: flex; align-items: center; gap: 5px; }
.keyboard-hint span { margin-right: 4px; font-weight: 800; letter-spacing: .1em; }
kbd { min-width: 16px; padding: 2px 4px; text-align: center; border: 1px solid var(--line-strong); border-radius: 3px; color: #9dafbb; font-family: inherit; font-size: 7px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #536777; font-size: 7px; letter-spacing: .13em; font-weight: 750; }
.app-footer i { color: var(--accent); font-style: normal; padding: 0 4px; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0,1fr) 330px; }
  .panel-scroll { padding-left: 13px; padding-right: 13px; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-rows: 68px minmax(0,1fr) 0; }
  .topbar { padding: 0 15px; }
  .brand-symbol { width: 35px; height: 35px; }
  .brand-symbol svg { width: 33px; height: 33px; }
  .brand-copy h1 { font-size: 17px; }
  .brand-copy p { font-size: 10px; }
  .topbar-meta { font-size: 8px; gap: 9px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(285px, 44%) minmax(0,1fr); gap: 9px; padding: 9px; }
  .visual-panel { grid-template-rows: 42px minmax(0,1fr) 70px; }
  .control-panel { min-height: 0; }
  .panel-scroll { padding: 12px 14px 15px; }
  .panel-heading { margin-bottom: 10px; }
  .panel-heading h2 { font-size: 15px; }
  .controls-section { margin-top: 13px; }
  .control-block { padding: 8px 0 7px; }
  .playback-section { padding-top: 10px; }
  .audit-card { margin-top: 10px; }
  .science-panel { margin-top: 10px; }
  .app-footer { display: none; }
}
@media (max-width: 520px) {
  .app-shell { grid-template-rows: 61px minmax(0,1fr) 0; }
  .topbar { padding: 0 11px; }
  .brand-lockup { gap: 8px; }
  .brand-symbol { width: 31px; height: 31px; }
  .brand-symbol svg { width: 30px; height: 30px; }
  .eyebrow { font-size: 7px; letter-spacing: .12em; }
  .brand-copy h1 { font-size: 15px; }
  .brand-copy p { font-size: 9px; margin-top: 2px; }
  .topbar-meta { gap: 7px; font-size: 7px; letter-spacing: .08em; }
  .live-indicator { gap: 5px; }
  .live-indicator i { width: 5px; height: 5px; }
  .meta-divider { height: 12px; }
  .workspace { grid-template-rows: minmax(270px, 43%) minmax(0,1fr); padding: 7px; gap: 7px; }
  .visual-panel { grid-template-rows: 37px minmax(0,1fr) 66px; }
  .stage-toolbar { padding: 0 9px; }
  .stage-context { gap: 6px; }
  .context-label { font-size: 7px; letter-spacing: .12em; }
  .context-detail { display: none; }
  .stage-actions { gap: 4px; }
  .quiet-button { height: 25px; padding: 0 6px; font-size: 7px; gap: 5px; }
  .screenshot-button svg { width: 11px; height: 11px; }
  .canvas-top-left { left: 9px; top: 8px; gap: 4px; }
  .frame-chip { padding: 4px 6px; font-size: 6px; }
  .scale-note { font-size: 6px; }
  .canvas-top-right { right: 8px; top: 9px; gap: 7px; font-size: 7px; }
  .canvas-top-right span { gap: 4px; }
  .canvas-top-right i { width: 5px; height: 5px; }
  .phase-caption { left: 8px; bottom: 8px; max-width: calc(100% - 120px); padding: 6px 8px; gap: 6px; font-size: 8px; }
  .caption-mark { margin-top: 3px; width: 4px; height: 4px; }
  .readout-cell { padding: 8px 8px 6px; gap: 3px; }
  .readout-label { font-size: 6px; letter-spacing: .08em; }
  .readout-cell strong { font-size: 16px; }
  .readout-cell strong small { font-size: 9px; }
  .readout-kind { font-size: 6px; letter-spacing: .08em; }
  .panel-scroll { padding: 10px 11px 13px; }
  .panel-heading { margin-bottom: 8px; }
  .panel-heading h2 { font-size: 14px; }
  .model-status { font-size: 7px; padding: 4px 6px; }
  .subsection-label { font-size: 7px; margin-bottom: 7px; }
  .preset-button { height: 49px; padding: 6px; gap: 6px; }
  .preset-icon { width: 25px; height: 25px; }
  .preset-copy b { font-size: 9px; }
  .preset-copy small { font-size: 7px; }
  .controls-section { margin-top: 11px; }
  .control-title-row label { font-size: 9px; }
  .control-title-row output { font-size: 9px; }
  .control-block p { font-size: 7px; margin-top: 4px; }
  .range-ends { font-size: 6px; }
  .transport-button { height: 31px; font-size: 7px; }
  .audit-card { padding: 8px 9px 7px; }
  .science-panel summary { min-height: 35px; }
  .keyboard-hint { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
