:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111a24;
  --panel-2: #141f2b;
  --panel-3: #182633;
  --line: #253443;
  --line-soft: rgba(151, 178, 196, .12);
  --text: #e6edf2;
  --muted: #8b9aa7;
  --faint: #60717f;
  --accent: #e8b46a;
  --accent-soft: rgba(232, 180, 106, .14);
  --green: #84c9ad;
  --red: #d98472;
  --radius: 10px;
  font-family: 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); }
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 { min-height: 100%; height: 100%; display: flex; flex-direction: column; background: radial-gradient(ellipse at 20% 0%, rgba(45, 69, 83, .19), transparent 38%), var(--bg); }
.topbar { height: 66px; min-height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(10, 16, 23, .92); z-index: 2; }
.brand-lockup, .topbar-right, .brand-copy, .era-chip, .icon-button, .visual-toolbar, .toolbar-meta, .view-switch, .caption-bar, .section-heading, .readout-label, .readout-foot, .stability-row, .transport-row, .preset-row, .time-row, .control-top, .check-heading, .check-values, .panel-footer { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(232,180,106,.45); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-7deg); background: rgba(232,180,106,.06); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .8; }
.brand-copy { align-items: flex-start; flex-direction: column; gap: 2px; }
.eyebrow { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .17em; }
.eyebrow span { color: var(--accent); padding: 0 4px; }
h1 { margin: 0; font-size: 17px; line-height: 1.1; font-weight: 650; letter-spacing: -.025em; }
h1 em { font-style: normal; color: var(--accent); font-weight: 500; }
.topbar-right { gap: 16px; }
.era-chip { gap: 8px; color: #a4b2bd; font-size: 9px; letter-spacing: .12em; font-weight: 700; }
.chip-dot, .live-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(232,180,106,.45); }
.icon-button { gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: #121d27; font-size: 10px; font-weight: 650; color: #d5e0e7; cursor: pointer; transition: border-color .2s, background .2s; }
.icon-button:hover { border-color: rgba(232,180,106,.55); background: #182633; }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; }
.visual-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: 48px minmax(0, 1fr) 52px; border-right: 1px solid var(--line); }
.visual-toolbar { justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line-soft); background: rgba(15,23,32,.78); }
.view-switch { gap: 4px; padding: 3px; background: #0b131b; border: 1px solid #202e3a; border-radius: 7px; }
.view-btn { border: 0; border-radius: 5px; padding: 7px 12px; background: transparent; color: #8495a2; font-size: 10px; font-weight: 650; cursor: pointer; transition: background .2s, color .2s; }
.view-btn:hover { color: var(--text); }
.view-btn.active { background: #25313c; color: var(--accent); box-shadow: inset 0 0 0 1px rgba(232,180,106,.15); }
.toolbar-meta { gap: 9px; color: #718391; font-size: 8px; font-weight: 750; letter-spacing: .14em; }
.live-indicator { width: 5px; height: 5px; background: #647786; box-shadow: none; }
.live-indicator.is-live { background: var(--green); box-shadow: 0 0 9px rgba(132,201,173,.55); }
.quality-toggle { margin-left: 6px; border: 1px solid #30404e; border-radius: 5px; padding: 5px 7px; background: #15212b; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .12em; cursor: pointer; }
.stage-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 48% 50%, rgba(40, 58, 68, .32), transparent 55%), linear-gradient(135deg, #0e1720 0%, #0b121a 100%); }
#machineCanvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.stage-corner { position: absolute; display: flex; flex-direction: column; gap: 3px; color: rgba(140,160,174,.54); font-size: 7px; font-weight: 700; letter-spacing: .16em; pointer-events: none; }
.stage-corner span:first-child { color: var(--accent); }
.stage-corner-tl { top: 17px; left: 19px; }
.stage-corner-br { right: 19px; bottom: 14px; text-align: right; }
.canvas-hint { position: absolute; top: 17px; right: 19px; color: rgba(145,163,176,.55); font-size: 7px; letter-spacing: .13em; font-weight: 700; pointer-events: none; }
.caption-bar { gap: 11px; padding: 0 20px; background: #101923; border-top: 1px solid var(--line-soft); }
.caption-icon { color: var(--accent); font-size: 17px; line-height: 1; }
.caption-bar p { margin: 0; color: #a9b7c1; font-size: 10px; line-height: 1.45; }
.control-column { min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(180deg, #111a24 0%, #0f1821 100%); scrollbar-width: thin; scrollbar-color: #344554 transparent; }
.control-column::-webkit-scrollbar { width: 5px; }
.control-column::-webkit-scrollbar-thumb { background: #344554; border-radius: 8px; }
.readout-section, .operation-section, .design-section { padding: 15px 17px 13px; border-bottom: 1px solid var(--line); }
.section-heading { justify-content: space-between; margin-bottom: 11px; color: #a9b8c2; font-size: 8px; letter-spacing: .16em; font-weight: 800; }
.section-index { color: #627584; font-size: 8px; letter-spacing: .08em; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; min-height: 68px; padding: 9px 10px 8px; border: 1px solid #263543; border-radius: 7px; background: linear-gradient(135deg, rgba(28,42,54,.88), rgba(17,27,37,.96)); }
.primary-readout { border-color: rgba(232,180,106,.38); background: linear-gradient(135deg, rgba(74,58,39,.27), rgba(17,27,37,.96)); }
.readout-label { justify-content: space-between; color: #91a1ad; font-size: 7px; font-weight: 750; letter-spacing: .12em; }
.readout-label span { color: var(--accent); font-family: Georgia, serif; font-size: 11px; font-style: italic; }
.readout-value { margin-top: 5px; color: #edf3f6; font-size: 21px; line-height: 1; font-weight: 550; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: #9cabb5; font-size: 9px; letter-spacing: 0; font-weight: 550; }
.readout-foot { gap: 5px; margin-top: 5px; color: #728493; font-size: 7px; letter-spacing: .06em; }
.readout-dot { width: 5px; height: 5px; border-radius: 50%; background: #738493; }
.temperature-track, .stability-track { height: 3px; margin-top: 7px; border-radius: 4px; overflow: hidden; background: #2a3946; }
.temperature-track span, .stability-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); transition: width .2s linear, background .2s; }
.stability-row { gap: 9px; margin-top: 9px; padding: 8px 10px; border: 1px solid #263543; border-radius: 7px; background: rgba(13,22,31,.7); }
.stability-row > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 73px; }
.stability-label { color: #8394a1; font-size: 7px; font-weight: 750; letter-spacing: .12em; }
.stability-row strong { color: var(--green); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stability-track { flex: 1; margin: 0; height: 4px; }
.stability-status { min-width: 51px; text-align: right; color: var(--green); font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.transport-row { gap: 6px; margin-bottom: 9px; }
.run-button { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(232,180,106,.48); border-radius: 6px; padding: 9px 10px; background: linear-gradient(135deg, #715333, #493923); color: #fff0d8; font-size: 10px; font-weight: 750; cursor: pointer; transition: filter .2s, transform .2s; }
.run-button:hover { filter: brightness(1.15); }
.run-button:active { transform: translateY(1px); }
.play-symbol { font-size: 9px; }
.transport-button { border: 1px solid #2a3a48; border-radius: 6px; padding: 9px 10px; background: #17232e; color: #a8b6c0; font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.transport-button:hover { border-color: #647786; color: var(--text); }
.preset-row { gap: 6px; }
.preset-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; text-align: left; border: 1px solid #293947; border-radius: 6px; padding: 7px 8px; background: #131f2a; cursor: pointer; }
.preset-btn.active { border-color: rgba(232,180,106,.5); background: rgba(232,180,106,.07); }
.preset-glyph { color: var(--accent); font-size: 14px; }
.preset-btn b, .preset-btn small { display: block; }
.preset-btn b { color: #cbd6dd; font-size: 8px; font-weight: 700; }
.preset-btn small { margin-top: 2px; color: #758794; font-size: 7px; }
.time-row { justify-content: space-between; margin-top: 9px; color: #738491; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.time-row b { margin-left: 4px; color: #bac7cf; font-size: 8px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 13px; row-gap: 10px; }
.control-item { min-width: 0; display: block; }
.control-top { justify-content: space-between; gap: 4px; margin-bottom: 5px; color: #aab8c2; font-size: 8px; font-weight: 600; }
.control-top i { color: #738895; font-size: 8px; font-style: normal; cursor: help; }
.control-top output { flex-shrink: 0; color: var(--accent); font-size: 8px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 14px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, var(--accent) 0 var(--range-pct, 0%), #4a5b68 var(--range-pct, 0%) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, var(--accent) 0 var(--range-pct, 0%), #4a5b68 var(--range-pct, 0%) 100%); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 10px; height: 10px; margin-top: -3.5px; border: 2px solid #1b2630; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(232,180,106,.55); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #1b2630; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(232,180,106,.55); }
.range-ends { display: flex; justify-content: space-between; color: #617381; font-size: 6px; }
.check-section { margin: 12px 17px; padding: 10px 11px; border: 1px solid #2b3b49; border-radius: 7px; background: rgba(18,30,40,.78); }
.check-heading { justify-content: space-between; color: #98aab6; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.check-pass { color: var(--green); font-size: 7px; }
.check-equation { margin: 8px 0; color: #d3dee5; font-family: Georgia, serif; font-size: 14px; text-align: center; }
.check-equation sub { font-size: 9px; }
.check-values { justify-content: space-between; gap: 4px; color: #748795; font-size: 6px; }
.check-values span { display: flex; flex-direction: column; gap: 3px; }
.check-values b { color: #d6e0e6; font-size: 9px; font-variant-numeric: tabular-nums; }
.check-note { margin: 7px 0 0; color: #728391; font-size: 7px; line-height: 1.45; }
.science-panel { margin: 0 17px 12px; border: 1px solid #2b3b49; border-radius: 7px; background: rgba(18,30,40,.58); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; color: #a8b8c2; font-size: 8px; font-weight: 800; letter-spacing: .13em; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-mark { color: var(--accent); font-size: 13px; font-weight: 400; }
.science-panel[open] .summary-mark { transform: rotate(45deg); }
.science-content { padding: 0 11px 11px; color: #8fa0ac; font-size: 8px; line-height: 1.55; }
.science-content p { margin: 8px 0 4px; }
.science-content p b { color: #c7d2d9; font-size: 8px; }
.equation { padding: 5px 8px; border-radius: 4px; background: #0d1720; color: var(--accent); font-family: Georgia, serif; font-size: 12px; text-align: center; }
.science-disclaimer { color: #c4a16e; font-style: italic; }
.panel-footer { justify-content: space-between; gap: 6px; padding: 0 17px 14px; color: #627583; font-size: 6px; letter-spacing: .06em; }
.panel-footer b { color: #98a9b4; font-weight: 650; }
.panel-footer i { color: #718391; font-style: italic; }
@media (max-width: 980px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0,1fr) 330px; }
  .topbar { padding: 0 17px; }
  .readout-section, .operation-section, .design-section { padding-left: 13px; padding-right: 13px; }
  .control-list { column-gap: 9px; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .app-shell { height: 100%; min-height: 0; }
  .topbar { height: 55px; min-height: 55px; padding: 0 12px; }
  .brand-mark { width: 27px; height: 27px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 15px; }
  .era-chip { display: none; }
  .topbar-right { gap: 0; }
  .icon-button { padding: 7px 8px; font-size: 9px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(285px, 43dvh) minmax(0,1fr); overflow: hidden; }
  .visual-column { grid-template-rows: 41px minmax(0,1fr) 42px; border-right: 0; border-bottom: 1px solid var(--line); }
  .visual-toolbar { padding: 0 10px; }
  .view-switch { gap: 2px; }
  .view-btn { padding: 6px 8px; font-size: 9px; }
  .toolbar-meta { gap: 5px; font-size: 7px; }
  .quality-toggle { padding: 4px 5px; font-size: 7px; }
  .stage-corner-tl { top: 9px; left: 10px; }
  .stage-corner-br { right: 10px; bottom: 8px; }
  .canvas-hint { top: 9px; right: 10px; font-size: 6px; }
  .caption-bar { padding: 0 11px; gap: 8px; }
  .caption-bar p { font-size: 9px; }
  .control-column { overflow-y: auto; min-height: 0; }
  .readout-section, .operation-section, .design-section { padding: 12px 12px 11px; }
  .readout-card { min-height: 62px; padding: 8px; }
  .readout-value { font-size: 19px; }
  .control-list { column-gap: 13px; row-gap: 9px; }
  .control-top { font-size: 8px; }
  .check-section { margin: 10px 12px; }
  .science-panel { margin: 0 12px 10px; }
  .panel-footer { padding: 0 12px 12px; }
}
@media (max-width: 370px) {
  .toolbar-meta #viewLabel { display: none; }
  .view-btn { padding-left: 6px; padding-right: 6px; }
  .control-list { grid-template-columns: 1fr; }
  .control-item { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
  .control-top { grid-column: 1 / -1; }
  .range-ends { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
