:root {
  color-scheme: dark;
  --bg: #080d12;
  --panel: #0d151c;
  --panel-2: #111c24;
  --line: rgba(174, 202, 212, .12);
  --line-strong: rgba(174, 202, 212, .2);
  --text: #e6eff1;
  --muted: #8b9ca5;
  --dim: #60727b;
  --accent: #63e0ce;
  --accent-soft: rgba(99, 224, 206, .12);
  --warning: #d6bd83;
  --danger: #d78d84;
  --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 { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 26% 15%, rgba(28, 64, 69, .18), transparent 42%), var(--bg); }
.topbar { height: 72px; min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 18, .92); position: relative; z-index: 3; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(99,224,206,.5); border-radius: 50%; position: relative; display: grid; place-items: center; }
.brand-mark span { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.brand-mark span:nth-child(1) { transform: translateY(-8px); }
.brand-mark span:nth-child(2) { transform: translate(-7px, 5px); }
.brand-mark span:nth-child(3) { transform: translate(7px, 5px); }
.eyebrow, .stage-kicker, .section-heading, .caption-label, .stage-time span, .canvas-hint, .rail-footer { letter-spacing: .13em; font-size: 9px; font-weight: 750; color: var(--muted); }
.brand-title { font-size: 14px; font-weight: 650; letter-spacing: -.02em; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.live-indicator { display: flex; align-items: center; gap: 8px; color: #a9babf; 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 12px rgba(99,224,206,.6); }
.icon-button { border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(255,255,255,.025); display: flex; align-items: center; gap: 8px; padding: 8px 11px; font-size: 11px; color: #c5d2d5; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
button:hover { border-color: rgba(99,224,206,.55); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 372px; flex: 1; min-height: 0; }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 42% 48%, rgba(26, 66, 70, .18), transparent 48%), linear-gradient(145deg, #0a1218 0%, #091016 65%, #0a1117 100%); }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-right: 1px solid rgba(174,202,212,.08); }
#viz { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.stage-heading { position: absolute; z-index: 1; top: 25px; left: 28px; pointer-events: none; }
.stage-heading h1 { font-size: clamp(18px, 2vw, 24px); letter-spacing: -.045em; font-weight: 590; margin: 7px 0 5px; }
.stage-heading p { margin: 0; color: #8da0a7; font-size: 11px; }
.stage-kicker { color: var(--accent); }
.stage-bottom { position: absolute; z-index: 2; bottom: 18px; left: 20px; right: 20px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(174,202,212,.13); border-radius: 12px; padding: 11px 14px; background: rgba(9, 17, 23, .84); backdrop-filter: blur(14px); box-shadow: 0 8px 28px rgba(0,0,0,.18); }
.caption-icon { width: 25px; height: 25px; flex: 0 0 25px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); }
.caption-icon span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(99,224,206,.5); }
.caption-copy { min-width: 0; flex: 1; }
.caption-label { color: var(--accent); font-size: 8px; }
.caption-copy p { margin: 3px 0 0; font-size: 11px; line-height: 1.4; color: #c2d0d3; }
.stage-time { padding-left: 15px; border-left: 1px solid var(--line-strong); min-width: 75px; }
.stage-time span { display: block; font-size: 7px; }
.stage-time strong { display: block; font-size: 14px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stage-time small { color: var(--muted); font-size: 9px; font-weight: 500; }
.canvas-hint { position: absolute; right: 24px; bottom: 94px; z-index: 1; font-size: 8px; color: #6e858d; pointer-events: none; }
.control-rail { min-width: 0; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(180deg, #0e171e, #0b1319); border-left: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #2b4148 transparent; padding: 0 19px 18px; }
.rail-section { padding: 17px 0 16px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; color: #b5c5c9; font-size: 9px; }
.section-note { font-size: 8px; color: #637982; letter-spacing: .1em; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 9px 7px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.018); cursor: pointer; transition: all .2s ease; }
.preset-button[aria-pressed="true"] { border-color: rgba(99,224,206,.52); background: rgba(99,224,206,.075); box-shadow: inset 0 0 0 1px rgba(99,224,206,.06); }
.preset-glyph { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,255,255,.055); color: var(--accent); font-size: 15px; }
.preset-button b { display: block; font-size: 9px; line-height: 1.2; font-weight: 650; }
.preset-button small { display: block; color: var(--muted); font-size: 8px; margin-top: 3px; white-space: nowrap; }
.slider-block { margin-top: 14px; }
.slider-topline { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.slider-topline label { color: #d1dcde; font-size: 11px; font-weight: 550; }
.slider-topline em { color: var(--accent); font-style: italic; }
.slider-topline output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 16px; margin: 5px 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) 0%, rgba(99,224,206,.3) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: rgba(99,224,206,.3); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #d9fffa; border: 2px solid #3a9f94; box-shadow: 0 0 0 3px rgba(99,224,206,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d9fffa; border: 2px solid #3a9f94; box-shadow: 0 0 0 3px rgba(99,224,206,.12); }
.range-ends { display: flex; justify-content: space-between; color: #62747c; font-size: 8px; margin-top: 0; font-variant-numeric: tabular-nums; }
.field-hint { color: #6f8189; font-size: 8px; margin-top: 4px; }
.control-actions { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; margin-top: 16px; }
.action-button { min-width: 0; height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.025); color: #c4d0d3; font-size: 10px; cursor: pointer; transition: .2s; }
.action-button.primary { background: var(--accent); border-color: var(--accent); color: #09201f; font-weight: 750; }
.action-button.primary:hover { background: #83f1e3; }
.button-icon { font-size: 14px; line-height: 1; }
.utility-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.toggle-control { display: flex; align-items: center; gap: 7px; color: #a8b7bb; font-size: 9px; cursor: pointer; }
.toggle-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { width: 25px; height: 14px; border-radius: 10px; background: #2b3b42; position: relative; transition: background .2s; }
.toggle-track::after { content: ""; position: absolute; width: 10px; height: 10px; top: 2px; left: 2px; border-radius: 50%; background: #9aabb0; transition: transform .2s, background .2s; }
.toggle-control input:checked + .toggle-track { background: rgba(99,224,206,.42); }
.toggle-control input:checked + .toggle-track::after { transform: translateX(11px); background: #d9fffa; }
.toggle-control input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.quality-switch { display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0,0,0,.15); }
.quality-switch button { border: 0; border-radius: 5px; padding: 4px 8px; background: transparent; color: #7f9096; font-size: 8px; cursor: pointer; }
.quality-switch button[aria-pressed="true"] { color: #cce5e3; background: rgba(99,224,206,.13); }
.share-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 12px; }
.share-cell { padding: 9px 9px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); }
.share-name { display: flex; justify-content: space-between; color: #8ea0a7; font-size: 8px; letter-spacing: .08em; }
.share-name i { color: var(--accent); font-style: normal; }
.share-cell strong { display: block; margin-top: 6px; font-size: 15px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.metric-cell { min-width: 0; padding: 9px; border-radius: 8px; background: rgba(255,255,255,.022); border: 1px solid rgba(174,202,212,.08); }
.metric-cell span { display: block; color: #81939a; font-size: 8px; }
.metric-cell strong { display: block; margin-top: 5px; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-cell strong small { font-size: 8px; font-weight: 500; color: #81939a; }
.stability-chip { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 6px 8px; border: 1px solid rgba(99,224,206,.2); border-radius: 20px; background: rgba(99,224,206,.055); color: var(--accent); font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.chip-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.stability-chip.neutral, .stability-chip.repelling { color: var(--accent); border-color: rgba(99,224,206,.2); background: rgba(99,224,206,.055); }
.check-section { padding-bottom: 15px; }
.check-card { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.018); padding: 10px; }
.check-equation { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.check-rows { display: grid; gap: 7px; padding: 9px 0; }
.check-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.check-rows span { color: #8c9da3; font-size: 8px; }
.check-rows strong { color: #d5e0e2; font-size: 9px; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); color: #9eb0b4; font-size: 8px; }
.check-pass { color: var(--accent); font-weight: 750; letter-spacing: .08em; display: flex; align-items: center; gap: 5px; }
.check-pass i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 15px 0; color: #b9c8cb; font-size: 9px; letter-spacing: .13em; font-weight: 750; }
.science-panel summary::-webkit-details-marker { display: none; }
.details-plus { color: var(--accent); font-size: 17px; font-weight: 400; transition: transform .2s; }
.science-panel[open] .details-plus { transform: rotate(45deg); }
.science-content { padding: 0 0 14px; color: #aab9bd; font-size: 10px; line-height: 1.55; }
.science-content h3 { margin: 10px 0 5px; color: #e0e9ea; font-size: 11px; font-weight: 650; }
.science-content p { margin: 5px 0 8px; }
.equation-block { padding: 9px 10px; margin: 7px 0; border: 1px solid var(--line); border-radius: 7px; background: rgba(0,0,0,.18); color: #d1e8e5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.7; }
.equation-block.matrix { width: fit-content; }
.matrix-label { display: flex; justify-content: space-between; align-items: center; font-size: 9px; }
.matrix-label span, .source-tag { color: var(--accent); font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.science-content ul { margin: 7px 0 10px; padding-left: 17px; }
.science-content li { margin: 4px 0; }
.disclaimer { margin-top: 12px !important; padding-top: 9px; border-top: 1px solid var(--line); color: #84969d; font-size: 9px; }
.rail-footer { padding-top: 12px; font-size: 7px; color: #5e727a; text-align: center; }
.rail-footer span { color: var(--accent); padding: 0 4px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .control-rail { padding-left: 15px; padding-right: 15px; }
  .topbar { padding: 0 18px; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar { height: 58px; min-height: 58px; padding: 0 13px; }
  .brand-mark { width: 27px; height: 27px; }
  .eyebrow { font-size: 7px; }
  .brand-title { font-size: 12px; }
  .topbar-right { gap: 9px; }
  .live-indicator { font-size: 7px; gap: 6px; }
  .icon-button { padding: 7px 8px; font-size: 9px; gap: 5px; }
  .icon-button svg { width: 13px; height: 13px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .stage { flex: 0 0 clamp(270px, 42dvh, 355px); min-height: 270px; }
  .stage-heading { top: 14px; left: 14px; max-width: 205px; }
  .stage-heading h1 { font-size: 14px; line-height: 1.12; margin: 5px 0 3px; max-width: 205px; }
  .stage-heading p { font-size: 9px; max-width: 195px; line-height: 1.3; }
  .stage-kicker { font-size: 7px; }
  .stage-bottom { bottom: 9px; left: 9px; right: 9px; padding: 8px 9px; gap: 8px; border-radius: 9px; }
  .caption-icon { width: 20px; height: 20px; flex-basis: 20px; border-radius: 6px; }
  .caption-copy p { font-size: 9px; line-height: 1.3; }
  .caption-label { font-size: 7px; }
  .stage-time { min-width: 58px; padding-left: 8px; }
  .stage-time span { font-size: 6px; }
  .stage-time strong { font-size: 11px; }
  .canvas-hint { display: none; }
  .control-rail { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 13px 14px; border-left: 0; border-top: 1px solid var(--line); }
  .rail-section { padding: 13px 0; }
  .section-heading { font-size: 8px; }
  .preset-grid { margin-top: 9px; }
  .preset-button { padding: 8px 6px; gap: 5px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .preset-glyph { width: 17px; height: 17px; flex-basis: 17px; font-size: 13px; }
  .slider-block { margin-top: 11px; }
  .slider-topline label { font-size: 10px; }
  .slider-topline output { font-size: 9px; }
  .range-ends { font-size: 7px; }
  .control-actions { margin-top: 12px; }
  .action-button { height: 32px; font-size: 9px; }
  .utility-row { margin-top: 10px; }
  .share-cell { padding: 8px; }
  .share-cell strong { font-size: 14px; }
  .metric-cell { padding: 8px; }
  .metric-cell strong { font-size: 12px; }
}
@media (max-width: 380px) {
  .topbar { padding: 0 10px; }
  .live-indicator { display: none; }
  .stage-heading h1 { font-size: 15px; }
  .stage-heading p { max-width: 175px; }
  .preset-button { gap: 4px; }
  .preset-glyph { display: none; }
  .control-rail { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
