:root {
  color-scheme: dark;
  --bg: #07121d;
  --panel: #0d1c29;
  --panel-2: #102333;
  --line: rgba(171, 205, 222, .13);
  --muted: #8299a8;
  --text: #e9f2f6;
  --soft: #b9cbd5;
  --accent: #67d6d0;
  --accent-2: #a1e8e1;
  --amber: #eabf84;
  --danger: #df9b89;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 16px 18px 18px; gap: 14px; background: radial-gradient(ellipse at 20% -10%, rgba(40, 83, 105, .19), transparent 42%), var(--bg); }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; }
.topbar { min-height: 58px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 4px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(103, 214, 208, .38); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-7deg); background: rgba(103, 214, 208, .07); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 10px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .75; }
.brand-kicker, .section-kicker { color: #7f9aa9; font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.3; }
.brand-kicker span { color: var(--accent); padding: 0 4px; }
h1 { font-size: clamp(17px, 2vw, 21px); line-height: 1.15; margin: 3px 0 0; font-weight: 650; letter-spacing: -.035em; }
.header-meta { display: flex; align-items: center; gap: 16px; min-width: 0; }
.header-chip { color: #b7d4dc; border: 1px solid rgba(103,214,208,.22); border-radius: 30px; padding: 7px 10px; font-size: 9px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; background: rgba(103,214,208,.055); }
.header-chip i { display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(103,214,208,.7); }
.header-note { color: #718895; font-size: 8px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.header-note b { color: var(--accent); padding: 0 4px; }
.main-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(345px, .86fr); gap: 14px; }
.stage-card, .control-card, .science-card { background: linear-gradient(145deg, rgba(18, 38, 53, .97), rgba(10, 25, 37, .98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 55px rgba(0,0,0,.18); }
.stage-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.stage-view { position: relative; flex: 1 1 auto; min-height: 190px; overflow: hidden; background: #091a28; }
#scene { display: block; width: 100%; height: 100%; outline: none; }
.stage-topline { position: absolute; top: 15px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; gap: 12px; }
.stage-tag { color: #c7dce4; font-size: 9px; letter-spacing: .13em; font-weight: 750; background: rgba(7, 18, 29, .62); border: 1px solid rgba(187, 219, 233, .13); padding: 8px 10px; border-radius: 8px; backdrop-filter: blur(10px); }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 0 7px 1px 0; box-shadow: 0 0 12px rgba(103,214,208,.8); }
.stage-scale { color: rgba(202,222,230,.65); font-size: 8px; letter-spacing: .13em; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.stage-bottomline { position: absolute; bottom: 14px; left: 16px; right: 16px; display: flex; align-items: end; justify-content: space-between; gap: 12px; pointer-events: none; }
.process-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: rgba(218,235,241,.82); font-size: 8px; font-weight: 750; letter-spacing: .13em; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(187,219,233,.12); background: rgba(7,18,29,.56); backdrop-filter: blur(8px); }
.process-chain b { color: var(--accent); font-size: 12px; }
.model-clock { text-align: right; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(187,219,233,.12); background: rgba(7,18,29,.56); backdrop-filter: blur(8px); }
.model-clock span { display: block; color: rgba(202,222,230,.62); font-size: 7px; letter-spacing: .12em; font-weight: 750; }
.model-clock strong { display: block; margin-top: 2px; color: #e9f5f5; font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.stage-key { position: absolute; top: 58px; right: 16px; color: rgba(214,231,238,.65); font-size: 8px; letter-spacing: .08em; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.key-cloud, .key-ice { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #c9e2ec; opacity: .75; }
.key-ice { background: var(--accent); margin-left: 8px; opacity: 1; }
.readouts { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: rgba(155,190,207,.11); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.readout { min-width: 0; padding: 12px 13px 11px; background: rgba(9,25,37,.88); }
.readout-top { display: flex; flex-direction: column; gap: 3px; min-height: 25px; }
.readout-top span { color: #8fa8b5; font-size: 8px; font-weight: 800; letter-spacing: .105em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-top small { color: #5f7d8b; font-size: 7px; letter-spacing: .09em; font-weight: 700; }
.readout-value { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; }
.readout-value strong { color: #edf8fa; font-size: clamp(18px, 2.1vw, 25px); line-height: 1.15; font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.readout-value em { color: var(--accent); font-style: normal; font-size: 10px; font-weight: 650; }
.readout-track { height: 2px; margin-top: 8px; background: rgba(133,166,182,.14); border-radius: 2px; overflow: hidden; }
.readout-track span { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #399d9e, #80e5d8); transition: width .22s ease-out; }
.caption-strip { flex: 0 0 auto; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 15px; background: rgba(12,29,42,.98); }
.caption-icon { color: var(--accent); font-size: 14px; }
.caption-strip p { color: #adc2cc; font-size: 10px; line-height: 1.45; margin: 0; }
.control-panel { min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(111,156,176,.35) transparent; }
.control-card { padding: 17px 17px 13px; flex: 0 0 auto; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 4px 0 0; font-size: 17px; font-weight: 630; letter-spacing: -.035em; }
.illustrative-pill { border: 1px solid rgba(234,191,132,.25); color: #d7b487; font-size: 7px; font-weight: 800; letter-spacing: .13em; border-radius: 20px; padding: 5px 7px; white-space: nowrap; }
.preset-block { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.subheading { color: #8ca5b2; font-size: 8px; font-weight: 800; letter-spacing: .12em; display: flex; justify-content: space-between; margin-bottom: 8px; }
.subheading span { color: #5e7887; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; padding: 9px 8px; border-radius: 10px; border: 1px solid rgba(153,190,207,.14); background: rgba(6,18,28,.34); cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.preset-button:hover { border-color: rgba(103,214,208,.45); background: rgba(103,214,208,.06); }
.preset-button:active { transform: translateY(1px); }
.preset-button.active { border-color: rgba(103,214,208,.48); background: rgba(103,214,208,.085); }
.preset-symbol { flex: 0 0 auto; width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; }
.preset-symbol.formed { color: var(--accent); background: rgba(103,214,208,.1); }
.preset-symbol.failed { color: var(--amber); background: rgba(234,191,132,.09); }
.preset-button strong { display: block; font-size: 9px; color: #dbe9ee; font-weight: 700; }
.preset-button small { display: block; color: #7d97a5; font-size: 7px; margin-top: 3px; white-space: nowrap; }
.sliders { padding: 12px 0 8px; display: flex; flex-direction: column; gap: 13px; }
.control-row { min-width: 0; }
.control-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: #d4e2e8; font-size: 10px; font-weight: 600; }
.control-label output { color: var(--accent-2); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 15px; margin: 5px 0 0; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(103,214,208,.78), rgba(103,214,208,.2)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(103,214,208,.78), rgba(103,214,208,.2)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #d5f6f1; border: 3px solid #398d8c; box-shadow: 0 0 0 3px rgba(103,214,208,.1); margin-top: -5px; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d5f6f1; border: 3px solid #398d8c; box-shadow: 0 0 0 3px rgba(103,214,208,.1); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; gap: 5px; color: #66818f; font-size: 7px; font-variant-numeric: tabular-nums; }
.range-ends span:last-child { color: #5c7988; font-size: 6px; letter-spacing: .06em; }
.seed-row { display: flex; align-items: center; gap: 9px; margin-top: 3px; }
.primary-button { flex: 0 0 auto; border: 1px solid rgba(117,232,222,.55); border-radius: 9px; padding: 10px 13px; color: #062126; background: linear-gradient(135deg, #8ce5dc, #58c5c0); font-size: 10px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 18px rgba(45,174,169,.12); transition: filter .18s, transform .18s; }
.primary-button:hover { filter: brightness(1.08); }
.primary-button:active { transform: translateY(1px); }
.primary-button span { margin-right: 5px; }
.seed-hint { color: #718b98; font-size: 8px; line-height: 1.35; }
.transport-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.transport-button { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 1px solid rgba(153,190,207,.16); border-radius: 8px; background: rgba(5,17,27,.32); color: #b6cbd4; font-size: 9px; cursor: pointer; transition: border-color .18s, background .18s; }
.transport-button:hover { border-color: rgba(103,214,208,.42); background: rgba(103,214,208,.06); }
.transport-button span:first-child { color: var(--accent); }
.transport-button.icon-only { font-size: 10px; letter-spacing: -.1em; }
.transport-button.compact { padding: 0 8px; }
.transport-spacer { flex: 1 1 auto; }
.quality-row { display: flex; align-items: center; gap: 8px; padding-top: 11px; margin-top: 11px; border-top: 1px solid var(--line); color: #7893a1; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.quality-switch { display: inline-flex; padding: 2px; border: 1px solid rgba(153,190,207,.14); border-radius: 7px; background: rgba(5,17,27,.38); }
.quality-switch button { padding: 4px 8px; border: 0; border-radius: 5px; background: transparent; color: #718b98; font-size: 8px; cursor: pointer; }
.quality-switch button.selected { color: #d8efef; background: rgba(103,214,208,.16); }
.quality-note { margin-left: auto; color: #587583; font-size: 6px; }
.science-card { flex: 0 0 auto; padding: 0 15px; }
.science-card details { padding: 0; }
.science-card summary { min-height: 54px; display: flex; justify-content: space-between; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
.science-card summary::-webkit-details-marker { display: none; }
.science-card summary strong { display: block; margin-top: 3px; font-size: 13px; font-weight: 650; letter-spacing: -.02em; }
.chevron { color: var(--accent); font-size: 18px; transition: transform .2s; }
.science-card details[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 0 14px; color: #9db3be; font-size: 9px; line-height: 1.5; }
.science-intro { margin: 0 0 11px; color: #b6c9d1; }
.equation-block { padding: 9px 10px; margin: 7px 0; border: 1px solid rgba(153,190,207,.12); border-radius: 9px; background: rgba(5,17,27,.26); }
.equation-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #819ca9; font-size: 7px; font-weight: 800; letter-spacing: .09em; }
.equation-label b { color: #70cfc9; font-size: 6px; white-space: nowrap; }
.equation { margin: 7px 0 4px; color: #e1f0f2; font-family: Georgia, "Times New Roman", serif; font-size: 14px; letter-spacing: .01em; overflow-wrap: anywhere; }
.equation sub { font-size: 9px; }
.equation-block p { margin: 0; color: #829aa7; font-size: 8px; }
.check-panel { margin-top: 9px; padding: 10px; border: 1px solid rgba(103,214,208,.24); border-radius: 9px; background: rgba(61,151,150,.07); }
.check-panel strong { display: block; margin-top: 4px; color: #d9eaee; font-size: 9px; }
.check-values { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--accent-2); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.check-values b { color: #91aeb8; font-size: 8px; font-weight: 650; }
.check-panel p { color: #829aa7; margin: 6px 0 0; font-size: 7px; }
.assumptions { padding: 10px 1px 2px; }
.assumptions strong { color: #d3e2e7; font-size: 9px; }
.assumptions ul { margin: 5px 0 0; padding-left: 16px; color: #829aa7; font-size: 8px; }
.assumptions li { margin: 3px 0; }
.disclaimer { margin: 9px 0 0; color: #6e8997; font-size: 7px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 850px) and (min-width: 701px) {
  .app-shell { padding: 12px; gap: 10px; }
  .main-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); gap: 10px; }
  .control-card { padding: 13px; }
  .readout { padding: 9px 8px; }
  .readout-top span { font-size: 7px; }
  .readout-top small { font-size: 6px; }
  .header-note { display: none; }
}
@media (max-width: 700px) {
  .app-shell { padding: 9px 9px 10px; gap: 9px; }
  .topbar { min-height: 43px; gap: 8px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
  .brand-lockup { gap: 9px; }
  .brand-kicker { font-size: 7px; letter-spacing: .12em; }
  h1 { font-size: 17px; }
  .header-meta { gap: 0; }
  .header-chip { font-size: 7px; padding: 6px 7px; }
  .header-note { display: none; }
  .main-grid { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,.83fr) minmax(0,1.17fr); gap: 9px; }
  .stage-card { border-radius: 14px; }
  .stage-view { min-height: 0; }
  .stage-topline { top: 8px; left: 9px; right: 9px; }
  .stage-tag { font-size: 7px; padding: 6px 7px; }
  .stage-scale { font-size: 6px; }
  .stage-key { display: none; }
  .stage-bottomline { bottom: 8px; left: 8px; right: 8px; gap: 6px; }
  .process-chain { gap: 4px; padding: 6px 7px; font-size: 6px; letter-spacing: .06em; }
  .process-chain b { font-size: 9px; }
  .model-clock { padding: 5px 7px; }
  .model-clock span { font-size: 5px; }
  .model-clock strong { font-size: 11px; }
  .readouts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout { padding: 6px 9px 6px; }
  .readout-top { min-height: 19px; gap: 1px; }
  .readout-top span { font-size: 6px; letter-spacing: .07em; }
  .readout-top small { font-size: 5px; }
  .readout-value { margin-top: 0; }
  .readout-value strong { font-size: 16px; }
  .readout-value em { font-size: 8px; }
  .readout-track { margin-top: 4px; }
  .caption-strip { min-height: 30px; padding: 5px 9px; gap: 6px; }
  .caption-icon { font-size: 10px; }
  .caption-strip p { font-size: 8px; line-height: 1.3; }
  .control-panel { gap: 8px; border-radius: 14px; }
  .control-card { padding: 12px 13px 10px; border-radius: 14px; }
  .panel-heading { padding-bottom: 9px; }
  .panel-heading h2 { font-size: 15px; }
  .section-kicker { font-size: 7px; }
  .illustrative-pill { font-size: 6px; }
  .preset-block { padding: 9px 0; }
  .subheading { font-size: 7px; margin-bottom: 6px; }
  .preset-button { padding: 7px 6px; gap: 6px; }
  .preset-symbol { width: 22px; height: 22px; }
  .preset-button strong { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .sliders { padding: 9px 0 6px; gap: 9px; }
  .control-label { font-size: 9px; }
  .control-label output { font-size: 9px; }
  input[type="range"] { margin-top: 3px; height: 13px; }
  .range-ends { font-size: 6px; }
  .range-ends span:last-child { font-size: 5px; }
  .primary-button { padding: 8px 10px; font-size: 9px; }
  .seed-hint { font-size: 7px; }
  .transport-row { margin-top: 8px; gap: 5px; }
  .transport-button { min-height: 28px; padding: 0 7px; font-size: 8px; }
  .quality-row { padding-top: 8px; margin-top: 8px; }
  .science-card { border-radius: 14px; }
  .science-card summary { min-height: 45px; }
  .science-card summary strong { font-size: 12px; }
}
@media (max-width: 360px) {
  .stage-scale { display: none; }
  .process-chain { font-size: 5px; }
  .seed-hint { display: none; }
  .header-chip { 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; }
}
