:root {
  color-scheme: dark;
  --bg: #0b1218;
  --panel: #111c24;
  --panel-2: #15232c;
  --line: #263740;
  --line-soft: rgba(144, 176, 187, .13);
  --text: #e8f0ef;
  --muted: #8fa3a8;
  --dim: #657a80;
  --accent: #63d6c4;
  --accent-deep: #1b8279;
  --warm: #f0b36d;
  --cool: #6bbdd4;
  --danger: #e58d78;
  --grid: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: 68px minmax(0, 1fr) 48px; background: radial-gradient(ellipse at 22% -10%, rgba(59, 112, 113, .13), transparent 44%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line-soft); background: rgba(11, 18, 24, .96); min-width: 0; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(99,214,196,.48); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); background: rgba(99,214,196,.07); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .62; }
.brand-mark span:nth-child(2) { height: 16px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .78; }
.eyebrow { color: #7f9b9f; font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.3; }
h1 { font-size: 16px; letter-spacing: -.025em; font-weight: 650; margin: 3px 0 0; white-space: nowrap; }
h1 span { color: var(--accent); padding: 0 3px; }
.top-meta { display: flex; align-items: center; gap: 9px; color: #9aadb0; font-size: 9px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.live-dot, .clock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(99,214,196,.1); }
.meta-divider, .footer-divider { width: 1px; height: 15px; background: var(--line); margin: 0 5px; }
.seed-label { color: #657d83; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; }
.visual-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) 102px; padding: 16px 16px 14px 20px; gap: 12px; }
.scene-wrap { min-height: 0; position: relative; overflow: hidden; border: 1px solid rgba(112,151,157,.2); border-radius: 14px; background: #0e1a20; box-shadow: inset 0 0 60px rgba(0,0,0,.2), 0 12px 30px rgba(0,0,0,.12); }
#scene { display: block; width: 100%; height: 100%; }
.scene-topline { position: absolute; z-index: 2; top: 14px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-chip { padding: 8px 11px; border: 1px solid rgba(128,164,168,.2); border-radius: 7px; background: rgba(10,20,26,.72); backdrop-filter: blur(8px); color: #b4c7c6; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.chip-icon { color: var(--accent); margin-right: 5px; }
.chip-sep { color: #577077; margin: 0 5px; }
.scene-clock { display: flex; align-items: center; gap: 8px; color: #789196; font-size: 9px; font-weight: 700; letter-spacing: .09em; padding: 8px 10px; border-radius: 7px; background: rgba(10,20,26,.55); }
.clock-dot { width: 5px; height: 5px; }
.scene-legend { position: absolute; bottom: 14px; left: 16px; display: flex; gap: 13px; padding: 8px 10px; border-radius: 7px; background: rgba(10,20,26,.75); color: #9db0b0; font-size: 9px; letter-spacing: .03em; pointer-events: none; }
.scene-legend span { display: flex; align-items: center; gap: 6px; }
.legend-swatch { display: inline-block; width: 7px; height: 7px; border-radius: 2px; }
.legend-swatch.warm { background: var(--warm); }
.legend-swatch.cool { background: var(--cool); }
.legend-line { display: inline-block; width: 12px; border-top: 1px dashed var(--accent); }
.scene-direction { position: absolute; bottom: 15px; right: 16px; padding: 8px 10px; border: 1px solid rgba(99,214,196,.25); border-radius: 7px; background: rgba(10,20,26,.76); color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .1em; pointer-events: none; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-height: 0; }
.readout-card { border: 1px solid var(--line-soft); background: linear-gradient(145deg, rgba(21,35,44,.94), rgba(15,26,33,.94)); border-radius: 10px; padding: 12px 13px 10px; min-width: 0; }
.readout-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #81979b; font-size: 8px; font-weight: 750; letter-spacing: .11em; white-space: nowrap; }
.mini-tag, .illustrative-tag { font-size: 7px; letter-spacing: .1em; font-weight: 800; color: #71918f; border: 1px solid rgba(99,214,196,.16); border-radius: 3px; padding: 2px 4px; }
.readout-value { display: flex; align-items: baseline; gap: 5px; margin-top: 7px; }
.readout-value strong { font-size: clamp(19px, 2vw, 25px); line-height: 1; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }
.readout-value span { color: #9bb0b0; font-size: 10px; }
.readout-foot { margin-top: 6px; color: #687f85; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(18,30,38,.98), rgba(13,23,30,.98)); padding: 20px 18px 16px; scrollbar-width: thin; scrollbar-color: #344b53 transparent; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line-soft); }
.panel-heading h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.035em; font-weight: 640; }
.panel-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--accent); border: 1px solid rgba(99,214,196,.2); border-radius: 8px; font-size: 20px; background: rgba(99,214,196,.06); }
.preset-block { padding: 15px 0 14px; border-bottom: 1px solid var(--line-soft); }
.section-label { display: flex; align-items: center; gap: 8px; color: #8ca2a4; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.illustrative-tag { color: #78928d; border-color: rgba(99,214,196,.13); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.preset-btn { display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; padding: 9px 8px; border-radius: 8px; border: 1px solid #2a3b43; background: #14222a; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-btn:hover { border-color: #4b7778; transform: translateY(-1px); }
.preset-btn.active { border-color: rgba(99,214,196,.58); background: rgba(99,214,196,.08); box-shadow: inset 0 0 0 1px rgba(99,214,196,.08); }
.preset-symbol { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: rgba(240,179,109,.1); color: var(--warm); font-size: 16px; flex: 0 0 auto; }
.wind-symbol { background: rgba(107,189,212,.1); color: var(--cool); }
.preset-btn b { display: block; color: #dbe7e5; font-size: 9px; line-height: 1.35; font-weight: 700; white-space: nowrap; }
.preset-btn small { display: block; color: #71878c; font-size: 8px; margin-top: 2px; white-space: nowrap; }
.controls-list { padding: 14px 0 10px; }
.control-row { margin-top: 11px; }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.control-label label { color: #c5d3d2; font-size: 10px; font-weight: 600; }
.control-value { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 14px; margin: 5px 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, #3e8e86, #35525a); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 8px; background: linear-gradient(90deg, #3e8e86, #35525a); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; border: 2px solid #d9f4ed; background: #4eb7a8; box-shadow: 0 0 0 3px rgba(99,214,196,.12); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #d9f4ed; background: #4eb7a8; box-shadow: 0 0 0 3px rgba(99,214,196,.12); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: #5f747a; font-size: 7px; margin-top: -1px; }
.section-label-spaced { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.balance-card { padding: 12px 12px 10px; border: 1px solid rgba(99,214,196,.16); border-radius: 9px; background: linear-gradient(135deg, rgba(24,49,52,.42), rgba(16,31,38,.68)); }
.balance-top { display: flex; align-items: center; justify-content: space-between; }
.balance-state { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .09em; }
.pressure-bars { display: grid; gap: 8px; margin-top: 11px; }
.pressure-row { display: grid; grid-template-columns: 92px minmax(20px, 1fr) 48px; gap: 7px; align-items: center; color: #91a6a8; font-size: 8px; }
.pressure-row b { color: #cbd9d7; font-size: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { height: 4px; border-radius: 5px; background: #24373e; overflow: hidden; }
.bar-track i { display: block; height: 100%; width: 10%; border-radius: inherit; transition: width .2s ease; }
.stack-bar { background: var(--warm); }
.wind-bar { background: var(--cool); }
.threshold-row { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; padding-top: 9px; border-top: 1px solid rgba(144,176,187,.1); color: #8da2a4; font-size: 8px; }
.threshold-row strong { color: #e2ece9; font-size: 10px; font-variant-numeric: tabular-nums; }
.threshold-note { margin-top: 5px; color: #657e83; font-size: 8px; line-height: 1.4; }
.action-row { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 7px; margin-top: 13px; }
.action { min-height: 34px; border: 1px solid #31464e; border-radius: 7px; background: #172831; color: #c7d7d4; font-size: 9px; font-weight: 700; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.action:hover { background: #203841; border-color: #54757a; transform: translateY(-1px); }
.action:focus-visible, .preset-btn:focus-visible, .text-action:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.action.primary { border-color: rgba(99,214,196,.5); background: linear-gradient(135deg, #267e75, #1d625e); color: #f0fffb; }
.action.primary:hover { background: linear-gradient(135deg, #32968b, #24736c); }
.action.primary span:first-child { font-size: 11px; margin-right: 5px; }
.icon-action { font-size: 18px; line-height: 1; }
.utility-row { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
.text-action { border: 0; background: transparent; color: #70878b; padding: 5px 0; font-size: 8px; font-weight: 800; letter-spacing: .09em; cursor: pointer; }
.text-action b { color: #b7c9c5; margin-left: 4px; }
.text-action:hover { color: var(--accent); }
.science-panel { margin-top: 12px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 12px 0; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: rgba(99,214,196,.08); color: var(--accent); font-size: 15px; }
.science-panel summary b { display: block; color: #cbd9d7; font-size: 10px; }
.science-panel summary small { display: block; color: #71868b; font-size: 8px; margin-top: 2px; }
.summary-chevron { margin-left: auto; color: #769096; font-size: 15px; transition: transform .18s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 0 14px; color: #91a7a8; font-size: 9px; line-height: 1.55; }
.science-intro { color: #a8bab8; margin: 0 0 10px; }
.equation-card, .audit-card { border: 1px solid rgba(144,176,187,.12); border-radius: 7px; padding: 9px 10px; margin-top: 7px; background: rgba(9,19,24,.38); }
.equation-title { display: flex; justify-content: space-between; gap: 6px; color: #b6c9c5; font-size: 8px; font-weight: 750; }
.equation-title span { color: #71928d; font-size: 7px; letter-spacing: .08em; }
.equation { margin: 8px 0 6px; color: #e0efea; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.equation-card p, .audit-card p { margin: 0; color: #789095; font-size: 8px; }
.audit-heading { color: #7d9d98; font-size: 7px; font-weight: 800; letter-spacing: .12em; margin-bottom: 7px; }
.audit-values, .audit-difference { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; font-size: 8px; color: #8da3a3; }
.audit-values b { color: #d9e6e2; font-size: 9px; font-variant-numeric: tabular-nums; }
.audit-difference { border-top: 1px solid rgba(144,176,187,.1); padding-top: 6px; margin-top: 8px; }
.audit-difference strong { color: var(--accent); font-size: 10px; }
.audit-card p { margin-top: 7px; }
.simplifications { margin-top: 10px; color: #a9b9b7; }
.simplifications b { color: #c7d6d3; font-size: 9px; }
.simplifications ul { margin: 5px 0 0; padding-left: 15px; color: #7e9699; }
.simplifications li { margin: 4px 0; }
.disclaimer { color: #60787e; font-size: 8px; margin: 12px 0 0; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.footerbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 0 22px; border-top: 1px solid var(--line-soft); background: #0d171d; }
.state-caption { display: flex; align-items: center; gap: 9px; color: #9db1ae; font-size: 9px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caption-pip { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(99,214,196,.08); }
.footer-right { display: flex; align-items: center; gap: 9px; color: #62787d; font-size: 7px; font-weight: 750; letter-spacing: .1em; white-space: nowrap; }
.footer-right b { color: #a9bbb8; font-weight: 800; }
button:disabled { opacity: .45; cursor: default; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .visual-column { padding-left: 14px; }
  .control-panel { padding-left: 15px; padding-right: 15px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-rows: 56px minmax(0, 1fr) 40px; }
  .topbar { padding: 0 12px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 27px; height: 27px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 13px; }
  .top-meta { gap: 6px; font-size: 7px; }
  .meta-divider { margin: 0 2px; }
  .seed-label { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(250px, 39dvh) minmax(0, 1fr); }
  .visual-column { padding: 9px 9px 8px; gap: 7px; grid-template-rows: minmax(0, 1fr) 72px; }
  .scene-wrap { border-radius: 10px; }
  .scene-topline { top: 8px; left: 9px; right: 9px; }
  .scene-chip, .scene-clock { padding: 6px 7px; font-size: 7px; }
  .scene-legend { bottom: 8px; left: 9px; padding: 6px 7px; gap: 8px; font-size: 7px; }
  .scene-direction { bottom: 8px; right: 9px; padding: 6px 7px; font-size: 7px; }
  .readout-grid { gap: 5px; }
  .readout-card { padding: 8px 7px 6px; border-radius: 7px; }
  .readout-head { font-size: 6px; letter-spacing: .06em; }
  .mini-tag { font-size: 5px; padding: 1px 2px; }
  .readout-value { margin-top: 6px; gap: 3px; }
  .readout-value strong { font-size: clamp(16px, 5vw, 21px); }
  .readout-value span { font-size: 8px; }
  .readout-foot { margin-top: 4px; font-size: 6px; }
  .control-panel { border-left: 0; border-top: 1px solid var(--line-soft); padding: 12px 13px 16px; }
  .panel-heading { padding-bottom: 10px; }
  .panel-heading h2 { font-size: 15px; }
  .panel-icon { width: 27px; height: 27px; }
  .preset-block { padding: 10px 0; }
  .preset-btn { padding: 7px; }
  .preset-btn b { font-size: 8px; }
  .preset-btn small { font-size: 7px; }
  .preset-symbol { width: 21px; height: 21px; }
  .controls-list { padding: 10px 0 8px; }
  .control-row { margin-top: 9px; }
  .control-label label, .control-value { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .balance-card { padding: 10px; }
  .action-row { margin-top: 10px; }
  .science-panel { margin-top: 9px; }
  .footerbar { padding: 0 10px; }
  .state-caption { font-size: 7px; gap: 7px; }
  .footer-right { font-size: 6px; gap: 6px; }
  .footer-right span:first-child { display: none; }
  .footer-divider { display: none; }
}
@media (max-width: 390px) {
  .workspace { grid-template-rows: minmax(238px, 37dvh) minmax(0, 1fr); }
  .scene-legend { gap: 6px; }
  .scene-legend span { gap: 4px; }
  .scene-direction { font-size: 6px; }
  .readout-head { font-size: 5.5px; }
  .readout-foot { font-size: 5.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
