:root {
  color-scheme: dark;
  --bg: #06131d;
  --panel: #0a1b27;
  --panel-2: #0d2230;
  --line: rgba(151, 202, 218, .13);
  --line-strong: rgba(151, 202, 218, .24);
  --text: #e8f4f7;
  --muted: #7e9aa8;
  --dim: #526d7a;
  --cyan: #61d8e8;
  --cyan-2: #20a9c7;
  --mint: #8de2d3;
  --gold: #e5c78a;
  --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; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; height: 100svh; min-height: 640px; display: flex; flex-direction: column; background: radial-gradient(ellipse at 70% 25%, rgba(20, 68, 82, .18), transparent 48%), var(--bg); }
.topbar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(5, 17, 26, .94); position: relative; z-index: 10; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 270px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(97,216,232,.55); border-radius: 9px; display: grid; place-items: center; color: var(--cyan); font-size: 15px; font-weight: 800; box-shadow: inset 0 0 18px rgba(32,169,199,.12); }
.brand-name { font-size: 11px; letter-spacing: .17em; font-weight: 800; color: #e8f4f7; }
.brand-name span { color: var(--cyan); }
.brand-subtitle { margin-top: 3px; font-size: 8px; letter-spacing: .19em; color: var(--dim); font-weight: 700; }
.topbar-center { display: flex; align-items: center; gap: 9px; color: #89a7b4; font-size: 9px; letter-spacing: .15em; font-weight: 700; }
.live-dot { display: inline-block; width: 6px; height: 6px; background: #65d8bd; border-radius: 50%; box-shadow: 0 0 10px rgba(101,216,189,.8); }
.topbar-right { display: flex; align-items: center; gap: 14px; min-width: 270px; justify-content: flex-end; }
.tech-pill { border: 1px solid rgba(97,216,232,.25); background: rgba(32,169,199,.08); border-radius: 20px; color: #79cbd7; padding: 6px 9px; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.version { color: var(--dim); font-size: 9px; letter-spacing: .12em; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 318px minmax(0,1fr); }
.sidebar { min-height: 0; overflow-y: auto; padding: 20px 18px 14px; background: linear-gradient(180deg, rgba(10,27,39,.98), rgba(7,22,32,.98)); border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #294653 transparent; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #294653; border-radius: 10px; }
.side-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--cyan); font-size: 8px; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 9px 0 3px; font-size: 31px; line-height: .99; letter-spacing: -.055em; font-weight: 720; }
h1 em { color: #77d4dc; font-style: normal; }
.lede { margin: 8px 0 12px; color: #90aab5; font-size: 11px; letter-spacing: .02em; }
.concept-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.concept-tags span { border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; color: #7895a1; font-size: 7px; letter-spacing: .11em; font-weight: 800; }
.control-section, .preset-section { padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-heading > span { color: var(--cyan); font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.section-heading h2 { margin: 0; color: #d7e8ed; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; }
.section-heading i { height: 1px; flex: 1; background: linear-gradient(90deg, var(--line-strong), transparent); }
.control-row { margin-bottom: 13px; }
.control-row:last-child { margin-bottom: 0; }
.control-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.control-label label { font-size: 10px; color: #d5e4e9; font-weight: 650; }
.control-label label small { display: block; margin-top: 2px; color: #688491; font-size: 8px; font-weight: 450; }
.control-label output { color: var(--cyan); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 750; }
input[type="range"] { width: 100%; height: 4px; appearance: none; background: linear-gradient(90deg, #227f92, #3bc3d1); border-radius: 8px; outline: none; display: block; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #d5f8f8; border: 3px solid #168ca3; box-shadow: 0 0 0 3px rgba(32,169,199,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d5f8f8; border: 3px solid #168ca3; box-shadow: 0 0 0 3px rgba(32,169,199,.12); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(97,216,232,.28); }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: #526d7a; font-size: 7px; }
.preset-section { padding-bottom: 16px; }
.preset-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.preset-btn { min-width: 0; min-height: 67px; padding: 8px 4px 7px; background: rgba(255,255,255,.018); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: border-color .18s, background .18s; }
.preset-btn:hover, .preset-btn:focus-visible { border-color: rgba(97,216,232,.55); outline: none; }
.preset-btn.active { background: rgba(32,169,199,.11); border-color: rgba(97,216,232,.55); box-shadow: inset 0 0 18px rgba(32,169,199,.06); }
.preset-icon { font-size: 18px; line-height: 19px; color: #7ca9b5; }
.develop-icon { color: var(--cyan); }
.strong-icon { color: #f1c78a; }
.preset-btn b { font-size: 8px; font-weight: 750; }
.preset-btn small { color: #6d8793; font-size: 7px; }
.compact-section { padding-bottom: 16px; }
.playback-row { display: grid; grid-template-columns: 1fr 38px 38px; gap: 6px; margin-bottom: 13px; }
.primary-btn, .icon-btn, .utility-btn { border-radius: 7px; border: 1px solid var(--line-strong); cursor: pointer; min-height: 34px; }
.primary-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, #147d91, #126174); border-color: rgba(97,216,232,.4); color: #efffff; font-size: 10px; font-weight: 750; }
.primary-btn:hover { filter: brightness(1.12); }
.play-symbol { font-size: 11px; }
.icon-btn { background: rgba(255,255,255,.025); color: #a7c4ce; font-size: 14px; }
.icon-btn:hover, .utility-btn:hover { border-color: rgba(97,216,232,.5); color: var(--cyan); }
.speed-label { margin: 0 0 8px; }
.utility-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 13px; }
.utility-btn { background: rgba(255,255,255,.025); color: #91acb8; font-size: 8px; font-weight: 650; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: #7f9aa6; font-size: 8px; }
.segmented { display: flex; padding: 2px; border: 1px solid var(--line); background: rgba(0,0,0,.16); border-radius: 6px; }
.segmented button { padding: 4px 9px; background: transparent; border: 0; border-radius: 4px; color: #6e8994; font-size: 8px; cursor: pointer; }
.segmented button.selected { background: #164454; color: #b9edf0; }
.science-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.018); }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 10px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: rgba(97,216,232,.1); color: var(--cyan); font-size: 15px; }
.science-panel summary b { display: block; color: #d9e8ec; font-size: 9px; }
.science-panel summary small { display: block; color: #698592; font-size: 7px; margin-top: 2px; }
.chevron { margin-left: auto; color: #7896a1; transition: transform .2s; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 12px; color: #9bb1ba; font-size: 8px; line-height: 1.55; }
.science-content h3 { margin: 11px 0 3px; color: #8edce2; font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.science-content p { margin: 3px 0 7px; }
.equation { padding: 7px 8px; border-left: 2px solid #2ca8ba; border-radius: 0 5px 5px 0; background: rgba(32,169,199,.07); color: #d4edf0; font-family: Georgia, serif; font-size: 10px; line-height: 1.8; }
.assumption-list { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); }
.assumption-list b { color: #e0c994; font-size: 8px; }
.assumption-list ul { margin: 5px 0 0; padding-left: 14px; }
.assumption-list li { margin: 3px 0; }
.sidebar-foot { margin-top: 12px; padding: 0 2px 3px; color: #526d78; font-size: 7px; line-height: 1.45; }
.stage { min-width: 0; min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 58% 30%, #0b2d3b, #06141f 68%); }
.stage-topline { position: absolute; z-index: 4; left: 20px; right: 20px; top: 15px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.scene-title { display: flex; flex-direction: column; gap: 5px; text-shadow: 0 2px 10px rgba(0,0,0,.55); }
.scene-kicker { color: #68c7d3; font-size: 8px; letter-spacing: .18em; font-weight: 800; }
.scene-title b { color: #e4f2f5; font-size: 12px; font-weight: 650; letter-spacing: .015em; }
.stage-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.state-chip, .scale-chip { padding: 6px 8px; border-radius: 20px; background: rgba(4,17,26,.65); border: 1px solid rgba(144,198,212,.18); color: #8caeb9; font-size: 7px; font-weight: 800; letter-spacing: .1em; backdrop-filter: blur(10px); }
.state-chip { display: flex; align-items: center; gap: 6px; }
.state-chip i { width: 5px; height: 5px; background: #61d8b6; border-radius: 50%; }
.state-chip.paused i { background: #e3bd79; box-shadow: 0 0 7px rgba(227,189,121,.7); }
.scale-chip { color: #688994; }
.scene-mount { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.scene-mount canvas { width: 100%; height: 100%; display: block; outline: none; }
.loading-state { position: absolute; z-index: 6; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; background: radial-gradient(ellipse, rgba(10,41,53,.94), rgba(5,18,27,.98)); color: #d8eff2; transition: opacity .35s; }
.loading-state.hidden { opacity: 0; pointer-events: none; }
.loading-state b { font-size: 11px; letter-spacing: .04em; }
.loading-state span { color: #6f98a5; font-size: 8px; }
.loader-ring { width: 29px; height: 29px; border: 2px solid rgba(97,216,232,.16); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.context-message { position: absolute; z-index: 7; inset: 0; background: rgba(4,15,23,.88); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; color: #dceef1; font-size: 11px; }
.context-message[hidden] { display: none; }
.context-message span { color: #8ba9b4; font-size: 9px; }
.context-message button { background: #13596a; border: 1px solid #3aa6b6; border-radius: 6px; padding: 7px 12px; margin-top: 5px; cursor: pointer; font-size: 9px; }
.scene-annotation { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 3px; pointer-events: none; text-shadow: 0 1px 7px rgba(0,0,0,.9); }
.scene-annotation b { color: #b8e2e6; font-size: 8px; letter-spacing: .12em; }
.scene-annotation small { color: #7299a6; font-size: 7px; }
.annotation-wind { left: 8%; top: 28%; }
.annotation-line { width: 34px; height: 1px; margin-bottom: 3px; background: #e0c88f; box-shadow: 0 0 6px rgba(224,200,143,.5); }
.annotation-streak { right: 8%; top: 43%; align-items: flex-end; text-align: right; }
.annotation-dot { width: 6px; height: 6px; border-radius: 50%; background: #f1e6c5; box-shadow: 0 0 10px #f1e6c5; margin-bottom: 2px; }
.annotation-roll { left: 8%; bottom: 24%; }
.cyan-dot { background: #51d5e7; box-shadow: 0 0 10px #51d5e7; }
.scene-legend { position: absolute; z-index: 2; left: 20px; bottom: 14px; display: flex; gap: 13px; pointer-events: none; color: #8aa7b1; font-size: 7px; text-shadow: 0 1px 5px #000; }
.scene-legend span { display: flex; align-items: center; gap: 5px; }
.scene-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.legend-white { background: #d9eff0; box-shadow: 0 0 5px #d9eff0; }
.legend-cyan { background: #28bad2; box-shadow: 0 0 5px #28bad2; }
.scene-legend .legend-line { width: 13px; height: 2px; border-radius: 0; background: #50b8d2; }
.view-hint { position: absolute; z-index: 2; right: 20px; bottom: 14px; color: #587a87; font-size: 7px; letter-spacing: .1em; pointer-events: none; }
.view-hint span { color: var(--cyan); padding: 0 4px; }
.data-dock { flex: 0 0 auto; border-top: 1px solid rgba(132,191,208,.17); background: linear-gradient(90deg, rgba(7,24,34,.96), rgba(8,30,41,.97)); padding: 10px 18px 11px; }
.dock-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.dock-heading b { color: #b4cdd5; font-size: 8px; letter-spacing: .12em; }
.dock-heading small { margin-left: 4px; color: #557481; font-size: 7px; letter-spacing: .08em; }
.readout-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; }
.readout { min-width: 0; padding: 0 13px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.readout:first-child { padding-left: 0; border-left: 0; }
.readout > span { color: #7896a1; font-size: 7px; letter-spacing: .12em; font-weight: 750; white-space: nowrap; }
.readout > b { color: #e5f4f6; font-size: 18px; line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; }
.readout > b small { color: #82a6b2; font-size: 9px; font-weight: 500; }
.readout > i { color: #4e8f9b; font-size: 6px; font-style: normal; letter-spacing: .1em; }
.validation-strip { flex: 0 0 auto; min-height: 49px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 18px; border-top: 1px solid var(--line); background: rgba(5,18,27,.98); }
.validation-title { display: flex; align-items: center; gap: 8px; min-width: 230px; }
.validation-title > span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(101,216,189,.35); background: rgba(101,216,189,.08); color: #7cddc4; font-size: 11px; }
.validation-title b { display: block; color: #a8c3cc; font-size: 7px; letter-spacing: .12em; }
.validation-title small { display: block; margin-top: 3px; color: #607d88; font-size: 7px; }
.validation-values { display: flex; align-items: center; gap: 19px; }
.validation-values span { display: flex; flex-direction: column; gap: 3px; color: #617e89; font-size: 6px; letter-spacing: .12em; }
.validation-values b { color: #c9e1e5; font-size: 9px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.validation-values span:last-child b { color: #80d8c4; }
.stage-footer { flex: 0 0 25px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: #06131c; border-top: 1px solid rgba(132,191,208,.08); color: #536f7b; font-size: 6px; letter-spacing: .1em; }
.stage-footer b { color: #89aab5; margin-left: 4px; font-weight: 700; }
.mobile-controls-btn { display: none; pointer-events: auto; background: rgba(7,28,39,.8); border: 1px solid var(--line-strong); border-radius: 6px; color: #a9d6dd; padding: 6px 8px; font-size: 8px; }
body.embed .topbar { display: none; }
body.embed .workspace { grid-template-columns: 280px minmax(0,1fr); }
body.embed .sidebar { padding-top: 13px; }
body.embed .stage-topline { top: 10px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (max-width: 980px) and (min-width: 701px) {
  .workspace { grid-template-columns: 280px minmax(0,1fr); }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .readout { padding: 0 8px; }
  .readout > b { font-size: 16px; }
  .annotation-streak { right: 4%; }
}
@media (max-width: 700px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100svh; display: flex; }
  .topbar { height: 52px; flex-basis: 52px; padding: 0 12px; }
  .brand-lockup { min-width: 0; gap: 8px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-name { font-size: 9px; }
  .brand-subtitle { font-size: 6px; }
  .topbar-center, .topbar-right { display: none; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .stage { order: 0; height: 68svh; min-height: 500px; flex: 0 0 auto; }
  .stage-topline { left: 12px; right: 12px; top: 10px; align-items: center; }
  .scene-title { max-width: 62%; }
  .scene-title b { font-size: 10px; }
  .scene-kicker { font-size: 7px; }
  .stage-actions { gap: 5px; }
  .state-chip, .scale-chip { padding: 5px 6px; font-size: 6px; }
  .scale-chip { display: none; }
  .mobile-controls-btn { display: block; position: absolute; top: 49px; right: 12px; z-index: 5; }
  .scene-annotation b { font-size: 6px; }
  .scene-annotation small { font-size: 6px; }
  .annotation-wind { left: 5%; top: 24%; }
  .annotation-streak { right: 4%; top: 40%; }
  .annotation-roll { left: 5%; bottom: 27%; }
  .scene-legend { left: 12px; bottom: 10px; gap: 8px; font-size: 6px; }
  .view-hint { right: 12px; bottom: 10px; font-size: 6px; }
  .data-dock { padding: 8px 11px 9px; }
  .dock-heading { margin-bottom: 7px; }
  .dock-heading b { font-size: 7px; }
  .dock-heading small { display: none; }
  .readout-grid { grid-template-columns: repeat(2,1fr); row-gap: 8px; }
  .readout { padding: 0 8px; min-height: 38px; }
  .readout:nth-child(odd) { border-left: 0; padding-left: 0; }
  .readout > span { font-size: 6px; }
  .readout > b { font-size: 15px; }
  .readout > b small { font-size: 8px; }
  .validation-strip { align-items: flex-start; flex-direction: column; gap: 7px; padding: 8px 11px; }
  .validation-title { min-width: 0; }
  .validation-values { width: 100%; justify-content: space-between; gap: 6px; padding-left: 27px; }
  .validation-values span { font-size: 5px; }
  .validation-values b { font-size: 8px; }
  .stage-footer { padding: 0 10px; font-size: 5px; }
  .sidebar { order: 1; overflow: visible; border-right: 0; border-top: 1px solid var(--line); padding: 17px 14px 20px; }
  .sidebar.mobile-collapsed { display: none; }
  h1 { font-size: 27px; }
  .control-section, .preset-section { padding-top: 14px; }
  .control-row { margin-bottom: 16px; }
  .sidebar-foot { font-size: 7px; }
  body.embed .workspace { display: flex; }
  body.embed .stage { height: 100svh; min-height: 500px; }
  body.embed .sidebar { position: absolute; z-index: 10; top: 8px; left: 8px; bottom: 8px; width: min(320px, calc(100vw - 16px)); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
  body.embed .sidebar.mobile-collapsed { display: none; }
  body.embed .mobile-controls-btn { display: block; }
}
@media (max-width: 390px) {
  .stage { height: 64svh; min-height: 470px; }
  .scene-title b { font-size: 9px; }
  .annotation-streak { top: 43%; }
  .scene-legend { gap: 6px; }
  .scene-legend span { gap: 3px; }
  .view-hint { font-size: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .loader-ring { animation: none; border-right-color: var(--cyan); }
}
