:root {
  color-scheme: dark;
  --bg: #071418;
  --panel: #0b1c20;
  --panel-2: #10262a;
  --panel-3: #132c30;
  --line: rgba(163, 203, 196, .13);
  --line-strong: rgba(163, 203, 196, .23);
  --text: #e9f3ef;
  --muted: #8ca7a1;
  --muted-2: #607c76;
  --accent: #65e4c8;
  --accent-soft: rgba(101, 228, 200, .12);
  --accent-glow: rgba(101, 228, 200, .25);
  --warning: #e5bc78;
  --danger: #ed8e79;
  --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: 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; }
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 12% -20%, rgba(38, 104, 98, .16), transparent 42%), var(--bg); }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(7, 20, 24, .92); position: relative; z-index: 2; }
.brand-lockup, .topbar-right, .brand-copy, .live-indicator { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 27px; height: 27px; display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid rgba(101, 228, 200, .34); border-radius: 8px; transform: rotate(-7deg); }
.brand-mark span { display: block; width: 4px; border-radius: 5px; background: var(--accent); transform: skewY(-22deg); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .75; }
.brand-copy { align-items: flex-start; flex-direction: column; gap: 1px; }
.eyebrow, .section-kicker, .caption-label, .readout-label, .threshold-label, .micro-note, .science-subhead, .audit-title, .panel-foot, .canvas-corner, .scale-note { font-size: 9px; letter-spacing: .14em; font-weight: 700; }
.eyebrow { color: var(--muted); font-size: 8px; }
.brand-title { font-size: 14px; font-weight: 850; letter-spacing: .14em; color: var(--text); }
.brand-title span { color: var(--accent); }
.topbar-right { gap: 20px; }
.live-indicator { gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: .14em; font-weight: 750; }
.live-dot, .meta-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(101, 228, 200, .09), 0 0 12px var(--accent-glow); }
.live-dot.paused { background: var(--warning); box-shadow: 0 0 0 4px rgba(229, 188, 120, .08); }
.icon-button { border: 1px solid var(--line-strong); background: rgba(17, 42, 45, .55); border-radius: 8px; padding: 8px 11px; display: flex; align-items: center; gap: 8px; color: #c3d6d0; font-size: 11px; cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.icon-button:hover { background: var(--accent-soft); border-color: rgba(101, 228, 200, .45); transform: translateY(-1px); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 366px; gap: 0; }
.stage-panel { min-width: 0; min-height: 0; padding: 20px 22px 18px 24px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); }
.stage-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.section-kicker { color: var(--muted-2); font-size: 8px; letter-spacing: .16em; }
.kicker-divider { color: var(--accent); padding: 0 4px; }
h1 { font-size: clamp(21px, 2.2vw, 29px); letter-spacing: -.045em; font-weight: 640; margin: 5px 0 0; line-height: 1.1; }
h1 em { color: var(--accent); font-style: normal; font-weight: 430; }
.stage-meta { flex: 0 0 auto; color: var(--muted); font-size: 8px; letter-spacing: .13em; font-weight: 700; display: flex; align-items: center; gap: 8px; padding-bottom: 3px; }
.meta-dot { width: 5px; height: 5px; }
.meta-sep { color: var(--muted-2); }
.visual-wrap { flex: 1; min-height: 0; position: relative; border: 1px solid rgba(115, 172, 162, .2); border-radius: 14px; overflow: hidden; background: #0a2024; box-shadow: 0 18px 60px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255,255,255,.015); }
#sceneCanvas { display: block; width: 100%; height: 100%; outline: none; }
.canvas-corner { position: absolute; top: 14px; color: rgba(195, 224, 216, .72); font-size: 8px; display: flex; align-items: center; gap: 8px; pointer-events: none; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.canvas-corner-left { left: 16px; }
.canvas-corner-right { right: 16px; }
.corner-label { color: var(--accent); font-size: 9px; }
.corner-line { width: 17px; height: 1px; background: var(--accent); box-shadow: 0 0 9px var(--accent-glow); }
.scale-note { position: absolute; bottom: 12px; right: 15px; color: rgba(190, 218, 211, .46); font-size: 7px; pointer-events: none; }
.stage-footer { flex: 0 0 auto; min-height: 66px; border: 1px solid var(--line); border-radius: 11px; background: rgba(13, 31, 35, .78); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.caption-mark { width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); display: grid; place-items: center; flex: 0 0 auto; }
.caption-mark span { width: 7px; height: 7px; border: 1px solid var(--accent); border-radius: 50%; box-shadow: 0 0 9px var(--accent-glow); }
.caption-copy { min-width: 0; flex: 1; }
.caption-label { color: var(--accent); font-size: 7px; margin-bottom: 4px; }
.caption-copy p { color: #b6c9c3; font-size: 10px; line-height: 1.45; margin: 0; max-width: 660px; }
.threshold-readout { border-left: 1px solid var(--line-strong); padding-left: 15px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; text-align: right; }
.threshold-label { color: var(--muted-2); font-size: 7px; }
.threshold-readout strong { color: var(--accent); font-size: 16px; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px 16px; background: linear-gradient(180deg, rgba(12, 29, 33, .92), rgba(8, 22, 26, .95)); scrollbar-width: thin; scrollbar-color: #284b4b transparent; }
.control-panel::-webkit-scrollbar { width: 5px; }
.control-panel::-webkit-scrollbar-thumb { background: #284b4b; border-radius: 8px; }
.panel-heading, .section-row-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
h2 { font-size: 14px; letter-spacing: -.025em; font-weight: 620; margin: 4px 0 0; }
.data-tag { font-size: 7px; letter-spacing: .12em; color: #86b8aa; border: 1px solid rgba(101, 228, 200, .2); background: rgba(101, 228, 200, .055); border-radius: 4px; padding: 4px 6px; font-weight: 750; white-space: nowrap; }
.readout-grid { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; border: 1px solid var(--line); background: rgba(17, 41, 44, .64); border-radius: 9px; padding: 10px 10px 9px; min-height: 77px; }
.primary-readout { background: linear-gradient(135deg, rgba(24, 67, 65, .52), rgba(16, 42, 44, .8)); border-color: rgba(101, 228, 200, .23); }
.readout-label { color: var(--muted-2); font-size: 7px; letter-spacing: .12em; }
.readout-value { margin-top: 5px; display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.readout-value strong { font-size: 22px; letter-spacing: -.06em; font-weight: 620; font-variant-numeric: tabular-nums; color: var(--text); }
.primary-readout .readout-value strong { color: var(--accent); }
.readout-value span { color: var(--muted); font-size: 10px; }
.readout-foot { color: var(--muted-2); font-size: 8px; margin-top: 2px; }
.threshold-track-wrap { margin-top: 11px; }
.threshold-track-label { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 7px; letter-spacing: .1em; font-weight: 700; margin-bottom: 6px; }
.threshold-track { height: 5px; background: rgba(125, 155, 148, .15); border-radius: 9px; position: relative; overflow: visible; }
.threshold-fill { width: 50%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c98670, var(--accent)); transition: width .22s ease; }
.threshold-marker { position: absolute; width: 2px; height: 11px; top: -3px; left: 50%; background: #e7f3ed; box-shadow: 0 0 7px rgba(255,255,255,.4); }
.preset-section, .parameters-section, .transport-section, .science-panel { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 14px; }
.section-row-heading { align-items: center; }
.section-row-heading h2 { margin: 0; }
.micro-note { color: var(--muted-2); font-size: 7px; }
.preset-grid { margin-top: 9px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { min-width: 0; border: 1px solid var(--line); background: rgba(15, 37, 40, .58); border-radius: 8px; display: flex; align-items: center; text-align: left; gap: 9px; padding: 8px 9px; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.preset-button:hover { border-color: rgba(101, 228, 200, .35); background: rgba(20, 52, 53, .7); }
.preset-button.active { border-color: rgba(101, 228, 200, .42); background: rgba(33, 77, 70, .28); box-shadow: inset 2px 0 0 var(--accent); }
.preset-icon { width: 25px; height: 25px; border-radius: 7px; background: rgba(101, 228, 200, .08); display: flex; align-items: center; justify-content: center; gap: 2px; flex: 0 0 auto; }
.preset-icon i { display: block; width: 2px; border-radius: 2px; background: var(--accent); transform: skew(-18deg); }
.preset-icon i:nth-child(1) { height: 7px; opacity: .55; }
.preset-icon i:nth-child(2) { height: 13px; }
.preset-icon i:nth-child(3) { height: 9px; opacity: .75; }
.fast-icon { background: rgba(101, 228, 200, .12); }
.fast-icon i { box-shadow: 0 0 6px var(--accent-glow); }
.heavy-icon { background: rgba(229, 188, 120, .08); }
.heavy-icon i { background: var(--warning); }
.preset-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.preset-text strong { font-size: 10px; font-weight: 650; }
.preset-text small { color: var(--muted); font-size: 8px; }
.preset-arrow { color: var(--muted-2); font-size: 12px; }
.parameter-list { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 12px; }
.parameter-row { min-width: 0; }
.parameter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 7px; }
.parameter-head label { font-size: 9px; color: #c4d5cf; font-weight: 550; white-space: nowrap; }
.parameter-head output { color: var(--accent); font-size: 9px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 0; 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, rgba(101,228,200,.52), rgba(116,155,146,.22)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(101,228,200,.52), rgba(116,155,146,.22)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; border: 2px solid #d9fff4; background: #2a9e88; box-shadow: 0 0 0 3px rgba(101,228,200,.12); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #d9fff4; background: #2a9e88; box-shadow: 0 0 0 3px rgba(101,228,200,.12); }
.range-ends { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 7px; margin-top: 3px; }
.parameter-note { display: flex; gap: 7px; align-items: flex-start; margin-top: 12px; color: var(--muted-2); font-size: 8px; line-height: 1.45; }
.note-glyph { width: 13px; height: 13px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); font-size: 8px; font-style: italic; }
.transport-controls { display: flex; gap: 6px; margin-top: 10px; align-items: stretch; }
.transport-button, .quality-button { min-height: 33px; border: 1px solid var(--line-strong); background: rgba(17, 41, 44, .66); border-radius: 7px; padding: 0 9px; color: #b8ccc5; font-size: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: all .2s ease; }
.transport-button:hover, .quality-button:hover { border-color: rgba(101,228,200,.4); color: var(--text); background: rgba(28, 65, 63, .5); }
.play-button { background: rgba(101, 228, 200, .13); border-color: rgba(101, 228, 200, .32); color: var(--accent); font-weight: 650; flex: 1; }
.play-symbol { font-size: 12px; line-height: 1; }
.step-symbol { font-size: 15px; line-height: 0; }
.quality-button { padding: 0 8px; font-size: 8px; letter-spacing: .08em; }
.quality-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.science-panel { margin-top: 15px; padding-top: 0; }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 13px 0 4px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 25px; height: 25px; border-radius: 7px; background: rgba(101,228,200,.09); color: var(--accent); display: grid; place-items: center; font-size: 14px; }
.science-panel summary > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.science-panel summary strong { font-size: 10px; font-weight: 650; }
.science-panel summary small { color: var(--muted); font-size: 8px; }
.summary-chevron { color: var(--muted); transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 12px 2px 3px; color: #a9beb7; font-size: 9px; line-height: 1.55; }
.science-subhead { color: var(--accent); font-size: 7px; margin: 12px 0 6px; }
.science-content p { margin: 5px 0; }
.science-content p strong { color: #d7e5df; font-size: 9px; }
.equation { padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(14, 36, 38, .75); color: #d4e9e0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.science-content ul { margin: 7px 0; padding-left: 16px; }
.science-content li { margin: 5px 0; }
.science-content li strong { color: #d5e7df; }
.audit-box { margin-top: 12px; padding: 10px; border: 1px solid rgba(101,228,200,.2); border-radius: 8px; background: rgba(23, 62, 57, .19); }
.audit-title { color: var(--accent); font-size: 7px; }
.audit-box p { color: var(--muted); font-size: 8px; }
.audit-values { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.audit-values span { color: var(--muted-2); font-size: 7px; display: flex; flex-direction: column; gap: 3px; }
.audit-values strong { color: var(--text); font-size: 10px; font-variant-numeric: tabular-nums; }
.disclaimer { margin-top: 12px !important; color: var(--muted-2) !important; font-size: 8px !important; }
.panel-foot { display: flex; justify-content: space-between; color: #4d6963; font-size: 6px; letter-spacing: .12em; margin-top: 16px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.panel-foot strong { color: var(--muted); }
@media (max-width: 900px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .stage-panel { padding-left: 16px; padding-right: 16px; }
  .control-panel { padding-left: 14px; padding-right: 14px; }
  .parameter-list { column-gap: 10px; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { height: 56px; flex-basis: 56px; padding: 0 14px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-title { font-size: 12px; }
  .eyebrow { font-size: 7px; }
  .topbar-right { gap: 11px; }
  .live-indicator { font-size: 8px; gap: 6px; }
  .icon-button { padding: 7px; }
  .icon-button span { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 0; min-height: 0; overflow: hidden; }
  .stage-panel { flex: 0 0 43%; min-height: 255px; padding: 11px 12px 10px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-heading { align-items: flex-end; }
  .section-kicker { font-size: 7px; }
  h1 { font-size: 19px; margin-top: 4px; }
  .stage-meta { font-size: 7px; gap: 5px; padding-bottom: 2px; }
  .visual-wrap { border-radius: 10px; }
  .canvas-corner { top: 9px; font-size: 6px; gap: 5px; }
  .canvas-corner-left { left: 10px; }
  .canvas-corner-right { right: 10px; }
  .scale-note { bottom: 7px; right: 9px; font-size: 6px; }
  .stage-footer { min-height: 49px; padding: 7px 9px; gap: 8px; border-radius: 8px; }
  .caption-mark { width: 20px; height: 20px; }
  .caption-label { font-size: 6px; margin-bottom: 2px; }
  .caption-copy p { font-size: 8px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .threshold-readout { padding-left: 9px; }
  .threshold-label { font-size: 6px; }
  .threshold-readout strong { font-size: 13px; }
  .control-panel { flex: 1 1 0; padding: 12px 13px 18px; min-height: 0; overflow-y: auto; }
  h2 { font-size: 12px; }
  .readout-grid { margin-top: 9px; gap: 6px; }
  .readout-card { min-height: 64px; padding: 8px; }
  .readout-label { font-size: 6px; }
  .readout-value { margin-top: 4px; }
  .readout-value strong { font-size: 19px; }
  .readout-foot { font-size: 7px; }
  .threshold-track-wrap { margin-top: 8px; }
  .preset-section, .parameters-section, .transport-section, .science-panel { margin-top: 13px; padding-top: 11px; }
  .preset-grid { grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
  .preset-button { padding: 7px 6px; gap: 5px; min-height: 54px; }
  .preset-icon { width: 19px; height: 19px; border-radius: 5px; }
  .preset-icon i:nth-child(1) { height: 5px; }
  .preset-icon i:nth-child(2) { height: 10px; }
  .preset-icon i:nth-child(3) { height: 7px; }
  .preset-text strong { font-size: 8px; line-height: 1.2; }
  .preset-text small { font-size: 6px; line-height: 1.2; }
  .preset-arrow { display: none; }
  .parameter-list { margin-top: 10px; row-gap: 10px; column-gap: 13px; }
  .parameter-head { margin-bottom: 5px; }
  .parameter-head label { font-size: 8px; }
  .parameter-head output { font-size: 8px; }
  .range-ends { font-size: 6px; }
  .parameter-note { font-size: 7px; margin-top: 10px; }
  .transport-controls { gap: 5px; }
  .transport-button, .quality-button { min-height: 31px; font-size: 8px; padding: 0 7px; }
  .science-panel summary { padding-top: 11px; }
  .panel-foot { font-size: 5px; }
}
@media (max-width: 370px) {
  .stage-panel { flex-basis: 42%; padding-left: 9px; padding-right: 9px; }
  h1 { font-size: 17px; }
  .stage-meta { font-size: 6px; }
  .control-panel { padding-left: 10px; padding-right: 10px; }
  .parameter-list { column-gap: 9px; }
  .preset-text strong { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
