:root {
  color-scheme: dark;
  --bg: #090f19;
  --panel: #101a28;
  --panel-2: #132033;
  --line: #253449;
  --line-soft: rgba(128, 157, 190, .14);
  --text: #edf4fb;
  --muted: #93a5b9;
  --quiet: #61758d;
  --accent: #72e4d1;
  --accent-dim: rgba(114, 228, 209, .13);
  --accent-line: rgba(114, 228, 209, .38);
  --radius: 12px;
  --space: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { 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 { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { width: 100%; height: 100dvh; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 35% 0%, rgba(27, 54, 75, .18), transparent 42%), var(--bg); }
.topbar { height: 64px; min-height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: rgba(8, 14, 23, .88); }
.brand-lockup, .topbar-right, .brand-mark, .utility-button, .live-indicator { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(114, 228, 209, .45); border-radius: 50%; justify-content: center; position: relative; }
.brand-mark span { width: 12px; height: 12px; border: 1px solid var(--accent); border-radius: 50%; }
.brand-mark i { position: absolute; width: 25px; height: 8px; border: 1px solid var(--accent); border-radius: 50%; transform: rotate(-35deg); opacity: .72; }
.eyebrow, .stage-kicker, .section-label, .caption-title { font-size: 9px; font-weight: 750; letter-spacing: .16em; color: var(--muted); }
.brand-title { margin-top: 2px; font-size: 15px; line-height: 1; font-weight: 650; letter-spacing: -.025em; }
.brand-title span { color: var(--accent); font-size: 10px; vertical-align: 2px; margin-left: 4px; }
.topbar-right { gap: 20px; }
.live-indicator { gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.live-indicator span, .status-pill span { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px rgba(114, 228, 209, .55); }
.utility-button { gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #101b29; color: #d6e2ee; font-size: 11px; cursor: pointer; transition: border-color .2s, background .2s; }
.utility-button:hover { border-color: var(--accent-line); background: #152538; }
.utility-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 382px; gap: 0; }
.stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; border-right: 1px solid var(--line-soft); background: #08121e; }
#sceneCanvas { display: block; width: 100%; height: 100%; }
.stage-topline { position: absolute; top: 24px; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.stage-kicker { color: #8ca1b6; }
.stage-topline h1 { margin: 8px 0 0; font-size: clamp(23px, 2.4vw, 34px); line-height: 1.06; letter-spacing: -.045em; font-weight: 560; }
.stage-topline h1 em { color: var(--accent); font-style: normal; }
.scale-chip { margin-top: 2px; padding: 7px 9px; border: 1px solid rgba(138, 165, 191, .22); border-radius: 6px; background: rgba(8, 17, 28, .64); color: #91a5b8; font-size: 8px; letter-spacing: .12em; font-weight: 700; }
.scale-dot { display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--accent); }
.stage-bottomline { position: absolute; bottom: 40%; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.stage-key { display: flex; align-items: center; gap: 8px; color: #8fa2b5; font-size: 9px; }
.key-star { width: 7px; height: 7px; border-radius: 50%; background: #e6f5f5; box-shadow: 0 0 8px rgba(206, 244, 240, .75); }
.key-body { width: 8px; height: 8px; border-radius: 50%; background: #172536; border: 1px solid #a1b2c1; }
.key-wave { width: 13px; height: 7px; border: 1px solid var(--accent); border-radius: 50%; opacity: .9; }
.key-divider { width: 1px; height: 10px; background: #304257; margin: 0 3px; }
.frame-counter { color: #70869d; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 28px; background: linear-gradient(180deg, rgba(17, 27, 42, .97), rgba(12, 21, 33, .99)); scrollbar-width: thin; scrollbar-color: #30445b transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 19px; font-weight: 570; letter-spacing: -.035em; }
.status-pill { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid rgba(114, 228, 209, .18); border-radius: 20px; color: var(--accent); font-size: 8px; letter-spacing: .1em; font-weight: 750; }
.section-label { display: flex; justify-content: space-between; align-items: center; color: #9aacc0; margin-bottom: 10px; }
.section-label span { color: #61768e; font-size: 8px; letter-spacing: .1em; }
.preset-section { padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-button { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 9px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: rgba(9, 17, 28, .42); cursor: pointer; transition: border-color .2s, background .2s; }
.preset-button:hover { border-color: #496078; }
.preset-button.active { border-color: var(--accent-line); background: var(--accent-dim); }
.preset-button strong { display: block; font-size: 10px; font-weight: 650; white-space: nowrap; }
.preset-button small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.preset-icon { width: 25px; height: 25px; flex: 0 0 25px; position: relative; border: 1px solid rgba(114, 228, 209, .28); border-radius: 50%; }
.icon-ring::before, .icon-ring::after { content: ""; position: absolute; inset: 5px; border: 1px solid var(--accent); border-radius: 50%; }
.icon-ring::after { inset: 1px; opacity: .5; }
.icon-blur::before, .icon-blur::after { content: ""; position: absolute; inset: 6px 3px; border: 1px solid var(--accent); border-radius: 50%; filter: blur(1px); }
.icon-blur::after { inset: 3px 0; opacity: .35; }
.controls-section { padding: 16px 0 15px; border-bottom: 1px solid var(--line-soft); }
.control-row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; row-gap: 6px; margin: 12px 0 13px; }
.control-row label { color: #cbd7e3; font-size: 10px; font-weight: 550; }
.control-row output { color: var(--accent); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.kind { display: inline-block; margin-left: 5px; color: #6d8399; font-size: 7px; font-weight: 700; letter-spacing: .09em; vertical-align: 1px; }
input[type="range"] { grid-column: 1 / -1; width: 100%; height: 13px; margin: 0; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) 0 var(--fill, 50%), #2d4055 var(--fill, 50%) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #2d4055; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border: 2px solid #0c1723; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #0c1723; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.playback-section { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.transport-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; }
.transport-button { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 8px 7px; border: 1px solid var(--line); border-radius: 7px; background: #111f30; color: #bac9d8; font-size: 10px; cursor: pointer; transition: background .2s, border-color .2s; }
.transport-button:hover { border-color: #4a637d; background: #17283b; }
.transport-button.primary { border-color: var(--accent-line); background: var(--accent-dim); color: var(--accent); }
.transport-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#playIcon path:first-child { fill: currentColor; stroke: none; }
.time-control { margin: 15px 0 10px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-button { display: flex; align-items: center; gap: 8px; padding: 4px 0; border: 0; background: transparent; color: #b5c4d2; font-size: 10px; cursor: pointer; }
.toggle-track { width: 26px; height: 15px; display: inline-flex; align-items: center; padding: 2px; border: 1px solid #43576c; border-radius: 10px; background: #1a2a3d; transition: background .2s; }
.toggle-track i { width: 9px; height: 9px; border-radius: 50%; background: #8193a7; transition: transform .2s, background .2s; }
.toggle-button.is-on .toggle-track { background: var(--accent-dim); border-color: var(--accent-line); }
.toggle-button.is-on .toggle-track i { transform: translateX(11px); background: var(--accent); }
.quality-toggle { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #0b1522; }
.quality-toggle button { padding: 4px 9px; border: 0; border-radius: 5px; background: transparent; color: #71869b; font-size: 9px; cursor: pointer; }
.quality-toggle button.selected { background: #24364a; color: #dce8f1; }
.readout-section { padding: 16px 0 14px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; padding: 10px 10px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(7, 14, 23, .34); }
.readout-card.featured { border-color: rgba(114, 228, 209, .2); background: linear-gradient(135deg, rgba(114, 228, 209, .08), rgba(7, 14, 23, .35)); }
.readout-label { display: flex; justify-content: space-between; align-items: center; color: #93a7ba; font-size: 8px; }
.readout-label span { color: #607a8d; font-size: 7px; letter-spacing: .08em; }
.readout-value { margin-top: 6px; color: #f0f7fb; font: 21px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.readout-value small { color: var(--accent); font: 10px ui-sans-serif, system-ui; letter-spacing: 0; }
.readout-note { margin-top: 4px; color: #71869b; font-size: 8px; }
.check-strip { display: flex; align-items: center; gap: 9px; margin-top: 9px; padding: 9px; border: 1px solid rgba(114, 228, 209, .18); border-radius: 8px; background: rgba(114, 228, 209, .055); }
.check-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 20px; border-radius: 50%; background: rgba(114, 228, 209, .13); color: var(--accent); font-size: 12px; }
.check-copy { min-width: 0; flex: 1; }
.check-copy strong { display: block; color: #c9d9e5; font-size: 9px; font-weight: 650; }
.check-copy strong span { margin-left: 4px; color: var(--accent); font-size: 7px; letter-spacing: .08em; }
.check-copy small { display: block; margin-top: 3px; color: #7d91a6; font-size: 7px; }
.check-result { color: var(--accent); font: 12px ui-monospace, monospace; white-space: nowrap; }
.check-result small { font: 9px ui-sans-serif, system-ui; }
.check-difference { margin: 5px 2px 0; text-align: right; color: #71889c; font-size: 8px; }
.caption-card { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(18, 33, 49, .68); }
.caption-mark { color: var(--accent); font-size: 16px; line-height: 1; }
.caption-title { color: var(--accent); font-size: 8px; }
.caption-card p { margin: 5px 0 0; color: #aebdcb; font-size: 9px; line-height: 1.5; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7, 14, 23, .25); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; color: #d7e2eb; font-size: 10px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary::after { content: "+"; color: var(--accent); font-size: 16px; font-weight: 300; }
.science-panel[open] summary::after { content: "−"; }
.summary-hint { margin-left: auto; margin-right: 9px; color: #71869b; font-size: 7px; letter-spacing: .1em; }
.science-content { padding: 0 12px 12px; color: #9fb0c0; font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 12px 0 5px; color: #d8e4ec; font-size: 10px; font-weight: 650; }
.science-content p { margin: 6px 0; }
.equation { margin: 8px 0; padding: 8px; border-left: 2px solid var(--accent); background: rgba(114, 228, 209, .055); color: #d2e9e6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.science-content ul { margin: 6px 0 10px; padding-left: 17px; }
.science-content li { margin: 4px 0; }
.model-note { margin-top: 12px !important; padding-top: 9px; border-top: 1px solid var(--line-soft); color: #74899e; font-style: italic; }
@media (max-width: 980px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .control-panel { padding-left: 16px; padding-right: 16px; }
  .stage-topline { left: 20px; right: 20px; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .app-shell { height: 100dvh; }
  .topbar { height: 54px; min-height: 54px; padding: 0 13px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-mark i { width: 22px; }
  .brand-title { font-size: 13px; }
  .live-indicator { display: none; }
  .topbar-right { gap: 0; }
  .utility-button { padding: 7px 8px; font-size: 9px; }
  .utility-button svg { width: 13px; height: 13px; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(250px, 43dvh) minmax(0, 1fr); min-height: 0; overflow: hidden; }
  .stage { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .stage-topline { top: 13px; left: 14px; right: 14px; }
  .stage-kicker { font-size: 7px; }
  .stage-topline h1 { margin-top: 5px; font-size: clamp(19px, 5.7vw, 26px); }
  .scale-chip { padding: 5px 6px; font-size: 6px; }
  .stage-bottomline { left: 13px; right: 13px; bottom: 40%; }
  .stage-key { gap: 5px; font-size: 7px; }
  .key-divider { margin: 0 1px; }
  .frame-counter { font-size: 7px; }
  .control-panel { padding: 15px 14px 24px; }
  .panel-heading { margin-bottom: 15px; }
  .panel-heading h2 { font-size: 17px; }
  .section-label { font-size: 8px; }
  .preset-button { padding: 9px 7px; gap: 7px; }
  .preset-button strong { font-size: 9px; }
  .preset-button small { font-size: 7px; }
  .preset-icon { width: 22px; height: 22px; flex-basis: 22px; }
  .control-row label { font-size: 10px; }
  .control-row { margin: 11px 0 12px; }
  .readout-value { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
