:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111a23;
  --panel-2: #15212b;
  --line: rgba(172, 197, 211, .13);
  --line-strong: rgba(172, 197, 211, .22);
  --text: #e9f0f3;
  --muted: #91a1ab;
  --quiet: #63737e;
  --accent: #74e0d2;
  --accent-dim: rgba(116, 224, 210, .14);
  --sand: #c4a477;
  --sand-dark: #8e7657;
  --radius: 16px;
  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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: 76px minmax(0, 1fr); overflow: hidden; background: radial-gradient(ellipse at 38% 0%, rgba(49, 82, 91, .16), transparent 46%), var(--bg); }
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid rgba(116,224,210,.36); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; background: rgba(116,224,210,.06); transform: rotate(-7deg); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); opacity: .9; }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; }
.heading-block { min-width: 0; }
.eyebrow, .section-kicker, .subsection-label, .readout-label, .clock-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.35; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
h1 { margin: 3px 0 0; font-size: 20px; line-height: 1.1; font-weight: 650; letter-spacing: -.035em; }
.subtitle { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.2; }
.top-status { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #a9b7bf; font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(116,224,210,.7); }
.status-separator { color: #4d5d68; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding: 16px 20px 18px; min-height: 0; }
.visual-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 12px; }
.stage-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid rgba(170,195,207,.15); border-radius: 18px; background: #0d1720; box-shadow: 0 16px 40px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.025); }
#scene { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.stage-topline, .stage-bottomline { position: absolute; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.stage-topline { top: 14px; }
.stage-kicker, .stage-mode { color: rgba(205,220,226,.72); font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.stage-kicker { display: flex; align-items: center; gap: 8px; }
.stage-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(116,224,210,.6); }
.stage-mode { padding: 6px 8px; border: 1px solid rgba(116,224,210,.18); border-radius: 6px; background: rgba(10,22,29,.52); color: var(--accent); font-size: 8px; }
.stage-bottomline { bottom: 12px; justify-content: flex-start; gap: 16px; color: rgba(190,205,211,.72); font-size: 9px; }
.stage-bottomline span { display: flex; align-items: center; gap: 6px; }
.legend-grain, .legend-field { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-grain { background: var(--sand); }
.legend-field { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.vertical-note { margin-left: auto; color: rgba(146,165,174,.55); font-size: 8px; letter-spacing: .12em; }
.caption-row { min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(17,26,35,.72); }
.caption-symbol { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(116,224,210,.24); border-radius: 9px; color: var(--accent); background: var(--accent-dim); font-size: 18px; }
.caption-copy { min-width: 0; }
.caption-copy .section-kicker { font-size: 8px; }
.caption-copy p { margin: 4px 0 0; color: #c0ccd1; font-size: 11px; line-height: 1.4; }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 10px 12px 9px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, rgba(20,31,41,.95), rgba(15,24,32,.9)); }
.readout-label { font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.readout-value { margin-top: 6px; color: #e9f3f4; font-size: clamp(17px, 1.75vw, 22px); line-height: 1; font-weight: 620; letter-spacing: -.04em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.readout-value small { color: #9eb0b8; font-size: 9px; font-weight: 550; letter-spacing: 0; }
.readout-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--quiet); font-size: 8px; letter-spacing: .06em; }
.readout-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .8; }
.controls-panel { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #34434d transparent; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(160deg, rgba(19,29,39,.98), rgba(14,22,30,.98)); }
.controls-panel::-webkit-scrollbar { width: 5px; }
.controls-panel::-webkit-scrollbar-thumb { background: #34434d; border-radius: 8px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 16px; line-height: 1.15; font-weight: 620; letter-spacing: -.025em; }
.quality-button { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: #17242e; color: #c5d1d6; font-size: 8px; font-weight: 800; letter-spacing: .12em; cursor: pointer; }
.quality-indicator { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px rgba(116,224,210,.6); }
.preset-block { margin-top: 18px; }
.subsection-label { font-size: 8px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.preset-button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px; text-align: left; background: rgba(255,255,255,.018); cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.preset-button:hover { border-color: rgba(116,224,210,.35); transform: translateY(-1px); }
.preset-button.active { border-color: rgba(116,224,210,.42); background: rgba(116,224,210,.075); }
.preset-icon { flex: 0 0 25px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: rgba(116,224,210,.1); color: var(--accent); font-size: 15px; }
.humid-icon { background: rgba(137,164,178,.12); color: #a6bac5; }
.preset-button b { display: block; color: #dce6e9; font-size: 9px; font-weight: 650; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.control-list { display: grid; gap: 14px; margin-top: 18px; }
.control-item { min-width: 0; }
.control-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.control-heading label { color: #cbd6da; font-size: 10px; font-weight: 560; }
.control-heading output { color: var(--accent); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 7px 0 0; padding: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(116,224,210,.55), rgba(104,130,144,.3)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(116,224,210,.55), rgba(104,130,144,.3)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #0e1a21; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(116,224,210,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #0e1a21; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(116,224,210,.12); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 5px; }
.range-ends { display: flex; justify-content: space-between; color: #667780; font-size: 8px; }
.transport-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 17px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sim-clock { min-width: 0; }
.clock-label { display: block; font-size: 8px; }
.sim-clock strong { display: inline-block; margin-top: 3px; color: #e4eff0; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sim-clock small { display: block; margin-top: 2px; color: var(--quiet); font-size: 8px; }
.transport-buttons { display: flex; align-items: center; gap: 5px; }
.transport-main, .icon-button { height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 8px; background: #1a2933; color: #d8e5e7; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.transport-main { gap: 7px; padding: 0 11px; border-color: rgba(116,224,210,.35); background: rgba(116,224,210,.12); color: var(--accent); font-size: 10px; font-weight: 700; }
.transport-main:hover, .icon-button:hover { border-color: rgba(116,224,210,.55); background: rgba(116,224,210,.16); }
.play-icon { font-size: 11px; }
.icon-button { width: 34px; font-size: 17px; }
.screenshot-button { font-size: 14px; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; color: #c6d3d8; font-size: 9px; font-weight: 750; letter-spacing: .14em; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-mark { color: var(--accent); font-size: 16px; font-weight: 400; transition: transform .2s ease; }
.science-panel[open] .summary-mark { transform: rotate(45deg); }
.science-content { padding: 0 12px 12px; color: #aebdc4; font-size: 9px; line-height: 1.5; }
.science-content h3 { margin: 8px 0 4px; color: #dce7e9; font-size: 10px; font-weight: 650; }
.science-content p { margin: 5px 0 8px; }
.equation { margin: 5px 0; padding: 7px 8px; border-left: 2px solid rgba(116,224,210,.55); border-radius: 0 6px 6px 0; background: rgba(116,224,210,.045); color: #d0e3e3; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.science-note { color: #8fa1aa; }
.audit-box { margin-top: 10px; padding: 9px; border: 1px solid rgba(116,224,210,.19); border-radius: 8px; background: rgba(116,224,210,.045); }
.audit-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #c7d8dc; font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.audit-tag { padding: 3px 5px; border-radius: 4px; background: rgba(116,224,210,.12); color: var(--accent); font-size: 7px; }
.audit-box p { margin: 8px 0 5px; color: #9eb0b8; font-size: 8px; }
.audit-box p b { color: #e3eeee; font-variant-numeric: tabular-nums; }
.audit-divider { margin: 0 4px; color: #647680; }
.audit-result { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px solid rgba(116,224,210,.12); color: #8fa2aa; font-size: 8px; }
.audit-result strong { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; }
.audit-box small { display: block; margin-top: 6px; color: #70838c; font-size: 7px; }
.disclaimer { margin: 10px 0 0; color: #748791; font-size: 8px; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 820px) {
  .app-shell { grid-template-rows: 64px minmax(0,1fr); }
  .topbar { gap: 11px; padding: 8px 14px; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  h1 { font-size: 17px; }
  .subtitle { font-size: 9px; }
  .top-status { gap: 6px; font-size: 7px; letter-spacing: .09em; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1.04fr) minmax(0,.96fr); gap: 10px; padding: 10px; }
  .visual-column { gap: 8px; }
  .stage-wrap { border-radius: 13px; }
  .stage-topline { left: 10px; right: 10px; top: 9px; }
  .stage-kicker { font-size: 7px; }
  .stage-mode { padding: 5px 6px; font-size: 7px; }
  .stage-bottomline { left: 10px; right: 10px; bottom: 8px; gap: 10px; font-size: 7px; }
  .vertical-note { font-size: 6px; }
  .caption-row { min-height: 50px; gap: 8px; padding: 7px 9px; border-radius: 10px; }
  .caption-symbol { width: 26px; height: 26px; flex-basis: 26px; font-size: 15px; }
  .caption-copy .section-kicker { font-size: 7px; }
  .caption-copy p { margin-top: 2px; font-size: 9px; line-height: 1.25; }
  .readouts { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .readout-card { padding: 7px 7px 6px; border-radius: 8px; }
  .readout-label { font-size: 6px; letter-spacing: .08em; }
  .readout-value { margin-top: 5px; font-size: clamp(13px, 4vw, 18px); }
  .readout-value small { font-size: 7px; }
  .readout-foot { margin-top: 5px; font-size: 6px; }
  .controls-panel { padding: 12px; border-radius: 12px; }
  .panel-heading h2 { font-size: 14px; }
  .preset-block { margin-top: 12px; }
  .control-list { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 10px; margin-top: 12px; }
  .control-heading label, .control-heading output { font-size: 9px; }
  .transport-row { margin-top: 12px; padding: 8px 0; }
  .science-panel { margin-top: 9px; }
}
@media (max-width: 420px) {
  .top-status { font-size: 6px; gap: 5px; }
  .subtitle { max-width: 210px; }
  .stage-bottomline { gap: 7px; }
  .vertical-note { display: none !important; }
  .readout-label { white-space: normal; min-height: 14px; }
  .control-list { column-gap: 10px; }
  .preset-button { gap: 6px; padding: 7px 6px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .transport-main { padding: 0 8px; }
  .icon-button { width: 30px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.constant-line { margin-top: 8px !important; color: #8fa1aa; }
.number-tag { display: inline-block; margin-left: 3px; color: var(--accent); font-size: 7px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
