:root {
  color-scheme: dark;
  --bg: #080f16;
  --panel: #101a24;
  --panel-2: #13212c;
  --line: rgba(157, 183, 200, .15);
  --line-strong: rgba(157, 183, 200, .25);
  --text: #e7f0f4;
  --muted: #8da1ad;
  --quiet: #607481;
  --accent: #6ad9dc;
  --accent-dim: rgba(106, 217, 220, .14);
  --accent-line: rgba(106, 217, 220, .45);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; min-width: 0; min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow: 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 { width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-rows: 68px minmax(0, 1fr); overflow: hidden; background: radial-gradient(ellipse at 28% -25%, rgba(41, 86, 102, .2), transparent 50%), var(--bg); }
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(9, 16, 23, .96); min-width: 0; z-index: 2; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 11px; background: var(--accent-dim); flex: 0 0 auto; }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.heading-block { min-width: 0; }
.eyebrow { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.3; }
.eyebrow span { color: var(--accent); padding: 0 4px; }
h1 { margin: 2px 0 0; font-size: 19px; line-height: 1.05; letter-spacing: -.035em; font-weight: 720; }
.heading-block p { display: inline; margin: 0 0 0 8px; color: #9aadb7; font-size: 11px; }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 9px; color: #a8bac2; font-size: 9px; font-weight: 700; letter-spacing: .11em; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(106,217,220,.65); }
.meta-divider { height: 16px; width: 1px; background: var(--line-strong); margin: 0 3px; }
.meta-small { color: var(--quiet); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: 0; min-width: 0; }
.stage-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 54px minmax(0, 1fr) auto; padding: 0 18px 14px 22px; border-right: 1px solid var(--line); }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.view-switch { display: inline-flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(17, 29, 39, .7); }
.view-button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 7px 12px; font-size: 11px; font-weight: 650; cursor: pointer; transition: color .18s ease, background .18s ease; }
.view-button:hover { color: var(--text); }
.view-button.active { color: #dffbfc; background: rgba(106, 217, 220, .14); box-shadow: inset 0 0 0 1px rgba(106, 217, 220, .22); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(19, 33, 44, .65); color: #b9cbd3; font-size: 10px; font-weight: 650; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.icon-button:hover { border-color: var(--accent-line); background: var(--accent-dim); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.canvas-wrap { min-height: 0; position: relative; overflow: hidden; border: 1px solid rgba(133, 170, 185, .15); border-radius: 14px; background: radial-gradient(ellipse at 52% 47%, rgba(21, 59, 70, .2), transparent 52%), linear-gradient(145deg, #0d1822, #09121b 72%); box-shadow: inset 0 1px rgba(255,255,255,.025), 0 14px 38px rgba(0,0,0,.12); }
.canvas-wrap::after { content: ""; pointer-events: none; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(135deg, rgba(255,255,255,.025), transparent 30%, transparent 75%, rgba(106,217,220,.025)); }
#machine-canvas { display: block; width: 100%; height: 100%; }
.canvas-corner { position: absolute; z-index: 1; color: #667d89; font-size: 8px; font-weight: 750; letter-spacing: .16em; pointer-events: none; }
.canvas-corner.top-left { top: 15px; left: 17px; }
.canvas-corner.bottom-right { right: 16px; bottom: 14px; }
.stage-caption { min-height: 54px; display: flex; align-items: center; gap: 11px; padding: 7px 4px 0; }
.caption-mark { width: 3px; height: 28px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px rgba(106,217,220,.25); flex: 0 0 auto; }
.stage-caption p { margin: 0; color: #a7b8c1; font-size: 11px; line-height: 1.5; max-width: 760px; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 14px; background: linear-gradient(180deg, rgba(17, 27, 37, .96), rgba(12, 21, 30, .98)); scrollbar-width: thin; scrollbar-color: #314651 transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 13px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 16px; letter-spacing: -.025em; font-weight: 680; }
.source-tag { display: inline-flex; align-items: center; min-height: 18px; padding: 0 6px; border: 1px solid rgba(142, 164, 176, .19); border-radius: 4px; color: #879ba6; font-size: 7px; line-height: 1; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.controls-grid { display: grid; gap: 10px; }
.control { display: block; min-width: 0; }
.control-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 3px; color: #c5d2d8; font-size: 10px; font-weight: 650; }
.control-top output { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 750; }
.control input[type="range"] { width: 100%; height: 13px; margin: 0; display: block; appearance: none; background: transparent; cursor: pointer; }
.control input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) 0%, rgba(106,217,220,.65) 55%, #30424e 55%, #30424e 100%); }
.control input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #30424e; }
.control input[type="range"]::-moz-range-progress { height: 3px; border-radius: 4px; background: var(--accent); }
.control input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border: 2px solid #09151c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(106,217,220,.7), 0 0 8px rgba(106,217,220,.3); }
.control input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #09151c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(106,217,220,.7); }
.control-hint { display: flex; justify-content: space-between; color: #708590; font-size: 8px; line-height: 1.4; }
.control-hint span { color: #607580; }
.preset-block { margin-top: 13px; }
.section-label, .readout-heading { display: flex; align-items: center; justify-content: space-between; color: #8297a2; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.section-label span { color: #5f737e; font-size: 7px; letter-spacing: .1em; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.preset-button { min-height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(25, 39, 50, .75); color: #9dafb8; font-size: 9px; font-weight: 650; cursor: pointer; transition: .18s ease; }
.preset-button:hover { color: var(--text); border-color: var(--accent-line); }
.preset-button.selected { border-color: rgba(106,217,220,.48); color: #d8f7f8; background: rgba(106,217,220,.10); }
.transport-row { display: flex; gap: 6px; margin-top: 11px; }
.transport { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 31px; flex: 1 1 0; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 7px; background: #172631; color: #9eb1bb; font-size: 9px; font-weight: 680; cursor: pointer; transition: .18s ease; }
.transport:hover { border-color: var(--accent-line); color: var(--text); }
.transport.primary { border-color: rgba(106,217,220,.4); background: rgba(106,217,220,.13); color: #d7f6f6; }
.transport svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quality-button { min-width: 42px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 7px; background: #101c26; color: #80949e; font-size: 8px; font-weight: 800; letter-spacing: .07em; cursor: pointer; }
.quality-button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); }
.readout-heading { margin: 15px 0 7px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.readout-card { min-width: 0; padding: 8px 9px 7px; border: 1px solid rgba(151, 177, 190, .13); border-radius: 8px; background: rgba(20, 33, 44, .72); }
.readout-card span { display: block; margin-bottom: 4px; color: #7f939e; font-size: 8px; }
.readout-card strong { display: block; color: #e0eaf0; font-size: 17px; line-height: 1.05; font-weight: 720; letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-card strong small { color: #9eb1bb; font-size: 9px; font-weight: 600; letter-spacing: 0; }
.readout-card.featured { border-color: rgba(106,217,220,.28); background: linear-gradient(135deg, rgba(106,217,220,.11), rgba(20,33,44,.75)); }
.readout-card.featured strong { color: var(--accent); }
.readout-card.efficiency-card { grid-column: span 2; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
.readout-card.efficiency-card span { margin: 0; }
.readout-card.efficiency-card strong { font-size: 18px; }
.audit-card { margin-top: 9px; padding: 9px 10px 8px; border: 1px solid rgba(106,217,220,.19); border-radius: 8px; background: rgba(8, 17, 24, .45); }
.audit-head { display: flex; align-items: center; justify-content: space-between; color: #8ea3ad; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.audit-pass { color: var(--accent); font-size: 8px; }
.audit-values { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #748a95; font-size: 8px; }
.audit-values strong { display: block; margin-top: 2px; color: #cbd9df; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.audit-foot { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line); color: #718590; font-size: 8px; }
.audit-foot strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.science-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(18, 30, 40, .65); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 10px; cursor: pointer; list-style: none; color: #c3d1d8; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary::after { content: "+"; margin-left: 8px; color: var(--accent); font-size: 14px; font-weight: 400; }
.science-panel[open] summary::after { content: "−"; }
.summary-note { margin-left: auto; color: #6e828d; font-size: 8px; font-weight: 500; letter-spacing: 0; }
.science-content { padding: 0 11px 11px; color: #91a5af; font-size: 9px; line-height: 1.5; }
.science-content p { margin: 8px 0; }
.science-content h3 { margin: 11px 0 5px; color: #c6d5dc; font-size: 9px; font-weight: 750; letter-spacing: .04em; }
.science-content ul { margin: 5px 0; padding-left: 15px; }
.science-content li { margin: 5px 0; }
.science-content b { color: #c4d3d9; }
.equation { color: #bcebed; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px; }
.disclaimer { padding-top: 7px; border-top: 1px solid var(--line); color: #a8bbc3; font-style: italic; }
.keyboard-hint { padding-top: 9px; color: #5e727d; font-size: 7px; font-weight: 700; letter-spacing: .09em; text-align: center; }
kbd { margin-left: 5px; padding: 2px 4px; border: 1px solid rgba(139,164,177,.18); border-radius: 3px; color: #90a4ae; font: inherit; letter-spacing: 0; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .stage-panel { padding-left: 14px; padding-right: 14px; }
  .control-panel { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 700px) {
  .app-shell { grid-template-rows: 58px minmax(0, 1fr); }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  h1 { font-size: 16px; }
  .heading-block p { display: none; }
  .eyebrow { font-size: 7px; letter-spacing: .12em; }
  .top-meta { gap: 6px; font-size: 7px; }
  .meta-divider, .meta-small { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(260px, 45%) minmax(0, 55%); }
  .stage-panel { grid-row: 1; grid-template-rows: 43px minmax(0, 1fr) auto; padding: 0 10px 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-toolbar { gap: 6px; }
  .view-switch { padding: 3px; }
  .view-button { padding: 6px 9px; font-size: 9px; }
  .icon-button { min-height: 29px; padding: 0 8px; font-size: 8px; }
  .icon-button svg { width: 13px; height: 13px; }
  .canvas-wrap { border-radius: 10px; }
  .canvas-corner { font-size: 6px; }
  .canvas-corner.top-left { top: 9px; left: 10px; }
  .canvas-corner.bottom-right { right: 10px; bottom: 9px; }
  .stage-caption { min-height: 42px; gap: 8px; padding-top: 5px; }
  .caption-mark { height: 24px; }
  .stage-caption p { font-size: 9px; line-height: 1.35; }
  .control-panel { grid-row: 2; padding: 11px 12px 14px; }
  .panel-heading { margin-bottom: 9px; }
  .panel-heading h2 { font-size: 14px; }
  .controls-grid { grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 9px; }
  .control-top { font-size: 9px; }
  .control-top output { font-size: 10px; }
  .control-hint { font-size: 7px; }
  .control-hint span { display: none; }
  .preset-block { margin-top: 10px; }
  .transport-row { margin-top: 9px; }
  .transport { min-height: 29px; font-size: 8px; }
  .quality-button { min-width: 38px; }
  .readout-heading { margin-top: 12px; }
  .readout-card { padding: 7px 8px; }
  .readout-card strong { font-size: 15px; }
  .audit-card { margin-top: 8px; }
}
@media (max-width: 360px) {
  .view-button { padding-left: 7px; padding-right: 7px; }
  .screenshot-button span { display: none; }
  .controls-grid { column-gap: 8px; }
  .readout-card strong { font-size: 14px; }
}
@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; }
