:root {
  color-scheme: dark;
  --bg: #0b1110;
  --panel: #111a18;
  --panel-raised: #17211e;
  --panel-soft: #1b2723;
  --line: #2a3731;
  --line-soft: rgba(178, 193, 181, .12);
  --text: #e9eee8;
  --muted: #98a69c;
  --muted-2: #718077;
  --accent: #d8ad69;
  --accent-soft: rgba(216, 173, 105, .13);
  --accent-line: rgba(216, 173, 105, .42);
  --radius: 12px;
  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-height: 100%; margin: 0; background: var(--bg); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 701px) { .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; } .workspace { height: calc(100dvh - 64px); } }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: #0d1412; z-index: 2; }
.brand-lockup { min-width: 0; display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 28px; height: 32px; position: relative; display: flex; align-items: center; justify-content: center; }
.brand-mark span { position: absolute; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 11px solid var(--accent); opacity: .92; }
.brand-mark span:nth-child(1) { top: 1px; transform: scale(.72); }
.brand-mark span:nth-child(2) { top: 9px; transform: scale(.94); }
.brand-mark span:nth-child(3) { top: 18px; transform: scale(1.14); }
.brand-copy { min-width: 0; }
.eyebrow { color: var(--muted-2); font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.2; white-space: nowrap; }
.eyebrow i { display: inline-block; width: 3px; height: 3px; margin: 0 6px 2px; border-radius: 50%; background: var(--accent); }
.brand-title { margin-top: 4px; color: var(--text); font-size: 15px; font-weight: 620; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.live-indicator { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 760; letter-spacing: .14em; white-space: nowrap; }
.live-dot, .corner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(216,173,105,.5); }
.quality-button { border: 1px solid var(--line); background: #141d1a; color: var(--muted); border-radius: 7px; padding: 8px 10px; font-size: 9px; font-weight: 800; letter-spacing: .1em; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.quality-button:hover, .quality-button:focus-visible { color: var(--text); border-color: var(--accent-line); outline: none; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 402px; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #0b1210; }
.scene-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #101917; }
#sceneCanvas { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#sceneCanvas.is-dragging { cursor: grabbing; }
.scene-corner-label { position: absolute; left: 20px; top: 17px; display: flex; align-items: center; gap: 8px; color: rgba(220,229,219,.62); font-size: 8px; font-weight: 800; letter-spacing: .16em; pointer-events: none; }
.scene-corner-label .corner-dot { width: 5px; height: 5px; }
.scene-caption { min-height: 70px; flex: 0 0 70px; display: flex; align-items: center; gap: 13px; padding: 12px 22px; border-top: 1px solid var(--line); background: #111a17; }
.caption-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-soft); }
.caption-icon span { width: 9px; height: 13px; border: 1.5px solid var(--accent); border-radius: 70% 30% 65% 35%; transform: rotate(38deg); }
.caption-copy { min-width: 0; flex: 1; }
.caption-kicker { color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.caption-copy p { margin: 4px 0 0; color: #d4ddd4; font-size: 11px; line-height: 1.45; }
.caption-state { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; padding-left: 10px; }
.control-panel { min-width: 0; min-height: 0; overflow: hidden; background: var(--panel); }
.panel-scroll { height: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #35443c transparent; padding: 18px 18px 22px; }
.panel-section { padding-bottom: 17px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.section-index { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.section-heading h2 { margin: 0; color: var(--text); font-size: 12px; font-weight: 680; letter-spacing: -.01em; }
.section-note { margin-left: auto; color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; min-height: 51px; display: flex; align-items: center; gap: 9px; text-align: left; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: #141e1b; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.preset-button:hover { border-color: #56634f; background: #19241f; }
.preset-button:active { transform: translateY(1px); }
.preset-button.is-active { border-color: var(--accent-line); background: var(--accent-soft); }
.preset-button b { display: block; color: #e3e9e2; font-size: 10px; font-weight: 700; line-height: 1.2; }
.preset-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.25; }
.preset-glyph { width: 21px; height: 21px; flex: 0 0 21px; position: relative; border: 1px solid rgba(216,173,105,.36); border-radius: 7px; background: rgba(216,173,105,.08); }
.glyph-cloud::before { content: ""; position: absolute; left: 4px; top: 8px; width: 11px; height: 6px; border: 1.4px solid var(--accent); border-radius: 8px; }
.glyph-cloud::after { content: ""; position: absolute; left: 7px; top: 5px; width: 6px; height: 6px; border: 1.4px solid var(--accent); border-bottom: 0; border-radius: 8px 8px 0 0; }
.glyph-sun::before { content: ""; position: absolute; inset: 5px; border: 1.5px solid var(--accent); border-radius: 50%; box-shadow: 0 -4px 0 -2.5px var(--accent), 0 4px 0 -2.5px var(--accent), 4px 0 0 -2.5px var(--accent), -4px 0 0 -2.5px var(--accent); }
.glyph-snow::before { content: "✳"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); font-size: 15px; }
.glyph-crack::before { content: ""; position: absolute; left: 9px; top: 3px; width: 1.5px; height: 14px; background: var(--accent); transform: rotate(28deg); box-shadow: 3px 4px 0 -0.2px var(--accent); }
.control-list { display: grid; gap: 12px; }
.control-row { min-width: 0; }
.control-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.control-head label { color: #cbd5cc; font-size: 10px; font-weight: 600; }
.control-head output { color: var(--text); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-head output em, .time-line em { color: var(--muted-2); font-size: 7px; font-style: normal; font-weight: 650; letter-spacing: .03em; }
input[type="range"] { width: 100%; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: #344139; }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #344139; }
input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; appearance: none; border: 2px solid #171e19; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #171e19; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; margin-top: -1px; color: var(--muted-2); font-size: 8px; font-variant-numeric: tabular-nums; }
.transport-section { padding-bottom: 14px; }
.transport-controls { display: grid; grid-template-columns: 1.15fr 1fr .85fr; gap: 7px; }
.transport-button { min-height: 33px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; background: #18221e; color: #cbd5cc; font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.transport-button:hover { border-color: var(--accent-line); color: var(--text); }
.transport-button.primary { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.transport-button.primary:hover { background: rgba(216,173,105,.2); }
.play-symbol { font-size: 10px; }
.transport-button span:last-child { color: var(--muted); }
.time-line { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--muted-2); font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.time-line strong { color: #cbd5cc; font-size: 9px; font-weight: 650; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-height: 66px; padding: 9px 10px 8px; border: 1px solid var(--line); border-radius: 9px; background: #141e1b; }
.readout-label { display: block; color: var(--muted-2); font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.readout-card strong { display: block; margin-top: 5px; color: var(--text); font-size: 19px; font-weight: 650; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.readout-card small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 7px; }
.check-list { display: grid; gap: 9px; }
.check-row { display: grid; grid-template-columns: 15px minmax(0,1fr) auto; align-items: center; gap: 7px; }
.check-mark { width: 14px; height: 14px; display: grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 50%; color: var(--accent); font-size: 9px; }
.check-row b { display: block; color: #cbd5cc; font-size: 9px; font-weight: 650; }
.check-row small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.check-row strong { color: var(--accent); font-size: 9px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.checks-footnote { margin-top: 9px; color: var(--muted-2); font-size: 8px; line-height: 1.4; }
.experiment-card { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #141e1b; }
.experiment-copy b { color: #dce5dc; font-size: 10px; font-weight: 700; }
.experiment-copy p { margin: 4px 0 10px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.experiment-button { width: 100%; min-height: 31px; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; border: 1px solid var(--accent-line); border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .12em; cursor: pointer; }
.experiment-button:hover { background: rgba(216,173,105,.2); }
.experiment-button:disabled { opacity: .55; cursor: wait; }
.experiment-result { margin-top: 9px; color: var(--muted); font-size: 8px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.science-panel { margin: 0 0 15px; border: 1px solid var(--line); border-radius: 9px; background: #141e1b; }
.science-panel summary { min-height: 41px; display: flex; align-items: center; gap: 9px; padding: 0 11px; color: var(--text); font-size: 10px; font-weight: 700; list-style: none; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-chevron { margin-left: auto; color: var(--accent); font-size: 17px; font-weight: 400; transition: transform .2s; }
.science-panel[open] .summary-chevron { transform: rotate(45deg); }
.science-content { padding: 0 12px 13px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 12px 0 5px; color: #d9e2d9; font-size: 10px; font-weight: 700; }
.science-content p { margin: 5px 0 7px; }
.science-content ul { margin: 5px 0 9px; padding-left: 16px; }
.science-content li { margin: 4px 0; }
.equation { margin: 7px 0; padding: 8px 9px; border-left: 2px solid var(--accent); background: rgba(216,173,105,.07); color: #e4e9e1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.science-note { padding-top: 8px; border-top: 1px solid var(--line-soft); color: #bdc8bd; }
.panel-footer { padding: 2px 0 5px; color: var(--muted-2); font-size: 8px; letter-spacing: .03em; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.embed-mode .topbar { display: none; }
body.embed-mode .workspace { min-height: 0; height: 100dvh; }
@media (max-width: 920px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 360px; }
  .topbar { padding: 0 17px; }
  .panel-scroll { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 700px) {
  .topbar { height: 54px; flex-basis: 54px; padding: 0 12px; gap: 8px; }
  .brand-mark { width: 23px; transform: scale(.88); }
  .brand-lockup { gap: 8px; }
  .eyebrow { font-size: 7px; letter-spacing: .13em; }
  .brand-title { max-width: 205px; font-size: 12px; }
  .topbar-actions { gap: 8px; }
  .live-indicator { font-size: 7px; gap: 5px; letter-spacing: .08em; }
  .quality-button { padding: 7px 7px; font-size: 7px; }
  .workspace { display: flex; flex-direction: column; min-height: calc(100dvh - 54px); }
  .stage-column { flex: 0 0 auto; height: 42dvh; min-height: 250px; max-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
  .scene-caption { min-height: 56px; flex-basis: 56px; gap: 9px; padding: 8px 12px; }
  .caption-icon { width: 25px; height: 25px; flex-basis: 25px; }
  .caption-copy p { font-size: 9px; }
  .caption-kicker { font-size: 7px; }
  .caption-state { max-width: 85px; font-size: 7px; white-space: normal; text-align: right; line-height: 1.3; }
  .control-panel { flex: 1 1 auto; min-height: 420px; overflow: visible; }
  .panel-scroll { height: auto; overflow: visible; padding: 15px 13px 25px; }
  body.embed-mode .workspace { height: 100dvh; min-height: 0; flex: 1; overflow: hidden; }
  body.embed-mode .stage-column { flex: 0 0 38%; height: 38%; min-height: 0; max-height: none; }
  body.embed-mode .control-panel { flex: 1 1 62%; min-height: 0; overflow: hidden; }
  body.embed-mode .panel-scroll { height: 100%; overflow: auto; }
}
@media (max-width: 420px) {
  .brand-title { max-width: 165px; font-size: 11px; }
  .live-indicator { display: none; }
  .stage-column { height: 39dvh; min-height: 238px; }
  .preset-button { min-height: 47px; gap: 7px; padding: 7px; }
  .preset-button b { font-size: 9px; }
  .preset-button small { font-size: 7px; }
  .preset-glyph { width: 19px; height: 19px; flex-basis: 19px; }
  .control-list { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
