:root {
  color-scheme: dark;
  --bg: #070b15;
  --panel: #0d1423;
  --panel-2: #111b2c;
  --line: rgba(149, 177, 218, .13);
  --line-strong: rgba(149, 177, 218, .22);
  --text: #edf4ff;
  --muted: #92a2bb;
  --dim: #63748e;
  --accent: #69e1d0;
  --accent-soft: rgba(105, 225, 208, .12);
  --warm: #ffba83;
  --radius: 16px;
  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-x: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 23% 0%, rgba(36, 67, 111, .18), transparent 38%), var(--bg); }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
.topbar { min-height: 72px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(7, 11, 21, .92); z-index: 2; }
.brand-lockup, .topbar-actions, .live-status, .stage-tags, .stage-heading, .readout-top, .readout-value, .control-heading, .range-ends, .transport-row, .quality-row, .switch-row, .panel-title-row { display: flex; align-items: center; }
.brand-lockup { gap: 13px; min-width: 0; }
.brand-symbol { width: 38px; height: 38px; border: 1px solid rgba(105,225,208,.35); border-radius: 12px; position: relative; display: grid; place-items: center; background: linear-gradient(145deg, rgba(105,225,208,.12), rgba(105,225,208,.015)); }
.brand-symbol span { width: 21px; height: 21px; border: 1px solid var(--accent); border-radius: 50%; transform: rotate(-26deg) scaleX(1.35); opacity: .9; }
.brand-symbol i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 9px rgba(255,186,131,.7); }
.brand-copy h1 { font-size: 18px; line-height: 1.1; margin: 3px 0 0; font-weight: 650; letter-spacing: -.025em; }
.eyebrow { color: #8294af; font-size: 9px; line-height: 1.3; letter-spacing: .15em; font-weight: 750; text-transform: uppercase; }
.eyebrow-divider { color: #455671; padding: 0 5px; }
.topbar-actions { gap: 18px; }
.live-status { gap: 8px; color: #a9bacf; font-size: 9px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; }
.live-pulse, .canvas-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(105,225,208,.65); }
.button { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 12px; background: rgba(255,255,255,.025); color: #cbd7e8; font-size: 11px; font-weight: 650; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 7px; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover, .preset-button:hover { background: rgba(255,255,255,.07); border-color: rgba(105,225,208,.35); }
.button:active, .preset-button:active { transform: translateY(1px); }
.button:focus-visible, .preset-button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.button-primary { background: var(--accent); color: #05201e; border-color: var(--accent); font-weight: 800; min-width: 94px; }
.button-primary:hover { background: #8af1e2; border-color: #8af1e2; }
.button-quiet { background: rgba(255,255,255,.025); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 16px 18px 18px; overflow: hidden; }
.visual-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 12px; }
.stage-card, .readout-card, .caption-strip, .control-panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(16,25,42,.96), rgba(10,16,29,.98)); border-radius: var(--radius); }
.stage-card { min-height: 0; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.stage-heading { min-height: 59px; padding: 10px 17px 9px; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(149,177,218,.08); }
.stage-heading h2, .panel-title-row h2 { font-size: 15px; font-weight: 650; letter-spacing: -.02em; margin: 3px 0 0; }
.stage-tags { gap: 7px; }
.tag { display: inline-flex; align-items: center; justify-content: center; min-height: 18px; padding: 2px 6px; border-radius: 5px; font-size: 8px; font-weight: 750; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; white-space: nowrap; }
.tag-muted { color: #9bacc4; background: rgba(149,177,218,.09); border: 1px solid rgba(149,177,218,.1); }
.tag-accent { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(105,225,208,.18); }
.tag-kind { color: #8c9cb5; background: rgba(149,177,218,.07); border: 1px solid rgba(149,177,218,.08); font-size: 7px; min-height: 16px; }
.canvas-wrap { flex: 1; min-height: 0; position: relative; background: radial-gradient(ellipse at 27% 47%, rgba(24,55,89,.28), transparent 43%), #080f1d; }
#vizCanvas { display: block; width: 100%; height: 100%; outline: none; }
.canvas-footer { position: absolute; left: 15px; bottom: 10px; display: flex; align-items: center; gap: 7px; color: #71839e; font-size: 8px; letter-spacing: .015em; pointer-events: none; }
.canvas-dot { width: 5px; height: 5px; }
.footer-separator { color: #42536d; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.readout-card { min-width: 0; padding: 11px 12px 10px; }
.readout-top { justify-content: space-between; gap: 5px; }
.readout-label { font-size: 8px; letter-spacing: .095em; color: #91a2bb; font-weight: 750; white-space: nowrap; }
.readout-value { gap: 6px; margin-top: 7px; white-space: nowrap; }
.readout-value strong { font-size: clamp(18px, 2vw, 24px); line-height: 1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.readout-value span { font-size: 10px; color: #91a2bb; }
.readout-foot { color: #657792; font-size: 8px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-highlight { border-color: rgba(105,225,208,.2); background: linear-gradient(145deg, rgba(16,42,48,.88), rgba(10,22,34,.98)); }
.readout-highlight .readout-value strong { color: var(--accent); }
.caption-strip { padding: 11px 14px; display: flex; align-items: center; gap: 11px; min-height: 62px; }
.caption-icon { flex: 0 0 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.caption-content { min-width: 0; flex: 1; }
.caption-content p { color: #b4c2d5; font-size: 10px; line-height: 1.45; margin: 3px 0 0; }
.phase-readout { border-left: 1px solid var(--line); padding-left: 13px; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 7px; }
.phase-readout span { grid-column: 1 / -1; color: #71839d; font-size: 7px; letter-spacing: .12em; font-weight: 750; }
.phase-readout strong { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 650; margin-top: 3px; }
.phase-readout .tag { align-self: center; margin-top: 3px; }
.control-panel { min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 15px 12px; scrollbar-width: thin; scrollbar-color: #293b55 transparent; }
.control-panel::-webkit-scrollbar { width: 5px; }
.control-panel::-webkit-scrollbar-thumb { background: #293b55; border-radius: 9px; }
.panel-title-row { justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.panel-title-row h2 { font-size: 16px; }
.panel-status { color: #71839d; border: 1px solid var(--line); padding: 5px 7px; border-radius: 5px; font-size: 7px; letter-spacing: .1em; font-weight: 750; white-space: nowrap; }
.preset-block { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.section-label { color: #8395af; font-size: 8px; letter-spacing: .12em; font-weight: 750; display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-width: 0; min-height: 48px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.018); display: flex; align-items: center; gap: 7px; text-align: left; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.preset-button.active { background: rgba(105,225,208,.075); border-color: rgba(105,225,208,.42); }
.preset-glyph { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: rgba(149,177,218,.08); color: #b5c8e1; font-size: 16px; flex: 0 0 auto; }
.strong-glyph { color: var(--warm); background: rgba(255,186,131,.08); }
.preset-button b { display: block; font-size: 9px; font-weight: 700; color: #dbe7f5; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; font-size: 7px; color: #8092ad; white-space: nowrap; }
.control-list { display: grid; gap: 13px; padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.control-heading { justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.control-heading label { color: #c3d0e1; font-size: 10px; font-weight: 600; }
.symbol { color: #7587a2; font-size: 9px; margin-left: 4px; font-weight: 500; }
.control-value { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
input[type="range"] { appearance: none; width: 100%; height: 4px; border-radius: 99px; background: linear-gradient(90deg, rgba(105,225,208,.85), rgba(105,225,208,.22)); display: block; margin: 0; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border: 2px solid #d9fff8; border-radius: 50%; background: #42bfae; box-shadow: 0 0 0 3px rgba(105,225,208,.12), 0 1px 6px rgba(0,0,0,.5); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #d9fff8; border-radius: 50%; background: #42bfae; box-shadow: 0 0 0 3px rgba(105,225,208,.12); }
.range-ends { justify-content: space-between; margin-top: 6px; color: #657792; font-size: 7px; }
.view-options { display: grid; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.switch-row, .quality-row { justify-content: space-between; gap: 12px; min-height: 30px; position: relative; }
.switch-row b, .quality-row b { display: block; color: #c5d2e3; font-size: 9px; font-weight: 650; }
.switch-row small, .quality-row small { display: block; color: #71839d; font-size: 7px; margin-top: 3px; }
.switch-row input { position: absolute; right: 0; width: 34px; height: 20px; opacity: 0; cursor: pointer; z-index: 2; }
.switch-ui { width: 31px; height: 17px; border: 1px solid #41536c; background: #1a273b; border-radius: 99px; position: relative; flex: 0 0 auto; transition: .2s; }
.switch-ui::after { content: ""; position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #8798af; top: 2px; left: 2px; transition: .2s; }
.switch-row input:checked + .switch-ui { background: rgba(105,225,208,.22); border-color: rgba(105,225,208,.7); }
.switch-row input:checked + .switch-ui::after { transform: translateX(13px); background: var(--accent); }
.switch-row input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 3px; }
.quality-toggle { display: flex; border: 1px solid var(--line-strong); border-radius: 7px; padding: 2px; background: rgba(0,0,0,.18); }
.quality-toggle button { border: 0; border-radius: 5px; background: transparent; color: #8192ab; font-size: 8px; padding: 5px 9px; cursor: pointer; }
.quality-toggle button[aria-pressed="true"] { color: #06201d; background: var(--accent); font-weight: 800; }
.playback-block { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.transport-row { gap: 7px; margin-top: 12px; }
.transport-row .button { flex: 1; min-width: 0; padding: 0 8px; }
.transport-row .reset-button { flex: .9; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); overflow: hidden; }
.science-panel summary { min-height: 48px; padding: 8px 10px; list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-summary-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 14px; }
.science-panel summary b { display: block; font-size: 10px; color: #d9e6f5; }
.science-panel summary small { display: block; margin-top: 3px; font-size: 7px; color: #788aa4; }
.summary-chevron { margin-left: auto; color: #8193ad; font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 12px; border-top: 1px solid var(--line); color: #9fb0c7; font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 12px 0 5px; color: #d7e5f5; font-size: 9px; letter-spacing: .02em; }
.science-content p { margin: 5px 0; }
.check-card { margin: 11px 0 8px; padding: 9px; border: 1px solid rgba(105,225,208,.2); border-radius: 8px; background: rgba(105,225,208,.045); }
.check-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.check-card-head b { color: #9bb0c8; font-size: 7px; letter-spacing: .1em; }
.check-card > p { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 5px 0; font-size: 8px; }
.check-card > p strong { color: #e4f1ff; font-variant-numeric: tabular-nums; }
.check-result { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 7px; padding-top: 7px; color: #8fa3bd; font-size: 8px; }
.check-result strong { color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
.check-formula { color: #8de7da; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 8px !important; overflow-wrap: anywhere; }
.science-content .equation { color: #8de7da; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.science-content ul { margin: 6px 0; padding-left: 16px; }
.science-content li { margin: 5px 0; }
.science-content li b { color: #d3e1f2; }
.science-note { color: #8194ad; font-style: italic; padding-top: 7px; border-top: 1px solid var(--line); }
.panel-footnote { display: flex; align-items: center; gap: 7px; color: #71839d; font-size: 7px; line-height: 1.4; padding: 10px 1px 0; }
.footnote-mark { width: 14px; height: 14px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #52637d; color: #a7b8ce; font-size: 8px; flex: 0 0 auto; }
@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 370px; gap: 18px; padding: 20px 22px; }
  .topbar { padding: 0 32px; }
  .control-panel { padding: 18px 17px 14px; }
  .control-list { gap: 15px; }
}
@media (max-width: 1050px) and (min-width: 761px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 310px; gap: 12px; padding: 12px; }
  .readout-grid { gap: 7px; }
  .readout-card { padding: 10px 8px; }
  .readout-label { font-size: 7px; }
  .readout-value strong { font-size: 18px; }
  .control-panel { padding: 13px 12px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 60px; padding: 0 13px; }
  .brand-symbol { width: 32px; height: 32px; border-radius: 10px; }
  .brand-copy h1 { font-size: 16px; }
  .eyebrow { font-size: 8px; }
  .topbar-actions { gap: 9px; }
  .live-status { font-size: 8px; }
  .screenshot-button { width: 34px; min-width: 34px; padding: 0; font-size: 0; }
  .screenshot-button span { font-size: 14px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(350px, 1.08fr) minmax(220px, .92fr); gap: 10px; padding: 10px; }
  .visual-column { gap: 8px; grid-template-rows: minmax(0,1fr) auto auto; }
  .stage-heading { min-height: 47px; padding: 7px 11px; }
  .stage-heading h2 { font-size: 13px; }
  .stage-tags { gap: 4px; }
  .tag { font-size: 7px; padding: 2px 5px; }
  .canvas-footer { display: none; }
  .readout-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .readout-card { padding: 7px 6px; border-radius: 10px; }
  .readout-top { flex-direction: column; align-items: flex-start; gap: 2px; }
  .readout-label { font-size: 6px; letter-spacing: .05em; }
  .tag-kind { min-height: 13px; font-size: 5px; padding: 1px 3px; }
  .readout-value { margin-top: 5px; gap: 3px; }
  .readout-value strong { font-size: clamp(14px, 4vw, 18px); }
  .readout-value span { font-size: 7px; }
  .readout-foot { font-size: 6px; margin-top: 4px; }
  .caption-strip { min-height: 46px; padding: 7px 9px; gap: 7px; border-radius: 10px; }
  .caption-icon { width: 21px; height: 21px; flex-basis: 21px; font-size: 11px; }
  .caption-content .eyebrow { font-size: 6px; }
  .caption-content p { font-size: 7px; line-height: 1.3; margin-top: 2px; }
  .phase-readout { padding-left: 7px; column-gap: 4px; }
  .phase-readout span { font-size: 5px; }
  .phase-readout strong { font-size: 10px; }
  .phase-readout .tag { font-size: 5px; }
  .control-panel { padding: 12px 12px 10px; border-radius: 12px; }
  .panel-title-row { margin-bottom: 10px; }
  .panel-title-row h2 { font-size: 14px; }
  .preset-block { padding-bottom: 10px; }
  .control-list { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 11px; padding: 11px 0; }
  .control-heading label { font-size: 9px; }
  .symbol { font-size: 8px; }
  .control-value { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .view-options { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; }
  .quality-row { align-items: center; }
  .playback-block { padding: 10px 0; }
  .science-panel { margin-top: 9px; }
}
@media (max-width: 430px) {
  .workspace { grid-template-rows: minmax(345px, 1.03fr) minmax(230px, .97fr); padding: 8px; gap: 8px; }
  .readout-grid { gap: 4px; }
  .readout-card { padding: 6px 5px; }
  .readout-label { font-size: 5.5px; }
  .readout-value strong { font-size: 15px; }
  .readout-foot { font-size: 5.5px; }
  .stage-tags .tag:first-child { display: none; }
  .control-list { column-gap: 10px; }
  .preset-button { padding: 6px; gap: 5px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
