/* stage.css: the look of every animated diagram. Colours come from --st-* (set by stage.js for light or dark). */
:root { --st-page: #fbfaf7; --st-panel: #fff; --st-line: #e6e2da; --st-fg: #25282d; --st-dim: #6f747c; --st-accent: #2156c4; }
[data-theme="dark"] { --st-accent: #5b8def; color-scheme: dark; }
html, body { margin: 0; background: var(--st-page); color: var(--st-fg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, sans-serif; -webkit-font-smoothing: antialiased; }
#stage { max-width: 1000px; margin: 0 auto; padding: 8px 6px 12px; }
.st-title { font-weight: 600; font-size: 13px; letter-spacing: .02em; color: var(--st-dim); margin: 2px 4px 8px; }
.st-svg { width: 100%; height: auto; display: block; background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 14px; }
[data-theme="light"] .st-svg { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05); }
.st-caption { min-height: 3.2em; margin: 12px 4px 4px; font-size: 15.5px; }
.st-frame .st-title, .st-frame .st-caption, .st-frame .st-cmd, .st-frame .st-ctrl { display: none; }
#stage.st-frame { padding: 2px 2px 4px; }
.st-caption b { font-weight: 650; }
.st-caption code, .st-cmd { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.st-caption code { background: color-mix(in srgb, var(--st-fg) 7%, transparent); padding: 1px 5px; border-radius: 4px; }
.st-cmd { background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 8px; padding: 7px 10px; margin: 6px 4px; white-space: pre-wrap; }
.st-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 4px 0; }
.st-ctrl button { background: var(--st-panel); color: var(--st-fg); border: 1px solid var(--st-line); border-radius: 9px;
  padding: 6px 13px; font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s, transform .1s; }
.st-ctrl button:hover:not(:disabled) { border-color: var(--st-dim); }
.st-ctrl button:active:not(:disabled) { transform: translateY(1px); }
.st-ctrl button:disabled { opacity: .35; cursor: default; }
.st-ctrl .b-play { background: var(--st-accent); border-color: var(--st-accent); color: #fff; min-width: 88px; font-weight: 600; }
.st-dots { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 4px; }
.st-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-line); cursor: pointer; transition: background .2s, transform .2s; }
.st-dots .dot.on { background: var(--st-accent); transform: scale(1.25); }
.st-count { color: var(--st-dim); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.b-flag { padding: 4px 9px !important; color: var(--st-dim) !important; }
.b-flag:hover { color: #e0823d !important; border-color: #e0823d !important; }

/* SVG */
.it { transition: transform .9s cubic-bezier(.4,.1,.2,1), opacity .5s ease; }
.it > :not(text) { opacity: var(--so, 1); transition: opacity .5s ease; }
.it > text, .it > g > text { opacity: var(--to, 1); transition: opacity .5s ease; }
.lbl { fill: var(--st-fg); font-size: 14px; }
.lbl.head { font-weight: 600; }
.lbl.sub, .lbl.dim, .lbl.ip, .arrow-l { fill: var(--st-dim); }
.lbl.sub { font-size: 12px; }
.lbl.small { font-size: 12.5px; }
.lbl.mono, .lbl.ip { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: pre; }
.lbl.pod-l { font-size: 12.5px; font-weight: 600; }
.lbl.bad { fill: #d1453b; font-weight: 700; }
.lbl.big { font-size: 20px; font-weight: 700; }
.lbl.note { fill: #b7791f; font-size: 13px; }
.arrow { stroke-width: 1.8; transition: d .9s cubic-bezier(.4,.1,.2,1), stroke-dashoffset .9s ease-out, opacity .6s; }
.pulse { fill: none; stroke: #e3a008; stroke-width: 3; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.halo { fill: none; stroke: #e3a008; stroke-width: 2.5; opacity: 0; animation: halo 1.6s ease-out 1; }
@keyframes halo { 0% { opacity: 0; } 20% { opacity: .95; } 100% { opacity: 0; } }
.chart-axis, .chart-grid { stroke: var(--st-line); stroke-width: 1.2; }
.chart-grid { stroke-dasharray: 3 4; }
.bar { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .8s cubic-bezier(.4,.1,.2,1); }
.bar-v { transition: transform .8s cubic-bezier(.4,.1,.2,1); font-weight: 600; }
.line { stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; transition: d .8s cubic-bezier(.4,.1,.2,1); }
.line-area { opacity: .12; transition: d .8s cubic-bezier(.4,.1,.2,1); }
.line-v { font-weight: 600; }
.cell-new { animation: cell 1.4s ease-out 1; }
@keyframes cell { 0%, 30% { fill: #e3a008; } 100% { fill: var(--st-fg); } }

.static .it, .static .arrow, .static .bar, .static .bar-v, .static .line, .static .line-area { transition: none !important; }
.static .halo { display: none; }
@media (max-width: 520px) { .st-caption { font-size: 14.5px; } .st-ctrl button { padding: 6px 10px; } }
@media (prefers-reduced-motion: reduce) {
  .it, .arrow, .bar, .bar-v, .line, .line-area { transition: none !important; }
  .halo, .cell-new, .pulse { animation: none !important; }
}
