:root {
  color-scheme: dark;
  --bg: #101316;
  --panel: #171b1f;
  --panel-2: #1b2024;
  --line: #30373c;
  --line-soft: #252c31;
  --text: #e9e7e1;
  --muted: #8d969b;
  --dim: #626d73;
  --accent: #d7a45b;
  --accent-bright: #f0bd72;
  --accent-wash: rgba(215,164,91,.12);
  --radius: 12px;
  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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.app-shell { width: 100%; min-height: 100vh; display: flex; flex-direction: column; padding: 0 28px 12px; max-width: 1760px; margin: 0 auto; }
.topbar { height: 76px; flex: 0 0 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); gap: 20px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.mark { width: 38px; height: 38px; border: 1px solid rgba(215,164,91,.42); border-radius: 10px; display: grid; place-items: center; background: var(--accent-wash); flex: 0 0 auto; }
.mark svg { width: 25px; height: 25px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { color: var(--accent); font-size: 9px; letter-spacing: .19em; font-weight: 750; margin-bottom: 4px; }
.eyebrow span { color: var(--dim); padding: 0 3px; }
h1 { font-size: 18px; letter-spacing: -.035em; line-height: 1.1; font-weight: 650; margin: 0; }
.topbar-note { color: #7d878d; font-size: 9px; letter-spacing: .13em; font-weight: 700; white-space: nowrap; }
.status-dot, .live-tag i, .hud-pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 10px rgba(215,164,91,.45); }
.note-divider { padding: 0 10px; color: #444d52; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(350px, .92fr); gap: 20px; flex: 1 1 auto; min-height: 0; padding-top: 18px; }
.stage-column, .control-column { min-width: 0; min-height: 0; }
.stage-column { display: flex; flex-direction: column; gap: 0; }
.stage-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 42px; padding: 0 0 10px; gap: 12px; }
.view-switch { display: flex; align-items: center; background: #171b1f; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.view-button, .quiet-button { border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 10px; letter-spacing: .06em; font-weight: 700; padding: 8px 12px; transition: background .18s ease, color .18s ease; }
.view-button:hover, .quiet-button:hover { color: var(--text); background: rgba(255,255,255,.045); }
.view-button.active { color: var(--accent-bright); background: rgba(215,164,91,.13); box-shadow: inset 0 0 0 1px rgba(215,164,91,.14); }
.stage-actions { display: flex; gap: 4px; align-items: center; }
.quiet-button { padding: 8px 9px; font-size: 9px; color: #9ba4a8; }
.screenshot-button { color: var(--accent); }
.canvas-stage { position: relative; flex: 1 1 auto; min-height: 330px; overflow: hidden; border: 1px solid #30383d; border-radius: 12px; background: radial-gradient(ellipse at 50% 40%, #252a2d 0%, #1b2023 52%, #14181b 100%); box-shadow: 0 18px 50px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.025); }
#machineCanvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.canvas-vignette { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9,12,14,.22), transparent 15%, transparent 85%, rgba(9,12,14,.22)), linear-gradient(0deg, rgba(9,12,14,.24), transparent 23%, transparent 80%, rgba(9,12,14,.15)); }
.scene-label { position: absolute; top: 17px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.scene-label-left { left: 18px; }
.scene-label-right { right: 18px; text-align: right; }
.label-kicker, .caption-kicker { color: #737f85; font-size: 8px; font-weight: 750; letter-spacing: .16em; }
.scene-label strong { color: #b9c0c2; font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.scene-hud { position: absolute; left: 17px; bottom: 14px; color: #7d898f; font-size: 8px; letter-spacing: .15em; font-weight: 750; pointer-events: none; }
.scene-hud .hud-pulse { width: 5px; height: 5px; margin-right: 6px; }
.hud-separator { color: var(--accent); padding: 0 7px; }
.stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 2px 0; min-height: 75px; }
.caption-block { min-width: 0; max-width: 620px; }
.caption-kicker { color: var(--accent); }
.caption-block p { color: #b3bbbd; font-size: 11px; line-height: 1.5; margin: 5px 0 0; max-width: 610px; }
.transport { display: flex; gap: 6px; flex: 0 0 auto; }
.transport-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; border: 1px solid #343d42; border-radius: 7px; padding: 0 11px; background: #1a1f23; color: #a9b1b3; font-size: 9px; letter-spacing: .07em; font-weight: 750; cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.transport-button:hover { border-color: #687178; color: var(--text); }
.transport-button.primary { color: var(--accent-bright); border-color: rgba(215,164,91,.42); background: rgba(215,164,91,.1); }
.pause-icon { font-size: 12px; line-height: 1; }
.control-column { overflow-y: auto; overscroll-behavior: contain; padding: 0 2px 6px 0; scrollbar-width: thin; scrollbar-color: #394247 transparent; }
.control-column::-webkit-scrollbar { width: 5px; }
.control-column::-webkit-scrollbar-thumb { background: #394247; border-radius: 8px; }
.readout-section, .design-section, .audit-section { background: #171b1f; border: 1px solid #2b3338; border-radius: 11px; padding: 14px 15px; margin-bottom: 10px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-heading > div { display: flex; align-items: center; gap: 9px; }
.section-index { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
h2 { margin: 0; font-size: 12px; font-weight: 680; letter-spacing: .01em; }
.live-tag, .unit-note, .audit-mark { color: #79858a; font-size: 8px; letter-spacing: .12em; font-weight: 750; white-space: nowrap; }
.live-tag { color: #9ca6a8; }
.live-tag i { width: 5px; height: 5px; margin-right: 4px; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.metric-card { background: #1d2327; border: 1px solid #2a3338; border-radius: 8px; padding: 10px 11px 8px; min-width: 0; }
.metric-card.accent-metric { border-color: rgba(215,164,91,.32); background: linear-gradient(140deg, rgba(215,164,91,.11), #1d2327 70%); }
.metric-name { color: #899398; font-size: 8px; letter-spacing: .12em; font-weight: 750; }
.metric-value { display: flex; align-items: baseline; gap: 5px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.metric-value span { color: #e5e5df; font-size: 25px; line-height: 1; letter-spacing: -.06em; font-weight: 620; }
.metric-value small { color: #9aa4a7; font-size: 10px; font-weight: 650; }
.accent-metric .metric-value span { color: var(--accent-bright); }
.metric-foot { color: #667279; font-size: 8px; line-height: 1.3; }
.secondary-readout { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 10px 1px 0; color: #6f7a80; font-size: 8px; letter-spacing: .1em; font-weight: 700; }
.secondary-readout strong { color: #c1c7c5; font-weight: 650; margin-left: 4px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 13px; }
.preset-button { border: 1px solid #343d42; border-radius: 6px; background: #1c2226; color: #8d989c; min-height: 30px; cursor: pointer; font-size: 8px; letter-spacing: .11em; font-weight: 800; transition: .18s ease; }
.preset-button:hover { color: var(--text); border-color: #626d73; }
.preset-button.active { color: var(--accent-bright); border-color: rgba(215,164,91,.45); background: rgba(215,164,91,.1); }
.control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 12px; }
.control-item { min-width: 0; }
.control-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.control-top label { color: #c1c8c7; font-size: 10px; font-weight: 600; }
.control-top output { color: var(--accent-bright); font-size: 9px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 13px; background: transparent; display: block; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--progress, 45%), #41494e var(--progress, 45%)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: #41494e; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; border-radius: 50%; margin-top: -4px; background: var(--accent-bright); border: 2px solid #30271d; box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-bright); border: 2px solid #30271d; box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; color: #68747a; font-size: 7px; margin-top: 1px; }
.audit-section { margin-bottom: 10px; }
.audit-card { background: #1c2226; border: 1px solid #2c353a; border-radius: 8px; padding: 10px 11px 9px; }
.audit-equation { color: #d9b47f; font-family: Georgia, serif; font-size: 14px; letter-spacing: .02em; padding-bottom: 8px; border-bottom: 1px solid #30383c; }
.audit-values { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 9px 0 7px; }
.audit-values div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.audit-values span { color: #748087; font-size: 7px; letter-spacing: .1em; font-weight: 750; }
.audit-values strong { color: #d6dbd8; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
#auditDiff { color: var(--accent-bright); }
.audit-card p { color: #78848a; font-size: 8px; line-height: 1.45; margin: 1px 0 0; }
.science-panel { background: #171b1f; border: 1px solid #2b3338; border-radius: 11px; margin-bottom: 8px; }
.science-panel summary { display: flex; align-items: center; gap: 9px; padding: 13px 15px; cursor: pointer; list-style: none; color: #c4cbc8; font-size: 10px; letter-spacing: .11em; font-weight: 750; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { margin-left: auto; color: var(--accent); font-size: 17px; font-weight: 400; transition: transform .2s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { border-top: 1px solid #2b3338; padding: 12px 15px 15px; }
.science-content h3 { color: #d7b37d; font-size: 10px; letter-spacing: .03em; margin: 10px 0 5px; }
.science-content h3:first-child { margin-top: 0; }
.science-content p { color: #929da0; font-size: 9px; line-height: 1.55; margin: 5px 0 8px; }
.science-content .equation { color: #e4e1d9; font-family: Georgia, "Times New Roman", serif; font-size: 13px; letter-spacing: .01em; margin: 5px 0; }
.science-content .disclaimer { color: #b0a18c; border-top: 1px solid #30383c; padding-top: 10px; margin-top: 12px; }
.page-footer { display: flex; justify-content: space-between; color: #59646a; font-size: 8px; letter-spacing: .15em; font-weight: 750; padding: 10px 2px 0; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .workspace { min-height: 0; }
@media (max-width: 1050px) {
  .app-shell { padding-left: 18px; padding-right: 18px; }
  .workspace { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .95fr); gap: 14px; }
  .control-list { column-gap: 10px; }
  .topbar-note { font-size: 8px; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 12px 8px; }
  .topbar { height: 61px; flex-basis: 61px; }
  .mark { width: 33px; height: 33px; }
  h1 { font-size: 15px; }
  .eyebrow { font-size: 8px; }
  .topbar-note { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
  .stage-column { flex: 0 0 48%; min-height: 300px; max-height: 440px; }
  .stage-toolbar { min-height: 36px; padding-bottom: 7px; }
  .view-button { padding: 7px 9px; font-size: 9px; }
  .quiet-button { padding: 7px 6px; font-size: 8px; }
  .canvas-stage { min-height: 0; flex: 1 1 auto; }
  .stage-footer { min-height: 64px; padding-top: 9px; gap: 8px; align-items: center; }
  .caption-block { max-width: none; flex: 1 1 auto; }
  .caption-block p { font-size: 9px; line-height: 1.35; margin-top: 3px; }
  .caption-kicker { font-size: 7px; }
  .transport { gap: 4px; }
  .transport-button { min-height: 30px; padding: 0 7px; font-size: 8px; }
  .transport-button .pause-icon { display: none; }
  .control-column { flex: 1 1 0; min-height: 0; overflow-y: auto; padding-right: 1px; }
  .readout-section, .design-section, .audit-section { padding: 12px; margin-bottom: 8px; }
  .metric-card { padding: 8px 9px 7px; }
  .metric-value span { font-size: 22px; }
  .metric-foot { font-size: 7px; }
  .control-list { column-gap: 14px; row-gap: 10px; }
  .page-footer { display: none; }
  .scene-label { top: 10px; }
  .scene-label-left { left: 11px; }
  .scene-label-right { right: 11px; }
  .scene-label strong { font-size: 8px; }
  .scene-hud { left: 11px; bottom: 9px; font-size: 7px; }
}
@media (max-width: 420px) {
  .stage-column { flex-basis: 48%; min-height: 300px; }
  .screenshot-button { font-size: 0; width: 30px; height: 29px; padding: 0; }
  .screenshot-button::first-letter { font-size: 11px; }
  .quiet-button#qualityButton { font-size: 7px; }
  .view-button { padding: 7px 7px; font-size: 8px; }
  .stage-footer { min-height: 61px; }
  .transport-button { padding: 0 6px; font-size: 7px; }
  .control-top label { font-size: 9px; }
  .control-top output { font-size: 8px; }
  .secondary-readout { font-size: 7px; }
  .audit-values { gap: 4px; }
  .audit-values strong { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.canvas-stage.exploded .scene-label { display: none; }
