:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #101923;
  --panel-2: #131f2b;
  --line: #263441;
  --line-soft: rgba(130, 160, 184, .14);
  --text: #e8f0f5;
  --muted: #91a4b2;
  --dim: #607382;
  --accent: #56d6d0;
  --accent-2: #2ba9ad;
  --gold: #e0b76d;
  --warning: #f0b56d;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; min-width: 320px; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 52% 0%, rgba(26, 58, 69, .18), transparent 42%), var(--bg); }
.topbar { height: 76px; flex: 0 0 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(10, 16, 23, .94); }
.identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.mark { width: 34px; height: 34px; border: 1px solid rgba(86,214,208,.38); border-radius: 10px; position: relative; display: grid; place-items: center; background: rgba(86,214,208,.07); flex: 0 0 auto; }
.mark span { width: 15px; height: 15px; border: 2px solid var(--accent); border-radius: 50% 50% 48% 48%; transform: rotate(45deg); position: absolute; }
.mark i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); position: absolute; }
.eyebrow, .section-kicker { color: #7e95a5; font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.3; }
.eyebrow span { color: var(--accent); padding: 0 4px; }
h1 { margin: 3px 0 0; font-size: 19px; line-height: 1.1; letter-spacing: -.025em; font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.run-state { display: flex; align-items: center; gap: 7px; color: #a5b8c3; font: 700 9px var(--mono); letter-spacing: .11em; margin-right: 10px; }
.state-dot, .live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(86,214,208,.65); }
.icon-button, .screenshot-button { height: 34px; border: 1px solid #2b3a47; border-radius: 7px; background: #121e29; padding: 0 11px; display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: #c5d3dc; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.icon-button:hover, .screenshot-button:hover { background: #1a2b37; border-color: #49616f; }
.icon-button:active, .screenshot-button:active { transform: translateY(1px); }
.icon-button:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pause-glyph { width: 9px; height: 11px; border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.step-glyph { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 8px solid var(--accent); position: relative; }
.step-glyph:after { content: ""; position: absolute; right: -4px; top: -6px; width: 2px; height: 12px; background: var(--accent); }
.reset-glyph { color: var(--accent); font-size: 17px; line-height: 1; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: 264px minmax(380px, 1fr) 282px; gap: 12px; padding: 12px; overflow: hidden; }
.panel, .stage-panel { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(180deg, rgba(19,31,43,.96), rgba(14,23,32,.98)); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.controls-panel, .telemetry-panel { padding: 17px 16px 14px; overflow: auto; scrollbar-width: thin; scrollbar-color: #314654 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 17px; }
.panel-heading h2 { font-size: 16px; margin: 4px 0 0; letter-spacing: -.02em; font-weight: 640; }
.tiny-tag { border: 1px solid rgba(224,183,109,.24); background: rgba(224,183,109,.07); color: #c8a76f; border-radius: 4px; padding: 4px 5px; font: 700 8px var(--mono); letter-spacing: .07em; }
.preset-block { border-bottom: 1px solid var(--line-soft); padding-bottom: 15px; margin-bottom: 15px; }
.control-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.control-label-row label { font-size: 11px; color: #d1dde4; font-weight: 620; }
.info-dot { width: 14px; height: 14px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid #4a6474; color: #92a9b8; font: 700 9px var(--mono); cursor: help; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.preset-button { height: 32px; border: 1px solid #2d3f4c; border-radius: 6px; background: #0f1922; color: #9eb0bc; font-size: 10px; font-weight: 620; cursor: pointer; transition: all .16s ease; }
.preset-button:hover { border-color: #55727e; color: #dce8ee; }
.preset-button.active { background: rgba(86,214,208,.11); border-color: rgba(86,214,208,.55); color: #9be9e4; box-shadow: inset 0 0 0 1px rgba(86,214,208,.06); }
.preset-note { margin: 8px 0 0; color: #718593; font-size: 9px; line-height: 1.45; }
.slider-control { margin: 0 0 16px; }
.value { color: var(--accent); font: 600 11px var(--mono); white-space: nowrap; }
.value small { color: #718995; font: 500 8px var(--sans); letter-spacing: .02em; margin-left: 2px; }
input[type="range"] { appearance: none; width: 100%; height: 16px; margin: 7px 0 0; background: transparent; cursor: ew-resize; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-2), #35505d); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-2), #35505d); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; background: #d4fffb; border: 3px solid #2da9a8; box-shadow: 0 0 0 3px rgba(86,214,208,.1); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d4fffb; border: 3px solid #2da9a8; box-shadow: 0 0 0 3px rgba(86,214,208,.1); }
.range-ends { display: flex; justify-content: space-between; color: #617583; font: 9px var(--mono); margin-top: 0; }
.hint { color: #748895; font-size: 9px; line-height: 1.4; margin: 5px 0 0; }
.last-slider { margin-bottom: 10px; }
.panel-footnote { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 10px; color: #708491; font-size: 9px; line-height: 1.45; }
.footnote-mark { color: var(--accent); font-size: 13px; margin-right: 4px; }
.stage-panel { display: flex; flex-direction: column; overflow: hidden; background: #0d151d; }
.stage-toolbar { height: 49px; flex: 0 0 49px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid var(--line); gap: 8px; }
.view-tabs { display: flex; align-items: center; gap: 3px; min-width: 0; }
.view-tab { height: 29px; padding: 0 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #8499a7; font-size: 10px; font-weight: 620; cursor: pointer; white-space: nowrap; }
.view-tab:hover { color: #d9e6ec; background: rgba(255,255,255,.03); }
.view-tab.active { color: #a7f0e9; background: rgba(86,214,208,.1); border-color: rgba(86,214,208,.22); }
.stage-tools { display: flex; align-items: center; gap: 8px; }
.quality-toggle { display: flex; padding: 2px; border: 1px solid #2b3b47; border-radius: 5px; background: #0b131b; }
.quality-toggle button { border: 0; background: transparent; color: #728593; border-radius: 3px; padding: 4px 7px; font-size: 9px; cursor: pointer; }
.quality-toggle button.selected { background: #233844; color: #d1e7e8; }
.screenshot-button { height: 27px; padding: 0 8px; border-radius: 5px; font-size: 9px; }
.screenshot-button:first-letter { color: var(--accent); }
.canvas-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 50%, rgba(23,54,64,.2), transparent 65%), #0c141c; }
#machineCanvas { display: block; width: 100%; height: 100%; }
.canvas-hud { position: absolute; top: 12px; display: flex; align-items: center; gap: 7px; color: #728996; font: 700 8px var(--mono); letter-spacing: .11em; pointer-events: none; }
.hud-left { left: 14px; }
.hud-right { right: 14px; color: #6e8998; letter-spacing: .03em; }
.hud-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(86,214,208,.5); }
.hud-separator { color: #3d5563; }
.caption-strip { min-height: 66px; flex: 0 0 auto; display: flex; align-items: center; gap: 11px; padding: 10px 16px; border-top: 1px solid var(--line); background: #101a24; }
.caption-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: rgba(86,214,208,.09); font-size: 14px; }
.caption-title { color: #75909d; font: 700 8px var(--mono); letter-spacing: .13em; margin-bottom: 3px; }
.caption-strip p { margin: 0; color: #b4c3cc; font-size: 10px; line-height: 1.45; }
.telemetry-heading { margin-bottom: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid rgba(86,214,208,.2); border-radius: 4px; color: #8fded9; font: 700 8px var(--mono); letter-spacing: .1em; }
.live-pill i { width: 5px; height: 5px; }
.readout { border: 1px solid rgba(75,100,116,.24); border-radius: 7px; background: rgba(8,15,22,.45); padding: 11px 11px 10px; min-width: 0; }
.primary-readout { margin-bottom: 8px; border-color: rgba(86,214,208,.2); background: linear-gradient(135deg, rgba(29,76,78,.2), rgba(9,18,26,.48)); }
.readout-top { display: flex; align-items: center; justify-content: space-between; color: #9aadb9; font-size: 10px; font-weight: 600; }
.readout-unit { color: #5f7887; font: 9px var(--mono); }
.readout-number { color: #e7f7f5; font: 500 24px var(--mono); letter-spacing: -.06em; margin: 7px 0 2px; white-space: nowrap; }
.readout-number small { color: #6f8993; font: 500 8px var(--sans); letter-spacing: 0; margin-left: 3px; vertical-align: middle; }
.primary-readout .readout-number { color: #9af0e9; font-size: 30px; }
.readout-sub { color: #657987; font-size: 8px; line-height: 1.4; }
.meter-track { height: 3px; background: #20323e; border-radius: 3px; overflow: hidden; margin-top: 10px; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, #278f91, #74e6dc); border-radius: inherit; transition: width .2s ease; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.compact-readout { padding: 9px 9px 8px; }
.compact-readout .readout-top { font-size: 9px; }
.compact-readout .readout-number { font-size: 18px; margin: 6px 0 3px; }
.compact-readout .readout-number small { font-size: 7px; }
.compact-readout .readout-sub { min-height: 22px; font-size: 7px; }
.valve-status-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 1px 11px; color: #8195a2; font-size: 9px; }
.valve-status-row strong { color: var(--accent); font: 700 9px var(--mono); letter-spacing: .08em; }
.check-card { border: 1px solid rgba(224,183,109,.2); border-radius: 7px; background: rgba(46,38,26,.16); padding: 10px 10px 9px; }
.check-heading { display: flex; justify-content: space-between; color: #b69a6d; font: 700 8px var(--mono); letter-spacing: .11em; }
.check-icon { color: #c6a96e; font-size: 11px; }
.check-title { color: #d8c6a6; font-size: 10px; font-weight: 630; margin: 5px 0 8px; }
.check-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-values div { display: flex; flex-direction: column; gap: 3px; }
.check-values span, .check-difference span { color: #887d6a; font-size: 8px; }
.check-values strong { color: #e3d2b5; font: 600 12px var(--mono); }
.check-difference { border-top: 1px solid rgba(224,183,109,.12); margin-top: 8px; padding-top: 7px; display: flex; justify-content: space-between; align-items: center; }
.check-difference strong { color: #d6bd8e; font: 600 11px var(--mono); }
.check-note { margin: 7px 0 0; color: #847b6c; font-size: 8px; line-height: 1.45; }
.science-panel { margin-top: 11px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.science-panel summary { min-height: 35px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; color: #9eb0bb; font: 700 9px var(--mono); letter-spacing: .12em; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--accent); font-size: 15px; font-weight: 400; transition: transform .18s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 0 11px; }
.science-intro { color: #8ea2af; font-size: 9px; line-height: 1.5; margin: 0 0 10px; }
.equation { padding: 7px 8px; border: 1px solid rgba(86,113,130,.14); border-radius: 5px; margin-bottom: 5px; background: rgba(6,12,18,.3); }
.equation span { display: block; color: #9fb1bb; font-size: 8px; margin-bottom: 4px; }
.equation code { color: #8ddbd4; font: 9px var(--mono); white-space: normal; overflow-wrap: anywhere; }
.constants, .simplifications { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; color: #8599a5; font-size: 8px; line-height: 1.4; }
.constants b, .simplifications b { color: #b8c6cd; font-size: 9px; }
.simplifications p { margin: 0; }
.disclaimer { color: #758996; font-size: 8px; line-height: 1.45; margin: 10px 0 0; }
.model-note { color: #617583; font: 8px var(--mono); letter-spacing: .03em; margin-top: 10px; text-align: center; }
.model-note span { color: #3e5966; padding: 0 3px; }
@media (max-width: 1120px) and (min-width: 761px) {
  .workspace { grid-template-columns: 238px minmax(300px, 1fr) 250px; gap: 9px; padding: 9px; }
  .controls-panel, .telemetry-panel { padding-left: 12px; padding-right: 12px; }
  .stage-toolbar { padding: 0 8px; }
  .view-tab { padding: 0 7px; }
  .screenshot-button span { display: none; }
}
@media (max-width: 760px) {
  body { overflow: hidden; }
  .topbar { height: 62px; flex-basis: 62px; padding: 0 12px; }
  .mark { width: 30px; height: 30px; }
  .eyebrow { font-size: 7px; letter-spacing: .12em; }
  h1 { font-size: 16px; }
  .top-actions { gap: 5px; }
  .run-state { margin-right: 2px; font-size: 7px; gap: 5px; }
  .icon-button { width: 33px; height: 32px; padding: 0; justify-content: center; gap: 0; }
  .icon-button span:last-child { display: none; }
  .reset-button { width: 31px; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: max(260px, 42dvh) max-content max-content; align-content: start; gap: 9px; padding: 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #314654 transparent; }
  .stage-panel { grid-row: 1; min-height: 260px; }
  .controls-panel { grid-row: 2; overflow: visible; min-height: max-content; padding: 14px 13px; }
  .telemetry-panel { grid-row: 3; overflow: visible; min-height: max-content; padding: 14px 13px; }
  .stage-toolbar { height: 43px; flex-basis: 43px; padding: 0 7px; }
  .view-tabs { gap: 0; }
  .view-tab { height: 27px; padding: 0 7px; font-size: 9px; }
  .quality-toggle button { padding: 4px 5px; font-size: 8px; }
  .screenshot-button { width: 28px; padding: 0; justify-content: center; font-size: 13px; }
  .screenshot-button span { display: none; }
  .canvas-hud { top: 8px; font-size: 7px; }
  .hud-left { left: 9px; }
  .hud-right { right: 9px; }
  .caption-strip { min-height: 58px; padding: 8px 10px; gap: 8px; }
  .caption-icon { width: 24px; height: 24px; flex-basis: 24px; }
  .caption-strip p { font-size: 9px; }
  .panel-heading { margin-bottom: 13px; }
  .preset-block { margin-bottom: 14px; }
  .slider-control { margin-bottom: 14px; }
  .panel-footnote { margin-top: 5px; }
  .telemetry-panel .readout-number { font-size: 22px; }
  .telemetry-panel .primary-readout .readout-number { font-size: 28px; }
  .telemetry-panel .compact-readout .readout-number { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .workspace { min-height: 0; }
body.embed-mode .canvas-wrap { min-height: 0; }
.equation code { display: block; }
.run-state.paused .state-dot { background: var(--warning); box-shadow: 0 0 9px rgba(240,181,109,.55); }
