:root {
  color-scheme: dark;
  --bg: #07131b;
  --panel: #0c1b25;
  --panel-2: #10232d;
  --panel-3: #142b35;
  --line: rgba(175, 215, 218, .12);
  --line-strong: rgba(175, 215, 218, .22);
  --text: #e6f1ee;
  --muted: #91aaa8;
  --dim: #607a7b;
  --accent: #66e0c2;
  --accent-2: #b8f5d9;
  --warn: #91aaa8;
  --danger: #df8b79;
  --radius: 16px;
  --space: 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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-rows: 68px minmax(0, 1fr) 34px; background: radial-gradient(ellipse at 32% 4%, rgba(30, 91, 91, .15), transparent 42%), var(--bg); overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(7, 19, 27, .9); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(102, 224, 194, .4); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); background: rgba(102, 224, 194, .06); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--accent); transform: rotate(8deg); }
.brand-mark span:nth-child(1) { height: 10px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .8; }
.eyebrow { color: var(--dim); font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.3; }
.brand-title { margin-top: 3px; font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.topbar-meta { display: flex; align-items: center; gap: 18px; }
.model-chip { display: inline-flex; align-items: center; gap: 8px; color: #b4cbc7; border: 1px solid var(--line); background: rgba(15, 36, 44, .72); border-radius: 30px; padding: 8px 11px; font-size: 9px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.live-dot, .state-dot, .tipping-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(102, 224, 194, .65); }
.scale-note { color: var(--dim); font-size: 9px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 16px 20px; overflow: hidden; }
.exhibit-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 10px; }
.exhibit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 0; }
h1 { margin: 4px 0 0; font-size: clamp(20px, 2.1vw, 28px); font-weight: 650; letter-spacing: -.045em; line-height: 1.12; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 8px 10px; border: 1px solid rgba(102, 224, 194, .24); border-radius: 30px; background: rgba(102, 224, 194, .06); color: var(--accent-2); font-size: 9px; font-weight: 850; letter-spacing: .1em; white-space: nowrap; }
.state-pill.stable { border-color: rgba(145, 170, 168, .24); color: #a8bfba; background: rgba(145, 170, 168, .05); }
.state-pill.stable .state-dot { background: var(--warn); box-shadow: 0 0 10px rgba(145,170,168,.28); }
.visual-stage { min-height: 0; position: relative; display: grid; grid-template-rows: 30px minmax(0, 1fr) 58px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17, 41, 49, .9), rgba(7, 20, 28, .96)); box-shadow: inset 0 1px rgba(255,255,255,.025), 0 18px 50px rgba(0,0,0,.12); }
.stage-topline { z-index: 2; display: flex; align-items: center; justify-content: center; gap: 22px; color: #91aaa8; font-size: 9px; font-weight: 650; letter-spacing: .025em; }
.stage-topline span { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 7px; height: 7px; display: inline-block; border-radius: 2px; }
.activator-swatch { background: #b9f6d8; box-shadow: 0 0 9px rgba(185,246,216,.65); }
.inhibitor-swatch { background: #2b8881; }
.canvas-frame { position: relative; align-self: stretch; justify-self: center; width: min(100%, calc(100vh - 310px)); height: 100%; min-height: 0; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 14px; background: radial-gradient(circle at 50% 48%, rgba(28, 92, 86, .22), rgba(5, 18, 25, .14) 68%); }
#fieldCanvas { width: auto; height: auto; max-width: 100%; max-height: 100%; aspect-ratio: 1; display: block; image-rendering: auto; opacity: 0; transform: scale(.96); transition: opacity 700ms ease, transform 1100ms cubic-bezier(.2,.75,.25,1); }
#fieldCanvas.ready { opacity: 1; transform: scale(1); }
.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .45; }
.poster[hidden] { display: none; }
.canvas-corner { position: absolute; z-index: 2; color: rgba(195, 223, 215, .58); font-size: 8px; font-weight: 850; letter-spacing: .12em; pointer-events: none; }
.canvas-corner span { color: rgba(145, 170, 168, .52); font-weight: 650; }
.canvas-corner.top-left { top: 13px; left: 14px; }
.canvas-corner.bottom-right { right: 14px; bottom: 13px; text-align: right; }
.stage-caption { z-index: 2; display: flex; align-items: center; gap: 12px; padding: 8px 18px 10px; border-top: 1px solid rgba(175, 215, 218, .08); background: linear-gradient(90deg, rgba(12, 31, 39, .88), rgba(9, 25, 33, .76)); }
.caption-icon { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border: 1px solid rgba(102,224,194,.24); border-radius: 9px; color: var(--accent); background: rgba(102,224,194,.07); font-size: 15px; }
.caption-kicker { color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.stage-caption p { margin: 3px 0 0; color: #bdd0ca; font-size: 11px; line-height: 1.35; }
.readout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 10px 13px 9px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(140deg, rgba(17, 39, 48, .85), rgba(10, 26, 34, .85)); }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #93aaa6; font-size: 8px; font-weight: 850; letter-spacing: .09em; white-space: nowrap; }
.readout-label span { color: #587574; font-size: 7px; letter-spacing: .08em; }
.readout-value { display: flex; align-items: baseline; gap: 7px; margin-top: 5px; white-space: nowrap; }
.readout-value strong { color: var(--accent-2); font-size: 23px; line-height: 1; font-weight: 650; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.readout-value small { color: #7d9995; font-size: 8px; }
.readout-foot { margin-top: 5px; color: #708a88; font-size: 8px; }
.audit-strip { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 7px 12px; border: 1px solid rgba(102,224,194,.18); border-radius: 11px; background: rgba(20, 54, 55, .24); }
.audit-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; color: var(--accent); background: rgba(102,224,194,.1); font-size: 12px; }
.audit-copy { min-width: 0; display: grid; gap: 2px; }
.audit-copy strong { color: #b9d7ce; font-size: 9px; font-weight: 750; }
.audit-copy span { color: #809a96; font-size: 9px; overflow-wrap: anywhere; }
.audit-delta { margin-left: auto; flex: 0 0 auto; color: var(--accent); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(14, 32, 42, .98), rgba(9, 24, 32, .98)); scrollbar-width: thin; scrollbar-color: #31545a transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.04em; font-weight: 650; }
.control-count { margin-top: 4px; color: #688381; font-size: 8px; font-weight: 850; letter-spacing: .1em; white-space: nowrap; }
.section-label { color: #829b97; font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.preset-block { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.preset-button { min-height: 35px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(255,255,255,.018); color: #91aaa6; font-size: 10px; font-weight: 700; cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.preset-button:hover { border-color: rgba(102,224,194,.42); color: var(--text); }
.preset-button.active { border-color: rgba(102,224,194,.52); color: var(--accent-2); background: rgba(102,224,194,.1); }
.slider-block { padding: 13px 0 11px; border-bottom: 1px solid var(--line); }
.slider-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slider-heading label { color: #d4e4df; font-size: 10px; font-weight: 650; }
.symbol { margin-left: 3px; color: var(--accent); font-size: 10px; }
.slider-heading output { min-width: 42px; color: var(--accent-2); font-size: 11px; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 16px; margin: 8px 0 2px; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 10px; background: linear-gradient(90deg, rgba(102,224,194,.68), rgba(102,224,194,.14)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 10px; background: linear-gradient(90deg, rgba(102,224,194,.68), rgba(102,224,194,.14)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 2px solid #07131b; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(102,224,194,.55), 0 0 10px rgba(102,224,194,.25); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #07131b; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(102,224,194,.55); }
.range-ends { display: flex; justify-content: space-between; color: #587371; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.tipping-card { margin-top: 14px; padding: 11px 12px 10px; border: 1px solid rgba(102,224,194,.24); border-radius: 11px; background: linear-gradient(120deg, rgba(102,224,194,.075), rgba(102,224,194,.025)); }
.tipping-card.stable { border-color: rgba(145,170,168,.22); background: linear-gradient(120deg, rgba(145,170,168,.055), rgba(145,170,168,.02)); }
.tipping-top { display: flex; align-items: center; gap: 8px; color: var(--accent-2); font-size: 9px; letter-spacing: .11em; }
.tipping-card.stable .tipping-top { color: #a8bfba; }
.tipping-card.stable .tipping-indicator { background: var(--warn); box-shadow: 0 0 10px rgba(145,170,168,.28); }
.tipping-card p { margin: 7px 0 9px; color: #a5bbb4; font-size: 9px; line-height: 1.45; }
.threshold-line { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid rgba(175,215,218,.1); color: #688381; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.threshold-line b { color: #c2d7cf; font-size: 9px; letter-spacing: 0; }
.threshold-line small { color: #718c88; font-size: 7px; font-weight: 500; }
.transport-controls { margin-top: 15px; }
.transport-row { display: grid; grid-template-columns: minmax(0,1fr) 74px 38px; gap: 7px; margin-top: 9px; }
.main-action, .utility-button { min-height: 38px; border-radius: 9px; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.main-action:active, .utility-button:active, .text-action:active { transform: translateY(1px); }
.main-action { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(102,224,194,.45); background: var(--accent); color: #06211e; font-size: 10px; font-weight: 850; }
.main-action:hover { background: #83edcf; }
.play-icon { font-size: 13px; line-height: 1; }
.utility-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #c0d3ce; font-size: 10px; font-weight: 700; }
.utility-button:hover { border-color: rgba(102,224,194,.4); color: var(--accent-2); background: rgba(102,224,194,.06); }
.utility-button span { color: var(--accent); }
.icon-button { font-size: 18px; font-weight: 400; }
.transport-meta { display: flex; justify-content: space-between; margin-top: 7px; color: #5e7b79; font-size: 7px; font-weight: 850; letter-spacing: .11em; }
.transport-meta #runStatus { color: var(--accent); }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quality-note { display: block; margin-top: 4px; color: #64807d; font-size: 8px; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.12); }
.segmented button { min-width: 39px; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: #78918d; font-size: 8px; font-weight: 750; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: #1a3c40; color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(102,224,194,.18); }
.panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; }
.text-action { display: inline-flex; align-items: center; gap: 6px; padding: 5px 0; border: 0; background: transparent; color: #a4bbb5; font-size: 9px; font-weight: 700; cursor: pointer; }
.text-action:hover { color: var(--accent-2); }
.text-action > span:first-child { color: var(--accent); font-size: 12px; }
.chevron { color: #77928c; transition: transform .2s ease; }
.text-action[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.science-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4, 15, 21, .4); }
.science-panel h3 { margin: 0 0 8px; color: #d5e8e0; font-size: 11px; }
.science-panel p { margin: 7px 0; color: #91aaa3; font-size: 9px; line-height: 1.55; }
.science-panel b { color: #d5e8e0; }
.equation { margin: 7px 0; padding: 8px; border-radius: 7px; background: rgba(102,224,194,.055); color: #c2e9d9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.science-panel .disclaimer { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: #b0c7bf; font-style: italic; }
.footerbar { display: flex; align-items: center; gap: 17px; padding: 0 22px; border-top: 1px solid var(--line); color: #607a79; font-size: 7px; font-weight: 850; letter-spacing: .11em; }
.footerbar b { margin-left: 4px; color: #9db4ae; font-size: 7px; }
.footer-spacer { flex: 1; }
.footerbar #peakCount { color: var(--accent); }
.footer-divider { width: 1px; height: 12px; background: var(--line-strong); }
@media (max-width: 900px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0,1fr) 310px; gap: 10px; padding: 10px; }
  .control-panel { padding: 13px; }
  .readout-value strong { font-size: 20px; }
  .readout-label { font-size: 7px; }
  .readout-label span { display: none; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .app-shell { grid-template-rows: 56px minmax(0,1fr) 27px; }
  .topbar { padding: 0 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-title { font-size: 12px; }
  .eyebrow { font-size: 8px; }
  .topbar-meta { gap: 0; }
  .model-chip { padding: 7px 8px; font-size: 7px; }
  .scale-note { display: none; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(360px, 48dvh) minmax(0,1fr); gap: 8px; padding: 8px; overflow: hidden; }
  .exhibit-panel { grid-template-rows: auto minmax(0,1fr) auto auto; gap: 7px; }
  .exhibit-heading { padding: 0 2px; }
  h1 { font-size: 17px; }
  .exhibit-heading .eyebrow { font-size: 7px; }
  .state-pill { padding: 6px 8px; font-size: 7px; }
  .visual-stage { grid-template-rows: 22px minmax(0,1fr) 48px; border-radius: 12px; }
  .stage-topline { gap: 12px; font-size: 7px; }
  .canvas-frame { width: min(100%, 100%); height: 100%; }
  .canvas-corner { font-size: 6px; }
  .canvas-corner.top-left { top: 8px; left: 9px; }
  .canvas-corner.bottom-right { right: 9px; bottom: 8px; }
  .stage-caption { padding: 6px 10px; gap: 8px; }
  .caption-icon { width: 23px; height: 23px; flex-basis: 23px; font-size: 13px; }
  .caption-kicker { font-size: 7px; }
  .stage-caption p { font-size: 9px; line-height: 1.28; }
  .readout-grid { gap: 5px; }
  .readout-card { padding: 7px 8px 6px; border-radius: 9px; }
  .readout-label { font-size: 6px; letter-spacing: .04em; }
  .readout-label span { display: none; }
  .readout-value { gap: 3px; margin-top: 4px; }
  .readout-value strong { font-size: 17px; }
  .readout-value small { font-size: 6px; white-space: normal; }
  .readout-foot { display: none; }
  .audit-strip { display: flex; min-height: 34px; padding: 5px 8px; gap: 7px; }
  .audit-icon { width: 18px; height: 18px; flex-basis: 18px; font-size: 10px; }
  .audit-copy { gap: 1px; }
  .audit-copy strong { font-size: 7px; }
  .audit-copy span { font-size: 7px; line-height: 1.2; }
  .audit-delta { font-size: 9px; }
  .control-panel { padding: 12px 13px; border-radius: 12px; }
  .panel-heading { margin-bottom: 11px; }
  h2 { font-size: 16px; }
  .control-count { font-size: 7px; }
  .preset-block { padding-bottom: 10px; }
  .preset-button { min-height: 31px; font-size: 9px; }
  .slider-block { padding: 10px 0 8px; }
  .slider-heading label { font-size: 9px; }
  .slider-heading output { font-size: 10px; }
  input[type="range"] { margin: 6px 0 1px; }
  .range-ends { font-size: 6px; }
  .tipping-card { margin-top: 10px; padding: 9px 10px 8px; }
  .tipping-card p { margin: 5px 0 7px; font-size: 8px; }
  .transport-controls { margin-top: 11px; }
  .transport-row { margin-top: 7px; }
  .main-action, .utility-button { min-height: 34px; }
  .quality-row { margin-top: 10px; padding: 8px 0; }
  .panel-actions { padding-top: 8px; }
  .footerbar { padding: 0 10px; gap: 11px; font-size: 6px; }
  .footerbar b { font-size: 6px; }
  .footerbar > span:nth-child(2), .footerbar > span:nth-child(3), .footerbar .footer-divider, .footerbar > span:last-child { display: none; }
}
@media (max-width: 380px) {
  .workspace { grid-template-rows: minmax(340px, 46dvh) minmax(0,1fr); }
  .stage-topline { gap: 8px; font-size: 6px; }
  .readout-value strong { font-size: 15px; }
  .readout-value small { font-size: 5px; }
  .control-panel { padding: 10px; }
  .slider-block { padding: 8px 0 6px; }
  .tipping-card { padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
