:root {
  color-scheme: dark;
  --bg: #081521;
  --panel: #0d1d2a;
  --panel-soft: #102434;
  --line: rgba(172, 199, 209, 0.13);
  --line-strong: rgba(172, 199, 209, 0.22);
  --text: #eaf0ed;
  --muted: #8ea2a9;
  --subtle: #607782;
  --sand: #e7b777;
  --sand-bright: #f4d3a1;
  --cyan: #75d5dd;
  --green: #8fcead;
  --danger: #e7a07d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 40% -30%, #193447 0%, var(--bg) 54%); }
.topbar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(7, 19, 29, 0.92); z-index: 4; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(231,183,119,.38); border-radius: 10px; color: var(--sand); display: grid; place-items: center; font-size: 26px; line-height: 1; background: rgba(231,183,119,.07); }
.eyebrow { color: var(--cyan); font-size: 8px; letter-spacing: .19em; font-weight: 800; margin-bottom: 3px; }
.brand-title { color: #eef2ef; font-size: 14px; font-weight: 650; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-title span { color: #637984; padding: 0 3px; }
.topbar-meta { display: flex; align-items: center; gap: 9px; color: #a7bbc0; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.live-dot, .chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(143,206,173,.6); }
.top-divider { height: 16px; width: 1px; background: var(--line-strong); margin: 0 6px; }
.seed-label { color: #738d97; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 366px; min-height: 0; flex: 1; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #152d3a; }
.scene-wrap { position: relative; flex: 1; min-height: 280px; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, #163447, #c28a5c 78%, #9b6748); }
.simulation-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.scene-topline { position: absolute; top: 17px; left: 18px; right: 18px; z-index: 2; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(238,231,217,.24); border-radius: 5px; color: #fff0dc; background: rgba(13,27,35,.45); backdrop-filter: blur(10px); font-size: 8px; letter-spacing: .15em; font-weight: 800; }
.scene-chip .chip-dot { width: 5px; height: 5px; background: var(--sand); box-shadow: 0 0 8px rgba(231,183,119,.7); }
.scene-hint { color: rgba(255,245,226,.74); font-size: 8px; font-weight: 750; letter-spacing: .13em; text-shadow: 0 1px 6px rgba(0,0,0,.25); }
.scene-hint span { padding: 0 5px; color: var(--sand-bright); }
.scene-legend { position: absolute; left: 19px; bottom: 62px; z-index: 2; display: flex; gap: 15px; color: rgba(255,242,220,.88); font-size: 8px; letter-spacing: .1em; font-weight: 800; pointer-events: none; }
.scene-legend span { display: flex; align-items: center; gap: 7px; }
.legend-grain, .legend-wave { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #f2c384; box-shadow: 0 0 8px rgba(242,195,132,.5); }
.legend-wave { background: var(--cyan); box-shadow: 0 0 8px rgba(117,213,221,.55); }
.scene-bottomline { position: absolute; bottom: 0; left: 0; right: 0; height: 43px; z-index: 2; display: flex; align-items: center; gap: 22px; padding: 0 19px; border-top: 1px solid rgba(255,255,255,.12); background: linear-gradient(90deg, rgba(9,24,33,.78), rgba(9,24,33,.28)); backdrop-filter: blur(7px); pointer-events: none; }
.scene-bottomline span { display: flex; align-items: baseline; gap: 7px; }
.scene-bottomline b { color: #f8e8d0; font-size: 10px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.scene-bottomline small { color: rgba(255,240,219,.62); font-size: 7px; letter-spacing: .13em; font-weight: 800; }
.scene-bottomline span:nth-child(2) b { color: var(--cyan); }
.scene-annotation { position: absolute; z-index: 2; top: 0; left: 0; padding: 5px 7px; color: #f4e5d1; background: rgba(7,21,30,.66); border: 1px solid rgba(241,211,172,.27); border-radius: 3px; font-size: 7px; font-weight: 850; letter-spacing: .16em; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 4px #081521; transition: opacity .2s ease; }
.stage-caption { flex: 0 0 119px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 22px 17px; background: #0d202c; border-top: 1px solid rgba(255,255,255,.05); }
.caption-copy { min-width: 0; }
.caption-kicker { display: block; color: var(--sand); font-size: 8px; letter-spacing: .17em; font-weight: 850; margin-bottom: 5px; }
.caption-copy strong { display: block; color: #edf2ef; font-size: 15px; font-weight: 650; letter-spacing: -.03em; }
.caption-copy p { max-width: 610px; margin: 5px 0 0; color: #91a5ab; font-size: 10px; line-height: 1.5; }
.caption-metric { flex: 0 0 146px; padding-left: 17px; border-left: 1px solid var(--line-strong); }
.caption-metric span { display: block; color: #78919a; font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.caption-metric strong { display: block; margin: 2px 0 0; color: var(--sand-bright); font-size: 24px; font-weight: 650; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.caption-metric strong small { font-size: 12px; font-weight: 500; }
.caption-metric em { display: block; color: #708a94; font-size: 7px; font-style: normal; letter-spacing: .1em; }
.control-panel { min-height: 0; background: linear-gradient(180deg, #0e202d, #0b1a26); border-left: 1px solid var(--line); overflow: hidden; }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #304958 transparent; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #304958; border-radius: 6px; }
.panel-section { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.section-index { color: var(--sand); font-size: 8px; font-weight: 850; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.section-heading h1, .section-heading h2 { margin: 0; color: #e6eeec; font-size: 12px; font-weight: 680; letter-spacing: -.01em; white-space: nowrap; }
.section-heading h1 { font-size: 14px; }
.section-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.section-subtitle { margin: 8px 0 13px; color: #91a5ab; font-size: 10px; line-height: 1.5; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.preset-button { min-width: 0; min-height: 54px; display: flex; align-items: center; gap: 7px; padding: 8px 7px; text-align: left; border: 1px solid var(--line-strong); border-radius: 5px; background: rgba(255,255,255,.018); color: #a9bbc0; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.preset-button:hover { border-color: rgba(231,183,119,.5); color: #f2e2cb; }
.preset-button.active { border-color: rgba(231,183,119,.7); background: rgba(231,183,119,.09); color: #f5dfbf; }
.preset-symbol { flex: 0 0 16px; color: var(--sand); font-size: 17px; text-align: center; }
.preset-button span:last-child { font-size: 8px; font-weight: 750; line-height: 1.35; }
.control-section { padding-top: 15px; padding-bottom: 12px; }
.control-section .section-heading { margin-bottom: 14px; }
.slider-control { margin: 0 0 14px; }
.slider-control.last-slider { margin-bottom: 1px; }
.slider-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.slider-label label { color: #c6d4d4; font-size: 10px; font-weight: 600; }
.slider-label output { color: var(--sand-bright); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 4px; margin: 0; display: block; appearance: none; -webkit-appearance: none; border-radius: 4px; outline: none; background: linear-gradient(90deg, #b88755, #d7ae7c 55%, #344b58 55%); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border: 2px solid #f2d5aa; border-radius: 50%; background: #152d39; box-shadow: 0 0 0 3px rgba(231,183,119,.13); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #f2d5aa; border-radius: 50%; background: #152d39; box-shadow: 0 0 0 3px rgba(231,183,119,.13); }
input[type="range"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #5e7781; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.live-section { padding-top: 15px; padding-bottom: 14px; }
.live-tag, .validation-tag { margin-left: auto; color: var(--green); font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.readout-card { min-width: 0; min-height: 66px; padding: 9px 10px 8px; border: 1px solid rgba(170,197,207,.13); border-radius: 5px; background: rgba(255,255,255,.025); }
.readout-card > span { display: block; color: #7f969e; font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.readout-card strong { display: block; margin-top: 5px; color: #e8c18e; font-size: 18px; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-card strong small { color: #a5b8bb; font-size: 9px; font-weight: 550; letter-spacing: 0; }
.readout-card em { display: block; margin-top: 1px; color: #617b85; font-size: 6px; font-style: normal; letter-spacing: .11em; }
.readout-card:nth-child(2) strong { color: var(--cyan); }
.envelope-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; color: #7e969d; font-size: 7px; font-weight: 850; letter-spacing: .11em; }
.envelope-track { flex: 1; height: 4px; border-radius: 4px; background: #263d49; overflow: hidden; }
.envelope-track i { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c28a58, #7bd1d9); transition: width .15s linear; }
.envelope-row b { min-width: 25px; color: var(--cyan); text-align: right; font-size: 8px; font-variant-numeric: tabular-nums; }
.validation-section { padding-top: 15px; padding-bottom: 15px; }
.validation-tag { color: var(--sand); }
.validation-card { margin-top: 11px; padding: 10px 11px; border: 1px solid rgba(231,183,119,.2); border-radius: 5px; background: linear-gradient(135deg, rgba(231,183,119,.055), rgba(255,255,255,.012)); }
.validation-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #b4c2c2; font-size: 7px; font-weight: 850; letter-spacing: .11em; }
.textbook-tag { padding: 3px 5px; color: #e7bd85; border: 1px solid rgba(231,183,119,.3); border-radius: 3px; font-size: 6px; white-space: nowrap; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.validation-values span, .validation-difference span { display: block; color: #718992; font-size: 6px; font-weight: 850; letter-spacing: .1em; }
.validation-values strong { display: block; margin-top: 4px; color: #e9d2b2; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.validation-difference { display: flex; align-items: baseline; justify-content: space-between; padding-top: 9px; margin-top: 8px; border-top: 1px solid var(--line); }
.validation-difference strong { color: var(--green); font-size: 13px; font-variant-numeric: tabular-nums; }
.validation-card p { margin: 7px 0 0; color: #80959c; font-size: 8px; line-height: 1.45; }
.transport-section { padding-top: 15px; padding-bottom: 15px; }
.transport-buttons { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; margin-top: 12px; }
.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; font-size: 9px; font-weight: 750; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:active { transform: translateY(1px); }
.button:focus-visible, .preset-button:focus-visible, .utility-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.button-primary { color: #14232a; border-color: #d8b27f; background: linear-gradient(135deg, #e7bd86, #d69e65); }
.button-primary:hover { background: linear-gradient(135deg, #f2d09f, #e4ad76); }
.button-secondary { color: #c5d3d2; background: rgba(255,255,255,.035); }
.button-secondary:hover { border-color: rgba(117,213,221,.45); background: rgba(117,213,221,.07); }
.speed-control { margin-top: 14px; margin-bottom: 13px; }
.utility-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.utility-button { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 31px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.018); color: #90a6ac; font-size: 7px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.utility-button span { color: var(--sand); font-size: 12px; }
.utility-button:hover { border-color: rgba(231,183,119,.42); color: #e9d7bb; }
.science-section { padding: 0; }
.science-section details { padding: 14px 18px; }
.science-section summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; color: #dce6e3; font-size: 11px; font-weight: 700; }
.science-section summary::-webkit-details-marker { display: none; }
.details-hint { margin-left: auto; color: #6f8790; font-size: 6px; font-weight: 800; letter-spacing: .11em; }
.chevron { color: var(--sand); font-size: 15px; transition: transform .2s ease; }
.science-section details[open] .chevron { transform: rotate(180deg); }
.science-content { padding-top: 13px; color: #9bb0b4; font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 13px 0 5px; color: #e4c69d; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.science-content p { margin: 5px 0; }
.science-content b { color: #d7e1dd; }
.science-content ul { margin: 6px 0; padding-left: 16px; }
.science-content li { margin: 3px 0; }
.equation { margin: 7px 0; padding: 7px 9px; border-left: 2px solid rgba(117,213,221,.5); background: rgba(255,255,255,.025); }
.equation span { display: block; color: #6f8992; font-size: 6px; font-weight: 850; letter-spacing: .12em; }
.equation code { display: block; margin-top: 3px; color: #d9e4e1; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; white-space: normal; }
.constant-strip { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.constant-strip span { padding: 4px 5px; border: 1px solid var(--line); border-radius: 3px; color: #a7b8b7; font-size: 7px; }
.constant-strip i { color: var(--sand); font-size: 6px; font-style: normal; }
.panel-footer { padding: 12px 18px 15px; color: #708791; }
.panel-footer p { margin: 0 0 6px; color: #94a7aa; font-size: 8px; line-height: 1.45; }
.panel-footer span { font-size: 6px; font-weight: 850; letter-spacing: .13em; color: #59727d; }
.webgl-fallback, .context-lost { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; background: radial-gradient(ellipse at center, rgba(22,48,61,.97), rgba(7,19,29,.98)); text-align: center; }
.webgl-fallback[hidden], .context-lost[hidden] { display: none; }
.fallback-icon { color: var(--sand); font-size: 38px; margin-bottom: 12px; }
.webgl-fallback strong, .context-lost strong { color: #f0e8d9; font-size: 16px; }
.webgl-fallback p, .context-lost span { max-width: 330px; margin: 9px 0 17px; color: #9bb0b5; font-size: 11px; line-height: 1.55; }
.scene-wrap .button { min-height: 36px; }
.embed-mode .topbar, .embed-mode .stage-caption { display: none; }
.embed-mode .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
.embed-mode .scene-wrap { min-height: 100%; }

@media (max-width: 1050px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .panel-section { padding-left: 14px; padding-right: 14px; }
  .science-section details { padding-left: 14px; padding-right: 14px; }
  .stage-caption { padding-left: 17px; padding-right: 17px; }
  .caption-copy p { max-width: 420px; }
}
@media (max-width: 700px) {
  html, body { height: 100%; overflow: hidden; }
  .topbar { height: 54px; flex-basis: 54px; padding: 0 13px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .eyebrow { font-size: 7px; }
  .brand-title { max-width: 210px; font-size: 12px; }
  .topbar-meta { gap: 6px; font-size: 7px; }
  .seed-label, .top-divider { display: none; }
  .workspace { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .stage-column { flex: 0 0 43vh; min-height: 285px; max-height: 430px; }
  .scene-wrap { min-height: 0; }
  .scene-topline { top: 11px; left: 11px; right: 11px; }
  .scene-chip { padding: 6px 8px; font-size: 7px; }
  .scene-hint { font-size: 6px; }
  .scene-legend { left: 12px; bottom: 49px; gap: 9px; font-size: 6px; }
  .scene-bottomline { height: 36px; gap: 12px; padding: 0 12px; }
  .scene-bottomline b { font-size: 8px; }
  .scene-bottomline small { font-size: 6px; }
  .stage-caption { display: none; }
  .control-panel { flex: 1 1 auto; min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .panel-scroll { height: 100%; }
  .panel-section { padding: 14px 15px; }
  .intro-section { padding-top: 13px; }
  .section-heading h1 { font-size: 13px; }
  .section-heading h2 { font-size: 11px; }
  .section-subtitle { margin: 7px 0 11px; font-size: 9px; }
  .preset-button { min-height: 49px; }
  .control-section { padding-top: 13px; }
  .slider-control { margin-bottom: 13px; }
  .readout-card { min-height: 62px; }
  .transport-buttons { grid-template-columns: 1.15fr 1fr 1fr; }
  .embed-mode .workspace { display: flex; flex-direction: column; }
  .embed-mode .stage-column { flex: 1 1 50%; min-height: 240px; }
  .embed-mode .control-panel { flex: 1 1 50%; }
}
@media (max-width: 380px) {
  .brand-title { max-width: 180px; font-size: 11px; }
  .topbar-meta { font-size: 6px; }
  .preset-button { gap: 4px; padding: 7px 5px; }
  .preset-symbol { flex-basis: 13px; font-size: 15px; }
  .utility-button { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
