:root {
  color-scheme: dark;
  --bg: #07111b;
  --panel: #0c1925;
  --panel-raised: #102130;
  --line: #1c3343;
  --line-soft: rgba(111, 151, 171, .16);
  --text: #e8f1f4;
  --muted: #8299a7;
  --faint: #536d7c;
  --accent: #48dfce;
  --accent-soft: rgba(72, 223, 206, .12);
  --accent-glow: rgba(72, 223, 206, .22);
  --radius: 12px;
  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-image: radial-gradient(ellipse at 48% -18%, rgba(42, 99, 113, .18), transparent 48%), linear-gradient(180deg, #08131e 0%, #07111b 100%); }
button, input { font: inherit; }
button { color: inherit; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .shell { height: 100vh; height: 100dvh; min-height: 0; }
.shell { width: min(1600px, 100%); min-height: 100vh; margin: 0 auto; padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 3px; flex: 0 0 auto; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(72,223,206,.35); border-radius: 10px; display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); gap: 4px; padding: 7px; transform: rotate(-7deg); background: rgba(72,223,206,.04); box-shadow: 0 0 22px rgba(72,223,206,.06); }
.brand-mark span { border-radius: 2px; background: var(--accent); opacity: .78; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .32; }
.eyebrow { color: #78909f; font-size: 9px; font-weight: 750; letter-spacing: .17em; margin-bottom: 3px; }
.eyebrow-dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin: 0 5px 1px; }
h1 { margin: 0; font-size: 20px; line-height: 1.1; letter-spacing: -.035em; font-weight: 650; }
h1 span { color: #91a8b5; font-weight: 450; }
.top-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; letter-spacing: .04em; white-space: nowrap; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: #b5d0d0; font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.meta-separator { height: 14px; width: 1px; background: var(--line); }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(218px, 245px) minmax(0, 1fr) minmax(218px, 238px); gap: 12px; }
.panel { background: linear-gradient(160deg, rgba(15,31,44,.97), rgba(10,23,34,.98)); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; box-shadow: 0 10px 28px rgba(0,0,0,.13), inset 0 1px 0 rgba(255,255,255,.018); }
.controls-panel, .insights-panel { padding: 15px; display: flex; flex-direction: column; min-height: 0; }
.panel-heading, .stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.panel-heading > div, .stage-heading > div:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.section-index { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .1em; opacity: .85; }
.panel-title { color: #dbe8ed; font-size: 12px; font-weight: 650; letter-spacing: .01em; }
.tiny-status, .unit-tag { color: #70908f; font-size: 8px; font-weight: 800; letter-spacing: .13em; border: 1px solid rgba(72,223,206,.18); border-radius: 4px; padding: 4px 6px; background: rgba(72,223,206,.045); }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 0 13px; }
.preset-button { min-height: 31px; border: 1px solid #243b4b; border-radius: 6px; background: #0b1a27; color: #91a6b1; font-size: 9px; font-weight: 650; cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.preset-button:hover { border-color: rgba(72,223,206,.5); color: var(--text); }
.preset-button.active { border-color: rgba(72,223,206,.42); color: var(--accent); background: rgba(72,223,206,.08); box-shadow: inset 0 0 14px rgba(72,223,206,.035); }
.control-list { display: flex; flex-direction: column; gap: 14px; }
.control-block { min-width: 0; }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.control-label label { color: #c8d7de; font-size: 10px; font-weight: 620; }
.control-label label span { color: #6f8998; font-size: 9px; font-weight: 500; margin-left: 3px; }
.control-label output { color: var(--accent); font-size: 11px; font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-label output small { color: #6e8a96; font-size: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-left: 3px; }
input[type="range"] { width: 100%; display: block; margin: 0; height: 13px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, var(--accent) 0%, rgba(72,223,206,.32) 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, var(--accent) 0%, rgba(72,223,206,.32) 100%); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #d7fffa; border: 2px solid #43cbbb; margin-top: -4.5px; box-shadow: 0 0 0 4px rgba(72,223,206,.1), 0 0 12px rgba(72,223,206,.22); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d7fffa; border: 2px solid #43cbbb; box-shadow: 0 0 0 4px rgba(72,223,206,.1); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 5px; border-radius: 5px; }
.range-ends { display: flex; justify-content: space-between; color: #536d7c; font-size: 8px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.control-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.playback-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.control-foot-label { color: #78919d; font-size: 8px; letter-spacing: .13em; font-weight: 750; }
.playback-actions { display: flex; gap: 6px; }
.icon-button { min-width: 31px; height: 30px; border: 1px solid #2a4352; border-radius: 6px; background: #102331; color: #afc4cc; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; transition: .16s ease; }
.icon-button:hover { color: var(--accent); border-color: rgba(72,223,206,.45); }
.icon-button.primary-action { width: 38px; color: #061a1b; border-color: var(--accent); background: var(--accent); box-shadow: 0 0 18px rgba(72,223,206,.12); }
.icon-button.primary-action:hover { background: #7df1e4; }
.play-glyph { font-size: 11px; margin-left: 2px; }
.icon-button small { font-size: 6px; letter-spacing: .07em; margin-left: 2px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: #78919d; font-size: 9px; }
.quality-button { border: 0; padding: 4px 0 4px 8px; background: transparent; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.quality-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.stage-panel { display: flex; flex-direction: column; padding: 13px 14px 12px; min-height: 0; overflow: hidden; animation: stage-in .7s cubic-bezier(.2,.7,.2,1) both; }
.stage-heading { flex: 0 0 auto; padding: 0 2px 9px; }
.stage-heading-right { display: flex; align-items: center; gap: 12px; }
.stage-unit { color: #68818e; font-size: 8px; letter-spacing: .13em; font-weight: 700; }
.screenshot-button { border: 1px solid #294353; border-radius: 5px; background: #102331; color: #a8bdc7; font-size: 9px; padding: 6px 9px; cursor: pointer; white-space: nowrap; }
.screenshot-button:hover { border-color: rgba(72,223,206,.5); color: var(--accent); }
.screenshot-button span { color: var(--accent); font-size: 12px; margin-right: 3px; }
.canvas-wrap { position: relative; flex: 1 1 auto; min-height: 250px; border: 1px solid #1b3544; border-radius: 8px; overflow: hidden; background: radial-gradient(ellipse at 42% 40%, #0c1e2a, #08131e 75%); }
#viz { width: 100%; height: 100%; display: block; }
.canvas-corner-label { position: absolute; left: 11px; top: 9px; pointer-events: none; color: rgba(180,211,215,.53); font-size: 7px; font-weight: 750; letter-spacing: .14em; }
.canvas-corner-label span { color: var(--accent); padding: 0 3px; }
.stage-caption { min-height: 57px; flex: 0 0 auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 4px 0; }
.caption-marker { width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); flex: 0 0 auto; }
.caption-kicker { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .13em; margin-bottom: 4px; }
.stage-caption p { margin: 0; color: #93aab5; font-size: 10px; line-height: 1.45; }
.insights-panel { gap: 12px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; border: 1px solid rgba(99,139,159,.15); background: rgba(6,18,28,.36); border-radius: 7px; padding: 10px 9px 8px; }
.readout-name { color: #8199a5; font-size: 8px; line-height: 1.3; font-weight: 600; }
.readout-name span { color: #607a88; }
.readout-value { color: #e4f3f3; font-size: clamp(16px, 1.55vw, 21px); line-height: 1.4; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value em { color: var(--accent); font-size: 9px; font-style: normal; font-weight: 550; letter-spacing: 0; }
.readout-kind { color: #607987; font-size: 7px; letter-spacing: .05em; text-transform: uppercase; }
.check-card { margin-top: auto; border: 1px solid rgba(72,223,206,.2); background: linear-gradient(140deg, rgba(72,223,206,.075), rgba(6,18,28,.42)); border-radius: 8px; padding: 11px 10px 10px; }
.check-heading { display: flex; align-items: center; gap: 6px; color: #b7d5d4; font-size: 9px; font-weight: 700; }
.check-icon { display: inline-flex; width: 15px; height: 15px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(72,223,206,.15); color: var(--accent); font-size: 10px; }
.check-main { display: flex; align-items: baseline; gap: 7px; margin: 11px 0 3px; color: var(--accent); font-size: 17px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.check-vs { color: #617e88; font-size: 8px; font-weight: 500; }
.check-labels { display: flex; justify-content: space-between; gap: 6px; color: #69828d; font-size: 6px; line-height: 1.35; }
.check-difference { display: flex; justify-content: space-between; border-top: 1px solid rgba(72,223,206,.12); padding-top: 7px; margin-top: 8px; color: #79929b; font-size: 8px; }
.check-difference strong { color: #d5e9e8; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-note { color: #637d88; font-size: 7px; line-height: 1.45; margin-top: 7px; }
.science-wrap { flex: 0 0 auto; }
.science-details { border: 1px solid var(--line); border-radius: 9px; background: rgba(12,25,37,.8); overflow: hidden; }
.science-details summary { min-height: 37px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; color: #c8d8df; font-size: 10px; font-weight: 650; }
.science-details summary::-webkit-details-marker { display: none; }
.science-summary-left { display: flex; align-items: center; gap: 8px; }
.science-icon { color: var(--accent); font-size: 14px; }
.science-hint { color: #6b8592; font-size: 7px; font-weight: 700; letter-spacing: .11em; }
.chevron { color: var(--accent); font-size: 13px; margin-left: 7px; }
.science-details[open] .chevron { display: inline-block; transform: rotate(180deg); }
.science-content { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 14px 16px 16px; border-top: 1px solid var(--line-soft); }
.science-column h2 { color: #c8dce2; font-size: 10px; margin: 0 0 7px; }
.science-column p { color: #8199a5; font-size: 9px; line-height: 1.55; margin: 0 0 7px; }
.equation { display: inline-block; padding: 7px 9px; margin: 2px 0 7px; color: var(--accent); background: rgba(72,223,206,.055); border: 1px solid rgba(72,223,206,.13); border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.model-disclaimer { color: #a0b8bf !important; }
.footer-note { display: flex; justify-content: space-between; color: #4f6876; font-size: 7px; font-weight: 700; letter-spacing: .12em; padding: 5px 2px 0; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes stage-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1500px) { .workspace { grid-template-columns: 250px minmax(0,1fr) 245px; } }
@media (max-width: 980px) and (min-width: 701px) {
  .shell { padding: 12px; gap: 9px; }
  .workspace { grid-template-columns: 205px minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; }
  .insights-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 180px minmax(0,1fr) minmax(220px,.9fr); align-items: center; gap: 10px; padding: 10px 12px; }
  .insights-panel .panel-heading { grid-column: 1; }
  .readout-grid { grid-column: 2; grid-row: 1; }
  .check-card { grid-column: 3; grid-row: 1; margin: 0; }
  .readout-card { padding: 7px; }
  .readout-value { font-size: 16px; }
  .control-list { gap: 11px; }
}
@media (max-width: 700px) {
  html, body { min-height: 100%; }
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .shell { height: 100vh; height: 100dvh; min-height: 0; padding: max(9px, env(safe-area-inset-top)) 9px max(8px, env(safe-area-inset-bottom)); gap: 8px; overflow: hidden; }
  .topbar { min-height: 48px; gap: 8px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 29px; height: 29px; padding: 6px; gap: 3px; border-radius: 8px; }
  .eyebrow { font-size: 7px; letter-spacing: .12em; }
  h1 { font-size: 17px; }
  .top-meta { gap: 6px; }
  .top-note, .meta-separator { display: none; }
  .live-indicator { font-size: 7px; }
  .workspace { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 2px; scrollbar-width: thin; scrollbar-color: #294353 transparent; }
  .stage-panel { order: 0; flex: 0 0 360px; min-height: 330px; padding: 10px 9px 8px; }
  .controls-panel { order: 1; }
  .insights-panel { order: 2; }
  .stage-heading { padding-bottom: 7px; }
  .stage-unit { display: none; }
  .stage-heading-right { gap: 5px; }
  .screenshot-button { font-size: 8px; padding: 5px 7px; }
  .canvas-wrap { min-height: 240px; }
  .canvas-corner-label { font-size: 6px; left: 7px; top: 7px; }
  .stage-caption { min-height: 52px; padding-top: 8px; gap: 7px; }
  .caption-kicker { font-size: 7px; margin-bottom: 3px; }
  .stage-caption p { font-size: 9px; }
  .controls-panel { flex: 0 0 auto; padding: 11px; }
  .panel-title { font-size: 11px; }
  .preset-row { margin: 9px 0 10px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 13px; row-gap: 10px; }
  .control-label { margin-bottom: 5px; }
  .control-label label { font-size: 9px; }
  .control-label label span { font-size: 8px; }
  .control-label output { font-size: 10px; }
  .range-ends { font-size: 7px; margin-top: 1px; }
  .control-foot { margin-top: 9px; padding-top: 8px; }
  .quality-row { margin-top: 7px; }
  .insights-panel { flex: 0 0 auto; padding: 10px; gap: 8px; }
  .insights-panel .panel-heading { min-height: 18px; }
  .readout-grid { gap: 6px; }
  .readout-card { padding: 7px 8px 6px; }
  .readout-value { font-size: 16px; }
  .check-card { margin-top: 0; padding: 9px; }
  .check-main { margin: 7px 0 2px; font-size: 15px; }
  .check-note { font-size: 7px; }
  .science-wrap { flex: 0 0 auto; }
  .science-details summary { min-height: 33px; padding: 0 10px; font-size: 9px; }
  .science-hint { font-size: 6px; }
  .science-content { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .science-column p { font-size: 8px; }
  .equation { font-size: 8px; white-space: normal; }
  .footer-note { display: none; }
}
@media (max-width: 380px) {
  .stage-panel { flex-basis: 338px; }
  .control-list { column-gap: 9px; }
  .control-label label { font-size: 8px; }
  .readout-value { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
