:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #101620;
  --panel-2: #0c121b;
  --line: rgba(166, 190, 211, .13);
  --muted: #8292a4;
  --soft: #b8c4d1;
  --text: #e9f0f6;
  --accent: #70e1d1;
  --accent-dim: rgba(112, 225, 209, .13);
  --accent-glow: rgba(112, 225, 209, .28);
  --radius: 12px;
  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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 62px minmax(0, 1fr) 34px; background: radial-gradient(ellipse at 28% 22%, rgba(30, 61, 73, .18), transparent 38%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(8, 11, 18, .94); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border: 1px solid rgba(112, 225, 209, .4); border-radius: 50%; position: relative; display: grid; place-items: center; box-shadow: 0 0 22px rgba(112, 225, 209, .1), inset 0 0 14px rgba(112, 225, 209, .07); }
.brand-mark span { width: 12px; height: 12px; border: 1px solid var(--accent); border-radius: 50%; display: block; box-shadow: 0 0 9px var(--accent-glow); }
.brand-mark i { position: absolute; width: 26px; height: 8px; border: 1px solid rgba(112, 225, 209, .7); border-radius: 50%; transform: rotate(-32deg); }
.eyebrow, .stage-kicker, .stage-scale, .section-heading, .footerbar { font-size: 9px; letter-spacing: .16em; font-weight: 700; color: var(--muted); }
.brand-copy h1 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.025em; line-height: 1; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.model-status { display: flex; align-items: center; gap: 8px; color: #9caebc; font-size: 9px; letter-spacing: .12em; font-weight: 700; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.icon-button { height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #101720; color: #c7d2dc; font-size: 11px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.icon-button:hover { border-color: rgba(112,225,209,.45); background: #15212a; }
.icon-button:active { transform: translateY(1px); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 366px; gap: 1px; background: var(--line); }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 35% 45%, rgba(19, 52, 62, .26), transparent 52%), #080e17; }
#spaceCanvas { display: block; width: 100%; height: 100%; }
.stage-topline { position: absolute; top: 17px; left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.stage-kicker { color: #a0b1bf; }
.stage-scale { color: #6f8795; font-size: 8px; }
.scene-caption { position: absolute; left: 20px; top: 48px; max-width: 310px; padding: 9px 11px; border-left: 2px solid var(--accent); background: rgba(9, 16, 24, .72); color: #c4d1da; font-size: 10px; line-height: 1.45; letter-spacing: .01em; backdrop-filter: blur(8px); pointer-events: none; }
.stage-legend { position: absolute; bottom: 13px; left: 20px; display: flex; gap: 15px; align-items: center; color: #8193a2; font-size: 9px; pointer-events: none; }
.stage-legend span { display: flex; align-items: center; gap: 6px; }
.stage-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.legend-crust { border: 1px solid var(--accent); background: transparent; }
.legend-core { background: #9ab8c6; box-shadow: 0 0 7px rgba(154,184,198,.5); }
.legend-beam { background: #d8e7ef; opacity: .8; }
.control-panel { min-width: 0; min-height: 0; background: var(--panel); overflow: hidden; }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 20px; scrollbar-width: thin; scrollbar-color: #2b3b48 transparent; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #2b3b48; border-radius: 10px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #a3b2c0; font-size: 9px; }
.micro-tag, .value-tag, .source-tag { font-size: 7px; letter-spacing: .11em; color: #688b8d; font-weight: 750; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.readout-card { min-width: 0; min-height: 63px; padding: 9px 10px 8px; border: 1px solid rgba(166,190,211,.12); border-radius: 8px; background: linear-gradient(135deg, rgba(23,35,47,.92), rgba(13,20,29,.95)); }
.readout-label { display: flex; justify-content: space-between; align-items: center; gap: 4px; white-space: nowrap; color: #8294a4; font-size: 7px; letter-spacing: .09em; font-weight: 750; }
.value-tag { color: #688b8d; font-size: 6px; flex: 0 0 auto; }
.readout-value { margin-top: 7px; color: #eaf3f5; font-size: 18px; font-weight: 620; letter-spacing: -.04em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.readout-value small { color: #9aabb8; font-size: 9px; font-weight: 500; letter-spacing: 0; }
.readout-footline { display: flex; justify-content: space-between; gap: 8px; margin: 9px 1px 0; color: #728493; font-size: 8px; letter-spacing: .07em; }
.readout-footline b { color: #b9c9d2; font-weight: 650; letter-spacing: 0; margin-left: 4px; }
.controls-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 13px; }
.preset-button { height: 30px; border: 1px solid rgba(166,190,211,.14); border-radius: 7px; background: #0c131c; color: #8799a8; font-size: 10px; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(112,225,209,.4); color: #d7e5e9; }
.preset-button.active { border-color: rgba(112,225,209,.48); background: var(--accent-dim); color: var(--accent); box-shadow: inset 0 0 14px rgba(112,225,209,.035); }
.slider-control { margin: 0 0 12px; }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.slider-heading label { color: #bdc9d2; font-size: 10px; font-weight: 550; }
.slider-heading output { color: #d7e6e8; font-size: 9px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 13px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(112,225,209,.7), rgba(112,225,209,.17)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(112,225,209,.7), rgba(112,225,209,.17)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border: 2px solid #baf7ef; border-radius: 50%; background: #3b9e98; box-shadow: 0 0 0 3px rgba(112,225,209,.12), 0 0 8px rgba(112,225,209,.35); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #baf7ef; border-radius: 50%; background: #3b9e98; box-shadow: 0 0 0 3px rgba(112,225,209,.12); }
.range-ends { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; color: #657789; font-size: 7px; font-variant-numeric: tabular-nums; }
.source-tag { color: #688b8d; }
.source-tag.illustrative { color: #9c8a68; }
.source-tag.scaled { color: #8c83ad; }
.speed-control { margin-top: 2px; padding-top: 11px; border-top: 1px solid rgba(166,190,211,.1); }
.transport-row { display: grid; grid-template-columns: 1.1fr 1fr .8fr; gap: 6px; margin-top: 15px; }
.transport-row button { height: 34px; border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 650; transition: .18s ease; }
.transport-primary { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(112,225,209,.45); background: rgba(112,225,209,.13); color: var(--accent); }
.transport-primary:hover { background: rgba(112,225,209,.2); }
.transport-secondary { border: 1px solid rgba(166,190,211,.15); background: #0d141e; color: #aebdc8; }
.transport-secondary:hover { border-color: rgba(112,225,209,.35); color: #e5f2f3; }
.pause-icon { width: 8px; height: 10px; display: inline-block; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.play-icon { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.toggle-block { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 13px; }
.trace-toggle { display: inline-flex; align-items: center; gap: 8px; color: #9aabb8; font-size: 9px; cursor: pointer; user-select: none; }
.trace-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 27px; height: 15px; border-radius: 10px; background: #263541; position: relative; transition: background .18s ease; }
.switch::after { content: ""; position: absolute; width: 9px; height: 9px; top: 3px; left: 3px; border-radius: 50%; background: #8294a4; transition: transform .18s ease, background .18s ease; }
.trace-toggle input:checked + .switch { background: rgba(112,225,209,.35); }
.trace-toggle input:checked + .switch::after { transform: translateX(12px); background: var(--accent); }
.trace-toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 3px; }
.view-switch { display: flex; padding: 2px; border: 1px solid rgba(166,190,211,.13); border-radius: 7px; background: #0a1119; }
.view-button { border: 0; border-radius: 5px; padding: 5px 8px; background: transparent; color: #758899; font-size: 8px; cursor: pointer; }
.view-button.active { background: #1b3036; color: var(--accent); }
.scale-explainer { min-height: 28px; margin: 8px 0 0; color: #718394; font-size: 8px; line-height: 1.45; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(166,190,211,.08); color: #718493; font-size: 7px; letter-spacing: .12em; font-weight: 750; }
.quality-toggle { padding: 5px 8px; border: 1px solid rgba(112,225,209,.35); border-radius: 6px; background: rgba(112,225,209,.08); color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .08em; cursor: pointer; }
.quality-toggle[aria-pressed="false"] { border-color: rgba(166,190,211,.18); background: #0c131c; color: #91a1ae; }
.audit-section { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.audit-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; margin-bottom: 6px; border: 1px solid rgba(166,190,211,.11); border-radius: 7px; background: #0c131c; }
.audit-title { display: block; color: #bdcbd3; font-size: 9px; font-weight: 600; }
.audit-subtitle { display: block; margin-top: 3px; color: #708292; font-size: 7px; }
.audit-card strong { color: var(--accent); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.science-panel { margin-top: 13px; border: 1px solid rgba(166,190,211,.12); border-radius: 8px; background: #0c131c; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; color: #aebdc8; font-size: 9px; font-weight: 750; letter-spacing: .12em; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--accent); font-size: 16px; font-weight: 400; transition: transform .2s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 12px 12px; color: #91a2af; font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 12px 0 5px; color: #d5e0e7; font-size: 10px; font-weight: 650; }
.science-content p { margin: 5px 0 8px; }
.equation { display: grid; gap: 3px; margin: 8px 0; padding: 7px 8px; border-left: 2px solid rgba(112,225,209,.4); background: rgba(112,225,209,.045); }
.equation span { color: #7e9a9c; font-size: 7px; font-weight: 750; letter-spacing: .12em; }
.equation code { color: #c8dcde; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; white-space: normal; }
.science-disclaimer { margin-top: 12px !important; padding-top: 8px; border-top: 1px solid rgba(166,190,211,.1); color: #a6b6c1; font-style: italic; }
.footerbar { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-top: 1px solid var(--line); color: #647586; font-size: 8px; letter-spacing: .12em; background: #090d14; }
.keyboard-hint { display: flex; align-items: center; gap: 6px; letter-spacing: .04em; text-transform: none; }
kbd { padding: 2px 4px; border: 1px solid rgba(166,190,211,.17); border-radius: 3px; color: #9aabb8; font: inherit; font-size: 7px; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 850px) {
  .app-shell { grid-template-rows: 54px minmax(0, 1fr) 30px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .topbar { padding: 0 15px; }
  .brand-copy h1 { font-size: 16px; }
  .model-status { display: none; }
}
@media (max-width: 680px) {
  .app-shell { grid-template-rows: 50px minmax(0, 1fr) 28px; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 39%) minmax(0, 1fr); gap: 1px; }
  .topbar { padding: 0 12px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-copy .eyebrow { font-size: 7px; }
  .brand-copy h1 { font-size: 15px; }
  .topbar-actions { gap: 0; }
  .icon-button { height: 30px; padding: 0 8px; font-size: 9px; }
  .icon-button svg { width: 13px; height: 13px; }
  .stage-topline { top: 10px; left: 12px; right: 12px; }
  .stage-kicker { font-size: 7px; }
  .stage-scale { font-size: 6px; }
  .scene-caption { top: 32px; left: 12px; max-width: 195px; padding: 6px 8px; font-size: 8px; }
  .stage-legend { bottom: 7px; left: 12px; gap: 10px; font-size: 7px; }
  .panel-scroll { padding: 12px 12px 18px; }
  .readout-card { min-height: 57px; padding: 7px 8px; }
  .readout-label { font-size: 6px; }
  .value-tag { font-size: 5px; }
  .readout-value { font-size: 16px; }
  .readout-value small { font-size: 8px; }
  .readout-footline { font-size: 7px; }
  .controls-section { margin-top: 14px; padding-top: 12px; }
  .slider-control { margin-bottom: 10px; }
  .slider-heading label { font-size: 9px; }
  .slider-heading output { font-size: 8px; }
  .footerbar { padding: 0 10px; font-size: 6px; letter-spacing: .08em; }
  .keyboard-hint { gap: 4px; }
  kbd { font-size: 6px; }
}
@media (max-width: 380px) {
  .scene-caption { max-width: 174px; }
  .readout-value { font-size: 14px; }
  .readout-label { letter-spacing: .04em; }
  .stage-legend { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
