:root {
  color-scheme: dark;
  --bg: #080d14;
  --panel: #0d1520;
  --panel-2: #111c29;
  --line: rgba(163, 190, 211, .12);
  --line-strong: rgba(163, 190, 211, .22);
  --text: #edf4f7;
  --muted: #8fa2b2;
  --dim: #627687;
  --accent: #69dfd1;
  --accent-soft: rgba(105, 223, 209, .12);
  --warm: #c6b18a;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; 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: 100%; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 20% -20%, rgba(34, 74, 88, .18), transparent 46%), var(--bg); }
.topbar { height: 68px; flex: 0 0 68px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8, 13, 20, .96); position: relative; z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; position: relative; display: flex; align-items: center; justify-content: center; }
.brand-mark span { position: absolute; width: 26px; height: 10px; border: 1px solid var(--accent); border-radius: 50%; transform: rotate(-24deg); opacity: .8; }
.brand-mark span:nth-child(2) { width: 19px; height: 19px; border-color: rgba(105,223,209,.45); transform: rotate(48deg); }
.brand-mark span:nth-child(3) { width: 5px; height: 5px; border: 0; border-radius: 50%; background: var(--accent); }
.brand-kicker, .eyebrow { font-size: 9px; line-height: 1.2; letter-spacing: .16em; font-weight: 750; color: var(--dim); }
h1 { font-size: 17px; line-height: 1.15; letter-spacing: -.035em; margin: 3px 0 0; font-weight: 650; white-space: nowrap; }
h1 span { color: var(--accent); font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topic-tag { color: #8194a5; font-size: 9px; letter-spacing: .14em; font-weight: 700; }
.live-status { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 9px; letter-spacing: .12em; font-weight: 800; border: 1px solid rgba(105,223,209,.2); background: rgba(105,223,209,.06); padding: 7px 9px; border-radius: 99px; }
.live-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(105,223,209,.65); }
.live-status.paused { color: #9aa9b4; border-color: var(--line); background: rgba(255,255,255,.025); }
.live-status.paused i { background: #748594; box-shadow: none; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 0; }
.visual-stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 48%, #101c29 0%, #0b1420 45%, #080e17 100%); border-right: 1px solid var(--line); }
#spaceCanvas { display: block; width: 100%; height: 100%; }
.stage-topline { position: absolute; top: 20px; left: 22px; right: 22px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.view-label, .scale-label { font-size: 9px; letter-spacing: .15em; font-weight: 800; color: #8da2b3; }
.view-label { display: flex; align-items: center; gap: 8px; }
.view-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(105,223,209,.7); }
.view-divider { color: #3b4e5f; }
.scale-label { color: var(--accent); background: rgba(9,18,26,.74); border: 1px solid rgba(105,223,209,.18); padding: 7px 9px; border-radius: 6px; }
.stage-legend { position: absolute; top: 54px; left: 22px; display: flex; align-items: center; gap: 15px; color: #8296a7; font-size: 8px; letter-spacing: .13em; font-weight: 750; pointer-events: none; }
.stage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.janus-dot { background: var(--accent); box-shadow: 0 0 8px rgba(105,223,209,.5); }
.legend-diamond { width: 7px; height: 7px; display: inline-block; background: #d0c5ad; transform: rotate(45deg); border-radius: 1px; }
.legend-line { width: 15px; height: 1px; display: inline-block; border-top: 1px dashed #657b8d; }
.stage-caption { position: absolute; left: 22px; bottom: 22px; width: min(410px, calc(100% - 44px)); padding: 13px 15px 14px; border: 1px solid rgba(154,180,201,.14); border-radius: 10px; background: rgba(8,14,22,.78); backdrop-filter: blur(12px); pointer-events: none; }
.caption-kicker { display: block; color: var(--accent); font-size: 8px; letter-spacing: .16em; font-weight: 800; margin-bottom: 6px; }
.stage-caption p { margin: 0; color: #c2ced6; font-size: 11px; line-height: 1.5; max-width: 390px; }
.stage-time { position: absolute; right: 22px; bottom: 24px; text-align: right; pointer-events: none; }
.time-label { display: block; font-size: 8px; color: #718596; letter-spacing: .15em; font-weight: 800; margin-bottom: 4px; }
.stage-time strong { font-size: 19px; font-weight: 650; letter-spacing: -.04em; color: #edf5f6; font-variant-numeric: tabular-nums; }
.stage-time small { font-size: 10px; color: var(--muted); font-weight: 500; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 19px 18px 14px; background: linear-gradient(180deg, rgba(15,24,35,.98), rgba(10,17,26,.98)); scrollbar-width: thin; scrollbar-color: #314454 transparent; }
.control-panel::-webkit-scrollbar { width: 5px; }
.control-panel::-webkit-scrollbar-thumb { background: #314454; border-radius: 9px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { font-size: 14px; margin: 4px 0 0; font-weight: 620; letter-spacing: -.02em; }
.telemetry-icon { color: var(--accent); font-size: 22px; line-height: 1; opacity: .85; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric-card { min-width: 0; padding: 11px 11px 10px; background: rgba(255,255,255,.027); border: 1px solid rgba(156,180,199,.09); border-radius: 9px; }
.metric-wide { grid-column: 1 / -1; background: linear-gradient(110deg, rgba(105,223,209,.085), rgba(255,255,255,.025)); border-color: rgba(105,223,209,.17); }
.metric-label { color: #8194a5; font-size: 8px; letter-spacing: .13em; font-weight: 800; }
.metric-value { margin-top: 6px; font-size: 20px; line-height: 1; letter-spacing: -.045em; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-wide .metric-value { font-size: 25px; }
.metric-value small { font-size: 10px; color: #91a4b2; font-weight: 500; letter-spacing: 0; }
.metric-foot { color: #718595; font-size: 9px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playback-section, .scenario-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 15px; }
.compact-heading { margin-bottom: 11px; }
.speed-readout { color: var(--accent); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.speed-readout small { color: #8295a4; font-size: 9px; font-weight: 500; }
.range-wrap { display: block; margin: 11px 0 12px; }
.range-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #b8c5cd; font-size: 10px; line-height: 1.3; margin-bottom: 8px; }
.range-meta span:last-child { color: #718595; font-size: 9px; }
.range-meta strong { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 15px; margin: 0; background: transparent; accent-color: var(--accent); cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(105,223,209,.55), rgba(105,223,209,.14)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: rgba(105,223,209,.22); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; margin-top: -4.5px; background: var(--accent); border: 2px solid #10242a; box-shadow: 0 0 0 3px rgba(105,223,209,.12); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #10242a; box-shadow: 0 0 0 3px rgba(105,223,209,.12); }
.transport-row { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 7px; margin-top: 10px; }
.primary-button, .secondary-button, .icon-button, .preset-button { border-radius: 8px; min-height: 35px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.primary-button { border: 1px solid rgba(105,223,209,.35); background: rgba(105,223,209,.13); color: #c9f5ef; font-size: 10px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary-button:hover { background: rgba(105,223,209,.2); border-color: rgba(105,223,209,.6); }
.play-icon { font-size: 12px; line-height: 1; }
.secondary-button, .icon-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #b7c4cd; font-size: 10px; font-weight: 600; }
.secondary-button:hover, .icon-button:hover { border-color: rgba(105,223,209,.35); background: rgba(105,223,209,.07); }
.icon-button { font-size: 19px; line-height: 1; color: #a7b7c2; }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 13px; }
.preset-button { min-height: 32px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #8ea1af; font-size: 9px; font-weight: 650; }
.preset-button.active { color: #d4f5f0; border-color: rgba(105,223,209,.35); background: rgba(105,223,209,.1); }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0 1px; margin-top: 4px; border-top: 1px solid rgba(163,190,211,.08); cursor: pointer; }
.toggle-row strong { display: block; font-size: 10px; font-weight: 650; color: #c8d3da; }
.toggle-row small { display: block; color: #718595; font-size: 9px; margin-top: 4px; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { flex: 0 0 34px; height: 19px; border: 1px solid #435667; border-radius: 99px; background: #1a2937; position: relative; transition: background .18s ease; }
.toggle-ui::after { content: ""; width: 11px; height: 11px; border-radius: 50%; position: absolute; top: 3px; left: 3px; background: #7f91a0; transition: transform .18s ease, background .18s ease; }
.toggle-row input:checked + .toggle-ui { background: rgba(105,223,209,.22); border-color: rgba(105,223,209,.5); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(15px); background: var(--accent); }
.toggle-row input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 3px; }
.audit-card { margin-top: 16px; padding: 12px 12px 11px; border: 1px solid rgba(105,223,209,.16); border-radius: 10px; background: linear-gradient(120deg, rgba(105,223,209,.075), rgba(255,255,255,.02)); }
.audit-head { display: flex; align-items: center; gap: 7px; color: #9bb0bd; font-size: 8px; letter-spacing: .13em; font-weight: 800; }
.audit-check { width: 15px; height: 15px; border-radius: 50%; background: rgba(105,223,209,.17); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.audit-kind { margin-left: auto; color: var(--accent); font-size: 7px; border: 1px solid rgba(105,223,209,.25); padding: 3px 5px; border-radius: 4px; }
.audit-main { display: flex; align-items: baseline; gap: 9px; margin-top: 9px; }
.audit-main strong { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.audit-main strong small { font-size: 10px; color: #9fb1bc; font-weight: 500; }
.audit-main span { color: #8ca0ae; font-size: 9px; }
.audit-compare { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 9px; color: #91a4b2; }
.audit-compare b { color: #d8e2e7; font-weight: 650; }
.audit-diff { color: var(--accent); font-size: 8px; font-weight: 700; }
.audit-card p { color: #6f8393; font-size: 8px; line-height: 1.45; margin: 8px 0 0; }
.science-section { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 3px; }
.science-section details { border-bottom: 1px solid var(--line); }
.science-section summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; padding: 12px 1px; }
.science-section summary::-webkit-details-marker { display: none; }
.science-icon { width: 25px; height: 25px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: rgba(105,223,209,.1); color: var(--accent); font-size: 15px; }
.science-section summary strong { display: block; color: #d4dfe5; font-size: 10px; font-weight: 700; }
.science-section summary small { display: block; color: #718595; font-size: 8px; margin-top: 3px; }
.chevron { margin-left: auto; color: #8094a4; font-size: 16px; transition: transform .18s ease; }
.science-section details[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 2px 13px 35px; color: #94a6b3; font-size: 9px; line-height: 1.55; }
.science-content h3 { color: #cbd7dd; font-size: 10px; margin: 10px 0 5px; font-weight: 700; }
.science-content p { margin: 5px 0 7px; }
.science-content ul { margin: 6px 0 8px; padding-left: 15px; }
.science-content li { margin: 5px 0; }
.science-content b { color: #c5d4dc; }
.equation { border: 1px solid rgba(163,190,211,.1); background: rgba(0,0,0,.17); padding: 7px 9px; border-radius: 6px; color: #d1e6e6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.science-rule { height: 1px; background: var(--line); margin: 11px 0; }
.disclaimer { color: #718595; font-size: 8px; font-style: italic; }
.utility-row { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.utility-button { min-height: 29px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(255,255,255,.025); color: #8ea1af; font-size: 8px; letter-spacing: .08em; font-weight: 750; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.utility-button:hover { color: #c8f4ee; border-color: rgba(105,223,209,.35); background: rgba(105,223,209,.07); }
.panel-footer { color: #65798a; font-size: 8px; padding: 12px 0 3px; letter-spacing: .02em; }
.panel-footer span { color: #91a4b2; letter-spacing: .14em; font-weight: 800; margin-right: 6px; }
kbd { display: inline-block; border: 1px solid rgba(163,190,211,.15); background: rgba(255,255,255,.035); color: #91a4b2; border-radius: 4px; padding: 2px 4px; margin: 0 3px 0 6px; font: inherit; }
@media (max-width: 760px) {
  .topbar { height: 58px; flex-basis: 58px; padding: 0 14px; }
  .brand-mark { width: 26px; height: 26px; transform: scale(.9); }
  .brand-kicker { font-size: 8px; }
  h1 { font-size: 15px; }
  .topic-tag { display: none; }
  .topbar-right { gap: 8px; }
  .live-status { font-size: 8px; padding: 6px 8px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .visual-stage { flex: 0 0 clamp(285px, 42vh, 365px); height: clamp(285px, 42vh, 365px); border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-topline { top: 13px; left: 13px; right: 13px; }
  .view-label, .scale-label { font-size: 7px; }
  .stage-legend { top: 42px; left: 13px; gap: 10px; font-size: 7px; }
  .stage-caption { left: 13px; bottom: 12px; width: calc(100% - 26px); padding: 9px 11px; }
  .caption-kicker { font-size: 7px; margin-bottom: 4px; }
  .stage-caption p { font-size: 9px; line-height: 1.4; max-width: 100%; }
  .stage-time { right: 14px; top: 62px; bottom: auto; padding: 5px 7px; border: 1px solid rgba(148,174,194,.12); border-radius: 7px; background: rgba(7,14,22,.66); }
  .stage-time strong { font-size: 16px; }
  .time-label { font-size: 7px; }
  .control-panel { flex: 1 1 auto; min-height: 0; padding: 15px 14px 16px; }
  .section-heading h2 { font-size: 13px; }
  .metric-card { padding: 10px; }
  .metric-value { font-size: 18px; }
  .metric-wide .metric-value { font-size: 22px; }
  .metric-foot { font-size: 8px; }
  .panel-footer { padding-bottom: 6px; }
}
@media (max-width: 390px) {
  .visual-stage { flex-basis: 300px; height: 300px; }
  .stage-caption p { max-width: 100%; }
  .metric-grid { gap: 6px; }
  .metric-card { padding: 9px; }
  .metric-value { font-size: 17px; }
  .metric-wide .metric-value { font-size: 21px; }
  .metric-label { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
