:root {
  color-scheme: dark;
  --bg: #06131e;
  --panel: #0a1d2a;
  --panel-2: #0d2432;
  --line: rgba(154, 205, 218, 0.13);
  --line-strong: rgba(154, 205, 218, 0.22);
  --text: #e7f3f5;
  --muted: #8da9b4;
  --subtle: #58727f;
  --cyan: #6de0e8;
  --cyan-2: #2daab8;
  --ice: #a9e5ee;
  --gold: #e0c28a;
  --danger: #f1a9a1;
  --radius: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; background: radial-gradient(ellipse at 18% 0%, rgba(31, 90, 111, .2), transparent 44%), #06131e; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { max-width: 1720px; margin: 0 auto; padding: 0 24px 12px; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 31px; height: 31px; border: 1px solid rgba(109, 224, 232, .48); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-7deg); background: linear-gradient(145deg, rgba(109,224,232,.14), rgba(109,224,232,.02)); }
.brand-mark span { display: block; width: 3px; border-radius: 5px; background: var(--cyan); transform: skewY(-25deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.eyebrow { color: #6e9ba8; font-size: 9px; line-height: 1.2; letter-spacing: .17em; font-weight: 800; }
.brand-title { margin-top: 3px; font-size: 14px; letter-spacing: .015em; font-weight: 650; }
.brand-title span { color: #426574; padding: 0 4px; }
.topbar-right { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 9px; letter-spacing: .13em; font-weight: 750; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #728b96; box-shadow: 0 0 0 3px rgba(114,139,150,.12); }
.live-indicator.is-running i { background: #6de0a5; box-shadow: 0 0 0 3px rgba(109,224,165,.13), 0 0 10px rgba(109,224,165,.5); }
.seed-label { padding-left: 18px; border-left: 1px solid var(--line); }
.seed-label b { color: #c3dce2; font-variant-numeric: tabular-nums; margin-left: 5px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding-top: 16px; align-items: start; }
.stage-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(13,36,50,.88), rgba(6,21,32,.96)); box-shadow: 0 18px 70px rgba(0,0,0,.18); }
.stage-topline { min-height: 84px; padding: 17px 20px 13px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stage-kicker { color: #6fa5b2; font-size: 9px; font-weight: 800; letter-spacing: .17em; }
h1 { margin: 5px 0 3px; font-size: clamp(21px, 2vw, 27px); letter-spacing: -.045em; line-height: 1.08; font-weight: 660; }
.stage-subtitle { margin: 0; color: #91aeb9; font-size: 11px; line-height: 1.45; }
.depth-tag { flex: 0 0 auto; padding: 8px 10px; border: 1px solid rgba(124,190,203,.18); border-radius: 20px; color: #85aab5; font-size: 8px; letter-spacing: .1em; white-space: nowrap; background: rgba(7,26,38,.45); }
.depth-tag b { color: #d2e7eb; font-weight: 700; }
.depth-dot { display: inline-block; width: 5px; height: 5px; margin-right: 6px; vertical-align: 1px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.scene-wrap { position: relative; height: clamp(360px, 52vh, 510px); overflow: hidden; background: radial-gradient(ellipse at 50% 35%, #123b4b, #071b2b 64%, #05131e); border-top: 1px solid rgba(142,203,215,.08); border-bottom: 1px solid rgba(142,203,215,.1); }
#scene-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.scene-vignette { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2,12,20,.18), transparent 22%, transparent 78%, rgba(2,12,20,.22)), linear-gradient(180deg, rgba(2,12,20,.16), transparent 18%, transparent 78%, rgba(2,12,20,.22)); }
.scene-status { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%,-50%); max-width: calc(100% - 28px); padding: 11px 14px; border: 1px solid rgba(112,207,220,.28); border-radius: 8px; background: rgba(3,17,27,.84); color: #9ddbe2; text-align: center; font-size: 9px; line-height: 1.5; letter-spacing: .11em; font-weight: 800; box-shadow: 0 10px 35px rgba(0,0,0,.3); }
.scene-status.is-error { color: #f1b5ac; border-color: rgba(241,169,161,.35); }
.is-hidden { display: none !important; }
.scene-annotation { position: absolute; display: flex; align-items: center; gap: 7px; color: rgba(177,220,225,.68); font-size: 8px; font-weight: 800; letter-spacing: .16em; text-shadow: 0 2px 8px #00121c; pointer-events: none; }
.annotation-line { width: 22px; height: 1px; background: rgba(109,224,232,.6); box-shadow: 0 0 7px rgba(109,224,232,.4); }
.annotation-top { top: 16%; left: 7%; }
.annotation-mid { top: 52%; right: 6%; flex-direction: row-reverse; }
.annotation-low { bottom: 18%; left: 9%; }
.scene-coordinates { position: absolute; left: 18px; bottom: 13px; display: flex; gap: 12px; color: rgba(143,180,191,.56); font-size: 8px; letter-spacing: .13em; font-weight: 750; pointer-events: none; }
.scene-coordinates span:first-child { color: rgba(167,216,222,.72); }
.scene-compass { position: absolute; right: 18px; bottom: 16px; width: 25px; height: 34px; color: rgba(169,218,225,.6); font-size: 8px; text-align: center; pointer-events: none; }
.scene-compass i { display: block; margin: 4px auto 0; width: 1px; height: 16px; background: linear-gradient(to bottom, var(--cyan), transparent); }
.scene-compass b { display: block; width: 5px; height: 5px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); transform: rotate(45deg); margin: -15px auto 0; }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding: 13px 18px 12px; border-bottom: 1px solid var(--line); gap: 12px; }
.readout { min-width: 0; padding-left: 12px; border-left: 1px solid rgba(128,185,198,.17); }
.readout:first-child { padding-left: 0; border-left: 0; }
.readout-label { display: flex; align-items: center; gap: 5px; color: #71909d; font-size: 8px; letter-spacing: .13em; font-weight: 800; white-space: nowrap; }
.readout-label em { color: #5fd5a5; font-size: 7px; font-style: normal; letter-spacing: .08em; }
.readout strong { display: block; margin-top: 5px; color: #e0f3f4; font-size: clamp(16px, 1.6vw, 21px); font-weight: 620; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout strong small { color: #83a8b2; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.readout-note { display: block; margin-top: 2px; color: #597583; font-size: 8px; white-space: nowrap; }
.stage-footer { min-height: 55px; padding: 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.playback-controls, .stage-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { width: 31px; height: 31px; display: inline-flex; justify-content: center; align-items: center; border: 1px solid rgba(143,197,207,.18); border-radius: 8px; background: rgba(13,42,55,.75); color: #9dc0c8; cursor: pointer; font-size: 14px; transition: border-color .18s, background .18s, color .18s, transform .18s; }
.icon-button:hover { border-color: rgba(109,224,232,.55); color: #e4ffff; background: rgba(20,67,80,.8); }
.icon-button:active { transform: scale(.96); }
.icon-button.primary { color: #06202a; background: linear-gradient(135deg, #9af0ed, #51c9d1); border-color: transparent; box-shadow: 0 4px 16px rgba(64,202,211,.14); }
.icon-button.primary:hover { color: #041a21; background: #b8fff5; }
.play-glyph { font-size: 12px; }
.speed-control { display: flex; align-items: center; gap: 2px; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.speed-control span { margin-right: 4px; color: #668593; font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.speed-control button { border: 0; padding: 5px 6px; border-radius: 5px; background: transparent; color: #7895a0; font-size: 9px; cursor: pointer; }
.speed-control button:hover, .speed-control button.selected { background: rgba(89,190,201,.14); color: #9be8eb; }
.text-button { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 6px 5px; background: transparent; color: #7896a1; cursor: pointer; font-size: 8px; letter-spacing: .09em; font-weight: 800; white-space: nowrap; transition: color .18s; }
.text-button span { color: #77cbd4; font-size: 13px; }
.text-button:hover { color: #d8f6f6; }
.quality-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #5dd5a5; box-shadow: 0 0 6px rgba(93,213,165,.55); }
.control-rail { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.rail-section, .science-panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(11,31,44,.96), rgba(8,24,35,.96)); box-shadow: 0 12px 36px rgba(0,0,0,.1); }
.experiment-section { padding: 17px 16px 13px; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-heading h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.035em; font-weight: 650; }
.control-count { padding: 5px 7px; border: 1px solid rgba(109,224,232,.17); border-radius: 5px; color: #77b8c2; font-size: 8px; letter-spacing: .1em; white-space: nowrap; }
.preset-block { margin-top: 16px; }
.section-label { display: block; color: #6e8d99; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 5px; margin-top: 7px; }
.preset-button { display: flex; align-items: center; gap: 9px; min-height: 39px; width: 100%; padding: 6px 9px; border: 1px solid rgba(137,188,199,.12); border-radius: 8px; background: rgba(7,22,32,.48); text-align: left; cursor: pointer; transition: border-color .18s, background .18s; }
.preset-button:hover { border-color: rgba(109,224,232,.35); background: rgba(13,47,60,.55); }
.preset-button.active { border-color: rgba(109,224,232,.42); background: linear-gradient(90deg, rgba(42,139,152,.18), rgba(11,37,50,.72)); box-shadow: inset 2px 0 #65d6df; }
.preset-icon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(103,211,220,.1); color: #82e4e9; font-size: 15px; }
.preset-button b { display: block; color: #c8e0e4; font-size: 10px; font-weight: 700; }
.preset-button small { display: block; margin-top: 2px; color: #688794; font-size: 8px; }
.control-list { margin-top: 14px; }
.control-row { padding: 9px 0 8px; border-top: 1px solid rgba(137,188,199,.09); }
.control-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-heading label { color: #b5cdd2; font-size: 10px; font-weight: 600; }
.control-heading output { color: #8fe0e5; font-size: 9px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { --range-progress: 50%; appearance: none; width: 100%; height: 4px; display: block; margin: 10px 0 5px; border-radius: 4px; outline: none; background: linear-gradient(90deg, #4dc4cf 0 var(--range-progress), #1a3947 var(--range-progress) 100%); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border: 2px solid #b5f5f0; border-radius: 50%; background: #278b99; box-shadow: 0 0 0 3px rgba(80,202,212,.12), 0 0 9px rgba(83,214,224,.4); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #b5f5f0; border-radius: 50%; background: #278b99; box-shadow: 0 0 0 3px rgba(80,202,212,.12); }
.range-ends { display: flex; justify-content: space-between; color: #587482; font-size: 8px; font-variant-numeric: tabular-nums; }
.control-footnote { display: flex; align-items: flex-start; gap: 7px; margin-top: 9px; padding: 9px 9px 0; border-top: 1px solid rgba(137,188,199,.09); color: #66838e; font-size: 8px; line-height: 1.5; }
.tiny-info { flex: 0 0 13px; width: 13px; height: 13px; display: grid; place-items: center; border: 1px solid rgba(111,184,195,.38); border-radius: 50%; color: #85c9d0; font-size: 8px; font-weight: 800; }
.validation-section { padding: 14px 15px 13px; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-heading-row h3 { margin: 4px 0 0; color: #d3e7e9; font-size: 13px; font-weight: 650; }
.status-pill { padding: 4px 6px; border: 1px solid rgba(223,194,138,.24); border-radius: 4px; color: #d9bd8b; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.validation-description { margin: 8px 0 10px; color: #78939e; font-size: 9px; line-height: 1.5; }
.validation-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.validation-grid div { padding: 8px 7px; border-radius: 6px; background: rgba(4,17,26,.48); }
.validation-grid span { display: block; color: #658390; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.validation-grid b { display: block; margin-top: 4px; color: #bfe3e5; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.science-panel { padding: 0; overflow: hidden; }
.science-panel summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary span:first-child { display: flex; flex-direction: column; gap: 4px; }
.science-panel summary b { font-size: 13px; font-weight: 650; }
.details-chevron { color: #77a8b3; font-size: 17px; transition: transform .2s; }
.science-panel[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding: 0 15px 15px; border-top: 1px solid rgba(137,188,199,.09); }
.science-content h4 { margin: 12px 0 5px; color: #bfe1e4; font-size: 10px; font-weight: 750; }
.science-content p, .science-content li { color: #819ca6; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 0 0 8px; }
.science-content ul { margin: 5px 0 10px; padding-left: 15px; }
.science-content li { margin: 4px 0; }
.equation { margin: 7px 0; padding: 8px 9px; border: 1px solid rgba(109,224,232,.12); border-radius: 6px; background: rgba(4,18,27,.55); color: #9de4e7; font-family: Georgia, serif; font-size: 12px; text-align: center; }
.science-legend { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; border-top: 1px solid rgba(137,188,199,.09); }
.science-legend span { display: inline-flex; align-items: center; gap: 5px; color: #73909b; font-size: 8px; }
.science-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.legend-ice { background: #a9e5ee; }.legend-brine { background: #3bc4d4; }.legend-water { background: #1d4b65; }
.footer-note { display: flex; justify-content: space-between; gap: 12px; padding: 11px 3px 0; color: #4e6d7b; font-size: 7px; letter-spacing: .12em; font-weight: 750; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #75e0e5; outline-offset: 3px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0,1fr) 330px; gap: 12px; }
  .app-shell { padding-inline: 16px; }
  .stage-footer { flex-wrap: wrap; }
  .stage-actions { margin-left: auto; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .scene-wrap { height: min(54vw, 470px); min-height: 340px; }
  .control-rail { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .experiment-section { grid-row: span 2; }
  .science-panel { grid-column: 2; }
  .preset-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 10px 10px; }
  .topbar { height: 55px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-title { font-size: 12px; }
  .topbar-right { gap: 9px; font-size: 8px; }
  .seed-label { padding-left: 9px; }
  .workspace { padding-top: 10px; gap: 10px; }
  .stage-topline { min-height: 76px; padding: 13px 13px 11px; }
  h1 { font-size: 22px; }
  .stage-subtitle { font-size: 10px; }
  .depth-tag { padding: 7px 8px; font-size: 7px; }
  .scene-wrap { height: 54vh; min-height: 350px; max-height: 470px; }
  .annotation-top { top: 11%; left: 4%; }
  .annotation-mid { top: 50%; right: 3%; }
  .annotation-low { bottom: 17%; left: 4%; }
  .scene-annotation { font-size: 7px; gap: 5px; }
  .annotation-line { width: 13px; }
  .scene-coordinates { left: 11px; bottom: 10px; gap: 7px; font-size: 7px; }
  .scene-compass { right: 10px; bottom: 11px; }
  .readout-strip { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 7px; padding: 11px 12px; }
  .readout { padding-left: 9px; }
  .readout:nth-child(3) { padding-left: 0; border-left: 0; }
  .readout-label { font-size: 7px; }
  .readout strong { font-size: 18px; margin-top: 3px; }
  .readout-note { font-size: 7px; }
  .stage-footer { padding: 9px 10px; gap: 8px; }
  .playback-controls { width: 100%; }
  .stage-actions { width: 100%; margin-left: 0; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 7px; }
  .text-button { font-size: 7px; }
  .speed-control { margin-left: auto; padding-left: 7px; }
  .speed-control button { padding: 5px 5px; }
  .control-rail { display: flex; }
  .experiment-section { padding: 14px 13px 12px; }
  .rail-heading h2 { font-size: 16px; }
  .preset-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .preset-button { min-height: 64px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 7px 7px; }
  .preset-icon { width: 19px; height: 19px; flex-basis: 19px; font-size: 13px; }
  .preset-button b { font-size: 8px; line-height: 1.2; }
  .preset-button small { font-size: 7px; line-height: 1.2; }
  .control-row { padding: 10px 0 8px; }
  .control-heading label { font-size: 10px; }
  .validation-section { padding: 13px; }
  .science-panel summary { padding: 13px; }
  .science-content { padding-inline: 13px; }
  .footer-note { flex-direction: column; gap: 5px; padding-inline: 2px; 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; }
}
body.embed-mode .topbar, body.embed-mode .footer-note { display: none; }
body.embed-mode .app-shell { padding: 0; }
body.embed-mode .workspace { padding: 0; gap: 8px; }
body.embed-mode .stage-card { border-radius: 0; }
body.embed-mode .control-rail { padding: 0 8px 8px; }
