:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111a24;
  --panel-2: #151f2a;
  --line: rgba(172, 194, 212, .13);
  --line-strong: rgba(172, 194, 212, .22);
  --text: #edf3f7;
  --muted: #94a4b2;
  --dim: #657582;
  --accent: #f2a65a;
  --accent-2: #e9824d;
  --cyan: #67c9d8;
  --green: #89c6a4;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-height: 100vh; overflow-x: hidden; }
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 26% 0%, rgba(36, 65, 83, .16), transparent 40%), var(--bg); }
.topbar { height: 82px; flex: 0 0 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(10, 16, 23, .9); }
.brand-lockup { display: flex; align-items: center; gap: 15px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; padding: 5px; border: 1px solid rgba(242,166,90,.5); border-radius: 9px; transform: rotate(-7deg); flex: 0 0 auto; }
.brand-mark span { background: linear-gradient(135deg, #f4b66d, #d86f43); border-radius: 2px; opacity: .9; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .48; }
.eyebrow { color: #8c9ca9; font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.2; }
.eyebrow-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin: 0 5px 1px; }
h1 { margin: 4px 0 0; font-size: 19px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.subhead { margin: 3px 0 0; color: #8999a6; font-size: 11px; line-height: 1.2; }
.header-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.phase-chip { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(242,166,90,.25); background: rgba(242,166,90,.07); border-radius: 20px; color: #f2bf86; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.phase-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(242,166,90,.65); }
.phase-chip.blast { border-color: rgba(103,201,216,.28); background: rgba(103,201,216,.07); color: #94dbe4; }
.phase-chip.blast .phase-dot { background: var(--cyan); box-shadow: 0 0 10px rgba(103,201,216,.6); }
.icon-button { display: flex; align-items: center; gap: 8px; height: 35px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #131d27; color: #c3cfd7; font-size: 10px; font-weight: 650; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.icon-button:hover { border-color: rgba(242,166,90,.55); background: #1a2733; }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 356px; min-height: 0; flex: 1; }
.visual-column { min-width: 0; display: flex; flex-direction: column; padding: 18px 20px 16px 24px; gap: 12px; }
.stage-wrap { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.stage-topline { min-height: 32px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stage-kicker { color: #8b9aa7; font-size: 9px; letter-spacing: .16em; font-weight: 750; display: flex; align-items: center; gap: 8px; padding-top: 5px; }
.live-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(137,198,164,.7); }
.view-switch { display: flex; gap: 3px; padding: 3px; border-radius: 8px; border: 1px solid var(--line); background: #101923; }
.view-button { border: 0; background: transparent; border-radius: 5px; padding: 6px 10px; color: #8797a4; font-size: 10px; font-weight: 650; cursor: pointer; transition: background .2s ease, color .2s ease; }
.view-button:hover { color: #e6edf1; }
.view-button.active { background: #283541; color: #f4c28d; box-shadow: inset 0 0 0 1px rgba(242,166,90,.13); }
.stage { position: relative; min-height: 300px; flex: 1 1 auto; overflow: hidden; border: 1px solid rgba(164,188,207,.14); border-radius: 13px; background: radial-gradient(ellipse at 48% 38%, rgba(39,61,75,.55), transparent 58%), linear-gradient(145deg, #111c27, #0d151e 74%); box-shadow: inset 0 1px rgba(255,255,255,.025), 0 16px 38px rgba(0,0,0,.13); }
.stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(rgba(180,203,220,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(180,203,220,.08) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 95%); }
#machineCanvas { display: block; width: 100%; height: 100%; position: relative; z-index: 1; }
.canvas-corner { position: absolute; z-index: 2; pointer-events: none; color: #7d8e9b; font-size: 8px; letter-spacing: .15em; font-weight: 750; }
.canvas-corner span { color: #d6a06a; }
.canvas-corner.top-left { top: 13px; left: 15px; }
.canvas-corner.bottom-right { right: 14px; bottom: 12px; }
.tiny-tag { font-size: 7px; color: #728391 !important; border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 4px; margin-left: 4px; }
.caption-strip { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 4px 2px; }
.caption-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(242,166,90,.28); border-radius: 8px; background: rgba(242,166,90,.07); }
.caption-icon span { width: 9px; height: 9px; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 9px rgba(242,166,90,.28); }
.caption-label { color: #8494a1; font-size: 8px; font-weight: 800; letter-spacing: .16em; margin-bottom: 4px; }
.caption-strip p { color: #c2cdd5; margin: 0; font-size: 11px; line-height: 1.42; max-width: 780px; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; flex: 0 0 auto; }
.readout-card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, rgba(22,33,44,.92), rgba(16,25,34,.94)); padding: 10px 12px 9px; box-shadow: inset 0 1px rgba(255,255,255,.02); }
.readout-card.primary-readout { border-color: rgba(242,166,90,.25); background: linear-gradient(145deg, rgba(55,43,33,.34), rgba(18,28,37,.95)); }
.readout-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #8b9aa6; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.readout-tag { color: #6f7f8b; border: 1px solid rgba(147,166,181,.18); border-radius: 3px; padding: 2px 4px; font-size: 6px; letter-spacing: .09em; font-weight: 750; flex: 0 0 auto; }
.readout-value { margin-top: 6px; color: #f3f5f6; font-size: clamp(19px, 2.15vw, 26px); font-weight: 650; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.readout-value small { color: #9eacb6; font-size: 10px; font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.primary-readout .readout-value { color: #f4bd82; }
.readout-foot { color: #71818e; font-size: 8px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-strip { display: flex; align-items: center; gap: 10px; min-height: 48px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; background: rgba(14,22,30,.7); }
.audit-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: #9fd2bd; font-size: 17px; background: rgba(137,198,164,.09); }
.audit-copy { min-width: 0; flex: 1; }
.audit-title { color: #8999a5; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.textbook-tag { color: #9bcab5; font-size: 6px; border: 1px solid rgba(137,198,164,.25); padding: 2px 4px; border-radius: 3px; margin-left: 4px; }
.audit-copy p { margin: 4px 0 0; color: #8495a1; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-copy strong { color: #dce5e9; font-weight: 650; font-variant-numeric: tabular-nums; }
.audit-status { flex: 0 0 auto; color: #9bcab5; font-size: 8px; font-weight: 800; letter-spacing: .12em; display: flex; align-items: center; gap: 6px; }
.audit-status span { width: 5px; height: 5px; border-radius: 50%; background: #8cc9a9; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(17,26,36,.98), rgba(13,21,29,.98)); padding: 20px 18px 14px; scrollbar-width: thin; scrollbar-color: #344553 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 17px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 17px; font-weight: 650; letter-spacing: -.03em; }
.cycle-clock { text-align: right; padding: 5px 8px 5px 10px; border-left: 1px solid var(--line-strong); min-width: 78px; }
.cycle-clock span, .cycle-clock small { display: block; color: #7e8e9a; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.cycle-clock strong { display: block; color: #e9bd8e; font-size: 17px; line-height: 1.25; font-weight: 650; font-variant-numeric: tabular-nums; }
.cycle-clock small { font-size: 6px; margin-top: 2px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #8a9aa6; font-size: 8px; font-weight: 800; letter-spacing: .14em; margin-bottom: 9px; }
.section-label span { color: #667987; font-size: 6px; letter-spacing: .1em; }
.preset-block { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 8px; border: 1px solid var(--line-strong); border-radius: 8px; text-align: left; background: rgba(28,41,53,.65); cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-button:hover { border-color: rgba(242,166,90,.5); background: rgba(39,51,62,.9); transform: translateY(-1px); }
.preset-button strong, .preset-button small { display: block; white-space: nowrap; }
.preset-button strong { color: #dce5e9; font-size: 9px; font-weight: 700; }
.preset-button small { color: #82929e; font-size: 7px; margin-top: 3px; }
.preset-glyph { width: 25px; height: 25px; flex: 0 0 auto; border-radius: 7px; position: relative; border: 1px solid rgba(242,166,90,.25); background: rgba(242,166,90,.09); }
.preset-glyph::before, .preset-glyph::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 3px; background: #d99b62; }
.preset-glyph::before { top: 7px; box-shadow: 0 5px 0 rgba(217,155,98,.65); }
.preset-glyph::after { top: 17px; width: 8px; right: auto; }
.rapid-glyph { border-color: rgba(103,201,216,.25); background: rgba(103,201,216,.08); }
.rapid-glyph::before, .rapid-glyph::after { background: #72c3cf; box-shadow: none; }
.parameter-block { padding: 15px 0 13px; border-bottom: 1px solid var(--line); }
.parameter { margin: 0 0 13px; }
.parameter:last-child { margin-bottom: 0; }
.parameter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.parameter label { color: #c3cdd4; font-size: 10px; font-weight: 600; }
.parameter output { color: #f0bd87; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.parameter input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; background: transparent; }
.parameter input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(242,166,90,.65), rgba(242,166,90,.18)); }
.parameter input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #f3b675; border: 2px solid #202b35; box-shadow: 0 0 0 1px rgba(242,166,90,.6); }
.parameter input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(242,166,90,.65), rgba(242,166,90,.18)); }
.parameter input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #f3b675; border: 2px solid #202b35; box-shadow: 0 0 0 1px rgba(242,166,90,.6); }
.range-ends { display: flex; justify-content: space-between; color: #61727f; font-size: 7px; margin-top: 1px; }
.pressure-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pressure-row > div:first-child { min-width: 80px; }
.metric-label { display: block; color: #7f909d; font-size: 7px; font-weight: 800; letter-spacing: .12em; margin-bottom: 4px; }
.pressure-row strong { color: #dce5e9; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pressure-row strong small { color: #8c9ca7; font-size: 8px; font-weight: 600; }
.pressure-meter { flex: 1; height: 4px; border-radius: 4px; background: #263541; overflow: hidden; }
.pressure-meter span { display: block; height: 100%; width: 15%; border-radius: inherit; background: linear-gradient(90deg, #75c2cb, #f2a65a, #e47b52); transition: width .2s ease; }
.transport-controls { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.transport-main { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 7px; }
.play-button, .step-button, .reset-button { display: flex; justify-content: center; align-items: center; gap: 7px; height: 35px; border-radius: 7px; font-size: 9px; font-weight: 700; cursor: pointer; transition: filter .18s ease, background .18s ease, border-color .18s ease; }
.play-button { border: 1px solid rgba(242,166,90,.5); background: linear-gradient(135deg, #d88c50, #bd7045); color: #1b2024; }
.play-button:hover { filter: brightness(1.1); }
.pause-glyph { width: 10px; height: 11px; border-left: 3px solid #28231e; border-right: 3px solid #28231e; }
.play-glyph { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid #28231e; }
.step-button, .reset-button { border: 1px solid var(--line-strong); background: #17232e; color: #c2cdd4; }
.step-button:hover, .reset-button:hover { border-color: rgba(242,166,90,.42); background: #1d2a36; }
.step-button svg, .reset-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.step-button svg path:first-child { fill: currentColor; stroke: none; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.quality-row > span { color: #7f909d; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.segmented { display: flex; gap: 2px; padding: 2px; background: #0d151d; border: 1px solid var(--line); border-radius: 6px; }
.segmented button { border: 0; background: transparent; color: #788995; border-radius: 4px; padding: 4px 9px; font-size: 8px; cursor: pointer; }
.segmented button.selected { color: #f0c18e; background: #2a3540; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(19,29,39,.75); }
.science-panel summary { display: flex; align-items: center; gap: 9px; list-style: none; padding: 10px 11px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: #eab27b; background: rgba(242,166,90,.1); font-size: 15px; }
.science-panel summary strong, .science-panel summary small { display: block; }
.science-panel summary strong { color: #d7e0e5; font-size: 9px; }
.science-panel summary small { color: #7e8f9b; font-size: 7px; margin-top: 2px; }
.chevron { margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid #82929d; border-bottom: 1.5px solid #82929d; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.science-panel[open] .chevron { transform: rotate(225deg) translateY(-1px); }
.science-content { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.science-content h3 { color: #d5dfe5; font-size: 9px; margin: 12px 0 5px; }
.science-content p { color: #9aabb6; font-size: 8px; line-height: 1.55; margin: 5px 0 8px; }
.equation { color: #f1c18e; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 8px; line-height: 1.6; padding: 7px 8px; border: 1px solid rgba(242,166,90,.13); border-radius: 6px; background: rgba(242,166,90,.045); overflow-wrap: anywhere; }
.equation-note { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #b4c0c8 !important; }
.constants-list { list-style: none; padding: 0; margin: 5px 0 10px; }
.constants-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(172,194,212,.07); color: #91a1ad; font-size: 7px; }
.constants-list b { color: #d5dfe4; font-size: 7px; font-weight: 600; text-align: right; }
.constants-list em { color: #7e9b8f; font-style: normal; font-size: 6px; }
.science-content .disclaimer { padding-top: 8px; border-top: 1px solid var(--line); color: #9bb8aa; }
.panel-foot { display: flex; align-items: center; gap: 6px; color: #657582; font-size: 6px; letter-spacing: .1em; padding: 12px 2px 0; font-weight: 750; }
.foot-dot { width: 5px; height: 5px; border-radius: 50%; background: #83b79a; box-shadow: 0 0 6px rgba(131,183,154,.5); }
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; overflow: hidden; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .visual-column { padding-left: 16px; padding-right: 14px; }
  .control-panel { padding-left: 14px; padding-right: 14px; }
  .readout-card { padding-left: 9px; padding-right: 9px; }
}
@media (max-width: 720px) {
  .topbar { height: 70px; flex-basis: 70px; padding: 0 13px; gap: 8px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-lockup { gap: 10px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 15px; }
  .subhead { max-width: 240px; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-actions { gap: 6px; }
  .phase-chip { padding: 7px 8px; font-size: 7px; gap: 6px; }
  .icon-button { width: 34px; padding: 0; justify-content: center; }
  .icon-button span { display: none; }
  .workspace { display: flex; flex-direction: column; min-height: 0; flex: 1; }
  .visual-column { flex: 0 0 auto; padding: 9px 10px 8px; gap: 7px; }
  .stage-topline { min-height: 28px; }
  .stage-kicker { font-size: 7px; padding-top: 6px; }
  .view-switch { padding: 2px; }
  .view-button { padding: 5px 8px; font-size: 8px; }
  .stage { height: clamp(220px, 31dvh, 270px); min-height: 220px; flex: 0 0 auto; border-radius: 10px; }
  .canvas-corner { font-size: 6px; }
  .canvas-corner.top-left { top: 10px; left: 10px; }
  .canvas-corner.bottom-right { right: 10px; bottom: 9px; }
  .caption-strip { min-height: 48px; padding: 4px 2px 0; gap: 8px; }
  .caption-icon { width: 23px; height: 23px; }
  .caption-label { font-size: 6px; margin-bottom: 3px; }
  .caption-strip p { font-size: 8px; line-height: 1.3; }
  .readout-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .readout-card { padding: 7px 6px 6px; border-radius: 7px; }
  .readout-head { font-size: 6px; letter-spacing: .07em; }
  .readout-tag { font-size: 5px; padding: 1px 3px; }
  .readout-value { font-size: 17px; margin-top: 5px; }
  .readout-value small { font-size: 8px; margin-left: 2px; }
  .readout-foot { font-size: 6px; margin-top: 4px; }
  .audit-strip { min-height: 38px; padding: 5px 7px; gap: 7px; }
  .audit-icon { width: 20px; height: 20px; font-size: 14px; }
  .audit-title { font-size: 6px; }
  .audit-copy p { font-size: 7px; margin-top: 3px; }
  .audit-status { font-size: 6px; gap: 4px; }
  .audit-status span { width: 4px; height: 4px; }
  .control-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; border-left: 0; border-top: 1px solid var(--line); padding: 12px 13px 14px; }
  .panel-heading { margin-bottom: 12px; }
  .panel-heading h2 { font-size: 15px; }
  .cycle-clock { padding-top: 2px; }
  .cycle-clock strong { font-size: 15px; }
  .preset-block { padding-bottom: 11px; }
  .parameter-block { padding: 12px 0 10px; }
  .parameter { margin-bottom: 10px; }
  .parameter label, .parameter output { font-size: 9px; }
  .parameter input[type="range"] { height: 12px; }
  .range-ends { font-size: 6px; }
  .pressure-row { padding: 9px 0; }
  .transport-controls { padding: 10px 0; }
  .science-panel { margin-top: 9px; }
  .panel-foot { padding-top: 9px; }
  body.embed-mode .workspace { overflow: hidden; }
}
@media (max-width: 390px) {
  .subhead { max-width: 188px; }
  .phase-chip { display: none; }
  .readout-head { font-size: 5.5px; }
  .readout-tag { display: none; }
  .readout-value { font-size: 16px; }
  .readout-foot { font-size: 5.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
