:root {
  color-scheme: dark;
  --bg: #06111c;
  --panel: #0a1926;
  --panel-2: #0c1d2c;
  --panel-3: #102638;
  --line: rgba(147, 184, 204, .13);
  --line-strong: rgba(147, 184, 204, .22);
  --text: #e8f2f5;
  --muted: #8aa2b2;
  --subtle: #5d7485;
  --teal: #5ee0d1;
  --cyan: #75cde9;
  --amber: #f3c37b;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(ellipse at 20% -15%, #112d3b 0%, transparent 42%), var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; letter-spacing: .01em; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.app { max-width: 1720px; margin: 0 auto; padding: 0 26px 18px; }
.topbar { height: 66px; 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: 27px; height: 27px; border: 1px solid rgba(94,224,209,.5); border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-8deg); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--teal); transform: skewY(-24deg); }
.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: .72; }
.eyebrow, .section-kicker { color: #82a1b3; font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.5; }
.eyebrow-divider { color: #496577; padding: 0 5px; }
.brand-name { margin-top: 2px; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.brand-version { color: var(--teal); font-size: 9px; margin-left: 8px; font-weight: 700; }
.topbar-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; letter-spacing: .12em; font-weight: 700; }
.live-dot, .scene-id-dot, .clock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(94,224,209,.7); }
.topbar-seed { border-left: 1px solid var(--line-strong); margin-left: 7px; padding-left: 15px; color: #647f90; font-variant-numeric: tabular-nums; }
.intro-row { display: flex; align-items: end; justify-content: space-between; padding: 23px 0 18px; gap: 18px; }
.section-kicker span { color: var(--teal); padding: 0 4px; }
h1 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.045em; line-height: 1; margin: 7px 0 7px; font-weight: 720; }
h1 em { color: var(--teal); font-style: normal; font-weight: 450; }
.intro-copy { margin: 0; color: #91a8b7; font-size: 12px; line-height: 1.5; }
.intro-tags { display: flex; gap: 7px; padding-bottom: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tag { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 4px; color: #91a7b5; font-size: 8px; letter-spacing: .1em; font-weight: 750; white-space: nowrap; }
.tag-teal { color: var(--teal); border-color: rgba(94,224,209,.28); background: rgba(94,224,209,.06); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 358px; gap: 14px; align-items: start; }
.scene-panel, .control-panel { min-width: 0; background: linear-gradient(180deg, rgba(12,29,44,.98), rgba(8,22,34,.98)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.17); }
.scene-topline { height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); }
.scene-id { display: flex; align-items: center; gap: 8px; color: #b3c8d1; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.scene-id-dot { width: 5px; height: 5px; }
.scene-id-muted { color: #526d7e; }
.scene-tools { display: flex; align-items: center; gap: 7px; }
.scale-chip { color: #668396; border: 1px solid var(--line); border-radius: 3px; padding: 5px 7px; font-size: 8px; letter-spacing: .12em; font-weight: 750; margin-right: 4px; }
.icon-button { width: 27px; height: 27px; border: 1px solid var(--line-strong); border-radius: 5px; background: rgba(255,255,255,.025); display: grid; place-items: center; cursor: pointer; color: #9cb5c3; transition: border-color .18s, color .18s, background .18s; }
.icon-button:hover { border-color: rgba(94,224,209,.45); color: var(--teal); background: rgba(94,224,209,.07); }
.icon-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scene-viewport { height: clamp(410px, calc(100vh - 270px), 650px); min-height: 410px; position: relative; overflow: hidden; background: radial-gradient(ellipse at 48% 48%, #10354b 0%, #081c2b 57%, #06121f 100%); }
#scene-canvas { 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(3,13,22,.28), transparent 24%, transparent 75%, rgba(3,13,22,.25)), linear-gradient(0deg, rgba(4,14,23,.48), transparent 30%, transparent 75%, rgba(4,14,23,.18)); }
.scene-annotations { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.annotation { position: absolute; display: flex; align-items: center; gap: 7px; color: rgba(199,225,232,.78); font-size: 8px; line-height: 1.45; letter-spacing: .12em; font-weight: 750; text-shadow: 0 1px 6px #03101a; white-space: nowrap; transition: opacity .2s; }
.annotation b { color: #f0f8f7; font-size: 9px; letter-spacing: .14em; }
.annotation-line { width: 24px; height: 1px; background: var(--teal); box-shadow: 0 0 7px rgba(94,224,209,.6); }
.annotation-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px currentColor; }
.annotation-dot.down { background: #f2c17a; color: #f2c17a; }
.annotation-dot.up { background: #69d6e8; color: #69d6e8; }
.scene-legend { position: absolute; bottom: 13px; left: 14px; display: flex; flex-wrap: wrap; gap: 12px; pointer-events: none; }
.legend-item { display: flex; align-items: center; gap: 6px; color: #90a9b6; font-size: 8px; letter-spacing: .045em; text-shadow: 0 1px 5px #04101b; }
.legend-swatch { width: 13px; height: 3px; border-radius: 3px; }
.swatch-flow { background: #4fd7c8; box-shadow: 0 0 8px rgba(79,215,200,.55); }
.swatch-tracer { background: #75cde9; }
.swatch-foam { background: #e6f3ee; }
.scene-status { position: absolute; right: 13px; bottom: 13px; display: flex; align-items: center; gap: 7px; color: #7493a5; font-size: 8px; font-weight: 700; letter-spacing: .12em; background: rgba(4,16,26,.58); border: 1px solid rgba(135,174,193,.13); border-radius: 4px; padding: 6px 8px; pointer-events: none; }
.status-pulse { width: 5px; height: 5px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 8px var(--teal); }
.context-overlay { position: absolute; inset: 0; background: rgba(4,14,24,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; color: #a6bdc9; z-index: 5; }
.context-overlay[hidden] { display: none; }
.context-overlay strong { color: var(--text); font-size: 14px; }
.context-overlay span { max-width: 300px; font-size: 11px; line-height: 1.6; }
.context-icon { color: var(--teal); font-size: 28px; }
.scene-footer { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border-top: 1px solid var(--line); background: rgba(4,14,23,.4); }
.transport-controls { display: flex; gap: 6px; }
.transport-button { height: 29px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: rgba(255,255,255,.025); color: #a7bac5; font-size: 8px; letter-spacing: .1em; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: .18s; }
.transport-button:hover { color: var(--teal); border-color: rgba(94,224,209,.38); }
.transport-button.primary { color: #041a20; background: var(--teal); border-color: var(--teal); min-width: 82px; justify-content: center; }
.transport-button.primary:hover { background: #83eee0; }
.play-icon { font-size: 12px; line-height: 1; }
.keycap { font-size: 9px; color: #648596; border: 1px solid var(--line-strong); border-radius: 3px; padding: 1px 4px; }
.time-control { display: flex; align-items: center; gap: 8px; min-width: 165px; }
.time-control label { color: #718b9b; font-size: 8px; font-weight: 800; letter-spacing: .11em; white-space: nowrap; }
.time-control input { width: 74px; }
.time-control output { color: var(--teal); font-size: 10px; font-variant-numeric: tabular-nums; min-width: 34px; }
.sim-clock { display: flex; align-items: center; gap: 7px; color: #b5c8d1; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-dot { width: 5px; height: 5px; }
.clock-label { color: #607b8c; font-size: 8px; letter-spacing: .11em; margin-left: 1px; }
.control-panel { max-height: calc(100vh - 215px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #254355 transparent; }
.control-panel::-webkit-scrollbar { width: 5px; }
.control-panel::-webkit-scrollbar-thumb { background: #254355; border-radius: 4px; }
.panel-section { padding: 14px 15px; border-bottom: 1px solid var(--line); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.panel-heading h2 { font-size: 14px; margin: 3px 0 0; letter-spacing: -.02em; font-weight: 650; }
.panel-index { color: #4f6c7f; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.preset-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 14px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px 6px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.018); text-align: left; cursor: pointer; transition: border-color .18s, background .18s; }
.preset-button:hover { border-color: rgba(94,224,209,.32); }
.preset-button.active { border-color: rgba(94,224,209,.5); background: rgba(94,224,209,.075); }
.preset-glyph { flex: 0 0 23px; height: 23px; display: grid; place-items: center; border-radius: 4px; background: rgba(94,224,209,.09); color: var(--teal); font-size: 17px; }
.strong-glyph { color: var(--amber); background: rgba(243,195,123,.09); }
.preset-button b { display: block; font-size: 9px; line-height: 1.3; white-space: nowrap; }
.preset-button small { display: block; margin-top: 2px; color: #728c9b; font-size: 7px; white-space: nowrap; }
.control-list { display: grid; gap: 10px; }
.control-row { display: grid; gap: 5px; }
.control-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-label label { color: #b5c6ce; font-size: 10px; }
.control-label output { color: #e0edf0; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.control-label output small { color: #7792a1; font-size: 8px; font-weight: 500; }
input[type="range"] { appearance: none; width: 100%; height: 13px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(94,224,209,.62), rgba(94,224,209,.16)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(94,224,209,.62), rgba(94,224,209,.16)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #d8f7f1; border: 2px solid #42cbbb; margin-top: -4px; box-shadow: 0 0 0 3px rgba(94,224,209,.08); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: #d8f7f1; border: 2px solid #42cbbb; box-shadow: 0 0 0 3px rgba(94,224,209,.08); }
.metrics-section { padding-bottom: 12px; }
.unit-note { color: #668294; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.metric-card { min-width: 0; border: 1px solid var(--line); background: rgba(255,255,255,.018); border-radius: 5px; padding: 9px 9px 8px; }
.metric-highlight { border-color: rgba(94,224,209,.24); background: linear-gradient(135deg, rgba(94,224,209,.07), rgba(255,255,255,.012)); }
.metric-name { color: #7691a1; font-size: 7px; letter-spacing: .11em; font-weight: 800; display: block; white-space: nowrap; }
.metric-value { color: #e7f3f4; font-size: 18px; font-weight: 650; letter-spacing: -.035em; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-highlight .metric-value { color: var(--teal); }
.metric-value small { font-size: 9px; color: #83a0ad; font-weight: 500; letter-spacing: 0; }
.metric-foot { color: #5f7a8b; font-size: 8px; margin-top: 3px; }
.ratio-line { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px 0; color: #718c9d; font-size: 8px; letter-spacing: .1em; font-weight: 750; }
.ratio-line b { color: #b6cbd3; font-size: 10px; font-variant-numeric: tabular-nums; }
.validation-section { padding-top: 13px; padding-bottom: 12px; }
.validation-check { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: rgba(94,224,209,.12); color: var(--teal); font-size: 11px; }
.validation-copy { color: #819aa8; font-size: 9px; margin: -4px 0 10px; line-height: 1.45; }
.validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.validation-grid > div { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 4px; padding: 7px 8px; }
.validation-grid span, .validation-result span { display: block; color: #668294; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.validation-grid b { display: block; color: #dcebed; font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.validation-grid small { color: #829dab; font-size: 8px; font-weight: 500; }
.validation-result { display: flex; align-items: center; justify-content: space-between; padding: 8px 1px 4px; }
.validation-result strong { color: var(--teal); font-size: 12px; font-variant-numeric: tabular-nums; }
.validation-labels { display: flex; justify-content: space-between; color: #536f80; font-size: 6px; letter-spacing: .1em; }
.tools-section { padding-top: 12px; padding-bottom: 12px; }
.tools-section .panel-heading { margin-bottom: 7px; }
.setting-row { min-height: 29px; display: flex; justify-content: space-between; align-items: center; color: #9ab0bc; font-size: 9px; }
.segmented { display: flex; border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px; gap: 2px; }
.segmented button { border: 0; background: transparent; color: #728d9d; font-size: 7px; font-weight: 800; letter-spacing: .1em; border-radius: 3px; padding: 4px 8px; cursor: pointer; }
.segmented button.selected { background: rgba(94,224,209,.14); color: var(--teal); }
.text-button { border: 0; background: transparent; color: var(--teal); font-size: 9px; cursor: pointer; padding: 5px; }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; padding: 13px 15px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; margin-top: 3px; font-size: 12px; font-weight: 650; }
.details-plus { width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 4px; display: grid; place-items: center; color: var(--teal); font-size: 15px; transition: transform .2s; }
.science-panel[open] .details-plus { transform: rotate(45deg); }
.science-content { padding: 0 15px 15px; }
.science-lead { color: #a6bbc5; font-size: 10px; line-height: 1.6; margin: 0 0 11px; }
.equation-block { border: 1px solid var(--line); border-radius: 4px; padding: 8px; margin-bottom: 6px; background: rgba(255,255,255,.018); }
.equation-label { color: var(--teal); font-size: 7px; letter-spacing: .12em; font-weight: 800; display: block; margin-bottom: 5px; }
.equation-block code { color: #e3f0f0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.equation-block small { display: block; color: #809aa8; font-size: 8px; margin-top: 4px; line-height: 1.4; }
.science-subhead { color: #c6d8de; font-size: 9px; font-weight: 800; margin: 12px 0 6px; }
.science-list { padding-left: 15px; margin: 0; color: #829aa8; font-size: 9px; line-height: 1.6; }
.science-list li { margin: 4px 0; }
.science-list b { color: #c5d9df; }
.model-disclaimer { border-left: 2px solid var(--teal); padding: 6px 8px; margin-top: 12px; background: rgba(94,224,209,.05); color: #8eacb6; font-size: 8px; line-height: 1.5; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; color: #4f6b7c; font-size: 7px; letter-spacing: .12em; font-weight: 750; padding: 13px 2px 0; }
.page-footer i { color: var(--teal); font-style: normal; padding: 0 4px; }
.page-footer b { color: var(--teal); padding: 0 3px; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 390px; } .scene-viewport { height: min(68vh, 760px); } }
@media (max-width: 1050px) { .app { padding-left: 16px; padding-right: 16px; } .workspace { grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; } .scene-footer { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; } .time-control { min-width: 145px; } .sim-clock { margin-left: auto; } .control-panel { max-height: calc(100vh - 210px); } }
@media (max-width: 760px) {
  .app { padding: 0 10px 14px; }
  .topbar { height: 56px; }
  .topbar-meta { font-size: 7px; gap: 6px; }
  .topbar-meta > span:nth-child(2) { display: none; }
  .topbar-seed { padding-left: 8px; margin-left: 2px; }
  .brand-name { font-size: 10px; }
  .intro-row { padding: 17px 0 13px; display: block; }
  h1 { font-size: 29px; }
  .intro-copy { max-width: 520px; font-size: 11px; }
  .intro-tags { justify-content: flex-start; padding-top: 10px; }
  .workspace { display: flex; flex-direction: column; gap: 10px; }
  .scene-panel, .control-panel { width: 100%; }
  .scene-viewport { height: min(53vh, 480px); min-height: 320px; }
  .scene-topline { height: 38px; padding: 0 10px; }
  .scene-id { font-size: 8px; }
  .scene-footer { gap: 8px; min-height: 55px; padding: 7px 9px; }
  .transport-button { padding: 0 8px; }
  .time-control { order: 3; flex: 1 1 100%; min-width: 0; }
  .time-control input { flex: 1; width: auto; }
  .sim-clock { margin-left: auto; }
  .control-panel { max-height: none; overflow: visible; }
  .panel-section { padding: 14px; }
  .control-list { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 12px; }
  .control-row:nth-child(1), .control-row:nth-child(2) { grid-column: span 1; }
  .metric-value { font-size: 19px; }
  .page-footer { flex-wrap: wrap; line-height: 1.6; }
  .page-footer span:nth-child(2) { order: 3; flex-basis: 100%; }
  .annotation { font-size: 7px; }
  .annotation b { font-size: 8px; }
  .scene-legend { gap: 8px; left: 9px; bottom: 9px; }
  .legend-item { font-size: 7px; }
  .scene-status { right: 8px; bottom: 8px; font-size: 7px; }
}
@media (max-width: 390px) {
  .topbar-meta { display: none; }
  .scene-viewport { min-height: 300px; }
  .scale-chip { display: none; }
  .control-list { grid-template-columns: 1fr; }
  .preset-button { gap: 4px; padding: 6px 4px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .metric-name { font-size: 6.5px; }
  .scene-legend { flex-direction: column; gap: 5px; }
  .scene-status { 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 .intro-row, body.embed-mode .page-footer { display: none; }
body.embed-mode .app { padding-top: 8px; }
body.embed-mode .workspace { min-height: 100vh; }
body.embed-mode .scene-viewport { height: calc(100vh - 110px); }
@media (max-width: 760px) { body.embed-mode .workspace { min-height: 0; } body.embed-mode .scene-viewport { height: 52vh; min-height: 280px; } }
