/* Reading aids: figures, diagrams, scenario casts, takeaways and Lab call-outs.
   Tokens only (site.css), so every aid follows the System, Light and Dark themes. No remote assets.
   Diagram strokes use --rv-stroke (at least 3:1 against the surface in both themes, WCAG 1.4.11). */
:root{--rv-stroke:#6b7c77;--rv-a:#e3f2ee;--rv-b:#eaeef8;--rv-c:#f6efe0;--rv-b-ink:#2f4f86;--rv-c-ink:#7a4f00;--rv-mark:#fdf0c4}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]):not(:has(input[name=ba-theme][value=light]:checked)){--rv-stroke:#7f938d;--rv-a:#12312c;--rv-b:#1a2438;--rv-c:#33290f;--rv-b-ink:#a9c2f0;--rv-c-ink:#f2c063;--rv-mark:#3d3412}}
:root[data-theme=dark],:root:not([data-theme]):has(input[name=ba-theme][value=dark]:checked){--rv-stroke:#7f938d;--rv-a:#12312c;--rv-b:#1a2438;--rv-c:#33290f;--rv-b-ink:#a9c2f0;--rv-c-ink:#f2c063;--rv-mark:#3d3412}

:is(.rv-fig,.rv-cast,.rv-takeaways,.rv-try){max-width:46rem;margin:var(--space-4) 0;color:var(--ink)}
.rv-fig{padding:var(--space-3);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface)}
.rv-fig figcaption{margin-top:var(--space-2);font-size:.9rem;line-height:1.5;color:var(--muted)}
.rv-fig figcaption strong{color:var(--ink-2)}
.rv-label{display:flex;align-items:center;gap:.45rem;margin:0 0 var(--space-2);font-size:.8rem;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:var(--brand)}
.rv-fine{margin:var(--space-2) 0 0;font-size:.82rem;color:var(--muted)}
.rv-ico{flex:none;color:var(--brand)}
.rv-ico-bg{fill:var(--brand-soft)}

/* SVG diagrams: sized by width/height attributes (no layout shift), scaled to the column. */
.rv-svg{display:block;width:100%;height:auto;max-width:30rem;margin-inline:auto;font-family:var(--font);overflow:visible}
.rv-size-s .rv-svg{max-width:24rem}
.rv-size-l .rv-svg{max-width:36rem}
.rv-svg text{fill:var(--ink)}
.rv-svg .m{fill:var(--muted)}
.rv-svg .mono{font-family:var(--mono)}
.rv-svg .acc-t{fill:var(--brand)}
.rv-svg .warn-t{fill:var(--warn)}
.rv-svg .bad-t{fill:var(--bad)}
.rv-svg .box{fill:var(--surface-2);stroke:var(--rv-stroke);stroke-width:1.5}
.rv-svg .acc{fill:var(--brand-soft);stroke:var(--brand);stroke-width:1.5}
.rv-svg .frame{fill:none;stroke:var(--rv-stroke);stroke-width:1.5}
.rv-svg .arrow{fill:none;stroke:var(--rv-stroke);stroke-width:2}
.rv-svg .arrow.thick{stroke-width:3;stroke:var(--brand)}
.rv-svg .dashed{stroke-dasharray:6 4}
.rv-svg .rv-head{fill:var(--rv-stroke)}
.rv-svg .dot{fill:var(--brand);stroke:var(--surface);stroke-width:2}
.rv-svg .life{stroke:var(--rv-stroke);stroke-width:1.5;stroke-dasharray:4 4}
.rv-svg .venn-a{fill:var(--rv-a);stroke:var(--brand);stroke-width:2;fill-opacity:.85}
.rv-svg .venn-b{fill:var(--rv-b);stroke:var(--rv-b-ink);stroke-width:2;fill-opacity:.7}
.rv-svg .join-on{fill:var(--brand);fill-opacity:.55}
.rv-svg .join-off{fill:var(--surface-2)}
.rv-svg .join-ring{fill:none;stroke:var(--rv-stroke);stroke-width:1.5}
.rv-svg .q1{fill:var(--rv-b)}.rv-svg .q2{fill:var(--rv-a)}.rv-svg .q3{fill:var(--surface-2)}.rv-svg .q4{fill:var(--rv-c)}
.rv-svg .lane{fill:var(--surface);stroke:var(--rv-stroke);stroke-width:1}
.rv-svg .lane-h{fill:var(--surface-2);stroke:var(--rv-stroke);stroke-width:1}
.rv-svg .task{fill:var(--brand-soft);stroke:var(--brand);stroke-width:1.5}
.rv-svg .gw{fill:var(--rv-c);stroke:var(--rv-c-ink);stroke-width:1.5}
.rv-svg .gw-x{fill:none;stroke:var(--rv-c-ink);stroke-width:2}
.rv-svg .ev-start{fill:var(--surface);stroke:var(--ok);stroke-width:2}
.rv-svg .ev-end{fill:var(--surface);stroke:var(--bad);stroke-width:4}
.rv-svg .lvl1{fill:var(--brand-soft);stroke:var(--brand);stroke-width:1.5}
.rv-svg .lvl2{fill:var(--rv-b);stroke:var(--rv-b-ink);stroke-width:1.5}
.rv-svg .lvl3{fill:var(--rv-c);stroke:var(--rv-c-ink);stroke-width:1.5}
.rv-svg .lvl4{fill:var(--surface-2);stroke:var(--rv-stroke);stroke-width:1.5}
.rv-svg .spark{fill:none;stroke:var(--brand);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.rv-svg .bar{fill:var(--brand);fill-opacity:.75}
.rv-svg .rule{stroke:var(--line-strong);stroke-width:1}
.rv-svg .chip-warn{fill:var(--warn-soft);stroke:var(--warn);stroke-width:1}
.rv-svg .band-n,.rv-svg .band-ok,.rv-svg .band-warn,.rv-svg .band-bad,.rv-svg .band-info{fill:var(--surface-2);stroke:var(--rv-stroke);stroke-width:1}
.rv-svg .band-k-n,.rv-svg .band-k-info{fill:var(--rv-b)}.rv-svg .band-k-ok{fill:var(--ok-soft)}.rv-svg .band-k-warn{fill:var(--warn-soft)}.rv-svg .band-k-bad{fill:var(--bad-soft)}
.rv-svg .cell-a{fill:var(--rv-a);stroke:var(--brand);stroke-width:1.2}.rv-svg .cell-b{fill:var(--rv-b);stroke:var(--rv-b-ink);stroke-width:1.2}.rv-svg .cell-c{fill:var(--rv-c);stroke:var(--rv-c-ink);stroke-width:1.2}.rv-svg .cell-d{fill:var(--bad-soft);stroke:var(--bad);stroke-width:1.2}
.rv-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:var(--radius-sm)}
.rv-scroll:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
.rv-scroll .rv-svg{max-width:none;min-width:34rem}
@media(min-width:720px){.rv-size-wide .rv-svg{max-width:46rem}}
.rv-words{margin-top:var(--space-2);font-size:.92rem}
.rv-words summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:650;color:var(--brand)}
.rv-words ul{margin:.25rem 0 0;padding-left:1.2rem}
.rv-words li{margin-bottom:.2rem}

/* Process flow: vertical on phones (and for long flows), across for up to four steps on wider screens. */
.rv-flow{list-style:none;margin:0;padding:0;display:grid;gap:.6rem;counter-reset:none}
.rv-flow li{position:relative;display:flex;gap:.75rem;align-items:flex-start;margin:0;padding:.7rem .85rem;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface-2)}
.rv-flow li:not(:last-child)::after{content:"";position:absolute;left:1.3rem;bottom:-.6rem;width:0;height:0;border-left:.42rem solid transparent;border-right:.42rem solid transparent;border-top:.55rem solid var(--rv-stroke);z-index:1}
.rv-n{flex:none;display:inline-grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:50%;background:var(--brand);color:var(--brand-ink);font-weight:800;font-size:.85rem}
.rv-step{display:grid;gap:.1rem;min-width:0;line-height:1.45}
.rv-step>span{font-size:.92rem;color:var(--ink-2)}
@media(min-width:720px){
.rv-flow-across{grid-auto-flow:column;grid-auto-columns:1fr;gap:1.1rem}
.rv-flow-across li{flex-direction:column;gap:.45rem}
.rv-flow-across li:not(:last-child)::after{left:auto;right:-.9rem;top:50%;bottom:auto;margin-top:-.42rem;border-top:.42rem solid transparent;border-bottom:.42rem solid transparent;border-left:.6rem solid var(--rv-stroke);border-right:0}
}

/* Comparison columns and Venn lists */
.rv-compare{display:grid;gap:.75rem}
@media(min-width:640px){.rv-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rv-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
.rv-venn-cols{margin-top:var(--space-3)}
.rv-col{min-width:0;padding:.75rem .9rem;border-radius:var(--radius-sm);border:1px solid var(--line-strong);border-top-width:4px}
.rv-tone-a{background:var(--rv-a);border-top-color:var(--brand)}
.rv-tone-b{background:var(--rv-b);border-top-color:var(--rv-b-ink)}
.rv-tone-c{background:var(--rv-c);border-top-color:var(--rv-c-ink)}
.rv-col-h{display:flex;align-items:center;gap:.4rem;margin:0 0 .35rem;font-size:1rem;font-weight:700;line-height:1.3;color:var(--ink)}
.rv-col-sub{margin:0 0 .35rem;font-size:.88rem;color:var(--ink-2)}
.rv-col ul,.rv-doavoid ul{margin:0;padding-left:1.1rem;font-size:.93rem;line-height:1.5}
.rv-col li,.rv-doavoid li{margin-bottom:.25rem}
.rv-bridge{margin:.75rem 0 0;font-size:.93rem;color:var(--ink-2)}
.rv-doavoid{display:grid;gap:.75rem}
@media(min-width:640px){.rv-doavoid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.rv-do,.rv-avoid{padding:.75rem .9rem;border-radius:var(--radius-sm)}
.rv-do{background:var(--ok-soft)}.rv-do .rv-ico{color:var(--ok)}
.rv-avoid{background:var(--bad-soft)}.rv-avoid .rv-ico{color:var(--bad)}.rv-avoid .rv-ico-bg{fill:var(--surface)}

/* Checklists and takeaways */
.rv-checklist,.rv-takeaways ul{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}
.rv-checklist li,.rv-takeaways li{display:flex;gap:.6rem;align-items:flex-start;margin:0;line-height:1.5}
.rv-checklist .rv-ico,.rv-takeaways li .rv-ico{margin-top:.15rem}
.rv-takeaways{padding:var(--space-3) var(--space-4);border-radius:var(--radius-sm);background:var(--brand-soft);border:1px solid var(--brand)}
.rv-takeaways .rv-ico-bg{fill:var(--surface)}

/* Annotated specimens (a story, ticket, document excerpt or query with numbered notes) */
.rv-annot{display:grid;gap:var(--space-3)}
@media(min-width:760px){.rv-annot{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start}}
.rv-specimen{padding:.85rem 1rem;border:1px solid var(--line-strong);border-left:4px solid var(--brand);border-radius:var(--radius-sm);background:var(--surface-2);line-height:1.75}
.rv-specimen p{margin:0 0 .4rem}.rv-specimen p:last-child{margin:0}
.rv-spec-h{font-size:.78rem;font-weight:750;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.rv-mono{font-family:var(--mono);font-size:.88rem;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.rv-mark{background:var(--rv-mark);color:var(--ink);padding:.05em .2em;border-radius:4px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.rv-pin{display:inline-grid;place-items:center;min-width:1.2rem;height:1.2rem;margin-left:.2rem;border-radius:50%;background:var(--brand);color:var(--brand-ink);font-family:var(--font);font-size:.7rem;font-weight:800;line-height:1;vertical-align:.35em}
.rv-notes{margin:0;padding-left:1.4rem;font-size:.93rem;line-height:1.55}
.rv-notes li{margin-bottom:.4rem}
.rv-notes li::marker{font-weight:800;color:var(--brand)}

/* Scenario cast */
.rv-cast{padding:var(--space-3) var(--space-4);border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface)}
.rv-cast ul{list-style:none;margin:0;padding:0;display:grid;gap:.6rem;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr))}
.rv-cast li{display:flex;gap:.65rem;align-items:center;margin:0;line-height:1.35;font-size:.93rem}
.rv-cast li strong{display:block;font-size:1rem}
.rv-avatar{flex:none;border-radius:50%}
.rv-av-bg{fill:var(--rv-a)}

/* Try this in the Lab */
.rv-try{padding:var(--space-3) var(--space-4);border-radius:var(--radius-sm);border:1px dashed var(--brand);background:var(--surface)}
.rv-try p{margin:0 0 .5rem}.rv-try p:last-child{margin:0}
.rv-try-link{display:inline-flex;align-items:center;min-height:44px;font-weight:700}

/* Silent clips: reserved 16:10 frame, poster and media load only near or on play. */
.rv-clip-frame{border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--line);background:var(--surface-2);aspect-ratio:16/10}
.rv-clip-frame video{display:block;width:100%;height:100%;object-fit:cover;background:var(--surface-2)}
.rv-clip-meta{display:inline-flex;align-items:center;gap:.35rem;font-weight:650;color:var(--ink-2)}
.rv-clip-meta .rv-ico{width:18px;height:18px}

.blog :is(.rv-fig,.rv-cast,.rv-takeaways,.rv-try) h3{margin-top:0}
.blog .rv-fig ul,.blog .rv-fig ol{margin-bottom:0}
@media print{.rv-k-clip,.rv-try,.rv-words summary{display:none}.rv-words[open] summary,.rv-words{display:block}}
@media(forced-colors:active){.rv-svg text{fill:CanvasText}.rv-svg :is(.box,.acc,.task,.lane,.frame,.arrow){stroke:CanvasText}.rv-mark{forced-color-adjust:none}}
.rv-svg .ring{fill:none;stroke:var(--rv-stroke);stroke-width:2}
.rv-svg .badge{fill:var(--brand)}
.rv-svg .badge-t{fill:var(--brand-ink)}
/* The blog's FAQ styling for <details> does not apply to the "Diagram in words" disclosure. */
.blog .rv-words{border:0;border-radius:0;background:none;margin-bottom:0}
.blog .rv-words summary{padding:0;list-style-position:inside}
.blog .rv-words ul{padding-left:1.2rem;margin:.25rem 0 0}
.rv-svg .spoke{stroke:var(--rv-stroke);stroke-width:1.5}
.rv-svg .slice{fill:none;stroke:var(--brand);stroke-width:2.5}
.rv-svg .axis{stroke:var(--rv-stroke);stroke-width:2}
.rv-svg .zone-ok{fill:var(--ok-soft);stroke:var(--ok);stroke-width:1}
.rv-svg .zone-bad{fill:var(--bad-soft);stroke:var(--bad);stroke-width:1}
.rv-svg .limit{stroke:var(--ink);stroke-width:2;stroke-dasharray:4 3}
.rv-svg .ok-t{fill:var(--ok)}
.rv-svg .venn-c{fill:var(--rv-c);stroke:var(--rv-c-ink);stroke-width:2;fill-opacity:.6}
.rv-svg .thin{fill:none;stroke:var(--rv-stroke);stroke-width:1.5}
.rv-svg .out{fill:var(--warn-soft);stroke:var(--warn);stroke-width:1.5}
.rv-svg .warn-row{fill:var(--warn-soft);stroke:var(--warn);stroke-width:1.2}
.rv-svg .chip-ok{fill:var(--ok-soft);stroke:var(--ok);stroke-width:1}.rv-svg .chip-bad{fill:var(--bad-soft);stroke:var(--bad);stroke-width:1}
.rv-svg .tile{fill:var(--surface);stroke:var(--line-strong);stroke-width:1}
.rv-svg .bar2{fill:var(--rv-b-ink);fill-opacity:.7}
.rv-svg .bar3{fill:var(--rv-c-ink);fill-opacity:.7}
.rv-svg .target{stroke:var(--bad);stroke-width:1.5;stroke-dasharray:4 3}
.rv-svg .st-ok{fill:var(--ok-soft);stroke:var(--ok);stroke-width:1.5}
.rv-svg .st-bad{fill:var(--bad-soft);stroke:var(--bad);stroke-width:1.5}
.rv-svg .st-warn{fill:var(--warn-soft);stroke:var(--warn);stroke-width:1.5}
.rv-svg .st-none{fill:var(--surface);stroke:var(--bad);stroke-width:1.5;stroke-dasharray:5 4}
.rv-card-list{list-style:none;margin:0;padding:0;display:grid;gap:.65rem;grid-template-columns:repeat(auto-fill,minmax(13.5rem,1fr))}
.rv-card-list li{margin:0;padding:.7rem .85rem;border:1px solid var(--line-strong);border-top:4px solid var(--brand);border-radius:var(--radius-sm);background:var(--surface-2)}
.rv-card-list p{margin:0 0 .25rem;font-size:.9rem;line-height:1.45;color:var(--ink-2)}
.rv-card-list p:last-child{margin:0}
/* Page-level <details> styles (blog FAQ, guide answers) do not apply to the "Diagram in words" disclosure. */
.rv-fig>details.rv-words{border:0;border-radius:0;padding:0;margin:var(--space-2) 0 0;background:none;box-shadow:none}
.rv-fig>details.rv-words>summary{padding:0;background:none;border:0}
