.deck-article, .viz-tip {
  --s-hero: #c98500;
}
:root[data-theme="light"] .deck-article, :root[data-theme="light"] .viz-tip {
  --s-hero: #eda100;
}
.viz-host { width: 100%; min-width: 0; }
.viz-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.viz-title { margin-right: auto; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.viz-seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }
.viz-seg button {
  border: 0; background: none; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--muted);
}
.viz-seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-svg text { font-family: var(--font); fill: var(--muted); font-size: 11.5px; }
.viz-svg .val { fill: var(--text); font-weight: 600; }
.viz-cap { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.viz-tip {
  position: fixed; z-index: 80; pointer-events: none;
  min-width: 150px; max-width: 240px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 92%, var(--text)); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 12.5px; line-height: 1.5; color: var(--text);
  opacity: 0; transform: translateY(4px); transition: opacity 0.12s ease, transform 0.12s ease;
}
.viz-tip.on { opacity: 1; transform: none; }
.viz-tip b { display: block; font-size: 13px; margin-bottom: 4px; }
@media (max-width: 640px) { .viz-seg button { padding: 6px 9px; } }

.dg .dg-zone { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; fill: var(--muted); }
.dg .dg-link { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; }
.dg .dg-link.is-hero { stroke: var(--s-hero); stroke-width: 2; }
.dg .dg-link.is-off { stroke-dasharray: 4 4; opacity: 0.55; }
.dg .dg-head { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dg .dg-head.is-hero { stroke: var(--s-hero); stroke-width: 1.8; }
.dg .dg-ring { fill: none; stroke: color-mix(in srgb, var(--text) 35%, transparent); stroke-width: 1.2; stroke-dasharray: 5 4; }
.dg .dg-node rect { fill: var(--bg); stroke: var(--border); stroke-width: 1; transition: fill 0.15s ease; }
.dg .dg-node.is-hero rect { stroke: var(--s-hero); stroke-width: 1.5; }
.dg .dg-node.is-off rect { fill: transparent; stroke-dasharray: 5 4; }
.dg .dg-node.is-off text { opacity: 0.55; }
.dg .dg-node:hover rect { fill: color-mix(in srgb, var(--text) 6%, var(--bg)); }
.dg .dg-name { font-size: 13.5px; font-weight: 700; fill: var(--text); }

.tc-flow { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 0; }
.viz-host .tc-flow { margin: 0; padding: 0; }
.viz-host .tc-flow > li { margin: 0; max-width: none; }
.viz-host .tc-flow > li::before { content: none; display: none; }
.viz-host .tc-step {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 10px; border: 1px solid var(--border); border-radius: 12px; text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tc-step em { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tc-step b { font-size: 14px; color: var(--text); line-height: 1.25; }
.tc-step span { font-size: 12px; line-height: 1.35; color: var(--muted); }
.tc-step:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.tc-step.is-check { border-color: var(--s-hero); }
.tc-step .tc-fall { display: none; margin-top: 4px; font-size: 12px; font-weight: 650; color: var(--text); }
.tc-step .tc-fall i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--s-hero); margin-right: 6px; vertical-align: 0; }
.tc-flow.is-wrong .tc-step.is-check .tc-fall { display: block; }
.tc-flow.is-wrong .tc-step.is-check .tc-ok { display: none; }
.tc-arrow { flex: 0 0 22px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.tc-arrow svg { display: block; }
.viz-host.is-stack .tc-flow { flex-direction: column; }
.viz-host.is-stack .tc-step { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; text-align: left; padding: 10px 12px; }
.viz-host.is-stack .tc-step em { grid-column: 1; grid-row: 1 / span 3; align-self: center; width: 64px; }
.viz-host.is-stack .tc-step > :not(em) { grid-column: 2; }
.viz-host.is-stack .tc-arrow { flex-basis: 18px; }
.viz-host.is-stack .tc-arrow svg { transform: rotate(90deg); }
