:root {
  color-scheme: dark;
  --bg: #080d13;
  --panel: #101821;
  --panel-2: #131e29;
  --line: rgba(168,190,210,.13);
  --line-strong: rgba(168,190,210,.22);
  --text: #e8eef4;
  --muted: #8292a1;
  --dim: #536474;
  --accent: #f18a4d;
  --accent-2: #ffbd75;
  --cyan: #71c6d2;
  --green: #8ed1a5;
  --font: 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); font-family: var(--font); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; min-height: 100vh; padding: 0 24px 12px; background: radial-gradient(ellipse at 43% 0%, rgba(35,61,78,.22), transparent 47%), var(--bg); }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 18px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; border: 1px solid rgba(241,138,77,.65); border-radius: 9px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 6px; transform: rotate(45deg); }
.brand-mark span { display: block; width: 3px; border-radius: 3px; background: var(--accent); transform: rotate(-45deg); }
.brand-mark span:nth-child(1) { height: 7px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 9px; opacity: .75; }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; }
.brand-name span { color: #8394a4; font-weight: 500; letter-spacing: .1em; }
.brand-sub { margin-top: 4px; font-size: 8px; letter-spacing: .18em; color: var(--dim); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.live-indicator { display: flex; align-items: center; gap: 8px; color: #a9b8c5; font-size: 9px; letter-spacing: .14em; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #7ccda1; box-shadow: 0 0 12px rgba(124,205,161,.75); }
.live-indicator.paused i { background: #e2a36b; box-shadow: 0 0 10px rgba(226,163,107,.45); }
.seed-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--dim); font-size: 9px; letter-spacing: .13em; }
.seed-chip b { color: #aebdca; margin-left: 5px; font-weight: 650; }
.workspace { max-width: 1720px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; padding-top: 18px; align-items: start; }
.visual-column { min-width: 0; }
.stage { height: min(62vh, 560px); min-height: 410px; position: relative; overflow: hidden; border: 1px solid rgba(150,175,194,.15); border-radius: 9px; background: radial-gradient(ellipse at 55% 38%, #1a2935 0%, #0c141d 53%, #080e15 100%); isolation: isolate; }
#sceneCanvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.stage:after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(5,9,14,.36), transparent 28%, transparent 72%, rgba(5,9,14,.56)); z-index: 1; }
.stage-topline, .stage-title, .stage-bottomline, .annotation-layer, .context-loss, .loading-note { position: absolute; z-index: 2; pointer-events: none; }
.stage-topline { left: 18px; right: 18px; top: 16px; display: flex; justify-content: space-between; gap: 10px; }
.scene-chip { border: 1px solid rgba(193,211,224,.16); border-radius: 4px; padding: 7px 9px; background: rgba(8,14,20,.52); backdrop-filter: blur(8px); color: #c4d1db; font-size: 8px; letter-spacing: .15em; }
.chip-dot { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.muted-chip { color: #8193a2; }
.chip-sep { padding: 0 5px; color: #465767; }
.stage-title { top: 74px; left: 22px; max-width: 320px; }
.eyebrow { color: #8c9dac; font-size: 8px; letter-spacing: .2em; font-weight: 700; }
.stage-title h1 { margin: 8px 0 5px; font-size: clamp(24px, 3vw, 38px); letter-spacing: -.055em; line-height: 1.02; font-weight: 620; text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.stage-title h1 em { color: #ffb16d; font-style: normal; }
.stage-title p { margin: 0; color: #a1b0bc; font-size: 10px; line-height: 1.5; letter-spacing: .01em; }
.stage-bottomline { left: 18px; right: 18px; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: #aab8c3; font-size: 8px; letter-spacing: .11em; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-magma { background: #f05d30; box-shadow: 0 0 7px #f05d30; }
.legend-gas { background: #ffc17b; box-shadow: 0 0 7px #ffc17b; }
.legend-wave { background: #7acbd8; box-shadow: 0 0 7px #7acbd8; }
.timecode { color: #7f91a0; font-size: 8px; letter-spacing: .14em; white-space: nowrap; }
.timecode b { color: #d8e0e7; margin-left: 5px; font-variant-numeric: tabular-nums; }
.annotation-layer { inset: 0; }
.annotation { position: absolute; display: flex; align-items: center; gap: 6px; color: #d8e2e9; font-size: 8px; font-weight: 750; letter-spacing: .14em; white-space: nowrap; text-shadow: 0 1px 5px #071018; opacity: 0; transition: opacity .2s ease; }
.annotation.visible { opacity: .92; }
.annotation-line { width: 22px; height: 1px; background: rgba(255,190,132,.78); box-shadow: 0 0 6px rgba(255,160,90,.55); }
#labelGas .annotation-line { background: rgba(255,210,142,.8); }
#labelMagma .annotation-line { background: rgba(238,93,54,.9); }
#labelWave .annotation-line { background: rgba(113,198,210,.9); }
.context-loss { inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; background: rgba(6,10,15,.91); color: #e9eef2; text-align: center; }
.context-loss[hidden] { display: none; }
.context-loss strong { font-size: 16px; }
.context-loss span { max-width: 280px; color: #9aabb8; font-size: 11px; line-height: 1.5; }
.loading-note { left: 50%; top: 50%; transform: translate(-50%,-50%); color: #91a2b1; font-size: 9px; letter-spacing: .2em; transition: opacity .4s ease; }
.loading-note.hidden { opacity: 0; }
.readout-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-top: 9px; }
.readout-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(145deg, rgba(20,31,42,.92), rgba(13,21,29,.95)); padding: 11px 12px 10px; }
.readout-label { color: #8798a7; font-size: 7px; letter-spacing: .13em; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-text { margin-left: 4px; color: #526777; font-size: 6px; letter-spacing: .08em; }
.readout-value { margin-top: 6px; color: #f0f4f7; font-size: 23px; line-height: 1; font-weight: 570; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { margin-left: 5px; color: #9aabb8; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.readout-foot { margin-top: 6px; color: #627483; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.control-panel { min-width: 0; max-height: calc(100vh - 96px); overflow: auto; scrollbar-width: thin; scrollbar-color: #344554 transparent; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(160deg, rgba(18,28,38,.98), rgba(12,19,27,.98)); padding: 16px 16px 13px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.04em; font-weight: 600; }
.panel-index { color: #d2dbe2; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.panel-index span { color: #5f7180; font-weight: 500; }
.section-label { display: flex; align-items: center; justify-content: space-between; color: #91a1ae; font-size: 8px; letter-spacing: .16em; font-weight: 750; }
.section-label span { color: #566c7d; font-size: 7px; letter-spacing: .14em; }
.preset-section { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 9px; }
.preset-btn { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 8px 6px; text-align: left; border: 1px solid rgba(158,180,198,.13); border-radius: 5px; background: rgba(255,255,255,.018); cursor: pointer; transition: border-color .2s,background .2s,transform .2s; }
.preset-btn:hover { border-color: rgba(241,138,77,.5); background: rgba(241,138,77,.06); }
.preset-btn.active { border-color: rgba(241,138,77,.55); background: rgba(241,138,77,.085); box-shadow: inset 0 0 0 1px rgba(241,138,77,.06); }
.preset-icon { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: rgba(255,255,255,.05); color: #f1a26d; font-size: 17px; }
.drum-icon { color: #ffd095; }
.sharp-icon { color: #ff8458; }
.preset-btn b { display: block; color: #dce5eb; font-size: 8px; line-height: 1.2; white-space: nowrap; }
.preset-btn small { display: block; margin-top: 3px; color: #738594; font-size: 7px; line-height: 1.2; white-space: nowrap; }
.parameter-section { padding: 13px 0 5px; }
.slider-row { margin-top: 12px; }
.slider-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.slider-head label { color: #c5d0d9; font-size: 10px; font-weight: 540; }
.slider-head output { color: #f2b17b; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type=range] { width: 100%; height: 13px; margin: 0; background: transparent; appearance: none; cursor: pointer; accent-color: var(--accent); }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(241,138,77,.85), rgba(95,119,137,.42)); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(241,138,77,.85), rgba(95,119,137,.42)); }
input[type=range]::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; appearance: none; border: 2px solid #ffcb9a; border-radius: 50%; background: #b95c32; box-shadow: 0 0 0 3px rgba(241,138,77,.12),0 0 10px rgba(241,138,77,.3); }
input[type=range]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #ffcb9a; border-radius: 50%; background: #b95c32; box-shadow: 0 0 0 3px rgba(241,138,77,.12); }
input[type=range]:focus-visible { outline: 1px solid var(--cyan); outline-offset: 4px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; margin-top: 2px; color: #566979; font-size: 7px; }
.compact-slider { margin-top: 10px; }
.speed-slider { padding-top: 10px; border-top: 1px solid var(--line); }
.transport-section { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.transport-main { display: grid; grid-template-columns: 1fr 38px 38px 38px; gap: 6px; }
.play-btn,.icon-btn,.text-btn { border: 1px solid var(--line-strong); border-radius: 5px; background: rgba(255,255,255,.025); cursor: pointer; transition: background .2s,border-color .2s,transform .2s; }
.play-btn:hover,.icon-btn:hover,.text-btn:hover { border-color: rgba(241,138,77,.55); background: rgba(241,138,77,.08); }
.play-btn { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 34px; border-color: rgba(241,138,77,.55); background: linear-gradient(110deg,rgba(180,83,44,.28),rgba(241,138,77,.1)); color: #ffd0a7; }
.play-btn span { font-size: 12px; }
.play-btn b { font-size: 8px; letter-spacing: .15em; }
.icon-btn { min-height: 34px; color: #a9b9c5; font-size: 16px; }
.transport-sub { display: flex; justify-content: space-between; margin-top: 8px; }
.text-btn { padding: 6px 8px; color: #8193a2; font-size: 7px; letter-spacing: .12em; }
.text-btn.active { color: #d9e5ed; border-color: rgba(113,198,210,.32); }
.validation-panel { margin-top: 12px; padding: 10px 10px 9px; border: 1px solid rgba(113,198,210,.18); border-radius: 5px; background: rgba(45,96,109,.08); }
.validation-heading { display: flex; align-items: center; gap: 8px; }
.validation-check { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #9ee0d2; border: 1px solid rgba(113,198,210,.35); font-size: 11px; }
.validation-heading small { display: block; margin-top: 3px; color: #6f8795; font-size: 7px; }
.validation-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-top: 11px; }
.validation-values div { display: flex; flex-direction: column; gap: 4px; }
.validation-values span { color: #6e8793; font-size: 6px; letter-spacing: .12em; }
.validation-values b { color: #c8e1df; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.validation-note { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(113,198,210,.12); color: #6f8993; font-size: 7px; }
.science-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.015); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 10px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; }
.details-plus { color: #8fa2b1; font-size: 17px; transition: transform .2s; }
.science-panel[open] .details-plus { transform: rotate(45deg); }
.science-content { padding: 0 10px 11px; }
.science-intro { margin: 0 0 10px; color: #9aabb8; font-size: 9px; line-height: 1.55; }
.equation-block { padding: 9px 0; border-top: 1px solid var(--line); }
.equation-label { display: block; color: #6f8392; font-size: 7px; letter-spacing: .13em; }
.equation-block code { display: block; margin-top: 6px; color: #f2c397; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 12px; }
.equation-block small { display: block; margin-top: 4px; color: #8294a2; font-size: 8px; }
.variable-list { padding: 8px 0; border-top: 1px solid var(--line); }
.variable-list div { display: flex; gap: 9px; padding: 3px 0; font-size: 8px; }
.variable-list b { width: 13px; color: #f0b47e; font-family: ui-monospace,monospace; }
.variable-list span { color: #8a9ba8; }
.science-caveat { padding: 9px; border-radius: 4px; background: rgba(241,138,77,.055); }
.science-caveat b { color: #dba47b; font-size: 7px; letter-spacing: .14em; }
.science-caveat p { margin: 5px 0 0; color: #9cabb5; font-size: 8px; line-height: 1.55; }
.model-key { margin-top: 9px; color: #8293a0; font-size: 7px; line-height: 1.6; }
.model-tag { display: inline-block; margin-right: 3px; padding: 2px 4px; border: 1px solid rgba(113,198,210,.22); border-radius: 3px; color: #9ed5d4; font-size: 6px; letter-spacing: .08em; }
.model-tag.illustrative { margin-left: 6px; border-color: rgba(241,138,77,.22); color: #e3aa7b; }
.footer-note { max-width: 1720px; margin: 12px auto 0; display: flex; justify-content: space-between; gap: 12px; color: #586b7a; font-size: 7px; letter-spacing: .08em; }
.footer-note b { color: #8193a0; font-weight: 650; }
.footer-note i { padding: 0 5px; color: #3e5362; font-style: normal; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
body.embed-mode .topbar, body.embed-mode .footer-note { display: none; }
body.embed-mode .app-shell { padding: 0; }
body.embed-mode .workspace { padding-top: 0; grid-template-columns: minmax(0,1fr) 330px; }
body.embed-mode .stage { border-radius: 0; }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0,1fr) 320px; gap: 12px; }
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .readout-card { padding: 10px 9px; }
  .readout-value { font-size: 20px; }
  .control-panel { padding: 13px; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .control-panel { max-height: none; overflow: visible; }
  .stage { height: min(60vh,520px); min-height: 380px; }
  .readout-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  body.embed-mode .workspace { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 520px) {
  .app-shell { padding: 0 9px 10px; }
  .topbar { height: 58px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-name { font-size: 9px; }
  .brand-name span { display: none; }
  .brand-sub { font-size: 7px; }
  .topbar-right { gap: 8px; }
  .live-indicator { font-size: 7px; }
  .seed-chip { padding: 6px; font-size: 7px; }
  .workspace { padding-top: 9px; gap: 10px; }
  .stage { height: 420px; min-height: 390px; border-radius: 7px; }
  .stage-topline { left: 10px; right: 10px; top: 10px; }
  .scene-chip { padding: 6px 7px; font-size: 7px; }
  .stage-title { top: 57px; left: 13px; max-width: 230px; }
  .stage-title h1 { font-size: 28px; }
  .stage-title p { max-width: 190px; font-size: 9px; }
  .stage-bottomline { left: 10px; right: 10px; bottom: 10px; align-items: flex-end; }
  .legend { gap: 7px; font-size: 6px; }
  .legend span { gap: 4px; }
  .timecode { font-size: 7px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-top: 7px; }
  .readout-card { padding: 10px; }
  .readout-value { font-size: 23px; }
  .control-panel { padding: 14px 13px; }
  .preset-btn { padding: 8px 7px; }
  .preset-btn b { font-size: 9px; }
  .preset-btn small { font-size: 7px; }
  .slider-head label { font-size: 11px; }
  .slider-head output { font-size: 10px; }
  .footer-note { flex-direction: column; gap: 5px; font-size: 7px; line-height: 1.5; }
  body.embed-mode .stage { height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
