:root {
  color-scheme: dark;
  --bg: #11100e;
  --panel: #191714;
  --panel-2: #201d18;
  --line: rgba(226, 205, 171, .12);
  --line-strong: rgba(226, 205, 171, .22);
  --text: #eee6d9;
  --muted: #9a9184;
  --faint: #6f675d;
  --sand: #d4a66e;
  --sand-bright: #f0c58a;
  --amber: #e7a85d;
  --green: #92bd83;
  --red: #d88969;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--sand-bright); outline-offset: 3px; }
.app-shell { height: 100dvh; min-height: 600px; display: grid; grid-template-rows: 72px minmax(0, 1fr) 28px; background: radial-gradient(ellipse at 20% 0%, rgba(123, 84, 48, .13), transparent 40%), var(--bg); }
.topbar { display: grid; grid-template-columns: 205px minmax(0,1fr) 190px; align-items: center; gap: 20px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(17,16,14,.94); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 26px; height: 28px; display: flex; align-items: flex-end; gap: 3px; transform: skewY(-17deg); }
.brand-mark span { display: block; width: 6px; background: var(--sand); border-radius: 2px 2px 0 0; }
.brand-mark span:nth-child(1) { height: 13px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 22px; opacity: .82; }
.brand-mark span:nth-child(3) { height: 17px; }
.eyebrow, .title-kicker, .section-label, .metric-label, .stage-meta, .stage-caption, .footerbar, .brand-sub, .validation-top, .range-ends { font-family: var(--mono); letter-spacing: .11em; }
.eyebrow { color: #a69b8b; font-size: 9px; font-weight: 600; }
.eyebrow i, .footerbar i { color: var(--amber); font-style: normal; padding: 0 4px; }
.brand-sub { margin-top: 5px; color: #6f675d; font-size: 9px; letter-spacing: .18em; }
.brand-sub span { color: var(--sand); margin-left: 5px; }
.title-lockup { min-width: 0; }
.title-kicker { color: #a99c88; font-size: 8px; margin-bottom: 4px; }
.title-kicker span { color: var(--amber); padding: 0 4px; }
h1 { margin: 0; font-size: clamp(15px, 1.5vw, 19px); letter-spacing: .075em; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h1 span { color: var(--amber); font-weight: 400; padding: 0 4px; }
.top-actions { display: flex; justify-content: flex-end; gap: 8px; }
.icon-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.02); padding: 9px 11px; border-radius: 3px; color: var(--sand-bright); font-family: var(--mono); font-size: 13px; cursor: pointer; transition: background .2s, border-color .2s; }
.icon-button span { color: #b9ad9c; font-size: 8px; letter-spacing: .12em; margin-left: 5px; }
.icon-button:hover { background: rgba(212,166,110,.09); border-color: rgba(212,166,110,.45); }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 360px; grid-template-rows: minmax(0,1fr) 112px; }
.stage-panel { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: linear-gradient(180deg, #3a2d22 0%, #b1875d 55%, #5d4630 100%); border-right: 1px solid var(--line); }
.scene-host { position: absolute; inset: 0; overflow: hidden; }
.scene-host canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-meta { position: absolute; z-index: 2; top: 18px; display: flex; align-items: center; gap: 10px; color: rgba(247,231,207,.83); font-size: 8px; text-shadow: 0 1px 6px rgba(0,0,0,.55); pointer-events: none; }
.stage-meta-left { left: 20px; }
.stage-meta-right { right: 20px; }
.stage-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--sand-bright); opacity: .8; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--green); box-shadow: 0 0 9px rgba(146,189,131,.7); }
.stage-caption { position: absolute; z-index: 2; bottom: 14px; left: 20px; right: 20px; display: flex; justify-content: space-between; gap: 12px; color: rgba(249,234,212,.73); font-size: 7px; text-shadow: 0 1px 6px rgba(0,0,0,.65); pointer-events: none; }
.stage-caption i { color: var(--sand-bright); font-style: normal; padding: 0 4px; }
.annotation { position: absolute; z-index: 3; display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid rgba(255,232,200,.32); background: rgba(28,23,18,.55); color: #f5e5cd; backdrop-filter: blur(6px); font: 8px var(--mono); letter-spacing: .08em; pointer-events: none; opacity: .9; transition: opacity .2s; }
.annotation b { color: var(--sand-bright); font-size: 8px; }
#labelWind { left: 8%; top: 27%; }
#labelImpact { left: 16%; top: 65%; }
#labelFacet { right: 13%; top: 37%; }
.scene-loading, .scene-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(24,20,16,.25); color: #f4dfc2; font: 9px var(--mono); letter-spacing: .16em; z-index: 10; }
.scene-loading.hidden, .scene-error.hidden { display: none; }
.loader-ring { width: 28px; height: 28px; border: 1px solid rgba(255,228,195,.2); border-top-color: var(--sand-bright); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scene-error { background: rgba(15,13,11,.86); text-align: center; padding: 24px; }
.scene-error strong { font: 600 14px var(--sans); letter-spacing: 0; }
.scene-error span { max-width: 380px; line-height: 1.6; color: #c4b49f; letter-spacing: .02em; }
.control-panel { min-height: 0; overflow: auto; background: linear-gradient(180deg, #1b1915, #171512); padding: 20px 20px 14px; scrollbar-width: thin; scrollbar-color: #514537 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 19px; font-weight: 540; letter-spacing: -.025em; }
.status-pill { display: flex; align-items: center; gap: 7px; border: 1px solid rgba(146,189,131,.24); color: #a9c99c; padding: 5px 8px; border-radius: 2px; font: 8px var(--mono); letter-spacing: .12em; }
.status-pill .live-dot { width: 5px; height: 5px; }
.section-label { display: flex; justify-content: space-between; align-items: center; color: #a59a8b; font-size: 8px; font-weight: 600; padding-bottom: 9px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.section-label span { color: #655d53; font-size: 7px; }
.preset-section { margin-bottom: 18px; }
.preset-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.preset { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 8px 6px; background: #211e19; border: 1px solid var(--line); border-radius: 3px; text-align: left; cursor: pointer; transition: .18s; }
.preset:hover { border-color: rgba(212,166,110,.4); }
.preset.active { border-color: rgba(220,165,103,.65); background: rgba(212,166,110,.1); }
.preset-icon { color: var(--sand-bright); font-size: 17px; width: 18px; flex: 0 0 18px; text-align: center; }
.preset b { display: block; font-size: 9px; font-weight: 600; white-space: nowrap; }
.preset small { display: block; margin-top: 3px; font-size: 7px; color: var(--muted); white-space: nowrap; }
.parameter-section { margin-bottom: 17px; }
.control-row { margin: 0 0 14px; }
.control-row label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 10px; color: #d9d0c2; }
.control-row label small { color: #7d7468; font-size: 8px; margin-left: 3px; }
.control-row output { color: var(--sand-bright); font: 11px var(--mono); white-space: nowrap; }
.control-row output i { color: #958776; font-size: 8px; font-style: normal; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #d1a16a 0%, #d1a16a var(--range-progress, 50%), #51483d var(--range-progress, 50%), #51483d 100%); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #f0c58a; border: 2px solid #33281d; box-shadow: 0 0 0 1px rgba(240,197,138,.65); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #f0c58a; border: 2px solid #33281d; box-shadow: 0 0 0 1px rgba(240,197,138,.65); }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: #71695e; font-size: 7px; letter-spacing: .04em; }
.run-section { margin-bottom: 14px; }
.transport-row { display: flex; gap: 6px; align-items: center; }
.primary-button, .square-button, .export-button { border: 1px solid var(--line-strong); border-radius: 3px; background: #25211b; cursor: pointer; transition: background .18s, border-color .18s; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; height: 34px; background: #c78f52; color: #1b140e; border-color: #c78f52; font: 700 9px var(--mono); letter-spacing: .1em; }
.primary-button:hover { background: #e0aa6e; }
.play-symbol { font-size: 11px; }
.square-button { width: 34px; height: 34px; color: var(--sand-bright); font-size: 14px; }
.square-button:hover, .export-button:hover { background: rgba(212,166,110,.13); border-color: rgba(212,166,110,.45); }
.speed-select { height: 34px; display: flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; color: #8d8274; font: 7px var(--mono); letter-spacing: .1em; }
.speed-select select { width: 49px; color: var(--sand-bright); background: transparent; border: 0; outline: 0; font: 10px var(--mono); cursor: pointer; }
.speed-select option { background: #211e19; }
.utility-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.quality-toggle { display: flex; align-items: center; gap: 4px; color: #7d7468; font: 7px var(--mono); letter-spacing: .1em; }
.quality-toggle span { margin-right: 3px; }
.quality-choice { padding: 4px 6px; border: 1px solid transparent; background: transparent; color: #84796c; font: 7px var(--mono); cursor: pointer; }
.quality-choice.active { color: var(--sand-bright); border-color: rgba(212,166,110,.35); background: rgba(212,166,110,.08); }
.export-button { padding: 6px 9px; color: #d9c7af; font: 8px var(--mono); letter-spacing: .06em; }
.export-button span { color: var(--sand-bright); font-size: 12px; margin-right: 4px; }
.science-details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 12px; }
.science-details summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.science-details summary::-webkit-details-marker { display: none; }
.science-glyph { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(212,166,110,.3); color: var(--sand-bright); border-radius: 3px; font: 14px Georgia, serif; }
.science-details summary b { display: block; font-size: 10px; font-weight: 600; }
.science-details summary small { display: block; margin-top: 3px; color: #8b8174; font-size: 8px; }
.chevron { margin-left: auto; color: var(--sand); transition: transform .2s; }
.science-details[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 0 14px; }
.science-block { margin: 12px 0; }
.science-block h3 { margin: 0 0 7px; color: #c9bba8; font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.equation { padding: 9px 10px; border-left: 2px solid rgba(212,166,110,.55); background: rgba(255,255,255,.025); color: #f0c58a; font: 12px Georgia, serif; line-height: 1.7; }
.equation sub { font-size: 8px; }
.science-block p, .validation-card p, .model-caveat p { color: #94897b; font-size: 9px; line-height: 1.55; margin: 7px 0 0; }
.validation-card { padding: 11px; margin-top: 14px; background: #211f19; border: 1px solid rgba(146,189,131,.22); border-radius: 3px; }
.validation-top { display: flex; justify-content: space-between; color: #a6c39a; font-size: 7px; letter-spacing: .12em; }
.checkmark { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(146,189,131,.15); color: var(--green); font-size: 10px; }
.validation-card h3 { margin: 7px 0 10px; font-size: 11px; font-weight: 550; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.validation-values div { padding: 7px; background: rgba(0,0,0,.18); }
.validation-values small { display: block; color: #7f776b; font: 7px var(--mono); letter-spacing: .1em; }
.validation-values b { display: block; margin-top: 4px; color: #e5d7c4; font: 11px var(--mono); }
.validation-diff { display: flex; justify-content: space-between; margin-top: 8px; color: #9b9183; font-size: 8px; }
.validation-diff b { color: var(--green); font: 9px var(--mono); }
.validation-card a { color: var(--sand-bright); text-decoration: none; border-bottom: 1px solid rgba(240,197,138,.3); }
.model-caveat { margin-top: 13px; padding: 9px 10px; border: 1px solid rgba(216,137,105,.18); background: rgba(216,137,105,.035); }
.model-caveat b { color: #c78f79; font: 7px var(--mono); letter-spacing: .12em; }
.model-caveat p { margin-top: 5px; }
.disclaimer { margin: 11px 0 0; color: #6f675d; font-size: 8px; line-height: 1.5; }
.telemetry { grid-column: 1 / -1; display: grid; grid-template-columns: 128px minmax(0,1fr); align-items: center; gap: 14px; padding: 12px 20px; background: #171512; border-top: 1px solid var(--line); }
.telemetry-heading { display: flex; flex-direction: column; gap: 8px; }
.clock-readout { display: flex; align-items: center; gap: 6px; color: #80766a; font: 7px var(--mono); letter-spacing: .08em; white-space: nowrap; }
.clock-dot { width: 5px; height: 5px; background: var(--sand); border-radius: 50%; }
.clock-readout b { color: var(--sand-bright); font: 10px var(--mono); letter-spacing: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0; min-width: 0; }
.metric { padding: 0 14px; min-width: 0; border-left: 1px solid var(--line); }
.metric-label { display: flex; align-items: center; gap: 6px; color: #958a7b; font-size: 7px; letter-spacing: .08em; white-space: nowrap; }
.metric-label span { color: #71675a; font-size: 6px; }
.metric-value { margin-top: 6px; color: #f0dfc8; font: 20px var(--mono); letter-spacing: -.06em; white-space: nowrap; }
.metric-value small { color: #988b79; font: 8px var(--mono); letter-spacing: 0; }
.metric-foot { margin-top: 3px; color: #6e665b; font-size: 7px; white-space: nowrap; }
.footerbar { display: flex; justify-content: space-between; align-items: center; padding: 0 20px; color: #645c52; background: #11100e; font-size: 7px; letter-spacing: .12em; }
.footerbar span:last-child { text-align: right; }
@media (max-width: 1100px) and (min-width: 761px) {
  .workspace { grid-template-columns: minmax(0,1fr) 326px; }
  .control-panel { padding-left: 16px; padding-right: 16px; }
  .metric { padding: 0 8px; }
  .metric-label { font-size: 6px; }
  .metric-value { font-size: 17px; }
  .metric-foot { font-size: 6px; }
  .topbar { grid-template-columns: 170px minmax(0,1fr) 160px; padding: 0 16px; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100dvh; grid-template-rows: 60px auto 25px; }
  .topbar { grid-template-columns: 120px minmax(0,1fr) 70px; gap: 7px; padding: 0 12px; }
  .brand-mark { width: 20px; transform: scale(.8) skewY(-17deg); transform-origin: left center; }
  .brand-lockup { gap: 3px; }
  .brand-copy .eyebrow { font-size: 7px; white-space: nowrap; }
  .brand-sub { font-size: 7px; }
  .title-kicker { font-size: 6px; letter-spacing: .06em; }
  h1 { font-size: 12px; letter-spacing: .015em; white-space: normal; line-height: 1.2; }
  h1 span { padding: 0 1px; }
  .top-actions { gap: 4px; }
  .icon-button { padding: 7px 8px; font-size: 11px; }
  .icon-button span { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 0; }
  .stage-panel { height: min(48vh, 410px); min-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-meta { top: 11px; font-size: 6px; gap: 6px; }
  .stage-meta-left { left: 10px; }
  .stage-meta-right { right: 10px; }
  .stage-caption { left: 10px; right: 10px; bottom: 9px; font-size: 6px; }
  .stage-caption span:last-child { display: none; }
  .annotation { font-size: 6px; padding: 4px 5px; gap: 4px; }
  #labelWind { left: 5%; top: 24%; }
  #labelImpact { left: 6%; top: 72%; }
  #labelFacet { right: 5%; top: 38%; }
  .control-panel { overflow: visible; padding: 17px 15px 16px; }
  .panel-heading { margin-bottom: 14px; }
  .panel-heading h2 { font-size: 17px; }
  .preset-grid { gap: 5px; }
  .preset { padding: 8px 5px; gap: 4px; }
  .preset b { font-size: 8px; }
  .preset small { font-size: 6px; }
  .preset-icon { width: 14px; flex-basis: 14px; font-size: 14px; }
  .control-row { margin-bottom: 13px; }
  .control-row label { font-size: 10px; }
  .telemetry { display: block; padding: 13px 12px 15px; }
  .telemetry-heading { flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; }
  .metric { padding: 10px 9px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .metric:nth-child(odd) { border-left: 0; }
  .metric-label { font-size: 7px; white-space: normal; }
  .metric-value { font-size: 20px; margin-top: 4px; }
  .metric-foot { font-size: 7px; }
  .footerbar { padding: 0 10px; font-size: 6px; }
  .footerbar span:last-child { display: none; }
}
@media (max-width: 390px) {
  .topbar { grid-template-columns: 105px minmax(0,1fr) 58px; }
  .brand-copy .eyebrow { font-size: 6px; }
  h1 { font-size: 11px; }
  .icon-button { padding: 6px; }
  .preset b { font-size: 7px; }
  .preset small { font-size: 6px; }
  .metric-label { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body.embed .topbar, body.embed .footerbar { display: none; }
body.embed .app-shell { grid-template-rows: minmax(0,1fr); min-height: 0; height: 100dvh; }
body.embed .workspace { grid-template-rows: minmax(0,1fr) 96px; }
body.embed .control-panel { max-height: 100%; }
