:root {
  color-scheme: dark;
  --bg: #071219;
  --panel: #0b1b24;
  --panel-2: #0e222c;
  --panel-3: #112a34;
  --line: rgba(172, 216, 213, .13);
  --line-strong: rgba(172, 216, 213, .22);
  --text: #e8f1ef;
  --muted: #8fa6a7;
  --dim: #607b7e;
  --accent: #79e2c0;
  --accent-deep: #2d9d8a;
  --warn: #e5c68b;
  --radius: 15px;
  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 { min-height: 100vh; overflow-x: hidden; background: radial-gradient(ellipse at 16% 0%, rgba(37, 93, 91, .18), transparent 38%), var(--bg); }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1600px, 100%); min-height: 100vh; margin: 0 auto; padding: 19px 24px 12px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 12px; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
.topbar { min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .19em; }
.eyebrow-line { width: 19px; height: 1px; background: var(--accent); display: inline-block; }
h1 { margin: 6px 0 1px; font-size: clamp(25px, 2.5vw, 34px); line-height: 1.05; letter-spacing: -.045em; font-weight: 640; }
.subtitle { margin: 4px 0 0; color: #9db2b2; font-size: 12px; letter-spacing: .01em; }
.header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-right: 2px; }
.live-chip { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(121,226,192,.22); border-radius: 99px; background: rgba(29,91,81,.17); color: #b4ead8; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 11px rgba(121,226,192,.8); }
.seed-line { color: var(--dim); font-size: 9px; letter-spacing: .13em; }
.seed-line span { color: var(--accent); padding: 0 4px; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 13px; }
.visual-panel, .control-panel { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(14,34,44,.98), rgba(8,24,32,.98)); overflow: hidden; }
.visual-panel { display: flex; flex-direction: column; padding: 13px; }
.visual-topline { height: 22px; flex: 0 0 22px; display: flex; align-items: flex-start; justify-content: space-between; color: #9bb1b1; font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.visual-topline i { color: var(--accent); font-style: normal; padding: 0 4px; }
.state-pill { border: 1px solid rgba(121,226,192,.2); border-radius: 99px; padding: 4px 8px; margin-top: -3px; color: var(--accent); font-size: 8px; letter-spacing: .12em; }
.state-pill.quiet { color: var(--muted); border-color: var(--line-strong); }
.canvas-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; border-radius: 11px; background: radial-gradient(ellipse at 50% 48%, #102e37 0%, #0a2029 53%, #081821 100%); border: 1px solid rgba(155,205,198,.08); }
#fieldCanvas { display: block; width: 100%; height: 100%; }
.canvas-top-label { position: absolute; top: 13px; left: 15px; pointer-events: none; color: #c3d8d3; font-size: 8px; font-weight: 750; letter-spacing: .15em; }
.label-mark { display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(121,226,192,.6); }
.label-muted { color: #648a8b; font-weight: 500; letter-spacing: .04em; margin-left: 5px; }
.field-legend { position: absolute; top: 12px; right: 14px; display: flex; align-items: center; gap: 7px; color: #789496; font-size: 7px; font-weight: 750; letter-spacing: .13em; pointer-events: none; }
.legend-ramp { width: 52px; height: 4px; border-radius: 5px; background: linear-gradient(90deg, #173a45, #267f7a, #79e2c0, #e8f4d8); }
.canvas-caption { position: absolute; left: 14px; right: 14px; bottom: 31px; padding: 9px 12px; border: 1px solid rgba(174,219,209,.12); border-radius: 8px; background: rgba(5,18,24,.72); backdrop-filter: blur(7px); color: #c3d5d1; font-size: 10px; line-height: 1.4; pointer-events: none; }
.canvas-scale { position: absolute; right: 14px; bottom: 11px; color: #587779; font-size: 7px; font-weight: 700; letter-spacing: .14em; pointer-events: none; }
.canvas-scale span { color: var(--accent); padding: 0 4px; }
.transport-bar { flex: 0 0 43px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.transport-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.control-button { min-height: 31px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(255,255,255,.025); color: #a9bfbc; cursor: pointer; font-size: 10px; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.control-button:hover { border-color: rgba(121,226,192,.48); color: var(--text); background: rgba(121,226,192,.07); }
.control-button:active { transform: translateY(1px); }
.primary-button { border-color: rgba(121,226,192,.4); background: rgba(52,145,124,.17); color: #c7f0e0; }
.button-symbol { color: var(--accent); font-size: 13px; line-height: 1; }
.quality-control { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 8px; font-weight: 750; letter-spacing: .13em; white-space: nowrap; }
.quality-button { min-width: 43px; height: 27px; border: 1px solid rgba(121,226,192,.3); border-radius: 6px; background: rgba(121,226,192,.09); color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .08em; cursor: pointer; }
.control-panel { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #23424a transparent; }
.panel-heading, .readout-heading { display: flex; align-items: center; justify-content: space-between; color: #b7c9c5; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.panel-count { color: #607b7e; font-size: 8px; letter-spacing: .1em; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-height: 43px; padding: 7px 9px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); text-align: left; cursor: pointer; }
.preset-button span { color: #a9bcba; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.preset-button small { color: #668184; font-size: 8px; }
.preset-button.active { border-color: rgba(121,226,192,.43); background: rgba(42,126,109,.15); }
.preset-button.active span { color: var(--accent); }
.preset-button.active small { color: #91c9b7; }
.sliders { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 12px; row-gap: 6px; }
.slider-block { display: flex; flex-direction: column; gap: 4px; }
.slider-block label { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; color: #b6c8c4; font-size: 10px; }
.slider-block label i { color: var(--accent); font-family: Georgia, serif; font-size: 12px; }
.slider-block label sub { font-size: 8px; }
.slider-block output { color: #d2e4dd; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slider-highlight { grid-column: 1 / -1; padding: 6px 8px 5px; margin: 0; border: 1px solid rgba(121,226,192,.14); border-radius: 8px; background: rgba(121,226,192,.035); }
input[type="range"] { width: 100%; height: 12px; margin: 0; appearance: none; -webkit-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, #2d8278, #3c6e70); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #2d8278, #3c6e70); }
input[type="range"]::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; appearance: none; -webkit-appearance: none; border: 2px solid #d7f6e9; border-radius: 50%; background: var(--accent-deep); box-shadow: 0 0 0 3px rgba(121,226,192,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d7f6e9; border-radius: 50%; background: var(--accent-deep); box-shadow: 0 0 0 3px rgba(121,226,192,.12); }
.range-ends { display: flex; justify-content: space-between; color: #587276; font-size: 7px; letter-spacing: .02em; }
.threshold-card { padding: 7px 9px 6px; border: 1px solid rgba(121,226,192,.18); border-radius: 9px; background: linear-gradient(110deg, rgba(27,83,77,.22), rgba(12,38,44,.25)); }
.threshold-top { display: flex; justify-content: space-between; align-items: center; color: #9ab3ad; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.threshold-tag { color: var(--accent); font-size: 7px; }
.threshold-tag.below { color: var(--warn); }
.threshold-main { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; }
.threshold-main strong { color: #e3f4eb; font-size: 22px; font-weight: 560; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.threshold-main span { color: #829d9b; font-size: 8px; }
.threshold-track { position: relative; height: 3px; margin: 7px 1px 5px; border-radius: 5px; background: linear-gradient(90deg, #5b5960, #347f76 55%, #79e2c0); }
.threshold-track span { position: absolute; top: 50%; left: 62.5%; width: 8px; height: 8px; border: 2px solid #e2f7eb; border-radius: 50%; background: var(--accent-deep); transform: translate(-50%,-50%); box-shadow: 0 0 7px rgba(121,226,192,.55); }
.threshold-foot { display: flex; justify-content: space-between; gap: 8px; color: #799391; font-size: 7px; }
.threshold-foot span:last-child { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-heading { padding-top: 1px; }
.readout-clock { color: #6d8988; font-size: 8px; font-weight: 500; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.readout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.readout-card { min-width: 0; padding: 8px 8px 7px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); }
.readout-card span { display: block; min-height: 16px; color: #6e898a; font-size: 7px; font-weight: 800; letter-spacing: .09em; }
.readout-card strong { display: block; margin-top: 2px; color: #e3f2e9; font-size: 19px; line-height: 1; font-weight: 570; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.readout-card small { display: block; margin-top: 5px; color: #6d8787; font-size: 7px; white-space: nowrap; }
.check-card { padding: 6px 8px 5px; border-top: 1px solid rgba(121,226,192,.16); background: rgba(121,226,192,.025); border-radius: 0 0 7px 7px; }
.check-heading { display: flex; justify-content: space-between; align-items: center; color: #86a49d; font-size: 7px; font-weight: 800; letter-spacing: .14em; }
.check-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.check-title { margin: 5px 0 6px; color: #b7c9c3; font-size: 9px; }
.check-values { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; color: #6f8a89; font-size: 8px; }
.check-values strong { color: #d7e8df; font-weight: 600; font-variant-numeric: tabular-nums; }
.check-error { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--line); color: #6f8987; font-size: 8px; }
.check-error strong { color: var(--accent); font-weight: 650; font-variant-numeric: tabular-nums; }
.science-panel { border: 1px solid var(--line); border-radius: 11px; background: rgba(10,27,35,.88); overflow: hidden; }
.science-panel summary { min-height: 39px; padding: 0 14px; display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; color: #b6c8c2; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; border: 1px solid rgba(121,226,192,.23); border-radius: 6px; color: var(--accent); font-size: 13px; }
.science-summary { color: #6e8988; font-size: 8px; font-weight: 500; letter-spacing: .03em; }
.summary-chevron { margin-left: auto; color: var(--accent); font-size: 14px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { display: grid; grid-template-columns: 1.15fr 1fr 1.3fr; gap: 20px; padding: 4px 16px 15px; border-top: 1px solid var(--line); }
.science-column h2 { margin: 10px 0 7px; color: #b8d0c8; font-size: 10px; font-weight: 700; }
.equation { margin: 5px 0; color: #d5eee2; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.science-copy { margin: 6px 0; color: #849d99; font-size: 9px; line-height: 1.55; }
.science-disclaimer { margin: 7px 0 0; color: #a6c5b7; font-size: 8px; }
.footer-line { display: flex; justify-content: space-between; color: #4f6a6d; font-size: 7px; font-weight: 700; letter-spacing: .14em; }
.footer-line i { color: var(--accent); font-style: normal; padding: 0 3px; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 900px) and (min-width: 701px) {
  .app-shell { padding: 15px; gap: 9px; }
  .workspace { grid-template-columns: minmax(0,1fr) 305px; gap: 9px; }
  .control-panel { padding: 11px; gap: 8px; }
  .visual-panel { padding: 10px; }
  .control-button { padding: 0 8px; }
  .screenshot-button { display: none; }
}
@media (max-width: 700px) {
  .app-shell { padding: 10px 10px 8px; gap: 8px; grid-template-rows: auto minmax(0,1fr) auto auto; }
  .topbar { min-height: 57px; gap: 8px; align-items: flex-start; }
  .eyebrow { font-size: 7px; letter-spacing: .13em; gap: 6px; }
  .eyebrow-line { width: 12px; }
  h1 { margin-top: 5px; font-size: 24px; }
  .subtitle { margin-top: 3px; font-size: 9px; }
  .header-meta { gap: 5px; padding-top: 2px; }
  .live-chip { padding: 6px 7px; font-size: 6px; letter-spacing: .08em; gap: 5px; white-space: nowrap; }
  .live-dot { width: 5px; height: 5px; }
  .seed-line { font-size: 6px; letter-spacing: .08em; white-space: nowrap; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(205px, 42%) minmax(0,1fr); gap: 8px; }
  .visual-panel { padding: 8px; border-radius: 11px; }
  .visual-topline { height: 18px; flex-basis: 18px; font-size: 7px; }
  .state-pill { font-size: 6px; padding: 3px 6px; }
  .canvas-stage { border-radius: 8px; }
  .canvas-top-label { top: 9px; left: 9px; font-size: 6px; }
  .field-legend { top: 9px; right: 9px; font-size: 6px; gap: 4px; }
  .legend-ramp { width: 34px; height: 3px; }
  .canvas-caption { left: 8px; right: 8px; bottom: 23px; padding: 6px 8px; font-size: 8px; }
  .canvas-scale { right: 9px; bottom: 7px; font-size: 6px; }
  .transport-bar { flex-basis: 34px; align-items: flex-end; }
  .transport-actions { gap: 4px; }
  .control-button { min-height: 27px; padding: 0 7px; gap: 4px; font-size: 8px; border-radius: 6px; }
  .button-symbol { font-size: 11px; }
  .screenshot-button { display: none; }
  .quality-control { font-size: 6px; gap: 5px; }
  .quality-button { min-width: 36px; height: 24px; font-size: 7px; }
  .control-panel { padding: 8px; gap: 6px; border-radius: 11px; }
  .panel-heading, .readout-heading { font-size: 8px; }
  .panel-count { font-size: 6px; }
  .preset-button { min-height: 35px; padding: 5px 7px; }
  .preset-button span { font-size: 7px; }
  .preset-button small { font-size: 7px; }
  .sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
  .slider-block { gap: 4px; }
  .slider-block label { font-size: 8px; }
  .slider-block output { font-size: 7px; }
  .range-ends { font-size: 6px; }
  .slider-highlight { padding: 4px 6px; margin: 0; }
  .threshold-card { padding: 7px 8px; }
  .threshold-top { font-size: 6px; }
  .threshold-main strong { font-size: 18px; }
  .threshold-main span { font-size: 7px; }
  .threshold-foot { font-size: 6px; }
  .readout-grid { gap: 5px; }
  .readout-card { padding: 6px; }
  .readout-card span { font-size: 6px; min-height: 12px; }
  .readout-card strong { font-size: 16px; }
  .readout-card small { font-size: 6px; margin-top: 4px; }
  .check-card { padding: 6px 7px; }
  .check-heading { font-size: 6px; }
  .check-title { margin: 4px 0; font-size: 8px; }
  .check-values, .check-error { font-size: 7px; }
  .science-panel summary { min-height: 34px; padding: 0 10px; font-size: 8px; gap: 7px; }
  .science-icon { width: 17px; height: 17px; font-size: 11px; }
  .science-summary { font-size: 7px; }
  .science-content { grid-template-columns: 1fr; gap: 5px; padding: 3px 11px 10px; }
  .science-column h2 { margin: 7px 0 4px; font-size: 9px; }
  .equation { font-size: 9px; }
  .science-copy { font-size: 8px; }
  .science-disclaimer { font-size: 7px; }
  .footer-line { font-size: 5px; letter-spacing: .08em; }
}
@media (max-width: 390px) {
  .app-shell { padding-left: 8px; padding-right: 8px; }
  .header-meta { max-width: 112px; }
  .live-chip { font-size: 5px; }
  .seed-line { font-size: 5px; }
  .workspace { grid-template-rows: minmax(195px, 40%) minmax(0,1fr); }
  .control-button { padding: 0 6px; }
  .slider-block label { font-size: 7px; }
  .slider-block output { 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; }
}
