/* Generated by the docs build from @minket/brand (src/tokens.ts). Edit the brand, not this block. */
@font-face {
  font-family: "Archivo Variable";
  src: url(/assets/fonts/archivo-latin-wdth.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Intel One Mono";
  src: url(/assets/fonts/intel-one-mono-latin-400.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Intel One Mono";
  src: url(/assets/fonts/intel-one-mono-latin-600.woff2) format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
:root {
  --background: #ffffff;
  --foreground: #10172f;
  --card: #ffffff;
  --card-foreground: #10172f;
  --popover: #ffffff;
  --popover-foreground: #10172f;
  --primary: #2541c4;
  --primary-foreground: #ffffff;
  --secondary: #f0f2f8;
  --secondary-foreground: #10172f;
  --muted: #f0f2f8;
  --muted-foreground: #4d5671;
  --accent: #e9edf9;
  --accent-foreground: #10172f;
  --destructive: #b3261e;
  --destructive-foreground: #ffffff;
  --success: #126b40;
  --warning: #8a5300;
  --border: #dce1ec;
  --input: #7a849d;
  --ring: #2541c4;
  --sidebar: #ffffff;
  --sidebar-foreground: #10172f;
  --sidebar-primary: #2541c4;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #eef1fa;
  --sidebar-accent-foreground: #10172f;
  --sidebar-border: #dce1ec;
  --sidebar-ring: #2541c4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0b1023;
    --foreground: #e7eaf5;
    --card: #11172e;
    --card-foreground: #e7eaf5;
    --popover: #11172e;
    --popover-foreground: #e7eaf5;
    --primary: #a3b4ff;
    --primary-foreground: #0b1023;
    --secondary: #182039;
    --secondary-foreground: #e7eaf5;
    --muted: #182039;
    --muted-foreground: #a5adc6;
    --accent: #1f2847;
    --accent-foreground: #e7eaf5;
    --destructive: #ff8a7f;
    --destructive-foreground: #0b1023;
    --success: #5fd29a;
    --warning: #f0c05a;
    --border: #252e4f;
    --input: #7b86a6;
    --ring: #a3b4ff;
    --sidebar: #0b1023;
    --sidebar-foreground: #e7eaf5;
    --sidebar-primary: #a3b4ff;
    --sidebar-primary-foreground: #0b1023;
    --sidebar-accent: #182039;
    --sidebar-accent-foreground: #ffffff;
    --sidebar-border: #252e4f;
    --sidebar-ring: #a3b4ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: #0b1023;
  --foreground: #e7eaf5;
  --card: #11172e;
  --card-foreground: #e7eaf5;
  --popover: #11172e;
  --popover-foreground: #e7eaf5;
  --primary: #a3b4ff;
  --primary-foreground: #0b1023;
  --secondary: #182039;
  --secondary-foreground: #e7eaf5;
  --muted: #182039;
  --muted-foreground: #a5adc6;
  --accent: #1f2847;
  --accent-foreground: #e7eaf5;
  --destructive: #ff8a7f;
  --destructive-foreground: #0b1023;
  --success: #5fd29a;
  --warning: #f0c05a;
  --border: #252e4f;
  --input: #7b86a6;
  --ring: #a3b4ff;
  --sidebar: #0b1023;
  --sidebar-foreground: #e7eaf5;
  --sidebar-primary: #a3b4ff;
  --sidebar-primary-foreground: #0b1023;
  --sidebar-accent: #182039;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #252e4f;
  --sidebar-ring: #a3b4ff;
  color-scheme: dark;
}
:root {
  --seal-ink: color-mix(in oklab, var(--primary) 82%, var(--background));
  --seal-faint: color-mix(in oklab, var(--foreground) 34%, var(--background));
  --seal-alarm: var(--destructive);
  --tint-ink: color-mix(in oklab, var(--primary) 30%, var(--background));
  --thread: color-mix(in oklab, var(--primary) 62%, var(--background));
  --rule-strong: var(--foreground);
  --overlay: rgb(11 16 35 / 0.42);
  --overlay-shadow: rgb(11 16 35 / 0.32);
  --font-sans: "Archivo Variable", "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Archivo Variable", "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Intel One Mono", ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  --display-stretch: 125%;
  --display-weight: 580;
  --heading-stretch: 125%;
  --heading-weight: 600;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 12px;
  --ease-out-quiet: cubic-bezier(0.2, 0, 0, 1);
}

/*
 * Minket docs in Proof (docs/design/direction.md §4 to §9), part 1 of 9: the base. The build
 * puts the colour tokens, derived inks and font faces first (generated from src/tokens.ts), then
 * the partials in the order of STYLESHEETS in src/assets.ts. Each partial only names tokens;
 * within each, specificity only rises, and every hover or current state lives in states.css,
 * after everything it overrides.
 */

:root {
  --header-h: 60px;
  --nav-w: 252px;
  --toc-w: 220px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Reserve the scrollbar's width on every page, so nothing shifts when a page starts or stops scrolling. */
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-stretch: 100%;
  font-size: 16px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in oklab, var(--primary) 24%, var(--background));
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

main:focus {
  outline: none;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
}

strong {
  font-weight: 600;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 18px;
  text-align: center;
  color: var(--muted-foreground);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 40;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--primary);
}

.skip-link:focus {
  top: 10px;
}

/* The drawn icon set: a 20 px grid, a 1.5 px stroke, round caps, no fills, beside a word. */
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}

@keyframes sheet-in {
  from {
    transform: translateX(-100%);
  }
}

/* Part 2 of 9: type. Titles, the lede, section heads, lists and notes. */

.page-header {
  margin-bottom: 28px;
}

article h1,
.reference-intro h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-weight: var(--display-weight);
  font-size: clamp(32px, 3.2vw, 42px);
  letter-spacing: -0.018em;
  line-height: 1.12;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 64ch;
  color: var(--muted-foreground);
  font-size: 19px;
  line-height: 1.55;
}

/* A jump to a section lands it 24 px under the masthead: the root's scroll-padding-top sets
   that offset once, so headings add no scroll margin of their own (the two would add up, and
   "On this page" would still show the section before). */
article h2,
article h3,
article h4 {
  text-wrap: balance;
}

/* Section heads: the wide face, heavier, under a carbon rule. */
article h2 {
  margin: 52px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-strong);
  font-family: var(--font-display);
  font-stretch: var(--heading-stretch);
  font-weight: var(--heading-weight);
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

article h3 {
  margin: 34px 0 10px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

article h4 {
  margin: 24px 0 8px;
  font-size: 16px;
  font-weight: 600;
}

article p,
article ul,
article ol {
  margin: 0 0 16px;
}

article ul,
article ol {
  padding-left: 24px;
}

article li {
  margin: 4px 0;
}

article li > ul,
article li > ol {
  margin: 4px 0 0;
}

blockquote {
  margin: 0 0 20px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--thread);
}

blockquote > :last-child {
  margin-bottom: 0;
}

/* Part 3 of 9: code. Inline code, code blocks and code tabs. */

/* Code: blocks are boxes, because a block of code is an object you copy whole. */

pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: color-mix(in oklab, var(--muted) 55%, var(--background));
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

:not(pre) > code {
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

article h2 code,
article h3 code {
  font-size: 0.82em;
}

.endpoint code {
  padding: 0;
  background: none;
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.tok-c {
  color: var(--muted-foreground);
}

figure.code,
.code-tabs {
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--background);
}

figure.code figcaption,
.code-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 4px 6px 4px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 12.5px;
}

.code-lang {
  font-weight: 500;
}

.copy {
  min-height: 30px;
  padding: 4px 11px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out-quiet);
}

.code-tabs figure.code {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.code-tabs .code-tabs-bar {
  align-items: stretch;
  padding: 0 6px 0 4px;
}

.code-tabs-bar .copy {
  align-self: center;
}

.code-tabs [role="tablist"] {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.code-tabs [role="tab"] {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms var(--ease-out-quiet);
}

/* The selected word is bolder; this reserves its bold width so the row never shifts. */
.code-tabs [role="tab"]::after {
  content: attr(data-tab);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 600;
}

/* Part 4 of 9: tables as ledgers, indexes, the page meta line, the API reference, the 404 mark. */

/* Tables are ledgers: ruled rows, a carbon rule under the heads, no box. */

.table {
  margin: 0 0 24px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}

th {
  padding: 6px 12px 7px;
  border-bottom: 1px solid var(--rule-strong);
  color: var(--muted-foreground);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
}

/* `break-word`, not `anywhere`: a cell's words keep their width when the table sizes its
   columns, and only a word longer than its column breaks. */
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

/* Code in a cell keeps its width when the columns are sized, so short code (a field, a type)
   never breaks; a long value breaks only at the seams where the build put a <wbr> (after a
   dot, a slash, an equals sign), and only past its column as the last resort. */
td code {
  overflow-wrap: break-word;
}

.generated.errors td:nth-child(5),
.generated.limits td:nth-child(3) {
  min-width: 24ch;
}

/* Indexes: the guides on the home page, the groups of the API reference. */

.index,
.cards {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}

.index li,
.cards li {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 2px 24px;
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.index a,
.cards a {
  font-weight: 600;
  text-decoration: none;
  line-height: 1.45;
}

.index p,
.cards p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 14.5px;
  line-height: 1.5;
}

.layout-landing article h3 {
  margin-top: 30px;
}

.page-meta {
  margin: 44px 0 0;
  color: var(--muted-foreground);
  font-size: 13.5px;
}

/* The API reference */

.reference {
  max-width: 100ch;
}

.operation {
  margin-top: 8px;
}

.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.method {
  padding: 0 7px;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 22px;
}

.op-meta {
  color: var(--muted-foreground);
  font-size: 14.5px;
}

.reference-intro {
  max-width: 76ch;
  padding: 32px 24px 8px;
}

.reference-fallback {
  padding: 16px 24px;
}

/* The 404 page: the seal mark, the one place the brand stands on its own in the docs. */

/* @minket/brand's seal mark through an external <use>, 112 px by its attributes: the bands in
   --seal-ink, the m in the text colour. */
.not-found .mark {
  display: block;
  margin: 8px 0 28px;
  color: var(--foreground);
}

@media (forced-colors: active) {
  .not-found .mark {
    color: CanvasText;
    --seal-ink: CanvasText;
  }
}

/* Part 5 of 9: the masthead. The wordmark and "Docs", the links, search, theme, the thread. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--background);
}

/* The security thread: hard-stop dashes, never a gradient, one per surface. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--thread) 0 12px, transparent 12px 18px);
}

.masthead {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--foreground);
  text-decoration: none;
}

.brand .brand-mark {
  display: block;
  flex: none;
}

.brand .wordmark {
  display: block;
  height: 18px;
  width: auto;
}

.brand-section {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-family: var(--font-display);
  font-stretch: var(--heading-stretch);
  font-weight: var(--heading-weight);
  font-size: 15px;
  line-height: 20px;
}

.site-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.site-links a {
  padding: 6px 0;
  color: var(--foreground);
  font-size: 15px;
  text-decoration: none;
}

.masthead-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  min-height: 36px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--muted-foreground);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out-quiet);
}

.search-label {
  flex: 1;
  text-align: left;
}

.theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 28px;
  min-height: 28px;
  padding: 2px 9px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition:
    background-color 150ms var(--ease-out-quiet),
    color 150ms var(--ease-out-quiet);
}

.theme-switch button .icon {
  display: none;
  width: 16px;
  height: 16px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  cursor: pointer;
}

/* Part 6 of 9: the columns (guides by job, the article, "On this page"), pager and footer. */

/* Three columns: the guides by job, the article, "On this page". */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  gap: 0 48px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.layout.has-toc {
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--toc-w);
}

main {
  min-width: 0;
  padding: 40px 0 72px;
}

article {
  max-width: 76ch;
}

.layout-reference {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
  padding: 0;
}

.layout-reference main {
  padding: 0;
}

.site-nav {
  position: sticky;
  top: calc(var(--header-h) + 2px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 2px);
  overflow-y: auto;
  padding: 30px 8px 48px 0;
  font-size: 14.5px;
  scrollbar-width: thin;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-label {
  margin: 0 0 4px;
  padding-left: 10px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  font-weight: 500;
}

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

.site-nav a {
  position: relative;
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out-quiet);
}

/* "On this page": the article's sections as a chain of knots. Sections already read are held
   (filled), the one in view is the larger knot, the rest are hollow, still ahead. */

.toc {
  position: sticky;
  top: calc(var(--header-h) + 2px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 2px);
  overflow-y: auto;
  /* The section in view is a larger knot that reaches 2px left of the chain; a scroll
     container clips anything past its edge. */
  padding: 44px 0 40px 4px;
  font-size: 14px;
  scrollbar-width: thin;
}

.toc h2 {
  margin: 0 0 10px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}

.toc ol {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc ol::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: 12px;
  border-left: 1.5px dotted var(--thread);
}

.toc li {
  position: relative;
  margin: 0;
}

.toc a {
  position: relative;
  display: block;
  padding: 4px 0 4px 22px;
  color: var(--muted-foreground);
  line-height: 1.4;
  text-decoration: none;
  transition: color 150ms var(--ease-out-quiet);
}

.toc-3 > a {
  padding-left: 34px;
  font-size: 13.5px;
}

.toc a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--seal-ink);
  border-radius: 50%;
  background: var(--background);
  transition: background-color 120ms var(--ease-out-quiet);
}

.toc-3 > a::before {
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-width: 1.25px;
}

/* The pager and the footer */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 76ch;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.pager a {
  display: grid;
  gap: 2px;
  color: var(--foreground);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.pager a span {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 400;
}

.pager-next {
  text-align: right;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 28px;
  color: var(--muted-foreground);
  font-size: 13.5px;
  line-height: 1.55;
}

.footer-inner p {
  margin: 0;
  max-width: 72ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--muted-foreground);
}

/* Part 7 of 9: search, a dialog over the page with the results as a list of sections. */

.search-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 96px));
  margin: 72px auto auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--popover);
  color: var(--popover-foreground);
  box-shadow: 0 18px 40px -16px var(--overlay-shadow);
}

.search-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialog-in 150ms var(--ease-out-quiet);
}

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

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
}

.search-field:focus-within {
  box-shadow: inset 0 -2px 0 var(--ring);
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.search-field input::placeholder {
  color: var(--muted-foreground);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-close {
  min-height: 30px;
  padding: 2px 6px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.search-results {
  flex: 1;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.search-results:empty {
  display: none;
}

.search-results [role="option"] {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.search-results [role="option"][aria-selected="true"] {
  background: var(--accent);
  box-shadow: inset 2px 0 0 var(--primary);
}

.result-title {
  color: var(--foreground);
  font-weight: 600;
  line-height: 1.4;
}

.result-page,
.result-text {
  color: var(--muted-foreground);
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.search-results mark {
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--primary) 18%, var(--background));
  color: inherit;
}

.search-status {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 12.5px;
}

/*
 * Part 8 of 9: states. Hover, the current page and section, pressed and selected controls,
 * after every rule they override, ordered by rising specificity. Then what hides when the page
 * runs without JavaScript.
 */

.copy:hover,
.search-close:hover {
  background: var(--accent);
}

.search-button:hover {
  border-color: var(--foreground);
}

.code-tabs [role="tab"]:hover {
  color: var(--foreground);
}

.code-tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--primary);
  color: var(--foreground);
  font-weight: 600;
}

.code-tabs [role="tab"]:focus-visible {
  outline-offset: -2px;
}

.site-links a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

.site-nav a:hover,
.theme-switch button:hover,
.toc a:hover,
.pager a:hover,
.footer-links a:hover,
.index a:hover,
.cards a:hover {
  color: var(--foreground);
}

.site-nav a:hover {
  background: var(--accent);
}

.pager a:hover {
  color: var(--primary);
}

.index a:hover,
.cards a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.site-links a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.theme-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--foreground);
}

.site-nav a[aria-current="page"] {
  background: var(--accent);
  font-weight: 600;
}

.toc a[aria-current="location"] {
  color: var(--foreground);
  font-weight: 600;
}

.held > a::before {
  background: var(--seal-ink);
}

.site-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--primary);
}

.toc a[aria-current="location"]::before {
  left: -2px;
  top: 7px;
  width: 14px;
  height: 14px;
  background: var(--seal-ink);
}

.toc-3 > a[aria-current="location"]::before {
  left: 0;
  top: 9px;
  width: 10px;
  height: 10px;
}

/* Without JavaScript: the controls that need it stay out, and every code example shows, one
   under the other, with its own label. With it, a tab group shows one panel at a time. */

.js .code-tabs figure.code figcaption {
  display: none;
}

html:not(.js) .search-button,
html:not(.js) .theme-switch,
html:not(.js) .menu-toggle,
html:not(.js) .copy,
html:not(.js) .code-tabs-bar {
  display: none;
}

html:not(.js) .code-tabs [role="tabpanel"][hidden] {
  display: block;
}

html:not(.js) .code-tabs [role="tabpanel"] + [role="tabpanel"] {
  border-top: 1px solid var(--border);
}

/*
 * Part 9 of 9: narrower screens, print and reduced motion. Below 1180 px "On this page" goes;
 * below 860 px the guides move behind Menu as a sheet from the left edge, and the masthead's
 * controls keep their words for screen readers but show only their icons.
 */

@media (max-width: 1180px) {
  :root {
    --nav-w: 232px;
  }

  .layout.has-toc {
    grid-template-columns: var(--nav-w) minmax(0, 1fr);
  }

  .toc {
    display: none;
  }

  .search-button {
    min-width: 180px;
  }
}

@media (max-width: 860px) {
  .masthead {
    gap: 8px;
    padding: 0 12px 0 16px;
  }

  .site-links {
    display: none;
  }

  .masthead-tools {
    gap: 6px;
    margin-left: auto;
  }

  .search-button {
    justify-content: center;
    min-width: 36px;
    padding: 0 8px;
    border-color: var(--border);
    color: var(--foreground);
  }

  .search-key {
    display: none;
  }

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

  .theme-switch button {
    padding: 2px 5px;
  }

  /* Icons only on a phone; the words stay for screen readers and as the buttons' names. */
  .search-button .label,
  .theme-switch .label,
  .menu-toggle .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .theme-switch button .icon {
    display: block;
  }

  .layout,
  .layout.has-toc {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 16px;
  }

  main {
    padding: 28px 0 56px;
  }

  .site-nav {
    position: static;
    max-height: none;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
  }

  .js .site-nav {
    display: none;
  }

  .js.nav-open .site-nav {
    position: fixed;
    top: calc(var(--header-h) + 2px);
    left: 0;
    bottom: 0;
    z-index: 15;
    display: block;
    width: min(340px, 88vw);
    padding: 20px 16px 40px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    background: var(--background);
    overflow-y: auto;
    animation: sheet-in 200ms var(--ease-out-quiet);
  }

  .nav-scrim {
    position: fixed;
    inset: calc(var(--header-h) + 2px) 0 0;
    z-index: 14;
    background: var(--overlay);
  }

  .lede {
    font-size: 18px;
  }

  article h2 {
    margin-top: 44px;
    font-size: 22px;
  }

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

  .pager-next {
    text-align: left;
  }

  .footer-inner {
    padding: 20px 16px 28px;
  }
}

@media (max-width: 640px) {
  .brand {
    gap: 10px;
  }

  .brand-section {
    padding-left: 10px;
  }

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

@media print {
  .site-header,
  .site-nav,
  .toc,
  .pager,
  .site-footer,
  .copy,
  .code-tabs-bar {
    display: none;
  }

  .layout {
    display: block;
  }

  .code-tabs [role="tabpanel"][hidden] {
    display: block;
  }
}

/* Reduced motion wins over every animation, so these are the one place for !important. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: must beat every animation rule */
    animation-duration: 0.01ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: must beat every animation rule */
    animation-iteration-count: 1 !important;
    /* biome-ignore lint/complexity/noImportantStyles: must beat every animation rule */
    transition-duration: 0.01ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: must beat every animation rule */
    scroll-behavior: auto !important;
  }
}
