:root {
  color-scheme: dark;
  --bg: #06111d;
  --panel: rgba(8, 23, 37, .94);
  --panel-2: #0a1b2b;
  --line: rgba(146, 193, 221, .13);
  --line-strong: rgba(146, 193, 221, .24);
  --text: #e8f5ff;
  --muted: #8ba8bd;
  --muted-2: #58768d;
  --cyan: #69d8f2;
  --cyan-bright: #9aeaff;
  --ice: #a5e8ff;
  --orange: #ffbd7a;
  --green: #76e5c1;
  --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; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
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; height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 40%, #102b40 0%, #071725 48%, #06111d 100%); overflow: hidden; }
.topbar { height: 64px; flex: 0 0 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(4, 14, 24, .84); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 27px; height: 27px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(45deg); }
.brand-mark span { width: 5px; border-radius: 5px; background: linear-gradient(180deg, #b9f0ff, #3aa9ce); box-shadow: 0 0 10px rgba(91, 208, 242, .35); }
.brand-mark span:nth-child(1) { height: 11px; }
.brand-mark span:nth-child(2) { height: 22px; }
.brand-mark span:nth-child(3) { height: 15px; }
.eyebrow { font-size: 9px; line-height: 1.2; letter-spacing: .18em; font-weight: 750; color: #78a1bb; }
.brand-title { margin-top: 4px; font-size: 13px; letter-spacing: .12em; font-weight: 800; color: #e6f7ff; white-space: nowrap; }
.brand-title span { color: #4c8ea8; padding: 0 4px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.live-chip, .seed-chip { border: 1px solid var(--line-strong); border-radius: 30px; padding: 7px 10px; font-size: 9px; font-weight: 750; letter-spacing: .1em; color: #a7c7d9; background: rgba(14, 37, 54, .55); }
.live-chip { display: flex; align-items: center; gap: 7px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #5be1ba; box-shadow: 0 0 10px #5be1ba; }
.seed-chip b { color: #d9f3ff; margin-left: 5px; font-variant-numeric: tabular-nums; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 286px minmax(350px, 1fr) 270px; gap: 0; }
.panel { min-width: 0; background: linear-gradient(180deg, rgba(8, 24, 38, .98), rgba(7, 19, 31, .98)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #23435a transparent; }
.control-panel { border-right: 1px solid var(--line); padding: 21px 18px 18px; }
.data-panel { border-left: 1px solid var(--line); padding: 21px 17px 18px; }
.panel-heading { margin-bottom: 16px; }
.panel-title { font-size: 19px; line-height: 1.15; font-weight: 720; letter-spacing: -.025em; margin-top: 7px; }
.panel-copy { margin: 8px 0 0; font-size: 11px; line-height: 1.55; color: var(--muted); max-width: 250px; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(2, 12, 21, .48); margin-bottom: 19px; }
.preset-btn { min-width: 0; padding: 8px 3px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #7896aa; font-size: 9px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: .18s ease; }
.preset-btn:hover { color: #d7f4ff; background: rgba(87, 175, 210, .08); }
.preset-btn.active { color: #dff8ff; border-color: rgba(91, 198, 230, .25); background: linear-gradient(180deg, rgba(40, 111, 140, .32), rgba(25, 75, 100, .28)); box-shadow: inset 0 1px rgba(255,255,255,.05); }
.control-list { display: flex; flex-direction: column; gap: 15px; }
.control-item { min-width: 0; }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.control-label label { font-size: 11px; color: #c4d9e6; font-weight: 650; }
.control-label output, .playback-top output { font-size: 10px; color: var(--cyan-bright); font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 4px; appearance: none; border-radius: 99px; background: linear-gradient(90deg, #2f93b4, #20445a); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #b3efff; border: 2px solid #3a99b9; box-shadow: 0 0 0 3px rgba(78, 189, 220, .12), 0 0 10px rgba(105, 216, 242, .45); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #b3efff; border: 2px solid #3a99b9; box-shadow: 0 0 0 3px rgba(78, 189, 220, .12); }
.range-hints { display: flex; justify-content: space-between; margin-top: 6px; color: #57748a; font-size: 8px; letter-spacing: .025em; }
.playback-block { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.playback-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.transport-row { display: grid; grid-template-columns: 1fr 40px 40px; gap: 7px; margin-top: 13px; }
.primary-action, .icon-action, .tool-btn { border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(17, 43, 61, .8); cursor: pointer; transition: .18s ease; }
.primary-action { min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #dff8ff; font-size: 11px; font-weight: 750; background: linear-gradient(180deg, #1d647e, #16465f); border-color: rgba(100, 205, 236, .36); box-shadow: 0 4px 15px rgba(5, 20, 30, .24); }
.primary-action:hover { filter: brightness(1.16); transform: translateY(-1px); }
.pause-icon { width: 9px; height: 11px; border-left: 2px solid #c6f5ff; border-right: 2px solid #c6f5ff; }
.primary-action.is-playing .pause-icon { width: 0; height: 0; border: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid #c6f5ff; }
.icon-action { font-size: 15px; color: #a9c9d9; }
.icon-action:hover, .tool-btn:hover { background: rgba(47, 102, 128, .42); color: #e4f8ff; border-color: rgba(111, 208, 237, .4); }
.scene-panel { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 50%, #12384d 0%, #0a2234 42%, #061725 100%); overflow: hidden; }
.scene-toolbar { height: 48px; flex: 0 0 48px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid rgba(146, 193, 221, .1); background: rgba(5, 17, 28, .48); z-index: 2; }
.scene-tag { display: flex; align-items: center; gap: 7px; color: #8bb5ca; font-size: 9px; letter-spacing: .13em; font-weight: 750; white-space: nowrap; }
.tag-square { width: 6px; height: 6px; background: #70d8ee; box-shadow: 0 0 9px #70d8ee; }
.scene-tools { display: flex; align-items: center; gap: 6px; }
.tool-btn { padding: 7px 9px; color: #88aabd; font-size: 8px; letter-spacing: .08em; font-weight: 800; white-space: nowrap; }
.export-btn { color: #a7dff0; border-color: rgba(90, 183, 214, .28); }
.scene-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 52% 42%, #16435a 0%, #0c2b40 42%, #061725 100%); }
#sceneCanvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(4,17,28,.35), transparent 20%, transparent 80%, rgba(4,17,28,.28)), linear-gradient(0deg, rgba(3,15,25,.32), transparent 25%, transparent 76%, rgba(3,15,25,.2)); }
.scene-label { position: absolute; pointer-events: none; display: flex; flex-direction: column; gap: 3px; color: rgba(198, 232, 245, .9); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-shadow: 0 1px 5px #051725; }
.scene-label small { color: rgba(126, 178, 202, .72); font-size: 7px; letter-spacing: .1em; font-weight: 700; }
.label-line { display: block; width: 25px; height: 1px; background: #78d9f0; box-shadow: 0 0 7px rgba(120,217,240,.5); margin-bottom: 2px; }
.label-ice { top: 16%; left: 7%; }
.label-plume { top: 48%; right: 7%; text-align: right; align-items: flex-end; }
.label-tube { top: 67%; left: 8%; }
.depth-ruler { position: absolute; right: 14px; top: 22%; bottom: 19%; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; pointer-events: none; color: rgba(143, 190, 211, .72); font-size: 8px; font-variant-numeric: tabular-nums; }
.depth-ruler i { display: block; width: 7px; height: 1px; background: rgba(131, 194, 220, .55); }
.scene-bottom-note { position: absolute; left: 14px; bottom: 12px; display: flex; align-items: center; gap: 7px; pointer-events: none; color: rgba(144, 184, 204, .72); font-size: 8px; letter-spacing: .04em; }
.compass-dot { width: 5px; height: 5px; border-radius: 50%; border: 1px solid #83d9ef; }
.scene-footer { height: 34px; flex: 0 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-top: 1px solid rgba(146,193,221,.1); color: #7595aa; font-size: 8px; letter-spacing: .035em; background: rgba(4, 16, 27, .55); }
.scene-footer b { color: #c3e3f0; font-weight: 750; font-variant-numeric: tabular-nums; }
.footer-key { color: #54788e; font-size: 8px; letter-spacing: .12em; font-weight: 800; margin-right: 5px; }
.footer-divider { color: #35556b; padding: 0 5px; }
.context-loss { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(3, 13, 22, .9); text-align: center; color: #d8f4ff; }
.context-loss[hidden] { display: none; }
.context-loss strong { font-size: 15px; }
.context-loss span { font-size: 11px; color: #89aabd; }
.data-heading { margin-bottom: 16px; }
.readout-basis { margin-top: 6px; color: #5d8da3; font-size: 7px; letter-spacing: .11em; font-weight: 800; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.readout-card { min-width: 0; min-height: 79px; padding: 10px 9px 8px; border: 1px solid rgba(133, 185, 211, .13); border-radius: 9px; background: linear-gradient(145deg, rgba(20, 52, 72, .64), rgba(8, 25, 39, .75)); }
.readout-name { font-size: 8px; line-height: 1.25; color: #7598ad; font-weight: 800; letter-spacing: .11em; }
.readout-value { margin-top: 8px; color: #dff7ff; font-size: 19px; line-height: 1; font-weight: 720; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { font-size: 9px; letter-spacing: .03em; color: #79b9d0; font-weight: 650; }
.readout-sub { margin-top: 6px; color: #57778e; font-size: 8px; }
.mechanism-card { margin-top: 15px; padding: 12px 10px 10px; border: 1px solid rgba(133,185,211,.13); border-radius: 9px; background: rgba(8, 25, 39, .62); }
.mechanism-heading { display: flex; align-items: center; gap: 7px; color: #83abc0; font-size: 8px; font-weight: 850; letter-spacing: .12em; margin-bottom: 11px; }
.mechanism-icon { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; color: #a4e8fa; background: rgba(69, 166, 199, .16); font-size: 12px; }
.mechanism-step { display: grid; grid-template-columns: 22px 1fr; gap: 7px; padding: 7px 0; border-top: 1px solid rgba(133,185,211,.08); }
.mechanism-step:first-of-type { border-top: 0; }
.mechanism-step > b { color: #5e9bb4; font-size: 9px; padding-top: 1px; }
.mechanism-step strong { display: block; font-size: 10px; color: #cce9f4; font-weight: 700; }
.mechanism-step span { display: block; margin-top: 3px; font-size: 8px; line-height: 1.4; color: #7895a9; }
.validation-card { margin-top: 11px; padding: 11px 10px 9px; border: 1px solid rgba(97, 203, 174, .18); border-radius: 9px; background: linear-gradient(140deg, rgba(13, 48, 52, .5), rgba(8, 26, 39, .7)); }
.validation-head { display: flex; align-items: center; justify-content: space-between; }
.validation-head .eyebrow { color: #6cae9d; }
.check-mark { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: #7de1bf; background: rgba(65, 186, 144, .15); font-size: 10px; }
.validation-title { margin: 7px 0 9px; color: #c9e7e6; font-size: 10px; font-weight: 700; }
.validation-row, .validation-diff { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 5px; font-size: 8px; color: #779a9d; }
.validation-row b { color: #b9dbd6; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-diff { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(108, 190, 165, .13); }
.validation-diff strong { color: #81e0bb; font-size: 11px; font-variant-numeric: tabular-nums; }
.validation-foot { margin-top: 7px; color: #5f9288; font-size: 7px; letter-spacing: .08em; font-weight: 800; }
.science-details { margin-top: 11px; border: 1px solid rgba(133,185,211,.13); border-radius: 9px; background: rgba(7, 22, 35, .6); }
.science-details summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 10px; cursor: pointer; list-style: none; color: #91b8ca; font-size: 8px; letter-spacing: .14em; font-weight: 850; }
.science-details summary::-webkit-details-marker { display: none; }
.details-plus { color: #79b9d0; font-size: 13px; transition: transform .18s ease; }
.science-details[open] .details-plus { transform: rotate(45deg); }
.science-content { padding: 0 10px 11px; color: #8ca8b8; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 7px 0; }
.science-content b { color: #c2e0ed; }
.equation { padding: 7px 8px; margin: 7px 0; border-left: 2px solid #4b9fba; border-radius: 0 5px 5px 0; background: rgba(47, 108, 132, .12); color: #b6e5f2; font-family: Georgia, serif; font-size: 12px; text-align: center; }
.science-note { color: #6e8a9d; }
.app-footer { height: 24px; flex: 0 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-top: 1px solid var(--line); background: rgba(4, 14, 24, .9); color: #4d6a7d; font-size: 7px; letter-spacing: .09em; font-weight: 750; }
body.embed .topbar, body.embed .app-footer { display: none; }
body.embed .workspace { height: 100vh; }
body.embed .control-panel { padding-top: 14px; }
body.embed .data-panel { padding-top: 14px; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 260px minmax(300px,1fr) 245px; }
  .control-panel { padding-left: 14px; padding-right: 14px; }
  .data-panel { padding-left: 13px; padding-right: 13px; }
  .scene-tag { font-size: 8px; }
  .tool-btn { padding: 7px 7px; font-size: 7px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(340px, 48vh) auto; }
  .scene-panel { grid-column: 1 / -1; grid-row: 1; min-height: 340px; }
  .control-panel { grid-column: 1; grid-row: 2; border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
  .data-panel { grid-column: 2; grid-row: 2; border-left: 0; border-top: 1px solid var(--line); }
  .app-footer { min-height: 24px; height: auto; padding-top: 7px; padding-bottom: 7px; }
}
@media (max-width: 560px) {
  .topbar { height: 56px; flex-basis: 56px; padding: 0 12px; }
  .brand-title { font-size: 10px; letter-spacing: .08em; }
  .eyebrow { font-size: 8px; }
  .brand-mark { transform: scale(.85) rotate(45deg); margin-left: -2px; }
  .topbar-right { gap: 5px; }
  .live-chip, .seed-chip { padding: 6px 7px; font-size: 7px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(330px, 42vh) auto auto; }
  .scene-panel { grid-column: 1; grid-row: 1; min-height: 330px; }
  .control-panel { grid-column: 1; grid-row: 2; border-right: 0; padding: 17px 15px; }
  .data-panel { grid-column: 1; grid-row: 3; border-left: 0; padding: 17px 15px 20px; }
  .panel-copy { max-width: 320px; }
  .control-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 16px; row-gap: 16px; }
  .playback-block { margin-top: 17px; }
  .scene-toolbar { height: 43px; flex-basis: 43px; padding: 0 9px; }
  .scene-tag { font-size: 7px; letter-spacing: .08em; }
  .scene-tools { gap: 4px; }
  .tool-btn { padding: 6px 6px; font-size: 6px; letter-spacing: .04em; }
  .label-ice { left: 5%; top: 14%; }
  .label-plume { right: 5%; top: 48%; }
  .label-tube { left: 6%; top: 69%; }
  .scene-bottom-note { font-size: 7px; left: 9px; bottom: 8px; }
  .scene-footer { padding: 0 9px; font-size: 7px; }
  .readout-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .readout-card { min-height: 75px; padding: 9px 7px 7px; }
  .readout-value { font-size: 16px; }
  .readout-value small { font-size: 8px; }
  .readout-name { font-size: 7px; }
  .mechanism-card, .validation-card, .science-details { margin-top: 12px; }
  .app-footer { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
