:root {
  color-scheme: dark;
  --bg: #07141d;
  --bg-deep: #051018;
  --panel: #0b1c27;
  --panel-2: #102431;
  --line: rgba(157, 194, 208, .13);
  --line-strong: rgba(157, 194, 208, .22);
  --text: #e7f1f4;
  --muted: #8aa4af;
  --quiet: #607985;
  --accent: #5bd5cc;
  --accent-soft: rgba(91, 213, 204, .12);
  --accent-glow: rgba(91, 213, 204, .24);
  --warning: #d5b98a;
  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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 16% 0%, rgba(23, 65, 77, .25), transparent 42%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; display: flex; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(5, 16, 24, .82); position: relative; z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 260px; }
.brand-symbol { width: 38px; height: 38px; border: 1px solid rgba(91, 213, 204, .35); border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(91, 213, 204, .13), rgba(91, 213, 204, .02)); box-shadow: inset 0 0 20px rgba(91, 213, 204, .06); }
.brand-symbol svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.55; stroke-linecap: round; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.eyebrow, .section-kicker, .mini-heading, .readout-label, .check-heading, .check-values span, .caption-kicker, .panel-bottom-note { letter-spacing: .13em; font-size: 9px; font-weight: 750; color: var(--quiet); }
.brand-title { color: #e8f5f6; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.brand-title span { color: #7e9aa5; font-weight: 550; }
.topbar-meta { display: flex; align-items: center; gap: 9px; color: #8da6af; font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.live-dot, .foot-dot, .caption-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(91, 213, 204, .1), 0 0 12px rgba(91, 213, 204, .55); }
.meta-divider { width: 1px; height: 14px; margin: 0 5px; background: var(--line-strong); }
.clock-rate { color: #c5d6dc; }
.clock-rate em { color: var(--quiet); font-style: normal; font-weight: 500; }
.screenshot-top { margin-left: auto; }
.icon-button, .square-button { border: 1px solid var(--line-strong); background: rgba(17, 40, 52, .68); border-radius: 9px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #c8d9de; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.icon-button svg, .square-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-button span { font-size: 10px; font-weight: 700; letter-spacing: .06em; }
button:hover { border-color: rgba(91, 213, 204, .5); background-color: rgba(91, 213, 204, .09); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 370px; }
.stage-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 20px 22px 12px; background: linear-gradient(160deg, rgba(9, 27, 37, .84), rgba(6, 20, 29, .96)); border-right: 1px solid var(--line); }
.stage-heading { min-height: 58px; flex: 0 0 58px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.stage-heading h1 { margin: 5px 0 0; font-size: clamp(19px, 2vw, 25px); line-height: 1.08; font-weight: 650; letter-spacing: -.035em; color: #e9f3f4; }
.section-kicker { color: #6f929f; }
.stage-heading-right { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #76929d; font-size: 8px; font-weight: 700; letter-spacing: .11em; white-space: nowrap; }
.legend-line { width: 18px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); margin-left: 8px; }
.legend-ring { width: 9px; height: 9px; border: 1px solid rgba(91, 213, 204, .62); border-radius: 50%; margin-left: 9px; }
.canvas-frame { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; border: 1px solid rgba(125, 172, 188, .16); border-radius: 13px; background: #071b27; box-shadow: 0 18px 48px rgba(0, 0, 0, .22), inset 0 0 35px rgba(20, 74, 89, .08); }
#scene { display: block; width: 100%; height: 100%; outline: none; }
.canvas-corner { position: absolute; z-index: 1; top: 12px; padding: 6px 8px; border: 1px solid rgba(159, 207, 217, .12); border-radius: 5px; background: rgba(5, 20, 29, .62); color: #9ab3bc; font-size: 8px; font-weight: 800; letter-spacing: .13em; pointer-events: none; backdrop-filter: blur(8px); }
.canvas-corner span { color: var(--accent); margin-left: 7px; }
.canvas-corner-left { left: 12px; }
.canvas-corner-right { right: 12px; color: #73919d; }
.stage-footline { height: 26px; flex: 0 0 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; color: #617f8b; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.stage-footline > span:first-child { display: flex; align-items: center; gap: 8px; }
.foot-dot { width: 5px; height: 5px; box-shadow: none; }
#modelClock { color: #77939d; font-variant-numeric: tabular-nums; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 14px; background: linear-gradient(180deg, rgba(11, 29, 40, .98), rgba(8, 22, 31, .98)); scrollbar-width: thin; scrollbar-color: #27424e transparent; }
.control-panel::-webkit-scrollbar { width: 6px; }
.control-panel::-webkit-scrollbar-thumb { background: #27424e; border-radius: 6px; }
.panel-intro { margin-bottom: 16px; }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 5px; }
.panel-title-row h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.03em; }
.model-tag { border: 1px solid rgba(91, 213, 204, .2); border-radius: 4px; padding: 4px 6px; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.panel-intro p { margin: 6px 0 0; color: #8ba4ae; font-size: 11px; line-height: 1.45; }
.mini-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #76939e; font-size: 8px; letter-spacing: .12em; }
.mini-heading span { color: #536f7b; font-size: 7px; font-weight: 700; }
.preset-section { margin-bottom: 16px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-button { min-width: 0; min-height: 58px; text-align: left; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(18, 43, 55, .52); display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 6px; row-gap: 3px; transition: border-color .2s ease, background .2s ease; }
.preset-button.selected { border-color: rgba(91, 213, 204, .46); background: linear-gradient(135deg, rgba(91, 213, 204, .12), rgba(16, 41, 52, .58)); box-shadow: inset 0 0 18px rgba(91, 213, 204, .035); }
.preset-index { grid-row: 1 / span 2; align-self: center; color: var(--accent); font-size: 9px; font-weight: 800; }
.preset-name { color: #d9e7ea; font-size: 10px; font-weight: 750; }
.preset-note { color: #78929d; font-size: 8px; }
.readout-section { margin-bottom: 16px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-height: 72px; padding: 9px 9px 8px; border: 1px solid rgba(135, 177, 190, .13); border-radius: 8px; background: linear-gradient(145deg, rgba(18, 43, 55, .74), rgba(12, 31, 42, .62)); }
.readout-accent { border-color: rgba(91, 213, 204, .24); background: linear-gradient(145deg, rgba(36, 84, 87, .32), rgba(12, 31, 42, .68)); }
.readout-label { display: flex; justify-content: space-between; color: #76929d; font-size: 7px; letter-spacing: .1em; }
.readout-label span { color: #a4c3c8; font-size: 9px; letter-spacing: 0; }
.readout-value { margin-top: 7px; color: #e5f3f3; font-size: 20px; line-height: 1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.readout-accent .readout-value { color: var(--accent); }
.readout-value small { color: #89a4ae; font-size: 9px; font-weight: 600; letter-spacing: 0; }
.readout-foot { margin-top: 5px; color: #607b86; font-size: 8px; }
.sliders-section { margin-bottom: 13px; }
.slider-control { padding: 8px 0 7px; border-top: 1px solid rgba(135, 177, 190, .09); }
.slider-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.slider-label-row label { color: #c8d9dd; font-size: 10px; font-weight: 650; }
.slider-label-row output { color: var(--accent); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.slider-label-row output small { color: #88a4ad; font-size: 8px; font-weight: 600; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 5px 0 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(91, 213, 204, .72), rgba(91, 213, 204, .18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(91, 213, 204, .72), rgba(91, 213, 204, .18)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #d9ffff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(91, 213, 204, .13), 0 0 12px rgba(91, 213, 204, .4); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d9ffff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(91, 213, 204, .13), 0 0 12px rgba(91, 213, 204, .4); }
.range-ends { display: flex; justify-content: space-between; color: #5e7984; font-size: 7px; font-variant-numeric: tabular-nums; }
.transport-section { margin: 2px 0 12px; }
.transport-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px 38px auto; gap: 7px; }
.play-button { height: 36px; border: 1px solid rgba(91, 213, 204, .42); border-radius: 8px; background: linear-gradient(100deg, rgba(91, 213, 204, .2), rgba(91, 213, 204, .08)); color: #c8f6f1; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 10px; font-weight: 750; cursor: pointer; }
.play-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.square-button { width: 38px; height: 36px; padding: 0; }
.quality-button { min-width: 74px; height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(17, 40, 52, .68); color: #8da8b1; font-size: 8px; font-weight: 800; letter-spacing: .08em; cursor: pointer; }
.check-card { margin-bottom: 11px; padding: 10px 11px 9px; border: 1px solid rgba(91, 213, 204, .19); border-radius: 8px; background: linear-gradient(145deg, rgba(19, 47, 55, .6), rgba(11, 29, 39, .75)); }
.check-heading { display: flex; align-items: center; gap: 7px; color: #9db7bf; font-size: 8px; }
.check-icon { width: 15px; height: 15px; border: 1px solid rgba(91, 213, 204, .42); border-radius: 50%; display: grid; place-items: center; color: var(--accent); font-size: 10px; }
.check-kind { margin-left: auto; color: #64838d; font-size: 7px; }
.check-subtitle { margin-top: 7px; color: #77939d; font-size: 8px; }
.check-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.check-values > div { min-width: 0; }
.check-values span { display: block; color: #617e89; font-size: 6px; letter-spacing: .08em; white-space: nowrap; }
.check-values strong { display: block; margin-top: 4px; color: #dcebed; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(135, 177, 190, .1); color: #77939d; font-size: 8px; }
.check-footer strong { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; }
.caption-card { padding: 10px 11px; border-left: 2px solid rgba(91, 213, 204, .65); border-radius: 0 7px 7px 0; background: rgba(91, 213, 204, .055); margin-bottom: 10px; }
.caption-kicker { display: flex; align-items: center; gap: 8px; color: #7fa7ae; font-size: 7px; }
.caption-pulse { width: 5px; height: 5px; box-shadow: none; }
.caption-card p { margin: 7px 0 0; color: #b8cbd0; font-size: 9px; line-height: 1.5; }
.science-panel { margin-top: 2px; border: 1px solid var(--line); border-radius: 8px; background: rgba(11, 29, 40, .62); }
.science-panel summary { min-height: 36px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; cursor: pointer; color: #a7c1c8; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary::after { content: "+"; color: var(--accent); font-size: 15px; font-weight: 400; margin-left: 5px; }
.science-panel[open] summary::after { content: "−"; }
.details-hint { margin-left: auto; color: #587580; font-size: 7px; font-weight: 600; }
.science-content { padding: 0 11px 12px; color: #9bb2ba; font-size: 9px; line-height: 1.5; }
.science-content h3 { margin: 11px 0 5px; color: #cbdde0; font-size: 9px; font-weight: 750; letter-spacing: .04em; }
.science-content p { margin: 5px 0; }
.science-content ul { padding-left: 15px; margin: 5px 0 9px; }
.science-content li { margin: 4px 0; }
.science-content strong { color: #d0e1e3; }
.equation { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(135, 177, 190, .08); }
.equation span { color: #76939d; font-size: 8px; }
.equation code, .equation-note code { color: #b9f0e8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; white-space: nowrap; }
.equation-note { margin-top: 7px !important; color: #829da7; }
.science-disclaimer { margin-top: 10px !important; padding-top: 8px; border-top: 1px solid var(--line); color: #9ab2b8; font-style: italic; }
.panel-bottom-note { padding: 11px 0 2px; text-align: center; color: #4f6b76; font-size: 7px; letter-spacing: .11em; }
.panel-bottom-note span { color: var(--accent); padding: 0 4px; }

@media (max-width: 980px) and (min-width: 701px) {
  #workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .stage-panel { padding: 16px 16px 10px; }
  .control-panel { padding: 15px 14px 12px; }
  .stage-heading-right { display: none; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar { height: 56px; flex-basis: 56px; padding: 0 12px; gap: 10px; }
  .brand-lockup { min-width: 0; gap: 8px; }
  .brand-symbol { width: 32px; height: 32px; border-radius: 9px; }
  .brand-symbol svg { width: 24px; height: 24px; }
  .eyebrow { font-size: 7px; }
  .brand-title { font-size: 10px; letter-spacing: .13em; }
  .topbar-meta { display: none; }
  .screenshot-top { width: 35px; height: 34px; padding: 0; margin-left: auto; }
  .screenshot-top span { display: none; }
  #workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(230px, 42dvh) minmax(0, 1fr); }
  .stage-panel { padding: 11px 10px 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-heading { min-height: 43px; flex-basis: 43px; }
  .stage-heading h1 { margin-top: 3px; font-size: 17px; }
  .stage-heading .section-kicker { font-size: 7px; }
  .stage-heading-right { display: none; }
  .canvas-frame { border-radius: 9px; }
  .canvas-corner { top: 7px; padding: 4px 6px; font-size: 6px; }
  .canvas-corner-left { left: 7px; }
  .canvas-corner-right { right: 7px; }
  .stage-footline { height: 20px; flex-basis: 20px; font-size: 6px; letter-spacing: .08em; }
  .control-panel { padding: 13px 13px calc(14px + env(safe-area-inset-bottom)); }
  .panel-intro { margin-bottom: 12px; }
  .panel-title-row h2 { font-size: 16px; }
  .panel-intro p { font-size: 10px; }
  .preset-section, .readout-section { margin-bottom: 13px; }
  .readout-card { min-height: 67px; }
  .slider-control { padding: 7px 0 6px; }
  .transport-row { grid-template-columns: minmax(0, 1fr) 36px 36px auto; }
  .square-button { width: 36px; }
}
@media (max-width: 360px) {
  .brand-title { font-size: 9px; }
  .stage-heading h1 { font-size: 15px; }
  .transport-row { grid-template-columns: minmax(0, 1fr) 34px 34px auto; gap: 5px; }
  .square-button { width: 34px; }
  .quality-button { min-width: 66px; font-size: 7px; }
  .readout-value { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; overflow: hidden; }
@media (max-width: 700px) {
  body.embed-mode #workspace { height: calc(100% - 56px); min-height: 0; }
}
