:root {
  color-scheme: dark;
  --bg: #071119;
  --panel: #0c1922;
  --panel-2: #10212c;
  --line: rgba(151, 190, 202, .13);
  --line-strong: rgba(151, 190, 202, .22);
  --text: #e6f0ef;
  --muted: #8ca5ac;
  --muted-2: #607a83;
  --cyan: #78d6d0;
  --cyan-soft: #a5e9df;
  --gold: #e8ae76;
  --orange: #d87c53;
  --red: #c9684b;
  --radius: 13px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; background-image: radial-gradient(ellipse at 52% -22%, rgba(34, 91, 102, .18), transparent 52%), linear-gradient(180deg, #071119 0%, #08141c 100%); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { min-height: 100vh; max-width: 1920px; margin: 0 auto; padding: 0 22px 12px; }
.topbar { min-height: 84px; display: grid; grid-template-columns: 225px minmax(0, 1fr) 210px; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--text); }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(120,214,208,.45); border-radius: 11px; display: grid; place-items: center; font-size: 20px; font-weight: 750; letter-spacing: -2px; color: #b7eee4; background: linear-gradient(145deg, rgba(50,117,121,.35), rgba(10,29,39,.55)); box-shadow: inset 0 0 18px rgba(120,214,208,.08); }
.brand-mark span { color: var(--gold); }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 11px; letter-spacing: .15em; }
.brand-copy strong span { color: var(--cyan); }
.brand-copy small { font-size: 8px; letter-spacing: .16em; color: var(--muted-2); }
.top-title { min-width: 0; }
.eyebrow, .section-kicker { color: var(--cyan); font-size: 9px; font-weight: 750; letter-spacing: .17em; }
.eyebrow span { color: var(--gold); margin: 0 5px; }
.top-title h1 { margin: 6px 0 0; font-size: clamp(15px, 1.45vw, 21px); font-weight: 620; letter-spacing: -.025em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title h1 span { color: var(--gold); font-weight: 400; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(120,214,208,.2); border-radius: 30px; padding: 7px 10px; color: #9dc5c5; font-size: 8px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; background: rgba(24, 59, 65, .23); }
.live-pill i, .scene-dot, .status-pulse { width: 6px; height: 6px; border-radius: 50%; background: #7fe0c5; box-shadow: 0 0 10px rgba(127,224,197,.65); }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line-strong); background: transparent; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 17px; }
.icon-button:hover, .scene-tool:hover, .transport-button:hover, .export-button:hover { border-color: rgba(120,214,208,.48); color: var(--cyan-soft); }
.workspace { display: grid; grid-template-columns: minmax(250px, 286px) minmax(430px, 1fr) minmax(250px, 292px); gap: 14px; align-items: stretch; padding-top: 14px; min-height: calc(100vh - 130px); }
.panel { background: linear-gradient(180deg, rgba(13, 27, 37, .98), rgba(10, 22, 31, .98)); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 16px 14px; min-width: 0; box-shadow: 0 16px 38px rgba(0,0,0,.13); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 16px; font-weight: 620; letter-spacing: -.02em; }
.panel-index { color: #48626c; font-size: 10px; letter-spacing: .12em; font-weight: 700; padding-top: 4px; }
.panel-intro { margin: 10px 0 15px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.preset-block { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0 13px; }
.control-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.control-label-row label { color: #b9cacc; font-size: 10px; font-weight: 600; }
.control-label-row output { color: var(--cyan-soft); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 650; }
.micro-note { color: var(--muted-2); font-size: 8px; letter-spacing: .12em; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 9px; }
.preset-button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 8px 7px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.preset-button:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.preset-button.active { border-color: rgba(120,214,208,.48); background: rgba(55,120,120,.12); }
.preset-button strong { font-size: 9px; font-weight: 680; }
.preset-button small { color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.preset-dot { width: 7px; height: 7px; border-radius: 50%; }
.classic-dot { background: #d88961; box-shadow: 0 0 7px rgba(216,137,97,.4); }
.fine-dot { background: #80d9cb; box-shadow: 0 0 7px rgba(128,217,203,.4); }
.sparse-dot { background: #c5a3d9; box-shadow: 0 0 7px rgba(197,163,217,.4); }
.controls-list { display: flex; flex-direction: column; gap: 12px; padding: 13px 0 12px; }
.range-control { min-width: 0; }
.range-control input[type="range"], .transport-speed input[type="range"] { display: block; width: 100%; height: 14px; margin: 6px 0 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, rgba(120,214,208,.8), rgba(75,112,122,.4)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, rgba(120,214,208,.8), rgba(75,112,122,.4)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; background: #c4f1e8; border: 2px solid #2a6968; box-shadow: 0 0 0 3px rgba(120,214,208,.12), 0 0 9px rgba(120,214,208,.25); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: #c4f1e8; border: 2px solid #2a6968; box-shadow: 0 0 0 3px rgba(120,214,208,.12); }
.range-ends { display: flex; justify-content: space-between; color: #607b84; font-size: 8px; margin-top: 1px; }
.derived-box { padding: 10px 11px 9px; background: rgba(45, 98, 100, .10); border: 1px solid rgba(120,214,208,.13); border-radius: 9px; }
.derived-label { font-size: 8px; color: var(--muted-2); letter-spacing: .13em; font-weight: 700; }
.derived-value { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.derived-value strong { font-size: 21px; letter-spacing: -.04em; font-weight: 630; font-variant-numeric: tabular-nums; }
.derived-value span { font-size: 9px; color: var(--muted); }
.derived-track { height: 3px; border-radius: 5px; background: rgba(255,255,255,.07); margin: 7px 0 6px; overflow: hidden; }
.derived-track span { display: block; width: 48%; height: 100%; background: linear-gradient(90deg, #4baca8, #d5b17c); border-radius: inherit; transition: width .25s; }
.derived-box p { margin: 0; font-size: 8px; line-height: 1.45; color: var(--muted-2); }
.panel-footnote { display: flex; gap: 7px; align-items: flex-start; margin-top: 12px; color: #60777f; font-size: 8px; line-height: 1.45; }
.tiny-bullet { flex: 0 0 auto; width: 4px; height: 4px; margin-top: 3px; border-radius: 50%; background: var(--gold); }
.stage-column { min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.scene-frame { display: flex; flex-direction: column; min-height: 490px; flex: 1; overflow: hidden; border: 1px solid rgba(121, 169, 178, .18); border-radius: var(--radius); background: radial-gradient(ellipse at 50% 38%, rgba(28, 74, 81, .22), transparent 55%), #07121a; position: relative; }
.scene-topline { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid rgba(151,190,202,.09); z-index: 2; }
.scene-id { display: flex; align-items: center; gap: 8px; color: #9db5b9; font-size: 8px; font-weight: 750; letter-spacing: .14em; }
.scene-view-tools { display: flex; gap: 6px; }
.scene-tool { border: 1px solid rgba(151,190,202,.16); background: rgba(8,20,28,.65); border-radius: 6px; color: #829ca4; font-size: 7px; font-weight: 750; letter-spacing: .1em; padding: 6px 8px; cursor: pointer; }
.scene-tool.active { border-color: rgba(120,214,208,.28); color: var(--cyan); background: rgba(50,109,111,.13); }
.scene-tool span { color: var(--gold); margin-left: 3px; }
.scene-viewport { position: relative; flex: 1; min-height: 420px; overflow: hidden; isolation: isolate; }
.scene-viewport canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; }
.scene-loading { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; background: #07121a; color: var(--text); transition: opacity .4s; }
.scene-loading.hidden { opacity: 0; pointer-events: none; }
.scene-loading strong { font-size: 11px; font-weight: 600; }
.scene-loading small { font-size: 9px; color: var(--muted-2); }
.loader-orbit { width: 27px; height: 27px; border: 2px solid rgba(120,214,208,.15); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scene-annotations { position: absolute; inset: 0; z-index: 2; pointer-events: none; transition: opacity .2s; }
.scene-annotations.hidden { opacity: 0; }
.scene-tag { position: absolute; display: inline-flex; align-items: center; gap: 6px; color: #9ebfc1; font-size: 7px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; text-shadow: 0 1px 6px #061018, 0 0 10px #061018; }
.scene-tag i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px rgba(120,214,208,.7); }
.tag-band i { background: var(--gold); box-shadow: 0 0 9px rgba(232,174,118,.65); }
.tag-ruler { padding: 5px 7px; border: 1px solid rgba(151,190,202,.15); border-radius: 5px; background: rgba(5,17,24,.65); color: #8ca8af; }
.scene-corner { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.scene-corner span { color: #597780; font-size: 7px; letter-spacing: .14em; font-weight: 700; }
.scene-corner strong { color: #9bb5b9; font-size: 8px; letter-spacing: .07em; font-weight: 650; }
.scene-corner-tl { left: 14px; top: 15px; }
.scene-corner-br { right: 14px; bottom: 14px; align-items: flex-end; }
.context-overlay { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 7px; background: rgba(4,12,18,.9); text-align: center; }
.context-overlay[hidden] { display: none; }
.context-overlay strong { font-size: 13px; }
.context-overlay span { font-size: 10px; color: var(--muted); }
.scene-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; padding: 9px 13px 10px; border-top: 1px solid rgba(151,190,202,.08); color: #6f8b92; font-size: 7px; letter-spacing: .1em; font-weight: 700; }
.scene-legend span { display: inline-flex; align-items: center; gap: 5px; }
.scene-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-ion { background: #72cfd1; box-shadow: 0 0 6px #72cfd1; }
.legend-gel { background: #82c9c0; opacity: .6; }
.legend-mineral { background: #d78a61; }
.scene-legend .legend-note { margin-left: auto; color: #4f6a73; }
.transport-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(13,27,37,.92); }
.transport-main, .transport-tools { display: flex; align-items: center; gap: 6px; }
.transport-button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid rgba(151,190,202,.15); border-radius: 7px; background: rgba(255,255,255,.018); color: #91a9af; font-size: 8px; font-weight: 750; letter-spacing: .08em; cursor: pointer; white-space: nowrap; }
.transport-button.primary { min-width: 85px; border-color: rgba(120,214,208,.4); background: linear-gradient(120deg, rgba(52,127,123,.3), rgba(37,79,82,.2)); color: #b9f0e5; }
.play-icon { font-size: 10px; color: var(--cyan); }
.step-icon { color: var(--gold); font-size: 12px; }
.reset-icon { font-size: 14px; }
.transport-speed { display: flex; align-items: center; gap: 7px; min-width: 118px; flex: 1; max-width: 180px; }
.transport-speed label { font-size: 7px; color: #708b92; letter-spacing: .1em; font-weight: 750; white-space: nowrap; }
.transport-speed input[type="range"] { flex: 1; min-width: 30px; margin-top: 0; }
.transport-speed output { font-size: 8px; color: var(--cyan-soft); font-variant-numeric: tabular-nums; min-width: 28px; }
.quality-switch { display: flex; gap: 2px; padding: 2px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 6px; }
.quality-button { border: 0; background: transparent; border-radius: 4px; padding: 5px 6px; color: #657e86; font-size: 7px; font-weight: 750; letter-spacing: .08em; cursor: pointer; }
.quality-button.active { background: rgba(120,214,208,.15); color: var(--cyan-soft); }
.export-button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 9px; border: 1px solid rgba(232,174,118,.2); border-radius: 7px; background: rgba(140,91,55,.09); color: #d6ad87; font-size: 7px; font-weight: 750; letter-spacing: .08em; cursor: pointer; white-space: nowrap; }
.export-button span { font-size: 13px; }
.keyboard-hint { padding: 0 3px; color: #4f6972; font-size: 8px; letter-spacing: .01em; }
.keyboard-hint span { color: #78939a; font-size: 7px; letter-spacing: .1em; margin-right: 8px; font-weight: 750; }
.keyboard-hint b { color: #8c9fa2; padding: 0 4px; font-weight: 400; }
.data-panel { display: flex; flex-direction: column; gap: 13px; }
.telemetry-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.telemetry-card { min-width: 0; padding: 10px 9px 9px; border: 1px solid rgba(151,190,202,.11); border-radius: 9px; background: rgba(255,255,255,.018); }
.telemetry-label { display: block; min-height: 19px; color: #76919a; font-size: 7px; font-weight: 750; letter-spacing: .1em; line-height: 1.35; }
.telemetry-number { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; }
.telemetry-number strong { color: #e3eeeb; font-size: 24px; font-weight: 620; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.telemetry-number small { color: #78939a; font-size: 9px; }
.mini-bar { height: 3px; margin: 8px 0 6px; background: rgba(255,255,255,.07); border-radius: 4px; overflow: hidden; }
.mini-bar i { display: block; width: 46%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #398f8c, #80d8c8); transition: width .3s; }
.mini-bar.warm i { background: linear-gradient(90deg, #a66d4c, #e5b37b); }
.telemetry-sub { display: block; color: #607981; font-size: 7px; line-height: 1.3; }
.band-indicator { height: 3px; display: flex; gap: 2px; margin: 8px 0 6px; }
.band-indicator i { flex: 1; border-radius: 3px; background: rgba(216,124,83,.15); }
.band-indicator i.active { background: #d58b64; box-shadow: 0 0 6px rgba(213,139,100,.22); }
.time-spark { display: flex; align-items: flex-end; gap: 3px; height: 3px; margin: 8px 0 6px; }
.time-spark i { flex: 1; height: 100%; border-radius: 2px; background: rgba(120,214,208,.28); }
.time-spark i:nth-child(3n) { background: rgba(120,214,208,.65); }
.validation-card { padding: 11px 11px 10px; border: 1px solid rgba(232,174,118,.18); border-radius: 9px; background: linear-gradient(140deg, rgba(122,80,48,.10), rgba(255,255,255,.012)); }
.validation-head { display: flex; align-items: center; justify-content: space-between; }
.textbook-tag { padding: 3px 5px; border: 1px solid rgba(232,174,118,.25); border-radius: 4px; color: #d8aa7d; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.validation-card h3 { margin: 8px 0 4px; font-size: 12px; font-weight: 650; }
.validation-card p { margin: 0; color: #82989d; font-size: 8px; line-height: 1.45; }
.validation-card p strong { color: #c7d6d2; font-weight: 650; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 8px; }
.validation-values div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 3px 4px; padding: 7px; border: 1px solid rgba(151,190,202,.1); border-radius: 6px; background: rgba(0,0,0,.12); }
.validation-values span { grid-column: 1 / -1; color: #728b91; font-size: 7px; letter-spacing: .1em; font-weight: 750; }
.validation-values strong { color: #d8e6df; font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; }
.validation-values small { color: #7d9699; font-size: 8px; }
.validation-result { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; border-top: 1px solid rgba(151,190,202,.1); }
.validation-result span { color: #758d91; font-size: 7px; letter-spacing: .1em; font-weight: 750; }
.validation-result strong { color: #9ce0cb; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.validation-equation { margin-top: 8px; color: #8b9fa1; font-size: 9px; font-family: Georgia, serif; font-style: italic; }
.validation-equation span { color: #d8b58d; }
.science-panel { border: 1px solid rgba(151,190,202,.13); border-radius: 9px; background: rgba(255,255,255,.015); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 10px 11px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.science-panel summary strong { font-size: 12px; font-weight: 650; }
.summary-plus { color: var(--cyan); font-size: 17px; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 11px 12px; border-top: 1px solid rgba(151,190,202,.09); }
.science-content h4 { margin: 12px 0 5px; color: #c5d6d2; font-size: 9px; font-weight: 700; }
.science-content p, .science-content li { color: #83999e; font-size: 8px; line-height: 1.55; }
.science-content p { margin: 0 0 7px; }
.science-content ul { padding-left: 15px; margin: 5px 0 0; }
.equation { padding: 7px 8px; margin: 7px 0; border-left: 2px solid rgba(120,214,208,.5); background: rgba(53,106,105,.1); color: #b9d9d0; font-family: Georgia, serif; font-size: 11px; }
.scaled-note { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding: 8px; border-radius: 6px; background: rgba(197,143,96,.08); border: 1px solid rgba(232,174,118,.13); }
.scaled-note strong { color: #d5a67d; font-size: 7px; letter-spacing: .1em; }
.scaled-note span { color: #8e9b98; font-size: 8px; line-height: 1.4; }
.data-foot { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); color: #607980; font-size: 7px; letter-spacing: .09em; font-weight: 700; }
.status-pulse { width: 5px; height: 5px; }
.footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 3px 0; color: #48616a; font-size: 7px; font-weight: 750; letter-spacing: .14em; }
.footer span span { color: #7caaa7; }
.footer b { color: var(--gold); padding: 0 4px; font-weight: 400; }
.embed .topbar, .embed .footer { display: none; }
.embed { padding: 8px; }
.embed .workspace { min-height: calc(100vh - 16px); padding-top: 0; }
.embed .scene-frame { min-height: 0; }
.embed .stage-column { min-height: calc(100vh - 16px); }
.embed .keyboard-hint { display: none; }
.embed .scene-viewport { min-height: 0; }
@media (max-width: 1180px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .workspace { grid-template-columns: minmax(230px, 260px) minmax(360px, 1fr) minmax(230px, 255px); gap: 10px; }
  .panel { padding: 14px 12px; }
  .transport-bar { flex-wrap: wrap; }
  .transport-speed { max-width: none; }
}
@media (max-width: 960px) {
  .topbar { grid-template-columns: 180px minmax(0,1fr) 150px; gap: 10px; }
  .top-title h1 { white-space: normal; font-size: 15px; }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stage-column { grid-column: 1 / -1; grid-row: 1; }
  .controls-panel { grid-column: 1; }
  .data-panel { grid-column: 2; }
  .scene-frame { min-height: 560px; }
  .scene-viewport { min-height: 480px; }
}
@media (max-width: 640px) {
  .app-shell { padding: 0 10px 10px; }
  .topbar { min-height: 68px; grid-template-columns: 1fr auto; gap: 8px; }
  .brand-mark { width: 33px; height: 33px; }
  .top-title { grid-column: 1 / -1; grid-row: 2; padding: 0 0 10px; }
  .top-title h1 { margin-top: 4px; font-size: 14px; white-space: normal; }
  .topbar { padding-top: 9px; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .live-pill { font-size: 7px; padding: 6px 8px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; min-height: 0; }
  .stage-column { order: 0; }
  .controls-panel { order: 1; }
  .data-panel { order: 2; }
  .scene-frame { min-height: 0; }
  .scene-viewport { min-height: min(116vw, 480px); }
  .scene-topline { padding: 9px 10px; }
  .scene-id { font-size: 7px; }
  .scene-tool { padding: 6px; font-size: 6px; }
  .scene-corner-tl { top: 10px; left: 10px; }
  .scene-corner-br { bottom: 10px; right: 10px; }
  .scene-legend { gap: 9px; padding: 8px 10px; font-size: 6px; }
  .scene-legend .legend-note { width: 100%; margin-left: 0; }
  .transport-bar { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 8px; }
  .transport-main { gap: 4px; }
  .transport-button { padding: 0 8px; font-size: 7px; }
  .transport-button.primary { min-width: 72px; }
  .transport-speed { grid-column: 1 / -1; grid-row: 2; max-width: none; width: 100%; }
  .transport-tools { grid-column: 2; grid-row: 1; }
  .export-button { padding: 7px; font-size: 6px; }
  .quality-button { padding: 5px 4px; font-size: 6px; }
  .keyboard-hint { font-size: 7px; line-height: 1.5; }
  .panel { padding: 15px 13px; }
  .controls-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 14px; }
  .preset-button { padding: 8px; }
  .panel-footnote { font-size: 8px; }
  .data-panel { gap: 10px; }
  .telemetry-card { padding: 10px; }
  .telemetry-number strong { font-size: 25px; }
  .footer { padding-top: 9px; font-size: 6px; }
}
@media (max-width: 380px) {
  .top-actions .live-pill { display: none; }
  .scene-tool { letter-spacing: .04em; }
  .scene-legend { gap: 7px; }
  .controls-list { column-gap: 10px; }
  .transport-button { gap: 4px; padding: 0 6px; }
  .export-button { gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (min-width: 641px) and (max-height: 760px) {
  .workspace { min-height: calc(100vh - 130px); }
  .panel { padding: 11px 11px 10px; }
  .panel-heading h2 { font-size: 15px; }
  .panel-intro { margin: 7px 0 9px; font-size: 9px; line-height: 1.4; }
  .preset-block { padding: 8px 0; }
  .preset-grid { margin-top: 7px; }
  .preset-button { padding: 6px; gap: 3px; }
  .preset-button small { font-size: 7px; }
  .controls-list { gap: 7px; padding: 9px 0; }
  .range-control input[type="range"] { height: 10px; margin-top: 4px; }
  .range-ends { margin-top: 0; }
  .derived-box { padding: 8px 9px; }
  .derived-value strong { font-size: 18px; }
  .derived-box p { font-size: 7px; }
  .panel-footnote { margin-top: 8px; font-size: 7px; }
  .data-panel { gap: 8px; }
  .telemetry-card { padding: 8px; }
  .telemetry-label { min-height: 16px; }
  .telemetry-number strong { font-size: 21px; }
  .mini-bar, .band-indicator, .time-spark { margin-top: 6px; margin-bottom: 5px; }
  .validation-card { padding: 9px; }
  .validation-card h3 { margin-top: 6px; }
  .validation-values { margin: 7px 0 6px; }
  .science-panel summary { padding: 8px 9px; }
  .scene-frame { min-height: 0; }
  .scene-viewport { min-height: 0; }
  .transport-bar { min-height: 48px; }
}
