:root {
  color-scheme: dark;
  --bg: #070d14;
  --panel: #0c1621;
  --panel-2: #101d2a;
  --line: rgba(143, 177, 203, .13);
  --line-strong: rgba(143, 177, 203, .23);
  --text: #e9f0f5;
  --muted: #8fa2b2;
  --subtle: #62778a;
  --cyan: #62d9e9;
  --amber: #e6aa64;
  --blue: #73a9ff;
  --violet: #b99aff;
  --radius: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; background: radial-gradient(ellipse at 51% 38%, #101e2a 0%, #09121c 43%, #060b11 100%); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(6, 12, 19, .9); position: relative; z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(98,217,233,.35); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); background: linear-gradient(145deg, rgba(98,217,233,.12), rgba(98,217,233,.015)); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--cyan); box-shadow: 0 0 10px rgba(98,217,233,.6); }
.brand-mark span:nth-child(1) { height: 10px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 19px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .75; }
.eyebrow, .section-label, .stage-kicker, .hud-label { color: #7f95a8; letter-spacing: .14em; font-size: 9px; font-weight: 750; }
.brand-lockup h1 { margin: 3px 0 0; font-size: 16px; letter-spacing: -.035em; font-weight: 650; white-space: nowrap; }
.brand-lockup h1 span { color: #526a7d; padding: 0 3px; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.live-indicator { display: flex; align-items: center; gap: 7px; font-size: 9px; color: #a7b8c6; letter-spacing: .13em; font-weight: 750; }
.live-indicator i, .view-chip i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #7b8791; box-shadow: 0 0 0 3px rgba(123,135,145,.11); }
.live-indicator.running i { background: #75d8a4; box-shadow: 0 0 0 3px rgba(117,216,164,.12), 0 0 12px rgba(117,216,164,.5); }
.seed-chip { color: #71879a; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-size: 9px; letter-spacing: .1em; }
.seed-chip b { color: #c9d7e2; margin-left: 5px; font-variant-numeric: tabular-nums; }
.icon-button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #9db1c1; cursor: pointer; font-size: 15px; }
.workspace { height: calc(100vh - 94px); min-height: 610px; display: grid; grid-template-columns: 278px minmax(390px, 1fr) 264px; gap: 12px; padding: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(15,27,39,.96), rgba(9,18,28,.97)); box-shadow: 0 18px 50px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.018); min-width: 0; }
.controls-panel, .data-panel { padding: 17px 16px 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #263a4c transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: -.035em; font-weight: 650; }
.panel-index { color: #5b7185; font-size: 10px; font-weight: 700; border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; }
.preset-section { padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.section-label { margin-bottom: 10px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset { min-width: 0; padding: 9px 7px 8px; text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.018); border-radius: 8px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.preset.active { border-color: rgba(230,170,100,.48); background: rgba(230,170,100,.075); }
.preset b { display: block; margin-top: 6px; font-size: 10px; font-weight: 700; }
.preset small { display: block; margin-top: 3px; color: #72889b; font-size: 8px; white-space: nowrap; }
.preset-dot { display: block; width: 7px; height: 7px; border-radius: 50%; }
.preset-dot.amber { background: var(--amber); box-shadow: 0 0 9px rgba(230,170,100,.55); }
.preset-dot.cyan { background: var(--cyan); box-shadow: 0 0 9px rgba(98,217,233,.55); }
.preset-dot.violet { background: var(--violet); box-shadow: 0 0 9px rgba(185,154,255,.55); }
.control-group { padding: 15px 0 13px; border-bottom: 1px solid var(--line); }
.control { display: block; margin-top: 12px; }
.control:first-of-type { margin-top: 0; }
.control-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #b7c5d0; font-size: 10px; }
.control-top output { color: #e8f1f7; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-top em { color: var(--amber); font-style: italic; }
input[type="range"] { width: 100%; height: 14px; margin: 7px 0 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(98,217,233,.75), rgba(98,217,233,.16)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(98,217,233,.75), rgba(98,217,233,.16)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; border: 2px solid #0d1b27; background: #9debf1; box-shadow: 0 0 0 1px rgba(98,217,233,.65), 0 0 10px rgba(98,217,233,.45); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #0d1b27; background: #9debf1; box-shadow: 0 0 0 1px rgba(98,217,233,.65), 0 0 10px rgba(98,217,233,.45); }
.range-ends { display: flex; justify-content: space-between; color: #5f7588; font-size: 8px; margin-top: -1px; }
.transport-section { padding: 15px 0 12px; }
.transport-buttons { display: grid; grid-template-columns: 1fr 38px 38px; gap: 7px; }
.primary-action, .square-action { border-radius: 8px; height: 36px; border: 1px solid var(--line-strong); cursor: pointer; transition: .18s ease; }
.primary-action { display: flex; align-items: center; justify-content: center; gap: 9px; background: linear-gradient(135deg, #2b7c86, #1b5969); border-color: rgba(98,217,233,.35); color: #e9fcff; font-size: 11px; font-weight: 750; box-shadow: 0 5px 16px rgba(20,112,125,.14); }
.primary-action:hover { filter: brightness(1.12); }
.play-glyph { font-size: 10px; }
.square-action { background: rgba(255,255,255,.03); color: #afc0cd; font-size: 14px; }
.square-action:hover { background: rgba(255,255,255,.08); border-color: rgba(98,217,233,.35); }
.speed-control { margin-top: 13px; }
.control-footer { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.text-action { border: 0; background: transparent; color: #8095a7; padding: 5px 0; font-size: 9px; cursor: pointer; }
.text-action:hover { color: #d8e5ed; }
.quality-led { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #70d8a4; box-shadow: 0 0 8px rgba(112,216,164,.5); }
.stage { display: flex; flex-direction: column; overflow: hidden; position: relative; min-height: 0; }
.stage-topline { height: 45px; flex: 0 0 45px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); }
.stage-caption { display: flex; align-items: center; gap: 9px; color: #879bad; font-size: 9px; }
.stage-kicker { color: #a7bac9; }
.stage-separator { color: #405568; }
.stage-tools { display: flex; align-items: center; gap: 13px; }
.view-chip { color: #7f98a9; display: flex; align-items: center; gap: 7px; font-size: 8px; letter-spacing: .12em; }
.view-chip i { background: #64d8c2; box-shadow: 0 0 8px rgba(100,216,194,.5); }
.stage-tool { border: 0; background: transparent; color: #a5b7c5; font-size: 9px; cursor: pointer; }
.stage-tool:hover { color: white; }
.scene-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 52% 45%, #142638 0%, #0b1723 46%, #09131d 100%); }
.scene { position: absolute; inset: 0; }
.scene canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 40%, rgba(3,8,13,.32) 100%), linear-gradient(180deg, rgba(4,10,16,.1), transparent 18%, transparent 75%, rgba(4,10,16,.22)); }
.scene-hud { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.scene-hud b { color: #d4e1e9; font-size: 10px; font-weight: 650; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.hud-label { font-size: 7px; color: #7690a5; }
.hud-top-left { top: 17px; left: 17px; }
.hud-bottom-left { left: 17px; bottom: 17px; }
.hud-bottom-right { right: 17px; bottom: 17px; text-align: right; }
.annotation { position: absolute; z-index: 3; display: flex; align-items: center; gap: 7px; pointer-events: none; color: #a8bdcc; font-size: 8px; letter-spacing: .02em; opacity: .92; text-shadow: 0 2px 8px rgba(0,0,0,.75); white-space: nowrap; }
.annotation i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.annotation b { display: block; margin-bottom: 3px; color: #e3edf3; font-size: 7px; letter-spacing: .12em; }
.anno-mechanism i { background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.anno-result i { background: #e6a35e; box-shadow: 0 0 9px #e6a35e; }
.stage-legend { min-height: 38px; flex: 0 0 38px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 15px; }
.legend-item { display: flex; align-items: center; gap: 6px; color: #8094a5; font-size: 8px; white-space: nowrap; }
.legend-swatch { display: inline-block; width: 7px; height: 7px; border-radius: 2px; }
.source-swatch { background: #54cbdc; box-shadow: 0 0 7px rgba(84,203,220,.4); }
.band-swatch { background: #d99653; }
.gel-swatch { background: #6b9db3; }
.drag-hint { margin-left: auto; color: #536b7f; font-size: 7px; letter-spacing: .13em; white-space: nowrap; }
.drag-hint span { color: #9cb0bf; padding: 0 3px; }
.loading-overlay, .context-overlay { position: absolute; z-index: 6; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: rgba(7,14,22,.92); color: #d8e7ef; font-size: 11px; transition: opacity .3s ease; }
.loading-overlay span, .context-overlay span { color: #7890a3; font-size: 9px; }
.loading-overlay.hidden, .context-overlay.hidden { opacity: 0; pointer-events: none; }
.loader-orbit { width: 28px; height: 28px; border: 2px solid rgba(98,217,233,.16); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.context-overlay { display: none; }
.context-overlay.visible { display: flex; }
.data-panel .panel-heading { padding-bottom: 15px; }
.readout-stack { display: grid; gap: 8px; padding: 13px 0; }
.readout-card { border: 1px solid var(--line); border-radius: 10px; padding: 11px 11px 9px; background: rgba(255,255,255,.018); min-width: 0; }
.readout-head { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: #8298aa; font-size: 7px; letter-spacing: .1em; font-weight: 750; }
.readout-tag { border-radius: 4px; padding: 3px 5px; font-size: 6px; letter-spacing: .08em; white-space: nowrap; }
.textbook { color: #6fd9e5; background: rgba(98,217,233,.1); }
.illustrative { color: #e6b277; background: rgba(230,170,100,.11); }
.scaled { color: #a8a0f3; background: rgba(157,147,241,.1); }
.readout-value { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.readout-value strong { color: #edf5f8; font-size: 24px; letter-spacing: -.055em; font-weight: 650; font-variant-numeric: tabular-nums; }
.readout-value small { color: #879bad; font-size: 9px; }
.readout-note { margin-top: 3px; color: #62788b; font-size: 8px; }
.micro-bar, .time-strip { height: 3px; margin-top: 10px; border-radius: 4px; background: rgba(255,255,255,.055); overflow: hidden; }
.micro-bar i, .time-strip i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s ease; background: var(--cyan); box-shadow: 0 0 8px rgba(98,217,233,.35); }
.amber-card .micro-bar i { background: var(--amber); }
.blue-card .micro-bar i { background: var(--blue); }
.band-ticks { display: flex; align-items: end; gap: 4px; height: 9px; margin-top: 8px; }
.band-ticks i { flex: 1; height: 3px; background: rgba(230,170,100,.13); border-radius: 3px; }
.band-ticks i.active { height: 8px; background: linear-gradient(180deg, #f2c17f, #b97842); box-shadow: 0 0 6px rgba(230,170,100,.25); }
.time-strip i { background: var(--violet); box-shadow: 0 0 8px rgba(185,154,255,.35); }
.validation-card { padding: 12px; border: 1px solid rgba(98,217,233,.16); border-radius: 10px; background: linear-gradient(135deg, rgba(98,217,233,.055), rgba(98,217,233,.012)); }
.validation-title { display: flex; justify-content: space-between; align-items: center; color: #b5c6d1; font-size: 8px; letter-spacing: .1em; font-weight: 750; }
.check-mark { color: #72d8a7; font-size: 13px; }
.validation-subtitle { margin-top: 6px; color: #6f8597; font-size: 8px; line-height: 1.4; }
.validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.validation-grid div { display: flex; flex-direction: column; gap: 4px; }
.validation-grid small { color: #6e8495; font-size: 7px; letter-spacing: .1em; }
.validation-grid b { color: #e0edf2; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.validation-diff { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(98,217,233,.12); margin-top: 9px; padding-top: 8px; color: #8297a7; font-size: 8px; }
.validation-diff b { color: #74dfbb; font-size: 11px; }
.validation-foot { margin-top: 7px; color: #5d7486; font-size: 7px; }
.science-teaser { display: flex; align-items: center; gap: 9px; padding: 12px 0 2px; }
.science-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(185,154,255,.1); color: #c5b2ff; font-size: 17px; }
.science-teaser div:nth-child(2) { min-width: 0; flex: 1; }
.science-teaser b { display: block; color: #cbd8e1; font-size: 9px; }
.science-teaser span { display: block; margin-top: 3px; color: #6f8597; font-size: 8px; line-height: 1.35; }
.science-teaser button { border: 0; background: transparent; color: #8ba1b3; cursor: pointer; font-size: 14px; }
.footer-note { height: 20px; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; color: #43596c; font-size: 7px; letter-spacing: .13em; }
.science-details { margin-top: 11px; border: 1px solid rgba(143,177,203,.18); border-radius: 10px; background: rgba(255,255,255,.018); overflow: hidden; }
.science-summary { display: flex; align-items: center; gap: 9px; padding: 11px; cursor: pointer; list-style: none; }
.science-summary::-webkit-details-marker { display: none; }
.science-summary-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #c5b2ff; background: rgba(185,154,255,.1); font-size: 16px; }
.science-summary-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.science-summary-copy b { color: #d9e5ec; font-size: 9px; }
.science-summary-copy small { color: #71879a; font-size: 7px; }
.science-chevron { color: #91a6b7; font-size: 15px; transition: transform .2s ease; }
.science-details[open] { border-color: rgba(98,217,233,.28); background: rgba(98,217,233,.025); }
.science-details[open] .science-chevron { transform: rotate(180deg); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 4px 0 0; font-size: 11px; letter-spacing: -.03em; }
.dialog-close { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.03); color: #a7b8c6; font-size: 17px; cursor: pointer; }
.science-content { padding: 7px 12px 13px; overflow: visible; max-height: none; }
.science-section { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.science-number { color: #70cdd9; font-size: 10px; font-weight: 800; padding-top: 2px; }
.science-section h3, .assumption-box h3 { margin: 0 0 6px; color: #d8e4eb; font-size: 10px; }
.science-section p { margin: 0; color: #8da1b1; font-size: 8px; line-height: 1.55; }
.equation { margin: 8px 0 5px; padding: 8px 9px; border-left: 2px solid rgba(98,217,233,.55); background: rgba(98,217,233,.045); color: #c8e9ee; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.equation-note { color: #6e8597 !important; font-size: 7px !important; }
.assumption-box { margin-top: 11px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); }
.assumption-box ul { margin: 7px 0 0; padding-left: 15px; color: #879cac; font-size: 7px; line-height: 1.55; }
.disclaimer { margin-top: 10px; color: #62798b; font-size: 7px; letter-spacing: .03em; line-height: 1.4; }
body.embed .topbar, body.embed .footer-note { display: none; }
body.embed .workspace { min-height: 0; padding: 0; gap: 0; }
body.embed .stage { border-radius: 0; border-top: 0; border-bottom: 0; }
body.embed .data-panel { border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 260px minmax(330px,1fr) 240px; gap: 9px; padding: 9px; }
  .controls-panel, .data-panel { padding-left: 13px; padding-right: 13px; }
  .stage-legend { gap: 10px; }
  .legend-item { font-size: 7px; }
}
@media (max-width: 920px) {
  .topbar { height: 66px; padding: 0 14px; }
  .workspace { height: auto; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(220px, .62fr); grid-template-areas: "stage stage" "controls data"; grid-template-rows: minmax(420px, 58vh) auto; }
  .stage { grid-area: stage; }
  .controls-panel { grid-area: controls; }
  .data-panel { grid-area: data; }
  .footer-note { height: 25px; }

}
@media (max-width: 600px) {
  .topbar { height: 62px; padding: 0 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-lockup { gap: 10px; }
  .brand-lockup .eyebrow { font-size: 7px; }
  .brand-lockup h1 { font-size: 13px; }
  .topbar-right { gap: 8px; }
  .seed-chip { display: none; }
  .live-indicator { font-size: 8px; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-areas: "stage" "controls" "data"; grid-template-rows: 410px auto auto; height: auto; padding: 8px; gap: 8px; }
  .stage { min-height: 410px; }
  .stage-topline { padding: 0 10px; }
  .stage-caption { font-size: 8px; gap: 6px; }
  .stage-kicker { font-size: 8px; }
  .stage-tool span { display: none; }
  .stage-legend { flex-wrap: wrap; min-height: 47px; flex-basis: 47px; gap: 7px 12px; padding: 7px 10px; }
  .legend-item { font-size: 7px; }
  .drag-hint { display: none; }
  .annotation { font-size: 7px; }
  .annotation b { font-size: 6px; }
  .hud-top-left { top: 12px; left: 11px; }
  .hud-bottom-left { bottom: 12px; left: 11px; }
  .hud-bottom-right { bottom: 12px; right: 11px; }
  .controls-panel, .data-panel { padding: 14px; }
  .control-group { padding-top: 13px; }
  .readout-stack { grid-template-columns: 1fr 1fr; }
  .readout-value strong { font-size: 22px; }
  .validation-card { margin-top: 2px; }
  .science-teaser { padding-bottom: 3px; }
  .footer-note { padding: 0 10px; font-size: 6px; }
  .footer-note span:nth-child(2) { display: none; }
  body.embed .workspace { height: 100vh; padding: 0; }
  body.embed .stage { min-height: 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; }
}
