:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #101621;
  --panel-2: #141c28;
  --line: rgba(174, 190, 211, .13);
  --muted: #8793a4;
  --soft: #b8c1cf;
  --text: #edf1f6;
  --orange: #ff8a42;
  --amber: #ffc36b;
  --red: #ff5d43;
  --cyan: #65c8d7;
  --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 { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 52% -20%, #17202e 0, #0b1019 44%, #080b12 76%); font-family: var(--sans); font-size: 13px; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #ffae67; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; color: #080b12; background: #ffc36b; border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { max-width: 1760px; min-height: 100vh; margin: 0 auto; padding: 0 26px 14px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 35px; height: 35px; border: 1px solid rgba(255, 147, 76, .45); border-radius: 50%; display: grid; place-items: center; position: relative; transform: rotate(-20deg); }
.brand-mark span { position: absolute; width: 18px; height: 18px; border: 1px solid #ff8a42; border-radius: 50%; transform: rotate(45deg) scaleX(.52); }
.brand-mark span:nth-child(2) { transform: rotate(105deg) scaleX(.52); opacity: .7; }
.brand-mark span:nth-child(3) { width: 4px; height: 4px; border: 0; background: #ffd18b; box-shadow: 0 0 10px #ff7d38; }
.eyebrow { color: #8e9bad; font: 700 9px/1.4 var(--mono); letter-spacing: .16em; }
.eyebrow span { color: #5e6a7b; }
h1 { margin: 3px 0 0; font-size: 21px; line-height: 1.1; letter-spacing: -.035em; font-weight: 650; }
h1 em { color: #ff9b58; font-style: normal; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 17px; color: var(--muted); font: 700 9px var(--mono); letter-spacing: .1em; }
.live-indicator { display: flex; align-items: center; gap: 8px; }
.live-indicator i, .tiny-dot, .regime-dot { width: 6px; height: 6px; border-radius: 50%; background: #667282; box-shadow: 0 0 0 3px rgba(120, 135, 155, .08); }
.live-indicator.running i { background: #65d69a; box-shadow: 0 0 0 3px rgba(101,214,154,.1), 0 0 10px rgba(101,214,154,.55); }
.topbar-divider, .transport-divider { width: 1px; height: 19px; background: var(--line); }
.seed-label strong { color: #d5dce6; font-weight: 600; }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); cursor: pointer; }
.info-glyph { display: inline-grid; place-items: center; width: 13px; height: 13px; border: 1px solid #93a2b5; border-radius: 50%; font: 600 9px Georgia, serif; }
.main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 18px; padding-top: 18px; align-items: start; }
.stage-column { min-width: 0; }
.scene-frame { position: relative; height: clamp(390px, 49vw, 590px); min-height: 380px; overflow: hidden; border: 1px solid rgba(174,190,211,.16); border-radius: 12px; background: #090e16; box-shadow: 0 24px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); }
.scene-host { position: absolute; inset: 0; z-index: 0; }
.scene-host canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(5,8,14,.54) 0%, transparent 22%, transparent 68%, rgba(5,8,14,.5) 100%), radial-gradient(ellipse at center, transparent 42%, rgba(3,6,10,.26) 100%); }
.scene-topline, .scene-bottomline { position: absolute; z-index: 2; left: 19px; right: 19px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-topline { top: 17px; }
.scene-kicker, .scene-scale, .scene-key, .scene-controls-hint { color: rgba(217,226,238,.75); font: 700 9px var(--mono); letter-spacing: .13em; text-shadow: 0 1px 5px #080b12; }
.scene-kicker { display: flex; align-items: center; gap: 8px; }
.tiny-dot { width: 5px; height: 5px; background: #ff9a51; box-shadow: 0 0 8px #ff6e2d; }
.scene-scale { color: rgba(193,205,220,.52); letter-spacing: .08em; }
.scene-scale span, .scene-controls-hint span { padding: 0 4px; color: #ff9650; }
.scene-bottomline { bottom: 16px; }
.scene-key { display: flex; align-items: center; gap: 7px; color: rgba(216,226,238,.7); font-size: 8px; }
.key-swatch { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-left: 7px; }
.key-swatch.hot { background: #ff8a3d; box-shadow: 0 0 7px #ff672d; }
.key-swatch.cold { background: #344450; border: 1px solid #78a3a9; }
.scene-controls-hint { color: rgba(193,205,220,.48); font-size: 8px; }
.scene-labels { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.scene-label { position: absolute; display: flex; align-items: center; gap: 7px; color: #f3c39b; font: 700 8px var(--mono); letter-spacing: .13em; white-space: nowrap; text-shadow: 0 1px 5px #090d14, 0 0 9px rgba(0,0,0,.8); transition: opacity .2s ease; }
.scene-label b { width: 5px; height: 5px; border-radius: 50%; background: #ff9852; box-shadow: 0 0 0 3px rgba(255,145,69,.14), 0 0 12px #ff7b38; }
.scene-label.hidden { opacity: 0; }
.webgl-fallback, .context-overlay { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; text-align: center; background: radial-gradient(ellipse, #22202a, #090e16 72%); }
.webgl-fallback[hidden], .context-overlay[hidden] { display: none; }
.fallback-icon { color: #ff9650; font-size: 40px; }
.webgl-fallback h2 { margin: 13px 0 5px; font-size: 18px; }
.webgl-fallback p, .context-overlay span { max-width: 350px; color: #9ba8b8; line-height: 1.6; }
.context-overlay { background: rgba(8,11,18,.92); gap: 8px; }
.context-overlay strong { color: #ffb06f; font-size: 15px; }
.transport-bar { min-height: 57px; margin-top: 10px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(16,22,33,.86); }
.transport-main, .transport-meta { display: flex; align-items: center; gap: 7px; }
.transport-button, .utility-button { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #aeb9c7; font: 700 9px var(--mono); letter-spacing: .08em; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.transport-button:hover, .utility-button:hover { background: rgba(255,255,255,.06); color: #fff; border-color: var(--line); }
.transport-button.primary { padding: 0 16px; color: #17100c; background: linear-gradient(135deg,#ffbd76,#ff8741); box-shadow: 0 4px 14px rgba(255,116,48,.16); }
.transport-button.primary:hover { background: #ffd09b; color: #17100c; }
.play-icon { font-size: 11px; }
.step-icon { font-size: 15px; }
.reset-icon { font-size: 16px; line-height: 1; }
.speed-control { display: flex; align-items: center; gap: 3px; color: #778598; font: 700 8px var(--mono); letter-spacing: .1em; }
.speed-control > span { margin-right: 4px; }
.speed-option { min-width: 28px; height: 25px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #8e9bac; font: 700 9px var(--mono); cursor: pointer; }
.speed-option.active { color: #ffd0a0; border-color: rgba(255,151,82,.3); background: rgba(255,137,64,.1); }
.utility-button { padding: 0 8px; font-size: 8px; }
.utility-button span { color: #ff9c5c; font-size: 14px; }
.readout-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin-top: 10px; }
.readout-card { min-height: 93px; padding: 12px 13px 10px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg,rgba(21,29,42,.94),rgba(13,18,27,.94)); }
.readout-card::before { content: ""; position: absolute; top: 0; left: 0; width: 28px; height: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.accent-orange { --accent: #ff914f; }.accent-amber { --accent: #ffc16c; }.accent-red { --accent: #ff6751; }.accent-cyan { --accent: #62c6d3; }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #8290a2; font: 700 8px var(--mono); letter-spacing: .08em; white-space: nowrap; }
.tag { padding: 2px 4px; border-radius: 3px; color: #9daab9; background: rgba(255,255,255,.055); font: 700 7px var(--mono); letter-spacing: .04em; }
.tag.scaled { color: #e9bb7e; background: rgba(255,184,99,.09); }.tag.illustrative { color: #e68f7f; background: rgba(255,103,81,.09); }
.readout-value { margin-top: 8px; color: #f2f4f8; font: 600 21px/1 var(--mono); letter-spacing: -.06em; }
.readout-value small { color: #aab5c4; font: 500 11px var(--sans); letter-spacing: 0; }
.readout-foot { margin-top: 6px; color: #667486; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.science-panel { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: rgba(15,21,31,.85); }
.science-toggle { width: 100%; min-height: 58px; padding: 9px 14px; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; text-align: left; cursor: pointer; }
.science-toggle-left { display: flex; align-items: center; gap: 11px; }
.science-icon { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(255,157,89,.25); border-radius: 7px; color: #ffab6b; background: rgba(255,137,64,.07); font: 600 17px Georgia,serif; }
.science-toggle b { display: block; color: #d9e0e9; font: 700 9px var(--mono); letter-spacing: .13em; }
.science-toggle small { display: block; margin-top: 4px; color: #78879a; font-size: 10px; }
.chevron { color: #8492a5; font-size: 18px; transition: transform .2s ease; }
.science-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 15px 15px; border-top: 1px solid var(--line); }
.science-content[hidden] { display: none; }
.science-columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; padding-top: 15px; }
.science-block h3 { margin: 0 0 9px; color: #f0b27f; font: 700 9px var(--mono); letter-spacing: .08em; }
.equation { margin: 8px 0; padding: 8px 9px; border-left: 2px solid rgba(255,149,78,.55); background: rgba(255,255,255,.025); color: #e2e9f2; font: 11px/1.7 var(--mono); }
.science-block p { margin: 7px 0; color: #9aa7b7; font-size: 10px; line-height: 1.6; }
.validation-row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.06); color: #8693a4; font-size: 10px; }
.validation-row b { color: #e1e7ef; font: 600 10px var(--mono); }
.validation-row .validation-good { color: #7bd3a1; }
.validation-note { margin-top: 9px; color: #748397; font-size: 9px; line-height: 1.5; }
.assumption-strip { margin-top: 13px; padding: 10px; display: flex; gap: 12px; border: 1px solid rgba(255,172,104,.13); border-radius: 6px; background: rgba(255,150,73,.035); color: #9ba8b7; font-size: 9px; line-height: 1.55; }
.assumption-strip b { flex: 0 0 auto; color: #f1b37e; font: 700 8px var(--mono); letter-spacing: .1em; }
.legal-line { margin: 11px 0 0; color: #667486; font-size: 9px; }
.control-panel { padding: 16px 15px 12px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(160deg,rgba(19,27,39,.98),rgba(13,18,27,.98)); box-shadow: 0 15px 50px rgba(0,0,0,.18); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.panel-heading h2 { margin: 4px 0 0; color: #edf1f6; font-size: 17px; font-weight: 620; letter-spacing: -.035em; }
.panel-index { padding: 5px 6px; border: 1px solid var(--line); border-radius: 4px; color: #8b98a8; font: 700 8px var(--mono); }
.section-caption { margin-bottom: 8px; color: #78869a; font: 700 8px var(--mono); letter-spacing: .13em; }
.preset-section { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.preset-list { display: grid; gap: 5px; }
.preset-button { width: 100%; min-height: 46px; padding: 6px 9px; display: flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 7px; background: rgba(255,255,255,.025); text-align: left; cursor: pointer; transition: .18s ease; }
.preset-button:hover { background: rgba(255,255,255,.055); }
.preset-button.active { border-color: rgba(255,151,82,.34); background: rgba(255,143,69,.075); }
.preset-mark { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #82909f; box-shadow: 0 0 0 3px rgba(130,144,159,.08); }
.quiet-mark { background: #6a9ca3; }.active-mark { background: #ff9b56; box-shadow: 0 0 0 3px rgba(255,155,86,.12), 0 0 9px rgba(255,155,86,.4); }.surge-mark { background: #ff6450; }
.preset-button b { display: block; color: #dce3ec; font-size: 10px; font-weight: 600; }
.preset-button small { display: block; margin-top: 3px; color: #78879a; font-size: 9px; }
.control-section { padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
.compact-section { padding-bottom: 10px; }
.control-row { margin-top: 12px; }
.control-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-top label { color: #b8c3d0; font-size: 10px; }
.control-top output { color: #f4b27d; font: 600 9px var(--mono); text-align: right; }
input[type="range"] { width: 100%; height: 15px; margin: 7px 0 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg,#e78b4d 0%,#a66c4a 45%,#394657 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg,#e78b4d 0%,#a66c4a 45%,#394657 100%); }
input[type="range"]::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; appearance: none; border: 2px solid #ffd1a4; border-radius: 50%; background: #ff8c48; box-shadow: 0 0 0 3px rgba(255,140,72,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #ffd1a4; border-radius: 50%; background: #ff8c48; box-shadow: 0 0 0 3px rgba(255,140,72,.12); }
.range-scale { display: flex; justify-content: space-between; margin-top: 1px; color: #5f6d7e; font: 8px var(--mono); }
.diagnostic-card { margin-top: 14px; padding: 11px 11px 10px; border: 1px solid rgba(255,155,87,.16); border-radius: 8px; background: radial-gradient(ellipse at 10% 0%,rgba(255,144,67,.09),transparent 75%),rgba(255,255,255,.02); }
.diagnostic-head { display: flex; justify-content: space-between; align-items: center; color: #8997a9; font: 700 8px var(--mono); letter-spacing: .1em; }
.regime-dot { background: #ff9854; box-shadow: 0 0 8px #ff9854; }
.regime-title { margin-top: 6px; color: #ffb274; font: 700 13px var(--mono); letter-spacing: .05em; }
.regime-sub { margin-top: 4px; color: #8996a8; font-size: 9px; }
.regime-track { position: relative; height: 4px; margin-top: 11px; overflow: hidden; border-radius: 4px; background: linear-gradient(90deg,#426f77,#d2a05f,#e45f44); }
.regime-track span { position: absolute; inset: 0 auto 0 0; width: 45%; border-radius: 4px; background: rgba(255,255,255,.7); mix-blend-mode: overlay; }
.regime-track i { position: absolute; top: -2px; left: 42%; width: 2px; height: 8px; background: #fff4e9; box-shadow: 0 0 4px white; }
.diagnostic-foot { display: flex; justify-content: space-between; margin-top: 9px; color: #78879a; font: 8px var(--mono); }
.diagnostic-foot b { color: #dce4ed; font-weight: 600; }
.panel-footer { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.quality-control { display: flex; justify-content: space-between; align-items: center; color: #8290a2; font: 700 8px var(--mono); letter-spacing: .1em; }
.quality-switch { display: flex; gap: 3px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: rgba(0,0,0,.15); }
.quality-option { padding: 4px 7px; border: 0; border-radius: 3px; background: transparent; color: #788699; font: 700 8px var(--mono); cursor: pointer; }
.quality-option.active { background: #2a3442; color: #e8edf4; }
.time-readout { display: flex; justify-content: space-between; margin-top: 12px; color: #7c8a9d; font: 8px var(--mono); letter-spacing: .04em; }
.time-readout b { margin-left: 4px; color: #d5dce6; font-weight: 600; }
.footer-line { display: flex; justify-content: space-between; padding: 16px 2px 0; color: #566476; font: 700 8px var(--mono); letter-spacing: .11em; }
.footer-line i { padding: 0 5px; color: #c37b4b; font-style: normal; }
.embed-mode .app-shell { padding-top: 0; }
.embed-mode .topbar, .embed-mode .footer-line { display: none; }
.embed-mode .main-layout { padding-top: 0; }
.embed-mode .scene-frame { border-radius: 0; }
@media (min-width: 1500px) { .main-layout { grid-template-columns: minmax(0,1fr) 350px; gap: 20px; }.scene-frame { height: min(58vw,650px); } }
@media (min-width: 851px) and (max-height: 800px) { .topbar { height: 70px; }.main-layout { padding-top: 12px; }.scene-frame { height: clamp(360px, 50vh, 430px); min-height: 360px; }.readout-card { min-height: 80px; padding-top: 10px; padding-bottom: 8px; }.science-toggle { min-height: 52px; }.control-panel { max-height: calc(100vh - 94px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #394657 transparent; } }
@media (max-width: 1120px) { .app-shell { padding: 0 18px 12px; }.main-layout { grid-template-columns: minmax(0,1fr) 300px; gap: 12px; }.scene-frame { height: 430px; }.readout-card { padding: 11px 9px; }.readout-label { font-size: 7px; }.tag { font-size: 6px; }.readout-value { font-size: 18px; }.transport-button { padding: 0 8px; }.transport-button.primary { padding: 0 12px; }.utility-button { padding: 0 5px; } }
@media (max-width: 850px) { .main-layout { grid-template-columns: minmax(0,1fr); }.control-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }.panel-heading { grid-column: 1/-1; }.preset-section { grid-column: 1; grid-row: 2; }.control-section { grid-column: 2; grid-row: 2 / span 2; }.compact-section { grid-column: 1; grid-row: 3; }.diagnostic-card, .panel-footer { grid-column: 1/-1; }.scene-frame { height: min(61vw,520px); min-height: 380px; }.science-columns { grid-template-columns: 1fr 1fr; }.validation-block { grid-column: 1/-1; } }
@media (max-width: 600px) {
  .app-shell { padding: 0 10px 12px; }
  .topbar { height: 68px; }
  .brand-mark { width: 30px; height: 30px; }
  h1 { font-size: 17px; }
  .eyebrow { font-size: 8px; }
  .topbar-right { gap: 9px; font-size: 8px; }
  .topbar-divider, .seed-label { display: none; }
  .main-layout { padding-top: 10px; gap: 10px; }
  .scene-frame { height: 48vh; min-height: 330px; max-height: 470px; border-radius: 9px; }
  .scene-topline, .scene-bottomline { left: 12px; right: 12px; }
  .scene-topline { top: 12px; }
  .scene-bottomline { bottom: 12px; }
  .scene-kicker, .scene-scale { font-size: 7px; }
  .scene-controls-hint { font-size: 7px; }
  .scene-key { font-size: 7px; }
  .scene-label { font-size: 7px; }
  .transport-bar { flex-wrap: wrap; padding: 7px; gap: 6px; }
  .transport-main { flex: 1; }
  .transport-button { min-height: 32px; font-size: 8px; padding: 0 7px; }
  .transport-button.primary { padding: 0 10px; }
  .transport-meta { width: 100%; justify-content: space-between; padding-top: 5px; border-top: 1px solid var(--line); }
  .speed-control { gap: 1px; }
  .speed-option { min-width: 25px; }
  .utility-button { padding: 0 5px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 8px; }
  .readout-card { min-height: 82px; padding: 10px 10px 8px; }
  .readout-label { font-size: 7px; }
  .readout-value { margin-top: 8px; font-size: 19px; }
  .readout-foot { font-size: 8px; }
  .control-panel { display: block; padding: 14px 12px 11px; }
  .panel-heading { margin-bottom: 12px; }
  .preset-section, .control-section, .compact-section { display: block; }
  .preset-list { grid-template-columns: 1fr; }
  .control-section { padding-top: 13px; }
  .control-row { margin-top: 11px; }
  .science-columns { grid-template-columns: 1fr; gap: 12px; }
  .validation-block { grid-column: auto; }
  .science-content { padding-left: 11px; padding-right: 11px; }
  .assumption-strip { display: block; }
  .assumption-strip b { display: block; margin-bottom: 4px; }
  .footer-line { 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; }
}
