:root {
  color-scheme: dark;
  --bg: #080c16;
  --panel: #0e1422;
  --panel-raised: #121b2c;
  --panel-soft: #0b1220;
  --line: rgba(163, 184, 220, 0.13);
  --line-strong: rgba(163, 184, 220, 0.22);
  --text: #edf3ff;
  --muted: #8998b3;
  --subtle: #63718d;
  --accent: #9a8cff;
  --accent-bright: #b7adff;
  --accent-soft: rgba(154, 140, 255, 0.14);
  --cyan: #72d8ed;
  --green: #75d9b3;
  --amber: #e8bd79;
  --danger: #e28e9c;
  --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; width: 100%; height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.app-shell { width: 100%; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 20% 0%, rgba(48, 56, 103, .12), transparent 42%), var(--bg); }
.topbar { height: 68px; min-height: 68px; padding: 0 22px 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8, 12, 22, .94); gap: 18px; z-index: 3; }
.identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.mark { width: 30px; height: 30px; border: 1px solid rgba(154,140,255,.55); border-radius: 50%; position: relative; flex: 0 0 auto; box-shadow: 0 0 20px rgba(154,140,255,.1); }
.mark::before { content: ""; position: absolute; inset: 6px 2px; border: 1px solid var(--accent); border-radius: 50%; transform: rotate(-32deg); }
.mark span { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-bright); top: 12px; left: 12px; }
.mark span:nth-child(2) { width: 3px; height: 3px; top: 4px; left: 19px; background: var(--cyan); }
.mark span:nth-child(3) { width: 3px; height: 3px; top: 21px; left: 6px; background: var(--accent-bright); }
.identity-copy { min-width: 0; }
.eyebrow, .section-kicker, .scene-kicker, .caption-label { margin: 0; font-size: 9px; line-height: 1.3; letter-spacing: .16em; font-weight: 750; color: var(--muted); }
.eyebrow-dot { color: var(--accent); padding: 0 4px; }
h1 { margin: 2px 0 0; font-size: 16px; letter-spacing: -.035em; line-height: 1.2; font-weight: 680; white-space: nowrap; }
.transport { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .1em; padding: 7px 10px; margin-right: 4px; border: 1px solid rgba(117,217,179,.2); background: rgba(117,217,179,.055); border-radius: 999px; }
.status-pill.paused { color: var(--amber); border-color: rgba(232,189,121,.22); background: rgba(232,189,121,.06); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.action-button { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.025); color: #cbd6eb; padding: 0 11px; cursor: pointer; font-size: 11px; font-weight: 650; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.action-button:hover { background: rgba(255,255,255,.075); border-color: rgba(185,198,228,.4); }
.action-button:active { transform: translateY(1px); }
.primary-action { border-color: rgba(154,140,255,.48); background: rgba(154,140,255,.15); color: #e7e3ff; min-width: 66px; }
.primary-action:hover { background: rgba(154,140,255,.24); border-color: var(--accent); }
.button-sub { color: var(--muted); font-size: 9px; margin-left: 3px; }
.icon-action { width: 34px; padding: 0; font-size: 19px; line-height: 1; color: #b9c5db; }
.screenshot-action { border-color: rgba(114,216,237,.28); color: #a9e9f3; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(360px, .92fr); gap: 0; }
.stage-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 17px 18px 12px 22px; border-right: 1px solid var(--line); background: linear-gradient(150deg, rgba(20,28,49,.22), transparent 48%); }
.stage-topline { min-height: 43px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.scene-heading { min-width: 0; }
.scene-kicker { color: #8f9ab3; font-size: 8px; }
.scene-title { display: block; margin-top: 4px; font-size: 13px; letter-spacing: -.02em; color: #dce5f7; font-weight: 620; }
.stage-tools { display: flex; gap: 7px; flex: 0 0 auto; }
.micro-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #aab8d1; border-radius: 7px; padding: 6px 8px; cursor: pointer; font-size: 9px; font-weight: 700; transition: .18s ease; }
.micro-toggle:hover { border-color: var(--line-strong); background: rgba(255,255,255,.055); }
.micro-toggle.active { color: #d9d2ff; border-color: rgba(154,140,255,.32); background: var(--accent-soft); }
.toggle-state { font-size: 8px; letter-spacing: .08em; color: var(--accent-bright); }
.canvas-wrap { position: relative; flex: 1; min-height: 170px; overflow: hidden; border: 1px solid rgba(135,156,199,.15); border-radius: 15px; background: radial-gradient(ellipse at 53% 49%, rgba(30,43,77,.58), rgba(8,13,26,.92) 72%); box-shadow: inset 0 0 70px rgba(0,0,0,.28), 0 12px 35px rgba(0,0,0,.15); }
#spaceCanvas { width: 100%; height: 100%; display: block; }
.canvas-corner { position: absolute; pointer-events: none; display: flex; align-items: center; gap: 6px; color: rgba(179,195,222,.64); font-size: 8px; font-weight: 760; letter-spacing: .12em; text-shadow: 0 1px 5px #070b14; }
.top-left-corner { top: 13px; left: 14px; }
.top-right-corner { top: 13px; right: 14px; }
.bottom-left-corner { bottom: 13px; left: 14px; gap: 8px; }
.corner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px rgba(114,216,237,.7); }
.corner-separator { color: var(--accent); }
.legend-line { width: 17px; height: 0; border-top: 1px dashed var(--cyan); display: inline-block; margin-left: 3px; }
.recoil-line { border-top: 2px solid var(--accent); }
.caption-row { min-height: 67px; display: flex; align-items: flex-start; gap: 11px; padding: 12px 4px 8px; }
.caption-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; flex: 0 0 auto; color: var(--accent-bright); background: rgba(154,140,255,.1); border: 1px solid rgba(154,140,255,.16); font-size: 13px; }
.caption-copy { min-width: 0; }
.caption-label { color: #9a8cff; font-size: 8px; }
.caption-copy p { margin: 4px 0 0; color: #aebbd1; font-size: 11px; line-height: 1.45; max-width: 760px; }
.stage-footline { display: flex; justify-content: space-between; gap: 12px; padding: 7px 4px 0; border-top: 1px solid rgba(163,184,220,.09); color: #64728d; font-size: 8px; letter-spacing: .06em; }
.stage-footline strong { color: #b9c5db; font-weight: 700; margin-left: 4px; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 12px; background: linear-gradient(180deg, rgba(17,24,40,.84), rgba(10,15,27,.94)); scrollbar-width: thin; scrollbar-color: rgba(142,157,193,.24) transparent; }
.control-panel::-webkit-scrollbar { width: 6px; }
.control-panel::-webkit-scrollbar-thumb { background: rgba(142,157,193,.2); border-radius: 99px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.section-kicker { font-size: 8px; color: #8190ab; }
h2 { margin: 3px 0 0; font-size: 15px; line-height: 1.2; letter-spacing: -.03em; font-weight: 670; }
.source-tag { display: inline-flex; align-items: center; padding: 4px 6px; border-radius: 5px; font-size: 7px; letter-spacing: .1em; line-height: 1; font-weight: 800; white-space: nowrap; }
.textbook-tag { color: #91d9c0; background: rgba(117,217,179,.09); border: 1px solid rgba(117,217,179,.15); }
.illustrative-tag { color: #d5b6ff; background: rgba(154,140,255,.1); border: 1px solid rgba(154,140,255,.16); }
.scaled-tag { color: #e9c488; background: rgba(232,189,121,.1); border: 1px solid rgba(232,189,121,.16); }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readout-card { min-width: 0; padding: 10px 11px 9px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); }
.featured-readout { border-color: rgba(154,140,255,.28); background: linear-gradient(145deg, rgba(154,140,255,.105), rgba(255,255,255,.014)); }
.readout-label { display: block; font-size: 7px; font-weight: 800; letter-spacing: .11em; color: #8291ad; }
.readout-card strong { display: block; margin-top: 6px; font-size: 20px; line-height: 1; font-weight: 690; letter-spacing: -.045em; font-variant-numeric: tabular-nums; color: #eef3ff; white-space: nowrap; }
.featured-readout strong { color: #d9d2ff; font-size: 23px; }
.readout-card strong small { font-size: 10px; font-weight: 600; letter-spacing: 0; color: #9caac3; }
.readout-note { display: block; margin-top: 6px; font-size: 8px; color: #6f7d98; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secondary-readouts { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px 0; color: #8391aa; font-size: 9px; }
.secondary-readouts > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.secondary-readouts strong { color: #d0daed; font-size: 10px; font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }
.secondary-readouts i { font-style: italic; }
.controls-section { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.controls-heading { margin-bottom: 10px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 13px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; text-align: left; background: rgba(255,255,255,.02); cursor: pointer; transition: .18s ease; }
.preset-button:hover { background: rgba(255,255,255,.055); border-color: var(--line-strong); }
.preset-button.selected { border-color: rgba(154,140,255,.42); background: rgba(154,140,255,.1); }
.preset-arrow { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; font-size: 16px; font-weight: 800; flex: 0 0 auto; }
.preset-arrow.outward { color: var(--green); background: rgba(117,217,179,.09); }
.preset-arrow.inward { color: var(--amber); background: rgba(232,189,121,.09); }
.preset-button strong, .preset-button small { display: block; }
.preset-button strong { font-size: 9px; font-weight: 750; color: #dce5f7; }
.preset-button small { margin-top: 3px; font-size: 8px; color: #8290a9; }
.slider-control { margin-top: 12px; }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.slider-heading label { color: #bac7dd; font-size: 10px; font-weight: 620; }
.slider-value { color: #d7d0ff; font-size: 10px; font-weight: 740; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 16px; margin: 4px 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, rgba(154,140,255,.6), rgba(154,140,255,.22)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, rgba(154,140,255,.6), rgba(154,140,255,.22)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; margin-top: -4.5px; background: #c2b9ff; border: 2px solid #282342; box-shadow: 0 0 0 3px rgba(154,140,255,.15), 0 0 12px rgba(154,140,255,.28); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #c2b9ff; border: 2px solid #282342; box-shadow: 0 0 0 3px rgba(154,140,255,.15), 0 0 12px rgba(154,140,255,.28); }
.range-ends { display: flex; justify-content: space-between; color: #62718c; font-size: 7px; margin-top: -1px; }
.control-hint { margin: 5px 0 0; color: #7887a1; font-size: 8px; line-height: 1.35; }
.two-up-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compact-control .slider-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
.compact-control .slider-heading label { font-size: 9px; }
.warp-control { padding: 9px 10px 8px; border: 1px solid rgba(232,189,121,.14); border-radius: 9px; background: rgba(232,189,121,.035); }
.warp-control .slider-heading label { display: flex; align-items: center; gap: 6px; }
.warp-control .slider-value { color: #e9c488; }
.reset-hint { margin: 10px 0 0; color: #697994; font-size: 8px; }
.audit-section { margin-top: 15px; padding: 11px 12px 10px; border: 1px solid rgba(117,217,179,.18); border-radius: 10px; background: linear-gradient(135deg, rgba(117,217,179,.06), rgba(255,255,255,.012)); }
.audit-heading { display: flex; align-items: center; gap: 8px; }
.audit-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; background: rgba(117,217,179,.11); color: var(--green); font-size: 12px; font-weight: 800; }
.audit-heading > div { flex: 1; min-width: 0; }
.audit-heading h2 { font-size: 11px; margin-top: 2px; }
.audit-heading .section-kicker { font-size: 7px; }
.audit-values { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.audit-values span, .audit-bottom span { display: block; color: #8291a8; font-size: 8px; }
.audit-values strong { display: block; margin-top: 3px; color: #d3e9df; font-size: 11px; font-variant-numeric: tabular-nums; }
.audit-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; padding-top: 7px; border-top: 1px solid rgba(117,217,179,.12); }
.audit-bottom strong { color: var(--green); font-size: 10px; font-variant-numeric: tabular-nums; }
.science-panel { margin-top: 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); overflow: hidden; }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 11px 12px; cursor: pointer; color: #dce5f7; font-size: 10px; font-weight: 700; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-summary-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--accent-bright); border-radius: 6px; background: var(--accent-soft); font-size: 13px; }
.summary-chevron { margin-left: auto; color: #8b99b3; font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.science-block { padding-top: 11px; }
.science-block p { margin: 7px 0 4px; color: #b9c6dc; font-size: 9px; line-height: 1.5; }
.science-block p strong { color: #e1e9f8; font-weight: 700; }
.science-block .equation { margin: 4px 0; padding: 6px 8px; border-radius: 6px; background: rgba(0,0,0,.2); color: #d4ccff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.science-block ul { padding-left: 16px; margin: 7px 0 0; color: #9cabc3; font-size: 9px; line-height: 1.55; }
.science-block li { margin: 4px 0; }
.disclaimer { margin: 12px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: #7e8ca6; font-size: 8px; line-height: 1.4; }
.panel-footer { display: flex; justify-content: space-between; gap: 8px; padding: 11px 2px 2px; color: #5f6e88; font-size: 7px; letter-spacing: .1em; }
.panel-footer strong { color: #8796b1; font-weight: 800; }
@media (max-width: 980px) and (min-width: 681px) {
  .workspace { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .95fr); }
  .topbar { padding: 0 15px; }
  .stage-panel { padding-left: 15px; padding-right: 13px; }
  .control-panel { padding-left: 13px; padding-right: 13px; }
  .status-pill { display: none; }
}
@media (max-width: 680px) {
  .topbar { height: 58px; min-height: 58px; padding: 0 11px; gap: 7px; }
  .mark { width: 25px; height: 25px; }
  .mark span:first-child { top: 9px; left: 9px; }
  .mark span:nth-child(2) { top: 3px; left: 16px; }
  .mark span:nth-child(3) { top: 17px; left: 4px; }
  .identity { gap: 8px; }
  .eyebrow { font-size: 7px; letter-spacing: .11em; }
  h1 { font-size: 13px; }
  .transport { gap: 4px; }
  .status-pill { display: none; }
  .action-button { min-height: 30px; padding: 0 8px; font-size: 9px; border-radius: 7px; }
  .primary-action { min-width: 52px; }
  .button-sub { display: none; }
  .icon-action { width: 30px; font-size: 17px; }
  .screenshot-action { display: inline-flex; justify-content: center; width: 37px; padding: 0 4px; font-size: 0; }
  .screenshot-action::after { content: "Shot"; font-size: 8px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .stage-panel { flex: 0 0 322px; min-height: 322px; padding: 10px 10px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-topline { min-height: 38px; align-items: center; }
  .scene-kicker { font-size: 7px; }
  .scene-title { font-size: 11px; margin-top: 3px; }
  .stage-tools { gap: 4px; }
  .micro-toggle { padding: 5px 6px; gap: 4px; font-size: 8px; }
  .toggle-state { font-size: 7px; }
  .canvas-wrap { min-height: 0; border-radius: 11px; }
  .canvas-corner { font-size: 6px; gap: 4px; }
  .top-left-corner { top: 8px; left: 9px; }
  .top-right-corner { top: 8px; right: 9px; }
  .bottom-left-corner { bottom: 8px; left: 9px; gap: 5px; }
  .legend-line { width: 11px; }
  .caption-row { min-height: 49px; padding: 7px 2px 4px; gap: 7px; }
  .caption-icon { width: 21px; height: 21px; font-size: 11px; }
  .caption-label { font-size: 7px; }
  .caption-copy p { font-size: 9px; line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .stage-footline { padding-top: 5px; font-size: 6px; }
  .control-panel { flex: 1 1 auto; min-height: 0; padding: 13px 12px 16px; }
  .section-heading { margin-bottom: 9px; }
  .readout-card { padding: 8px 9px; }
  .readout-card strong { font-size: 18px; }
  .featured-readout strong { font-size: 21px; }
  .controls-section { margin-top: 13px; padding-top: 12px; }
  .slider-control { margin-top: 10px; }
  .audit-section { margin-top: 12px; }
}
@media (max-width: 380px) {
  .transport { gap: 3px; }
  .action-button { padding: 0 6px; }
  .identity-copy { max-width: 148px; }
  .eyebrow { letter-spacing: .08em; }
  .micro-toggle { font-size: 7px; padding: 5px 5px; }
  .stage-panel { flex-basis: 314px; min-height: 314px; }
  .screenshot-action { width: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.inline-source { margin-left: 3px; vertical-align: 1px; font-size: 6px; padding: 2px 3px; }
