:root {
  color-scheme: dark;
  --bg: #080e16;
  --panel: #101a25;
  --panel-2: #14212d;
  --line: rgba(165, 194, 213, .13);
  --muted: #8194a4;
  --text: #e8eff3;
  --sand: #e4b97d;
  --cyan: #64d4e7;
  --amber: #f0b56b;
  --violet: #b29bf3;
  --green: #7ce0b1;
  --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; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; font-size: 13px; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input: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 45% -15%, rgba(38, 67, 84, .28), transparent 50%), var(--bg); }
.topbar { min-height: 68px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(9, 16, 24, .93); position: relative; z-index: 4; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(228, 185, 125, .34); border-radius: 10px; position: relative; overflow: hidden; background: linear-gradient(145deg, rgba(228,185,125,.15), rgba(228,185,125,.025)); flex: 0 0 auto; }
.brand-mark span { position: absolute; left: -3px; right: -3px; height: 13px; border-top: 1.5px solid var(--sand); border-radius: 50%; transform: rotate(-14deg); }
.brand-mark span:nth-child(1) { top: 8px; }
.brand-mark span:nth-child(2) { top: 14px; left: 4px; opacity: .75; transform: rotate(9deg); }
.brand-mark span:nth-child(3) { top: 20px; left: -8px; opacity: .45; transform: rotate(-5deg); }
.eyebrow { color: #8297a8; font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.3; }
.eyebrow-dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--sand); vertical-align: middle; margin: 0 5px 2px; }
h1 { margin: 3px 0 0; font-size: 15px; letter-spacing: -.025em; font-weight: 650; white-space: nowrap; }
.title-divider { color: #526575; font-weight: 400; margin: 0 4px; }
h1 span:last-child { color: #9aabb8; font-weight: 450; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.live-pill { height: 28px; display: flex; align-items: center; gap: 7px; border: 1px solid rgba(124, 224, 177, .2); border-radius: 999px; padding: 0 10px; color: #9ce3c1; font-size: 9px; letter-spacing: .11em; font-weight: 750; margin-right: 7px; }
.live-dot, .status-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(124,224,177,.65); }
.icon-button, .primary-button { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.025); display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; color: #b5c5d0; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; font-size: 11px; }
.icon-button:hover { background: rgba(255,255,255,.07); border-color: rgba(165,194,213,.28); }
.icon { color: var(--cyan); font-size: 17px; line-height: 1; }
.primary-button { background: #d7aa70; border-color: #d7aa70; color: #20170f; font-weight: 750; padding: 0 13px; }
.primary-button:hover { background: #ebc38e; border-color: #ebc38e; transform: translateY(-1px); }
.button-icon { font-size: 15px; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 0; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 14px 14px 10px 18px; gap: 9px; }
.stage { flex: 1; min-height: 360px; position: relative; overflow: hidden; border: 1px solid rgba(147, 179, 198, .15); border-radius: 13px; background: linear-gradient(180deg, #182736, #4a4037 88%); box-shadow: 0 20px 55px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.04); }
.webgl-mount { position: absolute; inset: 0; z-index: 0; }
.webgl-mount canvas { display: block; width: 100%; height: 100%; }
.stage-vignette { pointer-events: none; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(8,14,22,.40), transparent 25%, transparent 72%, rgba(8,14,22,.48)); }
.stage-topline, .stage-bottom { z-index: 2; position: absolute; left: 17px; right: 17px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.stage-topline { top: 15px; }
.scene-tag { padding: 7px 9px; background: rgba(7,14,21,.55); border: 1px solid rgba(208,225,235,.13); border-radius: 7px; color: #c2d0d8; font-size: 9px; letter-spacing: .13em; font-weight: 700; backdrop-filter: blur(12px); }
.tag-glyph { color: var(--sand); font-size: 15px; margin-right: 4px; vertical-align: -1px; }
.tag-separator { color: #708291; margin: 0 5px; }
.scene-coordinates { color: #a4b4be; font-size: 9px; letter-spacing: .1em; text-shadow: 0 1px 8px #0b1219; }
.scene-coordinates strong { color: #f0d4ad; margin-left: 6px; font-weight: 650; }
.stage-bottom { bottom: 13px; }
.legend { display: flex; align-items: center; gap: 14px; padding: 7px 9px; border: 1px solid rgba(208,225,235,.12); border-radius: 7px; background: rgba(7,14,21,.48); backdrop-filter: blur(10px); }
.legend span { display: flex; align-items: center; gap: 6px; color: #b6c3cb; font-size: 8px; letter-spacing: .08em; font-weight: 700; }
.legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend-sand { background: var(--sand); box-shadow: 0 0 7px var(--sand); }
.legend-wave { background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.legend-wind { background: #91c7d3; }
.orbit-hint { color: #9caeb9; font-size: 8px; letter-spacing: .1em; text-shadow: 0 1px 8px #111; }
.mouse-glyph { color: var(--cyan); font-size: 14px; margin-right: 4px; vertical-align: -1px; }
.hint-divider { padding: 0 6px; color: #526573; }
.annotation { position: absolute; z-index: 2; pointer-events: none; display: flex; align-items: center; gap: 6px; color: rgba(227,239,245,.72); font-size: 8px; font-weight: 750; letter-spacing: .14em; text-shadow: 0 1px 8px #111; }
.annotation-line { width: 24px; height: 1px; background: rgba(223,190,147,.75); }
.annotation-wind { top: 43%; left: 10%; }
.annotation-crest { top: 29%; left: 46%; }
.annotation-slip { top: 48%; left: 64%; }
.annotation-wave { top: 24%; right: 8%; color: #9deafa; }
.wave-symbol { font-size: 20px; letter-spacing: -5px; color: var(--cyan); margin-right: 6px; }
.webgl-fallback { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; background: linear-gradient(140deg, rgba(13,26,37,.92), rgba(38,34,31,.92)); }
.webgl-fallback[hidden] { display: none; }
.fallback-card { max-width: 320px; text-align: center; padding: 24px; color: #dce8ed; }
.fallback-icon { font-size: 32px; color: var(--cyan); margin-bottom: 10px; }
.fallback-card strong { font-size: 15px; }
.fallback-card p { color: #9cafba; line-height: 1.6; font-size: 11px; }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 10px 12px 9px; background: linear-gradient(145deg, rgba(20,32,44,.95), rgba(14,24,34,.95)); border: 1px solid var(--line); border-radius: 9px; }
.readout-label { display: flex; align-items: center; gap: 6px; color: #8fa2b0; font-size: 8px; letter-spacing: .1em; font-weight: 750; white-space: nowrap; }
.readout-dot { width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto; }
.readout-dot.amber { background: var(--amber); box-shadow: 0 0 8px rgba(240,181,107,.5); }
.readout-dot.cyan { background: var(--cyan); box-shadow: 0 0 8px rgba(100,212,231,.5); }
.readout-dot.sand { background: var(--sand); }
.readout-dot.violet { background: var(--violet); }
.readout-class { color: #667c8c; font-size: 7px; letter-spacing: .08em; margin-left: auto; }
.readout-class.textbook { color: #69c9dc; }
.readout-value { margin-top: 6px; display: flex; align-items: baseline; gap: 5px; font-size: 23px; line-height: 1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.readout-value small { color: #91a4b1; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.readout-foot { margin-top: 6px; color: #738795; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport-bar { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; background: #101a25; border: 1px solid var(--line); border-radius: 9px; }
.transport-left { display: flex; align-items: center; gap: 6px; }
.transport-button { width: 29px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(167,191,207,.16); border-radius: 6px; background: rgba(255,255,255,.025); color: #a9bbc7; cursor: pointer; font-size: 14px; }
.transport-button:hover { border-color: rgba(100,212,231,.45); color: var(--cyan); }
.play-button { width: auto; padding: 0 9px; display: flex; gap: 7px; color: #bcebd5; border-color: rgba(124,224,177,.25); font-size: 10px; }
.play-button.is-paused { color: var(--green); }
.transport-divider { height: 19px; width: 1px; background: var(--line); margin: 0 7px; }
.time-label, .speed-control label { color: #728797; font-size: 8px; letter-spacing: .11em; font-weight: 750; }
.time-value { font-size: 11px; font-variant-numeric: tabular-nums; color: #d8e4e9; margin-left: 2px; }
.speed-control { display: flex; align-items: center; gap: 9px; }
.speed-control input { width: 90px; }
.speed-control strong { font-size: 10px; color: #b5c9d2; min-width: 34px; }
.transport-status { display: flex; align-items: center; gap: 7px; color: #8eaa9e; font-size: 8px; letter-spacing: .12em; font-weight: 750; }
.status-pulse { width: 5px; height: 5px; }
.control-panel { min-height: 0; max-height: calc(100vh - 101px); overflow-y: auto; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(17,28,39,.97), rgba(12,21,31,.99)); padding: 19px 17px 12px; scrollbar-width: thin; scrollbar-color: #354957 transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 17px; }
.panel-eyebrow { font-size: 8px; color: #7f97a8; }
h2 { margin: 5px 0 0; font-size: 20px; letter-spacing: -.04em; font-weight: 620; }
.panel-index { color: #9aabba; font-size: 10px; font-variant-numeric: tabular-nums; padding-top: 6px; }
.panel-index span { color: #4c6272; margin: 0 3px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #9aafbd; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.section-note { color: #607687; font-size: 7px; font-weight: 650; }
.preset-section, .parameter-section, .environment-section { padding-bottom: 15px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-card { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 44px; padding: 6px 9px; border: 1px solid rgba(155,184,201,.12); border-radius: 8px; background: rgba(255,255,255,.018); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-card:hover { background: rgba(255,255,255,.045); border-color: rgba(155,184,201,.28); }
.preset-card.active { border-color: rgba(228,185,125,.55); background: linear-gradient(90deg, rgba(228,185,125,.12), rgba(228,185,125,.025)); box-shadow: inset 2px 0 #dcb37e; }
.preset-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.045); font-size: 17px; }
.quiet-icon { color: #91a3af; }
.singing-icon { color: var(--sand); }
.booming-icon { color: var(--cyan); font-size: 13px; letter-spacing: -3px; }
.preset-card strong { display: block; font-size: 10px; font-weight: 700; color: #dce6eb; }
.preset-card small { display: block; margin-top: 2px; color: #7f93a1; font-size: 8px; }
.parameter-section { padding-bottom: 4px; }
.control-row { margin-bottom: 14px; }
.control-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.control-meta label { color: #c4d0d8; font-size: 10px; font-weight: 550; }
.control-meta output { color: #e2bd89; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 4px; margin: 0; appearance: none; -webkit-appearance: none; border-radius: 99px; background: linear-gradient(90deg, #bd9768, #4b6474); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #e4bd88; border: 2px solid #17232e; box-shadow: 0 0 0 1px rgba(228,189,136,.55), 0 1px 5px rgba(0,0,0,.4); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #e4bd88; border: 2px solid #17232e; box-shadow: 0 0 0 1px rgba(228,189,136,.55); }
.range-ends { display: flex; justify-content: space-between; margin-top: 7px; color: #5e7382; font-size: 7px; letter-spacing: .06em; }
.compact-control { margin-bottom: 0; }
.science-section { border: 1px solid rgba(100,212,231,.15); border-radius: 9px; background: rgba(100,212,231,.025); overflow: hidden; }
.science-toggle { width: 100%; padding: 10px; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; cursor: pointer; text-align: left; }
.science-toggle-left { display: flex; align-items: center; gap: 9px; }
.science-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: var(--cyan); background: rgba(100,212,231,.1); font-size: 16px; }
.science-toggle strong { display: block; color: #d7e5eb; font-size: 10px; }
.science-toggle small { display: block; margin-top: 2px; color: #718795; font-size: 8px; }
.chevron { color: #85a0ad; font-size: 18px; transition: transform .2s ease; }
.science-toggle.expanded .chevron { transform: rotate(180deg); }
.science-content { padding: 0 10px 11px; }
.science-block { padding: 9px 0; border-top: 1px solid rgba(165,194,213,.1); }
.science-kicker { color: #74bccc; font-size: 7px; letter-spacing: .13em; font-weight: 800; }
.equation { color: #e4c493; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; margin: 7px 0 5px; }
.science-block p, .science-note p { color: #8499a6; font-size: 8px; line-height: 1.55; margin: 0; }
.science-note { margin-top: 4px; padding: 9px; border-radius: 7px; background: rgba(240,181,107,.06); border: 1px solid rgba(240,181,107,.12); }
.science-note strong { color: #d9b27f; font-size: 7px; letter-spacing: .12em; }
.science-note p { margin-top: 5px; }
.validation-box { margin-top: 9px; padding: 9px; border: 1px solid rgba(100,212,231,.17); border-radius: 7px; background: rgba(100,212,231,.045); }
.validation-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; color: #92a9b5; font-size: 7px; font-weight: 800; letter-spacing: .11em; }
.validation-status { color: #6fc9d8; }
.validation-line { display: flex; justify-content: space-between; padding: 3px 0; color: #8196a3; font-size: 8px; }
.validation-line strong { color: #d7e8ed; font-variant-numeric: tabular-nums; }
.panel-foot { display: flex; gap: 7px; align-items: flex-start; margin-top: 12px; color: #647987; font-size: 7px; line-height: 1.5; }
.foot-mark { display: inline-grid; place-items: center; width: 13px; height: 13px; border: 1px solid #607887; border-radius: 50%; color: #9ab0bd; font-size: 8px; flex: 0 0 auto; }
.footer { min-height: 24px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #526777; font-size: 7px; letter-spacing: .12em; font-weight: 750; }
.footer i { color: #b68e60; font-style: normal; margin: 0 4px; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 380px; }
  .stage-column { padding: 18px 18px 12px 22px; }
  .control-panel { padding: 23px 20px 14px; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preset-card { flex-direction: column; align-items: flex-start; min-height: 82px; gap: 5px; }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  .stage-column { padding-left: 12px; }
  .control-panel { padding-left: 13px; padding-right: 13px; }
  .readout-label { font-size: 7px; }
  .readout-class { display: none; }
  .annotation { font-size: 7px; }
}
@media (max-width: 820px) {
  .topbar { min-height: 60px; padding: 0 13px; }
  .brand-mark { width: 30px; height: 30px; }
  h1 { font-size: 13px; }
  .live-pill { display: none; }
  .top-actions { gap: 5px; }
  .icon-button { padding: 0 8px; }
  .button-text { display: none; }
  .primary-button { padding: 0 9px; font-size: 10px; }
  .workspace { display: flex; flex-direction: column; }
  .stage-column { padding: 10px 10px 9px; }
  .stage { flex: none; height: min(53vw, 430px); min-height: 290px; }
  .readout-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout-card { padding: 9px 11px; }
  .readout-value { font-size: 21px; }
  .control-panel { max-height: none; overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 17px 15px 15px; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preset-card { min-height: 82px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
  .preset-card small { font-size: 7px; }
  .parameter-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  .parameter-section .section-heading { grid-column: 1 / -1; }
  .environment-section { max-width: 480px; }
  .science-section { margin-top: 5px; }
  .footer { min-height: 27px; padding: 0 12px; }
  .footer span:last-child { display: none; }
}
@media (max-width: 480px) {
  .topbar { min-height: 56px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 27px; height: 27px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 11px; }
  .title-divider, h1 span:last-child { display: none; }
  .top-actions { gap: 4px; }
  .icon-button, .primary-button { height: 31px; }
  .primary-button { font-size: 9px; }
  .stage-column { padding: 8px 8px 8px; gap: 7px; }
  .stage { height: 48vh; min-height: 310px; max-height: 390px; }
  .stage-topline { top: 10px; left: 10px; right: 10px; }
  .scene-tag { font-size: 7px; padding: 6px 7px; }
  .scene-coordinates { font-size: 7px; }
  .scene-coordinates strong { display: block; margin: 3px 0 0; }
  .stage-bottom { left: 9px; right: 9px; bottom: 9px; }
  .legend { gap: 8px; padding: 6px 7px; }
  .legend span { font-size: 6px; gap: 4px; }
  .orbit-hint { display: none; }
  .annotation { font-size: 6px; }
  .annotation-wind { left: 5%; top: 48%; }
  .annotation-crest { top: 31%; left: 44%; }
  .annotation-slip { top: 53%; left: 63%; }
  .annotation-wave { right: 5%; top: 25%; }
  .annotation-line { width: 13px; }
  .readout-strip { gap: 6px; }
  .readout-card { padding: 8px 9px; }
  .readout-label { font-size: 6px; letter-spacing: .07em; }
  .readout-value { font-size: 20px; }
  .readout-value small { font-size: 8px; }
  .readout-foot { font-size: 7px; }
  .transport-bar { height: 44px; padding: 0 7px; }
  .transport-left { gap: 4px; }
  .transport-button { width: 26px; height: 26px; }
  .play-button { padding: 0 7px; }
  .time-label { display: none; }
  .speed-control { gap: 5px; }
  .speed-control label { font-size: 7px; }
  .speed-control input { width: 58px; }
  .speed-control strong { font-size: 9px; min-width: 30px; }
  .transport-status { display: none; }
  .control-panel { padding: 15px 12px; }
  h2 { font-size: 18px; }
  .preset-card { padding: 6px; }
  .preset-card strong { font-size: 9px; }
  .preset-card small { font-size: 6px; }
  .preset-icon { width: 24px; height: 24px; }
  .parameter-section { column-gap: 12px; }
  .control-meta label, .control-meta output { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .footer { font-size: 6px; }
}
@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, body.embed-mode .app-shell { min-height: 100vh; height: 100vh; }
body.embed-mode .topbar, body.embed-mode .footer { display: none; }
body.embed-mode .workspace { min-height: 0; height: 100vh; }
body.embed-mode .stage-column { padding: 8px; }
body.embed-mode .control-panel { max-height: 100vh; }
@media (max-width: 820px) {
  body.embed-mode .workspace { height: auto; min-height: 100vh; }
  body.embed-mode .stage { height: 48vh; }
  body.embed-mode .control-panel { max-height: none; }
}
