/*
 * deep_cv docs: visual system, after pixel-robotics.eu.
 * Brand: Pixel orange (--brand) on white, the logo's warm near-black (--ink) for text, the site's
 * cool grey band (--panel) for the navigation; Poppins for everything but code (Atkinson
 * Hyperlegible Mono keeps identifiers unambiguous); 3px corners on controls like the site's buttons.
 * Signature: the "pixel", the small orange square from the logo, marks where you are: the current
 * page on the navigation tree, the current section on the table-of-contents track, the release.
 */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/poppins-latin-400-normal.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: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/poppins-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../fonts/poppins-latin-500-normal.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: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../fonts/poppins-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../fonts/poppins-latin-600-normal.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: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("../fonts/poppins-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/poppins-latin-700-normal.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: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("../fonts/poppins-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/poppins-latin-400-italic.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: "Poppins";
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/poppins-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2-variations");
  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: "Atkinson Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- tokens */

:root {
  --bg: #ffffff;
  --panel: #f2f5f7;
  --surface: #ffffff;
  --sunken: #eef2f5;
  --code-bg: #f6f8fa;
  --ink: #291f1e;
  --ink-2: #3f3f46;
  --muted: #5c6672;
  --faint: #8b95a1;
  --rule: #e1e8ed;
  --rule-strong: #c5d0d8;
  --brand: #e25303;
  --brand-strong: #cc4a03;
  --brand-hover: #b54402;
  --brand-ink: #b54402;
  --brand-soft: #fceee6;
  --on-brand: #ffffff;
  --logo-ink: #291f1e;
  --mark: rgba(226, 83, 3, 0.16);
  --mark-strong: rgba(226, 83, 3, 0.34);
  --focus: #e25303;
  --shadow-card: 0 4px 24px rgba(41, 31, 30, 0.06);
  --shadow: 0 1px 2px rgba(41, 31, 30, 0.06), 0 8px 28px rgba(41, 31, 30, 0.12);
  --shadow-lg: 0 2px 6px rgba(41, 31, 30, 0.08), 0 24px 64px rgba(41, 31, 30, 0.22);
  --c-note: #3a4f66;
  --c-note-bg: #eef3f7;
  --c-tip: #1b7f3b;
  --c-tip-bg: #edf6ee;
  --c-important: #b54402;
  --c-important-bg: #fdf0e8;
  --c-warning: #8a5a00;
  --c-warning-bg: #fdf5e4;
  --c-caution: #b3261e;
  --c-caution-bg: #fdf1f0;
  /* syntax */
  --t-comment: #6b7480;
  --t-keyword: #3a4f66;
  --t-string: #1b7f3b;
  --t-number: #b54402;
  --t-func: #6b3fa0;
  --t-builtin: #0d6b78;
  --t-attr: #b54402;
  --t-tag: #3a4f66;
  --t-op: #52525b;
  --t-del-bg: #fbe4e4;
  --t-ins-bg: #e4f4e7;

  --font-display: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Atkinson Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --topbar-h: 4rem;
  --sidebar-w: 17.5rem;
  --rail-w: 15rem;
  --panel-w: 24rem;
  --measure: 46rem;
  --radius: 3px;
  --radius-lg: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1817;
    --panel: #211d1c;
    --surface: #262120;
    --sunken: #2f2927;
    --code-bg: #201c1b;
    --ink: #f2eeec;
    --ink-2: #d4cdca;
    --muted: #a69e9a;
    --faint: #857c78;
    --rule: #38312f;
    --rule-strong: #4b4240;
    --brand: #ef6a1f;
    --brand-strong: #ef6a1f;
    --brand-hover: #ff8540;
    --brand-ink: #ff9152;
    --brand-soft: #3b2518;
    --on-brand: #1b1817;
    --logo-ink: #f2eeec;
    --mark: rgba(239, 106, 31, 0.22);
    --mark-strong: rgba(239, 106, 31, 0.42);
    --focus: #ff9152;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 64px rgba(0, 0, 0, 0.55);
    --c-note: #a8bccf;
    --c-note-bg: #1f262d;
    --c-tip: #7fcf9f;
    --c-tip-bg: #15261b;
    --c-important: #ff9152;
    --c-important-bg: #3b2518;
    --c-warning: #e9b35b;
    --c-warning-bg: #2c2312;
    --c-caution: #f08a8a;
    --c-caution-bg: #2f1818;
    --t-comment: #8d8580;
    --t-keyword: #a8bccf;
    --t-string: #8fd1a7;
    --t-number: #ffab7a;
    --t-func: #c9a8f4;
    --t-builtin: #6fd0d6;
    --t-attr: #ffab7a;
    --t-tag: #a8bccf;
    --t-op: #b3aaa6;
    --t-del-bg: #3a1a1a;
    --t-ins-bg: #14301f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1817;
  --panel: #211d1c;
  --surface: #262120;
  --sunken: #2f2927;
  --code-bg: #201c1b;
  --ink: #f2eeec;
  --ink-2: #d4cdca;
  --muted: #a69e9a;
  --faint: #857c78;
  --rule: #38312f;
  --rule-strong: #4b4240;
  --brand: #ef6a1f;
  --brand-strong: #ef6a1f;
  --brand-hover: #ff8540;
  --brand-ink: #ff9152;
  --brand-soft: #3b2518;
  --on-brand: #1b1817;
  --logo-ink: #f2eeec;
  --mark: rgba(239, 106, 31, 0.22);
  --mark-strong: rgba(239, 106, 31, 0.42);
  --focus: #ff9152;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 64px rgba(0, 0, 0, 0.55);
  --c-note: #a8bccf;
  --c-note-bg: #1f262d;
  --c-tip: #7fcf9f;
  --c-tip-bg: #15261b;
  --c-important: #ff9152;
  --c-important-bg: #3b2518;
  --c-warning: #e9b35b;
  --c-warning-bg: #2c2312;
  --c-caution: #f08a8a;
  --c-caution-bg: #2f1818;
  --t-comment: #8d8580;
  --t-keyword: #a8bccf;
  --t-string: #8fd1a7;
  --t-number: #ffab7a;
  --t-func: #c9a8f4;
  --t-builtin: #6fd0d6;
  --t-attr: #ffab7a;
  --t-tag: #a8bccf;
  --t-op: #b3aaa6;
  --t-del-bg: #3a1a1a;
  --t-ins-bg: #14301f;
  color-scheme: dark;
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 1.25rem);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--brand-ink);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--brand);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
/* diagrams and inline SVG in content keep their own geometry and paint */
.prose svg {
  width: auto;
  height: auto;
  max-width: 100%;
  fill: initial;
  stroke: initial;
  stroke-width: initial;
}
img {
  max-width: 100%;
  height: auto;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
}
[hidden] {
  display: none !important;
}
::selection {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
}
.skip-link:focus {
  top: 0.6rem;
}
.muted {
  color: var(--muted);
}
.muted-link {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.12s,
    border-color 0.12s;
}
.btn:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: var(--on-brand);
}
.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--on-brand);
}
.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
}
.btn-wide {
  width: 100%;
}
.btn-danger {
  color: var(--c-caution);
}
.btn-danger:hover {
  border-color: var(--c-caution);
  color: var(--c-caution);
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--sunken);
  color: var(--ink);
}
.icon-btn.sm {
  width: 1.6rem;
  height: 1.6rem;
}
.icon-btn.sm svg {
  width: 14px;
  height: 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
.chip svg {
  width: 14px;
  height: 14px;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.chip[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.chip[aria-expanded="true"] {
  border-color: var(--brand);
  color: var(--brand-ink);
}
.chip .count {
  min-width: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 2px;
  background: var(--brand-strong);
  color: var(--on-brand);
  font-size: 0.72rem;
  text-align: center;
}
.kbd {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  background: var(--surface);
}
.label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
}
textarea {
  resize: vertical;
  line-height: 1.45;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: -1px;
  border-color: transparent;
}
.input-row,
.copy-row {
  display: flex;
  gap: 0.5rem;
}
.copy-row input {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.check,
.radio {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.93rem;
}
.msg {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.msg-err {
  background: var(--c-caution-bg);
  color: var(--c-caution);
}
.msg-ok {
  background: var(--c-tip-bg);
  color: var(--c-tip);
}
.hint {
  color: var(--faint);
  font-size: 0.8rem;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--topbar-h);
  padding: 0 1.25rem;
  background: color-mix(in srgb, var(--surface) 87%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}
.brand:hover {
  color: var(--ink);
}
.brand-logos img {
  display: block;
  width: auto;
  height: 30px;
}
.brand-logos .logo-on-dark,
.brand-mark {
  display: none;
}
:root[data-theme="dark"] .brand-logos .logo-on-light {
  display: none;
}
:root[data-theme="dark"] .brand-logos .logo-on-dark {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logos .logo-on-light {
    display: none;
  }
  :root:not([data-theme="light"]) .brand-logos .logo-on-dark {
    display: block;
  }
}
/* the logo's mark as inline SVG, for narrow screens: ink follows the theme, the eye stays dark */
.brand-mark {
  width: 28px;
  height: 28px;
  stroke: none;
}
.brand-mark .m-ink {
  fill: var(--logo-ink);
}
.brand-mark .m-brand {
  fill: #e25303;
}
.brand-mark .m-eye {
  fill: #291f1e;
}
.brand-name {
  padding-left: 0.9rem;
  border-left: 1px solid var(--rule-strong);
  line-height: 1.75rem;
}
.nav-toggle {
  display: none;
}

.release-switch {
  position: relative;
}
.release-btn {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 0.3rem 0 0.7rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
}
.release-btn:hover {
  border-color: var(--brand);
}
.release-zone {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-right: 0.55rem;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* the pixel: the release you are reading */
.release-zone::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--brand);
}
.release-name {
  display: block;
  max-width: 11rem;
  padding-right: 0.15rem;
  overflow: hidden;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.release-btn .chev {
  align-self: center;
  width: 16px;
  height: 16px;
  margin-right: 0.3rem;
  color: var(--ink-2);
}
.release-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 40;
  min-width: 15rem;
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.release-menu a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.release-menu a:hover,
.release-menu a:focus-visible {
  background: var(--sunken);
}
.release-menu [aria-selected="true"] a {
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 600;
}
.r-label {
  font-family: var(--font-mono);
  white-space: nowrap;
}
.r-meta {
  display: flex;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
/* space switcher: same control as the release switcher; menu rows carry a one-line description */
.space-menu {
  min-width: 17rem;
  max-width: min(24rem, calc(100vw - 2rem));
}
.space-menu a {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}
.s-label {
  font-weight: 600;
  white-space: nowrap;
}
.s-desc {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.space-menu [aria-selected="true"] .s-desc {
  font-weight: 400;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  max-width: 26rem;
  height: 2.4rem;
  margin-left: auto;
  padding: 0 0.5rem 0 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.search-trigger:hover {
  border-color: var(--rule-strong);
}
.search-placeholder {
  flex: 1;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
/* no search box (a space without docs yet): the actions still sit on the right */
.release-switch + .topbar-actions {
  margin-left: auto;
}
.ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.4rem;
  padding: 0 1rem;
  border: 1px solid var(--brand-strong);
  border-radius: var(--radius);
  background: var(--brand-strong);
  color: var(--on-brand);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.ask-btn:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}
.i-moon {
  display: none;
}
:root[data-theme="dark"] .i-sun {
  display: none;
}
:root[data-theme="dark"] .i-moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun {
    display: none;
  }
  :root:not([data-theme="light"]) .i-moon {
    display: block;
  }
}
.user-menu {
  position: relative;
}
.avatar {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 40;
  min-width: 15rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.menu-head {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.6rem 0.6rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.88rem;
}
.menu-head span {
  color: var(--muted);
  font-size: 0.8rem;
}
.menu a,
.menu button {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu a:hover,
.menu button:hover {
  background: var(--sunken);
}
.menu form {
  margin: 0;
}

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

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  min-height: calc(100vh - var(--topbar-h));
}
.layout-wide .shell {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}
.shell-single {
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
}
.shell.comments-open {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--panel-w);
}
.shell.comments-open .rail {
  display: none;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.1rem 0.7rem 3rem 0.9rem;
  background: var(--panel);
  border-right: 1px solid var(--rule);
  font-size: 0.9rem;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.sidebar-home {
  position: relative;
  display: block;
  padding: 0.32rem 0.6rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
  border-radius: var(--radius);
}
.sidebar-home:hover {
  color: var(--brand-ink);
}
.sidebar-home.is-active {
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.nav-close {
  display: none;
}
.sidebar-note {
  margin: 0 0.5rem 0.8rem;
  padding: 0.5rem 0.6rem;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
}
.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list .nav-list {
  margin: 0.1rem 0 0.25rem 0.8rem;
  padding-left: 0.45rem;
  border-left: 1px solid var(--rule-strong);
}
.nav-item a,
.nav-dir {
  position: relative;
  display: block;
  padding: 0.32rem 0.6rem;
  border-radius: var(--radius);
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.4;
}
.nav-item a:hover {
  color: var(--brand-ink);
}
.nav-item a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
/* the pixel marks where you are: on the tree line in the navigation, on the track of the table of
   contents; 7px centred on the 1px line */
.sidebar-home.is-active::before,
.nav-item a[aria-current="page"]::before,
.toc-list a.is-active::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--brand);
}
.sidebar-home.is-active::before,
.nav-item a[aria-current="page"]::before {
  left: calc(-0.45rem - 4px);
  top: calc(0.32rem + 0.7em - 3.5px);
}
.nav-item summary {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius);
}
.nav-item summary::-webkit-details-marker {
  display: none;
}
.nav-item summary > a,
.nav-item summary > .nav-dir {
  flex: 1;
  min-width: 0;
}
.nav-chev {
  width: 15px;
  height: 15px;
  margin: 0 0.3rem;
  color: var(--faint);
  transition: transform 0.15s;
}
details[open] > summary .nav-chev {
  transform: rotate(90deg);
}
/* top level: aisle labels */
.depth-0 > .nav-item.has-children {
  margin-top: 0.9rem;
}
.depth-0 > .nav-item.has-children:first-child {
  margin-top: 0.2rem;
}
.depth-0 > .nav-item > details > summary > a,
.depth-0 > .nav-item > details > summary > .nav-dir {
  padding: 0.32rem 0.6rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.depth-0 > .nav-item > details > summary > a:hover {
  color: var(--brand-ink);
}
.depth-0 > .nav-item > details > summary > a[aria-current="page"] {
  color: var(--ink);
}
.depth-0 > .nav-item > details > .nav-list {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.scrim {
  display: none;
}

.main {
  min-width: 0;
  padding: 2.5rem 3rem 5rem;
}
.doc {
  max-width: var(--measure);
  margin: 0 auto;
}
.layout-wide .doc {
  max-width: 50rem;
}

.rail {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 2.4rem 1.2rem 2rem 0.4rem;
  scrollbar-width: thin;
}
.toc-h {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--rule-strong);
  font-size: 0.82rem;
}
.toc-list a {
  position: relative;
  display: block;
  padding: 0.24rem 0 0.24rem 0.9rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.toc-list a:hover {
  color: var(--brand-ink);
}
.toc-list a.is-active {
  color: var(--ink);
}
.toc-list a.is-active::before {
  left: -4px;
  top: calc(0.24rem + 0.7em - 3.5px);
}
.toc-l3 a {
  padding-left: 1.7rem;
  font-size: 0.78rem;
}

/* ---------------------------------------------------------------- doc header (signature) */

.doc-head {
  margin-bottom: 2rem;
}
.locator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  max-width: 100%;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}
.loc-zone,
.loc-seg,
.loc-tag {
  display: inline-block;
  max-width: 18rem;
  overflow: hidden;
  color: var(--muted);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.loc-zone {
  padding: 0.24rem 0.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
}
a.loc-zone:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}
/* pixel trail between the levels, after the small squares of the logo */
.loc-seg::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 0.6rem 0.12em 0;
  border-radius: 1px;
  background: var(--faint);
  vertical-align: middle;
}
a.loc-seg:hover {
  color: var(--brand-ink);
}
.loc-tag {
  padding: 0.24rem 0.5rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}
.doc-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.35rem + 2vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.doc-lede code {
  padding: 0.08em 0.32em;
  border-radius: var(--radius);
  background: var(--sunken);
  font-size: 0.86em;
}
.doc-lede {
  margin: 0.8rem 0 0;
  color: var(--ink-2);
  font-size: 1.15rem;
  line-height: 1.55;
  text-wrap: pretty;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 1.3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.84rem;
}
.doc-meta .sha {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}
.notice {
  margin: 0 0 1.5rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 0.93rem;
}

/* ---------------------------------------------------------------- prose */

.prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  overflow-wrap: break-word;
}
.prose > :first-child {
  margin-top: 0;
}
.prose > h2:first-child {
  padding-top: 0;
  border-top: 0;
}
.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose blockquote,
.prose .table-wrap,
.prose .highlight,
.prose pre,
.prose details,
.prose figure {
  margin: 0 0 1.15em;
}
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  position: relative;
  font-family: var(--font-display);
  color: var(--ink);
  text-wrap: balance;
}
.prose h2 {
  margin: 2.5em 0 0.6em;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.prose h3 {
  margin: 1.9em 0 0.5em;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.35;
}
.prose h4 {
  margin: 1.6em 0 0.45em;
  font-size: 1.04rem;
  font-weight: 600;
}
.prose h5,
.prose h6 {
  margin: 1.4em 0 0.4em;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.prose h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2em 0 0.6em;
}
.heading-anchor {
  margin-left: 0.4em;
  padding: 0 0.15em;
  color: var(--faint);
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.prose :is(h1, h2, h3, h4, h5, h6):hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}
.heading-anchor:hover {
  color: var(--brand);
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li {
  margin: 0.25em 0;
}
.prose li > ul,
.prose li > ol {
  margin: 0.25em 0 0.4em;
}
.prose ul {
  list-style-type: square;
}
.prose li::marker {
  color: var(--faint);
}
.prose ol > li::marker {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92em;
}
.prose strong {
  font-weight: 600;
}
.prose a.broken-link {
  color: var(--c-caution);
  text-decoration-style: wavy;
}
.prose hr {
  height: 0;
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.prose blockquote {
  padding: 0.1em 0 0.1em 1.1em;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-2);
}
.prose img {
  display: inline-block;
  border-radius: var(--radius);
  cursor: zoom-in;
}
.prose p > img:only-child,
.prose p > a:only-child > img {
  display: block;
  margin: 0.3em 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.prose video {
  max-width: 100%;
  border-radius: var(--radius-lg);
}
.prose .doc-video {
  display: block;
  margin: 0.3em 0 0.2em;
  border: 1px solid var(--rule);
  background: #000;
}
.prose .doc-video-link {
  font-size: 0.85em;
  color: var(--ink-2);
}
.prose :not(pre) > code {
  padding: 0.12em 0.36em;
  border-radius: var(--radius);
  background: var(--sunken);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
.prose kbd {
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  font-size: 0.82em;
}
.prose dl dt {
  font-weight: 700;
}
.prose dl dd {
  margin: 0 0 0.6em 1.2em;
}
.prose details {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.prose details summary {
  cursor: pointer;
  font-weight: 600;
}
.prose .contains-task-list {
  padding-left: 0.3em;
  list-style: none;
}
.prose .task-list-item-checkbox {
  margin-right: 0.45em;
  accent-color: var(--brand);
}
.prose sup.footnote-ref a {
  text-decoration: none;
  font-size: 0.8em;
}
.prose section.footnotes {
  margin-top: 3em;
  color: var(--ink-2);
  font-size: 0.9rem;
}
.prose hr.footnotes-sep {
  margin-top: 3em;
}

/* tables */
.prose .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
}
.prose th,
.prose td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  text-align: left;
}
.prose th {
  background: var(--panel);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--panel) 45%, transparent);
}
.prose td img {
  max-width: 14rem;
}

/* callouts (GitHub alerts) */
.callout {
  --c: var(--c-note);
  --cb: var(--c-note-bg);
  margin: 0 0 1.2em;
  padding: 0.75rem 1rem 0.2rem;
  border-left: 3px solid var(--c);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--cb);
}
.callout-tip {
  --c: var(--c-tip);
  --cb: var(--c-tip-bg);
}
.callout-important {
  --c: var(--c-important);
  --cb: var(--c-important-bg);
}
.callout-warning {
  --c: var(--c-warning);
  --cb: var(--c-warning-bg);
}
.callout-caution {
  --c: var(--c-caution);
  --cb: var(--c-caution-bg);
}
.prose .callout > p.callout-title {
  margin: 0 0 0.3rem;
  color: var(--c);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.callout > :last-child {
  margin-bottom: 0.6rem;
}

/* code */
.prose .highlight,
.prose pre {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--code-bg);
}
.prose .highlight pre {
  margin: 0;
  border: 0;
  background: none;
}
.prose pre {
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  tab-size: 4;
  scrollbar-width: thin;
}
.prose pre code {
  font-size: inherit;
}
.prose .highlight[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.2rem 0.55rem;
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0 var(--radius-lg) 0 var(--radius);
  color: var(--faint);
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.12s;
}
.prose .highlight:hover[data-lang]::before {
  opacity: 0;
}
.copy-code {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.prose .highlight:hover .copy-code,
.prose pre:hover .copy-code,
.copy-code:focus-visible {
  opacity: 1;
}
.prose pre.mermaid {
  padding: 1rem;
  background: var(--surface);
  text-align: center;
  font-family: var(--font-body);
}
.prose pre.mermaid:not([data-processed]) {
  color: var(--faint);
  font-family: var(--font-mono);
  text-align: left;
}

/* pygments tokens */
.highlight .c,
.highlight .ch,
.highlight .cm,
.highlight .c1,
.highlight .cs,
.highlight .cpf {
  color: var(--t-comment);
  font-style: italic;
}
.highlight .cp {
  color: var(--t-builtin);
}
.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .ow {
  color: var(--t-keyword);
  font-weight: 600;
}
.highlight .kt,
.highlight .nc,
.highlight .nn,
.highlight .ne {
  color: var(--t-builtin);
}
.highlight .s,
.highlight .sa,
.highlight .sb,
.highlight .sc,
.highlight .dl,
.highlight .sd,
.highlight .s2,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .s1,
.highlight .ss {
  color: var(--t-string);
}
.highlight .m,
.highlight .mb,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo,
.highlight .il,
.highlight .no {
  color: var(--t-number);
}
.highlight .nf,
.highlight .fm,
.highlight .nd {
  color: var(--t-func);
}
.highlight .nb,
.highlight .bp {
  color: var(--t-builtin);
}
.highlight .nt {
  color: var(--t-tag);
  font-weight: 600;
}
.highlight .na,
.highlight .nl {
  color: var(--t-attr);
}
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi {
  color: var(--t-func);
}
.highlight .o {
  color: var(--t-op);
}
.highlight .gd {
  display: inline-block;
  width: 100%;
  background: var(--t-del-bg);
}
.highlight .gi {
  display: inline-block;
  width: 100%;
  background: var(--t-ins-bg);
}
.highlight .gh,
.highlight .gu {
  color: var(--t-keyword);
  font-weight: 700;
}
.highlight .ge {
  font-style: italic;
}
.highlight .gs {
  font-weight: 700;
}
.highlight .err {
  color: inherit;
}

/* comment highlights in the text */
mark.cmt {
  background: var(--mark);
  color: inherit;
  border-bottom: 2px solid var(--brand);
  border-radius: 2px 2px 0 0;
  cursor: pointer;
}
mark.cmt.is-active {
  background: var(--mark-strong);
}

/* children cards, pager, footer */
.children {
  margin-top: 2.5rem;
}
.children-h {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.child-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s;
}
.child-card:hover {
  border-color: var(--brand);
  color: var(--ink);
}
.child-card:hover .child-title,
.pager-link:hover .pager-title {
  color: var(--brand-ink);
}
.child-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}
.child-desc {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.child-count {
  margin-top: auto;
  padding-top: 0.2rem;
  color: var(--faint);
  font-size: 0.76rem;
}
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 3.5rem;
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-decoration: none;
}
.pager-link:hover {
  border-color: var(--brand);
  color: var(--ink);
}
.pager-link.next {
  grid-column: 2;
  text-align: right;
}
.pager-dir {
  color: var(--muted);
  font-size: 0.78rem;
}
.pager-title {
  font-family: var(--font-display);
  font-weight: 600;
}
.doc-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}
.doc-foot > a:first-child {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

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

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}
.search-form input {
  font-size: 1.1rem;
  padding: 0.65rem 0.9rem;
}
.results {
  margin: 0;
  padding: 0;
  list-style: none;
}
.result {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.result-page {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  text-decoration: none;
}
.result-path {
  margin-left: 0.6rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.result-hits {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}
.result-hits a {
  display: block;
  padding: 0.35rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: var(--radius);
  color: var(--ink-2);
  text-decoration: none;
}
.result-hits a:hover {
  background: var(--sunken);
}
.result-section {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
}
.result-snippet {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.result-snippet mark,
.palette mark {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-radius: 2px;
  padding: 0 0.1em;
}
.empty {
  padding: 1.2rem 1.3rem;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-2);
}

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

.palette {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(36rem, calc(100vh - 6rem));
  margin: 10vh auto auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.palette::backdrop,
.dialog::backdrop {
  background: rgba(41, 31, 30, 0.45);
  backdrop-filter: blur(2px);
}
.palette-box {
  display: flex;
  flex-direction: column;
  max-height: min(36rem, calc(100vh - 6rem));
}
.palette-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}
.palette-input input {
  flex: 1;
  padding: 0.2rem 0;
  border: 0;
  background: none;
  font-size: 1.1rem;
  outline: none;
}
.palette-input input:focus {
  outline: none;
}
.palette-input input::-webkit-search-cancel-button {
  display: none;
}
.palette-results {
  flex: 1;
  margin: 0;
  padding: 0.4rem;
  overflow-y: auto;
  list-style: none;
}
.palette-results:empty {
  display: none;
}
.pal-group {
  padding: 0.55rem 0.6rem 0.25rem;
  color: var(--faint);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pal-item a,
.pal-item button {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.pal-item svg {
  margin-top: 0.15rem;
  color: var(--faint);
}
.pal-item[aria-selected="true"] a,
.pal-item[aria-selected="true"] button {
  background: var(--brand-soft);
}
.pal-item[aria-selected="true"] svg {
  color: var(--brand);
}
.pal-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pal-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.pal-title .pal-sec {
  color: var(--muted);
  font-weight: 500;
}
.pal-snippet {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pal-ask .pal-title {
  color: var(--brand-ink);
}
.pal-ask svg {
  color: var(--brand);
}
.pal-empty {
  padding: 1.2rem 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.palette-foot {
  display: flex;
  gap: 1.2rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.76rem;
}
.palette-foot .kbd {
  margin-right: 0.2rem;
}
.palette-release {
  margin-left: auto;
}

/* ---------------------------------------------------------------- dialogs */

.dialog {
  width: min(34rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.dialog-box {
  padding: 1.2rem 1.4rem 1.3rem;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.dialog-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}
.dialog-sub {
  margin: 0 0 1rem;
  color: var(--ink-2);
  font-size: 0.93rem;
}
.dialog-warn {
  margin: 0.4rem 0 0.4rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--c-warning);
  background: var(--c-warning-bg);
  font-size: 0.92rem;
}
.field {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}
.field legend {
  margin-bottom: 0.3rem;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.field-row {
  display: flex;
  gap: 0.8rem;
}
.field-row .field {
  flex: none;
}
.field-row .grow {
  flex: 1;
}
.share-result {
  margin: 0.2rem 0 1rem;
  padding: 0.8rem;
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.4rem;
}

/* ---------------------------------------------------------------- selection popover */

.sel-pop {
  position: absolute;
  z-index: 35;
  display: flex;
  padding: 0.2rem;
  border-radius: 6px;
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 8px));
}
.sel-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.sel-pop button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--bg);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sel-pop button:hover {
  background: color-mix(in srgb, var(--bg) 16%, transparent);
}
.sel-pop svg {
  width: 15px;
  height: 15px;
}

/* ---------------------------------------------------------------- comments panel */

.comments-panel {
  position: sticky;
  top: var(--topbar-h);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  background: var(--panel);
  border-left: 1px solid var(--rule);
}
.cp-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.7rem 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.cp-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}
.cp-filter {
  display: flex;
  margin-left: auto;
  padding: 0.15rem;
  border-radius: var(--radius);
  background: var(--sunken);
}
.cp-filter button {
  padding: 0.2rem 0.55rem;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.cp-filter [aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.cp-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem;
}
.cp-empty {
  padding: 1rem 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.thread {
  margin-bottom: 0.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  scroll-margin-top: 1rem;
}
.thread.is-active {
  border-color: var(--brand);
  box-shadow: var(--shadow-card);
}
.thread-quote {
  display: block;
  margin: 0 0 0.6rem;
  padding: 0.1rem 0 0.1rem 0.6rem;
  border-left: 3px solid var(--brand);
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-quote.is-outdated {
  border-left-color: var(--rule-strong);
  text-decoration: line-through;
  text-decoration-color: var(--faint);
  cursor: default;
}
.outdated-tag {
  display: inline-block;
  margin-bottom: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  background: var(--sunken);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.cmt + .cmt {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
}
.cmt-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.82rem;
}
.cmt-author {
  font-weight: 700;
  color: var(--ink);
}
.cmt-time {
  color: var(--faint);
}
.cmt-src {
  padding: 0 0.35rem;
  border-radius: 3px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.7rem;
  font-weight: 700;
}
.cmt-body {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.cmt-body p {
  margin: 0 0 0.5em;
}
.cmt-body > :last-child {
  margin-bottom: 0;
}
.cmt-body pre {
  padding: 0.5rem;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--code-bg);
  font-size: 0.8rem;
}
.cmt-body code {
  font-size: 0.85em;
}
.cmt-deleted {
  color: var(--faint);
  font-style: italic;
  font-size: 0.86rem;
}
.cmt-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
}
.cmt-actions button,
.thread-actions button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.cmt-actions button:hover,
.thread-actions button:hover {
  color: var(--brand-ink);
}
.thread-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 0.6rem;
}
.reply-form,
.edit-form {
  margin-top: 0.6rem;
}
.reply-form textarea,
.edit-form textarea {
  font-size: 0.88rem;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.cp-new {
  padding: 0.8rem;
  border-top: 1px solid var(--rule);
  background: var(--panel);
}
.cp-new-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.45rem;
}
.cp-quote {
  margin: 0 0 0.5rem;
  padding: 0.1rem 0 0.1rem 0.6rem;
  border-left: 3px solid var(--brand);
  color: var(--ink-2);
  font-size: 0.84rem;
}

/* ---------------------------------------------------------------- chat drawer */

.chat {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(30rem, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--rule);
  box-shadow: var(--shadow-lg);
  animation: drawer-in 0.18s ease-out;
}
@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: var(--topbar-h);
  padding: 0 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.chat-title {
  flex: 1;
  margin: 0 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}
.chat-history {
  max-height: 45%;
  overflow-y: auto;
  padding: 0.6rem;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}
.chat-history-h {
  margin: 0.2rem 0.4rem 0.4rem;
  color: var(--faint);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chat-history ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.chat-history li {
  display: flex;
  align-items: center;
}
.chat-history li button.conv {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-history li button.conv:hover,
.chat-history li.is-current button.conv {
  background: var(--sunken);
}
.chat-history .conv-time {
  color: var(--faint);
  font-size: 0.75rem;
  margin-left: 0.4rem;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.5rem;
}
.chat-empty {
  color: var(--ink-2);
  font-size: 0.92rem;
}
.chat-empty-h {
  margin: 0.4rem 0 0.4rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.chat-examples {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.chat-examples button {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: left;
  font-size: 0.88rem;
  cursor: pointer;
}
.chat-examples button:hover {
  border-color: var(--brand);
}
.msg-user {
  margin: 1rem 0 0.8rem auto;
  max-width: 88%;
  width: fit-content;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-lg) var(--radius-lg) 2px var(--radius-lg);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.93rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-user .msg-ctx {
  display: block;
  margin-bottom: 0.3rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--brand);
  color: var(--muted);
  font-size: 0.8rem;
  white-space: normal;
}
.msg-bot {
  margin: 0 0 1.2rem;
}
.msg-bot .prose {
  font-size: 0.94rem;
  line-height: 1.6;
}
.msg-bot .prose h1,
.msg-bot .prose h2,
.msg-bot .prose h3 {
  margin: 1.1em 0 0.4em;
  padding: 0;
  border: 0;
  font-size: 1.02rem;
}
.msg-bot .prose pre {
  font-size: 0.8rem;
}
.msg-bot.is-streaming .prose > :last-child::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: -0.12em;
  background: var(--brand);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.msg-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}
.msg-tools li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.76rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-tools li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--c-tip);
  flex: none;
}
.msg-tools li.is-running::before {
  background: var(--brand);
  animation: blink 0.8s steps(2) infinite;
}
.msg-error {
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--c-caution);
  background: var(--c-caution-bg);
  color: var(--c-caution);
  font-size: 0.88rem;
}
.chat-form {
  padding: 0.7rem 0.8rem 0.8rem;
  border-top: 1px solid var(--rule);
  background: var(--surface);
}
.chat-context {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  padding: 0.3rem 0.3rem 0.3rem 0.6rem;
  border-left: 3px solid var(--brand);
  background: var(--panel);
  font-size: 0.8rem;
}
.ctx-label {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.ctx-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-form textarea {
  max-height: 12rem;
}
.chat-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

/* ---------------------------------------------------------------- auth pages */

.layout-auth {
  min-height: 100vh;
  background: var(--panel);
}
/* sign-in: the pixel-robotics.eu hero (Pixel PT in a rack aisle) next to a plain white panel */
.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(26rem, 1fr);
  min-height: 100vh;
}
.auth-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 3rem 3rem;
  overflow: hidden;
  background: #363636 url("../img/login-hero.webp") 30% 50% / cover no-repeat;
  color: #fff;
}
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(41, 31, 30, 0.45) 0%,
    rgba(41, 31, 30, 0.1) 38%,
    rgba(41, 31, 30, 0.85) 100%
  );
}
.auth-hero > * {
  position: relative;
}
.auth-hero-logo {
  display: block;
  align-self: flex-start;
  width: auto;
  height: 40px;
}
.auth-hero-line {
  max-width: 30rem;
  margin: 0;
  font-size: clamp(1.25rem, 0.9rem + 1vw, 1.6rem);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 3rem 2rem;
  background: var(--surface);
}
.auth-card {
  width: min(24rem, 100%);
}
.auth-site {
  margin: 0 0 2.2rem;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
/* two-tone name, like "PIXEL PT" on pixel-robotics.eu */
.auth-site span {
  color: var(--brand);
}
.auth-h {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.btn-google {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}
.btn-google svg {
  width: 20px;
  height: 20px;
  stroke: none;
}
.auth-hint {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.4rem 0 1rem;
  color: var(--faint);
  font-size: 0.78rem;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}
.auth-form {
  margin: 0;
}
.auth-card .msg {
  margin: 0 0 1rem;
}
/* standalone card: share-link errors for external viewers */
.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}
.auth > .auth-card {
  width: min(28rem, 100%);
  padding: 1.8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.auth-card-logo {
  margin-bottom: 1.4rem;
}

/* ---------------------------------------------------------------- settings */

.settings {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 5rem;
}
.settings-head {
  margin-bottom: 2rem;
}
.panel {
  margin-bottom: 2rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}
.panel-sub {
  max-width: 44rem;
  margin: 0.35rem 0 1.1rem;
  color: var(--ink-2);
  font-size: 0.93rem;
}
.panel-sub code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
  background: var(--sunken);
  font-size: 0.86em;
}
.token-form {
  max-width: 34rem;
  margin-bottom: 1.2rem;
}
.token-created {
  margin-bottom: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--c-tip);
  border-radius: var(--radius-lg);
}
.token-created .msg {
  margin: 0 0 0.6rem;
}
.snippets {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}
.snippet {
  position: relative;
}
.snippet-h {
  margin: 0 0 0.3rem;
  font-size: 0.84rem;
  font-weight: 600;
}
.snippet pre {
  margin: 0;
  padding: 0.7rem 0.8rem;
  padding-right: 4.5rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--code-bg);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}
.snippet .btn {
  position: absolute;
  top: 1.7rem;
  right: 0.4rem;
}
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--rule-strong);
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.data-table tr.is-inactive td {
  color: var(--faint);
}
.data-table code {
  font-size: 0.82rem;
}
.data-table td:last-child {
  text-align: right;
  white-space: nowrap;
}
.status {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius);
  background: var(--sunken);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.admin-toggle {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- share viewer */

.share-badge {
  margin-left: auto;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar-share .topbar-actions {
  margin-left: 0;
}

/* ---------------------------------------------------------------- lightbox, toast */

.lightbox {
  max-width: 96vw;
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
}
.lightbox::backdrop {
  background: rgba(27, 24, 23, 0.88);
}
.lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 94vh;
  border-radius: var(--radius);
  cursor: zoom-out;
  background: #fff;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 80;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

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

@media (max-width: 1240px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .shell-single {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
  .shell.comments-open {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .comments-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    z-index: 25;
    width: min(var(--panel-w), 100vw);
    height: auto;
    box-shadow: var(--shadow-lg);
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-h: 3.5rem;
  }
  .shell,
  .layout-wide .shell,
  .shell.comments-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .nav-toggle {
    display: inline-grid;
    margin-left: -0.4rem;
  }
  .nav-close {
    display: inline-grid;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(20rem, 86vw);
    height: auto;
    transform: translateX(-102%);
    visibility: hidden;
    transition:
      transform 0.2s ease,
      visibility 0.2s;
  }
  body.nav-open .sidebar {
    transform: none;
    visibility: visible;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(41, 31, 30, 0.45);
  }
  .main {
    padding: 1.5rem 1rem 4rem;
  }
  .topbar {
    gap: 0.5rem;
    padding: 0 0.75rem;
  }
  .topbar .brand-logos {
    display: none;
  }
  .topbar .brand-mark {
    display: block;
    width: 24px;
    height: 24px;
  }
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  /* keep the pixel, drop the word; the name gives way first when the bar is full */
  .release-switch {
    min-width: 0;
  }
  .release-btn {
    max-width: 100%;
    padding-left: 0.55rem;
  }
  .release-zone {
    gap: 0;
    padding-right: 0.45rem;
    font-size: 0;
  }
  .release-name {
    min-width: 0;
    max-width: 7.5rem;
  }
  /* space and release switchers side by side: the chevron gives way to the names */
  .space-switch ~ .release-switch .chev,
  .space-switch .chev {
    display: none;
  }
  .space-switch ~ .release-switch .release-btn,
  .space-switch .release-btn {
    padding: 0 0.4rem;
  }
  .space-switch ~ .release-switch .release-zone,
  .space-switch .release-zone {
    padding-right: 0.35rem;
  }
  .avatar {
    width: 2rem;
    height: 2rem;
  }
  .search-trigger {
    flex: 0 0 auto;
    width: 2.25rem;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: none;
  }
  .search-trigger .search-placeholder,
  .search-trigger .kbd {
    display: none;
  }
  .ask-btn span {
    display: none;
  }
  .ask-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    justify-content: center;
  }
  .meta-actions {
    margin-left: 0;
  }
  .prose h2 {
    font-size: 1.4rem;
  }
  .loc-zone,
  .loc-seg,
  .loc-tag {
    max-width: 11rem;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-link.next {
    grid-column: 1;
  }
  .field-row {
    flex-direction: column;
    gap: 0;
  }
  .settings {
    padding: 1.5rem 1rem 4rem;
  }
  .panel {
    padding: 1.1rem 1rem;
  }
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    display: none;
  }
  .palette {
    margin-top: 1rem;
  }
  /* iOS zooms into inputs with text smaller than 16px */
  input[type="text"],
  input[type="email"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
  }
}

@media (max-width: 760px) {
  .auth-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .auth-hero {
    min-height: 13rem;
    padding: 1.25rem 1rem;
  }
  .auth-hero-logo {
    height: 30px;
  }
  .auth-hero-line {
    font-size: 1.1rem;
  }
  .auth-panel {
    place-items: start center;
    padding: 2rem 1rem 3rem;
  }
  .auth-site {
    margin-bottom: 1.6rem;
    font-size: 1.8rem;
  }
}

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

/* ---------------------------------------------------------------- print */

@page {
  margin: 16mm 15mm 18mm;
}

@media print {
  :root {
    --bg: #fff;
    --ink: #000;
    --ink-2: #222;
    --muted: #444;
    --rule: #ccc;
    --code-bg: #f6f6f6;
    --panel: #f3f3f3;
  }
  body {
    background: #fff;
    font-size: 10.5pt;
  }
  .topbar,
  .sidebar,
  .rail,
  .comments-panel,
  .chat,
  .sel-pop,
  .meta-actions,
  .pager,
  .doc-foot,
  .children,
  .heading-anchor,
  .copy-code,
  .skip-link,
  .toast,
  .notice,
  .scrim,
  dialog {
    display: none !important;
  }
  .shell,
  .shell-single {
    display: block;
  }
  .main {
    padding: 0;
  }
  .doc {
    max-width: none;
  }
  .loc-zone {
    border-color: #000;
    color: #000;
  }
  .doc-title {
    font-size: 22pt;
  }
  .prose {
    font-size: 10.5pt;
    line-height: 1.5;
  }
  .prose h2 {
    break-after: avoid;
    font-size: 15pt;
  }
  .prose h3,
  .prose h4 {
    break-after: avoid;
  }
  .prose pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 8.5pt;
  }
  .prose .highlight,
  .prose table,
  .prose img,
  .callout {
    break-inside: avoid;
  }
  .prose .table-wrap {
    overflow: visible;
  }
  mark.cmt {
    background: none;
    border: 0;
  }
  .prose .highlight[data-lang]::before {
    display: none;
  }
  a {
    color: #000;
  }
}
