:root {
  color-scheme: dark;
  --bg: #080e14;
  --panel: #111a23;
  --panel-2: #141f29;
  --line: rgba(171, 190, 203, .13);
  --line-strong: rgba(171, 190, 203, .22);
  --text: #e9edf0;
  --muted: #91a0aa;
  --soft: #687984;
  --sand: #d9b47d;
  --sand-bright: #f0d2a1;
  --cyan: #79c9c1;
  --green: #82c4a0;
  --radius: 13px;
  --gap: 12px;
  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; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; background: radial-gradient(ellipse at 38% -20%, rgba(35, 63, 76, .28), transparent 44%), var(--bg); }
.topbar { height: 58px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7, 13, 19, .84); }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 27px; height: 27px; position: relative; display: flex; align-items: end; gap: 2px; padding: 4px 3px; border: 1px solid rgba(217,180,125,.45); border-radius: 7px; transform: skewY(-8deg); }
.brand-mark span { display: block; width: 5px; border-radius: 4px 4px 1px 1px; background: var(--sand); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .62; }
.brand-mark span:nth-child(2) { height: 14px; opacity: .88; }
.brand-mark span:nth-child(3) { height: 10px; }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #e4e8eb; }
.brand-name span { color: #8b9aa4; font-weight: 500; }
.brand-sub { margin-top: 3px; font-size: 8px; letter-spacing: .18em; color: #70808a; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.live-indicator, .seed-chip { font-size: 9px; letter-spacing: .12em; color: #9aabb3; }
.live-indicator { display: flex; align-items: center; gap: 7px; }
.live-indicator i, .app-footer i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #78c49d; box-shadow: 0 0 9px rgba(120,196,157,.6); }
.seed-chip { border: 1px solid var(--line); padding: 6px 9px; border-radius: 5px; color: #82919a; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 358px; gap: 16px; max-width: 1720px; margin: 0 auto; padding: 18px 22px 14px; align-items: start; }
.stage-column { min-width: 0; }
.stage-heading { display: flex; justify-content: space-between; align-items: end; padding: 0 2px 13px; gap: 12px; }
.eyebrow { font-size: 9px; letter-spacing: .16em; color: #8c9ba5; font-weight: 700; }
.eyebrow span { color: #bd9866; padding: 0 3px; }
h1 { margin: 5px 0 3px; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.12; font-weight: 650; letter-spacing: -.035em; }
.subtitle { margin: 0; color: #9aa8b0; font-size: 12px; line-height: 1.4; }
.stage-heading-badge { flex: 0 0 auto; border: 1px solid rgba(217,180,125,.24); color: #c9b18e; padding: 7px 9px; border-radius: 6px; font-size: 8px; letter-spacing: .13em; }
.stage-heading-badge span { display: inline-grid; place-items: center; width: 20px; height: 17px; margin-right: 5px; background: rgba(217,180,125,.13); border-radius: 3px; font-size: 9px; font-weight: 800; }
.viewport-shell { height: min(61vh, 610px); min-height: 430px; position: relative; overflow: hidden; border: 1px solid rgba(169,188,201,.16); border-radius: 14px; background: linear-gradient(155deg, #182733, #0d171f 72%); box-shadow: 0 22px 70px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.035); }
#sceneCanvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(6,13,19,.35), transparent 23%, transparent 75%, rgba(6,13,19,.38)), linear-gradient(90deg, rgba(6,13,19,.15), transparent 24%, transparent 82%, rgba(6,13,19,.15)); }
.scene-topline, .scene-bottomline { position: absolute; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-topline { top: 14px; }
.scene-bottomline { bottom: 13px; }
.scene-tag { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 5px; background: rgba(9,17,24,.64); border: 1px solid rgba(255,255,255,.09); font-size: 8px; letter-spacing: .14em; color: #bdc9cf; backdrop-filter: blur(10px); }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #d8b77f; box-shadow: 0 0 8px rgba(216,183,127,.65); }
.scene-coordinates { font-size: 8px; letter-spacing: .1em; color: rgba(220,228,231,.72); text-shadow: 0 1px 4px #000; }
.scene-coordinates span { padding: 0 4px; color: #c4a16e; }
.annotation { position: absolute; display: flex; align-items: center; gap: 7px; font-size: 8px; letter-spacing: .13em; color: rgba(241,229,207,.84); text-shadow: 0 1px 5px #000; pointer-events: none; }
.annotation-line { display: block; width: 23px; height: 1px; background: rgba(233,202,154,.7); }
.annotation-small { left: 17%; top: 53%; }
.annotation-large { left: 57%; top: 34%; }
.wind-label { position: absolute; right: 5.5%; bottom: 21%; display: flex; align-items: center; gap: 7px; color: rgba(185,220,215,.8); font-size: 8px; letter-spacing: .14em; text-shadow: 0 1px 5px #000; pointer-events: none; }
.wind-arrow { font-size: 22px; line-height: 1; color: #92c9bf; }
.scene-key { display: flex; align-items: center; gap: 7px; color: rgba(205,215,219,.75); font-size: 7px; letter-spacing: .1em; text-shadow: 0 1px 5px #000; }
.key-swatch { width: 8px; height: 8px; display: inline-block; border-radius: 2px; margin-left: 4px; }
.key-swatch.crest { background: #e6c58c; }
.key-swatch.slip { background: #92714e; }
.scene-time { padding: 6px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 4px; background: rgba(8,15,20,.55); color: #d6c19c; font-size: 8px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.webgl-message { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 32px; background: rgba(5,11,16,.9); text-align: center; }
.webgl-message[hidden] { display: none; }
.webgl-message strong { font-size: 15px; }
.webgl-message span { max-width: 360px; font-size: 12px; color: #aab6bd; line-height: 1.5; }
.transport-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 53px; padding: 8px 11px; margin-top: 9px; background: #111a22; border: 1px solid var(--line); border-radius: 10px; }
.transport-left, .transport-right { display: flex; align-items: center; gap: 7px; min-width: 0; }
.primary-control, .icon-control, .text-control { border: 1px solid var(--line-strong); background: #19252e; border-radius: 6px; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.primary-control:hover, .icon-control:hover, .text-control:hover { background: #243540; border-color: rgba(202,220,229,.34); }
.primary-control:active, .icon-control:active, .text-control:active { transform: translateY(1px); }
.primary-control { height: 34px; min-width: 88px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #c59d68; border-color: #d4b17f; color: #151a1d; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.primary-control:hover { background: #d8b47e; }
.play-icon { font-size: 10px; }
.icon-control { height: 34px; width: 34px; font-size: 15px; color: #b8c4c9; }
.transport-divider { height: 25px; width: 1px; background: var(--line-strong); margin: 0 5px; }
.speed-control { display: flex; align-items: center; gap: 8px; color: #8f9ea7; font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.speed-control input { width: 88px; }
.speed-control output { min-width: 34px; color: #d3c19f; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.text-control { padding: 8px 9px; color: #aab8bf; font-size: 8px; letter-spacing: .1em; white-space: nowrap; }
.text-control span { color: #d0b183; margin-right: 4px; font-size: 12px; }
.stage-footnote { display: flex; align-items: center; gap: 7px; padding: 9px 3px 0; color: #73838d; font-size: 8px; letter-spacing: .035em; }
.footnote-dot { width: 5px; height: 5px; border-radius: 50%; background: #83b9ad; }
.stage-footnote-spacer { flex: 1; }
.stage-footnote > span:last-child { font-size: 7px; letter-spacing: .13em; }
.side-panel { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #31424d transparent; }
.panel-card { background: linear-gradient(150deg, rgba(20,31,41,.97), rgba(14,23,31,.98)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 8px 25px rgba(0,0,0,.13); }
.panel-title-row { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 12px; }
.panel-title-row h2 { margin: 4px 0 0; font-size: 15px; font-weight: 620; letter-spacing: -.02em; }
.panel-index { font-size: 9px; color: #667782; letter-spacing: .12em; }
.preset-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-bottom: 16px; }
.preset-button { border: 1px solid var(--line); border-radius: 5px; padding: 8px 4px; background: #0e171f; color: #81919b; font-size: 8px; font-weight: 750; letter-spacing: .1em; cursor: pointer; transition: .18s; }
.preset-button:hover { border-color: rgba(217,180,125,.45); color: #d4c2a5; }
.preset-button.active { border-color: rgba(217,180,125,.58); background: rgba(197,157,104,.12); color: #e0c397; }
.control-group { margin-bottom: 13px; }
.control-group.compact-group { margin-bottom: 11px; }
.control-group.last-control { margin-bottom: 0; }
.control-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.control-label label { color: #c5cfd3; font-size: 10px; }
.control-label output { color: #d8bb8e; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.symbol { color: #d6b67f; font-family: Georgia, serif; font-style: italic; }
input[type="range"] { appearance: none; width: 100%; height: 4px; margin: 0; border-radius: 8px; background: linear-gradient(90deg, #b99261 0%, #b99261 50%, #33434d 50%, #33434d 100%); outline: none; cursor: pointer; accent-color: #c59d68; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #e2c18d; border: 2px solid #3d3328; box-shadow: 0 0 0 2px rgba(226,193,141,.15); }
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: #e2c18d; border: 2px solid #3d3328; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(121,201,193,.3); }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #687984; font-size: 8px; font-variant-numeric: tabular-nums; }
.readout-card { padding-bottom: 12px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout { min-width: 0; padding: 9px 9px 8px; border: 1px solid rgba(173,191,202,.1); border-radius: 7px; background: rgba(8,15,21,.36); }
.readout-label { display: block; color: #7e8e98; font-size: 7px; letter-spacing: .12em; white-space: nowrap; }
.readout-label em { color: #d5b17d; font-family: Georgia, serif; font-size: 9px; }
.readout strong { display: block; margin-top: 5px; color: #e2e8e9; font-size: 19px; line-height: 1.05; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout strong small { font-size: 9px; color: #9eabb1; font-weight: 500; letter-spacing: 0; }
.readout-note { display: block; margin-top: 5px; color: #657681; font-size: 6px; letter-spacing: .1em; }
.validation-card { border-color: rgba(130,196,160,.2); }
.validation-card .panel-title-row { margin-bottom: 8px; }
.validation-type { border: 1px solid rgba(130,196,160,.24); color: #8cc5a3; padding: 5px 7px; border-radius: 4px; font-size: 7px; letter-spacing: .12em; }
.validation-name { font-size: 11px; font-weight: 650; color: #d8e2e1; }
.validation-copy { margin: 5px 0 10px; color: #87979f; font-size: 9px; line-height: 1.45; }
.validation-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.validation-values > div { padding: 7px 6px; background: rgba(8,15,21,.4); border: 1px solid rgba(173,191,202,.08); border-radius: 5px; min-width: 0; }
.validation-values span { display: block; color: #75868f; font-size: 6px; letter-spacing: .1em; white-space: nowrap; }
.validation-values strong { display: block; margin-top: 5px; color: #dce8df; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.validation-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: #8bbda0; font-size: 8px; }
.check-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: rgba(130,196,160,.13); font-size: 9px; }
.science-card { padding: 0; overflow: hidden; }
.science-card summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; list-style: none; cursor: pointer; }
.science-card summary::-webkit-details-marker { display: none; }
.science-card summary > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.science-card summary strong { font-size: 13px; font-weight: 620; }
.science-chevron { color: #b9a17d; font-size: 17px; transition: transform .2s; }
.science-card[open] .science-chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line); padding: 12px 14px 14px; }
.science-intro { margin: 0 0 12px; color: #a4b1b6; font-size: 9px; line-height: 1.55; }
.equation-block { padding: 9px 0; border-top: 1px solid rgba(171,190,203,.08); }
.equation-block > span, .science-meta > strong { color: #b79b70; font-size: 7px; letter-spacing: .13em; }
.equation-block code { display: block; margin: 6px 0 4px; color: #e0d2b8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; white-space: normal; }
.equation-block p, .science-meta p { margin: 0; color: #8999a1; font-size: 8px; line-height: 1.5; }
.science-meta { padding-top: 9px; margin-top: 8px; border-top: 1px solid rgba(171,190,203,.08); }
.science-meta p { margin-top: 5px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 24px 15px; color: #657681; font-size: 8px; letter-spacing: .025em; }
.app-footer > span:last-child { display: flex; align-items: center; gap: 7px; color: #72838d; font-size: 7px; letter-spacing: .12em; }
.app-footer i { width: 5px; height: 5px; }
button:focus-visible, summary:focus-visible { outline: 2px solid #8ccac1; outline-offset: 3px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0,1fr) 330px; padding-inline: 15px; gap: 12px; }
  .transport-bar { align-items: flex-start; flex-direction: column; }
  .transport-left, .transport-right { width: 100%; justify-content: space-between; }
  .transport-right { justify-content: flex-end; }
  .viewport-shell { min-height: 410px; }
}
@media (max-width: 850px) {
  .workspace { display: flex; flex-direction: column; padding: 14px 14px 8px; }
  .stage-column, .side-panel { width: 100%; }
  .side-panel { max-height: none; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .control-card { grid-row: span 2; }
  .viewport-shell { height: min(58vh, 540px); min-height: 360px; }
  .transport-bar { flex-direction: row; align-items: center; }
  .transport-left, .transport-right { width: auto; }
  .app-footer { padding-inline: 15px; }
}
@media (max-width: 560px) {
  .topbar { height: 50px; padding: 0 13px; }
  .brand-name { font-size: 9px; }
  .brand-sub { font-size: 7px; }
  .brand-mark { width: 24px; height: 24px; }
  .topbar-right { gap: 8px; }
  .live-indicator { font-size: 7px; }
  .seed-chip { padding: 5px 6px; font-size: 7px; }
  .workspace { padding: 12px 10px 6px; gap: 10px; }
  .stage-heading { align-items: flex-start; padding-bottom: 10px; }
  h1 { font-size: 22px; }
  .subtitle { max-width: 270px; font-size: 10px; }
  .stage-heading-badge { padding: 6px 7px; font-size: 7px; }
  .stage-heading-badge span { width: 17px; height: 15px; }
  .viewport-shell { height: 48vh; min-height: 340px; max-height: 430px; border-radius: 10px; }
  .scene-topline, .scene-bottomline { left: 9px; right: 9px; }
  .scene-topline { top: 9px; }
  .scene-tag { padding: 6px 7px; font-size: 7px; }
  .scene-coordinates { font-size: 7px; }
  .annotation { font-size: 6px; gap: 4px; }
  .annotation-line { width: 13px; }
  .annotation-small { left: 8%; top: 55%; }
  .annotation-large { left: 53%; top: 36%; }
  .wind-label { right: 4%; bottom: 23%; font-size: 6px; }
  .wind-arrow { font-size: 17px; }
  .scene-key { font-size: 6px; gap: 4px; }
  .scene-time { padding: 5px 6px; font-size: 7px; }
  .transport-bar { min-height: 48px; padding: 6px; gap: 5px; flex-wrap: wrap; }
  .transport-left { flex: 1 1 100%; gap: 5px; }
  .transport-right { flex: 1 1 100%; justify-content: flex-end; }
  .primary-control { min-width: 75px; height: 31px; padding-inline: 8px; font-size: 8px; }
  .icon-control { width: 31px; height: 31px; }
  .speed-control { margin-left: auto; gap: 5px; font-size: 7px; }
  .speed-control input { width: 75px; }
  .text-control { padding: 6px 7px; font-size: 7px; }
  .stage-footnote { flex-wrap: wrap; font-size: 7px; gap: 5px; }
  .stage-footnote > span:last-child { display: none; }
  .side-panel { display: flex; gap: 9px; }
  .panel-card { padding: 12px; border-radius: 10px; }
  .panel-title-row h2 { font-size: 14px; }
  .control-label label { font-size: 10px; }
  .readout strong { font-size: 18px; }
  .app-footer { flex-direction: column; align-items: flex-start; padding: 10px 11px 15px; font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.embed-mode .topbar, .embed-mode .stage-heading, .embed-mode .side-panel, .embed-mode .app-footer, .embed-mode .stage-footnote { display: none !important; }
.embed-mode .workspace { display: block; padding: 0; margin: 0; }
.embed-mode .viewport-shell { height: 100vh; min-height: 320px; border: 0; border-radius: 0; }
.embed-mode .transport-bar { position: absolute; z-index: 8; bottom: 12px; left: 12px; right: 12px; margin: 0; background: rgba(12,20,27,.86); backdrop-filter: blur(12px); }
.quality-switch { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #0e171f; }
.quality-switch > span { padding: 0 5px; color: #71818b; font-size: 7px; letter-spacing: .12em; }
.quality-option { border: 0; border-radius: 4px; padding: 6px 7px; background: transparent; color: #778892; font-size: 7px; letter-spacing: .1em; cursor: pointer; }
.quality-option.active { background: rgba(217,180,125,.16); color: #e0c397; }
@media (max-width: 1120px) { .quality-switch { margin-right: auto; } }
@media (max-width: 560px) { .quality-switch > span { display: none; } .quality-option { padding: 6px 5px; } }
