/* Step diagrams on the docs pages (diagram.js; build_docs.py `@diagram <name>`; steps in docs/community/site/diagrams/<name>.json).
   A flow, not a chart. Boxes are neutral (--panel, --border). The one box where text is added is the accent (--accent-soft fill,
   --accent-text words), the kit's one selected thing. A before and after pair is the only data: it wears the status tokens and always
   writes the words. Tokens live in docs-kit.css; no colour value appears here. Type 11/12/13/14/16/20/24; spacing 4/8/12/16/24/32/48. */
.dia { margin: 24px 0 8px; scroll-margin-top: 80px; }
.dia-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 24px; color: var(--text); }
.dia-purpose { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--text-soft); max-width: 60ch; }
.dia-key { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--text-soft); overflow-wrap: anywhere; }
.dia-loop { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--text-soft); }
.dia-flow { position: relative; list-style: none; margin: 16px 0 0; padding: 0 48px 0 0; }
.dia-node { position: relative; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel);
  transition: opacity 200ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 200ms; }
.dia-node + .dia-node { margin-top: 24px; }
.dia-node + .dia-node::before { content: ""; position: absolute; left: 24px; top: -24px; height: 16px; width: 1px; background: var(--text-faint); }
.dia-node + .dia-node::after { content: ""; position: absolute; left: 20px; top: -9px; border: 5px solid transparent; border-top: 6px solid var(--text-faint); border-bottom: 0; }
.dia-t { display: block; font-size: 14px; font-weight: 600; line-height: 24px; color: var(--text); }
.dia-t .dia-n { display: inline-block; min-width: 24px; margin-right: 8px; color: var(--text-faint); font-variant-numeric: tabular-nums; font-weight: 600; }
.dia-c { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--text-soft); }
.dia-q { margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-alt);
  font-size: 14px; line-height: 20px; color: var(--text); }
.dia-q p { margin: 0; color: inherit; }
.dia-q p + p { margin-top: 4px; }
.dia-own { border-color: var(--accent-text); background: var(--accent-soft); }
.dia-own .dia-t { color: var(--accent-text); }
.dia-own .dia-q { background: var(--panel); }
.dia-ex { margin-left: 8px; vertical-align: 1px; }
.dia-back { position: absolute; right: 12px; top: 24px; bottom: 24px; width: 24px; border: 1px solid var(--text-faint); border-left: 0; border-radius: 0 12px 12px 0; }
.dia-back::before { content: ""; position: absolute; left: -6px; top: -5px; border: 5px solid transparent; border-right: 6px solid var(--text-faint); border-left: 0; }
/* A before and after pair: two values of one measure, the delta as a chip with a mark and words. */
.dia-pairs { margin: 8px 0 0; }
.dia-pair { margin: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-alt); }
.dia-pair + .dia-pair { margin-top: 8px; }
.dp-label { margin: 0; font-size: 12px; line-height: 16px; color: var(--text-soft); }
.dp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 4px 0 0; }
.dp-k { font-size: 12px; line-height: 16px; color: var(--text-faint); }
.dp-v { font-size: 20px; font-weight: 600; line-height: 24px; font-variant-numeric: tabular-nums; }
.dp-before { color: var(--text-faint); font-weight: 400; }
.dp-after.is-ok { color: var(--ok-text); }
.dp-after.is-bad { color: var(--bad-text); }
.dp-arrow { color: var(--text-faint); font-size: 16px; }
.dp-note { font-size: 14px; line-height: 20px; color: var(--text-soft); }
.dia-table { margin: 8px 0 0; font-size: 14px; line-height: 20px; color: var(--text-soft); }
.dia-table summary { cursor: pointer; color: var(--accent-text); }
.dia-table table { margin: 8px 0 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dia-table th, .dia-table td { padding: 4px 12px 4px 0; text-align: left; font-weight: 400; border-bottom: 1px solid var(--border); }
.dia-table th { color: var(--text-faint); font-size: 12px; line-height: 16px; }
.dia-node:focus-visible, .dia-table summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dia:not(.js) .dia-aps { display: none; }
.dia.js .dia-node { cursor: pointer; }
.dia.stepping .dia-node:not(.lit) { opacity: 0.45; }
.dia.stepping .dia-node.lit { box-shadow: 0 0 0 2px var(--accent); }
@media (prefers-reduced-motion: reduce) { .dia-node { transition: none; } }
@media (forced-colors: active) { .dia-node, .dia-pair { border-color: CanvasText; } .dia-own { border-width: 2px; } }
@media (max-width: 600px) {
  .dia-flow { padding-right: 32px; }
  .dia-back { width: 16px; right: 8px; }
}
