/*
 * docuape page styles.
 *
 * Both themes are expressed as custom properties under [data-theme]; the
 * attribute is set on <html> by an inline script before first paint, so there
 * is never a flash of the wrong theme and the syntax stylesheet (which is
 * scoped to [data-theme="dark"]) always has an attribute to match.
 */

:root {
  --sidebar-width: 17rem;
  --toc-width: 15rem;
  --content-max: 46rem;
  --layout-max: 100rem;
  --header-height: 3.5rem;
  --radius: 0.375rem;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

:root,
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-raised: #ffffff;
  --fg: #1c1e21;
  --fg-muted: #5c6470;
  --fg-faint: #8a919c;
  --border: #e3e6ea;
  --border-strong: #cdd2d9;
  --accent: #1868c4;
  --accent-hover: #0f4f9e;
  --accent-subtle: #eaf2fd;
  --code-bg: #f7f8fa;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 2px 8px rgb(0 0 0 / 0.04);
}

:root[data-theme="dark"] {
  --bg: #16181d;
  --bg-subtle: #1c1f26;
  --bg-raised: #21252d;
  --fg: #e6e8eb;
  --fg-muted: #9ba3af;
  --fg-faint: #6e7681;
  --border: #2c313a;
  --border-strong: #3a4049;
  --accent: #6aa9f0;
  --accent-hover: #8dbdf5;
  --accent-subtle: #1b2b3f;
  --code-bg: #1c1f26;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 8px rgb(0 0 0 / 0.2);
}

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

html {
  scroll-behavior: smooth;
  /* Keep a heading clear of the sticky header when jumped to by anchor. */
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

/*
 * Cross-document view transitions: the browser cross-fades one page into the
 * next instead of flashing. Entirely native — navigation stays a real
 * navigation, so back/forward, focus handling, bfcache and no-JS all keep
 * working. Browsers without support simply navigate as before.
 */
@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* Cut straight to the new page rather than animating between the two. */
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--header-height);
  padding: 0 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: var(--layout-max);
  height: 100%;
  margin: 0 auto;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-right: auto;
  color: var(--fg);
}

.site-brand:hover {
  text-decoration: none;
}

/* With `site.logo_href` the brand is a wrapper around two anchors. */
.site-brand-logo,
.site-brand-name {
  display: flex;
  align-items: center;
  min-width: 0;
}

.site-brand-logo:hover,
.site-brand-name:hover {
  text-decoration: none;
}

/* A wordmark is usually wider than it is tall, so height is what is fixed. */
.site-logo {
  flex: none;
  width: auto;
  height: 1.5rem;
  max-width: 10rem;
  object-fit: contain;
}

.site-logo-dark {
  display: none;
}

:root[data-theme="dark"] .site-logo-light {
  display: none;
}

:root[data-theme="dark"] .site-logo-dark {
  display: block;
}

.site-title {
  font-weight: 650;
  font-size: 1rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.icon-button:hover {
  background: var(--bg-subtle);
  color: var(--fg);
}

.icon-button svg {
  width: 1.125rem;
  height: 1.125rem;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-size: 0.8125rem;
  line-height: 1;
}

.github-link:hover {
  background: var(--bg-subtle);
  color: var(--fg);
  text-decoration: none;
}

.github-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.github-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.github-stars[hidden] {
  display: none;
}

.github-star-icon {
  width: 0.875rem;
  height: 0.875rem;
}

/* The toggle shows the theme you would switch *to*. */
.theme-toggle .icon-dark,
:root[data-theme="dark"] .theme-toggle .icon-light {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-dark {
  display: block;
}

.sidebar-toggle {
  display: none;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-link {
  color: var(--fg-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.header-link:hover {
  color: var(--fg);
  text-decoration: none;
}

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

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  grid-template-rows: auto auto;
  align-items: start;
  max-width: var(--layout-max);
  margin: 0 auto;
}

/* Pages with nothing worth listing get the third column back. */
.layout-no-toc {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar,
.toc {
  position: sticky;
  top: var(--header-height);
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem 1rem 3rem;
}

.sidebar {
  grid-row: 1 / -1;
  border-right: 1px solid var(--border);
}

.main {
  min-width: 0;
  padding: 2rem 2.5rem 5rem;
}

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

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

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

.nav-list .nav-list {
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  margin-left: 0.4rem;
}

.nav-link,
.nav-category > summary,
.nav-category-static {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.nav-link:hover,
.nav-category > summary:hover {
  background: var(--bg-subtle);
  color: var(--fg);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.nav-category > summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
  list-style: none;
}

.nav-category > summary::-webkit-details-marker {
  display: none;
}

/* A caret that rotates with the <details> open state — no JS involved. */
.nav-category > summary::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.nav-category[open] > summary::before {
  transform: rotate(45deg);
}

.nav-category > summary .nav-category-link {
  color: inherit;
  flex: 1;
}

.nav-category-static {
  font-weight: 600;
  color: var(--fg);
}

/* A category holding the current page stays visually connected to it. */
.nav-category.has-active > summary {
  color: var(--accent);
}

.pro-feature > .nav-link::after,
.nav-link.pro-feature::after {
  content: "PRO";
  margin-left: 0.4rem;
  padding: 0.05rem 0.3rem;
  border-radius: 0.2rem;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* ------------------------------------------------------------------- toc -- */

.toc-title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc-list .toc-list {
  border-left: none;
  padding-left: 0.75rem;
}

.toc-link {
  display: block;
  padding: 0.2rem 0 0.2rem 0.75rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--fg-muted);
  font-size: 0.825rem;
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--fg);
  text-decoration: none;
}

.toc-link.active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

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

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  margin: 2rem 0 0.75rem;
  line-height: 1.25;
  font-weight: 650;
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.content > h1:first-child,
.content > h2:first-child {
  margin-top: 0;
}

.content h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.content h2 {
  font-size: 1.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.content h3 {
  font-size: 1.2rem;
}

.content h4 {
  font-size: 1.05rem;
}

.content p,
.content ul,
.content ol,
.content blockquote {
  margin: 0 0 1rem;
}

.content li {
  margin: 0.25rem 0;
}

.content li > ul,
.content li > ol {
  margin: 0.25rem 0;
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 5px solid var(--border);
}

.content blockquote {
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--border-strong);
  color: var(--fg-muted);
}

.content hr {
  height: 1px;
  margin: 2rem 0;
  border: 0;
  background: var(--border);
}

/* The anchor beside a heading, revealed on hover. */
.hash-link {
  margin-left: 0.4rem;
  color: var(--fg-faint);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.content :is(h1, h2, h3, h4, h5, h6):hover .hash-link,
.hash-link:focus-visible {
  opacity: 1;
  text-decoration: none;
}

/* ---------------------------------------------------------------- tables -- */

/* Wide tables scroll inside their own box; the page itself never does. */
.table-wrapper {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

.content th,
.content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.content th {
  background: var(--bg-subtle);
  font-weight: 650;
}

/* ------------------------------------------------------- category indexes -- */

ul.category-index {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.content .category-index-item {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr);
  gap: 1rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

/* ------------------------------------------------------------------ code -- */

.content code {
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85em;
  word-break: break-word;
}

.code-block {
  position: relative;
  margin: 0 0 1.25rem;
}

.code-block pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  tab-size: 2;
}

.code-block pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

.code-block[data-lang]::after {
  content: attr(data-lang);
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  pointer-events: none;
}

.copy-button {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  z-index: 1;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.25rem;
  background: var(--bg-raised);
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.code-block:hover .copy-button,
.copy-button:focus-visible {
  opacity: 1;
}

.copy-button:hover {
  color: var(--fg);
  border-color: var(--accent);
}

/* Hide the language badge while the button covers it. */
.code-block:hover[data-lang]::after {
  opacity: 0;
}

/* -------------------------------------------------------------- diagrams -- */

/* A ```mermaid fence, drawn to SVG when the page was built. There is no script
   behind this and nothing to fetch, so it is on screen at first paint. */
.diagram {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  text-align: center;
}

/* The SVG carries the width its layout came out at. Letting it shrink is what
   keeps a wide diagram inside the column on a phone, and `height: auto` keeps
   it in proportion while it does. */
.diagram svg {
  max-width: 100%;
  height: auto;
}

/* ----------------------------------------------------------- admonitions -- */

.admonition {
  margin: 0 0 1.25rem;
  border: 1px solid var(--adm-border, var(--border));
  border-left: 4px solid var(--adm-accent, var(--border-strong));
  border-radius: var(--radius);
  background: var(--adm-bg, var(--bg-subtle));
  overflow: hidden;
}

.admonition-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-weight: 650;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--adm-accent, var(--fg));
}

.admonition-content {
  padding: 0 1rem;
}

.admonition-content > *:first-child {
  margin-top: 0.75rem;
}

.admonition-icon::before {
  content: "\2139";
  font-size: 1rem;
  line-height: 1;
}

.admonition-note {
  --adm-accent: #4b5563;
  --adm-bg: #f3f4f6;
  --adm-border: #d8dce2;
}

.admonition-tip {
  --adm-accent: #1a7f4b;
  --adm-bg: #e9f7ef;
  --adm-border: #bfe5cf;
}

.admonition-tip .admonition-icon::before {
  content: "\2714";
}

.admonition-info {
  --adm-accent: #1868c4;
  --adm-bg: #eaf2fd;
  --adm-border: #c6dcf7;
}

.admonition-warning {
  --adm-accent: #9a6206;
  --adm-bg: #fdf5e3;
  --adm-border: #f0dcae;
}

.admonition-warning .admonition-icon::before {
  content: "\26A0";
}

.admonition-danger {
  --adm-accent: #b32020;
  --adm-bg: #fdeceb;
  --adm-border: #f5c6c2;
}

.admonition-danger .admonition-icon::before {
  content: "\26D4";
}

.admonition-pro {
  --adm-accent: #7c3aed;
  --adm-bg: #f3eefe;
  --adm-border: #ddd0fb;
}

.admonition-pro .admonition-icon::before {
  content: "\2605";
}

:root[data-theme="dark"] .admonition-note {
  --adm-bg: #1f232b;
  --adm-border: #333a45;
  --adm-accent: #9ba3af;
}

:root[data-theme="dark"] .admonition-tip {
  --adm-bg: #14261c;
  --adm-border: #23472f;
  --adm-accent: #5cc98c;
}

:root[data-theme="dark"] .admonition-info {
  --adm-bg: #14212f;
  --adm-border: #21405f;
  --adm-accent: #6aa9f0;
}

:root[data-theme="dark"] .admonition-warning {
  --adm-bg: #2a2213;
  --adm-border: #4d3d1a;
  --adm-accent: #e0b357;
}

:root[data-theme="dark"] .admonition-danger {
  --adm-bg: #2c1717;
  --adm-border: #522626;
  --adm-accent: #f08b84;
}

:root[data-theme="dark"] .admonition-pro {
  --adm-bg: #221a35;
  --adm-border: #3d2d61;
  --adm-accent: #b491f5;
}

/* ----------------------------------------------------------- breadcrumbs -- */

/*
 * Opt-in chrome (`[breadcrumbs] show`). In `mobile` mode the markup is always
 * present and only this rule and its counterpart in the responsive section
 * decide whether it is on screen — so the two modes render one page, and the
 * one that hides it does so at exactly the width where the sidebar stops
 * showing the same path.
 */
.breadcrumbs {
  margin-bottom: 1.25rem;
}

.breadcrumbs-mobile {
  display: none;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

/* The separator is generated, so it is never selected with the text and never
   reaches the accessibility tree as a word of its own. */
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--fg-faint);
}

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

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-text {
  color: var(--fg-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------- footers -- */

.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.page-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
}

.page-nav-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.page-nav-next {
  grid-column: 2;
  text-align: right;
}

.page-nav-dir {
  display: block;
  color: var(--fg-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-nav-label {
  color: var(--accent);
  font-weight: 600;
}

/* ----------------------------------------------------------- site footer -- */

/*
 * The slot spans the content and contents-panel columns. Keeping it inside the
 * layout also keeps the sidebar's sticky containing block alive through the
 * footer instead of making the navigation scroll away as the footer enters.
 *
 * The markup belongs to whoever wrote the fragment. These are the styles it gets
 * by opting into the class, not styles docuape imposes on it.
 */
.layout-footer {
  grid-column: 2 / -1;
  grid-row: 2;
  min-width: 0;
}

.site-footer {
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-size: 0.875rem;
}

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

/* ------------------------------------------------------------ not found -- */

.not-found {
  padding: 2rem 0;
}

.not-found code {
  word-break: break-all;
}

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

/*
 * The whole of the serve/build difference: `data-search` is written only by a
 * build that carries an index, so a served page shows no control rather than a
 * dead one. The markup itself is unconditional, because the header token table
 * is built in `Site::load`, which has no mode to consult.
 */
body:not([data-search]) .search-button {
  display: none;
}

/* Wider than a plain .icon-button: this one carries a label and a hint. */
.search-button {
  width: auto;
  gap: 0.4rem;
  padding: 0 0.5rem;
  border-color: var(--border);
  background: var(--bg-subtle);
}

.search-button-label {
  font-size: 0.85rem;
}

.search-button-key {
  padding: 0 0.3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.search-dialog {
  width: min(40rem, calc(100vw - 2rem));
  margin-top: 10vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: var(--shadow);
}

.search-dialog::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.search-input {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--fg);
  font: inherit;
}

.search-input:focus {
  outline: none;
}

.search-status,
.search-hint {
  margin: 0;
  padding: 0.4rem 1rem;
  color: var(--fg-faint);
  font-size: 0.75rem;
}

.search-hint {
  border-top: 1px solid var(--border);
}

.search-results {
  max-height: 60vh;
  margin: 0;
  padding: 0.25rem;
  overflow-y: auto;
  list-style: none;
}

.search-result {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.search-result:hover,
.search-result.selected {
  background: var(--accent-subtle);
}

.search-title {
  display: block;
  color: var(--accent);
  font-weight: 600;
}

.search-excerpt {
  margin: 0.15rem 0 0;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/*
 * The first `mark` in the stylesheet. Pagefind wraps query hits in one, and the
 * browser default is yellow-on-black, which is unreadable in the dark theme.
 */
.search-excerpt mark {
  border-radius: 2px;
  background: var(--accent-subtle);
  color: var(--fg);
}

.search-subs {
  margin: 0.15rem 0 0 0.75rem;
  padding: 0 0 0 0.5rem;
  border-left: 2px solid var(--border);
  list-style: none;
}

.search-sub {
  padding: 0.25rem 0.5rem;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------- live reload -- */

.build-error {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.75rem 2.25rem 0.75rem 1rem;
  border: 1px solid #f5c6c2;
  border-left: 4px solid #b32020;
  border-radius: var(--radius);
  background: #fdeceb;
  color: #7a1a1a;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.build-error-dismiss {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

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

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .content .category-index-item {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .main {
    grid-column: 1;
  }

  .layout-footer {
    grid-column: 1;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .header-links {
    display: none;
  }

  /* The width at which the sidebar stops showing where the reader is, which is
     the whole of what `[breadcrumbs] show = "mobile"` means. Moving the sidebar
     breakpoint above means moving this one with it. */
  .breadcrumbs-mobile {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    z-index: 20;
    width: min(var(--sidebar-width), 85vw);
    height: calc(100vh - var(--header-height));
    max-height: none;
    background: var(--bg);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main {
    padding: 1.5rem 1.25rem 4rem;
  }

  .site-logo {
    height: 1.25rem;
  }

  /* The header goes back to a row of icons; the shortcut is moot without a
     keyboard anyway. */
  .search-button-label,
  .search-button-key {
    display: none;
  }

  .search-button {
    width: 2rem;
    padding: 0;
  }

  .site-footer {
    padding: 1.5rem 1.25rem;
  }

  .page-nav {
    grid-template-columns: 1fr;
  }

  .page-nav-next {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .copy-button,
  .hash-link,
  .nav-category > summary::before {
    transition: none;
  }
}
