:root {
  color-scheme: dark;
  --bg: #071016;
  --panel: #0c171f;
  --panel-2: #101f28;
  --line: rgba(166, 198, 211, .13);
  --line-strong: rgba(166, 198, 211, .22);
  --text: #e5f0f2;
  --muted: #8ca3ac;
  --dim: #5c747e;
  --accent: #55e0d1;
  --accent-soft: rgba(85, 224, 209, .12);
  --accent-glow: rgba(85, 224, 209, .25);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 18% 0%, rgba(27, 78, 82, .16), transparent 35%), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
.app { min-height: 100vh; }
.topbar { height: 76px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7, 16, 22, .86); }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(85,224,209,.5); border-radius: 9px; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-12deg); background: var(--accent-soft); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .72; }
.eyebrow, .stage-kicker, .control-label, .readout-label, .audit-title, .threshold-label { font-size: 9px; font-weight: 750; letter-spacing: .14em; color: var(--muted); }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.eyebrow-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
h1 { font-size: 18px; line-height: 1.15; margin: 0; letter-spacing: -.025em; font-weight: 650; }
.live-state { display: flex; align-items: center; gap: 8px; color: #a8c1c5; font-size: 9px; letter-spacing: .13em; font-weight: 750; padding: 8px 11px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,255,255,.018); }
.live-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 12px var(--accent-glow); }
.live-state.paused .live-dot { background: #71838a; box-shadow: none; }
.layout { max-width: 1600px; margin: 0 auto; padding: 22px 26px 20px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "visual controls" "science science" "footer footer"; gap: 18px; align-items: start; }
.visual-column { grid-area: visual; min-width: 0; }
.stage-card, .control-panel, .readout-card, .audit-strip, .science-panel { border: 1px solid var(--line); background: linear-gradient(155deg, rgba(16,31,40,.97), rgba(10,21,28,.98)); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.12); }
.stage-card { padding: 18px 18px 0; overflow: hidden; }
.stage-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.stage-kicker { color: var(--accent); }
.stage-title { margin-top: 5px; font-size: 17px; font-weight: 620; letter-spacing: -.025em; }
.schematic-tag { color: #718993; font-size: 8px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; padding-bottom: 3px; }
.canvas-wrap { position: relative; height: clamp(320px, 43vw, 450px); border-radius: 11px; overflow: hidden; background: #08131a; border: 1px solid rgba(151, 193, 203, .1); }
#simulation { width: 100%; height: 100%; display: block; }
.canvas-corner { position: absolute; z-index: 2; top: 13px; color: rgba(183, 209, 213, .58); font-size: 8px; font-weight: 750; letter-spacing: .13em; pointer-events: none; }
.corner-left { left: 15px; display: flex; align-items: center; gap: 7px; }
.corner-line { width: 16px; height: 1px; background: var(--accent); opacity: .8; }
.corner-right { right: 15px; }
.canvas-footer { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.legend-item { display: flex; gap: 6px; align-items: center; color: rgba(186, 208, 211, .76); font-size: 8px; letter-spacing: .02em; }
.legend-swatch { width: 13px; height: 3px; border-radius: 4px; display: inline-block; }
.stream-forward { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.stream-return { background: #a0d6cf; opacity: .6; }
.tracer-swatch { width: 5px; height: 5px; border-radius: 50%; background: #e2fbf6; }
.actin-swatch { height: 1px; background: #9ab3b2; opacity: .7; }
.caption-row { min-height: 52px; display: flex; align-items: center; gap: 11px; padding: 10px 1px 11px; }
.caption-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 14px; flex: 0 0 auto; }
.caption-row p { color: #b2c5c8; font-size: 11px; line-height: 1.5; margin: 0; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.readout-card { padding: 12px 13px 11px; min-width: 0; border-radius: 12px; box-shadow: none; }
.readout-card.emphasis-card { border-color: rgba(85,224,209,.32); background: linear-gradient(145deg, rgba(25,66,69,.34), rgba(12,27,34,.98)); }
.readout-label { font-size: 8px; letter-spacing: .105em; white-space: nowrap; }
.provenance { display: inline-block; margin-left: 3px; color: #6f9292; font-size: 6px; letter-spacing: .08em; font-weight: 800; vertical-align: 1px; }
.info-dot { display: inline-grid; place-items: center; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--dim); color: var(--muted); font-size: 8px; letter-spacing: 0; cursor: help; margin-left: 2px; }
.readout-value { margin-top: 7px; font-size: clamp(20px, 2.2vw, 26px); line-height: 1; font-weight: 630; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { font-size: 10px; letter-spacing: 0; color: var(--muted); font-weight: 550; margin-left: 4px; }
.readout-note { margin-top: 7px; color: var(--dim); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-strip { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 12px; box-shadow: none; background: rgba(11,26,31,.9); }
.audit-mark { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 12px; flex: 0 0 auto; }
.audit-copy { min-width: 0; flex: 1; }
.audit-title { font-size: 8px; color: #90aaa9; margin-bottom: 3px; }
.audit-copy > div:last-child { color: #b8c9c9; font-size: 9px; line-height: 1.4; }
.audit-copy b { color: #e4f0ee; font-weight: 650; }
.audit-status { color: var(--accent); font-size: 7px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.control-panel { grid-area: controls; padding: 19px 18px 15px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 17px; font-weight: 630; letter-spacing: -.03em; }
.control-glyph { color: var(--accent); font-size: 27px; line-height: 1; transform: rotate(90deg); opacity: .75; }
.preset-block { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.control-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.control-label { font-size: 8px; }
.small-muted { color: var(--dim); font-size: 8px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #a5b8bc; font-size: 10px; font-weight: 620; cursor: pointer; transition: border-color .18s, background .18s, color .18s; }
.preset-button:hover { border-color: rgba(85,224,209,.5); color: var(--text); }
.preset-button.active { border-color: rgba(85,224,209,.58); background: var(--accent-soft); color: #c9f8f1; }
.sliders-block { padding-top: 15px; }
.slider-control { margin-bottom: 15px; }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.slider-heading label { color: #d5e1e2; font-size: 10px; font-weight: 560; }
.slider-heading output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { appearance: none; width: 100%; height: 15px; margin: 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, var(--accent) 0 var(--fill, 50%), rgba(130,160,169,.23) var(--fill, 50%) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: rgba(130,160,169,.23); }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 5px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #d9fffa; border: 2px solid #2aaea3; box-shadow: 0 0 0 3px rgba(85,224,209,.13); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d9fffa; border: 2px solid #2aaea3; box-shadow: 0 0 0 3px rgba(85,224,209,.13); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.range-labels { display: flex; justify-content: space-between; color: #617982; font-size: 7px; margin-top: 1px; }
.slider-hint { margin: 4px 0 0; color: #789098; font-size: 8px; line-height: 1.4; }
.threshold-card { border: 1px solid rgba(85,224,209,.17); border-radius: 10px; background: rgba(85,224,209,.045); padding: 11px 11px 9px; margin-top: 2px; }
.threshold-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.threshold-label { color: #9ab9b6; font-size: 7px; }
.threshold-value { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.threshold-track { height: 5px; position: relative; border-radius: 10px; margin: 11px 0 6px; background: linear-gradient(90deg, #536d76, #398d88 48%, var(--accent)); }
.threshold-fill { position: absolute; inset: 0 auto 0 0; width: 60%; border-radius: inherit; background: rgba(85,224,209,.7); opacity: .24; }
.threshold-marker { position: absolute; left: 50%; top: -4px; width: 2px; height: 13px; background: #e7f8f4; box-shadow: 0 0 7px rgba(255,255,255,.45); }
.threshold-bottom { display: flex; justify-content: space-between; color: #718b91; font-size: 6px; letter-spacing: .1em; font-weight: 750; }
.threshold-card p { color: #9db5b5; font-size: 8px; line-height: 1.4; margin: 7px 0 0; }
.action-row { display: grid; grid-template-columns: minmax(0,1fr) 68px 36px 36px; gap: 6px; margin-top: 14px; }
.action-row button { height: 36px; border-radius: 8px; cursor: pointer; font-size: 9px; font-weight: 750; letter-spacing: .06em; transition: background .18s, border-color .18s, transform .18s; }
.action-row button:active { transform: translateY(1px); }
.primary-action { display: flex; justify-content: center; align-items: center; gap: 9px; background: var(--accent); color: #06201f; border: 1px solid var(--accent); }
.primary-action:hover { background: #82f1e5; }
.play-icon { font-size: 12px; line-height: 1; }
.secondary-action, .icon-action { background: rgba(255,255,255,.035); color: #bdd0d1; border: 1px solid var(--line-strong); }
.secondary-action:hover, .icon-action:hover { border-color: rgba(85,224,209,.55); color: var(--accent); }
.secondary-action span { font-size: 12px; margin-left: 4px; }
.icon-action { font-size: 17px !important; font-weight: 500 !important; }
.screenshot-action { font-size: 15px !important; }
.keyboard-note { margin-top: 8px; text-align: center; color: #657e86; font-size: 7px; }
kbd { display: inline-block; padding: 2px 4px; border: 1px solid rgba(140,170,179,.22); border-radius: 4px; color: #9cb3b7; font-size: 7px; font-family: inherit; }
.quality-row { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.quality-switch { display: flex; gap: 3px; padding: 3px; border-radius: 7px; background: rgba(0,0,0,.2); }
.quality-switch button { border: 0; border-radius: 5px; background: transparent; color: #81969b; font-size: 8px; padding: 4px 10px; cursor: pointer; }
.quality-switch button.selected { color: #d7f9f4; background: rgba(85,224,209,.16); }
.science-panel { grid-area: science; padding: 0 17px; box-shadow: none; }
.science-panel details > summary { list-style: none; cursor: pointer; min-height: 58px; display: flex; align-items: center; gap: 11px; }
.science-panel details > summary::-webkit-details-marker { display: none; }
.science-summary-icon { width: 27px; height: 27px; border: 1px solid rgba(85,224,209,.26); border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.science-panel summary strong { display: block; font-size: 11px; font-weight: 650; }
.science-panel summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.summary-chevron { margin-left: auto; color: #8aa2a8; font-size: 16px; transition: transform .2s; }
.science-panel details[open] .summary-chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line); padding: 15px 0 13px; }
.science-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 28px; }
.science-section h3 { margin: 0 0 6px; font-size: 10px; font-weight: 680; color: #d8e8e8; }
.science-section p { margin: 0; color: #91a9ad; font-size: 9px; line-height: 1.65; }
.equation { margin: 7px 0; padding: 8px 10px; border: 1px solid rgba(85,224,209,.13); border-radius: 7px; background: rgba(85,224,209,.045); color: #bcebe4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.disclaimer { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: #718a91; font-size: 8px; }
.footer-note { grid-area: footer; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #5d747c; font-size: 7px; font-weight: 750; letter-spacing: .12em; padding: 0 3px; }
.footer-note b { color: #91aaad; font-weight: 650; letter-spacing: 0; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0,1fr) 310px; padding: 18px; gap: 13px; }
  .stage-card { padding: 15px 15px 0; }
  .readout-grid { gap: 7px; }
  .readout-card { padding: 10px; }
  .readout-label { font-size: 7px; }
  .control-panel { padding: 16px 14px 13px; }
}
@media (max-width: 760px) {
  body { min-width: 320px; }
  .topbar { height: 64px; padding: 0 15px; }
  .brand-mark { width: 27px; height: 27px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 16px; }
  .live-state { padding: 7px 9px; font-size: 7px; }
  .layout { grid-template-columns: minmax(0,1fr); grid-template-areas: "visual" "controls" "science" "footer"; padding: 12px; gap: 12px; }
  .stage-card { padding: 13px 12px 0; }
  .stage-heading { align-items: flex-start; margin-bottom: 10px; }
  .stage-title { font-size: 14px; }
  .schematic-tag { font-size: 6px; padding-top: 3px; }
  .canvas-wrap { height: clamp(225px, 34vh, 300px); min-height: 225px; }
  .canvas-footer { left: 9px; right: 9px; bottom: 8px; gap: 8px 11px; }
  .legend-item { font-size: 7px; }
  .canvas-corner { top: 10px; font-size: 6px; }
  .corner-left { left: 10px; }
  .corner-right { right: 10px; }
  .caption-row { min-height: 48px; }
  .caption-row p { font-size: 10px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .readout-card { padding: 10px 11px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 23px; }
  .readout-note { font-size: 7px; }
  .audit-strip { align-items: flex-start; }
  .audit-status { display: none; }
  .audit-copy > div:last-child { font-size: 8px; }
  .control-panel { padding: 16px 15px 13px; }
  .panel-heading h2 { font-size: 16px; }
  .slider-control { margin-bottom: 13px; }
  .slider-heading label { font-size: 10px; }
  .science-grid { grid-template-columns: 1fr; gap: 13px; }
  .science-panel { padding: 0 13px; }
  .footer-note { flex-wrap: wrap; justify-content: flex-start; gap: 7px 15px; padding: 2px 3px 8px; }
}
@media (max-width: 380px) {
  .topbar { padding: 0 11px; }
  .live-state { font-size: 6px; }
  .layout { padding: 9px; }
  .stage-card { padding: 11px 10px 0; }
  .stage-title { font-size: 13px; }
  .schematic-tag { font-size: 5px; }
  .canvas-wrap { height: 225px; }
  .readout-value { font-size: 21px; }
  .readout-label { letter-spacing: .07em; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
body.embed-mode .topbar { flex: 0 0 76px; }
body.embed-mode .layout { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 760px) {
  body.embed-mode .topbar { flex-basis: 64px; }
  body.embed-mode .layout { align-content: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
