:root {
  color-scheme: dark;
  --bg: #090e17;
  --panel: #101925;
  --panel-2: #121f2d;
  --line: rgba(169, 194, 214, .13);
  --line-strong: rgba(169, 194, 214, .22);
  --text: #eaf1f5;
  --muted: #93a6b4;
  --dim: #607383;
  --accent: #62e0c1;
  --accent-soft: rgba(98, 224, 193, .12);
  --amber: #ffbd70;
  --red: #ff8d75;
  --radius: 16px;
  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 { min-height: 100vh; 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; display: flex; flex-direction: column; background: radial-gradient(ellipse at 34% 22%, rgba(32, 68, 79, .16), transparent 42%), var(--bg); }
.topbar { height: 64px; min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(9, 14, 23, .92); z-index: 2; }
.brand-lockup, .topbar-right, .model-pill, .transport-main, .transport-tools, .audit-heading { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(98, 224, 193, .4); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-7deg); background: rgba(98, 224, 193, .06); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--accent); transform: rotate(7deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }.brand-mark span:nth-child(2) { height: 16px; }.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.eyebrow { font-size: 9px; letter-spacing: .19em; color: #718897; font-weight: 750; line-height: 1.4; }
.brand-title { font-size: 11px; font-weight: 800; letter-spacing: .13em; margin-top: 2px; }
.topbar-right { gap: 15px; }
.model-pill { gap: 8px; color: #a9c0c9; font-size: 9px; font-weight: 800; letter-spacing: .13em; padding: 8px 11px; border: 1px solid rgba(98, 224, 193, .2); border-radius: 30px; background: rgba(98, 224, 193, .045); }
.pulse-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(98, 224, 193, .6); }
.topbar-divider { width: 1px; height: 19px; background: var(--line-strong); }
.seed-label { font-size: 9px; letter-spacing: .12em; color: #778c9a; font-weight: 700; }
.seed-label small { color: #607383; font-size: 7px; margin-left: 5px; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(350px, .92fr); gap: 16px; padding: 16px; }
.stage-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 58px; gap: 10px; }
.stage-shell { min-height: 0; position: relative; overflow: hidden; border: 1px solid rgba(142, 177, 194, .16); border-radius: 18px; background: #0b1420; box-shadow: 0 20px 60px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255,255,255,.025); }
#sceneCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-hud { position: absolute; top: 20px; left: 22px; right: 22px; display: flex; justify-content: space-between; pointer-events: none; }
.live-tag { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(98,224,193,.24); border-radius: 6px; background: rgba(8, 18, 27, .68); color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.live-dot { width: 5px; height: 5px; }
.hud-subtitle { color: #8da2af; font-size: 11px; margin-top: 9px; letter-spacing: .015em; }
.hud-right { display: flex; gap: 22px; text-align: right; }
.hud-metric { display: flex; flex-direction: column; gap: 2px; }
.hud-metric span { font-size: 8px; letter-spacing: .15em; color: #6e8493; font-weight: 800; }
.hud-metric strong { font-size: 18px; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hud-metric small { font-size: 7px; color: #647987; letter-spacing: .12em; }
.scene-label { position: absolute; display: flex; align-items: center; gap: 7px; color: rgba(169, 193, 202, .75); font-size: 8px; letter-spacing: .13em; font-weight: 750; pointer-events: none; white-space: nowrap; }
.label-line { width: 23px; height: 1px; background: rgba(98,224,193,.62); }
.label-muscle { left: 5.5%; top: 56%; }.label-latch { left: 58%; top: 74%; }.label-hair { right: 4%; top: 37%; flex-direction: row-reverse; }
.stage-footer { position: absolute; left: 22px; right: 22px; bottom: 16px; display: flex; align-items: center; gap: 19px; color: #8195a2; font-size: 8px; letter-spacing: .11em; font-weight: 700; pointer-events: none; }
.stage-footer span { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 6px; height: 6px; border-radius: 2px; display: inline-block; }.swatch-energy { background: var(--amber); box-shadow: 0 0 8px rgba(255,189,112,.45); }.swatch-motion { background: var(--accent); box-shadow: 0 0 8px rgba(98,224,193,.45); }
.stage-footer .schematic-note { margin-left: auto; color: #526877; }
.transport-bar { min-height: 58px; border: 1px solid var(--line); border-radius: 13px; background: rgba(15, 24, 36, .92); display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; gap: 10px; }
.transport-main, .transport-tools { gap: 7px; }
.button, .icon-button { border: 1px solid transparent; border-radius: 8px; height: 38px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:active, .icon-button:active, .preset-card:active { transform: translateY(1px); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.button-primary { background: var(--accent); color: #06201c; box-shadow: 0 4px 18px rgba(98,224,193,.13); }.button-primary:hover { background: #7be9cf; }
.button-secondary { background: #172536; border-color: #2a3c4c; color: #d4e1e6; }.button-secondary:hover, .icon-button:hover { background: #203347; border-color: #3c596a; }
.button-icon { font-size: 15px; line-height: 1; }.icon-button { width: 36px; background: #142131; border-color: #273747; color: #c3d1d8; font-size: 16px; }
.button-quiet { background: transparent; border-color: var(--line); color: #9aadb8; padding: 0 10px; }.button-quiet:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255,255,255,.03); }
.quality-toggle { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #0c1520; gap: 2px; }
.quality-toggle button { border: 0; background: transparent; color: #718695; font-size: 8px; letter-spacing: .1em; font-weight: 800; border-radius: 5px; padding: 7px 8px; cursor: pointer; }
.quality-toggle button[aria-pressed="true"] { background: #26394a; color: #dce9ed; }
.control-panel { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(180deg, rgba(18, 29, 43, .98), rgba(13, 22, 34, .98)); overflow: hidden; }
.panel-scroll { height: 100%; overflow: auto; overscroll-behavior: contain; padding: 21px 20px 18px; scrollbar-width: thin; scrollbar-color: #304454 transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.accent-eyebrow { color: var(--accent); }
.panel-heading h1 { font-size: 21px; line-height: 1.12; letter-spacing: -.04em; margin: 6px 0 7px; font-weight: 680; }
.panel-heading p { font-size: 11px; line-height: 1.5; color: #8ea2af; margin: 0; max-width: 340px; }
.ant-stamp { width: 38px; height: 38px; border: 1px solid rgba(255,189,112,.2); border-radius: 11px; display: grid; place-items: center; background: rgba(255,189,112,.06); font-size: 19px; filter: saturate(.7); }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #9aafbb; font-size: 9px; font-weight: 850; letter-spacing: .15em; margin-bottom: 10px; }
.section-label span { color: #5f7584; font-size: 7px; letter-spacing: .12em; }
.preset-section { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-card { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 10px; text-align: left; border-radius: 9px; border: 1px solid #2a3a49; background: rgba(7, 16, 26, .48); cursor: pointer; transition: .18s ease; }
.preset-card:hover { border-color: #58717e; background: rgba(255,255,255,.025); }
.preset-card.active { border-color: rgba(98,224,193,.5); background: rgba(98,224,193,.075); box-shadow: inset 0 0 0 1px rgba(98,224,193,.06); }
.preset-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; color: var(--accent); background: rgba(98,224,193,.11); font-size: 17px; flex: 0 0 auto; }.preset-icon-hot { color: var(--amber); background: rgba(255,189,112,.1); }
.preset-card strong { display: block; font-size: 10px; font-weight: 750; white-space: nowrap; }.preset-card small { display: block; margin-top: 3px; color: #78909e; font-size: 8px; white-space: nowrap; }
.controls-section { padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.control-row + .control-row { margin-top: 13px; }
.control-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.control-topline label { color: #d7e2e7; font-size: 10px; font-weight: 650; }
.control-topline output { color: var(--accent); font-size: 9px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 15px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(98,224,193,.85), rgba(98,224,193,.22)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(98,224,193,.85), rgba(98,224,193,.22)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; margin-top: -4.5px; background: #b7fff0; border: 2px solid #267e70; box-shadow: 0 0 0 3px rgba(98,224,193,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #b7fff0; border: 2px solid #267e70; box-shadow: 0 0 0 3px rgba(98,224,193,.12); }
.range-ends { display: flex; justify-content: space-between; color: #607786; font-size: 8px; margin-top: 3px; }
.mechanics-section { padding-top: 15px; }
.readout-section { padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; padding: 10px 11px 9px; border: 1px solid rgba(146,176,191,.13); border-radius: 9px; background: rgba(6, 15, 25, .45); }
.readout-card > span { display: block; color: #78909e; font-size: 8px; letter-spacing: .13em; font-weight: 800; }
.readout-card strong { display: block; margin-top: 5px; color: #e6f1f2; font-size: 19px; letter-spacing: -.045em; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-card strong small { color: #9cb0ba; font-size: 9px; letter-spacing: 0; font-weight: 600; }
.readout-card em { display: block; margin-top: 3px; color: #5d7380; font-size: 7px; font-style: normal; letter-spacing: .12em; }
.caption-card { display: flex; gap: 10px; padding: 12px 12px; margin: 14px 0; border: 1px solid rgba(98,224,193,.18); border-radius: 10px; background: rgba(98,224,193,.045); }
.caption-mark { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(98,224,193,.5); color: var(--accent); font-family: Georgia, serif; font-size: 12px; font-style: italic; }
.caption-title { font-size: 10px; font-weight: 800; color: #d8e9e8; margin-bottom: 4px; }
.caption-card p { color: #8fa7af; font-size: 9px; line-height: 1.5; margin: 0; }
.audit-card { border: 1px solid rgba(255,189,112,.17); border-radius: 10px; padding: 11px 12px; background: rgba(255,189,112,.035); }
.audit-heading { gap: 9px; align-items: center; }.audit-check { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,189,112,.12); color: var(--amber); font-size: 12px; }
.audit-heading .section-label { margin: 0 0 3px; color: #b0a18b; font-size: 7px; }.audit-heading strong { font-size: 9px; font-weight: 700; color: #e0d7c9; }
.audit-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0 8px; margin-top: 7px; border-bottom: 1px solid rgba(255,189,112,.12); }
.audit-values span, .audit-foot span { display: block; color: #8c897e; font-size: 8px; }.audit-values strong { display: block; color: #e8d9c0; font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.audit-foot { display: flex; align-items: baseline; gap: 6px; padding-top: 8px; }.audit-foot strong { color: var(--amber); font-size: 12px; font-variant-numeric: tabular-nums; }.audit-method { margin-left: auto; font-size: 6px !important; letter-spacing: .08em; color: #756d60 !important; }
.science-panel { margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; list-style: none; cursor: pointer; padding: 13px 0; color: #c0d0d6; font-size: 9px; font-weight: 850; letter-spacing: .16em; }.science-panel summary::-webkit-details-marker { display: none; }.summary-plus { color: var(--accent); font-size: 18px; font-weight: 400; transition: transform .2s ease; }.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 0 14px; }.science-content h2 { font-size: 12px; margin: 1px 0 7px; }.science-content p { color: #91a5b0; font-size: 9px; line-height: 1.55; margin: 0 0 9px; }.equation { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; margin: 5px 0; border-radius: 6px; background: rgba(255,255,255,.025); }.equation span { color: #7f96a3; font-size: 8px; }.equation code { color: #b9f0e3; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; white-space: nowrap; }.science-content .science-note { color: #748b98; font-size: 8px; }.science-content .institution-note { color: #a4b8bf; font-size: 8px; font-style: italic; margin-top: 9px; }
.panel-footnote { color: #506775; font-size: 7px; letter-spacing: .12em; margin-top: 12px; text-align: center; }

@media (max-width: 900px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1.3fr) minmax(310px, .95fr); gap: 10px; padding: 10px; }
  .panel-scroll { padding: 16px 14px; }.topbar { padding: 0 18px; }
  .transport-bar { flex-wrap: wrap; height: auto; }.transport-main, .transport-tools { gap: 5px; }.button { padding: 0 9px; }
}
@media (max-width: 700px) {
  body { overflow: auto; }
  .app-shell { height: 100vh; height: 100dvh; min-height: 0; }
  .topbar { height: 52px; min-height: 52px; padding: 0 13px; }.brand-mark { width: 26px; height: 26px; }.brand-title { font-size: 9px; }.eyebrow { font-size: 7px; }.topbar-right { gap: 8px; }.model-pill { padding: 6px 8px; font-size: 7px; }.topbar-divider, .seed-label { display: none; }
  .workspace { padding: 8px; gap: 8px; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(250px, 42dvh) minmax(0,1fr); }
  .stage-column { grid-template-rows: minmax(0,1fr) 48px; gap: 7px; }
  .stage-shell { border-radius: 13px; }.stage-hud { top: 12px; left: 13px; right: 13px; }.hud-subtitle { font-size: 9px; max-width: 190px; }.hud-right { gap: 12px; }.hud-metric strong { font-size: 14px; }.hud-metric span { font-size: 7px; }.scene-label { font-size: 6px; gap: 4px; }.label-line { width: 12px; }.label-muscle { left: 3%; top: 62%; }.label-latch { left: 54%; top: 75%; }.label-hair { right: 2%; top: 39%; }.stage-footer { left: 12px; right: 12px; bottom: 10px; gap: 9px; font-size: 6px; }.stage-footer .schematic-note { display: none; }
  .transport-bar { min-height: 48px; padding: 5px 5px; border-radius: 10px; gap: 3px; }.transport-main, .transport-tools { gap: 3px; }.button, .icon-button { height: 34px; }.button { font-size: 9px; padding: 0 8px; gap: 5px; }.button-primary { min-width: 102px; padding: 0 6px; font-size: 8px; }.button-secondary { width: 31px; padding: 0; font-size: 0; }.button-secondary .button-icon { font-size: 14px; }.icon-button { width: 31px; font-size: 14px; }.quality-toggle { display: flex; padding: 2px; }.quality-toggle button { font-size: 7px; padding: 6px 6px; }.button-quiet { font-size: 0; width: 30px; padding: 0; }.button-quiet span { font-size: 14px; }
  .control-panel { border-radius: 13px; min-height: 0; }.panel-scroll { padding: 14px 13px 20px; }.panel-heading { margin-bottom: 12px; }.panel-heading h1 { font-size: 18px; }.panel-heading p { font-size: 10px; }.ant-stamp { width: 32px; height: 32px; font-size: 16px; }.preset-section { padding-bottom: 12px; }.preset-card { padding: 8px; gap: 7px; }.preset-icon { width: 23px; height: 23px; font-size: 14px; }.preset-card strong { font-size: 9px; }.preset-card small { font-size: 7px; }.controls-section { padding: 12px 0; }.control-row + .control-row { margin-top: 10px; }.readout-section { padding: 12px 0; }.readout-card { padding: 8px 9px; }.readout-card strong { font-size: 17px; }.caption-card { margin: 11px 0; padding: 10px; }.audit-card { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .workspace { min-height: 0; }
@media (max-width: 700px) {
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  body.embed-mode .workspace { height: calc(100% - 52px); grid-template-rows: minmax(235px, 42dvh) minmax(0,1fr); overflow: hidden; }
  body.embed-mode .control-panel { overflow: hidden; }
  body.embed-mode .panel-scroll { overflow: auto; height: 100%; }
}
