:root {
  color-scheme: light;
  --blue: #0052D9;
  --ink: #153B67;
  --text: #334155;
  --muted: #64748B;
  --border: #E3E9F0;
  font-family: "DejaVu Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #F8FAFC;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 42%, #fff 0, #F8FAFC 68%); }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
button { transition: background 160ms, color 160ms, box-shadow 160ms; }
button:hover { color: var(--blue); }
.workspace { position: relative; width: min(1400px, 95vw, calc((100svh - 300px) * 2)); min-width: min(680px, 95vw); }
.masthead { position: absolute; inset: auto 0 calc(100% + 26px); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 0 3px; }
.eyebrow { display: flex; align-items: center; gap: 16px; color: #8392A7; font-size: 9px; font-weight: 600; letter-spacing: 1.65px; }
.eyebrow > span:last-child { display: flex; align-items: center; gap: 10px; }
.eyebrow i { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: #A8B5C5; }
.brand-symbol { font-size: 22px; letter-spacing: -1.6px; color: var(--ink); font-weight: 800; line-height: 1; }
.brand-symbol span { font-size: 22px; color: var(--blue); margin-left: 3px; }
h1 { margin: 13px 0 7px; color: var(--ink); font-size: clamp(24px, 2.3vw, 33px); font-weight: 650; letter-spacing: -1.1px; line-height: 1.15; }
.title-period { color: var(--blue); }
.subtitle { margin: 0; color: #8390A1; font-size: 12px; letter-spacing: .4px; }
.source-button { white-space: nowrap; display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #E2E8F0; border-radius: 5px; background: #FFFFFFB3; color: #64748B; font-size: 10px; }
.source-dot { width: 5px; height: 5px; border-radius: 50%; background: #0052D9; }
.canvas-card { position: relative; width: 100%; aspect-ratio: 2 / 1; background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px #153B6709, 0 4px 8px #153B6703, 0 18px 55px -18px #153B6724; overflow: hidden; isolation: isolate; }
#visualization { display: block; width: 100%; height: 100%; overflow: hidden; font-family: "DejaVu Sans", Arial, "PingFang SC", sans-serif; }
.chapter-label { fill: #153B67; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; }
.figure-meta { fill: #8291A4; font-size: 9px; letter-spacing: 1.1px; }
.chart-title { fill: #153B67; font-weight: 700; }
.axis-text { fill: #64748B; font-variant-numeric: tabular-nums; }
.stage-tick { fill: #0052D9; font-weight: 700; }
.node-hit { fill: transparent; stroke: transparent; stroke-width: 0; cursor: crosshair; pointer-events: all; }
.node-hit:focus-visible { outline: none; stroke: #0052D9; stroke-width: 1.3; stroke-dasharray: 2 2; }
.curve, .node-mark, .value-label, .chart-grid, .retrace, .pulse, .branch-head { pointer-events: none; }
.value-label { font-variant-numeric: tabular-nums; }
.control-deck { position: absolute; top: calc(100% + 19px); left: 3px; right: 3px; }
.timeline-row { display: flex; align-items: center; gap: 18px; margin: 0 0 15px; font-size: 10px; color: #64748B; }
#chapter-status { min-width: 106px; color: #526981; letter-spacing: .2px; }
#timeline { --progress: 0%; min-width: 0; flex: 1; margin: 0; height: 14px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
#timeline::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #0052D9 var(--progress), #DCE4EE var(--progress)); }
#timeline::-moz-range-track { height: 3px; border-radius: 3px; background: #DCE4EE; }
#timeline::-moz-range-progress { height: 3px; background: #0052D9; }
#timeline::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; height: 9px; width: 9px; border-radius: 50%; background: #0052D9; margin-top: -3px; box-shadow: 0 0 0 3px #F8FAFC; }
#timeline::-moz-range-thumb { height: 9px; width: 9px; border: 0; border-radius: 50%; background: #0052D9; }
.timecode { display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; font-size: 10px; color: #526981; }
.time-divider { color: #B7C1CE; }
#total-time { color: #94A3B8; }
.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transport { display: flex; align-items: center; gap: 8px; min-width: 133px; }
.play-button { display: flex; align-items: center; justify-content: center; gap: 9px; height: 36px; min-width: 84px; padding: 0 16px; background: #0052D9; border: 0; border-radius: 6px; color: white; font-size: 12px; box-shadow: 0 2px 4px #0052D914; }
.play-button:hover { background: #094BAA; color: white; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #7D8CA0; }
.icon-button:hover { background: #E9EFF7; }
.chapters { display: flex; padding: 3px; border-radius: 7px; border: 1px solid #E2E8F0; background: #EDF2F780; gap: 2px; }
.chapter-button { display: flex; align-items: center; gap: 9px; padding: 8px 13px; border: 0; border-radius: 4px; background: transparent; color: #7B8A9F; font-size: 11px; line-height: 1.2; }
.chapter-button.active { color: #0052D9; background: white; box-shadow: 0 1px 4px #153B670F; }
.chapter-number { font-size: 9px; font-variant-numeric: tabular-nums; opacity: .65; }
.layout-glyph { display: grid; width: 13px; height: 10px; gap: 1.5px; margin-left: 3px; opacity: .7; }
.layout-glyph i { background: currentColor; border-radius: .5px; }
.layout-glyph.four { grid-template-columns: repeat(2, 1fr); }
.layout-glyph.six { grid-template-columns: repeat(3, 1fr); }
.speed-controls { display: flex; align-items: center; gap: 3px; }
.speed-controls button { background: transparent; border: 0; border-radius: 4px; padding: 7px 8px; color: #94A3B8; font-size: 10px; }
.speed-controls button.active { color: #0052D9; background: #E8EFF9; font-weight: 600; }
.footnote { display: flex; justify-content: space-between; gap: 15px; padding-top: 18px; color: #97A3B3; font-size: 9px; line-height: 1.5; }
.footnote-blue { color: #6C89AD; }
.footnote-separator { margin: 0 9px; color: #C3CCD8; }
.keyboard-hint { color: #A7B1BE; }
#tooltip { position: fixed; z-index: 30; pointer-events: none; min-width: 218px; max-width: min(290px, calc(100vw - 24px)); padding: 15px 17px; border: 1px solid #E3E9F0; background: #FFFFFFF5; border-radius: 8px; box-shadow: 0 8px 30px #153B6721; color: #334155; font-size: 11px; }
.tooltip-heading { color: #153B67; font-weight: 700; margin-bottom: 4px; }
.tooltip-stage { color: #94A3B8; font-size: 10px; margin-bottom: 12px; }
.tooltip-line { display: flex; justify-content: space-between; gap: 20px; margin: 7px 0; }
.tooltip-line span { color: #94A3B8; }
.tooltip-line b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip-status { padding-top: 9px; margin-top: 10px; border-top: 1px solid #EDF1F6; color: #0052D9; font-size: 10px; }
.tooltip-status.discarded { color: #626B78; }
dialog { width: min(570px, calc(100vw - 32px)); max-height: calc(100svh - 48px); padding: 28px 32px; border: 1px solid #DCE5F0; border-radius: 12px; box-shadow: 0 24px 90px #153B6726; color: #334155; }
dialog::backdrop { background: #12263E40; backdrop-filter: blur(5px); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; }
.dialog-top .icon-button { font-size: 25px; font-weight: 300; }
dialog h2 { font-size: 24px; color: #153B67; letter-spacing: -.5px; margin: 17px 0; }
dialog p { color: #64748B; font-size: 12px; line-height: 1.9; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .92em; }
.methodology { margin: 20px 0; }
.methodology > div { border-top: 1px solid #E8EDF4; padding: 13px 0 0; margin-top: 13px; }
.methodology dt { color: #153B67; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.methodology dd { margin: 0; color: #64748B; font-size: 11px; line-height: 1.8; }
.source-fingerprint { font-size: 9px; color: #94A3B8; }
#source-hash { display: block; overflow-wrap: anywhere; }
dialog .dialog-note { font-size: 10px; color: #94A3B8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.load-error { position: absolute; inset: 30% 12%; padding: 30px; background: white; color: #7C3843; border: 1px solid #F4D1D1; border-radius: 10px; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .masthead { bottom: calc(100% + 22px); }
  .keyboard-hint { display: none; }
  .chapter-button { padding: 8px 10px; gap: 6px; }
  .layout-glyph { display: none; }
  .eyebrow { font-size: 8px; gap: 10px; letter-spacing: 1px; }
  .transport { min-width: auto; }
}
@media (max-width: 600px) {
  .workspace { width: 96vw; min-width: 0; }
  .masthead { gap: 8px; padding: 0 6px; }
  .eyebrow > span:last-child { font-size: 6px; gap: 5px; letter-spacing: .4px; }
  .brand-symbol { font-size: 18px; }
  h1 { font-size: clamp(18px, 4.8vw, 27px); letter-spacing: -.6px; }
  .subtitle { font-size: 10px; }
  .source-button { padding: 6px; font-size: 0; gap: 0; margin-bottom: 3px; }
  .source-button > span:last-child { font-size: 12px; margin-left: 5px; }
  .canvas-card { border-radius: 7px; }
  .control-deck { top: calc(100% + 15px); padding: 0 4px; }
  .timeline-row { gap: 10px; margin-bottom: 12px; }
  #chapter-status { min-width: 88px; font-size: 9px; }
  .controls-row { flex-wrap: wrap; gap: 10px; }
  .chapters { order: 3; width: 100%; justify-content: space-between; }
  .chapter-button { justify-content: center; flex: 1; font-size: 10px; padding: 9px 5px; }
  .play-button { height: 32px; min-width: 76px; font-size: 11px; }
  .footnote { font-size: 8px; padding-top: 12px; }
  .footnote-separator { margin: 0 4px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  body { min-height: 650px; }
  .workspace { width: min(880px, 94vw); min-width: 0; margin: 125px 0 155px; }
}
.embedded body { display: block; min-height: 0; background: white; padding: 14px 16px 8px; }
.embedded .workspace { width: 100%; min-width: 0; margin: 0; }
.embedded .masthead { display: none; }
.embedded .canvas-card { box-shadow: none; border-radius: 0; }
.embedded .control-deck { position: static; margin-top: 17px; }
.panorama .control-deck { display: none; }
.panorama .workspace { margin: 0; }
.panorama .canvas-card { box-shadow: none; }
.embedded .footnote { display: none; }
.embedded .timeline-row { margin-bottom: 13px; }
.embedded .transport { min-width: auto; }
#step-forward { font-size: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { body { background: white; } .workspace { width: 100%; min-width: 0; } .masthead, .control-deck, #tooltip, dialog { display: none; } .canvas-card { box-shadow: none; border: 0; } }
