:root {
  color-scheme: dark;
  --bg: #080d17;
  --panel: #0d1523;
  --panel-2: #101b2b;
  --panel-3: #121f30;
  --line: #1d2b3d;
  --line-soft: rgba(126, 153, 181, .13);
  --text: #edf4f7;
  --muted: #8292a5;
  --muted-2: #586b80;
  --accent: #6ee7c3;
  --accent-dim: rgba(110, 231, 195, .14);
  --accent-line: rgba(110, 231, 195, .42);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: 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); font-family: var(--sans); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; 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 { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 42% -20%, rgba(46, 81, 100, .17), transparent 48%), var(--bg); }
.topbar { height: 58px; min-height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 23, .96); }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { display: inline-flex; align-items: flex-end; gap: 3px; width: 18px; height: 18px; padding: 2px; border: 1px solid rgba(110, 231, 195, .35); border-radius: 5px; }
.brand-mark i { display: block; width: 3px; border-radius: 3px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 6px; opacity: .55; }.brand-mark i:nth-child(2) { height: 10px; opacity: .8; }.brand-mark i:nth-child(3) { height: 13px; }
.brand-overline, .header-title, .live-indicator, .quiet-button, .export-button, .section-kicker, .round-readout, .stage-corner, .stage-legend, .aside-heading, .metric-label, .metric-foot, .card-eyebrow, .state-pill, .state-foot, .chart-status, .chart-legend, .chart-footnote, .check-status, .check-detail, .equation-label, .source-tag, .controls-heading, .control-title, .control-hint, .keyboard-hint, .preset-label, .preset-button, .transport-button, .primary-control { font-family: var(--mono); letter-spacing: .08em; }
.brand-overline { color: #9eafbf; font-size: 10px; white-space: nowrap; }.brand-overline b { color: var(--accent); padding: 0 4px; font-weight: 500; }
.header-title { color: #dce8ee; font-size: 11px; font-weight: 700; letter-spacing: .19em; white-space: nowrap; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: #9aabb9; font-size: 9px; margin-right: 8px; white-space: nowrap; }.live-indicator i, .corner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(110,231,195,.6); display: inline-block; }
.quiet-button, .export-button { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #0c1522; color: #9cabb9; padding: 0 10px; font-size: 9px; cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.quiet-button:hover, .export-button:hover { color: var(--accent); border-color: var(--accent-line); background: #10201f; }
.export-button { display: flex; align-items: center; gap: 7px; color: var(--accent); border-color: rgba(110,231,195,.32); }.export-icon { font-family: var(--sans); font-size: 15px; line-height: 1; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(350px, .88fr); grid-template-rows: minmax(0, 1fr) auto; gap: 13px; padding: 14px 16px 15px; overflow: hidden; }
.visual-column { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.section-strip { height: 25px; min-height: 25px; display: flex; align-items: flex-start; justify-content: space-between; padding: 0 3px 5px; }
.section-kicker { color: #a9bac8; font-size: 9px; font-weight: 700; }.round-readout { color: #718398; font-size: 9px; }.round-readout em { color: #53677d; font-style: normal; }
.stage-wrap { position: relative; flex: 1; min-height: 250px; overflow: hidden; border: 1px solid #1a2a3d; border-radius: 9px; background: radial-gradient(ellipse at 50% 42%, #12253a 0%, #0d1828 45%, #0a1320 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 16px 38px rgba(0,0,0,.12); }
#sceneCanvas { display: block; width: 100%; height: 100%; }
.stage-corner { position: absolute; top: 14px; z-index: 1; color: #7d91a5; font-size: 8px; pointer-events: none; }.stage-corner-left { left: 15px; display: flex; align-items: center; gap: 7px; }.stage-corner-right { right: 15px; color: #8da2b4; }
.stage-legend { position: absolute; bottom: 11px; left: 14px; right: 14px; display: flex; align-items: center; gap: 17px; color: #8496a9; font-size: 8px; pointer-events: none; }.stage-legend span { display: inline-flex; align-items: center; gap: 6px; }.legend-swatch { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }.legend-swatch.winner { background: var(--accent); box-shadow: 0 0 8px rgba(110,231,195,.5); }.legend-swatch.majority { background: #52677e; }.stage-legend .legend-note { margin-left: auto; color: #53677b; }
.transport-bar { height: 50px; min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 1px 0; }
.transport-controls, .preset-controls { display: flex; align-items: center; gap: 7px; }.primary-control, .transport-button, .preset-button { height: 31px; padding: 0 11px; border-radius: 6px; font-size: 9px; cursor: pointer; transition: .18s ease; }
.primary-control { display: flex; align-items: center; gap: 8px; background: var(--accent); color: #08201b; border: 1px solid var(--accent); font-weight: 800; min-width: 91px; justify-content: center; }.primary-control:hover { background: #8bf1d2; border-color: #8bf1d2; }.play-symbol { font-family: var(--sans); font-size: 13px; letter-spacing: 0; }
.transport-button { background: #0e1928; border: 1px solid var(--line); color: #a6b4c2; }.transport-button:hover, .preset-button:hover { border-color: var(--accent-line); color: var(--accent); }.transport-button span { color: var(--accent); padding-left: 5px; font-family: var(--sans); font-size: 13px; }
.preset-label { font-size: 8px; color: #60748a; margin-right: 2px; }.preset-button { background: transparent; border: 1px solid #223247; color: #8498aa; padding: 0 9px; }.preset-button:active { background: var(--accent-dim); }
.insight-column { grid-column: 2; grid-row: 1 / span 2; min-width: 0; min-height: 0; overflow-y: auto; padding: 1px 1px 4px 0; scrollbar-width: thin; scrollbar-color: #26394e transparent; }
.aside-heading { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px 10px; color: #a8bac8; font-size: 9px; font-weight: 700; }.aside-heading-state { color: var(--accent); font-size: 8px; font-weight: 500; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric-card { min-width: 0; padding: 11px 12px 10px; border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(145deg, rgba(17,29,45,.94), rgba(12,21,34,.96)); }
.metric-alpha { border-color: rgba(110,231,195,.25); background: linear-gradient(145deg, rgba(18,39,45,.92), rgba(12,24,34,.96)); }
.metric-label { display: flex; justify-content: space-between; gap: 6px; color: #7f92a5; font-size: 8px; white-space: nowrap; }.metric-label span { color: var(--accent); }
.metric-value { margin-top: 6px; font-family: var(--mono); font-size: clamp(21px, 2.1vw, 27px); line-height: 1; letter-spacing: -.07em; color: #e7f1f4; font-variant-numeric: tabular-nums; }.metric-alpha .metric-value { color: var(--accent); }.value-unit { font-size: 13px; letter-spacing: 0; color: #a3b6c2; padding-left: 2px; }
.metric-foot { margin-top: 7px; color: #62758a; font-size: 8px; }.metric-foot b { color: #52677a; font-weight: 500; }
.state-card, .chart-card, .check-card, .science-panel { border: 1px solid var(--line); border-radius: 7px; background: rgba(13,21,35,.88); }
.state-card { margin-top: 8px; padding: 11px 12px 9px; }.state-card-top, .check-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }.card-eyebrow { color: #7c90a3; font-size: 8px; font-weight: 700; }.state-pill { padding: 4px 6px; border-radius: 4px; color: var(--accent); background: var(--accent-dim); font-size: 7px; white-space: nowrap; }
.state-card p { margin: 8px 0 9px; color: #b4c2cd; font-size: 11px; line-height: 1.48; }.state-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid var(--line-soft); color: #60758a; font-size: 7px; }.state-foot span { color: #52677b; }
.chart-card { margin-top: 8px; padding: 10px 11px 8px; }.chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.chart-heading > div { display: flex; flex-direction: column; gap: 4px; }.chart-heading strong { color: #dbe7ed; font-size: 11px; font-weight: 600; }.chart-status { color: var(--accent); font-size: 7px; white-space: nowrap; }.chart-status.done { color: #6c8296; }
#phaseCanvas { display: block; width: 100%; height: 132px; margin-top: 5px; }.chart-legend { display: flex; flex-wrap: wrap; gap: 9px 12px; color: #71859a; font-size: 7px; }.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }.chart-legend b { color: #586e82; font-weight: 500; }.chart-key { width: 13px; height: 2px; display: inline-block; }.curve-key { background: var(--accent); }.critical-key { background: repeating-linear-gradient(90deg, #a3aeb8 0 3px, transparent 3px 5px); }.current-key { width: 6px; height: 6px; border: 1px solid #e4f1f4; border-radius: 50%; }.chart-footnote { margin-top: 7px; color: #53677c; font-size: 7px; letter-spacing: .04em; }
.check-card { margin-top: 8px; padding: 10px 12px 9px; }.check-status { display: flex; align-items: center; gap: 5px; color: #7d958f; font-size: 7px; }.check-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }.check-main { margin-top: 7px; color: #dce9ee; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }.check-main span { color: #667b8f; padding: 0 4px; }.check-detail { margin-top: 4px; color: #72869a; font-size: 8px; letter-spacing: .035em; }
.science-panel { margin-top: 8px; overflow: hidden; }.science-panel summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; cursor: pointer; color: #a8bbc8; font-family: var(--mono); font-size: 8px; letter-spacing: .1em; }.science-panel summary::-webkit-details-marker { display: none; }.science-toggle { color: var(--accent); font-size: 14px; font-family: var(--sans); transition: transform .2s ease; }.science-panel[open] .science-toggle { transform: rotate(45deg); }.science-content { padding: 0 12px 12px; border-top: 1px solid var(--line-soft); }.equation-block { padding-top: 10px; }.equation-label { color: var(--accent); font-size: 7px; margin-bottom: 6px; }.equation-block p { color: #9aabba; font-size: 10px; line-height: 1.5; margin: 5px 0; }.equation-block code { color: #d3e3e8; background: #142334; border-radius: 3px; padding: 2px 4px; font-family: var(--mono); font-size: 9px; }.source-tag { display: inline-block; color: var(--accent); font-size: 7px; }.disclaimer { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line-soft); color: #6e8193; font-size: 9px; line-height: 1.45; }
.control-panel { grid-column: 1; grid-row: 2; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(13,21,35,.9); padding: 10px 12px 8px; }
.controls-heading { display: flex; justify-content: space-between; align-items: center; color: #9eafbd; font-size: 8px; font-weight: 700; }.controls-heading span:last-child { color: #566c81; font-weight: 400; font-size: 7px; }
.control-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-top: 9px; }.control-card { min-width: 0; }.control-title { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #91a4b5; font-size: 8px; white-space: nowrap; }.control-title label, .control-title > span:first-child { overflow: hidden; text-overflow: ellipsis; }.control-title output { color: var(--accent); font-size: 10px; font-weight: 700; }.control-note { color: #52677b; font-size: 7px; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 16px; margin: 8px 0 4px; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(110,231,195,.58), #314458); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(110,231,195,.58), #314458); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #09201b; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(110,231,195,.16); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #09201b; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(110,231,195,.16); }
.control-hint { display: flex; justify-content: space-between; color: #5e7388; font-size: 7px; }.control-hint span { color: #4e6578; }
.segmented { display: flex; width: 100%; height: 27px; margin-top: 7px; border: 1px solid #24374b; border-radius: 5px; padding: 2px; background: #091321; }.segmented button { flex: 1; min-width: 0; border: 0; border-radius: 3px; background: transparent; color: #71869a; font-family: var(--mono); font-size: 7px; letter-spacing: .04em; cursor: pointer; white-space: nowrap; }.segmented button[aria-pressed="true"] { background: rgba(110,231,195,.14); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(110,231,195,.2); }
.keyboard-hint { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: #5d7287; font-size: 7px; }.keyboard-hint > span { color: #8799aa; margin-right: 3px; }.keyboard-hint kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 15px; padding: 0 4px; border: 1px solid #2a3b4e; border-radius: 3px; color: #9aabba; font-family: var(--mono); font-size: 8px; background: #111c2b; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 5; padding: 9px 13px; border: 1px solid var(--accent-line); border-radius: 6px; background: #10211f; color: var(--accent); font-family: var(--mono); font-size: 9px; letter-spacing: .05em; transition: opacity .2s ease, transform .2s ease; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1050px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0,1.3fr) minmax(320px,.9fr); padding: 10px; gap: 10px; }
  .control-grid { gap: 8px; }.control-title { font-size: 7px; }.control-hint { font-size: 6px; }.header-title { letter-spacing: .12em; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .topbar { height: 54px; min-height: 54px; grid-template-columns: 1fr auto; padding: 0 12px; gap: 8px; }.brand-overline { font-size: 8px; }.brand-mark { width: 16px; height: 16px; }.header-title { display: none; }.header-actions { gap: 6px; }.live-indicator { display: none; }.quiet-button { height: 28px; padding: 0 7px; font-size: 8px; }.export-button { height: 28px; padding: 0 8px; font-size: 8px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #26394e transparent; }
  .visual-column { flex: 0 0 auto; order: 0; }.section-strip { height: 22px; min-height: 22px; }.stage-wrap { flex: none; height: 310px; min-height: 270px; }.stage-corner { top: 10px; font-size: 7px; }.stage-corner-left { left: 10px; }.stage-corner-right { right: 10px; }.stage-legend { left: 10px; right: 10px; bottom: 8px; gap: 11px; font-size: 7px; }.stage-legend .legend-note { display: none; }
  .transport-bar { height: 45px; min-height: 45px; padding-top: 7px; }.primary-control, .transport-button, .preset-button { height: 29px; padding: 0 8px; font-size: 8px; }.primary-control { min-width: 78px; }.preset-label { display: none; }.preset-controls { gap: 5px; }
  .insight-column { order: 1; flex: 0 0 auto; overflow: visible; padding: 0; }.aside-heading { padding: 2px 2px 8px; }.metric-grid { gap: 7px; }.metric-card { padding: 10px 11px 9px; }.metric-value { font-size: 25px; }.metric-label { font-size: 7px; }.metric-foot { font-size: 7px; }.state-card p { font-size: 11px; }.chart-card { padding: 10px; }#phaseCanvas { height: 150px; }.chart-legend { gap: 7px 10px; }.check-card { margin-bottom: 0; }
  .control-panel { order: 2; flex: 0 0 auto; padding: 11px; }.controls-heading span:last-child { display: none; }.control-grid { grid-template-columns: 1fr 1fr; gap: 15px 13px; margin-top: 12px; }.control-title { font-size: 8px; }.control-hint { font-size: 7px; }.source-control { grid-column: 1 / -1; }.segmented { max-width: 100%; }.keyboard-hint { flex-wrap: wrap; line-height: 1.5; margin-top: 12px; }
  .science-content { padding-bottom: 14px; }.toast { bottom: 10px; width: max-content; max-width: calc(100vw - 24px); }
}
@media (max-width: 380px) {
  .stage-wrap { height: 285px; }.transport-controls { gap: 5px; }.preset-button { padding: 0 6px; }.transport-button { padding: 0 7px; }.stage-legend { gap: 8px; font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
