:root {
  color-scheme: dark;
  --bg: #071312;
  --panel: #0c1b19;
  --panel-2: #10221f;
  --panel-3: #132925;
  --line: rgba(158, 209, 194, .13);
  --line-strong: rgba(158, 209, 194, .23);
  --text: #e4f1ec;
  --muted: #8ca59c;
  --dim: #607970;
  --accent: #55e0c2;
  --accent-soft: rgba(85, 224, 194, .12);
  --accent-mid: rgba(85, 224, 194, .34);
  --radius: 14px;
  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; }
body.embed-mode { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 15% 0%, rgba(39, 101, 86, .12), transparent 42%), var(--bg); }
body.embed-mode .app { height: 100%; min-height: 0; }
.topbar { min-height: 72px; padding: 0 28px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: rgba(7, 19, 18, .96); }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(85,224,194,.42); border-radius: 10px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; padding: 6px; transform: rotate(-7deg); }
.brand-mark span { border-radius: 50%; background: var(--accent); opacity: .82; }
.brand-mark span:nth-child(2) { opacity: .42; transform: scale(.72); }
.brand-mark span:nth-child(3) { opacity: .55; transform: scale(.84); }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker, .subhead, .readout-label, .caption-label, .equation-title, .check-heading, .simplifications > strong, .bottomline, .field-size, .stage-corner-note, .canvas-top-label, .canvas-bottom-label, .control-count, .number-key { font-size: 9px; letter-spacing: .15em; font-weight: 750; }
.eyebrow { color: var(--muted); line-height: 1.2; }
.eyebrow span { color: var(--accent); margin: 0 4px; }
h1 { margin: 4px 0 0; font-size: 18px; line-height: 1; letter-spacing: -.035em; font-weight: 650; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.live-dot, .caption-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(85,224,194,.7); }
.live-dot.paused { background: #82968f; box-shadow: none; }
.time-chip { border-left: 1px solid var(--line-strong); padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.time-chip span { color: var(--dim); font-size: 8px; letter-spacing: .14em; font-weight: 750; }
.time-chip strong { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 650; }
.workbench { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; padding: 16px 20px 10px; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.stage-shell { flex: 1; min-height: 300px; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18,39,35,.92), rgba(8,22,20,.98)); box-shadow: 0 16px 45px rgba(0,0,0,.16); }
.stage-head { min-height: 58px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.stage-heading { display: flex; flex-direction: column; gap: 5px; }
.section-kicker { color: var(--accent); font-size: 8px; }
.kicker-line { display: inline-block; width: 18px; height: 1px; margin: 0 0 2px 4px; background: var(--accent-mid); }
.stage-subtitle { color: var(--muted); font-size: 10px; }
.stage-actions { display: flex; gap: 7px; }
.icon-button { height: 29px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(255,255,255,.018); color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; transition: border-color .2s ease, color .2s ease, background .2s ease; }
.icon-button:hover, .icon-button:focus-visible { border-color: var(--accent-mid); color: var(--accent); outline: none; }
.screenshot-button { display: flex; align-items: center; gap: 7px; }
.camera-icon { width: 12px; height: 9px; display: inline-block; position: relative; border: 1px solid currentColor; border-radius: 2px; }
.camera-icon::before { content: ""; position: absolute; width: 4px; height: 2px; top: -3px; left: 3px; background: currentColor; border-radius: 2px 2px 0 0; }
.camera-icon::after { content: ""; position: absolute; width: 3px; height: 3px; border: 1px solid currentColor; border-radius: 50%; left: 3.5px; top: 1.5px; }
.canvas-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 95%, rgba(35,112,92,.12), transparent 60%), #071513; }
#simCanvas { width: 100%; height: 100%; display: block; }
.canvas-top-label { position: absolute; top: 14px; left: 16px; display: flex; align-items: center; gap: 8px; color: #91b9ac; font-size: 8px; pointer-events: none; }
.canvas-top-label strong { color: var(--accent); font-size: 9px; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.feed-mark { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.canvas-bottom-label { position: absolute; bottom: 13px; left: 16px; right: 16px; display: flex; align-items: center; gap: 8px; color: rgba(148,185,172,.64); font-size: 7px; pointer-events: none; }
.bottom-rule { height: 1px; flex: 1; background: linear-gradient(90deg, rgba(85,224,194,.3), transparent); }
.scale-mark { position: absolute; right: 17px; bottom: 35px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: rgba(158,209,194,.62); font-size: 8px; pointer-events: none; }
.scale-mark span { height: 2px; width: 36px; background: rgba(85,224,194,.72); box-shadow: 0 0 8px rgba(85,224,194,.2); }
.stage-corner-note { position: absolute; right: 16px; top: 15px; color: rgba(142,178,164,.42); font-size: 7px; pointer-events: none; }
.stage-foot { min-height: 35px; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.legend-swatch { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.legend-swatch:first-child { margin-left: 0; }
.legend-swatch.nutrient { background: rgba(51,150,128,.72); }
.legend-swatch.biomass { background: var(--accent); box-shadow: 0 0 7px rgba(85,224,194,.5); }
.field-size { color: var(--dim); font-size: 7px; letter-spacing: .11em; }
.field-size strong { color: var(--muted); font-size: 8px; letter-spacing: .03em; margin-left: 4px; }
.field-size span { font-weight: 500; letter-spacing: 0; }
.readout-grid { 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: 10px; background: rgba(12,27,25,.88); }
.readout-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 7px; letter-spacing: .12em; white-space: nowrap; }
.info-dot { display: inline-flex; width: 11px; height: 11px; border: 1px solid var(--dim); border-radius: 50%; justify-content: center; align-items: center; color: var(--dim); font-size: 8px; letter-spacing: 0; cursor: help; }
.readout-value { margin-top: 5px; font-size: 21px; font-weight: 630; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { font-size: 10px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.readout-foot { margin-top: 2px; color: var(--dim); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.regime-card .readout-value { color: var(--accent); }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(14,31,28,.98), rgba(9,22,20,.98)); padding: 17px 17px 12px; scrollbar-width: thin; scrollbar-color: rgba(85,224,194,.25) transparent; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 5px 0 0; font-size: 16px; font-weight: 630; letter-spacing: -.03em; }
.control-count { color: var(--dim); font-size: 7px; white-space: nowrap; }
.preset-block { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.subhead { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 7px; letter-spacing: .13em; }
.subhead-line { height: 1px; flex: 1; background: var(--line); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.preset-button { min-width: 0; height: 48px; padding: 0 9px; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.015); cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.preset-button:hover, .preset-button:focus-visible { border-color: var(--accent-mid); outline: none; }
.preset-button.active { border-color: rgba(85,224,194,.58); background: var(--accent-soft); }
.preset-button strong, .preset-button small { display: block; }
.preset-button strong { font-size: 10px; font-weight: 650; }
.preset-button small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.preset-glyph { width: 23px; height: 23px; flex: 0 0 23px; border-radius: 6px; background: rgba(85,224,194,.08); position: relative; overflow: hidden; }
.smooth-glyph::before { content: ""; position: absolute; width: 20px; height: 8px; left: 1px; bottom: 4px; border-top: 2px solid var(--accent); border-radius: 50%; }
.branch-glyph::before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 4px; border-left: 1.5px solid var(--accent); border-top: 1.5px solid var(--accent); transform: rotate(38deg) skew(-13deg); }
.branch-glyph::after { content: ""; position: absolute; width: 9px; height: 8px; left: 9px; top: 2px; border-left: 1px solid var(--accent); border-bottom: 1px solid var(--accent); transform: rotate(-23deg); }
.parameter-list { padding: 4px 0 6px; }
.parameter { padding: 9px 0 7px; }
.parameter-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.parameter label { color: #c9d9d2; font-size: 10px; font-weight: 560; }
.parameter output { color: var(--accent); font-size: 9px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; width: 100%; height: 15px; margin: 6px 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(85,224,194,.8), rgba(85,224,194,.16)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(85,224,194,.8), rgba(85,224,194,.16)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; background: var(--accent); border: 2px solid #09201b; box-shadow: 0 0 0 1px rgba(85,224,194,.5), 0 0 8px rgba(85,224,194,.2); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #09201b; box-shadow: 0 0 0 1px rgba(85,224,194,.5); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: var(--dim); font-size: 6px; font-weight: 750; letter-spacing: .12em; }
.experiment-footer { border-top: 1px solid var(--line); padding-top: 12px; }
.playback-row { display: grid; grid-template-columns: 1.05fr .95fr .85fr; gap: 6px; }
.primary-control, .secondary-control { height: 34px; border-radius: 7px; display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .1em; transition: background .2s ease, border-color .2s ease, transform .15s ease; }
.primary-control:active, .secondary-control:active { transform: translateY(1px); }
.primary-control { border: 1px solid rgba(85,224,194,.52); color: #052019; background: var(--accent); }
.primary-control:hover, .primary-control:focus-visible { background: #79ecd4; outline: none; }
.secondary-control { border: 1px solid var(--line-strong); background: rgba(255,255,255,.02); color: #b9ccc4; }
.secondary-control:hover, .secondary-control:focus-visible { border-color: var(--accent-mid); color: var(--accent); outline: none; }
.secondary-control span { color: var(--muted); font-size: 7px; letter-spacing: .02em; }
.reset-control { gap: 4px; }
.reset-glyph { font-size: 14px; line-height: 1; }
.pause-glyph { width: 9px; height: 10px; display: inline-block; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.play-glyph { width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.caption-box { margin-top: 10px; padding: 10px 11px 11px; border: 1px solid rgba(85,224,194,.19); border-radius: 8px; background: rgba(85,224,194,.055); }
.caption-label { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 7px; }
.caption-pulse { width: 5px; height: 5px; }
.caption-box p { margin: 6px 0 0; color: #b6c9c1; font-size: 9px; line-height: 1.5; }
.science-panel { margin-top: 10px; border-top: 1px solid var(--line); }
.science-panel summary { min-height: 38px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .13em; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.details-chevron { color: var(--accent); font-size: 16px; transition: transform .2s ease; }
.science-panel[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding: 0 0 8px; }
.science-intro { margin: 0 0 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.equation-card { padding: 9px 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.015); }
.equation-title { color: var(--accent); font-size: 7px; }
.equation { margin-top: 6px; color: #e1f0e9; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.55; }
.equation sub { font-size: 7px; }
.equation-note { margin-top: 4px; color: var(--dim); font-size: 8px; line-height: 1.45; }
.check-card { margin-top: 8px; padding: 10px; border: 1px solid rgba(85,224,194,.2); border-radius: 7px; background: rgba(85,224,194,.045); }
.check-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: 7px; }
.check-status { color: var(--accent); }
.check-values { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; margin-top: 8px; color: var(--muted); font-size: 8px; }
.check-values strong { color: var(--text); font-size: 9px; font-variant-numeric: tabular-nums; }
.check-card p, .simplifications p { color: var(--dim); font-size: 8px; line-height: 1.5; margin: 8px 0 0; }
.simplifications { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.simplifications > strong { color: var(--muted); font-size: 7px; }
.simplifications p { margin-top: 5px; }
.disclaimer { margin: 10px 0 0; color: #a5b9b0; font-size: 8px; line-height: 1.45; }
.number-key { margin-top: 9px; color: var(--dim); font-size: 6px; line-height: 1.7; letter-spacing: .08em; }
.number-key span { color: var(--accent); margin-right: 3px; }
.bottomline { min-height: 24px; padding: 0 22px; display: flex; justify-content: space-between; align-items: center; color: var(--dim); font-size: 7px; letter-spacing: .11em; }
.bottomline i { color: var(--accent); font-style: normal; margin: 0 5px; }
button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
@media (min-width: 1500px) { .workbench { grid-template-columns: minmax(0,1fr) 390px; padding: 20px 24px 12px; gap: 18px; } .control-panel { padding: 20px; } .topbar { padding: 0 32px; } }
@media (max-width: 1000px) { .workbench { grid-template-columns: minmax(0,1fr) 330px; padding: 12px; gap: 10px; } .control-panel { padding: 13px; } .readout-card { padding: 9px; } .readout-value { font-size: 18px; } .readout-label { font-size: 6px; } }
@media (max-width: 760px) {
  body, body.embed-mode { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .app { height: 100%; min-height: 0; }
  .topbar { min-height: 58px; padding: 0 13px; gap: 9px; }
  .brand-mark { width: 28px; height: 28px; padding: 5px; border-radius: 8px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 16px; }
  .topbar-right { gap: 10px; }
  .live-indicator { font-size: 7px; gap: 5px; }
  .time-chip { padding-left: 10px; }
  .time-chip span { font-size: 6px; }
  .time-chip strong { font-size: 11px; }
  .workbench { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 8px 9px 5px; gap: 7px; overflow: hidden; }
  .stage-column { flex: 0 0 48%; min-height: 0; gap: 6px; }
  .stage-shell { min-height: 0; flex: 1; }
  .stage-head { min-height: 43px; padding: 0 10px; }
  .section-kicker { font-size: 7px; }
  .stage-subtitle { font-size: 8px; }
  .icon-button { height: 25px; padding: 0 7px; font-size: 7px; }
  .camera-icon { display: none; }
  .canvas-top-label { top: 9px; left: 10px; font-size: 6px; gap: 5px; }
  .canvas-top-label strong { font-size: 7px; }
  .stage-corner-note { top: 10px; right: 10px; font-size: 6px; }
  .canvas-bottom-label { left: 10px; right: 10px; bottom: 8px; font-size: 6px; }
  .scale-mark { right: 11px; bottom: 24px; }
  .scale-mark span { width: 25px; }
  .stage-foot { min-height: 25px; padding: 0 9px; }
  .legend { font-size: 7px; gap: 5px; }
  .legend-swatch { width: 6px; height: 6px; margin-left: 5px; }
  .field-size { font-size: 6px; }
  .field-size strong { font-size: 6px; }
  .field-size span { display: none; }
  .readout-grid { gap: 5px; grid-template-columns: repeat(4, minmax(0,1fr)); }
  .readout-card { padding: 6px 6px 5px; border-radius: 7px; }
  .readout-label { font-size: 5.5px; letter-spacing: .07em; gap: 3px; }
  .info-dot { width: 9px; height: 9px; font-size: 6px; }
  .readout-value { margin-top: 3px; font-size: 15px; }
  .readout-value small { font-size: 7px; }
  .readout-foot { font-size: 6px; margin-top: 1px; }
  .control-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 11px 8px; border-radius: 10px; }
  .panel-head { padding-bottom: 8px; }
  .panel-head h2 { font-size: 13px; margin-top: 3px; }
  .control-count { font-size: 6px; }
  .preset-block { padding: 8px 0 7px; }
  .preset-row { margin-top: 6px; gap: 5px; }
  .preset-button { height: 37px; padding: 0 7px; gap: 6px; }
  .preset-glyph { width: 18px; height: 18px; flex-basis: 18px; }
  .preset-button strong { font-size: 9px; }
  .preset-button small { font-size: 7px; margin-top: 1px; }
  .parameter-list { padding: 1px 0 3px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .parameter { padding: 6px 0 4px; }
  .parameter-top { align-items: flex-start; flex-direction: column; gap: 2px; }
  .parameter label { font-size: 8px; }
  .parameter output { font-size: 8px; }
  input[type="range"] { margin-top: 3px; height: 13px; }
  .range-ends { font-size: 5px; }
  .experiment-footer { padding-top: 7px; }
  .playback-row { gap: 5px; }
  .primary-control, .secondary-control { height: 29px; font-size: 7px; }
  .secondary-control span { font-size: 6px; }
  .caption-box { margin-top: 6px; padding: 7px 8px; }
  .caption-label { font-size: 6px; }
  .caption-box p { font-size: 8px; margin-top: 4px; line-height: 1.35; }
  .science-panel { margin-top: 6px; }
  .science-panel summary { min-height: 30px; font-size: 7px; }
  .science-intro { font-size: 8px; }
  .equation-card { padding: 7px; }
  .equation { font-size: 9px; }
  .bottomline { display: none; }
}
@media (max-width: 390px) {
  .stage-column { flex-basis: 46%; }
  .stage-subtitle { font-size: 7px; }
  .stage-actions { gap: 4px; }
  .icon-button { padding: 0 6px; }
  .readout-value { font-size: 13px; }
  .readout-label { font-size: 5px; }
  .readout-foot { font-size: 5.5px; }
  .parameter-list { column-gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
