:root {
  color-scheme: dark;
  --bg: #06111b;
  --panel: rgba(10, 25, 38, 0.94);
  --panel-2: #0b1c2a;
  --line: rgba(133, 190, 218, 0.14);
  --line-strong: rgba(133, 190, 218, 0.25);
  --text: #e7f5fb;
  --muted: #8ca8b8;
  --subtle: #597485;
  --cyan: #55d8f4;
  --ice: #a6eaff;
  --green: #7be6c2;
  --amber: #edc98b;
  --radius: 14px;
  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 { background: radial-gradient(ellipse at 54% 2%, rgba(26, 75, 103, .22), transparent 38%), linear-gradient(180deg, #071521, #050d16 78%); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { width: min(100%, 1920px); margin: 0 auto; padding: 0 22px 14px; }
.topbar { height: 78px; 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: 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(123, 221, 249, .3); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(145deg, rgba(78, 200, 238, .17), rgba(16, 45, 65, .35)); transform: rotate(-8deg); }
.brand-mark span { width: 3px; border-radius: 3px; background: #9ceaff; box-shadow: 0 0 10px rgba(89, 216, 247, .55); }
.brand-mark span:nth-child(1) { height: 10px; transform: translateY(3px); }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 12px; transform: translateY(-2px); }
.eyebrow, .section-kicker { color: #79a6bc; letter-spacing: .16em; font-size: 9px; font-weight: 750; line-height: 1.5; }
.eyebrow span { color: #416b81; padding: 0 4px; }
h1 { font-size: clamp(17px, 1.45vw, 22px); letter-spacing: -.035em; margin: 2px 0 0; line-height: 1.15; font-weight: 650; }
h1 span { color: #7da9bd; font-weight: 400; }
.topbar-meta { display: flex; align-items: center; gap: 9px; color: #9ab5c4; font-size: 9px; font-weight: 750; letter-spacing: .13em; white-space: nowrap; }
.live-dot, .tag-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(123, 230, 194, .75); }
.meta-divider { width: 1px; height: 16px; background: var(--line-strong); margin: 0 5px; }
.seed-label { color: #6d8b9c; }
.workspace { display: grid; grid-template-columns: minmax(248px, 286px) minmax(420px, 1fr) minmax(236px, 264px); gap: 14px; padding-top: 14px; min-height: calc(100vh - 126px); align-items: stretch; }
.panel { background: linear-gradient(160deg, rgba(13, 31, 46, .97), rgba(7, 20, 32, .97)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 45px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255,255,255,.018); }
.control-panel, .data-panel { padding: 17px 16px 14px; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #284456 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.panel-heading h2, .science-panel h2 { margin: 3px 0 0; font-size: 16px; letter-spacing: -.025em; font-weight: 620; }
.panel-index { color: #527286; font-size: 9px; font-weight: 700; letter-spacing: .12em; padding-top: 5px; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; background: rgba(2, 11, 19, .54); border: 1px solid rgba(125, 181, 208, .12); border-radius: 9px; margin-bottom: 18px; }
.preset { border: 1px solid transparent; border-radius: 6px; background: transparent; color: #829eaf; font-size: 9px; font-weight: 700; padding: 8px 3px; cursor: pointer; transition: .18s ease; white-space: nowrap; }
.preset:hover { color: #d9f5ff; background: rgba(79, 180, 215, .08); }
.preset.active { color: #c9f5ff; background: rgba(53, 155, 190, .17); border-color: rgba(85, 216, 244, .2); }
.control-list { display: flex; flex-direction: column; gap: 17px; }
.control-group { display: flex; flex-direction: column; gap: 8px; }
.control-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.control-top label { font-size: 11px; font-weight: 600; color: #d6e8f0; }
.control-top output { color: #80dff5; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; width: 100%; height: 4px; background: linear-gradient(90deg, #3eabc8, #20465b); border-radius: 9px; outline: none; cursor: pointer; margin: 2px 0; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #c8f4ff; border: 2px solid #4bc8e7; box-shadow: 0 0 0 3px rgba(74, 201, 230, .13), 0 0 12px rgba(74, 201, 230, .25); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #c8f4ff; border: 2px solid #4bc8e7; box-shadow: 0 0 0 3px rgba(74, 201, 230, .13); }
.range-hints { display: flex; justify-content: space-between; color: #5e7a8b; font-size: 8px; letter-spacing: .015em; }
.cause-card { display: flex; gap: 10px; margin-top: 19px; padding: 11px 10px; border: 1px solid rgba(91, 200, 229, .17); background: linear-gradient(135deg, rgba(25, 85, 111, .18), rgba(9, 30, 44, .22)); border-radius: 10px; }
.cause-icon { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #9ceaff; background: rgba(67, 189, 223, .13); font-size: 15px; }
.cause-card strong { display: block; font-size: 9px; color: #b7eafa; letter-spacing: .06em; text-transform: uppercase; }
.cause-card p { margin: 5px 0 0; color: #7f9bab; font-size: 9px; line-height: 1.55; }
.stage-column { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.scene-frame { flex: 1; min-height: 430px; position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid rgba(119, 191, 220, .18); background: radial-gradient(ellipse at 50% 42%, #12364a, #071927 68%, #06111a); box-shadow: 0 20px 55px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.015); }
.scene-host { position: absolute; inset: 0; }
.scene-host canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-topline { position: absolute; z-index: 3; top: 13px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-tag { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid rgba(129, 195, 220, .16); border-radius: 6px; background: rgba(4, 19, 30, .62); color: #a7cad9; font-size: 8px; font-weight: 750; letter-spacing: .14em; backdrop-filter: blur(10px); }
.tag-dot { width: 5px; height: 5px; background: #65d8f5; box-shadow: 0 0 8px #65d8f5; }
.scene-tools { display: flex; align-items: center; gap: 9px; pointer-events: auto; }
.drag-hint { color: #7393a5; font-size: 8px; letter-spacing: .1em; font-weight: 700; }
.mouse-glyph { color: #a7dff0; font-size: 14px; padding-right: 5px; }
.icon-button { width: 30px; height: 30px; border: 1px solid rgba(129, 195, 220, .2); border-radius: 8px; background: rgba(4, 19, 30, .68); color: #a8d6e7; font-size: 18px; cursor: pointer; display: grid; place-items: center; transition: .18s ease; }
.icon-button:hover { background: rgba(50, 145, 178, .22); color: #fff; }
.scene-annotation { position: absolute; z-index: 2; display: flex; align-items: center; gap: 7px; color: rgba(186, 226, 239, .78); font-size: 8px; letter-spacing: .12em; font-weight: 750; pointer-events: none; text-shadow: 0 1px 4px #06121c; }
.annotation-line { display: block; height: 1px; width: 30px; background: linear-gradient(90deg, rgba(94, 214, 241, .15), rgba(132, 227, 248, .8)); }
.annotation-ice { top: 20%; left: 5%; }
.annotation-channel { top: 47%; right: 4%; flex-direction: row-reverse; }
.annotation-tip { bottom: 21%; left: 7%; }
.scene-scale { position: absolute; z-index: 2; bottom: 15px; left: 16px; display: flex; align-items: center; gap: 7px; color: #83a9b9; font-size: 8px; font-variant-numeric: tabular-nums; }
.scene-scale i { display: block; height: 1px; width: 23px; background: rgba(115, 202, 228, .48); }
.context-readout { position: absolute; z-index: 2; right: 14px; bottom: 13px; display: flex; flex-direction: column; gap: 4px; text-align: right; }
.context-label { color: #5f8799; font-size: 7px; letter-spacing: .16em; font-weight: 800; }
.context-readout strong { color: #8ae4f5; font-size: 8px; letter-spacing: .08em; font-weight: 700; }
.webgl-warning, .context-loss { position: absolute; z-index: 6; inset: 50% auto auto 50%; transform: translate(-50%,-50%); width: min(82%, 360px); padding: 18px; border: 1px solid rgba(115, 211, 237, .3); border-radius: 12px; background: rgba(5, 21, 33, .94); box-shadow: 0 12px 50px rgba(0,0,0,.4); text-align: center; }
.webgl-warning[hidden], .context-loss[hidden] { display: none; }
.webgl-warning strong { display: block; color: #d9f7ff; font-size: 13px; margin-bottom: 7px; }
.webgl-warning span { color: #8da9b8; font-size: 11px; line-height: 1.5; }
.context-loss { color: #c2e7f2; font-size: 11px; line-height: 1.5; }
.transport { min-height: 78px; padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transport-main { display: flex; align-items: center; gap: 7px; min-width: 0; }
.play-button { display: flex; align-items: center; gap: 7px; border: 1px solid rgba(91, 212, 239, .32); border-radius: 8px; padding: 9px 11px; background: linear-gradient(135deg, rgba(48, 157, 190, .28), rgba(20, 83, 110, .24)); color: #bdf3ff; font-size: 9px; font-weight: 800; letter-spacing: .08em; cursor: pointer; white-space: nowrap; }
.play-icon { font-size: 11px; }
.transport-button { border: 1px solid rgba(126, 177, 201, .14); border-radius: 7px; background: rgba(9, 26, 39, .7); color: #9cb9c8; padding: 9px 8px; font-size: 8px; letter-spacing: .08em; font-weight: 750; cursor: pointer; white-space: nowrap; }
.transport-button:hover, .quality-button:hover { color: #e2f8ff; border-color: rgba(85, 216, 244, .28); }
.transport-button span { color: #6ecce4; padding-left: 2px; font-size: 12px; }
.transport-divider { width: 1px; height: 28px; background: var(--line-strong); margin: 0 3px; }
.time-display { display: flex; flex-direction: column; gap: 2px; min-width: 66px; }
.time-display .section-kicker { font-size: 7px; white-space: nowrap; }
.time-display strong { font-size: 14px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.speed-control { display: flex; align-items: center; gap: 8px; min-width: 118px; }
.speed-control label, .quality-control > span { color: #6f8c9c; font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.speed-control input { width: 66px; }
.speed-control output { color: #a9e9f6; font-size: 9px; min-width: 25px; font-weight: 700; }
.quality-control { display: flex; align-items: center; gap: 4px; }
.quality-button { padding: 7px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #6f8b9b; font-size: 7px; letter-spacing: .1em; font-weight: 800; cursor: pointer; }
.quality-button.active { color: #bceeff; border-color: rgba(85, 216, 244, .22); background: rgba(65, 167, 198, .12); }
.export-button { border: 1px solid rgba(85, 216, 244, .2); border-radius: 7px; background: rgba(45, 139, 169, .11); color: #9de9f8; padding: 9px 10px; font-size: 8px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; cursor: pointer; }
.export-button:hover { background: rgba(45, 139, 169, .24); }
.export-button span { font-size: 12px; padding-right: 4px; }
.data-panel { display: flex; flex-direction: column; }
.telemetry-pulse { width: 7px; height: 7px; border-radius: 50%; background: #72e0c3; box-shadow: 0 0 0 4px rgba(114, 224, 195, .08), 0 0 12px rgba(114,224,195,.65); margin: 5px 3px 0 0; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout { min-width: 0; padding: 10px 9px 9px; border: 1px solid rgba(130, 186, 209, .12); border-radius: 9px; background: rgba(3, 15, 24, .42); }
.primary-readout { grid-column: span 2; padding: 12px 11px 10px; background: linear-gradient(120deg, rgba(27, 100, 127, .22), rgba(8, 30, 45, .4)); border-color: rgba(85, 216, 244, .2); }
.readout-label { color: #7797a8; font-size: 7px; letter-spacing: .1em; line-height: 1.4; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-label span { color: #547c8e; font-size: 6px; margin-left: 3px; }
.readout-value { color: #dff8ff; font-size: 20px; letter-spacing: -.04em; line-height: 1.3; margin-top: 4px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.primary-readout .readout-value { color: #9deaff; font-size: 27px; }
.readout-value small { color: #83a8b8; font-size: 9px; letter-spacing: 0; margin-left: 4px; font-weight: 550; }
.readout-foot { color: #587687; font-size: 8px; margin-top: 2px; line-height: 1.35; }
.validation-card { margin-top: 12px; padding: 11px 10px 10px; border: 1px solid rgba(123, 230, 194, .16); border-radius: 10px; background: linear-gradient(145deg, rgba(24, 83, 78, .14), rgba(5, 23, 30, .28)); }
.validation-heading { display: flex; align-items: center; gap: 8px; }
.validation-check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #85e8c7; background: rgba(83, 211, 164, .12); font-size: 11px; }
.validation-heading strong { display: block; font-size: 9px; color: #c2e9dc; }
.validation-heading span:not(.validation-check) { display: block; color: #648c87; font-size: 7px; letter-spacing: .1em; margin-top: 2px; }
.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: #638c89; font-size: 6px; font-weight: 800; letter-spacing: .1em; }
.validation-values strong { color: #bce9d8; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.validation-card p { color: #65847f; font-size: 8px; line-height: 1.45; margin: 8px 0 0; }
.science-toggle-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: auto; padding-top: 13px; gap: 8px; }
.science-toggle-row > span { color: #a9c7d5; font-size: 9px; font-weight: 650; }
.science-icon { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 5px; border-radius: 6px; color: #91e8fa; background: rgba(72, 177, 205, .13); font-size: 12px; }
.science-toggle-row button { border: 1px solid rgba(85, 216, 244, .19); border-radius: 6px; padding: 7px 8px; color: #8ddcf0; background: rgba(48, 137, 164, .1); font-size: 7px; letter-spacing: .1em; font-weight: 800; cursor: pointer; white-space: nowrap; }
.science-toggle-row button span { font-size: 11px; padding-left: 3px; }
.science-panel { margin-top: 14px; padding: 19px 20px 16px; }
.science-panel[hidden] { display: none; }
.science-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.science-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.science-grid article { border-left: 1px solid rgba(85, 216, 244, .23); padding-left: 12px; }
.science-number { color: #60b8d2; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.science-grid h3 { margin: 6px 0; color: #cfeaf4; font-size: 12px; }
.science-grid p { color: #819eae; font-size: 9px; line-height: 1.6; margin: 0 0 9px; }
.equation { color: #a8e7f5; font-size: 13px; font-family: Georgia, serif; letter-spacing: .01em; padding: 8px 0; }
.science-grid small { color: #607e8e; font-size: 8px; line-height: 1.5; display: block; }
.science-footnote { margin-top: 15px; padding-top: 11px; border-top: 1px solid var(--line); color: #7895a5; font-size: 9px; line-height: 1.5; }
.science-footnote strong { color: #b3d8e5; }
.footer-note { display: flex; justify-content: space-between; gap: 12px; color: #496779; font-size: 7px; letter-spacing: .08em; padding: 10px 3px 0; }
.footer-note span:last-child { letter-spacing: .015em; text-align: right; }
.embed-mode .topbar, .embed-mode .footer-note { display: none; }
.embed-mode .app-shell { padding: 0; }
.embed-mode .workspace { min-height: 100vh; padding: 0; }
.embed-mode .control-panel, .embed-mode .data-panel { border-radius: 0; }
.embed-mode .scene-frame { border-radius: 0; }

@media (max-width: 1220px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .workspace { grid-template-columns: minmax(224px, 250px) minmax(380px, 1fr) minmax(220px, 236px); gap: 10px; }
  .control-panel, .data-panel { padding-left: 12px; padding-right: 12px; }
  .transport { gap: 8px; padding-left: 9px; padding-right: 9px; }
  .speed-control { min-width: 105px; }
  .speed-control input { width: 52px; }
  .quality-control > span { display: none; }
}
@media (max-width: 1020px) {
  .workspace { grid-template-columns: minmax(220px, 250px) minmax(0, 1fr); }
  .data-panel { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(200px, .8fr) minmax(300px, 1.2fr); column-gap: 14px; align-items: start; }
  .data-panel .panel-heading { grid-column: 1; }
  .data-panel .readout-grid { grid-column: 1; grid-row: 2 / span 2; }
  .data-panel .validation-card { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .data-panel .science-toggle-row { grid-column: 2; grid-row: 3; margin-top: 10px; }
  .science-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .app-shell { padding: 0 10px 12px; }
  .topbar { height: 68px; }
  .brand-mark { width: 30px; height: 30px; }
  .topbar-meta { display: none; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 17px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; min-height: auto; }
  .stage-column { order: 0; }
  .control-panel { order: 1; }
  .data-panel { order: 2; display: flex; }
  .scene-frame { min-height: 0; height: clamp(350px, 53vh, 510px); }
  .drag-hint { display: none; }
  .annotation-ice { top: 18%; left: 3%; }
  .annotation-channel { right: 2%; top: 48%; }
  .annotation-tip { bottom: 18%; left: 4%; }
  .scene-annotation { font-size: 7px; }
  .scene-annotation .annotation-line { width: 18px; }
  .transport { flex-wrap: wrap; justify-content: flex-start; gap: 9px; }
  .transport-main { flex: 1 1 100%; }
  .speed-control { flex: 1; }
  .quality-control { margin-left: auto; }
  .export-button { margin-left: auto; }
  .control-panel, .data-panel { padding: 15px 13px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 17px; }
  .cause-card { margin-top: 16px; }
  .data-panel .panel-heading, .data-panel .readout-grid, .data-panel .validation-card, .data-panel .science-toggle-row { grid-column: auto; grid-row: auto; }
  .data-panel .validation-card { margin-top: 12px; }
  .science-toggle-row { margin-top: 14px; }
  .science-panel { padding: 15px 13px; }
  .science-grid { grid-template-columns: 1fr 1fr; gap: 13px; }
  .science-grid article { padding-left: 9px; }
  .footer-note { flex-direction: column; gap: 5px; font-size: 6px; }
  .footer-note span:last-child { text-align: left; }
}
@media (max-width: 420px) {
  .app-shell { padding-left: 8px; padding-right: 8px; }
  .scene-frame { height: 390px; }
  .scene-topline { top: 9px; left: 9px; right: 9px; }
  .scene-tag { font-size: 7px; padding: 6px 7px; }
  .control-list { grid-template-columns: 1fr; }
  .preset { font-size: 8px; }
  .readout-grid { gap: 6px; }
  .readout { padding: 9px 8px; }
  .readout-label { font-size: 6px; }
  .readout-value { font-size: 18px; }
  .primary-readout .readout-value { font-size: 24px; }
  .validation-values strong { font-size: 9px; }
  .science-grid { grid-template-columns: 1fr; }
  .transport-main { gap: 5px; }
  .play-button { padding: 9px 9px; }
  .transport-button { padding: 9px 6px; }
  .time-display { min-width: 57px; }
  .speed-control { min-width: 0; }
  .speed-control input { width: 48px; }
  .export-button { padding: 8px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
