:root {
  color-scheme: dark;
  --bg: #0b1119;
  --panel: #111923;
  --panel-soft: #151f2a;
  --line: rgba(164, 185, 201, .13);
  --line-strong: rgba(164, 185, 201, .22);
  --text: #e6edf2;
  --muted: #8495a3;
  --dim: #60717e;
  --cyan: #79c9d0;
  --cyan-soft: rgba(121, 201, 208, .12);
  --amber: #d6a06e;
  --amber-soft: rgba(214, 160, 110, .12);
  --danger: #e18d71;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; font-size: 12px; letter-spacing: .01em; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 48% 5%, rgba(34, 58, 73, .2), transparent 42%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(10, 16, 23, .92); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 25px; height: 25px; position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 4px; border: 1px solid rgba(121, 201, 208, .4); border-radius: 7px; transform: rotate(-3deg); }
.brand-mark span { display: block; width: 4px; border-radius: 3px 3px 1px 1px; background: var(--cyan); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .75; }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.brand-name span { color: var(--cyan); font-weight: 600; }
.brand-sub { margin-top: 4px; font-size: 8px; color: var(--muted); letter-spacing: .2em; }
.topbar-right { display: flex; align-items: center; gap: 9px; color: #aebbc4; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.status-dot, .scene-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: #7ac6a4; box-shadow: 0 0 12px rgba(122, 198, 164, .55); }
.topbar-divider { height: 14px; width: 1px; background: var(--line-strong); margin: 0 6px; }
.topbar-code { color: var(--dim); }
.workspace { width: min(1600px, 100%); margin: 0 auto; padding: 24px 30px 26px; display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 22px; align-items: start; flex: 1; }
.visual-column { min-width: 0; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 1px 0 17px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.eyebrow-line { width: 19px; height: 1px; background: var(--cyan); opacity: .8; }
h1 { margin: 8px 0 4px; font-size: clamp(25px, 3vw, 37px); line-height: 1.02; letter-spacing: .055em; font-weight: 760; }
.subtitle { margin: 0; color: #91a1ad; font-size: 12px; line-height: 1.5; }
.scene-tag { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(121, 201, 208, .18); border-radius: 4px; color: #b3c2ca; background: rgba(19, 35, 43, .5); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.scene-frame { overflow: hidden; border: 1px solid rgba(132, 162, 180, .22); border-radius: 7px; background: #0d151d; box-shadow: 0 18px 52px rgba(0,0,0,.24); }
.scene-host { position: relative; height: clamp(390px, 49vw, 570px); min-height: 360px; overflow: hidden; background: radial-gradient(ellipse at 48% 46%, #1a2b36 0%, #0b121a 75%); }
.simulation-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.scene-topline { position: absolute; top: 15px; left: 17px; right: 17px; z-index: 2; display: flex; justify-content: space-between; pointer-events: none; color: rgba(204, 220, 228, .7); font-size: 8px; font-weight: 700; letter-spacing: .15em; text-shadow: 0 1px 5px rgba(0,0,0,.8); }
.tiny-cross { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border: 1px solid var(--cyan); transform: rotate(45deg); }
.scene-bottomline { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: end; padding: 34px 18px 15px; background: linear-gradient(0deg, rgba(5, 10, 15, .88), rgba(5, 10, 15, .55) 64%, transparent); pointer-events: none; }
.stage-readout { display: flex; flex-direction: column; gap: 4px; }
.stage-kicker, .scene-time > span { color: #8fa2ae; font-size: 8px; font-weight: 800; letter-spacing: .17em; }
.stage-readout strong { color: #d6e3e9; font-size: 10px; letter-spacing: .13em; }
.scene-time { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.scene-time strong { font-size: 18px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.scene-time small { color: var(--cyan); font-size: 10px; }
.sequence-track { grid-column: 1 / -1; height: 2px; background: rgba(182, 202, 214, .18); }
.sequence-track div { width: 0%; height: 100%; background: linear-gradient(90deg, var(--amber), var(--cyan)); box-shadow: 0 0 9px rgba(121,201,208,.5); transition: width .15s linear; }
.scene-compass { position: absolute; top: 46px; right: 18px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; color: rgba(204,220,228,.7); font-size: 8px; letter-spacing: .12em; pointer-events: none; }
.compass-ring { width: 24px; height: 24px; border: 1px solid rgba(200,220,230,.3); border-radius: 50%; display: grid; place-items: center; }
.compass-ring i { display: block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 10px solid var(--cyan); }
.scene-label { position: absolute; z-index: 4; transform: translate(-50%, -50%); padding: 4px 6px; border: 1px solid rgba(214,160,110,.3); border-radius: 3px; background: rgba(8,14,19,.74); color: #e1b48a; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 3px #000; }
.scene-label::after { content: ""; position: absolute; top: 100%; left: 50%; width: 1px; height: 11px; background: currentColor; opacity: .55; }
.scene-label.label-cyan { border-color: rgba(121,201,208,.35); color: #a1e1e2; }
.scene-fallback { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 30px; text-align: center; background: #0b1119; color: var(--text); }
.scene-fallback[hidden] { display: none; }
.scene-fallback strong { font-size: 16px; }
.scene-fallback span { max-width: 340px; color: var(--muted); line-height: 1.6; }
.scene-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 19px; padding: 11px 15px; border-top: 1px solid var(--line); background: rgba(14, 22, 31, .92); color: #95a5b0; font-size: 8px; font-weight: 700; letter-spacing: .11em; }
.scene-legend span { display: flex; align-items: center; gap: 7px; }
.scene-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.legend-rock { background: #706256; }
.legend-water { background: #1d8396; }
.legend-wave { background: #91e0dd; box-shadow: 0 0 8px rgba(145,224,221,.55); }
.interaction-hint { margin: 9px 0 23px; color: #637480; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.interaction-hint b { color: #3d5662; margin: 0 5px; }
.mouse-icon { color: var(--cyan); margin-right: 6px; font-size: 12px; }
.readout-section { margin-top: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 10px; }
.section-heading h2, .panel-heading h2 { margin: 4px 0 0; font-size: 13px; letter-spacing: .13em; }
.data-class { color: #8e9ca6; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-height: 86px; padding: 12px 13px 10px; border: 1px solid var(--line); border-radius: 5px; background: linear-gradient(145deg, rgba(22,34,45,.92), rgba(14,22,31,.95)); }
.readout-label { display: block; color: #8294a1; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.readout-card strong { display: block; margin: 8px 0 4px; font-size: clamp(17px, 2vw, 23px); font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.readout-card strong small { color: var(--cyan); font-size: 10px; font-weight: 600; }
.readout-foot { color: #62727e; font-size: 8px; line-height: 1.35; }
.control-panel { min-width: 0; padding: 17px 17px 14px; border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(165deg, rgba(20,30,41,.98), rgba(13,20,28,.98)); box-shadow: 0 18px 50px rgba(0,0,0,.16); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-index { color: #61727e; font-size: 9px; letter-spacing: .14em; }
.preset-block { padding: 13px 0 14px; border-bottom: 1px solid var(--line); }
.control-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.control-label-row label, .speed-row label { color: #a8b6c0; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.mini-note { color: #61727e; font-size: 7px; letter-spacing: .1em; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 9px; }
.preset-button { min-height: 43px; display: flex; align-items: center; gap: 7px; padding: 7px 6px; border: 1px solid rgba(164,185,201,.14); border-radius: 4px; background: rgba(11,17,24,.6); color: #82929e; text-align: left; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.preset-button:hover { border-color: rgba(121,201,208,.38); color: #cbd8df; }
.preset-button.is-active { border-color: rgba(121,201,208,.5); background: rgba(43,91,101,.18); color: #dce9ed; }
.preset-symbol { color: var(--cyan); font-size: 15px; font-weight: 700; }
.preset-button span:last-child { font-size: 7px; font-weight: 800; line-height: 1.3; letter-spacing: .08em; }
.control-list { display: flex; flex-direction: column; gap: 14px; padding: 15px 0 15px; border-bottom: 1px solid var(--line); }
.range-control { min-width: 0; }
.range-control output, .speed-row output { color: #d7e4e9; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 15px; margin: 7px 0 0; padding: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #397c86, #2b4b58); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #397c86, #2b4b58); }
input[type="range"]::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; border: 2px solid #d5eff0; border-radius: 50%; background: #4c9ba4; box-shadow: 0 0 0 3px rgba(121,201,208,.12); appearance: none; -webkit-appearance: none; }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #d5eff0; border-radius: 50%; background: #4c9ba4; box-shadow: 0 0 0 3px rgba(121,201,208,.12); }
.range-scale, .speed-scale { display: flex; justify-content: space-between; color: #5f707c; font-size: 7px; letter-spacing: .04em; }
.transport-block { padding: 14px 0 14px; border-bottom: 1px solid var(--line); }
.transport-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; margin-top: 9px; }
.transport-row button, .utility-button { min-height: 32px; border-radius: 4px; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .1em; transition: background .18s, border-color .18s, transform .18s; }
.transport-row button:active, .utility-button:active, .preset-button:active { transform: translateY(1px); }
.transport-primary { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(121,201,208,.44); background: linear-gradient(135deg, #2d707a, #1c515e); color: #e6f5f5; }
.transport-primary:hover { background: linear-gradient(135deg, #38818b, #246371); }
.transport-icon { font-size: 12px; }
.transport-secondary { border: 1px solid rgba(164,185,201,.16); background: rgba(9,15,22,.58); color: #a6b4bd; }
.transport-secondary:hover, .utility-button:hover { border-color: rgba(121,201,208,.42); color: #dbe9ed; background: rgba(31,56,67,.55); }
.transport-secondary span { color: var(--cyan); font-size: 12px; margin-left: 3px; }
.speed-row { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.speed-row output { color: var(--cyan); }
.speed-scale { margin-top: 0; }
.utility-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px; margin-top: 12px; }
.utility-button { min-height: 29px; padding: 0 4px; border: 1px solid rgba(164,185,201,.14); background: rgba(9,15,22,.52); color: #899ba7; font-size: 7px; white-space: nowrap; }
.validation-card { margin-top: 13px; padding: 10px 11px; border: 1px solid rgba(121,201,208,.18); border-radius: 4px; background: linear-gradient(120deg, rgba(28,59,65,.25), rgba(12,24,31,.55)); }
.validation-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: #b7c8cf; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.validation-icon { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; color: #0d2025; background: var(--cyan); font-size: 9px; }
.validation-kind { margin-left: auto; color: var(--cyan); font-size: 7px; }
.validation-line, .validation-diff { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; color: #7f909b; font-size: 8px; }
.validation-line strong { color: #c8d7dd; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-diff { padding-top: 7px; margin-top: 8px; border-top: 1px solid rgba(164,185,201,.1); color: #a1b2bc; }
.validation-diff strong { color: var(--cyan); font-size: 10px; }
.science-panel { margin-top: 11px; border: 1px solid var(--line); border-radius: 4px; background: rgba(9,15,22,.4); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; cursor: pointer; list-style: none; color: #c0cdd4; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { color: var(--cyan); font-size: 13px; margin-right: 8px; }
.summary-plus { color: var(--cyan); font-size: 14px; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 12px 12px; color: #92a2ad; font-size: 9px; line-height: 1.55; }
.science-intro { margin: 0 0 10px; color: #bac8cf; }
.equation-block { padding: 7px 8px; margin: 6px 0; border-left: 2px solid rgba(121,201,208,.45); background: rgba(34,57,66,.26); }
.equation-label { display: block; margin-bottom: 3px; color: #708995; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.equation-block code { display: block; color: #d4e5e8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.variable-list { padding: 7px 0; color: #82939f; }
.variable-list b { color: #d1e1e5; }
.science-note { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(164,185,201,.1); color: #81929e; }
.science-note b { display: block; margin-bottom: 3px; color: #a9bac3; font-size: 7px; letter-spacing: .12em; }
.science-disclaimer { margin: 10px 0 0; color: #6f818c; font-size: 8px; font-style: italic; }
.footerbar { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 30px; border-top: 1px solid var(--line); color: #5f707c; font-size: 7px; font-weight: 700; letter-spacing: .12em; }
.footerbar b { color: var(--cyan); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(360px, calc(100vw - 40px)); padding: 11px 14px; border: 1px solid rgba(121,201,208,.35); border-radius: 5px; background: rgba(12,23,30,.96); color: #d8e8ec; font-size: 10px; line-height: 1.45; box-shadow: 0 12px 40px rgba(0,0,0,.3); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
body.embed .topbar, body.embed .footerbar, body.embed .title-row, body.embed .interaction-hint { display: none; }
body.embed .workspace { padding: 0; grid-template-columns: minmax(0, 1fr) 330px; gap: 0; }
body.embed .scene-host { height: 100vh; }
body.embed .scene-frame { border-radius: 0; }
body.embed .control-panel { border-radius: 0; min-height: 100vh; }
body.embed .readout-section { padding: 15px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; padding: 20px 20px 22px; gap: 16px; }
  .control-panel { padding: 14px; }
  .scene-host { height: clamp(360px, 48vw, 500px); }
  .utility-button { font-size: 6px; }
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: minmax(0, 1fr); padding: 19px 18px 22px; }
  .scene-host { height: min(58vw, 520px); min-height: 350px; }
  .control-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
  .panel-heading, .preset-block, .control-list, .transport-block, .validation-card, .science-panel { grid-column: auto; }
  .panel-heading { grid-column: 1 / -1; }
  .preset-block { grid-column: 1 / -1; }
  .control-list { grid-column: 1; grid-row: span 2; }
  .transport-block { grid-column: 2; }
  .validation-card, .science-panel { grid-column: 2; }
  .footerbar { padding: 0 18px; }
}
@media (max-width: 560px) {
  .topbar { height: 58px; flex-basis: 58px; padding: 0 14px; }
  .topbar-right { gap: 6px; font-size: 7px; }
  .topbar-code, .topbar-divider { display: none; }
  .brand-name { font-size: 9px; }
  .brand-sub { font-size: 7px; }
  .workspace { padding: 17px 12px 20px; gap: 15px; }
  .title-row { align-items: flex-start; margin-bottom: 12px; }
  h1 { font-size: 25px; letter-spacing: .025em; }
  .subtitle { max-width: 300px; font-size: 10px; }
  .scene-tag { padding: 7px 8px; font-size: 6px; margin-top: 18px; }
  .scene-host { height: 440px; min-height: 390px; }
  .scene-topline { left: 10px; right: 10px; top: 11px; font-size: 6px; }
  .scene-topline span:last-child { text-align: right; }
  .scene-bottomline { padding: 30px 11px 12px; }
  .scene-compass { right: 11px; top: 42px; }
  .scene-label { font-size: 6px; padding: 3px 4px; }
  .scene-legend { gap: 10px; padding: 10px 9px; font-size: 6px; }
  .scene-legend i { width: 6px; height: 6px; }
  .interaction-hint { font-size: 6px; margin: 8px 0 18px; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .readout-card { min-height: 78px; padding: 10px; }
  .readout-card strong { font-size: 20px; }
  .section-heading h2 { font-size: 12px; }
  .control-panel { display: block; padding: 14px 13px; }
  .control-list { gap: 15px; }
  .preset-button { min-height: 48px; }
  .preset-button span:last-child { font-size: 7px; }
  .transport-row button { min-height: 37px; }
  .utility-button { min-height: 33px; font-size: 7px; }
  .validation-card { margin-top: 13px; }
  .footerbar { flex-wrap: wrap; justify-content: center; padding: 9px 12px; gap: 5px 12px; font-size: 6px; text-align: center; }
  .footerbar span:nth-child(2) { order: 3; width: 100%; }
  body.embed .workspace { display: flex; flex-direction: column; }
  body.embed .scene-host { height: 60vh; min-height: 360px; }
  body.embed .control-panel { min-height: auto; width: 100%; }
  body.embed .visual-column { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Compact desktop composition for the 1280 × 720 museum-kiosk target. */
@media (min-width: 861px) and (max-height: 780px) {
  .topbar { height: 54px; flex-basis: 54px; }
  .workspace { padding: 14px 22px 12px; gap: 16px; }
  .title-row { margin: 0 0 10px; }
  h1 { font-size: 29px; }
  .subtitle { font-size: 10px; }
  .scene-host { height: min(49vh, 400px); min-height: 340px; }
  .scene-legend { padding: 8px 12px; }
  .interaction-hint { margin: 6px 0 11px; }
  .readout-grid { gap: 6px; }
  .readout-card { min-height: 74px; padding: 9px 10px 8px; }
  .readout-card strong { margin: 6px 0 3px; font-size: 18px; }
  .readout-foot { font-size: 7px; }
  .control-panel { padding: 12px; }
  .panel-heading { padding-bottom: 9px; }
  .preset-block { padding: 9px 0 10px; }
  .preset-button { min-height: 37px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; padding: 10px 0; }
  .range-control { min-width: 0; }
  .range-control input[type="range"] { margin-top: 5px; }
  .transport-block { padding: 10px 0; }
  .transport-row { margin-top: 7px; }
  .transport-row button { min-height: 28px; }
  .speed-row { margin-top: 9px; }
  .utility-row { margin-top: 9px; }
  .utility-button { min-height: 26px; }
  .validation-card { margin-top: 9px; padding: 8px 9px; }
  .validation-head { margin-bottom: 6px; }
  .validation-line { margin-top: 3px; }
  .validation-diff { margin-top: 6px; padding-top: 5px; }
  .science-panel { margin-top: 8px; }
  .science-panel summary { padding: 9px 10px; }
  .footerbar { min-height: 28px; }
}
@media (max-width: 560px) {
  .control-list { display: flex; }
}
