:root {
  color-scheme: dark;
  --bg: #080e12;
  --panel: #0d151a;
  --panel-2: #101a20;
  --line: rgba(171, 194, 199, .13);
  --line-strong: rgba(171, 194, 199, .22);
  --text: #e8eeec;
  --muted: #8a9a9d;
  --faint: #5b6c71;
  --gold: #e9bb32;
  --gold-bright: #f7d75b;
  --mint: #86c7b5;
  --ember: #e58b51;
  --font: 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); font-family: var(--font); }
body { min-height: 100vh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 55% 0%, rgba(34, 58, 62, .19), transparent 44%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8, 14, 18, .95); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(233,187,50,.42); border-radius: 9px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 6px; transform: rotate(-7deg); background: linear-gradient(145deg, rgba(233,187,50,.16), rgba(233,187,50,.025)); }
.brand-mark span { display: block; width: 4px; border-radius: 3px 3px 1px 1px; background: var(--gold); transform: skew(-13deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .6; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .8; }
.eyebrow { color: #87989b; font-size: 9px; letter-spacing: .17em; font-weight: 700; line-height: 1.3; }
.eyebrow span { color: #536267; padding: 0 3px; }
.brand-title { margin-top: 3px; font-size: 15px; font-weight: 650; letter-spacing: -.025em; white-space: nowrap; }
.brand-subtitle { margin-left: 6px; color: #8c9b9c; font-weight: 450; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.live-indicator { display: flex; align-items: center; gap: 8px; font-size: 9px; font-weight: 700; letter-spacing: .13em; color: #9db7ae; }
.live-indicator i, .chip-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #79c8a8; box-shadow: 0 0 11px rgba(121,200,168,.7); }
.topbar-seed { color: #718185; font-size: 9px; letter-spacing: .12em; }
.topbar-seed strong { color: #d5dfdc; font-size: 10px; margin-left: 5px; }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 258px minmax(360px, 1fr) 292px; gap: 10px; padding: 10px; }
.panel { background: linear-gradient(180deg, rgba(15,24,29,.98), rgba(11,18,22,.98)); border: 1px solid var(--line); border-radius: 11px; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #314047 transparent; }
.controls-panel { padding: 19px 16px 15px; }
.data-panel { padding: 19px 15px 13px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.panel-heading h2 { font-size: 15px; margin: 5px 0 0; font-weight: 620; letter-spacing: -.025em; }
.panel-index { color: #627479; font-size: 9px; font-weight: 700; letter-spacing: .12em; border: 1px solid var(--line); border-radius: 5px; padding: 5px 6px; }
.preset-block { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.section-label { color: #75878b; font-size: 8px; letter-spacing: .15em; font-weight: 750; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 9px; }
.preset-button { border: 1px solid rgba(171,194,199,.12); background: rgba(255,255,255,.018); color: #98a6a7; border-radius: 6px; padding: 7px 4px 6px; min-height: 47px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 9px; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.preset-button:hover { border-color: rgba(233,187,50,.38); color: #e4e9e5; }
.preset-button.active { background: rgba(233,187,50,.085); border-color: rgba(233,187,50,.42); color: #f1d777; }
.preset-swatch { display: block; width: 16px; height: 4px; border-radius: 8px; background: #8db6aa; }
.preset-swatch.frost { background: #b5d6d2; }
.preset-swatch.active-swatch { background: #e8bf3b; }
.preset-swatch.swept { background: #df8755; }
.control-group { padding: 10px 0 9px; border-bottom: 1px solid rgba(171,194,199,.075); }
.control-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-title label { color: #c7d0ce; font-size: 10px; font-weight: 560; }
.control-title output { color: #e7c65e; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
input[type="range"] { appearance: none; width: 100%; height: 3px; border-radius: 8px; background: linear-gradient(90deg, #b89a3a 0%, #b89a3a 50%, #2b3a3f 50%, #2b3a3f 100%); margin: 12px 0 6px; cursor: pointer; outline: none; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #e6c354; border: 2px solid #151c1d; box-shadow: 0 0 0 1px rgba(233,187,50,.6), 0 0 8px rgba(233,187,50,.22); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #e6c354; border: 2px solid #151c1d; box-shadow: 0 0 0 1px rgba(233,187,50,.6); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(233,187,50,.26); }
.range-ends { display: flex; justify-content: space-between; color: #5f7074; font-size: 8px; letter-spacing: .02em; }
.speed-control { border-bottom: 0; padding-bottom: 5px; }
.control-footnote { display: flex; align-items: center; gap: 7px; color: #738388; font-size: 8px; margin-top: 11px; letter-spacing: .025em; }
.tiny-dot { width: 5px; height: 5px; border-radius: 50%; background: #83b9aa; }
.stage-wrap { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0; position: relative; }
.stage-topline { height: 31px; flex: 0 0 31px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 8px; }
.stage-chip { display: flex; align-items: center; gap: 7px; color: #b6c7c1; font-size: 8px; letter-spacing: .14em; font-weight: 700; }
.stage-meta { color: #617277; font-size: 8px; letter-spacing: .13em; }
.stage-meta span { padding: 0 5px; color: #a68b45; }
.stage { position: relative; flex: 1 1 auto; min-height: 200px; overflow: hidden; border: 1px solid rgba(171,194,199,.15); border-radius: 9px; background: radial-gradient(ellipse at 52% 46%, #202b2b, #0b1317 70%); }
.three-canvas { width: 100%; height: 100%; display: block; outline: none; }
.scene-annotations { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.scene-annotation { position: absolute; display: flex; align-items: center; gap: 6px; color: rgba(197,215,207,.82); font-size: 8px; font-weight: 750; letter-spacing: .14em; text-shadow: 0 2px 8px #000; white-space: nowrap; transform: translate(-50%, -50%); }
.scene-annotation .annotation-line { display: block; width: 19px; height: 1px; background: rgba(177,204,193,.75); }
.scene-annotation.gold { color: #e5c45d; }
.scene-annotation.gold .annotation-line { background: #d9b43f; }
.scene-annotation.pale { color: #c4d4d2; }
.scene-annotation.pale .annotation-line { background: #a8c1bd; }
.scene-loading { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; background: #0a1115; color: #90a09e; font-size: 9px; font-weight: 700; letter-spacing: .16em; transition: opacity .45s ease; }
.scene-loading.hidden { opacity: 0; pointer-events: none; }
.loader-ring { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(233,187,50,.18); border-top-color: #e6c04e; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.webgl-error { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 24px; text-align: center; background: rgba(7,13,16,.96); color: #d9e2df; }
.webgl-error strong { font-size: 14px; }
.webgl-error span { max-width: 340px; color: #8ea0a0; font-size: 11px; line-height: 1.55; }
.hidden { display: none !important; }
.stage-corner-note { position: absolute; left: 13px; bottom: 12px; color: rgba(166,183,180,.52); font-size: 8px; letter-spacing: .14em; pointer-events: none; }
.stage-corner-note span { padding: 0 4px; color: #b6973d; }
.stage-toolbar { flex: 0 0 47px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px 3px; }
.transport-controls, .stage-tools-right { display: flex; align-items: center; gap: 5px; }
.transport, .tool-button { border: 1px solid rgba(171,194,199,.15); border-radius: 6px; background: rgba(255,255,255,.025); color: #aab8b6; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 30px; padding: 0 10px; font-size: 9px; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.transport:hover, .tool-button:hover { color: #e8efeb; border-color: rgba(171,194,199,.32); background: rgba(255,255,255,.055); }
.transport.primary { background: rgba(233,187,50,.13); border-color: rgba(233,187,50,.36); color: #f0d46f; min-width: 77px; }
.transport.primary:hover { background: rgba(233,187,50,.2); }
.pause-icon { display: flex; gap: 3px; }
.pause-icon i { display: block; width: 2px; height: 10px; border-radius: 2px; background: currentColor; }
.play-icon { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; }
.step-icon { font-size: 12px; }
.reset-icon { font-size: 15px; line-height: 1; }
.tool-button { padding: 0 8px; }
.tool-icon { color: #d0b45b; font-size: 13px; line-height: 1; }
.stage-hint { height: 18px; flex: 0 0 18px; color: #66777a; font-size: 8px; text-align: center; letter-spacing: .025em; }
.stage-hint span { padding: 0 4px; color: #48595d; }
.mouse-glyph { color: #c0aa5d !important; font-size: 11px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-height: 81px; border: 1px solid rgba(171,194,199,.1); border-radius: 7px; padding: 10px 9px 8px; background: linear-gradient(145deg, rgba(255,255,255,.027), rgba(255,255,255,.008)); }
.readout-label { color: #788a8d; font-size: 7px; letter-spacing: .12em; font-weight: 750; white-space: nowrap; }
.readout-value { margin-top: 8px; font-size: 20px; line-height: 1; font-weight: 620; letter-spacing: -.045em; color: #e7d28b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: #92a3a0; font-size: 9px; font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.readout-note { margin-top: 7px; color: #5e7074; font-size: 6.5px; letter-spacing: .09em; white-space: nowrap; }
.elapsed-card { margin-top: 10px; padding: 10px 10px 9px; border: 1px solid rgba(171,194,199,.1); border-radius: 7px; background: rgba(255,255,255,.018); }
.elapsed-card > div:first-child { display: flex; justify-content: space-between; align-items: center; }
.elapsed-card strong { color: #d8e0db; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.elapsed-bar { height: 3px; border-radius: 6px; background: #263438; margin: 9px 0 7px; overflow: hidden; }
.elapsed-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #9e873e, #e7c654); box-shadow: 0 0 9px rgba(231,198,84,.4); transition: width .2s linear; }
.elapsed-meta { display: flex; justify-content: space-between; color: #627478; font-size: 7px; }
.validation-card { margin-top: 10px; border: 1px solid rgba(133,191,172,.17); border-radius: 7px; padding: 10px 10px 9px; background: linear-gradient(140deg, rgba(72,123,103,.09), rgba(255,255,255,.012)); }
.validation-top { display: flex; align-items: center; justify-content: space-between; }
.validation-badge { color: #91c8ae; border: 1px solid rgba(133,191,172,.26); border-radius: 4px; padding: 3px 5px; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.validation-card h3 { margin: 8px 0 9px; color: #d6e1db; font-size: 10px; font-weight: 620; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.validation-values div { display: flex; flex-direction: column; gap: 4px; }
.validation-values span { color: #6f8982; font-size: 7px; letter-spacing: .1em; }
.validation-values strong { color: #c4d8ca; font-size: 10px; font-variant-numeric: tabular-nums; }
.validation-diff { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(133,191,172,.13); margin-top: 8px; padding-top: 7px; color: #789087; font-size: 8px; }
.validation-diff strong { color: #a8d7bd; font-size: 10px; }
.validation-caption { margin-top: 7px; color: #71827e; font-size: 7.5px; line-height: 1.5; }
.science-panel { margin-top: 10px; border: 1px solid rgba(171,194,199,.11); border-radius: 7px; background: rgba(255,255,255,.014); }
.science-panel summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 10px; color: #c5d0cb; font-size: 10px; font-weight: 600; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:first-child { display: flex; align-items: center; gap: 7px; }
.science-icon { color: #e5c24f; font-size: 14px; }
.chevron { color: #788a8c; font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line); padding: 10px; }
.science-step { display: grid; grid-template-columns: 21px 1fr; gap: 7px; margin-bottom: 12px; }
.step-number { color: #c6a848; font-size: 8px; font-weight: 750; padding-top: 2px; }
.science-step strong { color: #c8d4ce; font-size: 9px; }
.science-step p { margin: 4px 0 5px; color: #81918f; font-size: 8px; line-height: 1.5; }
.science-step code { display: block; margin-top: 4px; padding: 5px 6px; border-radius: 4px; background: rgba(0,0,0,.24); color: #dfc66e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 7.5px; line-height: 1.5; overflow-wrap: anywhere; }
.constant-list { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; display: grid; gap: 7px; }
.constant-list div { display: flex; justify-content: space-between; gap: 8px; color: #82928f; font-size: 7px; }
.constant-list b { color: #bac9c2; font-size: 7px; text-align: right; font-weight: 550; }
.assumptions { margin-top: 9px; color: #81908d; font-size: 8px; line-height: 1.5; }
.assumptions strong { color: #c0cec7; font-size: 8px; }
.assumptions ul { margin: 5px 0 0; padding-left: 14px; }
.assumptions li { margin: 3px 0; }
.model-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #738387; font-size: 7px; margin-top: 10px; padding: 0 2px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; margin-left: 4px; }
.legend-dot:first-child { margin-left: 0; }
.legend-dot.yellow { background: #e5bb2d; box-shadow: 0 0 7px rgba(229,187,45,.4); }
.legend-dot.smoke { background: #a8c1bd; }
.legend-dot.ember { background: #d66c31; }
.footerbar { height: 28px; flex: 0 0 28px; display: flex; justify-content: space-between; align-items: center; padding: 0 19px; border-top: 1px solid var(--line); color: #5e6e71; font-size: 8px; }
.footer-right { letter-spacing: .13em; color: #627276; font-size: 7px; }
.footer-right b { color: #8b9b99; font-weight: 650; }
.footer-right i { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: #b49b49; vertical-align: middle; margin: 0 7px; }
button:focus-visible, summary:focus-visible { outline: 2px solid rgba(233,187,50,.72); outline-offset: 2px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 228px minmax(300px, 1fr) 258px; gap: 8px; padding: 8px; }
  .controls-panel { padding: 16px 13px; }
  .data-panel { padding: 16px 12px; }
  .readout-value { font-size: 18px; }
  .brand-subtitle { display: none; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .topbar { height: 58px; flex-basis: 58px; padding: 0 13px; }
  .topbar-right { gap: 10px; }
  .topbar-seed { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 9px; padding: 8px; }
  .stage-wrap { order: 0; height: min(58vh, 500px); min-height: 310px; }
  .controls-panel { order: 1; overflow: visible; }
  .data-panel { order: 2; overflow: visible; }
  .panel-heading { margin-bottom: 13px; }
  .controls-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .controls-panel .panel-heading, .controls-panel .preset-block, .controls-panel .control-footnote { grid-column: 1 / -1; }
  .controls-panel .panel-heading { margin-bottom: 3px; }
  .preset-block { margin-bottom: 4px; }
  .control-group { padding: 8px 0 7px; }
  .data-panel { padding-bottom: 16px; }
  .data-heading { margin-bottom: 12px; }
  .readout-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .readout-card { min-height: 77px; padding: 8px 7px; }
  .readout-label { font-size: 6.5px; white-space: normal; min-height: 15px; }
  .readout-value { font-size: 16px; }
  .readout-value small { font-size: 8px; }
  .readout-note { font-size: 6px; white-space: normal; }
  .footerbar { padding: 0 11px; font-size: 7px; }
}
@media (max-width: 520px) {
  .topbar { height: 54px; flex-basis: 54px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-title { font-size: 13px; }
  .eyebrow { font-size: 8px; }
  .live-indicator { font-size: 7px; gap: 6px; }
  .stage-wrap { height: 46vh; min-height: 300px; }
  .stage-topline { height: 26px; flex-basis: 26px; }
  .stage-meta { font-size: 7px; }
  .stage-toolbar { height: 44px; flex-basis: 44px; }
  .transport, .tool-button { height: 29px; padding: 0 7px; font-size: 8px; gap: 5px; }
  .transport.primary { min-width: 68px; }
  .tool-button { padding: 0 6px; }
  .stage-hint { font-size: 7px; }
  .scene-annotation { font-size: 6px; letter-spacing: .1em; }
  .scene-annotation .annotation-line { width: 11px; }
  .controls-panel { grid-template-columns: 1fr; padding: 15px 13px 13px; }
  .controls-panel .panel-heading, .controls-panel .preset-block, .controls-panel .control-footnote { grid-column: auto; }
  .preset-block { margin-bottom: 7px; }
  .control-group { padding: 8px 0 7px; }
  .control-title label, .control-title output { font-size: 10px; }
  .range-ends { font-size: 8px; }
  .readout-grid { grid-template-columns: 1fr 1fr; }
  .readout-card { min-height: 79px; padding: 9px; }
  .readout-label { font-size: 7px; min-height: 0; }
  .readout-value { font-size: 20px; }
  .readout-value small { font-size: 9px; }
  .readout-note { font-size: 6.5px; }
  .footerbar { height: auto; min-height: 31px; flex-basis: auto; gap: 8px; padding: 7px 10px; line-height: 1.35; }
  .footer-right { white-space: nowrap; }
}
@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 .workspace { padding: 0; gap: 0; grid-template-columns: 230px minmax(0,1fr) 260px; }
body.embed .panel { border-radius: 0; }
body.embed .stage-wrap { padding: 0 5px; }
@media (max-width: 820px) {
  body.embed .workspace { display: flex; }
  body.embed .stage-wrap { padding: 0; }
}
