/* Opening article series layout. The 901px source breakpoint matches the existing figure breakout. */
.a1-preview {
  --preview-mobile-figure-min: 249px;
  --preview-mobile-figure-max: 360px;
  --preview-desktop-figure-max: 960px;
  --preview-figure-gutter: 3rem;
  --preview-figure-space: 2rem;
  --preview-series-space: 2rem;
  --preview-rule-width: 1px;
  --preview-label-size: 16px;
  --preview-support-size: 14px;
  --preview-cell-space: 0.75rem;
}
.a1-preview .post-content .preview-figure {
  width: 100%;
  margin: var(--preview-figure-space) auto;
  transform: none;
}
.a1-preview .preview-figure picture {
  display: block;
  width: 100%;
  min-width: var(--preview-mobile-figure-min);
  max-width: var(--preview-mobile-figure-max);
  margin-inline: auto;
}
.a1-preview .post-content .preview-figure img {
  width: 100%;
  height: auto;
  border: none;
}
.a1-preview .post-content table { max-width: 100%; }
.a1-preview .preview-series {
  display: block;
  margin-top: var(--preview-series-space);
  padding-top: var(--preview-series-space);
  border-top: var(--preview-rule-width) solid var(--color-border);
  color: var(--color-text-muted);
}
@media (min-width: 901px) {
  .a1-preview .post-content .preview-figure {
    width: min(var(--preview-desktop-figure-max), calc(100vw - var(--preview-figure-gutter)));
    margin-left: 50%;
    transform: translateX(-50%);
  }
  .a1-preview .preview-figure picture { max-width: none; }
}

/* Series layout. The 901px source breakpoint matches the existing figure breakout. */
.remaining-preview {
  --preview-mobile-figure-min: 249px;
  --preview-mobile-figure-max: 360px;
  --preview-desktop-figure-max: 960px;
  --preview-figure-gutter: 3rem;
  --preview-figure-space: 2rem;
  --preview-series-space: 2rem;
  --preview-rule-width: 1px;
}
.remaining-preview .post-content .preview-figure {
  width: 100%;
  margin: var(--preview-figure-space) auto;
  transform: none;
}
.remaining-preview .preview-figure picture {
  display: block;
  width: 100%;
  min-width: var(--preview-mobile-figure-min);
  max-width: var(--preview-mobile-figure-max);
  margin-inline: auto;
}
.remaining-preview .post-content .preview-figure img {
  width: 100%;
  height: auto;
  border: none;
}
.remaining-preview .post-content table { max-width: 100%; }
.remaining-preview .preview-series {
  display: block;
  margin-top: var(--preview-series-space);
  padding-top: var(--preview-series-space);
  border-top: var(--preview-rule-width) solid var(--color-border);
  color: var(--color-text-muted);
}
@media (min-width: 901px) {
  .remaining-preview .post-content .preview-figure {
    width: min(var(--preview-desktop-figure-max), calc(100vw - var(--preview-figure-gutter)));
    margin-left: 50%;
    transform: translateX(-50%);
  }
  .remaining-preview .preview-figure picture { max-width: none; }
}

.remaining-preview {
  --preview-label-size: 16px;
  --preview-support-size: 14px;
  --preview-cell-space: 0.75rem;
}
.remaining-preview .post-content table { table-layout: fixed; font-size: var(--preview-support-size); }
.remaining-preview .post-content th { font-size: var(--preview-label-size); }
.remaining-preview .post-content td, .remaining-preview .post-content th { overflow-wrap: anywhere; }
/* A bare commit hash or URL in running text must wrap instead of widening a 375px page. */
.remaining-preview .post-content { overflow-wrap: break-word; }
/* styles.css makes every `.post-content figure a` a block (for full-size image links). Series figures carry
   text links instead (source notes, captions), which must stay inline with their sentence. */
.a1-preview .post-content figure :is(p, figcaption, li, td, th, dd) a,
.remaining-preview .post-content figure :is(p, figcaption, li, td, th, dd) a { display: inline; }
.remaining-preview .field-label { display: none; }
.a1-preview .preview-equivalent,
.remaining-preview .preview-equivalent { font-size: var(--preview-support-size); margin-top: var(--preview-figure-space); }
.a1-preview .preview-equivalent summary,
.remaining-preview .preview-equivalent summary { cursor: pointer; font-size: var(--preview-label-size); min-height: 24px; }
.a1-preview .preview-figure > ol ~ figcaption,
.remaining-preview .preview-figure figcaption { font-size: var(--preview-support-size); overflow-wrap: anywhere; }
.remaining-preview summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }
.remaining-preview .preview-matrix {
  --matrix-label-size: 22px;
  --matrix-support-size: 18px;
  margin-block: var(--preview-figure-space);
  overflow-wrap: anywhere;
  font-size: var(--matrix-support-size);
}
/* Wide evidence tables remain labeled records even at desktop article width.
   Native headers stay in the accessibility tree; cell headers/roles survive. */
.remaining-preview .preview-matrix table,
.remaining-preview .preview-matrix tbody,
.remaining-preview .preview-matrix tr,
.remaining-preview .preview-matrix th,
.remaining-preview .preview-matrix td,
.remaining-preview .preview-matrix caption { display: block; width: 100%; }
.remaining-preview .preview-matrix thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.remaining-preview .preview-matrix table,
.remaining-preview .preview-matrix td { font-size: var(--matrix-support-size); }
.remaining-preview .preview-matrix th { font-size: var(--matrix-label-size); }
.remaining-preview .preview-matrix tbody tr { margin-bottom: var(--preview-cell-space); border: var(--preview-rule-width) solid var(--color-border); }
.remaining-preview .preview-matrix tbody th,
.remaining-preview .preview-matrix tbody td { padding: var(--preview-cell-space); border: none; border-bottom: var(--preview-rule-width) solid var(--color-border); }
.remaining-preview .preview-matrix .field-label { display: block; font-size: var(--matrix-label-size); font-weight: bold; color: var(--color-primary); }
.remaining-preview .preview-matrix a { display: inline-block; min-height: 24px; }
.remaining-preview .preview-matrix .unmeasured { display: inline; }
@media (max-width: 900px) {
  .remaining-preview .post-content table,
  .remaining-preview .post-content tbody,
  .remaining-preview .post-content tr,
  .remaining-preview .post-content th,
  .remaining-preview .post-content td { display: block; width: 100%; overflow: visible; }
  .remaining-preview .post-content thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .remaining-preview .post-content tbody tr { margin-bottom: var(--preview-cell-space); border: var(--preview-rule-width) solid var(--color-border); }
  .remaining-preview .post-content tbody th,
  .remaining-preview .post-content tbody td { padding: var(--preview-cell-space); border: none; border-bottom: var(--preview-rule-width) solid var(--color-border); }
  .remaining-preview .field-label { display: block; font-size: var(--preview-label-size); font-weight: bold; color: var(--color-primary); }
}

.post-content .series-about {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--color-primary);
  background: var(--color-card-bg);
}
.post-content .series-about p {
  margin: 0;
}
/* The closing block is four short paragraphs (who we are, "Secure it", "Build it", the services index);
   the gap between them is what separates the two offers. */
.post-content .series-about p + p {
  margin-top: 0.75rem;
}

/* Series line under the title of a series post (scripts/gen-series-nav.py): the linked series name, then the
   part. The paragraph takes the muted look of .post-header .meta from styles.css. The padding gives the one
   link a target at least 24px high without moving the text, and the line height keeps a wrapped second line
   clear of it. The link is underlined because its colour alone is too close to the muted part name beside it
   (about 1.7 to 1) to mark it as a link. */
.post-header .series-context {
  margin: 0;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.post-header .series-context a {
  padding-block: 0.35rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Glossary: a term per <dt>, its definition and source in the <dd>. */
.remaining-preview .post-content dt { margin-top: var(--preview-cell-space); font-weight: bold; color: var(--color-primary); scroll-margin-top: 5rem; }
.remaining-preview .post-content dd { margin: 0.25rem 0 0; }

/* Blog index "Start here" section (blog index, scripts/gen-blog-qa-index.py): one section per series, after the
   tracks row and as wide as the hub's other blocks (--blog-hub-* are set on .page-blog in styles.css). Its parts
   stand side by side, four columns wide; at tablet width they flow down two balanced columns (two parts in
   each, in reading order) and on a phone down one. Each part is its name over its posts in reading order. Links
   are underlined, so a link differs from text by more than its colour. A post link is a block, so the number
   of a title that wraps stands by the title's first line. */
.series-start {
  --series-start-space: 1.5rem;
  width: min(100% - 2 * var(--blog-hub-gutter), var(--blog-hub-width) - 2 * var(--blog-hub-gutter));
  margin: 0 auto 2.5rem;
  padding: var(--series-start-space);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  scroll-margin-top: var(--header-height);
}
.series-start h2 { font-family: var(--font-heading); font-size: 1.4rem; line-height: 1.3; color: var(--color-primary); margin: 0 0 0.5rem; }
.series-start__for { color: var(--color-text-muted); max-width: 70ch; margin: 0 0 var(--series-start-space); }
.series-start__parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--series-start-space) 2rem; }
.series-start__part { min-width: 0; padding-top: 0.75rem; border-top: 2px solid var(--color-line-strong); }
.series-start__part h3 { font-family: var(--font-heading); font-size: 1rem; line-height: 1.35; margin: 0 0 0.5rem; scroll-margin-top: var(--header-height); }
.series-start__posts { margin: 0; padding-left: 1.5rem; color: var(--color-label); font-size: 0.9rem; }
.series-start__posts li { margin-bottom: 0.15rem; }
.series-start a {
  display: inline-block;
  min-height: var(--blog-hub-tap);
  padding-block: 0.2rem;
  line-height: 1.4;
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-line-strong);
  text-underline-offset: 0.2em;
}
.series-start__posts a { display: block; }
.series-start__reference { margin: var(--series-start-space) 0 0; color: var(--color-text-muted); font-size: 0.9rem; }
@media (max-width: 1099px) {
  .series-start__parts { display: block; column-count: 2; column-gap: 2rem; }
  .series-start__part { break-inside: avoid; }
  .series-start__part + .series-start__part { margin-top: var(--series-start-space); }
}
@media (max-width: 640px) {
  .series-start { padding: 1rem; }
  .series-start__parts { column-count: 1; }
}

/* The same example in several APIs: one panel per API, one under the other at every width. The lines being
   compared run to 80 characters and more, and three columns never gave a panel that much room (47 characters
   at 1280px), so the line a reader came to compare ran out of every panel. minmax(0, 1fr) lets a longer line
   scroll inside its panel instead of widening the grid. */
.remaining-preview .code-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--preview-figure-space);
  margin-block: var(--preview-figure-space);
}
.remaining-preview .code-compare__panel { min-width: 0; }
.remaining-preview .code-compare__panel h3 { margin-top: 0; color: var(--color-primary); }

/* Code size. A block is set smaller than the prose and reaches into the article's side padding (--code-bleed is
   the 2rem padding of .post-content in styles.css), so a line holds about 91 characters in the 800px article
   and about 45 on a 390px phone, where the block runs from edge to edge. 13px is the floor. */
.post-content {
  --code-size: 0.875rem;
  --code-size-narrow: 0.8125rem;
  --code-line-height: 1.6;
  --code-bleed: 2rem;
}

/* Code blocks: build-time token spans from scripts/gen-code-highlight.py. Every color meets WCAG AA (4.5:1) against
   --color-card-bg, the code background in styles.css. Token rules may set only color, font-style and font-weight
   (the generator's --check enforces it), so a token span can never hide or move text. The same check holds the
   size, line height and bleed below to the --code-* variables above, and those to their committed values. */
.post-content pre {
  --tok-keyword: #7cc7ff;
  --tok-string: #f2c66d;
  --tok-comment: #9bb5a7;
  --tok-name: #3dff8a;
  --tok-operator: #ff8fa3;
  --tok-number: #c7a6ff;
  --tok-punctuation: #b9cbc1;
  --tok-generic: #d5e3dc;
  margin-inline: calc(-1 * var(--code-bleed));
  overflow-x: auto;
  color: var(--color-text);
  font-size: var(--code-size);
  line-height: var(--code-line-height);
}
.post-content pre code { white-space: pre; overflow-wrap: normal; font-size: inherit; }
@media (max-width: 768px) {
  .post-content pre { font-size: var(--code-size-narrow); }
}
.post-content pre .tok-k { color: var(--tok-keyword); font-weight: bold; }
.post-content pre .tok-s { color: var(--tok-string); }
.post-content pre .tok-c { color: var(--tok-comment); font-style: italic; }
.post-content pre .tok-n { color: var(--tok-name); }
.post-content pre .tok-o { color: var(--tok-operator); }
.post-content pre .tok-m { color: var(--tok-number); }
.post-content pre .tok-p { color: var(--tok-punctuation); }
.post-content pre .tok-g { color: var(--tok-generic); }

/* 3D figures (posts/scenes3d/engine3d.js): every series figure is played as a scene. The figure's media box (its
   first child: a <div> round the <picture>, or the <picture> itself) is framed by the marked block at the end of
   this file from first paint, at the scene's aspect and never taller than the screen, and the script lays one
   <div> of its own over that frame: the stage, with the caption and the controls inside it. The static image is
   the content image and a figure's list is the text for everyone. The rules here are the site's side: the list,
   the phone cap and bleed of the media box, and showing the whole image where no script runs. */
.a1-preview .preview-figure > div picture,
.remaining-preview .preview-figure > div picture { max-width: none; }
.a1-preview .preview-figure > ol,
.remaining-preview .preview-figure > ol { font-size: var(--preview-support-size); margin-top: var(--preview-cell-space); }
.a1-preview .preview-figure > ol li,
.remaining-preview .preview-figure > ol li { padding-left: 0.25rem; border-left: 3px solid transparent; }
.a1-preview .preview-figure > ol li.s3-step--current,
.remaining-preview .preview-figure > ol li.s3-step--current {
  border-left-color: var(--color-primary);
  color: var(--color-primary);
}
@media (max-width: 767px) {
  .a1-preview .preview-figure > div,
  .remaining-preview .preview-figure > div { max-width: var(--preview-mobile-figure-max); margin-inline: auto; }
}
/* On a phone (480px and under) every figure's media box bleeds through the article's side padding to the screen
   edges, so the frame, and the scene in it, is as wide as the screen; the list and the caption keep the padding.
   `--scene-bleed` is the side padding of `.post-content` in styles.css. The width is stated, not left to the
   margins: a box with an aspect ratio and no stated width is narrowed by the browser when its height cap binds. */
@media (max-width: 480px) {
  .a1-preview .preview-figure > div,
  .remaining-preview .preview-figure > div,
  .a1-preview .preview-figure > picture,
  .remaining-preview .preview-figure > picture {
    --scene-bleed: 2rem;
    width: calc(100% + 2 * var(--scene-bleed));
    max-width: none;
    margin-inline: calc(-1 * var(--scene-bleed));
  }
}
/* The two rules above size the media box. The engine's stage is a <div> in the same place (its only direct child
   of the figure), so it is taken out of both here, at every width: it keeps the place and size the script gives
   it. */
.a1-preview .preview-figure > .s3__stage,
.remaining-preview .preview-figure > .s3__stage { max-width: none; margin-inline: 0; }
/* Without script no scene can be built, so the frame comes off and the whole static image shows. (The series
   pages may not carry a <noscript> element: gen-term-links.py refuses one, so this is a media query.) */
@media (scripting: none) {
  .a1-preview .preview-figure > div,
  .remaining-preview .preview-figure > div,
  .a1-preview .preview-figure > picture,
  .remaining-preview .preview-figure > picture { aspect-ratio: auto; max-height: none; overflow: visible; }
}

/* scenes3d:begin (the 3D figure engine's styles; one block, replaced whole when the engine changes) */
/* 3D figures of the local AI series (engine3d.js): the stylesheet block the series stylesheet carries.
   Colours appear only as var(--name); the kit's own values are custom properties on .s3, which the script reads
   with getComputedStyle and hands to three.js.
   Layout contract: the stage is laid over the figure's static image (same box), and the caption band is inside
   the stage, over its bottom edge. The engine adds nothing to the page's flow, so the figure's box never changes. */
.s3 {
  --s3-bg: #050807;
  --s3-floor: #141a18;
  /* the light rig: the housings' own colour, the slab under a group, the ground, and the three lights */
  --s3-body: #4a5552;
  --s3-plinth: #0f1413;
  --s3-ground: #121716;
  --s3-key: #fff2e2;
  --s3-fill: #aab8c8;
  --s3-fill-low: #1c2320;
  --s3-rim: #7fb0ff;
  --s3-panel: #0f1514;
  --s3-screen: #cfdcd6;
  /* role tints of the housings' shells: what asks (console), what converts or guards (gate), what computes or stores (tower, rack, vault, switch) */
  --s3-tint-ask: #46594f;
  --s3-tint-pass: #6a767c;
  --s3-tint-run: #474f63;
  --s3-face-top: #808e87;
  --s3-face-front: #47564f;
  --s3-face-side: #1b2428;
  --s3-lane-idle: #4b5852;
  --s3-row-text: #c9d1cd;
  --s3-wafer: #d6dbd6;
  --s3-slab-top: #f7f9f8;
  --s3-slab-wall: #9ca5a1;
  --s3-recess: #3a403e;
  --s3-track: #1b201e;
  --s3-lamp-off: #56605c;
  --s3-lamp-on: #e4e9e6;
  --s3-lane: #74877f;
  --s3-lane-active: #d8deda;
  --s3-cable-top: #7b8882;
  --s3-cable-wall: #4c5350;
  --s3-meter-fill: #c9cfcc;
  --s3-accent-a: #3dff8a;
  --s3-accent-b: #8ab4ff;
  --s3-accent-c: #b36bff;
  --s3-accent-stop: #ff5c5c;
  --s3-cost: #ffb84d;
  --s3-pill: rgba(11, 17, 16, 0.85);
  --s3-pill-line: #22302c;
  --s3-leader: #5d6e68;
  --s3-accent-neutral: #74877f;
  --s3-text: #e9f1ed;
  --s3-text-2: #b2c0ba;
  --s3-backing: rgba(5, 8, 7, 0.72);
  --s3-button: #0d1412;
  --s3-button-off: #2a3530;
  --s3-sans: system-ui, -apple-system, Roboto, sans-serif;
  --s3-quick: 0.12s linear;
  color: var(--s3-text);
  font-family: var(--s3-sans);
  text-align: left;
}
.s3-fig { position: relative; }
/* The frame. Every figure of the series gets a scene, and the static images are tall diagrams, so the figure's media
   box (its first child: a div round the picture, or the picture itself) is framed from first paint at the stage's
   own aspect, never taller than the screen less the page's fixed header (--s3-header, set by the script once it
   has measured it) and 24 px. The image keeps its width and shows its top; the rest is one click away. Because
   the frame is in the stylesheet, building the scene moves nothing. Reduced motion shows the whole image, here in
   the stylesheet; the script adds s3-unframed for the other fallbacks and when the reader asks for the diagram.
   The aspect is 16:10, and 3:5 where the page shows a figure's narrow image on an upright screen. The page
   switches to the wide image at 768 px for a figure whose media box is a div and at 901 px for one whose media
   box is the picture itself, so THE TWO BREAKPOINTS of this block are 767 px (div) and 900 px (picture). */
.preview-figure > div, .preview-figure > picture { display: block; aspect-ratio: 16 / 10; max-height: calc(100vh - var(--s3-header, 96px) - 24px); overflow: hidden; }
@media (max-width: 767px) and (orientation: portrait) {
  .preview-figure > div { aspect-ratio: 3 / 5; }
}
@media (max-width: 900px) and (orientation: portrait) {
  .preview-figure > picture { aspect-ratio: 3 / 5; }
}
/* When the height cap binds, a browser narrows a box that has an aspect ratio. The frame keeps the width its place
   in the page gives it and is simply shorter: where the page lets the media box fill its column (a div from 768 px,
   a picture from 901 px) and where it bleeds the media box to the screen's edges (480 px and under). Between those the
   page caps the box at a fixed width, which a minimum width would override, so there the box is left alone. */
@media (min-width: 768px) {
  .preview-figure > div { min-width: 100%; }
}
@media (min-width: 901px) {
  .preview-figure > picture { min-width: 100%; }
}
@media (max-width: 480px) {
  .preview-figure > div, .preview-figure > picture { min-width: -webkit-fill-available; min-width: -moz-available; min-width: stretch; }
}
/* Where a scene could never be read the figure is not framed at all, from first paint, so nothing moves later: the
   whole static image shows and the script builds nothing (it reads the missing frame as its too-small gate).
   On a screen on its side the page shows a picture media box 360 px wide up to 900 px, and a div media box 360 px
   wide up to 767 px: at 16:10 that is 225 px high, less than the top strip and the band need. And on any screen
   on its side under 410 px high, the cap (the height less a 96 px header and 24 px) less the wide stage's strip
   and band (140 px) leaves under 150 px for the picture. 96 px is at least any header the page has, so this
   un-frames a little more than the script alone would, never less. */
@media (max-width: 900px) and (orientation: landscape) {
  .preview-figure > picture { aspect-ratio: auto; max-height: none; min-width: 0; overflow: visible; }
}
@media (max-width: 767px) and (orientation: landscape) {
  .preview-figure > div { aspect-ratio: auto; max-height: none; min-width: 0; overflow: visible; }
}
@media (max-height: 410px) and (orientation: landscape) {
  .preview-figure > div, .preview-figure > picture { aspect-ratio: auto; max-height: none; min-width: 0; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .preview-figure > div, .preview-figure > picture { aspect-ratio: auto; max-height: none; min-width: 0; overflow: visible; }
}
.s3-unframed > div, .s3-unframed > picture { aspect-ratio: auto; max-height: none; overflow: visible; }
.s3--hidden { display: none; }
.s3--ghost { visibility: hidden; }

/* the stage: over the image, in the image's own box (the script sets left, top, width and height) */
.s3-fig > .s3__stage { display: block; position: absolute; aspect-ratio: auto; max-height: none; overflow: visible; margin: 0; background: var(--s3-bg); }
/* the picture itself: the whole stage, or, when the image is taller than the screen, a view pinned while it scrolls past */
.s3__view { position: relative; width: 100%; height: 100%; overflow: hidden; }
.s3__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the last pixels of the picture fade into the page background, so no canvas edge can show */
.s3__fade { position: absolute; inset: 0; z-index: 0; pointer-events: none; box-shadow: inset 0 0 22px 5px var(--s3-bg); }
.s3__labels, .s3__head { z-index: 1; }
.s3__labels { position: absolute; inset: 0; pointer-events: none; }
.s3__head { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 20px; padding: 8px 12px 6px; pointer-events: none; }
.s3 .s3__title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.25; }
/* the legend: one line beside the title when it fits, else its own left-aligned row under it; never dropped */
.s3 .s3__legend { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0 0 0 auto; padding: 0; list-style: none; font-size: 12px; line-height: 1.35; color: var(--s3-text-2); }
.s3 .s3__entry { display: flex; align-items: center; gap: 6px; margin: 0; }
.s3__accent--a { --s3-mark: var(--s3-accent-a); }
.s3__accent--b { --s3-mark: var(--s3-accent-b); }
.s3__accent--c { --s3-mark: var(--s3-accent-c); }
.s3__accent--stop { --s3-mark: var(--s3-accent-stop); }
.s3__accent--neutral { --s3-mark: var(--s3-accent-neutral); }
.s3__glyph { flex: none; box-sizing: border-box; width: 18px; height: 6px; border-radius: 2px; background: var(--s3-mark); }
.s3__glyph--band-side { width: 6px; height: 13px; }
.s3__glyph--dot, .s3__glyph--lamp { width: 9px; height: 9px; border-radius: 50%; }
.s3__glyph--ring { width: 12px; height: 12px; border-radius: 50%; background: none; border: 2px solid var(--s3-mark); }
.s3__glyph--dash { height: 0; background: none; border-top: 2px dashed var(--s3-mark); border-radius: 0; }
.s3__glyph--slab { width: 14px; height: 9px; }
.s3__glyph--stop { width: 16px; height: 4px; border-radius: 0; }
.s3__glyph--cut { width: 11px; height: 11px; border-radius: 0; clip-path: polygon(0 0, 55% 0, 100% 45%, 100% 100%, 0 100%); }
.s3-nolabels .s3__labels, .s3-nolabels .s3__head, .s3-nolabels .s3__band { visibility: hidden; }

/* labels: 13 px, explicit line breaks only, never wrapped. A name is primary text on an opaque backing. */
.s3 .s3__lab { position: absolute; left: 0; top: 0; box-sizing: border-box; margin: 0; padding: 2px 6px 3px; background: var(--s3-backing); color: var(--s3-text); font-size: 14px; line-height: 18px; text-align: center; white-space: nowrap; border-radius: 3px; opacity: 0; transition: opacity var(--s3-quick); will-change: transform; }
.s3__small { font-size: 13px; opacity: 0.72; }
.s3 .s3__code { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.94em; }
/* a housing's name sits above it on a short leader, never on a face */
.s3 .s3__lab--station { font-size: 16px; font-weight: 600; background: none; border: 1px solid transparent; border-radius: 4px; padding: 1px 7px 2px; }
/* a name that lies over a housing in the frame being drawn takes the pill again (same box: the border is always there, transparent) */
.s3 .s3__lab--over { background: var(--s3-pill); border-color: var(--s3-pill-line); }
/* the leader: a 1 px line from a label to what it names, ending in a dot; it leaves the side of the label that faces it */
.s3__leader, .s3__pin { position: absolute; left: 0; top: 0; background: var(--s3-leader); opacity: 0; pointer-events: none; }
/* the leader is a fixed 100 px by 1 px box at the label's top left corner; the script moves, turns and stretches it by transform only, so it never changes the page's layout */
.s3__leader { width: 100px; height: 1px; transform-origin: 0 0; }
.s3__pin { width: 3px; height: 3px; border-radius: 50%; }
/* a prop with no room for its name before the play: a lettered mark in the picture, its name in the key under the title */
.s3 .s3__lab--dot { background: none; padding: 0; }
.s3 .s3__key { position: absolute; left: 12px; right: 12px; top: 100%; display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; padding: 1px 0; font-size: 12px; line-height: 18px; color: var(--s3-text-2); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
/* (the script caps the key's height at the strip its frame keeps for it; a taller key scrolls inside its own box) */
.s3__keyitem { display: inline-flex; align-items: flex-start; gap: 5px; }
.s3 .s3__key .s3__disc { min-width: 18px; height: 18px; font-size: 11px; border-width: 1px; }
/* the key's marks are letters in squares: the round numbered discs in the picture are the lanes' alone */
.s3 .s3__lab--dot .s3__disc, .s3 .s3__key .s3__disc { border-radius: 3px; }
/* (a numbered step in the key keeps the round disc it has in the picture) */
.s3 .s3__key .s3__disc--n { border-radius: 9px; }
.s3 .s3__lab--station .s3__small { font-weight: 400; }
.s3 .s3__lab--zone { background: none; padding: 1px 2px; color: var(--s3-text); opacity: 0.62; text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.s3 .s3__lab--zone .s3__small { text-transform: none; letter-spacing: 0; }
.s3 .s3__lab--ghost { border: 1px dashed var(--s3-lane); }
/* a label of something the step is not about: the second text colour on the same opaque backing. Against the pill
   over the lightest lit face the contrast is 5.8 to 1 (4.5 asked). */
.s3 .s3__lab--dim { color: var(--s3-text-2); }
/* a carrier's tag keeps the 13 px of the releases before the type was enlarged: it is the widest label (semi-bold, spaced) and must find a place beside a moving carrier on a 374 px stage */
.s3 .s3__lab--tag { font-size: 13px; line-height: 17px; font-weight: 600; letter-spacing: 0.02em; background: var(--s3-bg); border: 1px solid var(--s3-lane); }
.s3 .s3__lab--chip, .s3 .s3__lab--note, .s3 .s3__lab--readout { font-size: 13px; color: var(--s3-text-2); }
/* a note (a screen's rows beside it, an exit's word, a port's word, a limit) is never loose words on the floor: it has the pill's backing and edge */
.s3 .s3__lab--note { background: var(--s3-pill); border: 1px solid var(--s3-pill-line); }
.s3 .s3__lab--row { background: none; padding: 0 2px; font-size: 13px; line-height: 16px; color: var(--s3-row-text); text-align: left; }
.s3 .s3__lab--readout, .s3 .s3__lab--lit { color: var(--s3-text); }
/* a comparison of meters: each value in 16 px beside its level */
.s3--compare .s3__lab--readout { font-size: 20px; line-height: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.s3--compare.s3--narrow .s3__lab--readout { font-size: 16px; line-height: 18px; padding: 1px 4px; }
.s3 .s3__lab--refused { font-weight: 600; background: var(--s3-bg); border: 1px solid var(--s3-accent-stop); }
.s3 .s3__lab--lane { display: flex; align-items: center; gap: 5px; padding: 2px; text-align: left; border: 1px solid transparent; font-size: 13px; line-height: 16px; }
.s3 .s3__lab--lane .s3__words { padding-right: 4px; }
.s3 .s3__lab--active { border-color: var(--s3-lane-active); }
.s3__disc { flex: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 22px; height: 22px; padding: 0 2px; border-radius: 11px; background: var(--s3-bg); color: var(--s3-text); font-size: 12px; font-weight: 700; line-height: 1; border: 2px solid var(--s3-mark, var(--s3-lane)); }
.s3 .s3__lab--station .s3__disc { margin-right: 5px; vertical-align: -3px; }

/* the claim line: the notes in force and, at the end, the closing line. Laid over the top of the picture, just
   under the strip, only while there is a claim to show; it takes no room of its own. It wraps: up to two lines of
   18 px on a wide stage, up to five of 16 px on a narrow one, clipped beyond. */
.s3 .s3__claim { position: absolute; left: 12px; right: 12px; top: 100%; box-sizing: border-box; max-height: 38px; margin: 0; padding: 1px 6px; background: var(--s3-backing); border-radius: 3px; font-size: 13px; line-height: 18px; color: var(--s3-text); overflow: hidden; }
/* the band: inside the stage, over its bottom edge, on a scrim. Nothing of it is in the page's flow, so the
   figure's box never changes. The step line and the caption (two lines, clipped beyond) on the left, one row of
   controls on the right. Every height in it is set here, so it is the same for every story: 72 px. */
.s3__band { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; box-sizing: border-box; display: flex; align-items: flex-start; gap: 4px 20px; height: 72px; margin: 0; padding: 8px 12px; background: var(--s3-backing); }
.s3__text { flex: 1 1 auto; min-width: 0; }
.s3 .s3__step, .s3 .s3__plain, .s3 .s3__tech, .s3 .s3__full { margin: 0; padding: 0; }
.s3 .s3__step { height: 15px; font-size: 11px; line-height: 15px; color: var(--s3-text-2); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.s3 .s3__plain { height: 40px; font-size: 15px; line-height: 20px; color: var(--s3-text); overflow: hidden; }
/* the details panel: just above the band, under the picture the script fits above it (the script sets its bottom edge), at most 40% of the stage, scrolling inside; or inside the band over the caption */
/* (its backing is opaque: no label or housing is read through its text) */
.s3__panel { position: absolute; left: 0; right: 0; z-index: 2; box-sizing: border-box; max-height: 40%; overflow: auto; overscroll-behavior: contain; margin: 0; padding: 8px 12px; background: var(--s3-bg); border-top: 1px solid var(--s3-lane); }
/* the control for the static diagram stands at the panel's top right, the text beside and under it: whole in sight in every room the panel is given (60 px is the smallest), never below its fold */
.s3 .s3__button--still { float: right; margin: 0 0 4px 12px; }
.s3 .s3__full { font-size: 14px; line-height: 20px; padding-bottom: 4px; color: var(--s3-text); }
.s3 .s3__tech { font-size: 13px; line-height: 18px; color: var(--s3-text-2); overflow-wrap: anywhere; }

.s3__controls { flex: none; align-self: center; display: flex; align-items: center; gap: 6px; }
.s3__group { display: grid; grid-auto-flow: column; gap: 6px; }
.s3__button--play, .s3__button--replay { grid-area: 1 / 2; }
.s3__button--atend { visibility: hidden; }
.s3__button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; height: var(--tap-target-min, 44px); min-width: var(--tap-target-min, 44px); margin: 0; padding: 0 12px; font: 500 13px var(--s3-sans); line-height: 1.2; color: var(--s3-text); background: var(--s3-button); border: 1px solid var(--s3-lane); border-radius: 4px; cursor: pointer; white-space: nowrap; }
.s3__button--icon { width: var(--tap-target-min, 44px); padding: 0; }
.s3__button:focus-visible { outline: 2px solid var(--s3-text); outline-offset: 2px; }
/* a box that scrolls (the details panel, a key taller than its strip) takes the keyboard focus while it scrolls: the same ring, drawn inside the panel's edge (the view clips at the stage) */
.s3 .s3__panel:focus-visible { outline: 2px solid var(--s3-text); outline-offset: -2px; }
.s3 .s3__key:focus-visible { outline: 2px solid var(--s3-text); outline-offset: 2px; }
.s3__button--disabled { color: var(--s3-lane); border-color: var(--s3-button-off); cursor: default; }
/* the transport icons, drawn from boxes in the text colour: a bar, a triangle either way, a ring */
.s3__ico { display: inline-flex; align-items: center; gap: 3px; }
.s3__bar { width: 3px; height: 14px; background: currentColor; }
.s3__tri { width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent currentColor; }
.s3__tri--back { border-width: 7px 11px 7px 0; border-color: transparent currentColor transparent transparent; }
.s3__ring { box-sizing: border-box; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
/* a name kept for assistive technology and hidden from sight */
.s3__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* a narrow stage: 104 px. The caption (three lines of 16 px) above one row: the transport, the step count, the details toggle */
.s3--narrow .s3__band { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 48px 44px; gap: 3px 10px; align-items: center; height: 104px; padding: 5px 16px 4px; }
.s3--narrow .s3__text { display: contents; }
.s3--narrow .s3__controls { display: contents; }
.s3--narrow .s3__plain { grid-area: 1 / 1 / 2 / 4; align-self: start; height: 48px; font-size: 14px; line-height: 16px; }
.s3--narrow .s3__group { grid-area: 2 / 1; }
.s3--narrow .s3__step { grid-area: 2 / 2; height: 14px; line-height: 14px; text-align: center; }
.s3--narrow .s3__button--text { grid-area: 2 / 3; }
.s3--narrow .s3__panel { padding: 8px 16px; }
/* where the cast has no fit above the panel, the panel stands inside the band, over the caption it repeats, and scrolls */
.s3 .s3__panel--inband { z-index: 3; padding-top: 5px; padding-bottom: 4px; border-top: 0; }
/* the strip at the top of a narrow stage: the title on one line of 20 px (cut with an ellipsis), then the legend,
   which wraps onto as many lines of 16 px as it needs; nothing scrolls sideways. The script measures the strip and
   fits the picture under it. */
.s3--narrow .s3__head { display: block; padding: 6px 16px 4px; }
.s3--narrow .s3__title { height: 20px; font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s3--narrow .s3__legend { margin: 0; gap: 0 12px; font-size: 12px; line-height: 16px; }

.s3--narrow .s3__claim { left: 16px; right: 16px; max-height: 82px; font-size: 12px; line-height: 16px; }
.s3--narrow .s3__lab--station { font-size: 15px; }
.s3--narrow .s3__key { left: 16px; right: 16px; }
/* the control that brings the scene back while the reader looks at the static diagram: above the image, and it stays
   under the page's header while the tall image scrolls by, so the way back is always in reach */
.s3__back { position: sticky; top: calc(var(--s3-header, 96px) + 8px); z-index: 3; display: flex; justify-content: flex-start; margin: 0 0 8px; }
/* it is its own opaque strip, exactly as wide as the media box and at its left edge at every screen width (the
   script sets its width and left margin from the media box: the page may cap the box and centre it, or bleed it
   past the figure's own column): the diagram's text never shows through or beside it */
.s3 .s3__back, .s3__button.s3__back { background: var(--s3-bg); }
@media (prefers-reduced-motion: reduce) {
  .s3 .s3__lab { transition: none; }
}
/* scenes3d:end */
