:root {
  color-scheme: dark;
  --bg: #08131b;
  --panel: #0e1d27;
  --panel-2: #12242f;
  --line: #243a46;
  --line-soft: rgba(150, 190, 204, .13);
  --text: #edf6f8;
  --muted: #9bb0b9;
  --dim: #6f8792;
  --accent: #7de4ef;
  --accent-soft: rgba(125, 228, 239, .12);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(100%, 1680px); margin: 0 auto; padding: 0 28px 20px; }
.site-header { height: 72px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.brand-mark { width: 28px; height: 30px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: skewY(-18deg); }
.brand-mark span { display: block; width: 5px; border-radius: 8px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 12px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 22px; }
.brand-mark span:nth-child(3) { height: 16px; opacity: .75; }
.brand-copy { display: grid; gap: 2px; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .17em; line-height: 1.3; }
.brand-name { font-size: 16px; letter-spacing: .16em; font-weight: 800; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.live-dot, .state-dot, .key-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(125,228,239,.55); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(370px, .92fr); gap: 20px; padding-top: 20px; align-items: start; }
.visual-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.stage { position: relative; height: clamp(450px, 61vw, 690px); min-height: 450px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #091923; isolation: isolate; }
#venturiCanvas, #jetCanvas { display: block; width: 100%; height: 100%; }
.preview-fallback { width: 100%; height: 100%; object-fit: cover; }
.stage-topline { position: absolute; z-index: 2; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.stage-kicker { display: block; color: var(--accent); font-size: 9px; letter-spacing: .16em; font-weight: 800; }
.stage-sub { display: block; margin-top: 5px; color: #8199a4; font-size: 8px; letter-spacing: .12em; font-weight: 700; }
.stage-state { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(125,228,239,.25); border-radius: 30px; padding: 7px 10px; background: rgba(7,20,28,.78); color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.stage-state.stable { color: #b8c7ce; border-color: rgba(184,199,206,.25); }
.stage-state.stable .state-dot { background: #9eb1ba; box-shadow: none; }
.stage-bottomline { position: absolute; bottom: 16px; left: 20px; right: 20px; display: flex; flex-wrap: wrap; gap: 15px; color: #8da3ad; font-size: 8px; font-weight: 700; letter-spacing: .11em; pointer-events: none; }
.stage-bottomline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { width: 14px; height: 2px; background: var(--accent); display: inline-block; }
.legend-ring { width: 9px; height: 9px; border: 1px solid var(--accent); border-radius: 50%; display: inline-block; }
.legend-drop { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.observation-strip { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; background: rgba(14,29,39,.72); }
.observation-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.strip-label { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .16em; margin-bottom: 5px; }
.observation-strip p { margin: 0; color: #c4d3d9; font-size: 12px; line-height: 1.55; }
.experiment-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: linear-gradient(135deg, rgba(18,36,47,.94), rgba(12,27,37,.94)); }
.experiment-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.experiment-head h2 { margin: 4px 0 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.primary-button { border: 1px solid rgba(125,228,239,.45); background: var(--accent-soft); color: var(--accent); padding: 10px 13px; border-radius: 8px; font-size: 9px; font-weight: 850; letter-spacing: .11em; white-space: nowrap; cursor: pointer; transition: background .18s, transform .18s; }
.primary-button:hover { background: rgba(125,228,239,.2); transform: translateY(-1px); }
.primary-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.experiment-copy { color: var(--muted); font-size: 11px; line-height: 1.55; margin: 10px 0 12px; }
.experiment-result { min-height: 42px; border-top: 1px solid var(--line-soft); padding-top: 10px; color: #c4d3d9; font-size: 11px; line-height: 1.5; }
.result-placeholder { color: var(--dim); }
.result-values { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.result-values b { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }
.result-values small { display: block; color: var(--dim); font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.control-column { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: linear-gradient(180deg, #10212c 0%, #0d1b25 100%); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-heading h1 { max-width: 360px; margin: 7px 0 6px; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.08; letter-spacing: -.045em; font-weight: 680; }
.panel-intro { margin: 0; max-width: 330px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.quality-control { display: flex; flex: 0 0 auto; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #091721; }
.quality-button { border: 0; background: transparent; color: var(--dim); padding: 6px 7px; border-radius: 4px; font-size: 8px; letter-spacing: .1em; font-weight: 800; cursor: pointer; }
.quality-button.active { color: var(--accent); background: var(--accent-soft); }
.preset-block, .controls-block, .readout-block { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line-soft); }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; color: #c2d0d6; font-size: 9px; letter-spacing: .13em; font-weight: 800; }
.section-label span { color: var(--dim); font-size: 7px; letter-spacing: .1em; white-space: nowrap; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { text-align: left; min-height: 57px; border: 1px solid var(--line); border-radius: 8px; background: rgba(6,18,26,.48); padding: 9px 10px; cursor: pointer; transition: border-color .16s, background .16s; }
.preset-button b { display: block; color: #dce8ec; font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.preset-button small { display: block; color: #8298a2; font-size: 8px; line-height: 1.35; }
.preset-button:hover, .preset-button.selected { border-color: rgba(125,228,239,.58); background: var(--accent-soft); }
.preset-button.selected b { color: var(--accent); }
.control-row { margin-top: 12px; }
.control-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.control-top label { color: #d7e3e7; font-size: 10px; font-weight: 600; }
.control-top output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: #344c58; }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #344c58; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #07151d; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #07151d; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.range-ends { display: flex; justify-content: space-between; color: #667e89; font-size: 8px; font-variant-numeric: tabular-nums; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout { min-height: 74px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(5,17,25,.44); }
.readout-name { display: block; color: #91a7b0; font-size: 8px; font-weight: 650; letter-spacing: .07em; }
.readout strong { display: block; margin-top: 6px; color: #eff8fa; font-size: 20px; line-height: 1; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout strong small { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0; }
.readout-tag { display: block; margin-top: 6px; color: #6e8792; font-size: 6px; font-weight: 800; letter-spacing: .11em; }
.regime-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 9px; padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.regime-line.stable { color: #b5c5cc; background: rgba(160,180,190,.08); }
.regime-line span { font-weight: 600; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.playback-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; margin-top: 16px; }
.play-button, .transport-button { min-height: 35px; border: 1px solid var(--line); border-radius: 7px; background: rgba(5,17,25,.48); color: #b9cbd1; font-size: 8px; font-weight: 850; letter-spacing: .12em; cursor: pointer; }
.play-button { border-color: rgba(125,228,239,.4); background: var(--accent-soft); color: var(--accent); }
.play-button span:first-child { margin-right: 6px; font-size: 11px; }
.play-button:hover, .transport-button:hover { border-color: var(--accent); }
.number-key { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; color: #708893; font-size: 8px; line-height: 1.4; }
.number-key .key-dot { display: none; }
.number-key b { color: #a9bec6; font-size: 7px; letter-spacing: .1em; }
.science-section { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: #0d1b25; overflow: hidden; }
.science-section details > summary { min-height: 68px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.science-section details > summary::-webkit-details-marker { display: none; }
.science-section details > summary strong { display: block; margin-top: 3px; font-size: 17px; font-weight: 650; }
.details-hint { color: #7f96a0; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.details-hint b { display: inline-grid; place-items: center; margin-left: 10px; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-size: 13px; }
.science-section details[open] .details-hint b { content: "−"; }
.science-content { padding: 0 18px 18px; border-top: 1px solid var(--line-soft); }
.science-equation { padding: 18px 0 15px; }
.equation-label { color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.equation { margin: 12px 0 8px; color: #e8f4f6; font-family: Georgia, "Times New Roman", serif; font-size: clamp(16px, 2vw, 24px); letter-spacing: .01em; overflow-wrap: anywhere; }
.science-equation p, .science-grid p { color: #9eb2ba; font-size: 11px; line-height: 1.65; margin: 0; }
.science-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; padding: 15px 0; border-top: 1px solid var(--line-soft); }
.science-grid h3, .checks-title h3 { color: #dbe8ec; font-size: 11px; margin: 0 0 7px; font-weight: 700; }
.science-grid p { font-size: 10px; }
.checks-block { padding-top: 15px; border-top: 1px solid var(--line-soft); }
.checks-title { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.checks-title span { color: var(--dim); font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.checks-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.check-item { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: rgba(5,17,25,.35); }
.check-item span { color: #91a7b0; font-size: 9px; line-height: 1.4; }
.check-item b { color: var(--accent); font-size: 9px; font-variant-numeric: tabular-nums; }
.source-note { margin: 13px 0 0; color: #708791; font-size: 9px; line-height: 1.55; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 2px 0; color: #607782; font-size: 7px; font-weight: 800; letter-spacing: .15em; }
button:focus-visible, summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1.7fr) minmax(390px, .8fr); } }
@media (max-width: 1050px) {
  .app-shell { padding: 0 18px 18px; }
  .workspace { grid-template-columns: minmax(0, 1.2fr) minmax(340px, .95fr); gap: 14px; }
  .control-column { padding: 16px; }
  .stage { height: 570px; min-height: 420px; }
  .science-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 12px 16px; }
  .site-header { height: 60px; }
  .header-right { font-size: 7px; }
  .workspace { grid-template-columns: minmax(0,1fr); gap: 12px; padding-top: 12px; }
  .stage { height: min(112vw, 480px); min-height: 300px; }
  .control-column { padding: 16px; }
  .panel-heading h1 { font-size: 26px; }
  .science-section { margin-top: 12px; }
  .checks-grid { grid-template-columns: repeat(2,1fr); }
  .page-footer { flex-direction: column; gap: 6px; }
}
@media (max-width: 420px) {
  .app-shell { padding-left: 8px; padding-right: 8px; }
  .header-right { max-width: 120px; line-height: 1.35; text-align: right; }
  .stage { height: 370px; min-height: 300px; border-radius: 10px; }
  .stage-topline { top: 13px; left: 12px; right: 12px; }
  .stage-bottomline { left: 12px; right: 12px; bottom: 12px; gap: 9px; font-size: 7px; }
  .stage-sub { font-size: 7px; }
  .control-column { padding: 13px; }
  .panel-heading { flex-wrap: wrap; }
  .quality-control { margin-left: auto; }
  .preset-grid { gap: 6px; }
  .preset-button { min-height: 56px; padding: 8px; }
  .readout strong { font-size: 18px; }
  .science-section details > summary { padding: 12px; }
  .details-hint { font-size: 7px; }
  .science-content { padding: 0 12px 14px; }
  .science-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .experiment-card { padding: 13px; }
  .experiment-head { align-items: flex-start; }
  .experiment-head h2 { font-size: 15px; }
  .primary-button { padding: 9px 10px; font-size: 8px; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; padding: 0 12px 10px; overflow: hidden; }
body.embed-mode .site-header { display: none; }
body.embed-mode .workspace { flex: 1; min-height: 0; padding-top: 10px; grid-template-columns: minmax(0, 1.5fr) minmax(340px, .9fr); overflow: hidden; align-items: stretch; }
body.embed-mode .visual-column { min-height: 0; height: 100%; overflow: hidden; }
body.embed-mode .stage { height: auto; min-height: 0; flex: 1 1 auto; }
body.embed-mode .observation-strip { flex: 0 0 auto; }
body.embed-mode .experiment-card { flex: 0 0 auto; }
body.embed-mode .control-column { min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
body.embed-mode .science-section { flex: 0 0 auto; margin-top: 10px; }
body.embed-mode .page-footer { display: none; }
@media (max-width: 760px) {
  body.embed-mode .app-shell { padding: 0 8px 8px; }
  body.embed-mode .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(280px, 44dvh) minmax(0,1fr); gap: 8px; padding-top: 8px; }
  body.embed-mode .visual-column { min-height: 0; gap: 7px; }
  body.embed-mode .stage { min-height: 0; height: auto; flex: 1 1 auto; }
  body.embed-mode .observation-strip { padding: 8px 10px; }
  body.embed-mode .observation-icon { width: 24px; height: 24px; flex-basis: 24px; font-size: 17px; }
  body.embed-mode .observation-strip p { font-size: 10px; line-height: 1.35; }
  body.embed-mode .strip-label { margin-bottom: 3px; }
  body.embed-mode .experiment-card { display: none; }
  body.embed-mode .control-column { padding: 12px; }
  body.embed-mode .panel-heading h1 { font-size: 22px; }
  body.embed-mode .panel-intro { font-size: 10px; }
  body.embed-mode .preset-block, body.embed-mode .controls-block, body.embed-mode .readout-block { margin-top: 13px; padding-top: 12px; }
  body.embed-mode .control-row { margin-top: 8px; }
  body.embed-mode .number-key { display: none; }
  body.embed-mode .science-section { display: none; }
}
