:root {
  color-scheme: dark;
  --bg: #08111c;
  --panel: #0d1925;
  --panel-2: #101f2d;
  --line: rgba(176, 198, 212, .13);
  --line-strong: rgba(176, 198, 212, .22);
  --text: #e8edf0;
  --muted: #8b9aa7;
  --muted-2: #61717e;
  --gold: #e5b36f;
  --gold-bright: #f1c47b;
  --cyan: #79d2d8;
  --green: #8bd2ae;
  --danger: #e58e78;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --space: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 35% 0%, rgba(29, 53, 68, .32), transparent 45%), var(--bg); }
.masthead { height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7, 15, 24, .86); flex: 0 0 auto; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 27px; height: 27px; border: 1px solid rgba(229,179,111,.48); border-radius: 50%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 5px 4px; transform: rotate(-25deg); }
.brand-mark span { display: block; width: 4px; border-radius: 5px; background: var(--gold); }
.brand-mark span:nth-child(1) { height: 7px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 9px; opacity: .75; }
.eyebrow { font-size: 9px; letter-spacing: .16em; color: var(--muted); font-weight: 700; }
.brand-title { margin-top: 3px; font-size: 12px; letter-spacing: .12em; font-weight: 750; }
.masthead-right { display: flex; align-items: center; gap: 18px; }
.seed-chip { border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 9px; font-size: 9px; color: #b5c1c8; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.live-indicator { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: .12em; color: var(--green); font-weight: 750; }
.live-indicator i, .scene-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(139,210,174,.65); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 0; flex: 1 0 auto; min-height: 0; }
.stage-column { min-width: 0; padding: 22px 24px 18px 28px; display: flex; flex-direction: column; gap: 14px; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-end; min-height: 58px; }
.stage-head h1 { font-size: clamp(24px, 2.2vw, 32px); line-height: 1; letter-spacing: -.045em; margin: 7px 0 5px; font-weight: 660; }
.stage-subtitle { color: #9aa9b2; font-size: 12px; margin: 0; }
.stage-badges { display: flex; gap: 6px; padding-bottom: 4px; }
.tag { border: 1px solid var(--line-strong); color: #9eacb5; border-radius: 3px; padding: 5px 7px; font-size: 8px; font-weight: 750; letter-spacing: .1em; white-space: nowrap; }
.tag-gold { border-color: rgba(229,179,111,.38); color: var(--gold); }
.scene-frame { height: clamp(330px, 43vw, 450px); min-height: 310px; position: relative; border: 1px solid rgba(164,187,200,.16); border-radius: 8px; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, #0b1926 0%, #142330 50%, #111b22 100%); box-shadow: 0 16px 42px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035); }
.scene-container { position: absolute; inset: 0; z-index: 3; }
.scene-container canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.scene-vignette { pointer-events: none; position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgba(3,10,17,.18), transparent 20%, transparent 70%, rgba(3,10,17,.38)); }
.scene-topline { position: absolute; top: 14px; left: 16px; right: 16px; z-index: 4; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-coordinate { font-size: 8px; letter-spacing: .15em; color: rgba(218,230,234,.62); font-weight: 750; }
.scene-state { display: inline-flex; align-items: center; gap: 7px; font-size: 8px; letter-spacing: .11em; color: var(--green); border: 1px solid rgba(139,210,174,.25); background: rgba(5,19,23,.42); border-radius: 20px; padding: 6px 9px; backdrop-filter: blur(8px); }
.scene-state i { width: 5px; height: 5px; }
.scene-legend { position: absolute; z-index: 4; left: 16px; bottom: 50px; display: flex; flex-wrap: wrap; gap: 13px; pointer-events: none; }
.scene-legend span { font-size: 8px; color: rgba(224,233,235,.72); display: flex; align-items: center; gap: 6px; text-shadow: 0 1px 6px #08111c; }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-dot.wind { background: #e8c88e; box-shadow: 0 0 7px #e8c88e; }
.legend-dot.flow { background: #f5b56d; box-shadow: 0 0 7px #f5b56d; }
.legend-dot.sound { background: #79d2d8; box-shadow: 0 0 7px #79d2d8; }
.stage-footer { position: absolute; z-index: 4; bottom: 0; left: 0; right: 0; height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-top: 1px solid rgba(180,200,210,.1); background: rgba(4,12,19,.58); backdrop-filter: blur(10px); }
.camera-hint { color: rgba(194,207,213,.58); font-size: 8px; letter-spacing: .09em; display: flex; align-items: center; gap: 7px; }
.camera-hint b { color: rgba(194,207,213,.28); }
.mouse-icon { font-size: 13px; color: var(--gold); }
.stage-footer-actions { display: flex; gap: 5px; }
.icon-button { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(180,200,210,.16); background: rgba(14,28,39,.7); border-radius: 4px; color: #b4c1c8; font-size: 15px; cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.icon-button:hover { color: var(--gold-bright); border-color: rgba(229,179,111,.55); background: rgba(32,43,49,.9); }
.context-loss { position: absolute; z-index: 6; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; background: rgba(4,10,16,.92); text-align: center; padding: 24px; }
.context-loss[hidden] { display: none; }
.context-loss strong { font-size: 17px; }
.context-loss span { font-size: 11px; color: var(--muted); max-width: 280px; line-height: 1.5; }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; background: rgba(13,25,37,.72); }
.readout-card { padding: 11px 12px 10px; min-width: 0; border-right: 1px solid var(--line); }
.readout-card:last-child { border-right: 0; }
.readout-label { color: #91a0aa; font-size: 8px; letter-spacing: .1em; font-weight: 750; white-space: nowrap; }
.readout-label span { display: inline-block; color: #687a86; font-size: 7px; letter-spacing: .07em; margin-left: 4px; font-weight: 600; }
.readout-value { margin-top: 6px; display: flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; }
.readout-value strong { font-size: 22px; line-height: 1; letter-spacing: -.045em; font-weight: 650; }
.readout-value small { color: #91a0aa; font-size: 9px; }
.readout-foot { margin-top: 5px; font-size: 8px; color: #71818b; white-space: nowrap; }
.readout-highlight .readout-value strong { color: var(--gold-bright); }
.wave-panel { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 18px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(12,24,35,.6); min-height: 84px; }
.wave-main { margin-top: 5px; display: flex; align-items: baseline; gap: 6px; }
.wave-main strong { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--cyan); }
.wave-main span { font-size: 9px; color: #9aabb4; }
.wave-copy p { margin: 4px 0 0; font-size: 8px; line-height: 1.4; color: #758690; }
.wave-visual { min-width: 0; }
.wave-visual svg { display: block; width: 100%; height: 52px; overflow: visible; }
.wave-baseline { fill: none; stroke: rgba(174,195,204,.13); stroke-width: 1; stroke-dasharray: 3 5; }
.wave-path { fill: none; stroke: url(#wave-gradient); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(121,210,216,.3)); }
.wave-scale { display: flex; justify-content: space-between; color: #667781; font-size: 7px; letter-spacing: .04em; }
.control-panel { border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(14,27,39,.94), rgba(10,21,31,.98)); padding: 22px 18px 14px; display: flex; flex-direction: column; min-width: 0; gap: 15px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; }
.panel-heading h2 { margin: 6px 0 0; font-size: 18px; letter-spacing: -.035em; font-weight: 650; }
.panel-index { font-size: 8px; letter-spacing: .13em; color: #6d7d88; padding-bottom: 2px; }
.transport-row { display: grid; grid-template-columns: 1.3fr 1fr 36px; gap: 6px; }
.transport-button { height: 36px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgba(23,39,52,.72); color: #c3ced3; font-size: 10px; font-weight: 650; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: .18s ease; }
.transport-button:hover { border-color: rgba(229,179,111,.48); color: var(--gold-bright); }
.transport-button.primary { background: linear-gradient(110deg, #dca965, #bd874b); border-color: transparent; color: #17202a; box-shadow: 0 4px 16px rgba(196,139,74,.13); }
.transport-button.primary:hover { filter: brightness(1.08); }
.play-symbol { font-size: 10px; }
.transport-button.compact { font-size: 18px; color: #9eabb2; }
.preset-block, .control-list, .speed-block { display: flex; flex-direction: column; gap: 10px; }
.section-label { color: #91a0aa; font-size: 8px; font-weight: 800; letter-spacing: .13em; display: flex; align-items: center; justify-content: space-between; }
.section-label span { color: #5f707b; font-size: 7px; letter-spacing: .1em; font-weight: 650; }
.preset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.preset-button { min-height: 57px; padding: 7px 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border: 1px solid var(--line); background: rgba(18,34,47,.72); border-radius: 4px; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover { border-color: rgba(229,179,111,.4); }
.preset-button.active { border-color: rgba(229,179,111,.64); background: rgba(81,60,39,.25); }
.preset-button b { display: block; font-size: 8px; font-weight: 700; color: #c7d0d4; white-space: nowrap; }
.preset-button small { display: block; font-size: 7px; color: #71818b; margin-top: 3px; }
.preset-icon { font-size: 14px; line-height: 1; color: var(--gold); }
.quiet-icon { color: #9aabb5; }
.damp-icon { color: var(--cyan); }
.control-list { gap: 12px; }
.range-control { display: block; }
.range-head { display: flex; justify-content: space-between; align-items: baseline; color: #bdc8ce; font-size: 10px; }
.range-head output { color: var(--gold-bright); font-size: 9px; font-variant-numeric: tabular-nums; }
.range-control input[type=range], .speed-slider { width: 100%; display: block; appearance: none; height: 14px; background: transparent; cursor: pointer; margin: 5px 0 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #b8844b, #536a78); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #b8844b, #536a78); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; border: 2px solid #f1c47b; background: #182a37; box-shadow: 0 0 0 3px rgba(229,179,111,.13); }
input[type=range]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #f1c47b; background: #182a37; box-shadow: 0 0 0 3px rgba(229,179,111,.13); }
.range-scale { display: flex; justify-content: space-between; color: #5f707b; font-size: 7px; margin-top: 1px; }
.speed-block { gap: 4px; }
.speed-block .section-label output { color: var(--gold-bright); font-size: 9px; letter-spacing: 0; }
.speed-slider { margin-top: 2px; }
.speed-ticks { display: flex; justify-content: space-between; color: #687985; font-size: 7px; }
.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quality-button, .science-button { min-height: 32px; border: 1px solid var(--line); border-radius: 4px; background: rgba(17,32,44,.68); font-size: 8px; letter-spacing: .09em; font-weight: 750; cursor: pointer; color: #9eacb5; }
.quality-button { display: flex; justify-content: center; align-items: center; gap: 7px; }
.quality-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px rgba(139,210,174,.5); }
.quality-button[aria-pressed=false] .quality-dot { background: #9aabb5; box-shadow: none; }
.science-button { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.science-button span { color: var(--gold); font-size: 15px; font-weight: 400; }
.science-panel { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; animation: reveal .22s ease-out; }
.science-panel[hidden] { display: none; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.science-intro h3 { font-size: 15px; margin: 5px 0; letter-spacing: -.025em; }
.science-intro p, .equation-card p, .validation-card p { margin: 0; color: #8797a1; font-size: 9px; line-height: 1.5; }
.equation-card { border: 1px solid var(--line); background: rgba(6,16,25,.4); border-radius: 4px; padding: 9px; }
.equation-label { color: #748691; font-size: 7px; letter-spacing: .12em; font-weight: 750; }
.equation { margin: 8px 0 5px; color: #f0c987; font-family: Georgia, "Times New Roman", serif; font-size: 14px; white-space: nowrap; }
.equation sub, .equation sup { font-size: 9px; }
.validation-card { border: 1px solid rgba(121,210,216,.22); background: rgba(28,67,74,.12); border-radius: 4px; padding: 10px; }
.validation-heading { display: flex; justify-content: space-between; align-items: center; color: #9bb1b9; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.validation-pass { color: var(--green); }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 7px; }
.validation-values small { display: block; color: #72858e; font-size: 6px; letter-spacing: .08em; }
.validation-values strong { display: block; margin-top: 3px; color: #dce7e8; font-size: 13px; font-variant-numeric: tabular-nums; }
.validation-diff { font-size: 8px; color: #8ca1a9; margin-bottom: 7px; }
.validation-diff b { color: var(--cyan); }
.science-notes { border-top: 1px solid var(--line); padding-top: 9px; }
.science-notes h4 { margin: 0 0 6px; font-size: 9px; color: #c1cbd0; }
.science-notes ul { margin: 0; padding-left: 14px; color: #8797a1; font-size: 8px; line-height: 1.55; }
.science-notes li { margin: 3px 0; }
.science-notes b { color: #c7d1d5; }
.legal-note { color: #63747e; font-size: 7px; line-height: 1.4; margin: 0; }
.panel-footnote { color: #52636e; font-size: 7px; letter-spacing: .1em; margin-top: auto; padding-top: 8px; }
.panel-footnote span { color: #9c744a; padding: 0 3px; }
.global-footer { min-height: 27px; padding: 0 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: #566873; font-size: 7px; letter-spacing: .13em; flex: 0 0 auto; }
.annotation { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -50%); padding: 5px 7px; border: 1px solid rgba(204,218,219,.18); border-radius: 3px; background: rgba(7,17,25,.72); color: #d7e1e2; font-size: 8px; letter-spacing: .07em; white-space: nowrap; backdrop-filter: blur(5px); }
.annotation::after { content: ""; position: absolute; width: 4px; height: 4px; left: 50%; bottom: -3px; background: var(--gold); border-radius: 50%; }
.annotation small { color: #93a5ac; margin-left: 4px; font-size: 7px; }
.embed-mode .masthead, .embed-mode .global-footer { display: none; }
.embed-mode .workspace { min-height: 100vh; }
.embed-mode .stage-column { padding-top: 12px; }
.embed-mode .stage-head { min-height: 46px; }
.embed-mode .control-panel { padding-top: 14px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0,1fr) 320px; }
  .stage-column { padding-left: 18px; padding-right: 16px; }
  .control-panel { padding-left: 14px; padding-right: 14px; }
  .readout-card { padding-left: 9px; padding-right: 8px; }
  .readout-label { font-size: 7px; }
  .readout-label span { display: none; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .stage-column { padding: 18px 18px 14px; }
  .scene-frame { height: min(58vw, 430px); min-height: 300px; }
  .control-panel { border-left: 0; border-top: 1px solid var(--line); padding: 18px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 16px 22px; }
  .panel-heading, .transport-row, .preset-block, .control-list, .speed-block, .panel-actions, .science-panel, .panel-footnote { min-width: 0; }
  .panel-heading, .transport-row { grid-column: 1 / -1; }
  .science-panel { grid-column: 1 / -1; }
  .panel-footnote { grid-column: 1 / -1; margin-top: 0; }
  .control-list { grid-row: span 3; }
  .global-footer { padding: 0 18px; }
}
@media (max-width: 560px) {
  .masthead { height: 54px; padding: 0 14px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-title { font-size: 10px; }
  .eyebrow { font-size: 8px; }
  .masthead-right { gap: 9px; }
  .seed-chip { font-size: 8px; padding: 5px 6px; }
  .live-indicator { font-size: 7px; }
  .stage-column { padding: 15px 12px 12px; gap: 10px; }
  .stage-head { align-items: flex-start; min-height: 52px; }
  .stage-head h1 { font-size: 25px; }
  .stage-subtitle { font-size: 10px; max-width: 250px; line-height: 1.4; }
  .stage-badges { flex-direction: column; align-items: flex-end; gap: 4px; }
  .tag { font-size: 7px; padding: 4px 5px; }
  .scene-frame { height: 47vh; min-height: 280px; max-height: 390px; border-radius: 6px; }
  .scene-topline { top: 10px; left: 10px; right: 10px; }
  .scene-coordinate { font-size: 7px; }
  .scene-state { font-size: 7px; padding: 5px 7px; }
  .scene-legend { left: 10px; bottom: 44px; gap: 9px; }
  .scene-legend span { font-size: 7px; }
  .stage-footer { height: 34px; padding-left: 10px; }
  .camera-hint { font-size: 7px; gap: 4px; }
  .readout-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout-card { padding: 9px 10px; border-bottom: 1px solid var(--line); }
  .readout-card:nth-child(2) { border-right: 0; }
  .readout-card:nth-child(3), .readout-card:nth-child(4) { border-bottom: 0; }
  .readout-label { font-size: 7px; }
  .readout-label span { display: inline-block; font-size: 6px; }
  .readout-value strong { font-size: 20px; }
  .wave-panel { grid-template-columns: 1fr; gap: 5px; padding: 9px 11px; }
  .wave-copy p { display: none; }
  .wave-main { margin-top: 2px; }
  .wave-visual svg { height: 42px; }
  .control-panel { padding: 16px 12px 12px; grid-template-columns: minmax(0,1fr); gap: 14px; }
  .panel-heading, .transport-row, .preset-block, .control-list, .speed-block, .panel-actions, .science-panel, .panel-footnote { grid-column: 1; }
  .control-list { grid-row: auto; }
  .preset-button { min-height: 54px; }
  .preset-button b { font-size: 8px; }
  .range-head { font-size: 10px; }
  .range-control input[type=range] { margin-top: 6px; }
  .panel-footnote { margin-top: 0; }
  .global-footer { padding: 7px 12px; gap: 5px; font-size: 6px; line-height: 1.4; }
  .global-footer span:last-child { text-align: right; }
  .embed-mode .stage-column { padding: 10px; }
  .embed-mode .scene-frame { height: 45vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
