:root {
  color-scheme: dark;
  --bg: #06151e;
  --panel: #0b202b;
  --panel-2: #102a36;
  --line: rgba(155, 214, 228, 0.12);
  --line-strong: rgba(155, 214, 228, 0.22);
  --text: #e9f6f8;
  --muted: #8daab3;
  --faint: #5d7a85;
  --cyan: #7be6ee;
  --cyan-strong: #38c5d8;
  --ice: #b7f4fa;
  --amber: #f1c47b;
  --radius: 14px;
  --space: 8px;
  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 { 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 { height: 100vh; min-height: 620px; display: flex; flex-direction: column; background: radial-gradient(ellipse at 76% 42%, #0c2a37 0%, #06151e 64%); }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(5, 18, 26, 0.86); position: relative; z-index: 4; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 28px; height: 28px; border: 1px solid rgba(117, 224, 236, .45); border-radius: 9px; position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(45deg); }
.brand-icon span { width: 3px; border-radius: 4px; background: var(--cyan); display: block; }
.brand-icon span:nth-child(1) { height: 9px; opacity: .55; }
.brand-icon span:nth-child(2) { height: 16px; }
.brand-icon span:nth-child(3) { height: 11px; opacity: .75; }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #d9f1f4; }
.brand-name span { color: #70929e; font-weight: 600; }
.brand-subtitle { color: #6f909b; font-size: 9px; letter-spacing: .16em; margin-top: 4px; }
.topbar-meta { display: flex; align-items: center; gap: 18px; }
.live-indicator, .seed-tag { font-size: 9px; letter-spacing: .12em; color: #8fb0ba; font-weight: 700; }
.live-indicator { display: flex; align-items: center; gap: 7px; }
.live-indicator i, .status-chip i { width: 6px; height: 6px; border-radius: 50%; background: #65e3be; box-shadow: 0 0 12px rgba(101, 227, 190, .85); display: inline-block; }
.seed-tag { border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; color: #73939e; }
.workspace { display: grid; grid-template-columns: 316px minmax(0, 1fr); flex: 1; min-height: 0; }
.control-panel { overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px 18px; background: linear-gradient(180deg, rgba(10, 31, 42, .98), rgba(7, 24, 33, .98)); border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #244956 transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 19px; }
.eyebrow { font-size: 9px; color: #73a5b1; font-weight: 800; letter-spacing: .16em; }
.panel-heading h1 { margin: 7px 0 5px; font-size: 20px; letter-spacing: -.035em; font-weight: 650; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; max-width: 230px; }
.icon-button { border: 1px solid var(--line-strong); background: #102c38; color: #a8d7de; border-radius: 9px; width: 32px; height: 32px; font-size: 18px; cursor: pointer; flex: 0 0 auto; }
.icon-button:hover, .utility-button:hover, .transport-button:hover, .stage-button:hover { border-color: rgba(123,230,238,.6); color: var(--cyan); }
.preset-section, .control-section { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 14px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title-row h2 { margin: 0; font-size: 11px; font-weight: 750; letter-spacing: .06em; color: #cde5e9; }
.mini-label, .section-index { color: #668b97; font-size: 8px; letter-spacing: .13em; font-weight: 800; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: rgba(15, 42, 54, .6); border-radius: 9px; padding: 8px 10px; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.preset-button:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.preset-button.active { border-color: rgba(98, 217, 228, .54); background: rgba(34, 91, 105, .24); box-shadow: inset 2px 0 0 var(--cyan-strong); }
.preset-button b { display: block; font-size: 10px; font-weight: 700; }
.preset-button small { display: block; margin-top: 2px; color: #7798a2; font-size: 9px; }
.preset-mark { width: 22px; height: 22px; display: block; border-radius: 7px; position: relative; background: #123746; flex: 0 0 22px; }
.preset-mark::before, .preset-mark::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border-radius: 50%; }
.preset-mark::before { width: 9px; height: 9px; top: 4px; background: #85dce8; }
.preset-mark::after { width: 3px; height: 8px; top: 12px; background: #85dce8; }
.active-mark::before { background: #50d3e4; box-shadow: 0 0 8px #50d3e4; }
.weak-mark::before { background: #8eabb7; }
.weak-mark::after { background: #8eabb7; height: 4px; }
.range-control { margin: 0 0 15px; }
.range-control label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #bdd4d9; font-size: 10px; font-weight: 600; margin-bottom: 7px; }
.range-control output { color: var(--cyan); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 4px; margin: 0; display: block; appearance: none; background: linear-gradient(90deg, #2e9daf, #3c7180); border-radius: 10px; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #d7fbff; background: #42c9dc; box-shadow: 0 0 0 3px rgba(66, 201, 220, .16); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #d7fbff; background: #42c9dc; box-shadow: 0 0 0 3px rgba(66, 201, 220, .16); }
.range-ends { display: flex; justify-content: space-between; color: #587783; font-size: 8px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.control-note { display: block; color: #75a8a9; font-size: 8px; margin-top: 7px; }
.control-note.warning { color: var(--amber); }
.compact-section .range-control { margin-bottom: 12px; }
.transport-row { display: grid; grid-template-columns: 1.15fr 1fr 34px; gap: 6px; margin-top: 12px; }
.primary-button, .transport-button, .utility-button { border-radius: 8px; border: 1px solid var(--line-strong); cursor: pointer; font-size: 10px; font-weight: 750; height: 34px; transition: .18s ease; }
.primary-button { background: linear-gradient(135deg, #2f9eaf, #1c7185); color: #effdff; border-color: rgba(112, 235, 245, .32); box-shadow: 0 5px 18px rgba(18, 118, 138, .16); }
.primary-button:hover { filter: brightness(1.12); }
.primary-button.is-playing { background: linear-gradient(135deg, #236e7c, #16495a); }
.transport-button { background: #102c38; color: #9dbdc5; }
.reset-button { font-size: 17px; }
.utility-row { display: flex; gap: 6px; margin-top: 7px; }
.utility-button { flex: 1; height: 28px; background: rgba(16, 44, 56, .62); color: #83a5ae; font-size: 9px; }
.science-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8, 29, 39, .55); overflow: hidden; }
.science-panel summary { list-style: none; padding: 12px 12px 11px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; font-size: 10px; letter-spacing: .11em; }
.science-panel summary small { display: block; color: #668b96; font-size: 8px; letter-spacing: .08em; margin-top: 4px; }
.summary-plus { font-size: 18px; color: #80b4bf; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 12px 13px; }
.science-step { display: grid; grid-template-columns: 24px 1fr; gap: 7px; padding: 9px 0; border-top: 1px solid rgba(155,214,228,.08); }
.step-number { font-size: 9px; color: #51c7d6; font-weight: 800; padding-top: 1px; }
.science-step b { display: block; font-size: 10px; }
.science-step p, .limitations p { margin: 4px 0 0; color: #88a6ae; font-size: 9px; line-height: 1.5; }
.science-step code { color: #a5e7eb; background: rgba(80, 163, 178, .1); padding: 1px 3px; border-radius: 3px; font-size: 9px; }
.equation-card { border: 1px solid rgba(96, 199, 211, .2); background: rgba(28, 81, 94, .18); border-radius: 8px; padding: 10px; margin-top: 7px; }
.equation-label { color: #70b6c2; font-size: 7px; letter-spacing: .11em; font-weight: 800; }
.equation { color: #e0fbfd; font-family: Georgia, serif; font-size: 18px; margin: 8px 0 3px; }
.equation-small { color: #9bd5dd; font-family: Georgia, serif; font-size: 12px; }
.equation-card p { margin: 7px 0 0; color: #7e9ea7; font-size: 8px; line-height: 1.45; }
.science-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.science-facts div { border-left: 2px solid #286f7d; padding-left: 7px; }
.science-facts span { display: block; color: #648792; font-size: 7px; letter-spacing: .08em; }
.science-facts b { display: block; margin-top: 3px; font-size: 9px; font-weight: 650; }
.limitations { border-top: 1px solid var(--line); padding-top: 9px; }
.limitations b { color: #d0e7eb; font-size: 8px; letter-spacing: .09em; }
.panel-disclaimer { color: #56727d; font-size: 8px; line-height: 1.5; padding: 12px 2px 0; }
.stage { position: relative; overflow: hidden; min-width: 0; min-height: 0; background: radial-gradient(ellipse at 50% 35%, #0c3445, #061925 64%, #04121b); isolation: isolate; }
.three-root { position: absolute; inset: 0; z-index: 0; }
.three-root canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(3, 15, 23, .34) 0%, transparent 25%, transparent 72%, rgba(3, 15, 23, .65) 100%), radial-gradient(ellipse at center, transparent 45%, rgba(1, 10, 16, .24) 100%); }
.stage-topline { position: absolute; z-index: 2; top: 22px; left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.scene-title { font-size: 19px; font-weight: 680; letter-spacing: -.035em; margin-top: 5px; text-shadow: 0 2px 18px rgba(0,0,0,.4); }
.scene-subtitle { color: #8fb3bd; font-size: 10px; margin-top: 4px; letter-spacing: .015em; }
.stage-actions { display: flex; gap: 7px; pointer-events: auto; }
.stage-button { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(153, 217, 228, .24); background: rgba(7, 30, 42, .7); backdrop-filter: blur(8px); color: #b4dce2; font-size: 12px; cursor: pointer; }
.stage-button span { font-size: 9px; margin-left: 4px; }
.annotation { position: absolute; z-index: 2; pointer-events: none; display: flex; align-items: center; gap: 5px; white-space: nowrap; color: #a8dce3; font-size: 8px; letter-spacing: .11em; font-weight: 800; text-shadow: 0 1px 5px #001018; transition: opacity .2s; }
.annotation i { width: 5px; height: 5px; border-radius: 50%; background: #8df4f2; box-shadow: 0 0 9px #8df4f2; }
.annotation-top { top: 35%; left: 40%; }
.annotation-wall { top: 52%; left: 50%; }
.annotation-tip { top: 70%; left: 51%; }
.readout-status-row { position: absolute; z-index: 2; top: 100px; left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.status-chip { border: 1px solid rgba(110, 211, 210, .24); background: rgba(5, 28, 37, .56); backdrop-filter: blur(9px); border-radius: 20px; padding: 7px 10px; display: flex; align-items: center; gap: 7px; color: #a2d2d5; font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.status-chip .muted-status { color: #c5a978; }
.elapsed-chip { display: flex; align-items: center; gap: 9px; border: 1px solid rgba(153, 217, 228, .18); background: rgba(5, 26, 37, .62); backdrop-filter: blur(9px); border-radius: 8px; padding: 6px 10px; }
.elapsed-chip span { color: #7095a0; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.elapsed-chip b { font-size: 13px; font-variant-numeric: tabular-nums; color: #d9f9fc; }
.readout-grid { position: absolute; z-index: 2; top: 145px; left: 26px; display: grid; grid-template-columns: repeat(2, minmax(116px, 1fr)); gap: 6px; width: 252px; pointer-events: none; }
.readout-card { background: rgba(5, 25, 35, .64); backdrop-filter: blur(10px); border: 1px solid rgba(153, 217, 228, .15); border-radius: 8px; padding: 8px 9px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.readout-card > span { color: #81a7b0; display: flex; align-items: center; justify-content: space-between; font-size: 7px; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
.readout-card em, .validation-mini em { font-style: normal; color: #5eb5bf; font-size: 6px; letter-spacing: .06em; }
.readout-card div { margin-top: 5px; display: flex; align-items: baseline; gap: 5px; }
.readout-card b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; color: #e3fbfd; }
.readout-card small { color: #7ca0a9; font-size: 8px; }
.scene-bottom { position: absolute; z-index: 2; left: 26px; right: 26px; bottom: 116px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; pointer-events: none; }
.legend-row { display: flex; gap: 12px; flex-wrap: wrap; color: #a1c2ca; font-size: 8px; text-shadow: 0 1px 5px #001018; }
.legend-row span { display: flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.brine-dot { background: #36c7f1; box-shadow: 0 0 7px #36c7f1; }
.ice-dot { background: #c5fbff; box-shadow: 0 0 7px #c5fbff; }
.ambient-dot { background: #6b9ca9; }
.growth-meter { width: min(220px, 32%); }
.growth-meter-top { display: flex; justify-content: space-between; align-items: center; color: #80a4ae; font-size: 7px; letter-spacing: .09em; margin-bottom: 6px; }
.growth-meter-top b { color: #d7f6f8; font-size: 10px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.meter-track { height: 3px; background: rgba(146, 201, 211, .16); border-radius: 4px; overflow: hidden; }
.meter-track span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #2aa7c0, #9cf4f3); box-shadow: 0 0 9px #3abfd0; transition: width .2s linear; }
.bottom-data-strip { position: absolute; z-index: 2; bottom: 0; left: 0; right: 0; min-height: 75px; display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)) 1.4fr; gap: 0; padding: 13px 26px 12px; background: linear-gradient(90deg, rgba(5, 20, 28, .9), rgba(5, 25, 35, .76)); border-top: 1px solid rgba(151, 215, 226, .13); backdrop-filter: blur(12px); }
.bottom-data-strip > div { padding: 0 13px; border-left: 1px solid rgba(151, 215, 226, .1); }
.bottom-data-strip > div:first-child { border-left: 0; padding-left: 0; }
.bottom-data-strip span { display: block; color: #6f939d; font-size: 7px; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
.bottom-data-strip b { display: inline-block; margin-top: 5px; color: #d9f8fa; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.bottom-data-strip small { margin-left: 4px; color: #7ea5ae; font-size: 8px; }
.bottom-data-strip .validation-mini { border-left-color: rgba(93, 202, 214, .28); }
.validation-mini b { color: #81e8e5; font-size: 13px; }
.validation-mini small { display: block; margin: 2px 0 0; }
.growth-chart { position: absolute; z-index: 2; right: 26px; top: 145px; width: 132px; padding: 8px 9px 5px; border: 1px solid rgba(153,217,228,.14); border-radius: 8px; background: rgba(5,25,35,.56); backdrop-filter: blur(9px); pointer-events: none; }
.chart-head { display: flex; justify-content: space-between; color: #6e939d; font-size: 6px; letter-spacing: .08em; }
.chart-head b { color: #b7d9df; font-size: 7px; }
.growth-chart svg { width: 100%; height: 40px; margin-top: 4px; overflow: visible; }
.status-toast { position: absolute; z-index: 5; left: 50%; bottom: 90px; transform: translate(-50%, 12px); opacity: 0; padding: 8px 12px; border: 1px solid rgba(111, 218, 227, .25); border-radius: 8px; background: rgba(5, 25, 35, .92); color: #c8f3f6; font-size: 10px; pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap; }
.status-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.status-toast[data-tone="warning"] { border-color: rgba(241,196,123,.45); color: #f3d8aa; }
.webgl-fallback { position: absolute; z-index: 8; inset: 25% 12%; padding: 24px; background: rgba(5, 20, 28, .94); border: 1px solid rgba(241,196,123,.4); border-radius: 14px; color: #f2d8a8; font-size: 13px; line-height: 1.6; text-align: center; }
.mobile-hint { display: none; }
.embed-mode .topbar, .embed-mode .control-panel { display: none; }
.embed-mode .workspace { display: block; }
.embed-mode .stage { height: 100vh; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 292px minmax(0, 1fr); }
  .control-panel { padding-left: 15px; padding-right: 15px; }
  .readout-grid { width: 230px; }
  .readout-card { padding: 7px; }
  .readout-card b { font-size: 15px; }
  .growth-chart { display: none; }
  .bottom-data-strip { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  .topbar { height: 58px; flex-basis: 58px; padding: 0 14px; }
  .topbar-meta { gap: 8px; }
  .live-indicator { font-size: 7px; }
  .seed-tag { font-size: 8px; padding: 6px; }
  .workspace { display: flex; flex-direction: column; }
  .stage { order: -1; height: min(67vh, 610px); min-height: 470px; flex: 0 0 auto; }
  .control-panel { border-right: 0; border-top: 1px solid var(--line); overflow: visible; padding: 18px 16px 24px; }
  .panel-heading { margin-bottom: 12px; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
  .preset-button { padding: 7px 6px; gap: 6px; }
  .preset-button b { font-size: 9px; }
  .preset-button small { font-size: 8px; }
  .preset-mark { width: 18px; height: 18px; flex-basis: 18px; }
  .preset-mark::before { width: 7px; height: 7px; top: 3px; }
  .preset-mark::after { height: 6px; top: 10px; }
  .control-section { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .control-section .section-title-row { grid-column: 1 / -1; }
  .control-section .range-control { min-width: 0; }
  .compact-section { display: block; }
  .compact-section .range-control { max-width: 100%; }
  .science-panel { margin-top: 14px; }
  .stage-topline { top: 15px; left: 15px; right: 15px; }
  .scene-title { font-size: 16px; }
  .scene-subtitle { font-size: 9px; }
  .stage-button { padding: 0 8px; }
  .stage-button span { display: none; }
  .readout-status-row { top: 85px; left: 15px; right: 15px; }
  .readout-grid { top: 125px; left: 15px; width: 196px; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 5px; }
  .readout-card { padding: 6px 7px; }
  .readout-card > span { font-size: 6px; }
  .readout-card em { display: none; }
  .readout-card b { font-size: 14px; }
  .readout-card small { font-size: 7px; }
  .scene-bottom { left: 15px; right: 15px; bottom: 100px; display: block; }
  .legend-row { font-size: 7px; gap: 8px; margin-bottom: 9px; }
  .growth-meter { width: 100%; }
  .bottom-data-strip { min-height: 68px; grid-template-columns: repeat(4, 1fr); padding: 10px 10px 8px; }
  .bottom-data-strip > div { padding: 0 6px; }
  .bottom-data-strip span { font-size: 6px; letter-spacing: .04em; }
  .bottom-data-strip b { font-size: 12px; }
  .bottom-data-strip small { font-size: 7px; margin-left: 2px; }
  .bottom-data-strip .validation-mini { display: none; }
  .annotation { font-size: 6px; }
  .annotation-top { top: 34%; }
  .annotation-wall { top: 52%; }
  .annotation-tip { top: 72%; }
  .mobile-hint { display: block; position: absolute; z-index: 2; right: 14px; bottom: 82px; color: rgba(165, 213, 221, .62); font-size: 6px; letter-spacing: .1em; }
}
@media (max-width: 430px) {
  .brand-name { font-size: 9px; }
  .brand-subtitle { font-size: 7px; }
  .brand-icon { width: 24px; height: 24px; }
  .live-indicator { max-width: 100px; line-height: 1.3; }
  .stage { height: 64vh; min-height: 460px; }
  .scene-title { font-size: 15px; }
  .scene-title-block { max-width: 220px; }
  .readout-grid { width: 178px; }
  .readout-card > span { font-size: 5.5px; }
  .readout-card b { font-size: 13px; }
  .readout-card { background: rgba(5,25,35,.72); }
  .elapsed-chip { padding: 5px 7px; gap: 5px; }
  .elapsed-chip span { font-size: 6px; }
  .elapsed-chip b { font-size: 11px; }
  .status-chip { padding: 6px 8px; font-size: 6px; }
  .legend-row { gap: 6px; font-size: 6px; }
  .bottom-data-strip > div { padding: 0 4px; }
  .bottom-data-strip span { white-space: normal; min-height: 15px; }
  .bottom-data-strip b { font-size: 11px; }
  .control-section { column-gap: 12px; }
  .preset-grid { gap: 4px; }
  .preset-button { flex-direction: column; align-items: flex-start; min-height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
