/* SPDX-FileCopyrightText: 2026 José M. Requena Plens
   SPDX-License-Identifier: GPL-3.0-or-later */

/* api.kleidos.dev: the one sheet of the host that serves the generated
   references, beside tokens.css.

   tokens.css is not written by hand: scripts/stage.mjs cuts it from the
   site's own sheet (assets/style.css: its faces and its tokens layer), so
   this host and kleidos.dev read one set of tokens and cannot drift. This
   file holds no color literal, no font size that is not a role and no rule
   that names a theme: both themes come with the tokens, by what the reader's
   system asks for. The host's one script is the search (assets/search.js),
   and nothing here waits for it: without it the bar's control is a link.

   Three kinds of page read it: the index (pages/index.html), the page of a
   missing address (pages/404.html), and every page of a reference Doxygen
   wrote (body.reference), whose markup is Doxygen 1.18.0's with the header and
   footer of the firmware's docs/published-reference/. The reference's rules style
   Doxygen's own class names; no sheet of Doxygen's is served.

   Layers, in order: tokens (tokens.css), base, chrome (what every page
   wears), index, reference, print.

   The faces are the site's, declared in tokens.css, with more characters: the
   ones code is written with (scripts/subset_fonts.py). What their family does
   not draw is in the two faces declared here, for those characters alone. */

@layer tokens, base, chrome, index, reference, print;

@font-face {
  font-family: "Kleidos Sans";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  src: url("fonts/kleidos-signs-text.woff2") format("woff2");
  font-display: optional;
  unicode-range:
    U+0394, U+03A3, U+03A9, U+2016, U+21B5, U+21D2, U+232B, U+23CE, U+25B2, U+25BC, U+25C6,
    U+25CF, U+26A0;
}

@font-face {
  font-family: "Kleidos Mono";
  font-style: normal;
  font-weight: 400 500;
  src: url("fonts/kleidos-signs-mono.woff2") format("woff2");
  font-display: optional;
  unicode-range:
    U+0394, U+03A3, U+2016, U+21D2, U+232B, U+23CE, U+2500, U+2502, U+2514, U+251C, U+25B2,
    U+25BC, U+25C6, U+25CF, U+26A0;
}

@layer base {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  /* A part reached by its fragment lands below the sticky bar. */
  html {
    scrollbar-gutter: stable;
    scroll-padding-top: calc(var(--header-h) + var(--s-4));
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: var(--t-body-face);
    font-size: var(--t-body);
    font-variation-settings: var(--t-body-fvs);
    font-weight: var(--t-body-weight);
    font-stretch: var(--t-body-width);
    line-height: var(--t-body-lh);
    color: var(--ink);
    letter-spacing: var(--t-body-track);
    overflow-wrap: break-word;
    background: var(--bg);
  }

  h1 {
    font-family: var(--t-chapter-face);
    font-size: var(--t-chapter);
    font-variation-settings: var(--t-chapter-fvs);
    font-weight: var(--t-chapter-weight);
    font-stretch: var(--t-chapter-width);
    line-height: var(--t-chapter-lh);
    letter-spacing: var(--t-chapter-track);
  }

  h2 {
    font-family: var(--t-section-face);
    font-size: var(--t-section);
    font-variation-settings: var(--t-section-fvs);
    font-weight: var(--t-section-weight);
    font-stretch: var(--t-section-width);
    line-height: var(--t-section-lh);
    letter-spacing: var(--t-section-track);
  }

  h3 {
    font-family: var(--t-title-face);
    font-size: var(--t-title);
    font-variation-settings: var(--t-title-fvs);
    font-weight: var(--t-title-weight);
    font-stretch: var(--t-title-width);
    line-height: var(--t-title-lh);
    letter-spacing: var(--t-title-track);
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
  }

  p,
  li,
  dd {
    text-wrap: pretty;
  }

  code,
  kbd,
  samp,
  pre {
    font-family: var(--t-label-face);
    font-variation-settings: var(--t-label-fvs);
    font-stretch: var(--t-label-width);
  }

  a {
    color: var(--accent);
    text-underline-offset: 0.2em;
  }

  /* A link in a line of type is shorter than the 24 px a target is owed:
     19.7 px at --t-small, 17 px at --t-label, and the body's 23.97 px, which
     WebKit draws as it is. Block padding on an inline box grows what a
     pointer can hit and moves no line (the site's two rules, its `@region
     primitives`); at a size whose words reach 24 px the padding comes to
     nothing. On a link drawn as a box of its own (a flex item, an
     inline-flex, a block) the same padding makes the box taller and moves
     what is around it, so such a link sets its own (`padding-block: 0` beside
     its `min-height`), which outweighs this one from any later layer: the
     sweep fails one that does not (`boxLinks`). An example's links are its
     lines'. */
  :where(main, .api-footer) a[href]:where(:not(.fragment *)) {
    padding-block: calc((24px - 1.3em) / 2);
  }

  img {
    max-width: 100%;
    height: auto;
  }

  /* An outline and not a shadow, so it survives forced colors. */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  ::selection {
    color: var(--ink);
    background: var(--select);
  }
}

@layer chrome {
  /* @region visually-hidden */
  /* Words for who does not see what the page shows. */
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
  }
  /* @endregion */

  /* @region skip-link */
  /* Off the top of the page until it has the keyboard. */
  .skip-link {
    position: absolute;
    top: var(--s-4);
    left: max(var(--gutter), env(safe-area-inset-left));
    z-index: 5;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--s-4);
    color: var(--ink);
    background: var(--surface);
    border-radius: var(--r-sm);
    transform: translateY(calc(-100% - var(--s-7)));
  }

  .skip-link:focus {
    transform: none;
  }

  @media (prefers-reduced-motion: no-preference) {
    .skip-link {
      transition: transform var(--d-fast) var(--ease-out);
    }
  }
  /* @endregion */

  /* @region header */
  /* kleidos.dev's sticky bar (`site/assets/style.css`, `@region header`):
     one glass row of --header-h at every width, the one surface content
     scrolls under, so every word on it is --ink (7.17:1 over the worst
     underlay, where --ink-2 drops to 3.26:1). The brand, the way back to the
     list of references, then the reference's own pages: one list, drawn as a
     row from 1100 px up and as the site's menu below that. The menu's control
     is a <details> that opens and closes, takes the keyboard and announces its
     state with no script, which this host serves none of; the list is the
     landmark after it, not its content, so the row never depends on how a
     browser exposes a closed fold's content (WebKit leaves it out of the
     accessibility tree). No transition anywhere on it. */
  .api-header {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    min-height: var(--header-h);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--glass-line);
    backdrop-filter: var(--glass-blur);
  }

  @supports not (backdrop-filter: blur(1px)) {
    .api-header {
      background: var(--surface);
    }
  }

  .api-header-row {
    /* The containing block the menu's sheet hangs from. */
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1) var(--s-3);
    align-items: center;
    width: 100%;
    max-width: var(--wide);
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    margin-inline: auto;
  }

  /* The site's brand (`.brand`): its mark, the keyhole in its ring, and its
     name at the lede's size in the title's face, weight and rhythm, as the
     site sets it (roles.test holds the two rules equal); "API" beside it as a
     label. */
  .api-brand {
    display: inline-flex;
    gap: var(--s-2);
    align-items: center;
    min-height: 44px;
    margin-right: auto;
    font-family: var(--t-title-face);
    font-size: var(--t-lede);
    font-variation-settings: var(--t-title-fvs);
    font-weight: var(--t-title-weight);
    font-stretch: var(--t-title-width);
    line-height: var(--t-title-lh);
    color: var(--ink);
    letter-spacing: var(--t-title-track);
    text-decoration: none;
  }

  .api-brand:hover .api-brand-name {
    text-decoration: underline;
  }

  /* The brand's own file (`assets/logo-mark.svg`, the vendored
     `logo/svg/kleidos-mark.svg` that kleidos.dev serves), in its own cyan and
     navy in both themes, as the site's bar draws it. */
  .brand-mark {
    display: block;
    flex: none;
  }

  .api-brand-what {
    align-self: center;
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
  }

  /* The menu's control: outlined, the glyph and the word. Three bars closed, a
     cross open, so it says it closes with a shape and not only with the
     accent its outline takes; one of the two paths is always hidden. */
  .menu-summary {
    display: inline-flex;
    gap: var(--s-2);
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--s-3);
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--control-line);
    border-radius: var(--r-pill);
  }

  .menu-summary::-webkit-details-marker {
    display: none;
  }

  .menu-summary:hover,
  .site-menu[open] > .menu-summary {
    border-color: var(--accent);
  }

  .menu-glyph {
    display: block;
    flex: none;
  }

  .site-menu:not([open]) .menu-cross,
  .site-menu[open] .menu-bars {
    display: none;
  }

  /* The list, as the site's sheet below 1100 px: across the bar, under it and
     over the page, opaque, scrolling inside itself; drawn, and so in the
     accessibility tree, only while the control before it is open. */
  .api-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    max-height: calc(100dvh - var(--header-h));
    padding: var(--s-3) max(var(--gutter), env(safe-area-inset-right))
      max(var(--s-5), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
    overflow-y: auto;
    background: var(--raised);
    border-bottom: 1px solid var(--rule-strong);
    box-shadow: var(--shadow-card);
  }

  /* What the list is of: the clearest cue that the sheet is a menu. */
  .menu-title {
    padding: 0 0 var(--s-2);
    margin: 0 0 var(--s-1);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
    border-bottom: 1px solid var(--rule);
  }

  .menu-pages {
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .menu-row {
    border-bottom: 1px solid var(--rule);
  }

  .menu-page {
    position: relative;
    display: flex;
    gap: var(--s-3);
    align-items: center;
    min-height: 44px;
    padding: var(--s-2);
    color: var(--ink);
    text-decoration: none;
  }

  .menu-page:hover {
    background: var(--accent-wash);
  }

  /* The page being read: the wash and a dot at the end of the row; the index
     whose letter the page is: a bar on its left. Never the color alone. */
  .menu-page[aria-current="page"] {
    background: var(--accent-wash);
  }

  .menu-page[aria-current="page"]::after {
    flex: none;
    width: 8px;
    height: 8px;
    margin-left: auto;
    content: "";
    background: var(--accent);
    border-radius: var(--r-pill);
  }

  .menu-page[aria-current="true"] {
    padding-left: var(--s-4);
  }

  .menu-page[aria-current="true"]::before {
    position: absolute;
    top: var(--s-2);
    bottom: var(--s-2);
    left: 0;
    width: 3px;
    content: "";
    background: var(--ink-2);
    border-radius: var(--r-pill);
  }

  @media (max-width: 1099px) {
    .site-menu:not([open]) + .api-nav {
      display: none;
    }
  }

  /* Off the phone widths the menu is a panel under its control, not a sheet. */
  @media (min-width: 720px) {
    .api-nav {
      right: max(var(--gutter), env(safe-area-inset-right));
      left: auto;
      width: 360px;
      padding-right: var(--s-4);
      padding-left: var(--s-4);
      border: 1px solid var(--rule-strong);
      border-top: 0;
      border-radius: 0 0 var(--r-md) var(--r-md);
    }
  }

  /* From 1100 px up the same list is the row: the control and the list's name
     are not drawn, and the entries are the site's pills, the page being read
     underlined in the accent and the index a letter page is of in dotted ink. */
  @media (min-width: 1100px) {
    .site-menu,
    .menu-title {
      display: none;
    }

    .api-nav {
      position: static;
      width: auto;
      max-height: none;
      padding: 0;
      overflow: visible;
      background: none;
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }

    .menu-pages {
      display: flex;
    }

    .menu-row {
      border: 0;
    }

    .menu-page {
      display: inline-flex;
      padding: 0 clamp(6px, calc(1vw - 5px), 10px);
      white-space: nowrap;
      text-underline-offset: 6px;
      border-radius: var(--r-pill);
    }

    .menu-page[aria-current] {
      padding-left: clamp(6px, calc(1vw - 5px), 10px);
      background: none;
    }

    .menu-page[aria-current]:hover {
      background: var(--accent-wash);
    }

    .menu-page[aria-current]::before,
    .menu-page[aria-current]::after {
      content: none;
    }

    .menu-page[aria-current="page"] {
      text-decoration: underline solid 2px var(--accent);
    }

    .menu-page[aria-current="true"] {
      text-decoration: underline dotted 2px var(--ink);
    }
  }

  /* Narrower still, the control keeps its glyph and loses its word, which
     stays for what reads rather than looks. The brand keeps its name: brand,
     name, label and control hold one row at 320 px, the narrowest width
     WCAG 1.4.10 reflows to, so the site's rule below 390 px, which hides the
     name to make room for its language pill and theme toggle, has nothing to
     make room for here. */
  @media (max-width: 479px) {
    .menu-summary {
      padding: 0;
    }

    .menu-word {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      white-space: nowrap;
      border: 0;
      clip-path: inset(50%);
    }
  }

  /* @endregion */

  /* @region note */
  /* What every page of a reference in development says first: the site's
     status pill, its --pending dot beside the word that says it, the first
     thing in the page's content and not in the bar, which stays one row. It
     hugs its words; a host page's longer note wraps in a box of the same
     radius as a card's content. */
  .api-note {
    width: fit-content;
    max-width: 100%;
    padding: var(--s-1) var(--s-3);
    margin: 0 0 var(--s-5);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
  }

  .api-note::before {
    display: inline-block;
    width: var(--s-2);
    height: var(--s-2);
    margin-inline-end: var(--s-2);
    vertical-align: 0.1em;
    content: "";
    background: var(--pending);
    border-radius: var(--r-pill);
  }

  .api-note strong {
    font-weight: var(--t-title-weight);
    color: var(--ink);
  }
  /* @endregion */

  /* @region footer */
  /* The site's footer (`.site-footer`): a band of the alternate ground from
     one edge of the window to the other under a hairline, its words the small
     role in the secondary ink, its links in the sentence's own ink with their
     line and the accent under the pointer, so a footer of accent lines does
     not compete with the page it closes. One text on every page of the host:
     the license and the two ways to reach the project, then, on a page of a
     reference, what built it. */
  .api-footer {
    width: 100%;
    padding: var(--s-7) max(var(--gutter), env(safe-area-inset-right)) var(--s-8)
      max(var(--gutter), env(safe-area-inset-left));
    margin-top: auto;
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
    background: var(--bg-2);
    border-top: 1px solid var(--rule);
  }

  .api-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-6);
    align-items: baseline;
    justify-content: space-between;
    max-width: var(--wide);
    margin-inline: auto;
  }

  .api-footer p {
    margin: 0;
  }

  .api-footer a {
    color: inherit;
  }

  .api-footer a:hover {
    color: var(--accent);
  }

  .api-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--s-5);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  /* What built the page, under the rest in the tertiary ink, as the site's
     line of meta. */
  .api-footer .api-footer-built {
    flex-basis: 100%;
    padding-top: var(--s-4);
    color: var(--ink-3);
    border-top: 1px solid var(--rule);
  }
  /* @endregion */

  /* @region search */
  /* The search (`docs/design/web/components.md` §33): the bar's control and
     the dialog the host's one script makes (`assets/search.js`). Without the
     script the control is a link to the page of the search, which lists the
     indexes that need no script, and no dialog exists. The control is the
     menu's pill, its lens alone below 480 px, the lens and the word from there,
     and from 1100 px up a field with the "/" key at its end. */
  .search-open {
    display: inline-flex;
    flex: none;
    gap: var(--s-2);
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--s-3);
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--control-line);
    border-radius: var(--r-pill);
  }

  .search-open:hover {
    border-color: var(--accent);
  }

  .search-glyph {
    display: block;
    flex: none;
  }

  .search-key {
    display: none;
  }

  @media (max-width: 479px) {
    .api-header .search-open {
      padding: 0;
    }

    .api-header .search-word {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      white-space: nowrap;
      border: 0;
      clip-path: inset(50%);
    }
  }

  @media (min-width: 1100px) {
    .api-header .search-open {
      justify-content: flex-start;
      min-width: 200px;
      padding: 0 var(--s-2) 0 var(--s-3);
      background: var(--surface);
      border-radius: var(--r-sm);
    }

    .api-header .search-key {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 24px;
      min-height: 24px;
      padding: 0 var(--s-1);
      margin-left: auto;
      font-family: var(--t-label-face);
      font-size: var(--t-label);
      font-variation-settings: var(--t-label-fvs);
      font-weight: var(--t-label-weight);
      font-stretch: var(--t-label-width);
      line-height: var(--t-label-lh);
      color: var(--ink-2);
      letter-spacing: var(--t-label-track);
      border: 1px solid var(--rule-strong);
      border-radius: var(--r-xs);
    }
  }

  /* The dialog: a sheet from the top on a phone, a 640 px panel from 720 px,
     over the veil the site's enlarged view lays. The page behind it holds
     still (`html.searching`, set by the script while the dialog is open). */
  .search-dialog {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    padding: 0;
    margin: 0 0 auto;
    color: var(--ink);
    background: none;
    border: 0;
  }

  .search-dialog::backdrop {
    background: var(--veil);
  }

  html.searching,
  html.searching body {
    overflow: hidden;
  }

  .search-panel {
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
    padding: max(var(--s-3), env(safe-area-inset-top))
      max(var(--gutter), env(safe-area-inset-right))
      max(var(--s-3), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
    background: var(--raised);
    border-bottom: 1px solid var(--rule-strong);
    box-shadow: var(--shadow-card);
  }

  .search-bar {
    display: flex;
    gap: var(--s-2);
    align-items: center;
  }

  .search-bar .search-glyph {
    color: var(--ink-2);
  }

  /* The field at the body's size, 17 px: under 16 px iOS Safari zooms the
     page when the field takes the focus. */
  .search-input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0 var(--s-3);
    font-family: var(--t-body-face);
    font-size: var(--t-body);
    font-variation-settings: var(--t-body-fvs);
    font-weight: var(--t-body-weight);
    font-stretch: var(--t-body-width);
    line-height: var(--t-body-lh);
    color: var(--ink);
    letter-spacing: var(--t-body-track);
    appearance: none;
    background: var(--bg);
    border: 1px solid var(--control-line);
    border-radius: var(--r-sm);
  }

  .search-input::placeholder {
    color: var(--ink-3);
    opacity: 100%;
  }

  .search-close {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--s-3);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink);
    letter-spacing: var(--t-small-track);
    cursor: pointer;
    background: none;
    border: 1px solid var(--control-line);
    border-radius: var(--r-pill);
  }

  .search-close:hover {
    border-color: var(--accent);
  }

  .search-status,
  .search-hint {
    min-height: var(--s-5);
    margin: var(--s-2) 0 0;
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
  }

  .search-hint {
    color: var(--ink-3);
  }

  .search-results {
    flex: 1;
    min-height: 0;
    padding: 0;
    margin: var(--s-2) 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
  }

  /* The row is what a click or a tap opens: it holds no link, since an
     option's content is not a control of its own. */
  .search-row {
    cursor: pointer;
    border-top: 1px solid var(--rule);
  }

  /* A result is the menu's row: 44 px at least, the wash under the pointer
     and on the one the arrows chose, which also takes the dot. */
  .search-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
    justify-content: center;
    min-height: 44px;
    padding: var(--s-2) var(--s-6) var(--s-2) var(--s-2);
    color: var(--ink);
    text-decoration: none;
    border-radius: var(--r-sm);
  }

  .search-row:hover .search-item,
  .search-row[aria-selected="true"] .search-item {
    background: var(--accent-wash);
  }

  .search-row[aria-selected="true"] .search-item::after {
    position: absolute;
    top: calc(50% - 4px);
    right: var(--s-3);
    width: 8px;
    height: 8px;
    content: "";
    background: var(--accent);
    border-radius: var(--r-pill);
  }

  .search-head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1) var(--s-2);
    align-items: center;
  }

  .search-name {
    min-width: 0;
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    color: var(--accent);
    letter-spacing: var(--t-small-track);
    overflow-wrap: anywhere;
  }

  /* An overload's parameters, after its name: the name's role in the second ink. */
  .search-sig {
    min-width: 0;
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
    overflow-wrap: anywhere;
  }

  .search-where {
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
  }

  @media (pointer: coarse) {
    .search-hint {
      display: none;
    }
  }

  @media (min-width: 720px) {
    .search-dialog {
      width: min(640px, calc(100% - 2 * var(--gutter)));
      margin: var(--s-8) auto auto;
    }

    .search-panel {
      max-height: calc(100dvh - 2 * var(--s-8));
      padding: var(--s-3);
      border: 1px solid var(--rule-strong);
      border-radius: var(--r-lg);
    }
  }
  /* @endregion */
}

@layer index {
  /* @region index */
  /* The index and the page of a missing address: the column of the header and
     the footer, with a headline, a line under it and the list of references. */
  .api-main {
    width: 100%;
    max-width: var(--wide);
    padding: var(--s-8) max(var(--gutter), env(safe-area-inset-right)) var(--s-8)
      max(var(--gutter), env(safe-area-inset-left));
    margin-inline: auto;
  }

  .api-main h1 {
    margin: 0;
  }

  .api-lede {
    max-width: var(--measure-lede);
    margin: var(--s-5) 0 0;
    font-family: var(--t-lede-face);
    font-size: var(--t-lede);
    font-variation-settings: var(--t-lede-fvs);
    font-weight: var(--t-lede-weight);
    font-stretch: var(--t-lede-width);
    line-height: var(--t-lede-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-lede-track);
  }

  .api-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: var(--s-5);
    padding: 0;
    margin: var(--s-7) 0 0;
    list-style: none;
  }

  .api-project {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
  }

  .api-project h2 {
    margin: 0;
    font-family: var(--t-title-face);
    font-size: var(--t-title);
    font-variation-settings: var(--t-title-fvs);
    font-weight: var(--t-title-weight);
    font-stretch: var(--t-title-width);
    line-height: var(--t-title-lh);
    letter-spacing: var(--t-title-track);
  }

  .api-project p {
    margin: 0;
    color: var(--ink-2);
  }

  /* A reference's state: a dot and the word that says it. */
  .api-status {
    display: inline-flex;
    gap: var(--s-2);
    align-items: center;
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
  }

  .api-status::before {
    width: var(--s-2);
    height: var(--s-2);
    content: "";
    background: var(--ink-3);
    border-radius: var(--r-pill);
  }

  .api-status[data-state="development"]::before {
    background: var(--pending);
  }

  .api-open {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 44px;
    padding-block: 0;
    margin-top: auto;
    font-weight: var(--t-title-weight);
  }

  .api-back {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-5);
    padding: 0;
    margin: var(--s-6) 0 0;
    list-style: none;
  }

  .api-back a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0;
  }
  /* @endregion */
}

/* stylelint-disable selector-class-pattern -- the class names are Doxygen's */
@layer reference {
  /* @region page */
  /* A page Doxygen wrote: one column, as wide as a wide table needs. */
  .reference #doc-content {
    width: 100%;
    max-width: var(--wide);
    padding: var(--s-6) max(var(--gutter), env(safe-area-inset-right)) var(--s-8)
      max(var(--gutter), env(safe-area-inset-left));
    margin-inline: auto;
    overflow-wrap: anywhere;
  }

  /* Where a nested name is, on a page that is not a compound's (whose scopes
     are its eyebrow): the scopes above it, on one line, on the page's own
     edge. A file's are its folders. */
  .reference .navpath {
    width: 100%;
    max-width: var(--wide);
    padding: var(--s-5) max(var(--gutter), env(safe-area-inset-right)) 0
      max(var(--gutter), env(safe-area-inset-left));
    margin-inline: auto;
  }

  .reference #top:has(.navpath) + #doc-content {
    padding-top: var(--s-3);
  }

  .reference #doc-content > .navpath {
    padding: 0 0 var(--s-3);
  }

  .reference .navpath ul {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    color: var(--ink-3);
    letter-spacing: var(--t-small-track);
    list-style: none;
  }

  .reference .navpath li {
    overflow-wrap: anywhere;
  }

  .reference .navpath li + li::before {
    content: "::";
  }

  .reference .folders li + li::before {
    content: "/";
  }

  .reference .navpath b {
    font-weight: var(--t-small-weight);
  }

  .reference .navpath a {
    text-decoration: none;
  }

  .reference .navpath a:hover {
    text-decoration: underline;
  }

  /* The opening, as the site's page hero: what the page is and where, in the
     eyebrow; its name, at the chapter's size; the topics it is in, as the
     site's trail; and its contents. No line under it: the first section's
     own room says where the page starts. */
  .reference .header {
    margin-bottom: var(--s-7);
  }

  .reference .headertitle {
    display: flex;
    flex-direction: column;
  }

  /* What the page is, in small capitals in the tertiary ink, and the scope it
     is in, which is code: its case kept and its parts joined as code joins
     them, each scope a link where it has a page. */
  .reference .eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--s-2);
    align-items: baseline;
    margin: 0 0 var(--s-3);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-3);
    letter-spacing: var(--t-label-track);
  }

  .reference .eyebrow-kind {
    text-transform: uppercase;
  }

  .reference .eyebrow-scope {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    padding: 0;
    margin: 0;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    list-style: none;
  }

  .reference .eyebrow-scope::before {
    margin-inline-end: var(--s-2);
    content: "·" / "";
  }

  .reference .eyebrow-scope li + li::before {
    content: "::";
  }

  .reference .eyebrow a {
    color: var(--ink-2);
    text-decoration: underline;
  }

  .reference .eyebrow a:hover {
    color: var(--ink);
  }

  .reference .title {
    margin: 0;
    font-family: var(--t-chapter-face);
    font-size: var(--t-chapter);
    font-variation-settings: var(--t-chapter-fvs);
    font-weight: var(--t-chapter-weight);
    font-stretch: var(--t-chapter-width);
    line-height: var(--t-chapter-lh);
    letter-spacing: var(--t-chapter-track);
    text-wrap: wrap;
    overflow-wrap: anywhere;
  }

  /* The topics a page is in, from the widest: the site's trail, each a link,
     underlined so it is told from the words around it by more than its ink,
     the separator read as nothing. */
  .reference .trail {
    margin: var(--s-4) 0 0;
  }

  .reference .trail ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--s-2);
    padding: 0;
    margin: 0;
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
    list-style: none;
  }

  .reference .trail li {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
  }

  .reference .trail li + li::before {
    margin-inline-end: var(--s-2);
    content: "›" / "";
  }

  .reference .trail a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding-block: 0;
    color: var(--ink-2);
    text-decoration: underline;
  }

  .reference .trail a:hover {
    color: var(--ink);
  }

  /* The page's parts: the site's contents (`@region toc-rail`), a fold under
     the opening below 1100 px, closed until it is opened, its entries whole
     targets of 44 px. The fold is the control alone; the list after it is
     drawn while it is open, and from 1100 px up always, as the rail. */
  .reference .toc {
    max-inline-size: var(--measure);
    margin: var(--s-5) 0 0;
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
  }

  .reference .toc-head {
    display: none;
  }

  @media (max-width: 1099px) {
    .reference .toc-fold:not([open]) + .toc-body {
      display: none;
    }
  }

  .reference .toc-title {
    display: flex;
    gap: var(--s-3);
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding-inline: var(--s-4);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
    cursor: pointer;
    list-style: none;
  }

  .reference .toc-title::-webkit-details-marker {
    display: none;
  }

  /* A chevron that points down while the list is folded and up when open. */
  .reference .toc-title::after {
    flex: none;
    width: 8px;
    height: 8px;
    content: "";
    border-block-end: 2px solid currentcolor;
    border-inline-end: 2px solid currentcolor;
    transform: translateY(-2px) rotate(45deg);
  }

  .reference .toc-fold[open] > .toc-title::after {
    transform: translateY(2px) rotate(-135deg);
  }

  .reference .toc-list {
    padding: 0 var(--s-4) var(--s-3);
    margin: 0;
    list-style: none;
  }

  .reference .toc-list a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: var(--s-2);
    padding-inline-start: var(--s-3);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
    text-decoration: none;
    border-inline-start: 2px solid transparent;
  }

  .reference .toc-list a:hover {
    color: var(--ink);
  }

  /* From 1100 px up a page with contents is the site's inner page: a rail of
     220 px on the left, the contents sticking under the bar, and the column
     beside it, which a wide table or member list takes to its right edge.
     The opening's box gives way to its parts, so the contents can take the
     rail while the rest stays in the column. The list is drawn whatever its
     fold's state, which is not drawn here. */
  @media (min-width: 1100px) {
    .reference #doc-content:has(> .header > .toc) {
      display: grid;
      grid-template-columns: [rail-start] 220px [rail-end text-start] minmax(0, 1fr) [end];
      gap: 0 var(--s-6);
      align-content: start;
      align-items: start;
    }

    .reference #doc-content:has(> .header > .toc) > * {
      grid-column: text-start / end;
      min-width: 0;
    }

    .reference #doc-content:has(> .header > .toc) > .header {
      display: contents;
    }

    .reference #doc-content:has(> .header > .toc) > .header > .headertitle {
      grid-column: text-start / end;
      margin-bottom: var(--s-7);
    }

    .reference .header > .toc {
      grid-row: 1 / span 99;
      grid-column: rail-start / rail-end;
      place-self: stretch start;
      max-inline-size: none;
      width: 220px;
      margin: 0;
      background: none;
      border: 0;
      border-radius: 0;
    }

    .reference .toc-fold {
      display: none;
    }

    .reference .toc-body {
      position: sticky;
      top: calc(var(--header-h) + var(--s-5));
      max-block-size: calc(100vh - var(--header-h) - var(--s-7));
      overflow: clip auto;
    }

    /* The control's words, as the rail's heading: not a control here. */
    .reference .toc-head {
      display: flex;
      align-items: center;
      min-height: 32px;
      margin: 0;
      font-family: var(--t-label-face);
      font-size: var(--t-label);
      font-variation-settings: var(--t-label-fvs);
      font-weight: var(--t-label-weight);
      font-stretch: var(--t-label-width);
      line-height: var(--t-label-lh);
      color: var(--ink-2);
      text-transform: uppercase;
      letter-spacing: var(--t-label-track);
    }

    .reference .toc-list {
      padding: 0;
      border-inline-start: 1px solid var(--rule-strong);
    }

    .reference .toc-list a {
      min-height: 32px;
      padding-block: var(--s-1);
      margin-inline-start: -1px;
    }
  }

  /* The page's one line, and the text that follows it. */
  .reference .brief,
  .reference .contents .brief {
    max-width: var(--measure-lede);
    font-family: var(--t-lede-face);
    font-size: var(--t-lede);
    font-variation-settings: var(--t-lede-fvs);
    font-weight: var(--t-lede-weight);
    font-stretch: var(--t-lede-width);
    line-height: var(--t-lede-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-lede-track);
  }

  .reference .contents p,
  .reference .contents li,
  .reference .contents dd,
  .reference .contents figcaption,
  .reference .textblock {
    max-width: calc(72 * var(--zero-text));
  }

  /* What is wider than a line of prose takes the page's column. */
  .reference .textblock:has(> table, > .data-wrap, > .fragment, > .doxtable, > figure) {
    max-width: none;
  }

  .reference .contents p {
    margin: 0 0 var(--s-4);
  }

  .reference .contents ul,
  .reference .contents ol {
    padding-left: var(--s-5);
    margin: 0 0 var(--s-4);
  }

  /* The site's list of sentences (`.facts`): its markers in the tertiary ink,
     8 px between items. */
  .reference .contents li::marker {
    color: var(--ink-3);
  }

  .reference .contents li + li {
    margin-top: var(--s-2);
  }

  .reference hr {
    height: 0;
    margin: var(--s-6) 0;
    border: 0;
    border-top: 1px solid var(--rule-strong);
  }

  /* A part of the page, as every h2 of the site: the section role, with a
     hairline under it, which a long list of members needs to be told where
     its next part starts. */
  .reference h2.doxsection,
  .reference h2.groupheader {
    padding-bottom: var(--s-2);
    margin: var(--s-7) 0 var(--s-4);
    font-family: var(--t-section-face);
    font-size: var(--t-section);
    font-variation-settings: var(--t-section-fvs);
    font-weight: var(--t-section-weight);
    font-stretch: var(--t-section-width);
    line-height: var(--t-section-lh);
    letter-spacing: var(--t-section-track);
    border-bottom: 1px solid var(--rule);
  }

  .reference .memberdecls h2.groupheader {
    margin-top: var(--s-6);
  }

  /* A heading inside a part, and the bold words a comment opens a paragraph
     with: the title role, an h3 of the site, all six of its companions, so an
     h2 element does not draw these words in the display face. Bold words a
     level deeper are an h4, and take the h4's label role below. */
  .reference h3.doxsection,
  .reference :is(h2, h3).doxlabel {
    margin: var(--s-6) 0 var(--s-3);
    font-family: var(--t-title-face);
    font-size: var(--t-title);
    font-variation-settings: var(--t-title-fvs);
    font-weight: var(--t-title-weight);
    font-stretch: var(--t-title-width);
    line-height: var(--t-title-lh);
    letter-spacing: var(--t-title-track);
  }

  /* Deeper than that, the label role, as the site's step facts. */
  .reference h4 {
    margin: var(--s-5) 0 var(--s-2);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
  }

  .reference .contents > :is(h2, h3):first-child,
  .reference .textblock > :is(h2, h3):first-child,
  .reference .memberdecls:first-child h2.groupheader {
    margin-top: 0;
  }

  /* The way back, at the end of each part of a long page. */
  .reference .to-top {
    margin: var(--s-5) 0 0;
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
  }

  .reference .to-top a {
    display: inline-flex;
    align-items: center;
    min-height: var(--s-6);
    padding-block: 0;
  }

  /* A name in a column of names is not underlined: a table of them would be
     a table of rules. It opens its row, with at most its indentation before
     it, and has a weight of its own, since a member's has its arguments after
     it and a name's, in an index, the class it is of. Every other link has
     text around it (a type, an argument, a member's line, a brief
     description), and the accent alone is about 1.4:1 against that text
     (WCAG 1.4.1 asks 3:1 of a link told apart by color alone), so it keeps
     its line. */
  .reference .memItemRight > a:first-child,
  .reference .directory .entry > a:first-of-type,
  .reference .names > li > a:first-child,
  .reference .qindex,
  .reference .title a,
  .reference .summary a,
  .reference .permalink a {
    text-decoration: none;
  }

  .reference .memItemRight > a:first-child:hover,
  .reference .directory .entry > a:first-of-type:hover,
  .reference .names > li > a:first-child:hover,
  .reference .qindex:hover,
  .reference .title a:hover,
  .reference .summary a:hover,
  .reference .permalink a:hover {
    text-decoration: underline;
  }

  .reference .memItemRight > :is(a, b):first-child,
  .reference .names > li > :is(a, b):first-child {
    font-weight: var(--t-label-weight);
  }

  .reference .memItemRight > b:first-child,
  .reference .names > li > b:first-child {
    color: var(--ink);
  }
  /* @endregion */

  /* @region declarations */
  /* The list of what a page declares: the type, the name and its line, with a
     hairline over each. On a narrow window the type sits above the name; from
     720 px it is a column of its own, as wide as its longest type and never
     wider than 22 zeros, where a longer one wraps. The table is a layout
     (role="presentation"), so its rows may be any box. */
  .reference table {
    border-spacing: 0;
    border-collapse: collapse;
  }

  .reference .memberdecls,
  .reference .memberdecls > tbody,
  .reference .memberdecls > tbody > tr,
  .reference .memberdecls > tbody > tr > td {
    display: block;
  }

  .reference .memberdecls {
    width: 100%;
    margin-bottom: var(--s-5);
  }

  .reference .memberdecls td {
    padding: 0;
  }

  .reference .memItemLeft,
  .reference .memItemRight,
  .reference .memTemplParams {
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
  }

  .reference .memItemLeft {
    color: var(--ink-2);
  }

  .reference .memTemplParams {
    color: var(--ink-3);
  }

  .reference .memberdecls .memItemLeft:empty,
  .reference .memberdecls .mdescLeft {
    display: none;
  }

  .reference .mdescRight {
    max-width: calc(72 * var(--zero-text));
    margin-top: var(--s-1);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
  }

  .reference tr[class^="memitem:"] {
    padding-top: var(--s-3);
    margin-top: var(--s-3);
    border-top: 1px solid var(--rule);
  }

  .reference .heading + tr[class^="memitem:"] {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
  }

  .reference h3.groupHeader,
  .reference .groupText,
  .reference .inherit_header > td {
    margin: var(--s-4) 0 0;
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-title-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
  }

  .reference .groupText {
    font-weight: var(--t-small-weight);
  }

  @media (min-width: 720px) {
    @supports (grid-template-columns: subgrid) {
      .reference .memberdecls > tbody {
        display: grid;
        grid-template-columns: fit-content(calc(22 * var(--zero-mono))) minmax(0, 1fr);
        column-gap: var(--s-4);
        font-family: var(--t-small-face);
        font-size: var(--t-small);
        font-variation-settings: var(--t-small-fvs);
        font-weight: var(--t-small-weight);
        font-stretch: var(--t-small-width);
        line-height: var(--t-small-lh);
        letter-spacing: var(--t-small-track);
      }

      .reference .memberdecls > tbody > tr {
        display: grid;
        grid-template-columns: subgrid;
        grid-column: 1 / -1;
      }

      .reference .memberdecls > tbody > tr > td {
        grid-column: 2;
      }

      .reference .memberdecls > tbody > tr > .memItemLeft {
        grid-column: 1;
      }

      .reference .memberdecls > tbody > tr > td[colspan] {
        grid-column: 1 / -1;
      }
    }
  }
  /* @endregion */

  /* @region member */
  /* One member in full: its name as a heading, its declaration on a raised
     strip, its documentation under it. */
  .reference .memtitle {
    margin: var(--s-7) 0 var(--s-3);
    font-family: var(--t-title-face);
    font-size: var(--t-title);
    font-variation-settings: var(--t-title-fvs);
    font-weight: var(--t-title-weight);
    font-stretch: var(--t-title-width);
    line-height: var(--t-title-lh);
    letter-spacing: var(--t-title-track);
  }

  .reference .overload {
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-3);
    letter-spacing: var(--t-small-track);
  }

  /* As tall as a finger, and no wider than its word's own edge. */
  .reference .permalink a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--s-5);
    min-height: var(--s-5);
    padding: 0 var(--s-1);
    font-weight: var(--t-small-weight);
    color: var(--ink-3);
    text-align: center;
  }

  /* The box of a member: the site's box for content (--r-md), its outline in
     the strong rule and the one card shadow, which only the light theme
     draws; its declaration on the raised ground, as a table's head, so it
     reads as the box's head. */
  .reference .memitem {
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
  }

  .reference .memproto {
    padding: var(--s-3) var(--s-4);
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
    background: var(--raised);
    border-bottom: 1px solid var(--rule-strong);
    border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
  }

  .reference .memtemplate {
    color: var(--ink-3);
  }

  /* A second line of a declaration is further in than its parameters, which
     have a line each where there are several. */
  .reference .memproto .memname {
    padding-left: calc(4 * var(--zero-mono));
    text-indent: calc(-4 * var(--zero-mono));
  }

  .reference .memproto .parameter {
    display: block;
    padding-left: calc(2 * var(--zero-mono));
  }

  .reference .paramname {
    color: var(--ink);
    overflow-wrap: break-word;
  }

  .reference .paramtype,
  .reference .paramdefval,
  .reference .paramdefsep {
    color: var(--ink-2);
  }

  /* What a member is besides its type: static, constexpr, override. A row
     under its declaration, and under a compound's name in its title the
     same: beside a long name the row would start a line of its own a margin
     in from the name. */
  .reference .mlabels {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1);
    margin-top: var(--s-2);
  }

  /* The site's badge (`.badge`): the label role in capitals, the secondary
     ink inside the strong rule, the smallest radius, 24 px tall. A kind and a
     member's labels are tags, not words of a name. */
  .reference .mlabel,
  .reference .kind,
  .reference .paramdir .dir,
  .search-dialog .badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: var(--s-1) var(--s-2);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
    white-space: nowrap;
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-xs);
  }

  .reference .memdoc {
    padding: var(--s-4) var(--s-4) var(--s-1);
  }

  .reference .memdoc > :last-child {
    margin-bottom: var(--s-3);
  }
  /* @endregion */

  /* @region sections */
  /* The named parts of a comment: parameters, returns, a note, a warning.
     Each opens with its head in the label role. */
  .reference dl {
    margin: 0 0 var(--s-4);
  }

  .reference dl.section > dt,
  .reference dl.params > dt,
  .reference dl.retval > dt,
  .reference dl.tparams > dt,
  .reference dl.exception > dt {
    margin-bottom: var(--s-2);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
  }

  .reference dl.section > dd,
  .reference dl.params > dd,
  .reference dl.retval > dd,
  .reference dl.tparams > dd,
  .reference dl.exception > dd {
    margin: 0;
  }

  /* A note, a condition and a warning: a box of the alternate ground with a
     bar on its start, so a phone's reader tells it from the paragraph before
     it at a glance. A note's bar and head are ink, its head the site's badge;
     a warning's are the status color, its head the site's caution badge
     (`.flag`): the word says it, and the color only repeats it. */
  .reference dl:is(.note, .warning, .attention, .pre, .post, .invariant) {
    padding: var(--s-3) var(--s-4);
    background: var(--bg-2);
    border-left: 2px solid var(--ink-3);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
  }

  .reference dl:is(.note, .warning, .attention, .pre, .post, .invariant) > dt {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: var(--s-1) var(--s-2);
    color: var(--ink-2);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-xs);
  }

  .reference dl:is(.warning, .attention) {
    border-left-color: var(--pending);
  }

  .reference dl:is(.warning, .attention) > dt {
    color: var(--pending);
    background: var(--surface);
    border-color: var(--pending);
  }

  .reference dl:is(.note, .warning, .attention, .pre, .post, .invariant) > dd > :last-child {
    margin-bottom: 0;
  }

  /* Parameters, values, template parameters and exceptions, and what a member
     returns: the site's chain of steps (`.chain`). A strong hairline over the
     list and a fainter one under each row; the name in mono at the small size
     and weight 500 in the primary ink, its direction the site's badge after
     it, and what is said of it in the small role's secondary ink. */
  .reference :is(table.params, table.retval, table.tparams, table.exception) {
    width: 100%;
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
    border-top: 1px solid var(--rule-strong);
  }

  /* Their heads are for who hears the table: a column of names and a column
     of words need none to be seen. */
  .reference :is(.params, .retval, .tparams, .exception) th {
    padding: 0;
    line-height: 0;
  }

  /* A name is never cut: a cell breaks a word only where the word alone is
     wider than the page, so a column is never narrower than its longest word. */
  .reference :is(.params, .retval, .tparams, .exception) td {
    padding: var(--s-2) var(--s-4) var(--s-2) 0;
    vertical-align: baseline;
    overflow-wrap: break-word;
    border-bottom: 1px solid var(--rule);
  }

  .reference :is(.params, .retval, .tparams, .exception) td:last-child {
    padding-right: 0;
  }

  .reference :is(.params, .retval, .tparams, .exception) :is(td.paramname, td.paramtype) {
    font-family: var(--t-label-face);
    font-variation-settings: var(--t-label-fvs);
    font-stretch: var(--t-label-width);
  }

  .reference :is(.params, .retval, .tparams, .exception) td.paramname {
    font-weight: var(--t-label-weight);
    color: var(--ink);
  }

  .reference .paramdir {
    white-space: nowrap;
  }

  /* What a member returns: one row of the same chain. */
  .reference dl.section.return > dd {
    padding: var(--s-2) 0;
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
    border-top: 1px solid var(--rule-strong);
    border-bottom: 1px solid var(--rule);
  }

  .reference dl.section.return > dd > :last-child {
    margin-bottom: 0;
  }

  /* From 720 px the names and the directions are columns as narrow as their
     names, and the words take the rest. A name breaks only where the build
     let it (`<wbr>`), never after a hyphen of `0..kMax-1`. */
  @media (min-width: 720px) {
    .reference :is(.params, .retval, .tparams, .exception) td:not(:last-child) {
      width: 1%;
    }

    .reference :is(.params, .retval, .tparams, .exception) td:not(:last-child, :has(wbr)) {
      white-space: nowrap;
    }
  }

  /* Below 720 px a row is its name and its direction, then what is said of
     it under them. */
  @media (max-width: 719px) {
    .reference :is(table.params, table.retval, table.tparams, table.exception),
    .reference :is(table.params, table.retval, table.tparams, table.exception) tbody {
      display: block;
    }

    .reference :is(table.params, table.retval, table.tparams, table.exception) thead {
      position: absolute;
    }

    .reference :is(table.params, table.retval, table.tparams, table.exception) tbody tr {
      display: flex;
      flex-wrap: wrap;
      gap: var(--s-1) var(--s-2);
      align-items: baseline;
      padding-block: var(--s-2);
      border-bottom: 1px solid var(--rule);
    }

    /* A cell in a row of flex is as wide as its longest word unless it may be
       narrower: without this a word wider than a phone widens the page. */
    .reference :is(table.params, table.retval, table.tparams, table.exception) td {
      display: block;
      min-width: 0;
      padding: 0;
      border-bottom: 0;
    }

    .reference :is(table.params, table.retval, table.tparams, table.exception) td:empty {
      display: none;
    }

    .reference :is(table.params, table.retval, table.tparams, table.exception) td:last-child {
      flex: 1 0 100%;
    }
  }
  /* @endregion */

  /* @region tables */
  /* A table a comment wrote and the values of an enumeration, in the site's
     table box (`.data-wrap`, which the build puts around each): the strong
     rule around it at the radius of a box of content, its head on the raised
     ground, a strong rule between rows and none between columns, a row in
     every two on the alternate ground, and its first column held at the box's
     left edge while the rest scrolls under it. The box hugs its table and is
     never wider than the column. A table in HTML (doxtable) scrolls in its
     own box. */
  .reference .data-wrap {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 var(--s-5);
    overflow-x: auto;
    background: var(--bg);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
  }

  /* In a member's box the ground is the box's. */
  .reference .memdoc .data-wrap {
    background: var(--surface);
  }

  .reference .markdownTable,
  .reference .fieldtable,
  .reference .doxtable {
    max-width: 100%;
    margin: 0 0 var(--s-5);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
    overflow-wrap: break-word;
  }

  /* Separate borders, because a collapsed one belongs to the table and would
     stay behind when a held cell moved over it. */
  .reference .data-wrap > table {
    width: 100%;
    margin: 0;
    border-spacing: 0;
    border-collapse: separate;
  }

  .reference .doxtable {
    display: block;
    overflow-x: auto;
  }

  .reference :is(.markdownTable, .fieldtable, .doxtable) th {
    padding: var(--s-3);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    vertical-align: bottom;
    color: var(--ink-2);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
    background: var(--raised);
    border-bottom: 1px solid var(--rule-strong);
  }

  .reference :is(.markdownTable, .fieldtable, .doxtable) td {
    padding: var(--s-3);
    vertical-align: top;
    border-bottom: 1px solid var(--rule-strong);
  }

  .reference .data-wrap tr:last-child > td {
    border-bottom: 0;
  }

  /* The rows: the box's ground, and the alternate one every two, which the
     held cell takes from its row. The head is the first row of both kinds of
     table, so the second row of data is the third. */
  .reference .data-wrap tr:has(> td) {
    background: var(--bg);
  }

  .reference .memdoc .data-wrap tr:has(> td) {
    background: var(--surface);
  }

  .reference .data-wrap tr:nth-child(odd):has(> td) {
    background: var(--bg-2);
  }

  .reference .data-wrap tr:has(> td) > :first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
  }

  .reference .markdownTable td:first-child {
    color: var(--ink);
  }

  .reference :is(.markdownTableBodyRight, .markdownTableHeadRight) {
    text-align: right;
  }

  .reference .fieldname {
    font-family: var(--t-label-face);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    color: var(--ink);
  }

  .reference :is(.fieldtable, .markdownTable) p:last-child {
    margin-bottom: 0;
  }

  .reference .fielddoc:empty {
    display: none;
  }

  /* Below 720 px a row is a block of the box, the site's ledger of evidence
     (`dl.evidence`): its first cell, its name, across the row, and each other
     cell under its column's head in the label role, as many to a line as fit.
     A table of two columns has no heads to say: its second cell is under its
     first and as wide as the row, one track, since the first cell spans every
     track there is and an empty one would keep half the row. Nothing is held,
     since nothing scrolls. */
  @media (max-width: 719px) {
    .reference .data-wrap {
      width: auto;
    }

    .reference :is(.markdownTable, .fieldtable),
    .reference :is(.markdownTable, .fieldtable) tbody,
    .reference :is(.markdownTable, .fieldtable) tr,
    .reference :is(.markdownTable, .fieldtable) td {
      display: block;
    }

    .reference .markdownTable .markdownTableHead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      white-space: nowrap;
      clip-path: inset(50%);
    }

    .reference .data-wrap tr:has(> td) {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
      gap: var(--s-3) var(--s-4);
      padding: var(--s-3) var(--s-4);
      border-bottom: 1px solid var(--rule-strong);
    }

    .reference .data-wrap tr:has(> td:nth-child(2):last-child) {
      grid-template-columns: minmax(0, 1fr);
    }

    .reference .data-wrap tr:last-child {
      border-bottom: 0;
    }

    .reference :is(.markdownTable, .fieldtable) td,
    .reference .data-wrap tr:has(> td) > :first-child {
      position: static;
      padding: 0;
      text-align: left;
      background: none;
      border-bottom: 0;
    }

    .reference .data-wrap td:first-child {
      grid-column: 1 / -1;
      font-weight: var(--t-label-weight);
    }

    .reference .fieldtable th {
      display: block;
      padding: var(--s-2) var(--s-4);
    }

    .reference .markdownTable td[data-label]:not(:first-child)::before {
      display: block;
      margin-bottom: var(--s-1);
      font-family: var(--t-label-face);
      font-size: var(--t-label);
      font-variation-settings: var(--t-label-fvs);
      font-weight: var(--t-label-weight);
      font-stretch: var(--t-label-width);
      line-height: var(--t-label-lh);
      color: var(--ink-3);
      text-transform: uppercase;
      letter-spacing: var(--t-label-track);
      content: attr(data-label);
    }
  }

  /* A table of five columns and more has no room for them under 1100 px: the
     same ledger, three values to a line. */
  @media (min-width: 720px) and (max-width: 1099px) {
    .reference .markdownTable.wide,
    .reference .markdownTable.wide tbody,
    .reference .markdownTable.wide td {
      display: block;
    }

    .reference .markdownTable.wide .markdownTableHead {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      white-space: nowrap;
      clip-path: inset(50%);
    }

    .reference .markdownTable.wide tr:has(> td) {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--s-3) var(--s-4);
      padding: var(--s-3) var(--s-4);
      border-bottom: 1px solid var(--rule-strong);
    }

    .reference .markdownTable.wide tr:last-child {
      border-bottom: 0;
    }

    .reference .markdownTable.wide td,
    .reference .markdownTable.wide tr:has(> td) > :first-child {
      position: static;
      padding: 0;
      background: none;
      border-bottom: 0;
    }

    .reference .markdownTable.wide td:first-child {
      grid-column: 1 / -1;
      font-weight: var(--t-label-weight);
    }

    .reference .markdownTable.wide td:not(:first-child)::before {
      display: block;
      margin-bottom: var(--s-1);
      font-family: var(--t-label-face);
      font-size: var(--t-label);
      font-variation-settings: var(--t-label-fvs);
      font-weight: var(--t-label-weight);
      font-stretch: var(--t-label-width);
      line-height: var(--t-label-lh);
      color: var(--ink-3);
      text-transform: uppercase;
      letter-spacing: var(--t-label-track);
      content: attr(data-label);
    }
  }
  /* @endregion */

  /* @region tree */
  /* The lists of topics, classes and namespaces: a name, what it is, and its
     line under it, all as far in as it is deep, with a guide line down the
     start of each level above it, as the contents rail draws its line, so a
     phone's reader sees what is inside what. A topic's name is words, in the
     text face; a class's or a namespace's is code, in mono at weight 500. */
  .reference table.directory,
  .reference .directory > table > tbody,
  .reference .directory > table tr,
  .reference .directory > table td {
    display: block;
  }

  .reference .directory > table {
    max-width: calc(72 * var(--zero-text));
    margin: 0 0 var(--s-5);
  }

  .reference .directory tr {
    position: relative;
    padding: var(--s-3) 0;
    background: repeating-linear-gradient(
        to right,
        var(--rule-strong) 0 1px,
        transparent 1px var(--s-5)
      )
      var(--s-2) 0 / 0 100% no-repeat;
    border-bottom: 1px solid var(--rule);
  }

  .reference .directory tr.level-2 {
    padding-left: var(--s-5);
    background-size: var(--s-5) 100%;
  }

  .reference .directory tr.level-3 {
    padding-left: calc(2 * var(--s-5));
    background-size: calc(2 * var(--s-5)) 100%;
  }

  .reference .directory tr.level-4 {
    padding-left: calc(3 * var(--s-5));
    background-size: calc(3 * var(--s-5)) 100%;
  }

  .reference .directory tr:is(.level-5, .level-6, .level-7, .level-8) {
    padding-left: calc(4 * var(--s-5));
    background-size: calc(4 * var(--s-5)) 100%;
  }

  .reference .directory td {
    padding: 0;
  }

  .reference .directory .entry {
    overflow-wrap: break-word;
  }

  .reference .directory .entry > a:first-of-type {
    font-weight: var(--t-small-weight);
  }

  .reference .directory .entry:has(> .kind) > :is(a:first-of-type, b) {
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
  }

  .reference .directory .desc {
    margin-top: var(--s-1);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
  }

  .reference .directory .desc:empty {
    display: none;
  }

  /* What a row is: a namespace, a class, a struct, the site's badge after the
     name. The room between them is the name's, at its end, so a badge a long
     name pushes onto a line of its own starts where the name does. */
  .reference .directory .entry > :has(+ .kind) {
    margin-inline-end: var(--s-2);
  }

  .reference .kind {
    vertical-align: 1px;
  }

  .reference .levels {
    display: none;
  }

  /* On a coarse pointer the whole row is the name's target and the name is
     44 px tall; a link in the row's line stands above that target. */
  @media (pointer: coarse) {
    .reference .directory .entry > a:first-of-type {
      display: inline-flex;
      align-items: center;
      min-height: 44px;
      padding-block: 0;
    }

    .reference .directory .entry > a:first-of-type::after {
      position: absolute;
      inset: 0;
      content: "";
    }

    .reference .directory .desc a {
      position: relative;
      z-index: 1;
    }

    .reference .directory tr {
      padding-block: var(--s-1) var(--s-3);
    }
  }
  /* @endregion */

  /* @region indexes */
  /* The letters of an index, each a target a finger can hit, and its names,
     each with the class or the file it is of. */
  .reference .letters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1);
    margin: var(--s-4) 0 var(--s-5);
  }

  .reference a.qindex {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--s-6);
    min-height: var(--s-6);
    padding: 0 var(--s-2);
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-xs);
  }

  /* How many names a letter holds, under it, in the tertiary ink. */
  .reference a.qindex:has(.qcount) {
    flex-direction: column;
    min-width: 44px;
    padding: var(--s-1) var(--s-2);
  }

  .reference .qcount {
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-3);
    letter-spacing: var(--t-label-track);
  }

  @media (pointer: coarse) {
    .reference a.qindex {
      min-width: 44px;
      min-height: 44px;
    }
  }

  .reference a.qindex[aria-current] {
    color: var(--ink);
    background: var(--raised);
    border-color: var(--control-line);
  }

  .reference .contents ul.names {
    padding: 0;
    list-style: none;
  }

  .reference .contents ul.names li {
    max-width: none;
    padding: var(--s-2) 0;
    margin: 0;
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
    border-bottom: 1px solid var(--rule);
  }

  .reference .of {
    color: var(--ink-2);
  }
  /* @endregion */

  /* @region code */
  /* An example a comment gives, in a box of content (--r-md) on the
     alternate ground. The words are ink and only a name that links is the
     accent, with a thin line in the accent's own faint ink: nothing is
     colored to be told apart by color. A long line scrolls inside the box,
     with room after its last character, and a shade on the edge where more
     of it is hidden says that it does: each edge's shade is covered by the
     ground while the box is scrolled to that edge. */
  .reference .fragment {
    padding: var(--s-3) 0 var(--s-3) var(--s-4);
    margin: 0 0 var(--s-4);
    overflow-x: auto;
    font-family: var(--t-label-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-small-lh);
    letter-spacing: var(--t-small-track);
    overflow-wrap: normal;
    background:
      linear-gradient(to right, var(--bg-2) var(--s-4), transparent) left / var(--s-7) 100%
        no-repeat local,
      linear-gradient(to left, var(--bg-2) var(--s-4), transparent) right / var(--s-7) 100%
        no-repeat local,
      linear-gradient(to right, var(--rule-strong), transparent) left / var(--s-3) 100%
        no-repeat scroll,
      linear-gradient(to left, var(--rule-strong), transparent) right / var(--s-3) 100%
        no-repeat scroll,
      var(--bg-2);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
  }

  .reference .fragment .line {
    width: max-content;
    min-width: 100%;
    padding-inline-end: var(--s-4);
    white-space: pre;
  }

  .reference .fragment a {
    text-decoration-thickness: 1px;
    text-decoration-color: var(--accent-line);
  }

  .reference .comment {
    color: var(--ink-3);
  }

  .reference .keyword,
  .reference .keywordtype,
  .reference .keywordflow,
  .reference .preprocessor {
    font-weight: var(--t-label-weight);
  }

  .reference .stringliteral,
  .reference .charliteral {
    color: var(--ink-2);
  }

  /* Code in a line of text: a quiet chip at the size of the words around it,
     in the primary ink on the alternate ground inside a faint rule, so a name
     reads as code on a phone wherever it sits, on a box of the alternate
     ground too. A declaration, an example, a title and the scope above it are
     code throughout and wear no chip. */
  .reference :is(code, .tt):not(.fragment *, .memproto *, .memname *, .title *, .eyebrow *) {
    padding: 0 var(--s-1);
    font-family: var(--t-label-face);
    font-variation-settings: var(--t-label-fvs);
    font-stretch: var(--t-label-width);
    color: var(--ink);
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: var(--r-xs);
  }
  /* @endregion */

  /* @region diagram */
  /* A diagram is in the page, in the page's ink and face: the drawing holds
     shapes and words, and every color and face of it is here. Its words are
     drawn at the small role's 14 px, and it is never shrunk below that: on a
     column narrower than the drawing, a phone's, the drawing scrolls sideways
     in its figure, as an example does. From 1100 px, where the column has room
     for it, it is drawn a fifth larger, so its words are near the body's. */
  .reference .diagram {
    max-width: 100%;
    margin: var(--s-5) 0;
    overflow-x: auto;
  }

  .reference .drawing {
    display: block;
    height: auto;
    font-family: var(--t-body-face);
    font-variation-settings: var(--t-body-fvs);
    font-stretch: var(--t-body-width);
  }

  @media (min-width: 1100px) {
    .reference .drawing {
      zoom: 1.2;
    }
  }

  .reference .drawing text {
    fill: var(--ink);
  }

  .reference .drawing .node :is(polygon, ellipse, path, polyline) {
    fill: var(--surface);
    stroke: var(--control-line);
  }

  .reference .drawing .cluster :is(polygon, path) {
    fill: none;
    stroke: var(--rule-strong);
  }

  .reference .drawing .edge path {
    fill: none;
    stroke: var(--ink-2);
  }

  .reference .drawing .edge :is(polygon, ellipse) {
    fill: var(--ink-2);
    stroke: var(--ink-2);
  }

  /* A word on an arrow has the page's ground around it. */
  .reference .drawing .edge text {
    fill: var(--ink-2);
    stroke: var(--bg);
    stroke-width: 3px;
    paint-order: stroke;
  }

  .reference .drawing a text {
    text-decoration: underline;
    fill: var(--accent);
  }

  /* The badge every figure wears (the site's `.prov`), in the secondary ink
     inside the strong rule: a diagram is not the device. */
  .reference .diagram .prov {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: var(--s-1) var(--s-2);
    margin-top: var(--s-3);
    font-family: var(--t-label-face);
    font-size: var(--t-label);
    font-variation-settings: var(--t-label-fvs);
    font-weight: var(--t-label-weight);
    font-stretch: var(--t-label-width);
    line-height: var(--t-label-lh);
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: var(--t-label-track);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-xs);
  }

  .reference .diagram figcaption {
    margin-top: var(--s-2);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink-2);
    letter-spacing: var(--t-small-track);
  }

  /* With the reader's own colors the shapes take them too. */
  @media (forced-colors: active) {
    .reference .drawing :is(polygon, ellipse, path, polyline) {
      stroke: currentcolor;
    }

    .reference .drawing .node :is(polygon, ellipse, path, polyline) {
      fill: none;
    }

    .reference .drawing text,
    .reference .drawing .edge :is(polygon, ellipse) {
      fill: currentcolor;
    }

    .reference .drawing .edge text {
      stroke: none;
    }
  }
  /* @endregion */

  /* @region front */
  /* The ways in (`scripts/api_reference_front.py`): the Overview's tasks and
     modules as the site's cards (§6), the Topics page's modules as a row of
     links above its tree, and the search first on an index by letter. */
  .reference .textblock:has(> .cards) {
    max-width: none;
  }

  .reference .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: var(--s-4);
    margin: var(--s-5) 0 var(--s-6);
  }

  .reference .card {
    padding: var(--s-5);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
  }

  .reference .card h3 {
    margin: 0;
  }

  .reference .card h3 a {
    text-decoration: none;
  }

  .reference .card h3 a:hover {
    text-decoration: underline;
  }

  .reference .contents .card p {
    margin: var(--s-2) 0 0;
    color: var(--ink-2);
  }

  .reference .contents .card-links {
    padding: 0;
    margin: var(--s-3) 0 0;
    list-style: none;
  }

  .reference .contents .card-links li {
    margin: 0;
    border-top: 1px solid var(--rule);
  }

  .reference .card-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0;
    font-weight: var(--t-label-weight);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--accent-line);
    text-underline-offset: 0.2em;
  }

  .reference .card-links a:hover {
    text-decoration-color: currentcolor;
  }

  .reference .contents .module-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    padding: 0;
    margin: 0 0 var(--s-6);
    list-style: none;
  }

  .reference .contents .module-list li {
    max-width: none;
    margin: 0;
  }

  .reference .module-list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--s-3);
    font-family: var(--t-small-face);
    font-size: var(--t-small);
    font-variation-settings: var(--t-small-fvs);
    font-weight: var(--t-small-weight);
    font-stretch: var(--t-small-width);
    line-height: var(--t-small-lh);
    color: var(--ink);
    letter-spacing: var(--t-small-track);
    text-decoration: none;
    border: 1px solid var(--control-line);
    border-radius: var(--r-pill);
  }

  .reference .module-list a:hover {
    background: var(--accent-wash);
    border-color: var(--accent);
  }

  .reference .contents .index-search {
    max-width: none;
    margin: var(--s-4) 0 0;
  }

  .reference .index-search .search-field {
    justify-content: flex-start;
    width: 100%;
    max-width: calc(48 * var(--zero-text));
    color: var(--ink-2);
    background: var(--surface);
    border-radius: var(--r-sm);
  }
  /* @endregion */
}

@layer print {
  /* @region print */
  /* On paper there is nothing to follow and nothing to scroll: the bar and the
     ways back go, a wide box wraps, a link is ink with its line, and a heading
     stays with what it opens. Paper is light whatever the reader's system
     asks for, and a printer leaves the grounds out: every ink is the paper's
     text color and every ground the paper, so a page printed from a dark
     system is not pale ink on white. */
  @media print {
    @page {
      margin: 16mm;
    }

    :root {
      --ground: Canvas;
      --bg: Canvas;
      --bg-2: Canvas;
      --surface: Canvas;
      --raised: Canvas;
      --select: Canvas;
      --ink: CanvasText;
      --ink-2: CanvasText;
      --ink-3: CanvasText;
      --pending: CanvasText;
      --signal: CanvasText;
      --accent: CanvasText;
      --rule: GrayText;
      --rule-strong: GrayText;
      --control-line: CanvasText;
      --shadow-card: none;

      color-scheme: light;
    }

    .skip-link,
    .site-menu,
    .api-nav,
    .reference .summary,
    .reference .letters,
    .reference .to-top,
    .reference .permalink {
      display: none;
    }

    .api-header {
      position: static;
    }

    .reference #doc-content {
      display: block;
    }

    .api-header-row,
    .api-footer,
    .reference .navpath,
    .reference #doc-content {
      max-width: none;
      padding-inline: 0;
    }

    .reference a {
      color: inherit;
    }

    .reference .fragment,
    .reference .doxtable {
      overflow: visible;
    }

    .reference .fragment .line {
      white-space: pre-wrap;
    }

    .reference :is(h1, h2, h3, h4, .memtitle, .markdownTableHead, .memproto) {
      break-after: avoid;
    }

    .reference :is(tr, .memproto, .diagram) {
      break-inside: avoid;
    }

    .reference :is(p, li, dd) {
      widows: 3;
      orphans: 3;
    }
  }
  /* @endregion */
}
/* stylelint-enable selector-class-pattern */
