:root {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #111a22;
  --panel-2: #141f29;
  --panel-3: #0e171f;
  --line: rgba(157, 178, 193, 0.15);
  --line-strong: rgba(157, 178, 193, 0.25);
  --text: #e7edf1;
  --muted: #9aabb6;
  --dim: #687b88;
  --accent: #e7ae66;
  --accent-bright: #ffd49a;
  --accent-soft: rgba(231, 174, 102, 0.13);
  --grid: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow: 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: 68px minmax(0, 1fr); overflow: hidden; background: radial-gradient(ellipse at 18% -20%, rgba(52, 73, 87, 0.22), transparent 48%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(10, 16, 22, 0.92); min-width: 0; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border: 1px solid rgba(231,174,102,.46); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-16deg); flex: 0 0 auto; }
.brand-mark span { display: block; border: 1px solid var(--accent); border-radius: 50%; width: 7px; height: 19px; opacity: .9; }
.brand-mark span:nth-child(2) { height: 25px; width: 9px; opacity: .72; }
.brand-mark span:nth-child(3) { height: 15px; opacity: .55; }
.eyebrow, .section-kicker, .control-label-row > label, .metric-label, .caption-index, .stage-corner-note, .stage-bottom-note, .cause-step strong, .rail-footer, .audit-copy strong, .equation-label { letter-spacing: .12em; font-size: 9px; font-weight: 750; color: var(--muted); }
.eyebrow { font-size: 9px; white-space: nowrap; }
.eyebrow-dot { display: inline-block; width: 3px; height: 3px; margin: 0 7px 2px; border-radius: 50%; background: var(--accent); }
.brand-copy h1 { font-size: 20px; letter-spacing: -.045em; line-height: 1.15; margin: 3px 0 0; font-weight: 650; }
.brand-copy h1 em { font-style: normal; color: var(--accent); font-weight: 520; }
.topbar-right { display: flex; align-items: center; gap: 16px; color: var(--dim); font-size: 9px; font-weight: 750; letter-spacing: .13em; white-space: nowrap; }
.status-pill { display: flex; align-items: center; gap: 7px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 20px; padding: 7px 10px; font-size: 8px; letter-spacing: .12em; }
.status-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(231,174,102,.65); }
.status-pill.paused .status-dot { background: #81919b; box-shadow: none; }
.topbar-divider { width: 1px; height: 17px; background: var(--line-strong); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 352px; min-height: 0; overflow: hidden; }
.exhibit-panel { min-width: 0; min-height: 0; padding: 18px 22px 14px 26px; display: grid; grid-template-rows: auto minmax(180px, 1fr) auto auto auto; gap: 10px; overflow: hidden; }
.stage-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; min-height: 43px; }
.section-kicker { color: var(--dim); font-size: 8px; }
.section-kicker span { color: var(--accent); padding: 0 4px; }
.stage-heading h2, .rail-header h2 { font-size: 16px; letter-spacing: -.035em; font-weight: 590; margin: 4px 0 0; }
.stage-heading-right { display: flex; align-items: center; gap: 8px; padding-bottom: 1px; }
.model-tag, .clock-tag { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; color: var(--muted); font-size: 8px; letter-spacing: .1em; font-weight: 700; white-space: nowrap; }
.clock-tag { color: var(--accent-bright); border-color: rgba(231,174,102,.27); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clock-tag small { color: var(--dim); font-size: 7px; margin-left: 3px; text-transform: uppercase; letter-spacing: .1em; }
.visual-stage { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #0d151d; isolation: isolate; }
.visual-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.015), inset 0 -40px 90px rgba(2,7,11,.16); }
#simulation-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; }
.stage-annotation { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 4px; font-size: 7px; color: #b4c1c9; letter-spacing: .14em; font-weight: 750; pointer-events: none; text-shadow: 0 1px 4px #081018; }
.stage-annotation b { color: var(--accent-bright); font-size: 10px; margin-left: 3px; }
.annotation-source { left: 5.5%; top: 17%; }
.annotation-gel { left: 28%; top: 17%; }
.annotation-line { width: 1px; height: 13px; background: rgba(231,174,102,.65); margin-left: 5px; }
.annotation-gel .annotation-line { background: rgba(171,191,203,.65); }
.stage-corner-note { position: absolute; z-index: 2; top: 13px; right: 14px; color: #718490; font-size: 7px; pointer-events: none; }
.stage-bottom-note { position: absolute; z-index: 2; bottom: 10px; left: 14px; display: flex; align-items: center; gap: 7px; color: #7e909b; font-size: 7px; pointer-events: none; }
.legend-swatch { width: 11px; height: 3px; display: inline-block; border-radius: 3px; }
.swatch-precipitate { background: var(--accent); box-shadow: 0 0 6px rgba(231,174,102,.6); }
.swatch-diffusion { background: #a5b7c2; margin-left: 7px; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.metric-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: rgba(19,29,38,.72); padding: 9px 11px 8px; }
.metric-label { color: var(--dim); font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.number-tag { display: inline-block; color: #83939d; border: 1px solid rgba(131,147,157,.24); border-radius: 3px; padding: 1px 3px; margin-left: 4px; font-size: 6px; line-height: 1.2; letter-spacing: .09em; vertical-align: 1px; font-weight: 800; }
.metric-value { margin-top: 5px; font-size: 19px; font-weight: 570; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { color: var(--muted); font-size: 10px; font-weight: 500; margin-left: 2px; letter-spacing: 0; }
.audit-strip { display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 6px 11px; border: 1px solid rgba(231,174,102,.2); border-radius: 6px; background: linear-gradient(90deg, rgba(231,174,102,.075), rgba(231,174,102,.018)); }
.audit-icon { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(231,174,102,.5); color: var(--accent); display: grid; place-items: center; font-size: 10px; flex: 0 0 auto; }
.audit-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.audit-copy strong { color: #c7d0d5; font-size: 7px; }
.audit-copy > span { color: #a8b6be; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.textbook-tag { color: var(--accent); border-color: rgba(231,174,102,.28); }
.audit-status { margin-left: auto; color: var(--accent); font-size: 7px; letter-spacing: .1em; font-weight: 800; flex: 0 0 auto; }
.caption-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: start; gap: 10px; padding: 2px 2px 0; }
.caption-index { color: var(--accent); font-size: 7px; padding-top: 3px; white-space: nowrap; }
.caption-row p { margin: 0; color: #aab8c0; font-size: 10px; line-height: 1.5; max-width: 850px; }
.cause-chain { display: flex; align-items: center; gap: 13px; padding: 8px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 47px; }
.cause-step { display: grid; grid-template-columns: 19px auto; grid-template-rows: auto auto; column-gap: 6px; align-items: center; min-width: 0; }
.cause-step > span { grid-row: 1 / 3; color: var(--accent); font-size: 9px; font-variant-numeric: tabular-nums; }
.cause-step strong { color: #b7c3ca; font-size: 7px; }
.cause-step small { color: var(--dim); font-size: 8px; margin-top: 2px; white-space: nowrap; }
.cause-arrow { color: #657781; font-size: 12px; }
.control-rail { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); background: linear-gradient(160deg, rgba(19,29,38,.96), rgba(13,21,29,.98)); padding: 20px 18px 12px; scrollbar-width: thin; scrollbar-color: #34434e transparent; }
.rail-header { display: flex; align-items: end; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rail-header h2 { font-size: 15px; }
.rail-index { color: #6c7d88; font-size: 8px; letter-spacing: .14em; font-weight: 750; }
.preset-block { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.control-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.control-label-row > label { color: #b3c0c8; font-size: 8px; letter-spacing: .075em; }
.control-label-row output { color: var(--accent-bright); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.value-with-tag { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.preset-button { background: #101922; border: 1px solid var(--line-strong); border-radius: 5px; padding: 8px 7px; color: #9baab3; font-size: 9px; font-weight: 650; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.preset-button.active { border-color: rgba(231,174,102,.62); color: var(--accent-bright); background: rgba(231,174,102,.08); }
.preset-button:hover, .icon-button:hover, .utility-button:hover { border-color: rgba(231,174,102,.58); color: var(--text); }
.control-list { display: grid; gap: 13px; padding: 14px 0 13px; }
.range-control { min-width: 0; }
.range-control input[type="range"] { display: block; width: 100%; margin: 9px 0 3px; accent-color: var(--accent); cursor: pointer; height: 14px; background: transparent; }
.range-control input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.range-ends { display: flex; justify-content: space-between; color: #71838e; font-size: 7px; font-variant-numeric: tabular-nums; }
.range-ends i { font-style: normal; color: #596d79; font-size: 6px; margin-left: 2px; }
.transport-note { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 8px 9px; color: #8496a1; font-size: 8px; line-height: 1.4; }
.transport-icon { color: var(--accent); font-size: 13px; }
.playback-block { padding: 13px 0 12px; }
.playback-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; }
.play-button, .icon-button, .utility-button { min-width: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: #111c25; height: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 8px; letter-spacing: .06em; font-weight: 800; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.play-button { background: var(--accent); border-color: var(--accent); color: #17202a; font-size: 9px; }
.play-button:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.play-symbol { font-size: 12px; line-height: 1; }
.icon-button { color: #b4c1c8; }
.utility-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; }
.utility-button { height: 29px; color: #84949e; font-size: 7px; letter-spacing: .08em; }
.quality-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px rgba(231,174,102,.5); }
.science-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-panel summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 12px 0; color: #c3cdd3; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-plus { color: var(--accent); font-size: 14px; font-weight: 400; transition: transform .2s ease; }
.science-panel[open] .science-plus { transform: rotate(45deg); }
.science-content { padding: 0 0 12px; animation: reveal .2s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.science-intro, .equation-block p, .science-notes li, .source-note, .disclaimer { color: #91a2ad; font-size: 8px; line-height: 1.55; }
.science-intro { margin: 0 0 10px; }
.equation-block { border: 1px solid var(--line); border-radius: 5px; background: rgba(8,14,19,.32); padding: 8px 9px; margin: 7px 0; }
.equation-label { font-size: 7px; color: #7d909b; margin-bottom: 6px; }
.equation-block code { display: block; color: var(--accent-bright); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; line-height: 1.65; white-space: normal; }
.equation-block p { margin: 5px 0 0; }
.science-notes { padding-top: 7px; }
.science-notes > strong { font-size: 7px; color: #c0cbd1; letter-spacing: .12em; }
.science-notes ul { margin: 6px 0 8px; padding-left: 14px; }
.science-notes li { padding: 1px 0; }
.source-note { color: #71838e; font-size: 7px; }
.disclaimer { color: #c5a477; font-size: 7px; margin: 8px 0 0; }
.rail-footer { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; color: #52646f; font-size: 6px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 980px) and (min-width: 641px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  .exhibit-panel { padding-left: 18px; padding-right: 16px; }
  .control-rail { padding-left: 14px; padding-right: 14px; }
  .stage-heading h2 { font-size: 14px; }
  .metric-card { padding-left: 8px; padding-right: 8px; }
  .metric-label { font-size: 6px; }
}
@media (max-width: 640px) {
  body { overflow: hidden; }
  .app-shell { grid-template-rows: 58px minmax(0, 1fr); }
  .topbar { padding: 0 14px; }
  .brand-lockup { gap: 10px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-copy h1 { font-size: 17px; }
  .eyebrow { font-size: 7px; letter-spacing: .08em; }
  .topbar-right { gap: 8px; }
  .topbar-meta, .topbar-divider { display: none; }
  .status-pill { padding: 6px 8px; font-size: 7px; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(285px, 43%) minmax(0, 57%); overflow: hidden; }
  .exhibit-panel { padding: 10px 10px 8px; gap: 7px; grid-template-rows: auto minmax(120px, 1fr) auto auto auto; }
  .stage-heading { min-height: 34px; }
  .stage-heading h2 { font-size: 13px; margin-top: 3px; }
  .section-kicker { font-size: 7px; }
  .model-tag { display: none; }
  .clock-tag { padding: 5px 6px; font-size: 8px; }
  .visual-stage { border-radius: 6px; }
  .annotation-source { left: 5%; top: 13%; }
  .annotation-gel { left: 30%; top: 13%; }
  .stage-corner-note { top: 8px; right: 8px; font-size: 6px; }
  .stage-bottom-note { display: none; }
  .metric-strip { gap: 4px; }
  .metric-card { padding: 6px 6px 5px; border-radius: 4px; }
  .metric-label { font-size: 5px; letter-spacing: .06em; }
  .metric-label .number-tag { display: none; }
  .metric-value { font-size: 15px; margin-top: 4px; }
  .metric-value small { font-size: 8px; }
  .audit-strip { min-height: 33px; padding: 5px 7px; gap: 7px; }
  .audit-icon { width: 15px; height: 15px; font-size: 9px; }
  .audit-copy strong { font-size: 6px; }
  .audit-copy > span { font-size: 7px; }
  .audit-status { font-size: 6px; }
  .caption-row { grid-template-columns: 1fr; gap: 2px; padding: 0 1px; }
  .caption-index { font-size: 6px; }
  .caption-row p { font-size: 8px; line-height: 1.35; }
  .cause-chain { display: none; }
  .control-rail { border-left: 0; border-top: 1px solid var(--line); padding: 12px 14px 16px; }
  .rail-header { padding-bottom: 10px; }
  .rail-header h2 { font-size: 14px; }
  .preset-block { padding: 10px 0; }
  .control-list { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 11px; padding: 11px 0; }
  .control-label-row > label { font-size: 7px; letter-spacing: .035em; }
  .control-label-row output { font-size: 9px; }
  .range-control input[type="range"] { margin: 6px 0 2px; }
  .range-ends { font-size: 6px; }
  .range-ends i { font-size: 5px; }
  .transport-note { font-size: 7px; padding: 6px 8px; }
  .playback-block { padding: 10px 0; }
  .play-button, .icon-button { height: 32px; }
  .utility-button { height: 27px; }
  .science-panel summary { padding: 10px 0; }
  .rail-footer { padding-top: 8px; }
}
@media (max-width: 380px) {
  .workspace { grid-template-rows: minmax(275px, 42%) minmax(0, 58%); }
  .control-rail { padding-left: 11px; padding-right: 11px; }
  .control-list { column-gap: 10px; }
  .control-label-row > label { font-size: 6px; }
  .range-ends i { display: block; margin: 1px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
