/* The algorithm visualisers (static/visualiser.js, site/tools_viz.py): player, call tree, call stack, pegs, bars, code.
   Loaded only by the visualiser pages. Colours are the brand tokens, so both themes work. @map:visualiser */
.viz { border: 1px solid var(--qb-border-strong); background: var(--qb-surface); padding: 14px 16px; min-width: 0; }
/* THE COLOURS (fixed, 2026-10-23): each meaning has one colour and nothing else on a visualiser uses it, so a colour can be read without its label.
   yellow  now: the node, call, code line, bar or sentence being worked on     green   done: printed, found, sorted, returned
   blue    a left child (t.left)                                               purple  a right child (t.right)
   pink    wrong: overflow, underflow, a swap, a deletion                      outline and grey: everything else
   This is the only place the hues are chosen; the tree rules, chips, order line, output line and legend read the tokens. */
.viz { --c-now: var(--qb-accent); --c-now-ink: #1C1B18; --c-left: var(--sub-cs); --c-right: var(--sub-lt); --c-done: var(--qb-correct-fg);
  --c-done-soft: var(--qb-correct-bg); --c-ink: var(--qb-bg-base); }
.viz:not(.is-live) .viz-player p { margin: 0; }
.viz-player { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.viz-player:focus-visible { outline: 2px solid var(--qb-accent); outline-offset: 6px; }
.viz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; }
.viz-title { font-weight: 700; color: var(--qb-text-heading); }
.viz-count { font-family: var(--f-mono, ui-monospace, monospace); font-size: 13px; color: var(--qb-text-muted); }
.viz-stage { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.viz-stage.is-single { grid-template-columns: minmax(0, 1fr); }
.viz-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* the call tree */
.viz-tree { overflow: auto; max-height: 440px; border: 1px solid var(--qb-border); background: var(--qb-surface-strong); }
.viz-tree svg { display: block; margin: 0 auto; }
.viz-edge { stroke: var(--qb-border-strong); stroke-width: 1.5; fill: none; }
.viz-node rect { fill: var(--qb-bg-base); stroke: var(--qb-border-strong); stroke-width: 1.5; transition: fill .25s, stroke .25s; }
.viz-node text { font-family: var(--f-mono, ui-monospace, monospace); fill: var(--qb-text-primary); }
.viz-nl { font-size: 12.5px; }
.viz-nv { font-size: 12px; font-weight: 700; fill: var(--qb-correct-fg); }
.viz-node.is-wait rect { stroke: var(--qb-text-heading); stroke-width: 2.5; }
.viz-node.is-done rect { fill: var(--qb-correct-bg); stroke: var(--qb-correct-border); stroke-width: 1.5; }
.viz-node.is-cur rect { fill: var(--qb-accent); stroke: var(--qb-text-heading); stroke-width: 2.5; }
.viz-node.is-cur text, .viz-node.is-cur .viz-nv { fill: #1C1B18; }
.viz-node.is-new { animation: viz-fade .35s ease-out; }
@keyframes viz-fade { from { opacity: 0; } }

/* Tower of Hanoi */
.viz-pegs { width: 100%; max-width: 520px; height: auto; align-self: center; }
.viz-base { fill: var(--qb-text-heading); }
.viz-rod { fill: var(--qb-border-strong); }
.viz-peg-name { font: 600 13px var(--f-mono, ui-monospace, monospace); fill: var(--qb-text-muted); }
.viz-disc { transition: transform .45s ease; }
.viz-disc rect { stroke: var(--qb-bg-base); stroke-width: 1; }
.viz-disc.is-moving rect { stroke: var(--qb-text-heading); stroke-width: 3; }
.viz-disc-n { font: 700 12px var(--f-mono, ui-monospace, monospace); fill: var(--qb-bg-base); }
.viz-moves, .viz-legend { margin: 0; font-size: 13px; line-height: 1.5; color: var(--qb-text-muted); }
.viz-moves { font-family: var(--f-mono, ui-monospace, monospace); }

/* a list: bars to sort, boxes to search */
.viz-arr { display: flex; gap: 6px; align-items: flex-end; padding: 6px 0; font-family: var(--f-mono, ui-monospace, monospace); }
.viz-cell { flex: 1 1 0; min-width: 0; max-width: 84px; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.viz-arr.is-bars .viz-cell { height: 220px; }
.viz-cell .viz-bar { background: var(--qb-surface-strong); border: 2px solid var(--qb-border-strong); color: var(--qb-text-primary);
  font-weight: 700; font-size: 14px; transition: height .3s ease, background .2s, border-color .2s; overflow: hidden; }
.viz-arr.is-boxes .viz-bar { padding: 12px 0; font-size: 16px; }
.viz-arr.is-bars .viz-bar { padding-top: 3px; }
.viz-i { margin-top: 4px; font-size: 11.5px; color: var(--qb-text-muted); }
.viz-p { min-height: 18px; font-size: 12px; font-weight: 700; color: var(--qb-text-primary); }
.viz-cell.m-cmp .viz-bar { background: var(--qb-accent); border-color: var(--qb-text-heading); color: #1C1B18; }
.viz-cell.m-swap .viz-bar { background: var(--sub-ch); border-color: var(--qb-text-heading); color: var(--qb-bg-base); }
.viz-cell.m-min .viz-bar, .viz-cell.m-key .viz-bar { background: var(--sub-cs); border-color: var(--qb-text-heading); color: var(--qb-bg-base); }
.viz-cell.m-sorted .viz-bar { background: var(--qb-correct-bg); border-color: var(--qb-correct-border); color: var(--qb-correct-fg); }
.viz-cell.m-found .viz-bar { background: var(--qb-correct-fg); border-color: var(--qb-correct-border); color: var(--qb-bg-base); }
.viz-cell.m-dim { opacity: .3; }
.viz-cell.m-empty .viz-bar { background: transparent; border-style: dashed; border-color: var(--qb-border); }    /* a free cell of a stack or queue */

/* a binary search tree: round nodes, as in the textbooks. A node is cream; yellow while it is the one being worked on; green once printed
   (strongest on the step that prints it); a blue or purple ring when a sentence names it as the left or right child (below); an outline when it
   was visited on the way. */
.viz-bn circle { fill: var(--qb-bg-base); stroke: var(--qb-border-strong); stroke-width: 1.5; transition: fill .25s, stroke .25s; }
.viz-bn text { font: 700 13px var(--f-mono, ui-monospace, monospace); fill: var(--qb-text-primary); }
.viz-bn.is-path circle { stroke: var(--qb-text-heading); stroke-width: 2.5; }
.viz-bn.is-out circle { fill: var(--c-done-soft); fill: color-mix(in srgb, var(--c-done) 26%, var(--qb-bg-base)); stroke: var(--c-done); stroke-width: 2.5; }
.viz-bn.is-out text { fill: var(--c-done); }
.viz-bn.is-cur circle { fill: var(--c-now); stroke: var(--qb-text-heading); stroke-width: 2.5; }
.viz-bn.is-cur text { fill: var(--c-now-ink); }
.viz-bn.is-printed circle { fill: var(--c-done); stroke: var(--qb-text-heading); stroke-width: 3; }
.viz-bn.is-printed text { fill: var(--c-ink); }
.viz-bn.is-new { animation: viz-fade .35s ease-out; }

/* names in a sentence (qh/visualise.py `ref`, visualiser.js `readRefs`): a coloured chip in the words, the same colour on the node it names
   in the picture - a ring and the name beside it, the edge down to it, or a dashed empty place for a null. t is the node being worked on
   (yellow), left is blue, right is purple, out is a value being printed (green). @map:ref-chips */
.hl-left { --hl: var(--c-left); }
.hl-right { --hl: var(--c-right); }
.viz-ref { display: inline-block; padding: 0 6px; margin: 0 1px; font: 700 .93em var(--f-mono, ui-monospace, monospace); line-height: 1.45; border: 1.5px solid; cursor: default; }
.viz-ref.r-t { background: var(--c-now); color: var(--c-now-ink); border-color: var(--qb-text-heading); }
.viz-ref.r-left { background: var(--c-left); color: var(--c-ink); border-color: var(--c-left); }
.viz-ref.r-right { background: var(--c-right); color: var(--c-ink); border-color: var(--c-right); }
.viz-ref.r-out { background: var(--c-done); color: var(--c-ink); border-color: var(--c-done); }
/* a traversal's order above the sentence ("Preorder: root = A → left = B → right = C"): the three parts as outlined chips in the colours of the
   chips and nodes, the one being done filled in and the others dimmed */
.viz-order { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 15px; }
.viz-oname { color: var(--qb-text-heading); }
.viz-opart { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.viz-oarrow { color: var(--qb-text-muted); }
.viz-order .viz-ref { margin: 0; padding: 1px 9px; background: transparent; color: var(--qb-text-primary); transition: background .2s, color .2s, opacity .2s; }
.viz-order .viz-ref.r-t { border-color: var(--qb-text-heading); }
.viz-order .viz-ref.r-left { border-color: var(--c-left); }
.viz-order .viz-ref.r-right { border-color: var(--c-right); }
.viz-order.has-on .viz-ref:not(.is-on) { opacity: .5; }
.viz-order .viz-ref.is-on { box-shadow: 0 0 0 3px var(--qb-border); }
.viz-order .viz-ref.is-on.r-t { background: var(--c-now); color: var(--c-now-ink); }
.viz-order .viz-ref.is-on.r-left { background: var(--c-left); color: var(--c-ink); }
.viz-order .viz-ref.is-on.r-right { background: var(--c-right); color: var(--c-ink); }
/* the output so far: every printed value a green chip, the one printed by this step solid and popping in */
.viz-outline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.viz-outname { font: 600 13px var(--f-mono, ui-monospace, monospace); color: var(--qb-text-muted); }
.viz-outnone { font-size: 13px; font-style: italic; color: var(--qb-text-muted); }
.viz-outchip { padding: 1px 9px; font: 700 14px var(--f-mono, ui-monospace, monospace); color: var(--c-done); border: 1.5px solid var(--c-done);
  background: var(--c-done-soft); background: color-mix(in srgb, var(--c-done) 16%, transparent); }
.viz-outchip.is-new { color: var(--c-ink); background: var(--c-done); box-shadow: 0 0 0 3px var(--c-done-soft); animation: viz-pop .4s ease-out both; }
/* what each colour means, under the picture */
.viz-keys { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--qb-text-muted); }
.viz-key { display: inline-flex; align-items: center; gap: 6px; }
.viz-sw { width: 14px; height: 14px; box-sizing: border-box; border: 2px solid var(--qb-border-strong); border-radius: 50%; background: var(--qb-bg-base); }
.viz-sw.sw-now { background: var(--c-now); border-color: var(--qb-text-heading); }
.viz-sw.sw-left { border: 3px solid var(--c-left); }
.viz-sw.sw-right { border: 3px solid var(--c-right); }
.viz-sw.sw-out { background: var(--c-done); border-color: var(--c-done); }
.viz-sw.sw-path { border: 3px solid var(--qb-text-heading); }
.viz-lit { fill: none; stroke: var(--hl); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: var(--len); animation: viz-draw .5s ease-out both; }
.viz-lit.is-ghost { stroke-width: 3; stroke-dasharray: 5 4; animation: viz-fade .35s ease-out both; }
@keyframes viz-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.viz-ring { fill: none; stroke: var(--hl); stroke-width: 3.5; transform-box: fill-box; transform-origin: center; animation: viz-pop .4s ease-out both; }
.viz-ghost { animation: viz-fade .35s ease-out both; }
.viz-ghost rect { fill: var(--qb-bg-base); stroke: var(--hl); stroke-width: 2; stroke-dasharray: 4 3; }
.viz-ghost text { font: 700 11px var(--f-mono, ui-monospace, monospace); fill: var(--hl); }
@keyframes viz-pop { from { transform: scale(.4); opacity: 0; } }
.viz-tag { font: 700 12px var(--f-mono, ui-monospace, monospace); fill: var(--hl); paint-order: stroke; stroke: var(--qb-surface-strong); stroke-width: 4px; stroke-linejoin: round; animation: viz-fade .35s .1s ease-out both; }
.viz-tag.r-t { fill: var(--qb-text-heading); }
.viz-ring.is-hot { stroke-width: 6; }
.viz-lit.is-hot { stroke-width: 7; }
.viz-ghost.is-hot rect { stroke-width: 4; }
.viz-tag.is-hot { font-size: 13.5px; }

/* the call stack: newest on top */
.viz-stack { border: 1px solid var(--qb-border); background: var(--qb-surface-strong); padding: 10px; min-height: 120px; }
.viz-stack h3 { margin: 0 0 8px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--qb-text-muted); }
.viz-frames { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.viz-frame { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 1px solid var(--qb-border-strong);
  background: var(--qb-bg-base); font-family: var(--f-mono, ui-monospace, monospace); font-size: 12.5px; }
.viz-frame.is-cur { background: var(--qb-accent); border-color: var(--qb-text-heading); color: #1C1B18; }
.viz-frame.is-new { animation: viz-drop .3s ease-out; }
@keyframes viz-drop { from { opacity: 0; transform: translateY(-12px); } }
.viz-note { font-family: var(--f-text, Georgia, serif); font-size: 12px; color: var(--qb-text-muted); }
.viz-frame.is-cur .viz-note { color: #3A372F; }
.viz-empty { margin: 0; font-size: 13px; font-style: italic; color: var(--qb-text-muted); }

/* the sentence, the controls, the code */
.viz-say { margin: 0; padding: 10px 14px; min-height: 3.2em; line-height: 1.5; border-left: 4px solid var(--qb-accent); background: var(--qb-accent-tint); }
.viz-say.is-print { border-left-color: var(--c-done); background: var(--c-done-soft); background: color-mix(in srgb, var(--c-done) 18%, transparent); }
.viz-say.is-bad { border-left-color: var(--sub-ch); background: rgba(181, 69, 107, .16); background: color-mix(in srgb, var(--sub-ch) 18%, transparent); }
.viz-bar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.viz-btn { padding: 7px 12px; font-size: 14px; }
.viz-btn:disabled { opacity: .45; cursor: default; }
.viz-btn.is-play { background: var(--qb-text-heading); color: var(--qb-bg-base); border-color: var(--qb-text-heading); font-weight: 700; min-width: 96px; }
.viz-range { flex: 1 1 160px; min-width: 120px; accent-color: var(--qb-text-heading); }
.viz-speed { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--qb-text-muted); }
.viz-speedbar { width: 110px; accent-color: var(--qb-text-heading); }
.viz-speedval { min-width: 3em; font-family: var(--f-mono, ui-monospace, monospace); color: var(--qb-text-primary); }

/* a linked list: node boxes (data | next), arrows drawn from every next, pointer names above the nodes */
.viz-ln { transition: transform .45s ease; }
.viz-ln .ln-box { fill: var(--qb-bg-base); stroke: var(--qb-border-strong); stroke-width: 1.5; transition: fill .25s, stroke .25s; }
.viz-ln .ln-sep { stroke: var(--qb-border-strong); stroke-width: 1.5; }
.viz-ln text { font: 700 14px var(--f-mono, ui-monospace, monospace); fill: var(--qb-text-primary); }
.viz-ln .ln-dot { fill: var(--qb-text-heading); }
.viz-ln.h-cmp .ln-box { fill: var(--qb-accent); stroke: var(--qb-text-heading); stroke-width: 2.5; }
.viz-ln.h-cmp text { fill: #1C1B18; }
.viz-ln.h-new .ln-box { stroke: var(--qb-text-heading); stroke-width: 2.5; stroke-dasharray: 5 3; }
.viz-ln.h-del .ln-box { fill: rgba(181, 69, 107, .24); fill: color-mix(in srgb, var(--sub-ch) 26%, transparent); stroke: var(--sub-ch); stroke-width: 2.5; }
.viz-ln.h-found .ln-box { fill: var(--qb-correct-bg); stroke: var(--qb-correct-border); stroke-width: 2.5; }
.viz-ln.h-found text { fill: var(--qb-correct-fg); }
.viz-ln.is-fresh { animation: viz-fade .35s ease-out; }
.viz-ledge { stroke: var(--qb-text-heading); stroke-width: 1.6; fill: none; animation: viz-fade .3s .25s both; }
.viz-arrowhead { fill: var(--qb-text-heading); }
.viz-lnull { font: 600 12px var(--f-mono, ui-monospace, monospace); fill: var(--qb-text-muted); }
.ln-ptr { font: 700 12.5px var(--f-mono, ui-monospace, monospace); fill: var(--qb-text-heading); }
.viz-codehead { display: flex; justify-content: flex-end; margin-bottom: -6px; font-size: 13px; color: var(--qb-text-muted); }
.viz-codehead select { font: inherit; margin-left: 4px; }
.viz-code { list-style: none; margin: 0; padding: 8px 0; overflow: auto; position: relative; max-height: 360px; border: 1px solid var(--qb-border); background: var(--qb-code-bg);
  font-family: var(--f-mono, ui-monospace, monospace); font-size: 13px; counter-reset: ln; }
.viz-code li { display: flex; counter-increment: ln; padding: 1px 12px 1px 0; border-left: 4px solid transparent; white-space: pre; }
.viz-code li::before { content: counter(ln); flex: none; width: 34px; padding-right: 12px; text-align: right; color: var(--qb-text-muted); }
.viz-code li.is-on { background: var(--qb-accent-tint); border-left-color: var(--qb-accent); }
.viz-code .k { font-weight: 700; color: var(--qb-text-heading); }
.viz-all summary { cursor: pointer; font-weight: 700; }
.viz-steps { margin: 10px 0 0; padding-left: 26px; line-height: 1.55; }

.tool-out:has(.viz) > .bs-result { column-count: 1; }            /* the shared result wrapper is two columns on a wide page; the result and the steps stack */

/* a 2D array: row and column numbers, the cells with the number of their turn, the cell being worked on lit */
.viz-gridbox { overflow-x: auto; padding: 6px 0; }
.viz-grid { border-collapse: separate; border-spacing: 5px; margin: 0 auto; font-family: var(--f-mono, ui-monospace, monospace); }
.viz-grid .g-head { min-width: 24px; padding: 2px 4px; font-size: 12px; font-weight: 600; color: var(--qb-text-muted); text-align: center; }
.viz-grid .g-head.g-hi { color: #1C1B18; background: var(--qb-accent); }
.viz-grid td { position: relative; width: 54px; height: 50px; min-width: 40px; text-align: center; border: 1.5px solid var(--qb-border-strong);
  background: var(--qb-bg-base); transition: background .25s, border-color .25s; }
.viz-grid .g-v { font-size: 16px; font-weight: 700; color: var(--qb-text-primary); }
.viz-grid .g-n { position: absolute; top: 1px; right: 4px; font-size: 11px; font-weight: 700; color: var(--qb-text-muted); }
.viz-grid td.g-in { background: var(--qb-accent-tint); }
.viz-grid td.g-skip { opacity: .4; }
.viz-grid td.g-done { background: var(--qb-correct-bg); border-color: var(--qb-correct-border); }
.viz-grid td.g-done .g-v { color: var(--qb-correct-fg); }
.viz-grid td.g-done .g-n { color: var(--qb-correct-fg); }
.viz-grid td.g-cur { background: var(--qb-accent); border-color: var(--qb-text-heading); border-width: 2.5px; opacity: 1; }
.viz-grid td.g-cur .g-v, .viz-grid td.g-cur .g-n { color: #1C1B18; }

/* the instruction builder (static/visualiser-input.js): buttons instead of typed syntax; the text boxes stay hidden underneath */
.has-builders .tool-field.is-built .bs-help { display: none; }
.has-builders [hidden] { display: none !important; }
.vb-num, .vb-add, .vb-tools, .vb-seqbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vb-step { width: 38px; height: 38px; padding: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--qb-text-primary);
  border: 1px solid var(--qb-border-strong); background: var(--qb-surface-strong); }
.vb-step:hover, .vb-op:hover { filter: brightness(1.08); }
.vb-numin, .vb-arg { font: inherit; width: 6.5em; padding: 8px; color: var(--qb-text-primary); background: var(--qb-bg-base); border: 1px solid var(--qb-border-strong); }
.vb-arg { width: 4.8em; padding: 7px 6px; }
.vb-numin[aria-invalid="true"] { border-color: var(--sub-ch); }
.vb-range, .vb-hint { font-size: 13px; color: var(--qb-text-muted); }
.vb-hint { margin: 6px 0 0; }
.vb-hint.is-bad { color: var(--sub-ch); font-weight: 600; }
.vb-error { margin: 8px 0 0; font-size: 14px; font-weight: 700; color: var(--sub-ch); }
.vb-chips, .vb-seq { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vb-chip, .vb-step-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 3px 3px 10px; font: 14px var(--f-mono, ui-monospace, monospace);
  border: 1px solid var(--qb-border-strong); background: var(--qb-surface-strong); }
.vb-chip span { font-weight: 700; }
.vb-n { font-size: 12px; color: var(--qb-text-muted); }
.vb-t { font-weight: 700; }
.vb-x { padding: 0 7px; font-size: 18px; line-height: 1.2; color: var(--qb-text-muted); background: transparent; border: 0; cursor: pointer; }
.vb-x:hover { color: var(--sub-ch); }
.vb-none { padding: 4px 0; font-size: 14px; font-style: italic; color: var(--qb-text-muted); }
.vb-link { padding: 4px 6px; font: inherit; font-size: 14px; color: var(--qb-text-secondary); text-decoration: underline; background: transparent; border: 0; cursor: pointer; }
.vb-link:disabled { opacity: .4; cursor: default; text-decoration: none; }
.vb-opgrp { display: inline-flex; align-items: stretch; }
.vb-op { padding: 8px 12px; font: 700 14px var(--f-mono, ui-monospace, monospace); cursor: pointer; color: #1C1B18; background: var(--qb-accent);
  border: 1px solid var(--qb-text-heading); }
.vb-opgrp .vb-arg + .vb-arg { border-left: 0; }
.vb-opgrp .vb-op { border-right: 0; }
.vb-opgrp .vb-arg { border-left: 1px solid var(--qb-text-heading); }
.vb-opgrp:not(:has(.vb-arg)) .vb-op { border-right: 1px solid var(--qb-text-heading); }
.vb-opgrp .vb-arg:last-child { border-right: 1px solid var(--qb-text-heading); }
.vb-size { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 10px; }
.vb-dim { display: inline-flex; align-items: center; gap: 8px; }
.vb-dim b { min-width: 1.2em; text-align: center; font-family: var(--f-mono, ui-monospace, monospace); }
.vb-mgrid { border-collapse: separate; border-spacing: 3px; margin: 0 0 8px; max-width: 100%; }
.vb-mgrid th { font: 600 11.5px var(--f-mono, ui-monospace, monospace); color: var(--qb-text-muted); text-align: center; }
.vb-cell { width: clamp(2.7em, 11vw, 4.4em); padding: 7px 2px; font: inherit; text-align: center; color: var(--qb-text-primary); background: var(--qb-bg-base);
  border: 1px solid var(--qb-border-strong); }
.vb-cell[aria-invalid="true"] { border-color: var(--sub-ch); background: rgba(181, 69, 107, .14); }
.has-builders .bs-actions .btn.primary { min-width: 120px; font-weight: 700; }
.viz { scroll-margin-top: 72px; }

/* the player needs the whole width, so on a wide page the form sits above it instead of beside it */
@media (min-width: 1100px) {
  .dialog-body:has(> .tool-out .viz) > .tool-form { grid-column: 1 / -1; position: static; max-width: 760px; }
  .dialog-body:has(> .tool-out .viz) > .tool-out { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .viz { padding: 10px; }
  .viz-stage { grid-template-columns: minmax(0, 1fr); }
  .viz-tree { max-height: 340px; }
  .viz-arr.is-bars .viz-cell { height: 170px; }
  .viz-btn { padding: 7px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .viz-disc, .viz-cell .viz-bar, .viz-node rect, .viz-ln { transition: none; }
  .viz-node.is-new, .viz-frame.is-new, .viz-ln.is-fresh, .viz-ledge, .viz-lit, .viz-ring, .viz-ghost, .viz-tag { animation: none; }
}
