:root {
  color-scheme: dark;
  --bg: #080d14;
  --panel: rgba(11, 19, 28, 0.88);
  --panel-solid: #0d1721;
  --line: rgba(144, 178, 194, 0.17);
  --line-strong: rgba(144, 178, 194, 0.3);
  --text: #e7eef1;
  --muted: #9aabb5;
  --dim: #647984;
  --cyan: #79d9e5;
  --orange: #ff8854;
  --amber: #e9b66d;
  --green: #7be0c4;
  --shadow: 0 16px 48px rgba(0,0,0,.32);
}
* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; letter-spacing: .01em; }
button, input { font: inherit; }
button { color: inherit; }
#app { display: flex; flex-direction: column; }
.topbar {
  height: 78px; min-height: 78px; display: grid; grid-template-columns: 230px minmax(0, 1fr) 150px;
  align-items: center; gap: 22px; padding: 0 25px; z-index: 20;
  background: linear-gradient(180deg, rgba(11,18,27,.98), rgba(9,15,23,.94));
  border-bottom: 1px solid rgba(153,185,198,.12);
}
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 27px; height: 27px; display: flex; align-items: end; gap: 3px; padding: 4px; border: 1px solid rgba(121,217,229,.35); border-radius: 7px; background: rgba(121,217,229,.06); }
.brand-mark span { width: 4px; border-radius: 4px; background: var(--cyan); box-shadow: 0 0 9px rgba(121,217,229,.4); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .75; }
.eyebrow { color: #b7c6ce; font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.4; }
.eyebrow i { color: var(--dim); font-style: normal; padding: 0 4px; }
.brand-sub { color: #718691; font-size: 8px; letter-spacing: .13em; margin-top: 4px; white-space: nowrap; }
.brand-sub span { color: var(--orange); padding: 0 4px; }
.title-lockup { min-width: 0; }
.title-lockup h1 { margin: 0; color: #f0f5f6; font-size: 17px; font-weight: 620; letter-spacing: -.025em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-lockup h1 span { color: var(--orange); padding: 0 2px; }
.title-lockup p { margin: 4px 0 0; color: #8fa2ad; font-size: 10px; letter-spacing: .025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-status { display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: #b5c8d0; font-size: 9px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.top-status small { margin-left: 3px; padding: 4px 6px; color: #d4a76f; border: 1px solid rgba(233,182,109,.28); border-radius: 4px; font-size: 7px; letter-spacing: .12em; }
.status-dot, .live-pulse, .tiny-dot, .caption-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(123,224,196,.7); }
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; isolation: isolate; background: #080e16; }
#scene-container { position: absolute; inset: 0; z-index: 0; }
#scene-container canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.scene-vignette { pointer-events: none; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 51% 44%, transparent 42%, rgba(4,8,13,.22) 100%), linear-gradient(180deg, rgba(6,11,17,.14), transparent 25%, transparent 76%, rgba(4,8,13,.35)); }
.panel { position: absolute; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); backdrop-filter: blur(17px); -webkit-backdrop-filter: blur(17px); overflow: hidden; }
.control-panel { top: 18px; left: 20px; width: 300px; max-height: calc(100% - 165px); display: flex; flex-direction: column; }
.science-panel { top: 18px; right: 20px; width: 310px; max-height: calc(100% - 165px); display: flex; flex-direction: column; }
.panel-head { min-height: 61px; padding: 12px 14px 10px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 3px 0 0; font-size: 14px; font-weight: 620; letter-spacing: -.015em; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; color: #a9bbc3; background: rgba(255,255,255,.035); cursor: pointer; font-size: 16px; transition: background .2s, border .2s; }
.icon-button:hover { background: rgba(121,217,229,.1); border-color: rgba(121,217,229,.38); }
.panel-content { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #324753 transparent; }
.control-panel .panel-content { padding: 12px 15px 13px; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 13px; }
.preset { min-height: 29px; padding: 4px 3px; border: 1px solid rgba(142,173,187,.16); border-radius: 5px; background: rgba(255,255,255,.025); color: #9baeb7; font-size: 9px; font-weight: 650; letter-spacing: .025em; cursor: pointer; transition: all .18s ease; }
.preset:hover { border-color: rgba(121,217,229,.42); color: #d5e7eb; }
.preset.active { border-color: rgba(121,217,229,.5); background: rgba(57,151,163,.16); color: #a8eff0; box-shadow: inset 0 0 0 1px rgba(121,217,229,.06); }
.control-group { margin: 0 0 12px; }
.control-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.control-heading label { color: #c8d4d9; font-size: 10px; font-weight: 600; }
.control-heading .unit { color: #8197a2; padding-left: 4px; font-size: 9px; font-weight: 500; }
.control-heading output { color: var(--cyan); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 4px; margin: 2px 0 1px; appearance: none; -webkit-appearance: none; background: linear-gradient(90deg, rgba(92,191,199,.68), rgba(92,191,199,.2)); border-radius: 10px; outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #c9f5f3; background: #328c94; box-shadow: 0 0 0 3px rgba(74,190,192,.12), 0 0 10px rgba(74,190,192,.25); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #c9f5f3; background: #328c94; box-shadow: 0 0 0 3px rgba(74,190,192,.12); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(121,217,229,.22); }
.range-ends { display: flex; justify-content: space-between; margin-top: 4px; color: #687e89; font-size: 8px; font-variant-numeric: tabular-nums; }
.control-group small { display: block; margin-top: 5px; color: #687e89; font-size: 8px; }
.compact-group { margin-bottom: 10px; }
.panel-footnote { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: #7c919b; font-size: 8px; line-height: 1.5; }
.panel-footnote .tiny-dot { width: 5px; height: 5px; margin-right: 5px; vertical-align: 1px; }
.science-content { padding: 13px 14px 14px; }
.mechanism-list { display: grid; gap: 9px; margin-bottom: 13px; }
.mechanism-step { display: grid; grid-template-columns: 23px 1fr; gap: 8px; align-items: start; }
.mechanism-step > b { display: flex; align-items: center; justify-content: center; width: 21px; height: 21px; border: 1px solid rgba(121,217,229,.25); border-radius: 5px; color: var(--cyan); font-size: 8px; }
.mechanism-step strong { color: #d9e5e9; font-size: 10px; font-weight: 650; }
.mechanism-step p { margin: 3px 0 0; color: #91a4ae; font-size: 9px; line-height: 1.42; }
.equation-card { padding: 10px 10px 9px; margin-bottom: 8px; border: 1px solid rgba(121,217,229,.18); border-radius: 7px; background: linear-gradient(120deg, rgba(35,104,112,.17), rgba(255,255,255,.015)); }
.equation-label { color: #8eb8bf; font-size: 7px; font-weight: 750; letter-spacing: .15em; }
.equation { margin-top: 8px; color: #e2f0ef; font-family: "Times New Roman", Georgia, serif; font-size: 16px; letter-spacing: .01em; text-align: center; white-space: nowrap; }
.equation sub { font-size: 10px; }
.equation-sub { margin-top: 5px; color: #92a9b1; font-size: 8px; text-align: center; }
.secondary-equation { background: rgba(255,255,255,.018); border-color: var(--line); }
.secondary-equation .equation { font-size: 12px; }
.science-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 10px 0; }
.science-facts > div { padding: 7px 6px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.018); }
.science-facts span { display: block; color: #8ca2ac; font-size: 8px; }
.science-facts strong { display: block; margin: 4px 0 2px; color: #e5eff1; font-size: 11px; font-weight: 650; }
.science-facts small { display: block; color: #748995; font-size: 7px; line-height: 1.3; }
.validation-block { padding: 10px; border: 1px solid rgba(123,224,196,.22); border-radius: 7px; background: rgba(39,104,83,.10); }
.validation-title { display: flex; align-items: center; gap: 8px; }
.check-mark { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #a0f0d5; background: rgba(123,224,196,.14); font-size: 12px; }
.validation-title strong { display: block; color: #d6eee5; font-size: 10px; }
.validation-title small { display: block; margin-top: 2px; color: #7da99b; font-size: 7px; letter-spacing: .12em; }
.validation-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 10px; }
.validation-grid > div { min-width: 0; }
.validation-grid small { display: block; color: #7da99b; font-size: 7px; letter-spacing: .1em; }
.validation-grid strong { display: block; margin-top: 4px; color: #d6eee5; font-size: 11px; font-variant-numeric: tabular-nums; }
.validation-block p { margin: 8px 0 0; color: #88a69d; font-size: 8px; line-height: 1.45; }
.limits-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.limits-note strong { color: #d1dfe3; font-size: 9px; }
.limits-note p { margin: 4px 0 0; color: #8297a1; font-size: 8px; line-height: 1.48; }
.illustrative-note { margin: 10px 0 0; color: #788d97; font-size: 7px; line-height: 1.45; }
.telemetry { position: absolute; z-index: 4; left: 50%; bottom: 82px; transform: translateX(-50%); width: min(530px, calc(100% - 660px)); min-width: 360px; padding: 9px 12px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(9,17,25,.82); backdrop-filter: blur(14px); box-shadow: 0 10px 35px rgba(0,0,0,.24); }
.telemetry-head { display: flex; align-items: center; gap: 7px; color: #a7c0c8; font-size: 8px; font-weight: 750; letter-spacing: .14em; }
.telemetry-head .live-pulse { width: 5px; height: 5px; }
.telemetry-head small { margin-left: auto; color: #738a95; font-size: 7px; letter-spacing: .11em; }
.telemetry-head small b { margin-left: 4px; color: #dce8eb; font-size: 9px; font-variant-numeric: tabular-nums; }
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 8px; }
.metric { min-width: 0; padding-left: 8px; border-left: 1px solid rgba(141,177,190,.17); }
.metric:first-child { padding-left: 0; border-left: 0; }
.metric span { display: block; color: #8da2ad; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric strong { display: block; margin-top: 3px; color: #e8f2f3; font-size: 16px; font-weight: 640; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric strong small { color: #92b9c0; font-size: 9px; font-weight: 500; letter-spacing: 0; }
.metric i { display: block; margin-top: 2px; color: #637e89; font-size: 6px; font-style: normal; font-weight: 700; letter-spacing: .12em; }
.transport-bar { position: absolute; z-index: 8; left: 50%; bottom: 17px; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; height: 49px; padding: 5px 7px; border: 1px solid rgba(147,183,196,.22); border-radius: 9px; background: rgba(9,17,25,.94); box-shadow: 0 12px 38px rgba(0,0,0,.38); backdrop-filter: blur(18px); white-space: nowrap; }
.transport-bar button { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #9db0b9; font-size: 8px; font-weight: 750; letter-spacing: .1em; cursor: pointer; transition: .18s ease; }
.transport-bar button:hover { color: #e7f5f6; border-color: rgba(121,217,229,.25); background: rgba(121,217,229,.07); }
.transport-bar .transport-primary { min-width: 77px; border-color: rgba(121,217,229,.35); background: rgba(54,146,153,.19); color: #bdf4ef; font-size: 9px; letter-spacing: .04em; }
.play-icon { font-size: 12px; line-height: 1; }
.transport-bar .transport-button span { font-size: 13px; line-height: 0; }
.transport-divider { width: 1px; height: 22px; margin: 0 3px; background: rgba(143,177,191,.16); }
.speed-control { display: flex; align-items: center; gap: 6px; padding: 0 5px; color: #7e949e; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.speed-control output { color: var(--cyan); font-size: 9px; letter-spacing: 0; min-width: 24px; }
.speed-control input { width: 63px; }
.transport-bar .export-button { color: #c3d9dd; }
.bottom-caption { position: absolute; z-index: 3; left: 22px; bottom: 18px; color: #718590; font-size: 7px; font-weight: 700; letter-spacing: .13em; pointer-events: none; }
.bottom-caption span { padding: 0 4px; color: #bd7951; }
.caption-dot { width: 5px; height: 5px; margin-right: 5px; background: #df9862; box-shadow: 0 0 8px rgba(223,152,98,.55); vertical-align: 1px; }
.scene-label { position: absolute; z-index: 3; display: flex; align-items: center; gap: 7px; color: rgba(200,220,224,.75); font-size: 7px; font-weight: 750; letter-spacing: .16em; text-shadow: 0 2px 8px rgba(0,0,0,.8); pointer-events: none; }
.label-line { display: block; width: 27px; height: 1px; background: linear-gradient(90deg, var(--cyan), rgba(121,217,229,.05)); box-shadow: 0 0 7px rgba(121,217,229,.4); }
.label-crater { top: 17%; left: 43%; }
.label-gas { top: 66%; left: 44%; }
.label-plug { top: 52%; left: 54%; }
.label-wave { bottom: 29%; right: 28%; }
.axis-note { position: absolute; z-index: 3; right: 350px; top: 20px; display: flex; align-items: center; gap: 7px; color: #6f8590; font-size: 7px; letter-spacing: .14em; pointer-events: none; }
.axis-north { color: var(--cyan); font-weight: 800; }
.axis-rule { width: 24px; height: 1px; background: rgba(121,217,229,.5); }
.context-overlay { position: absolute; z-index: 30; inset: 0; display: grid; place-items: center; background: rgba(3,8,13,.84); backdrop-filter: blur(8px); }
.context-overlay.hidden { display: none; }
.context-card { width: min(350px, calc(100% - 32px)); padding: 24px; text-align: center; border: 1px solid var(--line-strong); border-radius: 12px; background: #101b25; box-shadow: var(--shadow); }
.context-icon { width: 34px; height: 34px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: rgba(233,182,109,.12); color: var(--amber); font-size: 18px; }
.context-card h2 { margin: 0; font-size: 16px; }
.context-card p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.context-card button { margin-top: 8px; padding: 9px 14px; border: 1px solid rgba(121,217,229,.35); border-radius: 6px; background: rgba(121,217,229,.1); color: #c9f2f0; font-size: 9px; font-weight: 750; letter-spacing: .1em; cursor: pointer; }
.mobile-panel-tabs { display: none; }
.panel.collapsed .panel-content { display: none; }
.panel.collapsed .panel-head { border-bottom: 0; }
button:focus-visible, input:focus-visible { outline: 2px solid rgba(121,217,229,.8); outline-offset: 3px; }
@media (max-width: 1180px) and (min-width: 761px) {
  .topbar { grid-template-columns: 190px minmax(0,1fr) 130px; gap: 14px; padding: 0 18px; }
  .control-panel { left: 14px; width: 278px; }
  .science-panel { right: 14px; width: 282px; }
  .telemetry { width: min(450px, calc(100% - 590px)); min-width: 330px; }
  .axis-note { right: 305px; }
  .title-lockup h1 { font-size: 15px; }
}
@media (max-width: 760px) {
  .topbar { height: 80px; min-height: 80px; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 0 13px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 23px; height: 23px; }
  .brand-lockup .eyebrow { font-size: 8px; }
  .brand-sub { font-size: 7px; }
  .title-lockup { grid-column: 1 / 2; grid-row: 2; margin-top: -13px; }
  .title-lockup h1 { font-size: 13px; white-space: normal; }
  .title-lockup p { display: none; }
  .topbar { align-content: center; }
  .top-status { grid-column: 2; grid-row: 1; font-size: 7px; gap: 5px; }
  .top-status small { font-size: 6px; }
  #stage { min-height: 0; }
  .panel { border-radius: 9px; }
  .control-panel, .science-panel { top: auto; left: 9px; right: 9px; bottom: 111px; width: auto; max-height: min(41%, 350px); }
  .control-panel { display: flex; }
  .science-panel { display: none; }
  #stage.mobile-science-active .control-panel { display: none; }
  #stage.mobile-science-active .science-panel { display: flex; }
  .panel-head { min-height: 49px; padding: 8px 11px; }
  .panel-head h2 { font-size: 12px; }
  .control-panel .panel-content, .science-content { padding: 9px 12px 10px; }
  .preset-row { margin-bottom: 10px; }
  .control-group { margin-bottom: 9px; }
  .control-heading label, .control-heading output { font-size: 9px; }
  .telemetry { left: 9px; right: 9px; top: 8px; bottom: auto; transform: none; width: auto; min-width: 0; padding: 7px 9px 8px; border-radius: 8px; }
  .telemetry-head { font-size: 7px; }
  .metric-grid { gap: 5px; margin-top: 6px; }
  .metric { padding-left: 6px; }
  .metric span { font-size: 7px; }
  .metric strong { font-size: 13px; }
  .metric strong small { font-size: 8px; }
  .metric i { font-size: 5px; }
  .transport-bar { left: 9px; right: 9px; bottom: 9px; transform: none; height: 43px; justify-content: space-between; gap: 2px; padding: 4px; }
  .transport-bar button { height: 32px; padding: 0 6px; font-size: 7px; }
  .transport-bar .transport-primary { min-width: 62px; }
  .transport-bar .transport-button { min-width: 40px; }
  .transport-divider { margin: 0 1px; height: 18px; }
  .speed-control { gap: 3px; padding: 0 2px; font-size: 6px; }
  .speed-control input { width: 38px; }
  .speed-control output { min-width: 20px; font-size: 8px; }
  .export-button span { display: none; }
  .bottom-caption, .scene-label, .axis-note { display: none; }
  .mobile-panel-tabs { position: absolute; z-index: 9; left: 50%; bottom: 60px; transform: translateX(-50%); display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(8,15,23,.9); }
  .mobile-panel-tabs button { padding: 6px 12px; border: 0; border-radius: 4px; background: transparent; color: #8ea3ad; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
  .mobile-panel-tabs button.active { color: #c5f1ed; background: rgba(73,157,160,.22); }
  .science-facts small { font-size: 6px; }
  .equation { font-size: 14px; }
  .secondary-equation .equation { font-size: 10px; }
}
@media (max-width: 390px) {
  .topbar { padding: 0 10px; }
  .title-lockup h1 { font-size: 12px; }
  .transport-bar button { padding: 0 4px; }
  .transport-bar .transport-button { min-width: 34px; }
  .speed-control input { width: 31px; }
  .metric strong { font-size: 12px; }
  .control-panel, .science-panel { bottom: 108px; max-height: 40%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.embed-mode .topbar { display: none; }
.embed-mode #stage { height: 100vh; flex: 1; }

.model-status { margin-left: 3px; padding: 3px 5px; border: 1px solid rgba(123,224,196,.22); border-radius: 4px; color: #8ddac2; font-size: 6px; font-weight: 800; letter-spacing: .10em; }
.model-status.warning { color: #f0bf7a; border-color: rgba(240,191,122,.34); background: rgba(240,191,122,.08); }
@media (max-width: 760px) { .model-status { display: none; } }
