:root {
  color-scheme: dark;
  --bg: #0a1118;
  --panel: #101a23;
  --panel-2: #14212b;
  --line: #243541;
  --line-soft: rgba(118, 154, 169, .16);
  --text: #e5edf0;
  --muted: #8fa2ab;
  --dim: #5e737d;
  --accent: #43d6c1;
  --accent-2: #ff9b61;
  --copper: #c8794c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 18% 8%, rgba(38, 83, 91, .14), transparent 36%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(10, 17, 24, .94); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(67,214,193,.42); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); background: rgba(67,214,193,.07); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); transform: rotate(8deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .6; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .78; }
.eyebrow, .section-kicker { color: #8ba2ad; font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; white-space: nowrap; }
.eyebrow-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
h1 { font-size: 17px; line-height: 1.15; font-weight: 650; letter-spacing: -.025em; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.live-state { color: #a5b6bc; font: 700 9px var(--mono); letter-spacing: .13em; display: flex; align-items: center; gap: 8px; }
.live-dot, .live-tag span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #7c929b; box-shadow: 0 0 0 3px rgba(124,146,155,.12); }
.live-dot.running { background: var(--accent); box-shadow: 0 0 0 3px rgba(67,214,193,.14), 0 0 12px rgba(67,214,193,.5); }
.icon-button, .square-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #111d26; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.icon-button:hover, .square-button:hover { border-color: rgba(67,214,193,.55); background: #172832; }
.icon-button:active, .square-button:active, .run-button:active { transform: translateY(1px); }
.icon-button svg, .square-button svg { width: 18px; height: 18px; fill: none; stroke: #a7bbc1; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 0; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 18px 18px 16px 22px; border-right: 1px solid var(--line); }
.stage-head { flex: 0 0 26px; display: flex; align-items: flex-start; justify-content: space-between; min-width: 0; }
.stage-head > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-divider { color: #40545d; padding: 0 9px; }
.stage-subtitle { color: #9aadb4; font-size: 11px; }
.stage-head-right { display: flex; gap: 6px; padding-left: 10px; }
.tiny-chip { border: 1px solid #293b46; color: #8499a2; padding: 4px 7px; border-radius: 4px; font: 700 8px var(--mono); letter-spacing: .09em; white-space: nowrap; }
.accent-chip { border-color: rgba(67,214,193,.27); color: var(--accent); background: rgba(67,214,193,.05); }
.canvas-wrap { position: relative; flex: 1 1 auto; min-height: 220px; overflow: hidden; border: 1px solid #233640; border-radius: 12px; background: #0b151d; box-shadow: 0 18px 42px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.02); }
#cellCanvas { display: block; width: 100%; height: 100%; outline: none; }
.canvas-hud { position: absolute; top: 15px; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.hud-left { left: 16px; }
.hud-right { right: 16px; align-items: flex-end; }
.hud-label { font: 700 8px var(--mono); letter-spacing: .14em; color: #6f8994; }
.hud-value { font: 700 10px var(--mono); letter-spacing: .08em; color: #c3d3d7; }
.hud-value.mono { color: var(--accent); }
.canvas-footnote { position: absolute; right: 13px; bottom: 10px; color: rgba(160,184,190,.55); font: 8px var(--mono); letter-spacing: .035em; pointer-events: none; }
.canvas-footnote span { color: var(--accent); padding: 0 4px; }
.process-strip { flex: 0 0 91px; padding: 13px 3px 0; }
.process-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sequence-note { color: #7f959e; font-size: 10px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; position: relative; }
.step-track::before { content: ""; position: absolute; top: 10px; left: 5%; right: 5%; height: 1px; background: #2a3b45; }
.step-item { position: relative; display: flex; align-items: center; gap: 7px; min-width: 0; color: #667d87; }
.step-number { z-index: 1; flex: 0 0 20px; width: 20px; height: 20px; border: 1px solid #354a55; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #101b24; font: 700 8px var(--mono); }
.step-name { font-size: 9px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-item.active { color: #e0ecee; }
.step-item.active .step-number { border-color: var(--accent); color: #081b1b; background: var(--accent); box-shadow: 0 0 0 4px rgba(67,214,193,.1); }
.step-item.done { color: #8dbeb6; }
.step-item.done .step-number { border-color: rgba(67,214,193,.45); color: var(--accent); background: rgba(67,214,193,.08); }
.control-column { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 17px 17px 12px; background: rgba(13,22,30,.88); scrollbar-width: thin; scrollbar-color: #344852 transparent; }
.control-column::-webkit-scrollbar { width: 5px; }
.control-column::-webkit-scrollbar-thumb { background: #344852; border-radius: 8px; }
.outcome-card { padding: 14px 15px 12px; border: 1px solid #2b454e; border-radius: 10px; background: linear-gradient(130deg, rgba(28,62,65,.34), rgba(16,30,38,.96) 65%); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.card-topline, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-dot { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #536c75; border-radius: 50%; color: #8fa6ad; font: 700 9px Georgia, serif; cursor: help; }
.outcome-main { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 7px 0 9px; }
.outcome-number { font: 650 35px/1 var(--mono); letter-spacing: -.08em; color: #e7f2f0; }
.outcome-number small { font-size: 11px; color: #7c939b; letter-spacing: 0; margin-left: 4px; }
.outcome-status { display: flex; align-items: center; gap: 7px; color: #a6c8c1; font-size: 10px; font-weight: 650; text-align: right; }
.status-mark { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(67,214,193,.5); }
.quality-track { height: 5px; background: #263941; border-radius: 8px; overflow: hidden; }
.quality-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, #36c8b2, #a2d5a2); transition: width .35s ease, background .35s ease; }
.quality-foot { display: flex; justify-content: space-between; margin-top: 6px; color: #667d86; font: 700 7px var(--mono); letter-spacing: .1em; }
.readout-section { margin-top: 17px; }
.live-tag { display: flex; align-items: center; gap: 6px; color: #6d9291; font: 700 8px var(--mono); letter-spacing: .07em; }
.live-tag span { width: 5px; height: 5px; background: var(--accent); box-shadow: none; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 9px; }
.readout-card { min-width: 0; padding: 10px 10px 9px; border: 1px solid #22343e; border-radius: 8px; background: #111e27; }
.readout-label { display: block; color: #80949c; font-size: 9px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-card strong { display: block; color: #e2ecee; font: 650 19px/1.1 var(--mono); letter-spacing: -.06em; white-space: nowrap; }
.readout-card strong small { color: #8ea5ac; font-size: 9px; letter-spacing: 0; }
.readout-sub { display: block; margin-top: 5px; color: #607680; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-section { margin-top: 18px; }
.text-button { border: 0; background: none; padding: 2px 0; color: #77bdb3; font-size: 9px; cursor: pointer; }
.text-button:hover { color: var(--accent); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 10px 0 14px; }
.preset-button { display: flex; align-items: flex-start; gap: 7px; min-width: 0; padding: 9px 8px; border: 1px solid #263943; border-radius: 7px; background: #111e27; text-align: left; cursor: pointer; transition: border-color .18s, background .18s; }
.preset-button:hover { border-color: #54716f; }
.preset-button.selected { border-color: rgba(67,214,193,.65); background: rgba(36,84,80,.18); }
.preset-indicator { flex: 0 0 8px; width: 8px; height: 8px; border: 1px solid #607680; border-radius: 50%; margin-top: 3px; }
.preset-button.selected .preset-indicator { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2px #15332f; }
.preset-button b { display: block; color: #cbd9dc; font-size: 9px; font-weight: 650; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #71858d; font-size: 8px; line-height: 1.25; }
.control-list { display: flex; flex-direction: column; gap: 12px; }
.control-row { min-width: 0; }
.control-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.control-label label { color: #bdcbd0; font-size: 10px; font-weight: 560; }
.control-label output { color: var(--accent); font: 650 10px var(--mono); white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #3c9f95, #2b454e); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: #2b454e; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; margin-top: -4.5px; border: 2px solid #0e2226; background: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 9px rgba(67,214,193,.24); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #0e2226; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; margin-top: 1px; color: #586e78; font: 8px var(--mono); }
.transport-card { margin-top: 16px; padding: 11px 12px 10px; border: 1px solid #253842; border-radius: 8px; background: #101c25; }
.mini-unit { color: #637d86; font: 8px var(--mono); }
.transport-bar-wrap { position: relative; height: 7px; margin: 12px 1px 6px; border-radius: 8px; background: linear-gradient(90deg, #2f9d8e 0%, #8aa66c 56%, #c78a55 78%, #aa5d55 100%); }
.transport-marker { position: absolute; top: 50%; left: 74%; width: 12px; height: 12px; border: 2px solid #e6f4ef; border-radius: 50%; background: #132a2d; transform: translate(-50%,-50%); box-shadow: 0 0 0 3px rgba(67,214,193,.18); transition: left .25s ease; }
.transport-labels { display: flex; justify-content: space-between; color: #647a83; font-size: 8px; }
.what-seeing { color: #a0b3b9; font-size: 9px; line-height: 1.5; margin: 9px 0 0; }
.audit-card { margin-top: 8px; }
.audit-check { color: #76c9b8; font: 700 8px var(--mono); letter-spacing: .06em; }
.audit-values { display: grid; grid-template-columns: 1fr 16px 1fr; align-items: center; margin-top: 9px; }
.audit-values > div:not(.audit-equals) { min-width: 0; }
.audit-values small { display: block; color: #6f858e; font-size: 8px; margin-bottom: 3px; }
.audit-values strong { display: block; color: #dce8e9; font: 600 13px var(--mono); }
.audit-equals { color: #6e878f; text-align: center; }
.audit-diff { margin-top: 8px; color: #71858d; font-size: 8px; line-height: 1.4; }
.audit-diff b { color: var(--accent); font: 700 9px var(--mono); }
.audit-diff span { color: #647b83; }
.playback-section { margin-top: 15px; padding-top: 13px; border-top: 1px solid #243640; }
.playback-buttons { display: grid; grid-template-columns: 1fr 38px 38px; gap: 7px; }
.run-button { height: 38px; border: 1px solid rgba(67,214,193,.65); border-radius: 8px; background: linear-gradient(100deg, #1b8d83, #237d78); color: #f1fffc; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 10px; font-weight: 750; cursor: pointer; box-shadow: 0 5px 14px rgba(14,120,108,.13); transition: filter .18s, transform .18s; }
.run-button:hover { filter: brightness(1.12); }
.play-icon { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #effffb; }
.play-icon.pause { width: 8px; height: 10px; border: 0; border-left: 2.5px solid #effffb; border-right: 2.5px solid #effffb; }
.square-button { width: 38px; height: 38px; }
.square-button svg { width: 16px; height: 16px; }
.playback-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; color: #657b84; font: 700 8px var(--mono); letter-spacing: .08em; }
.playback-bottom strong { color: #cbdadd; font: 600 11px var(--mono); letter-spacing: 0; white-space: nowrap; }
.playback-bottom strong small { color: #728891; font-size: 8px; font-weight: 500; }
.quality-toggle { border: 1px solid #2b404a; border-radius: 20px; background: #121f28; color: #94aaaF; padding: 5px 8px; font: 700 7px var(--mono); letter-spacing: .06em; cursor: pointer; white-space: nowrap; }
.toggle-dot { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.quality-toggle[aria-pressed="false"] .toggle-dot { background: #84949a; }
.science-panel { margin-top: 13px; border-top: 1px solid #243640; border-bottom: 1px solid #243640; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 1px; color: #c5d3d7; font-size: 10px; font-weight: 650; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--accent); font-size: 16px; font-weight: 400; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 2px 12px; color: #8ea2aa; font-size: 9px; line-height: 1.55; }
.science-content h3 { color: #c0d1d4; font-size: 9px; margin: 10px 0 4px; letter-spacing: .03em; }
.science-content p { margin: 4px 0; }
.science-content b { color: #c8d9db; }
.science-constants { color: #7c9a9b; }
.science-disclaimer { color: #6c848b; font-style: italic; margin-top: 10px !important; }
.panel-footer { display: flex; justify-content: space-between; padding: 12px 0 3px; color: #536a74; font: 700 7px var(--mono); letter-spacing: .12em; }
.panel-footer b { color: #81949b; }
.panel-footer i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-left: 4px; background: var(--accent); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0,1fr) 340px; }
  .stage-column { padding-left: 15px; padding-right: 14px; }
  .control-column { padding-left: 13px; padding-right: 13px; }
  .stage-head-right .tiny-chip:first-child { display: none; }
}
@media (max-width: 680px) {
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { height: 58px; flex-basis: 58px; padding: 0 13px; }
  .brand-mark { width: 27px; height: 27px; }
  .eyebrow { font-size: 7px; letter-spacing: .11em; }
  h1 { font-size: 15px; }
  .topbar-right { gap: 10px; }
  .live-state { font-size: 8px; }
  .icon-button { width: 32px; height: 32px; }
  .workspace { min-height: 0; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(270px, 44dvh) minmax(0,1fr); }
  .stage-column { padding: 10px 10px 0; border-right: 0; min-height: 0; }
  .stage-head { flex-basis: 24px; align-items: center; }
  .stage-head .section-kicker { font-size: 8px; }
  .stage-subtitle { font-size: 9px; }
  .stage-divider { padding: 0 5px; }
  .stage-head-right { gap: 4px; }
  .tiny-chip { padding: 3px 5px; font-size: 7px; }
  .canvas-wrap { min-height: 0; border-radius: 9px; }
  .canvas-hud { top: 9px; }
  .hud-left { left: 9px; }
  .hud-right { right: 9px; }
  .hud-label { font-size: 7px; }
  .hud-value { font-size: 8px; }
  .canvas-footnote { display: none; }
  .process-strip { flex: 0 0 68px; padding: 9px 1px 0; }
  .process-strip-head { margin-bottom: 8px; }
  .process-strip-head .section-kicker { font-size: 8px; }
  .sequence-note { font-size: 8px; max-width: 58%; }
  .step-track { gap: 3px; }
  .step-track::before { top: 8px; }
  .step-item { gap: 4px; flex-direction: column; align-items: flex-start; }
  .step-number { flex-basis: 17px; width: 17px; height: 17px; font-size: 7px; }
  .step-name { font-size: 8px; }
  .control-column { padding: 11px 12px 12px; min-height: 0; }
  .outcome-card { padding: 10px 12px 9px; }
  .outcome-number { font-size: 29px; }
  .outcome-main { margin: 5px 0 7px; }
  .outcome-status { font-size: 9px; }
  .quality-foot { font-size: 6px; }
  .readout-section { margin-top: 12px; }
  .readout-grid { gap: 6px; margin-top: 7px; }
  .readout-card { padding: 8px 9px 7px; }
  .readout-label { font-size: 8px; margin-bottom: 4px; }
  .readout-card strong { font-size: 16px; }
  .readout-sub { margin-top: 3px; font-size: 7px; }
  .settings-section { margin-top: 13px; }
  .preset-row { margin: 8px 0 11px; }
  .preset-button { padding: 7px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .control-list { gap: 10px; }
  .control-label label { font-size: 9px; }
  .control-label output { font-size: 9px; }
  .transport-card { margin-top: 13px; }
}
@media (max-width: 390px) {
  .stage-head-right .accent-chip { display: none; }
  .stage-subtitle { font-size: 8px; }
  .readout-card strong { font-size: 15px; }
  .control-column { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
