:root {
  color-scheme: dark;
  --bg: #07131f;
  --panel: #0b1a28;
  --panel-2: #0e2030;
  --line: rgba(153, 190, 213, .13);
  --line-strong: rgba(153, 190, 213, .22);
  --text: #e7f1f6;
  --muted: #8da5b5;
  --subtle: #587184;
  --cyan: #55dfd0;
  --blue: #6ab5ed;
  --orange: #f2a36a;
  --green: #6de2b4;
  --radius: 14px;
  --gap: 8px;
  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; background: radial-gradient(ellipse at 34% 0%, #10283a 0%, #07131f 52%, #050d16 100%); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; max-width: 1920px; margin: 0 auto; padding: 18px 20px 22px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 2px 2px 16px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 35px; height: 35px; border: 1px solid rgba(85,223,208,.35); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 2px; background: linear-gradient(145deg, rgba(85,223,208,.16), rgba(106,181,237,.05)); }
.brand-mark span { display: block; width: 4px; border-radius: 8px; background: var(--cyan); box-shadow: 0 0 9px rgba(85,223,208,.45); }
.brand-mark span:nth-child(1) { height: 12px; opacity: .65; transform: translateY(2px); }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .78; transform: translateY(-2px); }
.eyebrow { color: #7b9aab; font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.4; }
h1 { margin: 3px 0 0; font-size: clamp(16px, 1.55vw, 21px); font-weight: 680; letter-spacing: -.035em; white-space: nowrap; }
h1 span { color: #466173; font-weight: 400; padding: 0 4px; }
h1 em { color: #91a9b8; font-style: normal; font-weight: 450; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.live-pill, .seed-chip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: #a8c0ce; font-size: 9px; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.live-pill { display: flex; align-items: center; gap: 7px; }
.live-pill i, .pulse-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(109,226,180,.75); }
.seed-chip { color: #7690a1; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; padding-top: 16px; }
.scene-column { min-width: 0; }
.scene-frame { position: relative; height: min(68vh, 720px); min-height: 510px; overflow: hidden; border: 1px solid rgba(115,169,198,.2); border-radius: 17px; background: radial-gradient(ellipse at 52% 42%, #112c3c, #071522 64%, #050e18); box-shadow: 0 20px 60px rgba(0,0,0,.27), inset 0 1px rgba(255,255,255,.035); }
.scene-mount { position: absolute; inset: 0; z-index: 1; }
.scene-mount canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { pointer-events: none; position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgba(4,12,20,.42), transparent 19%, transparent 74%, rgba(4,12,20,.54)); }
.scene-topline, .scene-footer, .layer-label { position: absolute; z-index: 3; pointer-events: none; }
.scene-topline { top: 17px; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.scene-kicker { display: flex; align-items: center; gap: 8px; color: #c3d7e1; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.scene-scale { color: #7793a5; font-size: 9px; letter-spacing: .1em; }
.scene-scale span { color: #38566b; padding: 0 4px; }
.layer-label { display: flex; align-items: center; gap: 7px; left: 18px; padding: 7px 9px; border: 1px solid rgba(167,201,217,.12); border-radius: 8px; background: rgba(5,16,26,.58); backdrop-filter: blur(8px); color: #c8dbe4; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.layer-label small { color: #7390a1; font-size: 8px; font-weight: 500; letter-spacing: .02em; margin-left: 3px; }
.layer-top { top: 72px; }
.layer-bottom { bottom: 64px; }
.layer-dot { width: 7px; height: 7px; border-radius: 50%; }
.layer-dot.warm { background: var(--orange); box-shadow: 0 0 9px rgba(242,163,106,.55); }
.layer-dot.cool { background: var(--cyan); box-shadow: 0 0 9px rgba(85,223,208,.55); }
.scene-footer { bottom: 15px; left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.legend { display: flex; align-items: center; gap: 7px; color: #8ba5b4; font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; margin-left: 6px; }
.legend-swatch.fresh { background: #4fd8d0; }
.legend-swatch.salty { background: #f1a16c; }
.scene-hint { color: #718a9a; font-size: 8px; letter-spacing: .1em; }
kbd { border: 1px solid rgba(151,183,201,.22); border-radius: 4px; padding: 3px 5px; color: #a6bdc9; font: inherit; margin-left: 7px; }
.context-overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(4,12,20,.78); backdrop-filter: blur(8px); }
.context-overlay[hidden] { display: none; }
.context-card { display: grid; gap: 8px; text-align: center; padding: 22px 26px; border: 1px solid var(--line-strong); border-radius: 13px; background: #0b1a28; max-width: 330px; }
.context-card strong { font-size: 14px; }
.context-card span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.under-scene { padding: 12px 3px 0; }
.mechanism-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9,25,38,.72); }
.mechanism-step { display: flex; align-items: center; gap: 9px; min-width: 0; }
.step-number { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid rgba(85,223,208,.25); border-radius: 8px; color: var(--cyan); font-size: 9px; font-weight: 800; }
.mechanism-step div { display: grid; gap: 3px; min-width: 0; }
.mechanism-step b { color: #91aab9; font-size: 8px; letter-spacing: .12em; }
.mechanism-step span:not(.step-number) { color: #a7bac5; font-size: 10px; line-height: 1.35; }
.mechanism-arrow { color: #446275; font-size: 17px; flex-shrink: 0; }
.source-note { padding: 9px 3px 0; color: #526b7b; font-size: 9px; letter-spacing: .02em; }
.control-panel { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, rgba(13,31,46,.98), rgba(7,20,32,.98)); box-shadow: 0 16px 45px rgba(0,0,0,.18); }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 8px; margin-bottom: 13px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 16px; letter-spacing: -.025em; }
.model-tag { padding: 5px 7px; border: 1px solid rgba(106,181,237,.18); border-radius: 6px; color: #83b8dd; font-size: 8px; white-space: nowrap; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 15px; }
.preset { min-width: 0; display: flex; justify-content: center; align-items: center; gap: 5px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: #0a1a28; color: #90a7b5; font-size: 9px; font-weight: 650; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.preset:hover { border-color: rgba(85,223,208,.4); color: #d9f2f1; }
.preset.active { border-color: rgba(85,223,208,.43); background: rgba(39,111,113,.18); color: #a9f1e8; }
.preset-glyph { color: var(--cyan); font-size: 14px; line-height: 1; }
.control-section { padding: 12px 0 4px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; color: #88a2b2; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.section-unit { color: #506c7e; font-size: 7px; letter-spacing: .1em; }
.slider-control { margin: 0 0 11px; }
.slider-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.slider-label label { color: #c6d7e0; font-size: 10px; }
.symbol { color: #6cbdbd; font-family: Georgia, serif; font-style: italic; margin-left: 3px; }
.slider-label output { color: #b7d5dd; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type=range] { width: 100%; height: 14px; margin: 0; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(85,223,208,.78), rgba(106,181,237,.35)); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(85,223,208,.78), rgba(106,181,237,.35)); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #c5fff4; border-radius: 50%; background: #3bb8b0; box-shadow: 0 0 0 3px rgba(85,223,208,.12), 0 0 9px rgba(85,223,208,.3); }
input[type=range]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #c5fff4; border-radius: 50%; background: #3bb8b0; box-shadow: 0 0 0 3px rgba(85,223,208,.12); }
input[type=range]:focus-visible { outline: 1px solid var(--cyan); outline-offset: 4px; border-radius: 8px; }
.range-ends { display: flex; justify-content: space-between; color: #506a7a; font-size: 7px; margin-top: -1px; }
.transport-row { display: flex; justify-content: space-between; align-items: center; margin: 5px 0 0; padding: 11px 0 2px; border-top: 1px solid var(--line); }
.transport-copy { display: grid; gap: 3px; }
.transport-copy label { color: #c6d7e0; font-size: 10px; }
.transport-copy small { color: #5f7c8e; font-size: 7px; letter-spacing: .11em; }
#speedOut { color: var(--cyan); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.speed-range { margin-bottom: 9px !important; }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 14px; }
.action { display: flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: #0c2030; color: #a9bfcb; font-size: 9px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.action:hover { border-color: rgba(106,181,237,.42); background: #112b3e; color: #e0edf2; }
.action:active { transform: translateY(1px); }
.action.primary { border-color: rgba(85,223,208,.35); background: rgba(42,123,121,.22); color: #a9f2e8; }
.button-icon { color: var(--cyan); font-size: 13px; line-height: 1; }
.readout-section { padding: 12px 0 11px; border-top: 1px solid var(--line); }
.regime-badge { color: #6de2b4; font-size: 7px; letter-spacing: .08em; border: 1px solid rgba(109,226,180,.2); background: rgba(109,226,180,.06); border-radius: 999px; padding: 4px 6px; white-space: nowrap; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.readout-card { padding: 9px 10px 8px; border: 1px solid rgba(153,190,213,.11); border-radius: 9px; background: rgba(5,17,27,.52); display: grid; gap: 3px; }
.readout-card span { color: #819bab; font-size: 8px; }
.readout-card strong { color: #e1f3f4; font-size: 17px; line-height: 1.2; font-weight: 680; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.readout-card small { color: #5c7789; font-size: 7px; letter-spacing: .04em; }
.readout-foot { display: flex; align-items: center; gap: 7px; padding: 8px 2px 0; color: #7792a2; font-size: 8px; }
.readout-foot b { color: #c7e5e7; font-size: 9px; }
.readout-clock { margin-left: auto; color: #6f8b9b; font-variant-numeric: tabular-nums; }
.validation-card { padding: 11px; border: 1px solid rgba(106,181,237,.17); border-radius: 11px; background: linear-gradient(145deg, rgba(21,53,73,.5), rgba(8,25,39,.5)); }
.validation-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.validation-head h3 { margin: 3px 0 0; font-size: 11px; font-weight: 650; }
.validation-check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--green); background: rgba(109,226,180,.1); border: 1px solid rgba(109,226,180,.2); font-size: 11px; }
.validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.validation-grid div { display: grid; gap: 4px; min-width: 0; }
.validation-grid small { color: #69899d; font-size: 7px; letter-spacing: .08em; }
.validation-grid strong { color: #c8e3ed; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.validation-result { display: flex; align-items: center; gap: 7px; padding-top: 9px; margin-top: 9px; border-top: 1px solid var(--line); color: #8da8b8; font-size: 8px; }
.validation-result b { color: var(--green); font-size: 11px; }
.validation-result em { margin-left: auto; color: #69cda7; font-size: 7px; font-style: normal; letter-spacing: .08em; }
.validation-caption { margin: 8px 0 0; color: #637e90; font-size: 8px; line-height: 1.45; }
.science-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(6,18,29,.6); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px; list-style: none; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary span:first-child { display: grid; gap: 3px; }
.science-panel summary b { color: #b7cbd5; font-size: 9px; letter-spacing: .12em; }
.science-panel summary small { color: #718b9b; font-size: 8px; }
.details-plus { color: var(--cyan); font-size: 16px; transition: transform .2s ease; }
.science-panel[open] .details-plus { transform: rotate(45deg); }
.science-content { padding: 0 11px 12px; }
.science-intro { margin: 0 0 10px; color: #a3bac6; font-size: 9px; line-height: 1.55; }
.equation-block { display: grid; gap: 5px; padding: 8px 9px; margin: 6px 0; border-left: 2px solid rgba(85,223,208,.4); background: rgba(16,42,57,.45); }
.eq-label { color: #7193a5; font-size: 7px; font-weight: 800; letter-spacing: .11em; }
.equation-block code { color: #d0e7e9; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; white-space: normal; }
.equation-block small { color: #6e8a9b; font-size: 8px; }
.variable-list { display: grid; gap: 5px; padding: 8px 0; }
.variable-list div { display: grid; grid-template-columns: 54px 1fr; gap: 8px; font-size: 8px; }
.variable-list b { color: #7ed7cf; font-family: Georgia, serif; font-style: italic; }
.variable-list span { color: #829cab; }
.assumption-note { padding: 9px; border: 1px solid rgba(242,163,106,.15); border-radius: 8px; background: rgba(100,60,35,.1); }
.assumption-note b { color: #d9a47d; font-size: 7px; letter-spacing: .1em; }
.assumption-note p { margin: 5px 0 0; color: #9db0bb; font-size: 8px; line-height: 1.55; }
.model-legend { display: flex; gap: 6px; margin-top: 9px; }
.model-legend span { padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; color: #6f8c9d; font-size: 7px; letter-spacing: .08em; }
.panel-foot { padding: 11px 2px 0; color: #506b7b; font-size: 7px; letter-spacing: .12em; text-align: center; }
.panel-foot span { padding: 0 4px; color: #2f4c60; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 345px; gap: 12px; }
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .control-panel { padding: 12px; }
  .scene-frame { min-height: 480px; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .scene-frame { height: min(66vh, 690px); min-height: 430px; }
  .control-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; align-items: start; }
  .panel-heading, .preset-row, .action-grid, .readout-section, .validation-card, .science-panel, .panel-foot { grid-column: 1 / -1; }
  .control-section { min-width: 0; }
  .transport-row, .speed-range { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .app-shell { padding: 10px 9px 16px; }
  .topbar { padding-bottom: 11px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-lockup { gap: 9px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 15px; white-space: normal; line-height: 1.2; }
  h1 em { display: block; font-size: 11px; margin-top: 2px; }
  h1 span { display: none; }
  .topbar-right { flex-direction: column; align-items: end; gap: 4px; }
  .live-pill, .seed-chip { padding: 5px 7px; font-size: 7px; }
  .workspace { padding-top: 10px; gap: 10px; }
  .scene-frame { height: 56vh; min-height: 390px; max-height: 560px; border-radius: 12px; }
  .scene-topline { top: 11px; left: 11px; right: 11px; align-items: start; }
  .scene-kicker { font-size: 7px; }
  .scene-scale { font-size: 7px; text-align: right; max-width: 112px; line-height: 1.45; }
  .layer-label { left: 10px; padding: 6px 7px; font-size: 7px; }
  .layer-label small { font-size: 7px; }
  .layer-top { top: 55px; }
  .layer-bottom { bottom: 55px; }
  .scene-footer { left: 10px; right: 10px; bottom: 10px; }
  .legend { gap: 4px; font-size: 6px; }
  .legend-swatch { margin-left: 2px; width: 6px; height: 6px; }
  .scene-hint { font-size: 6px; }
  kbd { margin-left: 3px; padding: 2px 3px; }
  .mechanism-strip { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .mechanism-step span:not(.step-number) { font-size: 9px; }
  .mechanism-arrow { display: none; }
  .source-note { font-size: 8px; line-height: 1.4; }
  .control-panel { display: block; padding: 12px; border-radius: 12px; }
  .panel-heading h2 { font-size: 15px; }
  .control-section { padding-top: 11px; }
  .slider-label label { font-size: 10px; }
  .slider-label output { font-size: 8px; }
  .readout-card strong { font-size: 16px; }
  .validation-grid strong { font-size: 9px; }
}
@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 .app-shell { padding: 8px; }
body.embed .topbar, body.embed .under-scene, body.embed .panel-foot { display: none; }
body.embed .workspace { padding-top: 0; grid-template-columns: minmax(0,1fr) 330px; gap: 8px; }
body.embed .scene-frame { height: 100vh; min-height: 360px; border-radius: 9px; }
body.embed .control-panel { max-height: 100vh; overflow-y: auto; }
@media (max-width: 760px) {
  body.embed .workspace { grid-template-columns: minmax(0,1fr); }
  body.embed .scene-frame { height: 55vh; }
  body.embed .control-panel { max-height: none; }
}
.scene-annotation { position: absolute; z-index: 4; top: 0; left: 0; padding: 5px 7px; border: 1px solid rgba(125,194,207,.2); border-radius: 5px; background: rgba(5,17,28,.62); color: #9bc5cd; font-size: 7px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; pointer-events: none; backdrop-filter: blur(6px); transform-origin: top left; }
.reduced-motion-note { position: absolute; z-index: 5; right: 14px; bottom: 54px; padding: 6px 8px; border: 1px solid rgba(153,190,213,.16); border-radius: 6px; background: rgba(5,16,26,.72); color: #8da8b8; font-size: 8px; pointer-events: none; }
