:root {
  color-scheme: dark;
  --bg: #101417;
  --panel: #171d20;
  --panel-2: #1d2528;
  --line: #2b3538;
  --muted: #849194;
  --soft: #b9c2bf;
  --text: #edf0e9;
  --accent: #e7b76b;
  --accent-2: #f2d29b;
  --green: #9ebc9b;
  --red: #d58e77;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 64px minmax(0, 1fr); background: radial-gradient(ellipse at 76% 8%, rgba(105, 86, 55, .10), transparent 34%), var(--bg); }
.topbar { height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #242d30; background: rgba(15, 20, 22, .94); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid #68583e; border-radius: 9px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 7px; transform: rotate(-7deg); }
.brand-mark span { display: block; height: 2px; border-radius: 3px; background: var(--accent); }
.brand-mark span:nth-child(2) { width: 70%; opacity: .75; }
.brand-mark span:nth-child(3) { width: 44%; opacity: .5; }
.brand-text { display: grid; gap: 2px; }
.brand-text strong { font-size: 12px; letter-spacing: .17em; font-weight: 700; }
.micro-label, .eyebrow { color: var(--muted); font: 9px/1.2 var(--mono); letter-spacing: .16em; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: #9aa5a3; font: 9px var(--mono); letter-spacing: .12em; }
.topbar-status i { width: 3px; height: 3px; border-radius: 50%; background: #596669; margin: 0 3px; }
.status-dot, .badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(158, 188, 155, .6); }
.layout { width: 100%; max-width: 1680px; margin: 0 auto; padding: 18px 24px 20px; display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 20px; min-height: 0; }
.control-deck { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 21px 20px 17px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(160deg, rgba(31, 40, 42, .92), rgba(20, 26, 28, .98) 56%); scrollbar-width: thin; scrollbar-color: #435052 transparent; }
.deck-intro h1 { margin: 10px 0 8px; font-size: clamp(22px, 2vw, 27px); line-height: 1.08; letter-spacing: -.045em; font-weight: 620; }
.deck-intro p { max-width: 255px; margin: 0; color: #9ba7a5; font-size: 12px; line-height: 1.55; }
.preset-section { margin-top: 23px; padding-top: 15px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; color: #aab5b1; font: 9px var(--mono); letter-spacing: .13em; }
.section-note { color: #657174; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.preset-button { min-height: 35px; padding: 0 8px; border: 1px solid #344043; border-radius: 7px; background: #20292c; color: #b7c1be; font-size: 10px; font-weight: 600; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.preset-button:hover { border-color: #8b744e; color: var(--text); }
.preset-button.active { border-color: #8d744d; background: rgba(231, 183, 107, .12); color: var(--accent-2); }
.sliders { display: grid; gap: 16px; margin-top: 22px; }
.control-row { min-width: 0; }
.control-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.control-top label { color: #d6ddd7; font-size: 11px; font-weight: 560; }
.control-top .unit { color: #82908f; font-size: 10px; font-weight: 450; }
.control-top output { color: var(--accent-2); font: 11px var(--mono); white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 15px; margin: 7px 0 1px; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #b48d55, #455154); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #b48d55, #455154); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #f0d29e; border-radius: 50%; background: #8d6d42; box-shadow: 0 0 0 3px rgba(231, 183, 107, .12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #f0d29e; border-radius: 50%; background: #8d6d42; box-shadow: 0 0 0 3px rgba(231, 183, 107, .12); }
.range-foot { display: flex; justify-content: space-between; color: #667477; font: 8px var(--mono); letter-spacing: .02em; }
.range-foot b { margin-left: 5px; color: #87918d; font-size: 7px; font-weight: 500; letter-spacing: .08em; }
.deck-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 23px; padding-top: 14px; border-top: 1px solid var(--line); }
.quality-copy { display: grid; gap: 4px; }
.quality-copy > span:last-child { color: #7e8c8d; font-size: 9px; }
.quality-button { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 9px; border: 1px solid #394447; border-radius: 6px; background: #20292c; color: #cbd3ce; font: 9px var(--mono); letter-spacing: .08em; cursor: pointer; }
.quality-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(231, 183, 107, .45); }
.exhibit { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #435052 transparent; display: grid; grid-template-rows: auto minmax(230px, 1fr) auto auto auto; gap: 12px; }
.stage-heading { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-heading .eyebrow { margin-bottom: 4px; }
.stage-subtitle { color: #b8c2be; font: 10px var(--mono); letter-spacing: .12em; }
.flow-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #3b4a43; border-radius: 20px; background: rgba(107, 137, 111, .08); color: #b4cbb0; font: 8px var(--mono); letter-spacing: .12em; white-space: nowrap; }
.flow-badge.silent { border-color: #55453d; background: rgba(160, 107, 85, .08); color: #d1a08c; }
.flow-badge.silent .badge-dot { background: var(--red); box-shadow: 0 0 8px rgba(213, 142, 119, .45); }
.canvas-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #354043; border-radius: 12px; background: #151e21; box-shadow: 0 16px 50px rgba(0, 0, 0, .17); }
#scene { display: block; width: 100%; height: 100%; }
.scene-topline { position: absolute; top: 13px; left: 16px; right: 16px; display: flex; align-items: center; gap: 9px; color: #82918e; font: 8px var(--mono); letter-spacing: .11em; pointer-events: none; }
.scene-topline b { color: #c4cdc5; font-weight: 500; }
.flow-arrow { color: #6d7c78; }
.scene-key { position: absolute; top: 41px; right: 15px; display: flex; gap: 12px; color: #9ba8a2; font: 7px var(--mono); letter-spacing: .08em; pointer-events: none; }
.scene-key span { display: flex; align-items: center; gap: 5px; }
.key-grain { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px rgba(231, 183, 107, .7); }
.key-wave { width: 10px; height: 2px; border-top: 1px solid #a6c5c4; border-radius: 50%; }
.scene-caption { position: absolute; left: 16px; bottom: 29px; max-width: min(440px, 67%); padding: 9px 12px; border-left: 2px solid var(--accent); background: rgba(14, 19, 21, .72); color: #d8dfd8; font-size: 10px; line-height: 1.45; backdrop-filter: blur(8px); pointer-events: none; }
.scene-scale { position: absolute; right: 14px; bottom: 13px; color: #72807d; font: 7px var(--mono); letter-spacing: .1em; pointer-events: none; }
.scene-scale span { color: #a0784c; padding: 0 4px; }
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.readout-card { min-width: 0; min-height: 76px; padding: 10px 13px 9px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(135deg, #1a2225, #171e21); }
.readout-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #94a09d; font: 8px var(--mono); letter-spacing: .1em; }
.readout-kind { color: #687675; font-size: 7px; white-space: nowrap; }
.readout-value { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; }
.readout-value strong { color: #f0d19b; font: 22px/1 var(--mono); font-weight: 500; letter-spacing: -.06em; }
.readout-value span { color: #9aa6a1; font: 10px var(--mono); }
.readout-foot { margin-top: 5px; color: #6e7d7c; font: 7px var(--mono); letter-spacing: .08em; }
.sync-track { height: 3px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: #354044; }
.sync-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b68c55, #e9c17f); transition: width .18s ease; }
.action-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(270px, .85fr); gap: 10px; min-width: 0; }
.transport { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.action-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 1px solid #354044; border-radius: 7px; background: #1c2528; color: #c1cbc5; font-size: 9px; font-weight: 600; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.action-button:hover { border-color: #7c6848; background: #242d2f; }
.action-button:active { transform: translateY(1px); }
.primary-action { border-color: #8b7049; background: rgba(231, 183, 107, .13); color: #f1d4a2; }
.primary-action:hover { background: rgba(231, 183, 107, .2); }
.pause-icon { font-size: 11px; }
.step-glyph { color: var(--accent); font-size: 16px; line-height: 0; }
.screenshot-action { margin-left: auto; }
.screenshot-action span { color: var(--accent); font-size: 12px; }
.check-card { min-width: 0; padding: 8px 11px 7px; border: 1px solid #344043; border-radius: 8px; background: rgba(25, 34, 36, .85); }
.check-title { color: #84918e; font: 7px var(--mono); letter-spacing: .12em; }
.check-title span { margin-left: 4px; color: #c2a16d; }
.check-main { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; color: #9ca9a4; font: 8px var(--mono); }
.check-main strong { color: #e5c58e; font-size: 12px; font-weight: 500; }
.check-main i { color: #586663; font-style: normal; }
.check-main small { color: #81908b; }
.check-delta { margin-top: 3px; color: #71817c; font: 7px var(--mono); }
.science-panel { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: rgba(24, 31, 33, .72); }
.science-panel summary { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 13px; color: #d5ddd5; cursor: pointer; list-style: none; font: 9px var(--mono); letter-spacing: .13em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { color: var(--accent); font: 15px Georgia, serif; }
.science-summary-note { margin-left: auto; color: #72807d; font: 8px var(--sans); letter-spacing: 0; }
.chevron { color: #8e9a94; font-size: 14px; transition: transform .18s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 4px 15px 15px; border-top: 1px solid #293336; }
.science-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 22px; padding: 13px 0; }
.science-grid h2 { margin: 0 0 6px; color: #e3c28d; font-size: 10px; font-weight: 650; }
.science-grid p, .science-content p { margin: 0; color: #9aa7a1; font-size: 10px; line-height: 1.55; }
.equation { margin: 4px 0 7px; color: #f0d6a7; font: 13px var(--mono); letter-spacing: -.03em; }
.audit-note { padding: 10px 12px; border-left: 2px solid #9c8155; background: rgba(231, 183, 107, .055); color: #aab5ae; font-size: 9px; line-height: 1.55; }
.audit-note strong { color: #e5d2ae; }
.textbook-tag, .illustrative-tag, .scaled-tag { padding: 2px 4px; color: #d9c08f; font: 7px var(--mono); letter-spacing: .06em; }
.model-limit { margin-top: 10px !important; }
.affiliation-note { margin-top: 8px !important; color: #d0d7ce !important; font-size: 9px !important; }
.references { margin-top: 8px !important; color: #73817d !important; font-size: 8px !important; }

@media (max-width: 980px) and (min-width: 761px) {
  .layout { grid-template-columns: 270px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .control-deck { padding: 17px 15px; }
  .action-row { grid-template-columns: 1fr; }
  .check-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .check-delta { margin-top: 0; }
  .screenshot-action { margin-left: 0; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-rows: 56px minmax(0, 1fr); }
  .topbar { height: 56px; padding: 0 13px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-text strong { font-size: 10px; }
  .micro-label { font-size: 7px; }
  .topbar-status { gap: 6px; font-size: 7px; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, .88fr); gap: 9px; padding: 9px 9px 10px; height: calc(100dvh - 56px); }
  .exhibit { grid-row: 1; grid-template-rows: auto minmax(125px, 1fr) auto auto auto; gap: 8px; }
  .control-deck { grid-row: 2; padding: 15px 15px 13px; }
  .deck-intro h1 { margin: 6px 0 5px; font-size: 21px; }
  .deck-intro p { max-width: none; font-size: 10px; line-height: 1.4; }
  .preset-section { margin-top: 13px; padding-top: 11px; }
  .preset-grid { margin-top: 7px; }
  .preset-button { min-height: 31px; }
  .sliders { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 12px; margin-top: 14px; }
  .control-top label { font-size: 9px; }
  .control-top .unit, .control-top output { font-size: 9px; }
  .range-foot { font-size: 7px; }
  .range-foot b { font-size: 6px; }
  .deck-footer { margin-top: 14px; padding-top: 10px; }
  .stage-heading { min-height: 28px; }
  .stage-subtitle { font-size: 8px; }
  .flow-badge { padding: 6px 8px; font-size: 7px; }
  .scene-topline { top: 9px; left: 10px; right: 10px; gap: 5px; font-size: 6px; }
  .scene-key { top: 29px; right: 10px; gap: 7px; font-size: 6px; }
  .scene-caption { left: 9px; bottom: 23px; max-width: 50%; padding: 6px 8px; font-size: 9px; }
  .scene-scale { right: 9px; bottom: 9px; font-size: 6px; }
  .readouts { gap: 6px; }
  .readout-card { min-height: 62px; padding: 7px 8px 6px; }
  .readout-head { font-size: 6px; letter-spacing: .06em; }
  .readout-kind { font-size: 5px; }
  .readout-value { margin-top: 4px; gap: 4px; }
  .readout-value strong { font-size: 17px; }
  .readout-value span { font-size: 8px; }
  .readout-foot { margin-top: 3px; font-size: 5px; }
  .sync-track { margin-top: 6px; }
  .action-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .transport { gap: 5px; }
  .action-button { min-height: 29px; padding: 0 8px; font-size: 8px; }
  .screenshot-action { margin-left: auto; }
  .check-card { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; }
  .check-title { font-size: 6px; }
  .check-main { margin-top: 0; gap: 4px; font-size: 6px; }
  .check-main strong { font-size: 10px; }
  .check-main small { font-size: 6px; }
  .check-delta { margin-top: 0; font-size: 6px; white-space: nowrap; }
  .science-panel summary { min-height: 32px; padding: 0 10px; font-size: 8px; }
  .science-summary-note { font-size: 7px; }
  .science-grid { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 390px) {
  .layout { grid-template-rows: minmax(0, 1fr) minmax(0, .78fr); }
  .topbar-status { font-size: 6px; }
  .scene-topline { gap: 4px; letter-spacing: .05em; }
  .readout-card { padding-left: 6px; padding-right: 6px; }
  .readout-value strong { font-size: 15px; }
  .check-delta { display: none; }
  .screenshot-action { margin-left: 0; }
}
@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-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .layout { min-height: 0; }
@media (max-width: 760px) {
  body.embed-mode .layout { height: calc(100dvh - 56px); overflow: hidden; }
  body.embed-mode .control-deck { min-height: 0; }
}
