/* Vole documentation theme.

   The tokens are the forge's Everforest dark/medium palette from
   server/web/static/everforest.css and the layout tokens from
   server/web/static/vole.css. The site is deliberately dark only: it uses
   Vole's dark/medium variant directly, rather than carrying a light half that
   only the docs use.

   Sections, in file order: tokens and fonts, base type, top bar, page layout,
   sidebar, content, tables and code, page footer, search palette, responsive. */

/* ---------- tokens and fonts ---------- */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #2d353b;
  --bg-panel: #343f44;
  --bg-raised: #3d484d;
  --bg-hover: #475258;
  --bg-active: #4f585e;
  --border: #4f585e;
  --border-strong: #56635f;

  /* text */
  --fg: #d3c6aa;
  --fg-muted: #9da9a0;
  --fg-faint: #859289;

  /* accent and status */
  --accent: #a7c080;
  --accent-fg: #2d353b;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --running: #7fbbb3;
  --good: #a7c080;
  --bad: #e67e80;
  --warn: #dbbc7f;
  --merged: #d699b6;

  /* shape, type, and measure */
  --radius: 6px;
  --radius-lg: 8px;
  --page-gutter: 24px;
  --topbar-h: 46px;
  --sidebar-w: 16rem;
  --toc-w: 14rem;
  /* The article is the flexible column: it takes the space the side columns
     leave, up to this cap. */
  --content-max: 56rem;
  --layout-gap: 32px;
  /* The docs grid, not the whole page, is the measure the header and footer
     follow. Keeping the columns plus their gutters in one token is what makes
     the brand line up with the sidebar at every width. */
  --layout-max: calc(
    var(--sidebar-w) + var(--content-max) + var(--toc-w) +
    2 * var(--layout-gap) + 2 * var(--page-gutter)
  );
  --font: "Lexend", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs: 15.4px;
  --lh: 1.62;

  /* The head mark is drawn in the text colour, as on the forge's dark theme. */
  --mark-fill: currentColor;
  --mark-outline: transparent;
}

@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/lexend-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/lexend-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: italic;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: italic;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- base type ---------- */

* { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

html {
  scroll-behavior: smooth;
  /* The top bar scrolls away with the page, so an anchor only needs the
     article's own breathing room, not the bar's height. */
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  -webkit-font-smoothing: auto;
  font-kerning: normal;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li > p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
img { max-width: 100%; }
kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-panel);
  color: var(--fg-muted);
}
.icon { width: 14px; height: 14px; flex: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-200%);
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 500;
}
.skip-link:focus { transform: none; text-decoration: none; }

.muted { color: var(--fg-muted); }

/* ---------- top bar ---------- */

/* The bar is part of the document: it scrolls away with the page rather than
   pinning itself over the article. */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--topbar-h);
  padding-block: 0;
  padding-inline: max(var(--page-gutter), calc((100% - var(--layout-max)) / 2 + var(--page-gutter)));
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  display: block;
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
}
.brand .mark::before,
.brand .mark::after {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
}
.brand .mark::before {
  background-color: var(--mark-outline);
  -webkit-mask-image: url("vole-head-solid.png");
  mask-image: url("vole-head-solid.png");
}
.brand .mark::after {
  background-color: var(--mark-fill);
  -webkit-mask-image: url("vole-head.png");
  mask-image: url("vole-head.png");
}
.brand-name {
  font-size: calc(15.4px * 1);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-note {
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-faint);
  font-size: calc(11.55px * 1);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--bg-hover); color: var(--fg); }

.topsearch {
  flex: 1 1 auto;
  min-width: 8rem;
  max-width: 18rem;
  margin-left: auto;
}
.topsearch-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg-muted);
  font: inherit;
  font-size: calc(13.75px * 1);
  text-align: left;
  cursor: pointer;
}
.topsearch-box:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--fg);
}
.topsearch-box .icon { width: 13px; height: 13px; color: var(--fg-faint); }
.topsearch-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topsearch-key {
  flex: 0 0 auto;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-panel);
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: calc(11.55px * 1);
}

/* The way out to the repository this site documents (mkdocs.yml's repo_url). */
.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-size: calc(13.75px * 1);
  white-space: nowrap;
}
.topbar-link:hover {
  background: var(--bg-hover);
  color: var(--fg);
  text-decoration: none;
}
.topbar-link .icon { width: 13px; height: 13px; color: var(--fg-faint); }

/* ---------- page layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  justify-content: center;
  align-items: start;
  gap: var(--layout-gap);
  width: min(100%, var(--layout-max));
  margin: 0 auto;
  padding: 28px var(--page-gutter) 80px;
}

/* ---------- sidebar ---------- */

/* The side columns scroll with the article; no column has its own scrollbar. */
.sidebar {
  padding-right: 4px;
}

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-root > .nav-item { margin-bottom: 12px; }
.nav-section { margin: 20px 0 0; }
.nav-section:first-child { margin-top: 0; }
.nav-section-title {
  margin: 0 0 6px;
  padding: 0 10px;
  color: var(--fg-faint);
  font-size: calc(11.55px * 1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-link {
  display: block;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-size: calc(13.75px * 1);
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--fg);
  text-decoration: none;
}
.nav-link.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
  font-weight: 500;
}

/* ---------- content ---------- */

.content {
  min-width: 0;
  max-width: var(--content-max);
}

.content > :first-child { margin-top: 0; }
.content > :last-child { margin-bottom: 0; }

.content h1 { margin: 0 0 16px; font-size: calc(23.1px * 1); }
.content h2 { margin: 42px 0 12px; font-size: calc(17.6px * 1); }
.content h3 { margin: 30px 0 9px; font-size: calc(15.4px * 1); }
.content h4 { margin: 24px 0 8px; font-size: calc(14.3px * 1); }
.content h5,
.content h6 { margin: 18px 0 6px; color: var(--fg-muted); font-size: calc(13.75px * 1); }

.content p { margin: 14px 0; }
.content ul,
.content ol { margin: 14px 0; padding-left: 24px; }
.content li { margin: 4px 0; }
.content li::marker { color: var(--fg-faint); }

/* Start-here cards on the overview. They are links, not navigation: the three
   jobs a reader can arrive with. */
.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 28px;
}
.start-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--fg);
}
.start-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--bg-raised);
  text-decoration: none;
}
.start-card-title {
  color: var(--accent);
  font-size: calc(14.3px * 1);
  font-weight: 600;
}
.start-card-text {
  color: var(--fg-muted);
  font-size: calc(13.2px * 1);
  line-height: 1.5;
}

/* Callouts. Core Markdown's admonition extension emits .admonition.<type>.
   Use them for a caveat at the point of decision, not for ordinary prose. */
.admonition {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--running);
  border-radius: var(--radius);
  background: var(--bg-panel);
}
.admonition-title {
  margin: 0 0 6px;
  color: var(--running);
  font-size: calc(13.75px * 1);
  font-weight: 600;
}
.admonition > :last-child { margin-bottom: 0; }
.admonition.tip { border-left-color: var(--good); }
.admonition.tip .admonition-title { color: var(--good); }
.admonition.warning {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 7%, var(--bg-panel));
}
.admonition.warning .admonition-title { color: var(--warn); }
.admonition.danger {
  border-left-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 7%, var(--bg-panel));
}
.admonition.danger .admonition-title { color: var(--bad); }

/* Diagrams are Mermaid source, rendered in the browser on pages that opt in
   with `mermaid: true`. Static images use the same figure frame. */
.doc-figure { margin: 22px 0; }
.doc-figure .mermaid {
  margin: 0;
  overflow-x: auto;
  text-align: center;
}
.doc-figure .mermaid svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}
.doc-figure figcaption {
  margin-top: 8px;
  color: var(--fg-faint);
  font-size: calc(12.65px * 1);
  line-height: 1.5;
}

.content blockquote {
  margin: 14px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--border-strong);
  color: var(--fg-muted);
}
.content blockquote > :first-child { margin-top: 0; }
.content blockquote > :last-child { margin-bottom: 0; }

/* A heading permalink is quiet until the reader is near it. The link is still
   in the tab order, so keyboard users can copy the fragment without a mouse. */
.headerlink {
  margin-left: 0.35em;
  color: var(--fg-faint);
  font-weight: 400;
  opacity: 0;
}
h1:hover .headerlink,
h2:hover .headerlink,
h3:hover .headerlink,
h4:hover .headerlink,
h5:hover .headerlink,
h6:hover .headerlink,
.headerlink:focus-visible { opacity: 1; }
.headerlink:hover { color: var(--accent); text-decoration: none; }

/* ---------- tables and code ---------- */

.content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-collapse: collapse;
  background: var(--bg-panel);
  font-size: calc(13.75px * 1);
}
.content th,
.content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.content tr:last-child > td { border-bottom: 0; }
.content th {
  background: var(--bg-raised);
  color: var(--fg-faint);
  font-size: calc(12.1px * 1);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 7px;
  padding-bottom: 7px;
}
.content tbody tr:hover { background: var(--bg-hover); }

.content code,
.content kbd {
  font-family: var(--mono);
}
.content code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-raised);
  font-size: 0.82em;
}
.content pre {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: auto;
  font-family: var(--mono);
  font-size: calc(13.2px * 1);
  line-height: 1.55;
}
.content pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}
.content .codehilite {
  position: relative;
  margin: 12px 0;
}
.content .codehilite pre { margin: 0; }

.copy-code {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--fg-muted);
  font-family: var(--font);
  font-size: calc(11.55px * 1);
  line-height: 1.4;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.codehilite:hover .copy-code,
.copy-code:focus-visible { opacity: 1; }
.copy-code:hover { background: var(--bg-hover); color: var(--fg); }

/* ---------- pager and footer ---------- */

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--fg);
}
.pager-link:hover {
  border-color: var(--border-strong);
  background: var(--bg-raised);
  text-decoration: none;
}
.pager-next { text-align: right; }
.pager-where {
  color: var(--fg-faint);
  font-size: calc(11.55px * 1);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pager-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(13.75px * 1);
  font-weight: 500;
}
.pager-prev .pager-title { color: var(--fg-muted); }
.pager-next .pager-title { color: var(--accent); }

.site-footer {
  width: min(100%, var(--layout-max));
  margin: 0 auto;
  padding: 18px var(--page-gutter) 40px;
  border-top: 1px solid var(--border);
  color: var(--fg-faint);
  font-size: calc(12.65px * 1);
}
.site-footer p { margin: 0; }
.site-footer p + p { margin-top: 4px; }
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- on this page ---------- */

.toc {
  font-size: calc(12.65px * 1);
}
.toc-title {
  margin: 0 0 8px;
  color: var(--fg-faint);
  font-size: calc(11.55px * 1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list .toc-list { padding-left: 10px; }
.toc-item > a {
  display: block;
  padding: 3px 0 3px 10px;
  border-left: 1px solid var(--border);
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-item > a:hover {
  border-left-color: var(--border-strong);
  color: var(--fg);
  text-decoration: none;
}
.toc-level-3 > a { padding-left: 18px; color: var(--fg-faint); }

/* ---------- search palette ---------- */

.palette {
  width: min(40rem, calc(100vw - 2 * var(--page-gutter)));
  max-height: min(80vh, 44rem);
  margin: 10vh auto auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.palette::backdrop { background: rgba(0, 0, 0, 0.5); }
.palette-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.palette-search .icon { width: 16px; height: 16px; color: var(--fg-muted); }
.palette-search input[type="search"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: calc(15.4px * 1);
}
.palette-search input[type="search"]::placeholder { color: var(--fg-faint); }
.palette-search input[type="search"]::-webkit-search-cancel-button,
.palette-search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.palette-search input[type="search"]:focus-visible { outline: 0; }
.palette-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--fg-faint);
  cursor: pointer;
}
.palette-close:hover { background: var(--bg-hover); color: var(--fg); }
.palette-results { max-height: min(60vh, 30rem); overflow-y: auto; padding: 6px; }
.palette-row {
  display: block;
  padding: 7px 9px;
  border-radius: var(--radius);
  color: var(--fg);
}
.palette-row:hover { background: var(--bg-hover); text-decoration: none; }
.palette-row.is-selected { background: var(--accent-soft); }
.palette-row-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.palette-row-where {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-faint);
  font-size: calc(12.65px * 1);
}
.palette-empty {
  margin: 0;
  padding: 16px 12px;
  color: var(--fg-muted);
  font-size: calc(13.75px * 1);
}
.palette-foot {
  display: flex;
  gap: 14px;
  padding: 7px 12px;
  border-top: 1px solid var(--border);
  color: var(--fg-faint);
  font-size: calc(12.65px * 1);
}
.palette-foot kbd {
  padding: 0 4px;
  background: var(--bg-panel);
}

.nav-scrim { display: none; }

.not-found {
  padding: 40px 0;
}
.not-found-code {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: calc(13.2px * 1);
  letter-spacing: 0.12em;
}

/* ---------- responsive ---------- */

/* Below the width where three columns plus a readable article fit, give the
   article the TOC's space rather than squeezing it. */
@media (max-width: 1360px) {
  .layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    justify-content: start;
  }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .start-grid { grid-template-columns: 1fr; }

  .layout {
    display: block;
    padding-top: 20px;
  }
  .content { max-width: var(--content-max); }

  /* On small screens the sidebar is a drawer over the page, not a column in
     it, so it is the one thing that stays put while open. */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: min(20rem, 85vw);
    overflow-y: auto;
    padding: 16px 14px 32px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.16s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.5);
  }
  body.nav-open .nav-scrim { display: block; }
}

@media (max-width: 640px) {
  .topbar { gap: 10px; padding-inline: 16px; }
  .brand-note { display: none; }
  .topsearch { min-width: 0; max-width: none; }
  .topsearch-label { display: none; }
  .topsearch-box { justify-content: flex-end; }
  .topsearch-key { display: none; }
  /* Keep the word "Source": the icon alone is a thinner target and a weaker
     label, and the search box can shrink to make the room. */
  .topbar-link .icon { display: none; }
  .topbar-link { padding-inline: 2px; }
  .layout { padding-inline: 16px; }
  .site-footer { padding-inline: 16px; }
  .content h1 { font-size: calc(20.9px * 1); }
  .pager { grid-template-columns: 1fr; }
  .palette-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
