:root {
  color-scheme: dark;
  --bg: #07121c;
  --panel: #0b1a26;
  --panel-2: #0d202d;
  --line: rgba(150, 190, 204, .14);
  --line-strong: rgba(150, 190, 204, .24);
  --text: #e8f1f4;
  --muted: #8ca3ad;
  --dim: #5d7682;
  --accent: #62e7dc;
  --accent-soft: rgba(98, 231, 220, .12);
  --accent-glow: rgba(98, 231, 220, .28);
  --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 { background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13px; line-height: 1.45; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 20% 0%, rgba(24, 68, 78, .16), transparent 34%), var(--bg); }
.embed-mode .app-shell { height: 100%; min-height: 0; }
.topbar { height: 58px; flex: 0 0 58px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(5, 15, 23, .92); }
.brand-mark { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; gap: 2px; border: 1px solid rgba(98, 231, 220, .3); border-radius: 8px; background: var(--accent-soft); }
.brand-mark span { display: block; width: 2px; border-radius: 2px; background: var(--accent); }
.brand-mark span:nth-child(1), .brand-mark span:nth-child(4) { height: 7px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .8; }
.brand-copy { display: flex; flex-direction: column; gap: 0; }
.eyebrow, .kicker, .caption-label, .readout-label, .check-label, .preset-heading, .footer, .stage-topline, .stage-bottomline, .control-count { font-family: var(--mono); letter-spacing: .12em; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 700; }
.brand-title { color: #b5c5cb; font-size: 11px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.offline-tag { color: #8ca5ad; font: 9px var(--mono); letter-spacing: .1em; }
.offline-tag i, .live-pulse, .state-dot, .check-mark i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); vertical-align: 1px; }
.top-index { color: #6d8791; font: 10px var(--mono); }
.top-index b, .footer b { color: var(--accent); font-weight: 400; }
.workspace { width: 100%; max-width: 1640px; margin: 0 auto; padding: 22px 28px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 326px; grid-template-rows: auto auto; gap: 18px 22px; align-content: start; }
.visual-column { grid-column: 1; grid-row: 1; min-width: 0; }
.control-column { grid-column: 2; grid-row: 1; align-self: start; }
.embed-mode .workspace { min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; }
.visual-column { min-width: 0; }
.intro-row { min-height: 78px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 0 1px 12px; }
.kicker { color: var(--accent); font-size: 9px; font-weight: 700; }
.kicker span { color: #4c7880; padding: 0 4px; }
h1 { margin: 4px 0 1px; font-size: clamp(25px, 3vw, 35px); line-height: 1.1; letter-spacing: -.045em; font-weight: 620; }
.subtitle { margin: 4px 0 0; color: #9ab0b8; font-size: 12px; }
.live-state { flex: 0 0 auto; display: inline-flex; align-items: center; margin-top: 16px; padding: 7px 10px; border: 1px solid rgba(98, 231, 220, .22); border-radius: 5px; background: rgba(98, 231, 220, .06); color: var(--accent); font: 9px var(--mono); letter-spacing: .08em; white-space: nowrap; }
.live-state[data-state="quiet"] { color: #9bb1b9; border-color: var(--line-strong); background: rgba(140, 163, 173, .06); }
.live-state[data-state="separated"] { color: #b9d3d0; border-color: rgba(98, 231, 220, .15); }
.live-state .state-dot { width: 5px; height: 5px; }
.stage { position: relative; height: 366px; overflow: hidden; border: 1px solid rgba(98, 231, 220, .16); border-radius: 9px; background: #06131e; box-shadow: 0 18px 50px rgba(0,0,0,.22), inset 0 0 50px rgba(14, 59, 67, .12); }
#sceneCanvas { display: block; width: 100%; height: 100%; outline: none; }
#sceneCanvas:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.stage-topline, .stage-bottomline { position: absolute; left: 15px; right: 15px; display: flex; justify-content: space-between; gap: 12px; color: #6e8a96; font-size: 8px; letter-spacing: .11em; pointer-events: none; }
.stage-topline { top: 13px; }
.stage-bottomline { bottom: 11px; }
.stage-topline > span:first-child { color: #b4d0d0; }
.stage-scale { text-align: right; }
.stage-scale b, .stage-bottomline b { color: var(--accent); font-weight: 400; }
.stage-bottomline span:last-child { white-space: nowrap; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.readout-card { min-width: 0; padding: 10px 11px 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(12, 29, 41, .72); }
.readout-label { display: flex; justify-content: space-between; gap: 5px; color: #78919b; font-size: 8px; white-space: nowrap; }
.readout-label span { color: #56747e; }
.readout-value { margin-top: 5px; color: #e4eff0; font: 600 clamp(16px, 1.8vw, 21px)/1.1 var(--mono); letter-spacing: -.06em; white-space: nowrap; }
.readout-value small, .check-grid strong small { font: 10px var(--mono); color: #8ca5ad; letter-spacing: 0; }
.readout-foot { margin-top: 5px; color: #66808b; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.accent-readout { border-color: rgba(98, 231, 220, .22); background: linear-gradient(140deg, rgba(98, 231, 220, .08), rgba(12, 29, 41, .7)); }
.accent-readout .readout-value { color: var(--accent); }
.caption-panel { display: flex; align-items: flex-start; gap: 11px; margin-top: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; background: rgba(10, 25, 36, .66); }
.caption-icon { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.caption-label { margin-bottom: 2px; color: #73909a; font-size: 8px; }
.caption-panel p { margin: 0; color: #b8c9ce; font-size: 11px; line-height: 1.45; }
.check-panel { margin-top: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 6px; background: rgba(9, 22, 32, .75); }
.check-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.check-heading h2 { margin: 2px 0 0; font-size: 13px; font-weight: 550; letter-spacing: -.02em; }
.check-mark { color: #829da5; font: 8px var(--mono); letter-spacing: .1em; white-space: nowrap; }
.check-mark i { width: 5px; height: 5px; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.check-grid > div { padding-left: 10px; border-left: 1px solid var(--line-strong); }
.check-grid > div:first-child { padding-left: 0; border-left: 0; }
.check-label { display: block; color: #6f8a94; font-size: 8px; }
.check-grid strong { display: block; margin-top: 2px; color: #dbe8e9; font: 600 16px/1.2 var(--mono); }
.check-difference strong { color: var(--accent); }
.check-note { display: block; margin-top: 3px; color: #617b85; font-size: 9px; }
.control-column { min-width: 0; align-self: start; padding: 15px 15px 12px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(155deg, rgba(13, 31, 44, .96), rgba(8, 20, 30, .98)); }
.control-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.control-header h2 { margin: 3px 0 0; font-size: 19px; line-height: 1.1; letter-spacing: -.04em; font-weight: 580; }
.control-count { margin-top: 4px; color: #6e8993; font-size: 8px; white-space: nowrap; }
.control-intro { margin: 6px 0 8px; color: #8da4ac; font-size: 9px; line-height: 1.38; }
.control-group { padding: 5px 0 4px; border-top: 1px solid var(--line); }
.control-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-title label { color: #d3e0e3; font-size: 10px; font-weight: 550; }
.control-title output { color: var(--accent); font: 10px var(--mono); white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 4px 0 2px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(98,231,220,.7), rgba(98,231,220,.18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(98,231,220,.7), rgba(98,231,220,.18)); }
input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; appearance: none; -webkit-appearance: none; border: 2px solid #07151e; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(98,231,220,.18), 0 0 12px rgba(98,231,220,.25); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #07151e; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(98,231,220,.18); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 5px; }
.range-ends { display: flex; justify-content: space-between; gap: 8px; color: #617b85; font: 7px var(--mono); }
.control-help { margin: 3px 0 0; color: #718994; font-size: 8px; line-height: 1.3; }
.last-control { padding-bottom: 7px; }
.preset-block { padding: 8px 0 7px; border-top: 1px solid var(--line); }
.preset-heading { display: flex; justify-content: space-between; color: #69828d; font-size: 8px; }
.preset-heading .kicker { font-size: 8px; }
.preset-buttons { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; margin-top: 5px; }
.preset-button { min-height: 60px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 5px; background: rgba(7, 19, 28, .52); text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover, .preset-button:focus-visible { border-color: rgba(98,231,220,.42); outline: none; }
.preset-button.selected { border-color: rgba(98,231,220,.32); background: rgba(98,231,220,.07); }
.preset-symbol { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 4px; color: var(--accent); background: var(--accent-soft); font-size: 14px; }
.preset-button b { display: block; color: #cbdadd; font-size: 8px; line-height: 1.15; font-weight: 550; }
.preset-button small { display: block; margin-top: 1px; color: #6f8993; font-size: 7px; line-height: 1.2; }
.transport-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 6px; padding-top: 7px; border-top: 1px solid var(--line); }
.transport-button { min-height: 33px; display: flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: rgba(7, 18, 27, .75); color: #a8bbc0; font-size: 9px; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.transport-button:hover, .transport-button:focus-visible { border-color: rgba(98,231,220,.45); outline: none; }
.transport-button.primary { border-color: rgba(98,231,220,.4); background: var(--accent-soft); color: var(--accent); }
.transport-button span { font-size: 13px; line-height: 1; }
.play-icon { font-family: var(--mono); }
.utility-row { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: #78929b; font: 8px var(--mono); letter-spacing: .08em; cursor: pointer; }
.text-button b { color: var(--accent); font-weight: 500; }
.text-button:hover, .text-button:focus-visible { color: var(--text); outline: none; }
.keyboard-hint { margin-top: 5px; color: #617985; font-size: 8px; text-align: center; }
kbd { padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 3px; color: #8da4ac; font: 8px var(--mono); }
.keyboard-hint span { padding: 0 4px; color: #425c67; }
.science-panel { grid-column: 1 / -1; grid-row: 2; border: 1px solid var(--line); border-radius: 7px; background: rgba(9, 22, 32, .8); }
.science-panel summary { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary:focus-visible { outline: 1px solid var(--accent); outline-offset: -3px; border-radius: 7px; }
.science-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.science-panel summary b { display: block; color: #d7e4e6; font-size: 11px; font-weight: 550; }
.science-panel summary small { display: block; color: #728a94; font-size: 9px; }
.summary-state { margin-left: auto; color: #78919b; font: 8px var(--mono); letter-spacing: .1em; }
.summary-state i { margin-left: 5px; color: var(--accent); font-size: 12px; font-style: normal; }
.science-panel[open] .summary-state i { display: inline-block; transform: rotate(45deg); }
.science-content { padding: 0 14px 13px; border-top: 1px solid var(--line); }
.science-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; padding-top: 12px; }
.science-grid h3 { margin: 0 0 5px; color: #d3e1e3; font-size: 10px; font-weight: 600; }
.science-grid p { margin: 0 0 7px; color: #879ea6; font-size: 9px; line-height: 1.5; }
.equation { margin: 6px 0; padding: 7px 8px; border-left: 2px solid var(--accent); background: rgba(98,231,220,.055); color: #c5e6e3; font: 10px/1.5 var(--mono); overflow-wrap: anywhere; }
.disclaimer { margin: 9px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: #617a84; font-size: 9px; }
.footer { display: flex; justify-content: space-between; gap: 10px; padding: 0 28px 12px; color: #536c76; font-size: 8px; }
@media (min-width: 1500px) { .workspace { padding-left: 40px; padding-right: 40px; grid-template-columns: minmax(0,1fr) 350px; gap: 20px 26px; } .stage { height: 410px; } }
@media (max-width: 900px) { .workspace { grid-template-columns: minmax(0,1fr) 300px; padding: 18px 18px 14px; gap: 14px; } .stage { height: 330px; } .readout-card { padding: 9px 8px; } .readout-label { font-size: 7px; } .readout-foot { font-size: 8px; } .control-column { padding: 13px 12px 10px; } .footer { padding-left: 18px; padding-right: 18px; } }
@media (max-width: 680px) {
  body { font-size: 12px; }
  .topbar { height: 52px; flex-basis: 52px; padding: 0 14px; }
  .topbar-right { gap: 12px; }
  .offline-tag { font-size: 8px; }
  .top-index { font-size: 9px; }
  .workspace { display: flex; flex-direction: column; gap: 12px; padding: 13px 12px 16px; }
  .visual-column { display: contents; }
  .intro-row { order: 1; }
  .stage { order: 2; }
  .control-column { order: 3; }
  .readout-grid { order: 4; }
  .caption-panel { order: 5; }
  .check-panel { order: 6; }
  .science-panel { order: 7; }
  .intro-row { min-height: 70px; padding-bottom: 9px; }
  h1 { font-size: 28px; }
  .subtitle { font-size: 10px; }
  .live-state { margin-top: 14px; padding: 6px 7px; font-size: 7px; }
  .stage { height: clamp(228px, 34vh, 286px); min-height: 228px; flex: 0 0 clamp(228px, 34vh, 286px); border-radius: 7px; }
  .stage-topline, .stage-bottomline { left: 10px; right: 10px; font-size: 7px; }
  .stage-scale { max-width: 48%; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; margin-top: 7px; }
  .readout-card { padding: 8px 9px 7px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 19px; }
  .readout-foot { font-size: 8px; }
  .caption-panel { margin-top: 7px; padding: 9px 10px; }
  .caption-panel p { font-size: 10px; }
  .check-panel { margin-top: 8px; padding: 10px; }
  .check-grid { gap: 6px; }
  .check-grid > div { padding-left: 7px; }
  .check-label { font-size: 7px; }
  .check-grid strong { font-size: 14px; }
  .check-note { font-size: 8px; }
  .control-column { width: 100%; padding: 13px 13px 11px; }
  .control-header h2 { font-size: 18px; }
  .control-intro { margin-bottom: 9px; }
  .control-group { padding: 9px 0 8px; }
  .preset-buttons { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; }
  .preset-button { min-height: 57px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; padding: 6px; }
  .preset-symbol { width: 18px; height: 18px; font-size: 12px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; line-height: 1.2; }
  .transport-button { min-height: 36px; }
  .science-panel { width: 100%; }
  .science-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .footer { padding: 0 12px 10px; font-size: 7px; }
}
@media (max-width: 390px) {
  .brand-title { font-size: 10px; }
  .offline-tag { font-size: 7px; }
  .top-index { display: none; }
  .workspace { padding-left: 10px; padding-right: 10px; }
  .live-state { font-size: 6px; }
  .readout-label { letter-spacing: .08em; }
  .check-grid { grid-template-columns: 1fr 1fr 1fr; }
  .check-grid strong { font-size: 13px; }
  .science-grid { gap: 9px; }
  .footer span:last-child { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
