:root {
  color-scheme: dark;
  --bg: #0a1119;
  --panel: #101b25;
  --panel-2: #13212d;
  --line: rgba(160, 185, 202, .14);
  --line-strong: rgba(160, 185, 202, .24);
  --text: #e7eff4;
  --muted: #8294a2;
  --faint: #586b79;
  --accent: #53d5c4;
  --accent-2: #b4f2e8;
  --water: #4d9bb8;
  --amber: #e8b66b;
  --radius: 12px;
  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; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
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; display: flex; flex-direction: column; background: radial-gradient(ellipse at 20% -10%, rgba(42, 85, 100, .18), transparent 42%), var(--bg); }
.topbar { height: 76px; flex: 0 0 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(9, 16, 23, .94); }
.brand-lockup, .topbar-right, .brand-copy, .live-indicator, .icon-button, .stage-head, .stage-title, .view-switch, .stage-footer, .caption-copy, .transport-controls, .panel-heading, .readout-label, .readout-foot, .metric-value, .efficiency-top, .flow-line, .control-top, .range-hints, .preset-button, .preset-glyph, .check-head, .check-values { display: flex; align-items: center; }
.brand-lockup { gap: 13px; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(83, 213, 196, .42); border-radius: 10px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 8px; transform: rotate(-5deg); }
.brand-mark span { width: 4px; border-radius: 4px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .58; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .76; }
.eyebrow, .section-kicker, .metric-label, .readout-label, .canvas-overlay, .footer-bar, .live-indicator, .check-head, .range-hints, .model-state { letter-spacing: .12em; text-transform: uppercase; font-size: 9px; font-weight: 700; }
.eyebrow { color: var(--muted); margin-bottom: 3px; font-size: 8px; }
h1 { font-size: 18px; font-weight: 620; letter-spacing: -.035em; line-height: 1; margin: 0; }
.topbar-right { gap: 20px; }
.live-indicator { gap: 8px; color: #9fb0bc; font-size: 8px; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(83, 213, 196, .65); }
.icon-button { gap: 8px; background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 11px; color: #b9c8d1; font-size: 11px; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.icon-button:hover { border-color: rgba(83, 213, 196, .55); color: var(--accent-2); background: rgba(83, 213, 196, .06); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 376px; gap: 0; }
.stage-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 18px 20px 16px 24px; border-right: 1px solid var(--line); }
.stage-head { flex: 0 0 46px; justify-content: space-between; gap: 16px; }
.stage-title { align-items: flex-start; flex-direction: column; gap: 4px; }
.section-kicker { color: #8b9eac; font-size: 8px; letter-spacing: .16em; }
.stage-subtitle { color: #c2d0d8; font-size: 12px; }
.view-switch { gap: 3px; padding: 3px; border: 1px solid var(--line); background: rgba(18, 30, 40, .8); border-radius: 8px; }
.view-button { border: 0; background: transparent; color: #8295a3; font-size: 10px; border-radius: 6px; padding: 7px 10px; cursor: pointer; transition: .2s; }
.view-button:hover { color: var(--text); }
.view-button.active { color: #dffbf5; background: rgba(83, 213, 196, .15); box-shadow: inset 0 0 0 1px rgba(83, 213, 196, .18); }
.canvas-wrap { position: relative; flex: 1; min-height: 260px; overflow: hidden; border: 1px solid rgba(150, 180, 196, .16); border-radius: 13px; background: #0b1720; box-shadow: 0 16px 50px rgba(0, 0, 0, .22); }
#machineCanvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.canvas-overlay { position: absolute; color: #728a98; font-size: 8px; pointer-events: none; text-shadow: 0 1px 6px #071018; }
.canvas-overlay.top-left { top: 16px; left: 17px; display: flex; align-items: center; gap: 8px; }
.overlay-dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 8px rgba(83, 213, 196, .7); }
.canvas-overlay.bottom-left { bottom: 15px; left: 17px; }
.canvas-overlay.bottom-left span { color: var(--accent); padding: 0 4px; }
.canvas-overlay.bottom-right { bottom: 15px; right: 17px; }
.stage-footer { flex: 0 0 82px; gap: 12px; padding: 14px 2px 0; }
.caption-icon { align-self: flex-start; color: var(--accent); font-size: 19px; line-height: 1; padding-top: 2px; }
.caption-copy { min-width: 0; flex: 1; align-items: flex-start; flex-direction: column; gap: 4px; }
.caption-copy p { margin: 0; color: #a9bac4; font-size: 11px; line-height: 1.45; max-width: 720px; }
.transport-controls { gap: 6px; flex: 0 0 auto; }
.transport-button { width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(19, 33, 45, .8); color: #a8bac4; cursor: pointer; font-size: 15px; display: grid; place-items: center; transition: .2s; }
.transport-button:hover { color: var(--accent-2); border-color: rgba(83, 213, 196, .55); }
.transport-button.primary { color: #081b1a; border-color: transparent; background: var(--accent); font-weight: 800; }
.transport-button.primary:hover { background: #7ce5d7; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(180deg, rgba(17, 29, 40, .96), rgba(13, 23, 32, .98)); scrollbar-width: thin; scrollbar-color: #304553 transparent; }
.readout-section, .design-section { padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.panel-heading { justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 15px; font-weight: 590; letter-spacing: -.02em; }
.model-state { color: var(--accent); font-size: 8px; border: 1px solid rgba(83, 213, 196, .23); background: rgba(83, 213, 196, .07); border-radius: 20px; padding: 5px 8px; }
.primary-readout { margin-top: 18px; padding: 14px 14px 12px; border: 1px solid rgba(83, 213, 196, .16); border-radius: 10px; background: linear-gradient(120deg, rgba(35, 75, 79, .24), rgba(15, 31, 42, .65)); }
.readout-label { color: #9aadb9; font-size: 8px; gap: 7px; }
.readout-label span { color: var(--accent); font-size: 7px; }
.readout-value { display: flex; align-items: baseline; gap: 7px; margin: 4px 0 10px; }
.readout-value strong { font-size: 34px; font-weight: 560; letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.readout-value small { color: #a5b7c1; font-size: 11px; }
.pressure-track, .efficiency-track { height: 4px; border-radius: 5px; background: rgba(117, 145, 159, .18); overflow: hidden; }
.pressure-track > div { height: 100%; width: 0; background: linear-gradient(90deg, #328c94, var(--accent)); border-radius: inherit; transition: width .22s; }
.readout-foot { justify-content: space-between; margin-top: 8px; color: #708491; font-size: 8px; font-variant-numeric: tabular-nums; }
.readout-foot em { font-style: normal; color: #526876; font-size: 7px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.metric-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(13, 25, 35, .52); min-width: 0; }
.metric-card.wide { grid-column: 1 / -1; }
.metric-label { color: #8498a5; font-size: 7px; }
.metric-value { gap: 5px; margin: 5px 0 3px; align-items: baseline; }
.metric-value strong { font-size: 20px; line-height: 1; letter-spacing: -.04em; font-weight: 570; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 9px; color: #8fa3ae; }
.metric-note { display: block; color: #627783; font-size: 7px; line-height: 1.35; }
.efficiency-top { justify-content: space-between; margin-bottom: 9px; }
.efficiency-top strong { font-size: 14px; font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.efficiency-track { height: 5px; margin-bottom: 7px; }
.efficiency-track > div { height: 100%; width: 0; background: linear-gradient(90deg, #328c94, var(--accent)); border-radius: inherit; transition: width .22s; }
.flow-line { gap: 6px; margin-top: 12px; flex-wrap: wrap; color: #708592; font-size: 8px; letter-spacing: .07em; }
.flow-line strong { color: #c4d1d8; font-size: 9px; font-weight: 570; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.flow-divider { color: #425764; margin: 0 3px; }
.compact h2 { margin-top: 4px; }
.text-button { background: transparent; border: 0; color: #83a99f; font-size: 9px; cursor: pointer; padding: 5px; }
.text-button:hover { color: var(--accent-2); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 14px 0 16px; }
.preset-button { min-width: 0; text-align: left; gap: 8px; padding: 9px 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(10, 21, 30, .55); cursor: pointer; transition: .2s; }
.preset-button:hover { border-color: rgba(83, 213, 196, .35); }
.preset-button.active { border-color: rgba(83, 213, 196, .38); background: rgba(83, 213, 196, .08); }
.preset-glyph { width: 24px; height: 24px; flex: 0 0 24px; justify-content: center; border-radius: 7px; background: rgba(83, 213, 196, .11); color: var(--accent); font-size: 16px; }
.preset-button b { display: block; font-size: 9px; font-weight: 590; color: #d6e1e7; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #718592; font-size: 7px; white-space: nowrap; }
.control-list { display: flex; flex-direction: column; gap: 14px; }
.control-row { min-width: 0; }
.control-top { justify-content: space-between; margin-bottom: 7px; }
.control-top label { color: #bdcbd3; font-size: 10px; }
.control-top output { color: var(--accent-2); font-size: 10px; font-weight: 570; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(83, 213, 196, .56), rgba(100, 129, 144, .35)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(83, 213, 196, .56), rgba(100, 129, 144, .35)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #b8f3e9; border-radius: 50%; background: #238f87; box-shadow: 0 0 0 3px rgba(83, 213, 196, .12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #b8f3e9; border-radius: 50%; background: #238f87; box-shadow: 0 0 0 3px rgba(83, 213, 196, .12); }
.range-hints { justify-content: space-between; color: #617581; font-size: 7px; margin-top: 4px; letter-spacing: .02em; }
.range-hints .classification { color: #526c78; text-transform: lowercase; font-style: italic; }
.design-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; padding: 9px 10px; border-radius: 7px; background: rgba(87, 124, 139, .08); }
.note-mark { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(125, 160, 174, .4); color: #92a9b5; font-size: 9px; line-height: 12px; text-align: center; }
.design-note p { margin: 0; color: #7f939e; font-size: 8px; line-height: 1.45; }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 16px 20px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.science-panel summary b { font-size: 12px; font-weight: 590; }
.chevron { color: #8195a1; font-size: 18px; transition: transform .2s; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 20px 18px; color: #94a7b2; font-size: 9px; line-height: 1.55; }
.science-content h3 { color: #c8d5dc; font-size: 10px; margin: 12px 0 7px; font-weight: 620; }
.science-content p { margin: 6px 0; }
.science-content .equation { color: #d7e9e9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; background: rgba(83, 213, 196, .055); border-left: 2px solid rgba(83, 213, 196, .45); padding: 6px 8px; overflow-wrap: anywhere; }
.science-content ul { padding-left: 16px; margin: 7px 0 12px; }
.science-content li { margin: 5px 0; }
.science-content li b { color: #c3d4db; }
.independent-check { margin-top: 13px; padding: 10px; border: 1px solid rgba(83, 213, 196, .18); border-radius: 8px; background: rgba(83, 213, 196, .045); }
.check-head { justify-content: space-between; color: #91a6b1; font-size: 7px; }
.check-status { color: var(--accent); font-size: 7px; }
.check-values { gap: 10px; margin: 10px 0 6px; }
.check-values > div { flex: 1; min-width: 0; }
.check-values small { display: block; color: #718692; font-size: 7px; margin-bottom: 3px; }
.check-values strong { color: #d7e7e8; font-size: 14px; font-weight: 580; font-variant-numeric: tabular-nums; }
.independent-check p { margin: 5px 0 0; color: #8199a3; font-size: 8px; }
.disclaimer { margin-top: 12px !important; color: #728894; font-style: italic; }
.footer-bar { flex: 0 0 28px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; color: #4e6471; border-top: 1px solid var(--line); font-size: 7px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.embed-mode .workspace { min-height: 0; }
body.embed-mode .control-panel { min-height: 0; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 400px; } .stage-panel { padding-left: 30px; padding-right: 26px; } }
@media (max-width: 1050px) { .workspace { grid-template-columns: minmax(0, 1fr) 340px; } .stage-panel { padding-left: 16px; padding-right: 16px; } .readout-section, .design-section { padding-left: 16px; padding-right: 16px; } }
@media (max-width: 760px) {
  .topbar { height: 58px; flex-basis: 58px; padding: 0 14px; }
  .brand-mark { width: 29px; height: 29px; padding: 6px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 15px; }
  .live-indicator { display: none; }
  .icon-button { padding: 7px 8px; font-size: 9px; }
  .icon-button svg { width: 13px; height: 13px; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(270px, 45dvh) minmax(0, 1fr); min-height: 0; }
  .stage-panel { padding: 10px 10px 8px; border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .stage-head { flex-basis: 40px; gap: 6px; }
  .stage-subtitle { font-size: 9px; }
  .view-switch { gap: 1px; padding: 2px; }
  .view-button { padding: 6px 7px; font-size: 8px; }
  .canvas-wrap { min-height: 0; border-radius: 9px; }
  .canvas-overlay { font-size: 6px; }
  .canvas-overlay.top-left { top: 9px; left: 10px; }
  .canvas-overlay.bottom-left { bottom: 9px; left: 10px; }
  .canvas-overlay.bottom-right { bottom: 9px; right: 10px; }
  .stage-footer { flex-basis: 58px; gap: 8px; padding-top: 8px; }
  .caption-icon { font-size: 15px; }
  .caption-copy { gap: 2px; }
  .caption-copy .section-kicker { font-size: 6px; }
  .caption-copy p { font-size: 8px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .transport-controls { gap: 4px; }
  .transport-button { width: 27px; height: 27px; border-radius: 7px; font-size: 13px; }
  .control-panel { overflow-y: auto; }
  .readout-section, .design-section { padding: 13px 14px 13px; }
  .panel-heading h2 { font-size: 13px; }
  .primary-readout { margin-top: 11px; padding: 10px 11px 9px; }
  .readout-value { margin: 3px 0 7px; }
  .readout-value strong { font-size: 27px; }
  .metric-grid { gap: 6px; margin-top: 6px; }
  .metric-card { padding: 8px 9px; }
  .metric-value { margin: 4px 0 2px; }
  .metric-value strong { font-size: 17px; }
  .metric-note { font-size: 6px; }
  .flow-line { margin-top: 8px; font-size: 7px; }
  .flow-line strong { font-size: 8px; }
  .preset-row { margin: 10px 0 12px; gap: 6px; }
  .preset-button { padding: 7px 6px; gap: 6px; }
  .preset-glyph { width: 20px; height: 20px; flex-basis: 20px; font-size: 13px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .control-list { gap: 10px; }
  .control-top label, .control-top output { font-size: 9px; }
  .range-hints { font-size: 6px; }
  .design-note { margin-top: 11px; }
  .science-panel summary { padding: 13px 14px; }
  .science-content { padding: 0 14px 14px; }
  .footer-bar { display: none; }
}
@media (max-width: 390px) {
  .workspace { grid-template-rows: minmax(255px, 43dvh) minmax(0, 1fr); }
  .stage-subtitle { max-width: 145px; }
  .view-button { padding: 5px 6px; font-size: 7px; }
  .readout-foot { font-size: 7px; }
  .metric-label { 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; }
}
.quality-button { position: absolute; top: 12px; right: 14px; pointer-events: auto; border: 1px solid rgba(130, 163, 176, .26); background: rgba(10, 25, 35, .76); color: #a6c2ca; border-radius: 6px; padding: 5px 8px; font-size: 7px; font-weight: 700; letter-spacing: .12em; cursor: pointer; transition: .2s; }
.quality-button:hover { color: var(--accent-2); border-color: rgba(83, 213, 196, .55); }
@media (max-width: 760px) { .quality-button { top: 8px; right: 9px; padding: 4px 6px; font-size: 6px; } }
