/* TapSift docs: a calm reading surface on the shared sky. Tokens come from base.css; Night is
   html[data-theme="dark"], scoped below as [data-theme="dark"] .x. Motion is gated on .motion. */

/* ------------------------------------------------------------------ layout */
.docs-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 13.5rem;
  grid-template-areas: "side main toc";
  gap: clamp(1.75rem, 3vw, 3rem);
  width: min(1380px, calc(100% - 48px));
  padding-block: 2.25rem 4.5rem;
}
.docs-sidebar { grid-area: side; }
.docs-main { grid-area: main; min-width: 0; }
.docs-layout > .docs-toc { grid-area: toc; }
.docs-mobilebar { grid-area: bar; display: none; }
.docs-sidebar, .docs-layout > .docs-toc {
  position: sticky;
  top: calc(var(--header-h) + 1.75rem);
  align-self: start;
  max-height: calc(100dvh - var(--header-h) - 3.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: top .45s var(--ease), max-height .45s var(--ease);
}
body:has(.site-header.is-hidden) :is(.docs-sidebar, .docs-layout > .docs-toc) {
  top: 1.75rem;
  max-height: calc(100dvh - 3.5rem);
}

/* Reading progress: a hairline under the glass header, shown only when motion is allowed. */
.read-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 41;
  height: 2px;
  pointer-events: none;
  display: none;
  transition: transform .45s var(--ease);
}
.motion .read-progress { display: block; }
.read-progress span {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--term-accent), var(--signal));
  box-shadow: 0 0 10px color-mix(in srgb, var(--signal) 45%, transparent);
}
body:has(.site-header.is-hidden) .read-progress { transform: translateY(calc(-1 * var(--header-h))); }
.docs-home .read-progress { display: none; }

/* ------------------------------------------------------------------ sidebar */
.docs-nav { padding: 3px 3px 1.5rem; font-size: .9rem; }
.docs-section {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 1.6rem 0 .45rem;
  padding-inline: .75rem;
  color: var(--muted);
  font: 600 .68rem/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.docs-section::before {
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  opacity: .55;
}
.docs-nav .docs-section:first-child { margin-top: .25rem; }
.docs-nav ul, .docs-toc ul { margin: 0; padding: 0; list-style: none; }
.docs-nav li + li { margin-top: 1px; }
.docs-nav a {
  position: relative;
  display: block;
  padding: .38rem .75rem .38rem 1.55rem;
  border-radius: 9px;
  color: var(--muted);
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.docs-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.docs-nav a:focus-visible { outline-offset: -2px; }
.docs-nav [aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow-soft);
}
.docs-nav [aria-current="page"]::before {
  content: "";
  position: absolute;
  left: .72rem;
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  background: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 16%, transparent);
}

/* ------------------------------------------------------------------ on-page menu */
.docs-toc { font-size: .84rem; }
.docs-toc p {
  margin: .25rem 0 .75rem;
  color: var(--muted);
  font: 600 .68rem/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.docs-toc ul { position: relative; border-inline-start: 1px solid var(--border); }
.docs-toc ul::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: var(--marker-h, 0);
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transform: translateY(var(--marker-y, 0));
}
.docs-toc ul.has-marker::before { opacity: 1; }
.motion .docs-toc ul::before { transition: transform .35s var(--ease), height .35s var(--ease), opacity .3s; }
.docs-toc a {
  display: block;
  padding: .3rem .9rem;
  color: var(--muted);
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s;
}
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-active { color: var(--text); }
.docs-toc a:focus-visible { outline-offset: -2px; }
.docs-toc .toc-h3 a { padding-inline-start: 1.65rem; font-size: .95em; }

/* ------------------------------------------------------------------ reading surface */
.doc-paper {
  position: relative;
  padding: clamp(1.4rem, 4vw, 3.5rem) clamp(1.25rem, 4.6vw, 4rem) clamp(1.75rem, 4vw, 3.25rem);
  border-radius: calc(var(--radius) + 8px);
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow-soft);
  -webkit-backdrop-filter: saturate(1.3) blur(20px);
  backdrop-filter: saturate(1.3) blur(20px);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
}
.doc-paper > :last-child { margin-bottom: 0; }
[data-theme="dark"] .doc-paper {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 88%, transparent), var(--glass-strong) 40%);
  box-shadow: inset 0 0 0 1px var(--glass-line), inset 0 1px 0 color-mix(in srgb, var(--signal) 22%, transparent), var(--shadow-soft);
}
.doc-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1.4rem;
  color: var(--muted);
  font: 500 .72rem/1.4 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.doc-crumbs a { color: var(--muted); text-decoration: none; }
.doc-crumbs a:hover { color: var(--accent); }
.doc-crumbs span:last-child { color: var(--accent); }

.doc-head h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4.3vw, 3.35rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.042em;
  text-wrap: balance;
}
.doc-paper .doc-lead {
  max-width: 38em;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.5vw, 1.22rem);
  line-height: 1.55;
  letter-spacing: -.008em;
  text-wrap: pretty;
}
.motion .doc-head > * { animation: doc-rise .9s var(--ease) both; }
.motion .doc-head > :nth-child(2) { animation-delay: .08s; }
.motion .doc-head > :nth-child(3) { animation-delay: .16s; }
@keyframes doc-rise { from { opacity: 0; transform: translateY(10px); } }
.doc-sieve { height: 36px; margin: 1.1rem 0 1.4rem; --dash: var(--muted); }
.doc-sieve::before { -webkit-mask: linear-gradient(90deg, #000, #000 60%, transparent); mask: linear-gradient(90deg, #000, #000 60%, transparent); }
.doc-sieve i:nth-child(1) { left: 8%; }
.doc-sieve i:nth-child(2) { left: 16%; }
.doc-sieve i:nth-child(3) { left: 23%; }

.doc-paper :is(h2, h3) { position: relative; scroll-margin-top: calc(var(--header-h) + 1.5rem); text-wrap: balance; }
.doc-paper h2 {
  margin: 3.1rem 0 .85rem;
  font-size: clamp(1.45rem, 2.2vw, 1.72rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.028em;
}
.doc-paper h3 {
  margin: 2.1rem 0 .55rem;
  font-size: 1.16rem;
  font-weight: 640;
  line-height: 1.35;
  letter-spacing: -.015em;
}
.doc-sieve + h2 { margin-top: .5rem; }
.heading-anchor {
  position: absolute;
  left: -1.05em;
  padding-right: .25em;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity .2s, color .2s;
}
:is(h2, h3):hover > .heading-anchor { opacity: .7; }
.heading-anchor:hover { color: var(--accent); opacity: 1 !important; }
.doc-paper p { margin: 0 0 1.05em; }
.doc-paper p, .doc-paper li { overflow-wrap: break-word; }
.doc-paper strong { font-weight: 640; }
.doc-paper a:not(.heading-anchor, .doc-crumbs a) {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 38%, transparent);
  text-underline-offset: .22em;
  transition: text-decoration-color .2s;
}
.doc-paper a:not(.heading-anchor, .doc-crumbs a):hover { text-decoration-color: currentColor; }

/* Lists: a small pixel for bullets, mono numerals for steps. */
.doc-paper :is(ul, ol):not([class]) { margin: 0 0 1.2em; padding-inline-start: 1.5rem; }
.doc-paper li { margin-block: .4rem; }
.doc-paper ul:not([class]) > li { list-style: none; position: relative; }
.quick-links li::before { content: none !important; }
.doc-paper ul:not([class]) > li::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: .72em;
  width: 5px;
  height: 5px;
  background: color-mix(in srgb, var(--signal) 70%, var(--muted));
}
.doc-paper ol:not([class]) > li { padding-inline-start: .3rem; }
.doc-paper ol:not([class]) > li::marker { color: var(--muted); font: 600 .84em var(--mono); }
.doc-paper li > :is(ul, ol) { margin: .4rem 0 .2rem; }

/* Inline code and keys */
.doc-paper :not(pre) > code {
  padding: .12em .38em;
  border: 1px solid var(--glass-line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 5.5%, transparent);
  color: var(--text);
  font-size: .85em;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.doc-paper :is(td, th) code { white-space: nowrap; overflow-wrap: normal; }
.doc-paper a > code { color: inherit; }
.docs-main kbd, .not-found kbd {
  display: inline-block;
  min-width: 1.8em;
  margin-inline: .06em;
  padding: .1em .48em .14em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--text) 4%, var(--surface)));
  box-shadow: 0 1.5px 0 var(--border), 0 2px 3px -1px color-mix(in srgb, var(--text) 18%, transparent), inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
  font: 600 .76em/1.5 var(--mono);
  text-align: center;
  vertical-align: .1em;
  white-space: nowrap;
}

/* Terminal code blocks: dark in both themes, a label bar and an always-visible copy control. */
.docs-main .code-block {
  position: relative;
  margin: 1.45rem 0 1.7rem;
  overflow: hidden;
  border-radius: 14px;
  background: var(--term-bg);
  box-shadow: 0 0 0 1px var(--term-border), 0 22px 44px -26px color-mix(in srgb, var(--term-bg) 75%, transparent);
}
.docs-main .code-block::before {
  content: attr(data-lang) / "";
  display: flex;
  align-items: center;
  height: 2.45rem;
  padding: 0 1rem 0 1.85rem;
  border-bottom: 1px solid var(--term-border);
  background:
    radial-gradient(circle at 1.05rem 50%, var(--dot, var(--term-success)) 0 3px, transparent 3.6px),
    var(--term-surface);
  color: var(--term-muted);
  font: 500 .7rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.docs-main .code-block[data-lang="json"] { --dot: var(--term-accent); }
.docs-main .code-block[data-lang="text"] { --dot: var(--term-muted); }
.docs-main .code-block pre,
.docs-main .code-block.has-copy pre {
  margin: 0;
  padding: 1rem 1.2rem 1.1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--term-text);
  font-size: .86rem;
  line-height: 1.72;
  scrollbar-width: thin;
  scrollbar-color: var(--term-border) transparent;
}
.docs-main .code-block pre:focus-visible { outline: 2px solid var(--term-accent); outline-offset: -4px; border-radius: 12px; }
.docs-main .code-block .copy {
  top: .32rem;
  right: .4rem;
  min-height: 1.8rem;
  padding: .2rem .6rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--term-muted);
  font: 500 .72rem/1 var(--mono);
  opacity: 1;
}
.docs-main .code-block .copy:hover { color: var(--term-text); background: color-mix(in srgb, var(--term-text) 8%, transparent); border-color: var(--term-border); }
.docs-main .code-block .copy:focus-visible { outline: 2px solid var(--term-accent); outline-offset: 1px; }
.docs-main .code-block .copy.is-copied { color: var(--term-success); border-color: color-mix(in srgb, var(--term-success) 45%, transparent); }

/* Callouts: soft tinted glass with an icon; each kind has its own hue. */
.docs-main .callout {
  --callout: var(--accent);
  position: relative;
  margin: 1.6rem 0 1.8rem;
  padding: 1rem 1.2rem 1.05rem 3.05rem;
  border: 1px solid color-mix(in srgb, var(--callout) 24%, transparent);
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--callout) 8%, var(--surface)), color-mix(in srgb, var(--callout) 3%, var(--surface)) 70%);
  font-size: .98rem;
  line-height: 1.62;
}
.docs-main .callout-tip { --callout: var(--success); }
.docs-main .callout-experimental { --callout: var(--warning); }
.docs-main .callout-warning { --callout: var(--error); }
.docs-main .callout-planned {
  --callout: var(--muted);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--muted) 45%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.callout-icon {
  position: absolute;
  left: 1.1rem;
  top: 1.12rem;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--callout);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.docs-main .callout-label {
  margin: .1rem 0 .3rem;
  color: var(--callout);
  font: 650 .7rem/1.5 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.docs-main .callout-planned .callout-label { color: var(--muted); }
.docs-main .callout p { margin-bottom: .55em; }
.docs-main .callout p:last-child { margin-bottom: 0; }

/* Tables */
.docs-main .table-scroll {
  margin: 1.5rem 0 1.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.docs-main table {
  min-width: 30rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .925rem;
  line-height: 1.55;
}
.docs-main :is(th, td) { padding: .78rem 1rem; border: 0; }
.docs-main th {
  background: color-mix(in srgb, var(--text) 3.5%, var(--surface));
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font: 600 .68rem/1.5 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.docs-main td { background: var(--surface); }
.docs-main tbody tr + tr td { border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent); }
.docs-main tbody tr:hover td { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.docs-main td:first-child { color: var(--text); font-weight: 560; }
.docs-main th:first-child { border-top-left-radius: 13px; }
.docs-main th:last-child { border-top-right-radius: 13px; }

/* Figures: product screens framed like the landing's terminal objects. */
.doc-figure { margin: 2rem 0; }
.doc-figure img {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: var(--term-bg);
  box-shadow: var(--shadow-deep);
}
.doc-figure figcaption {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: .5rem;
  margin-top: .95rem;
  color: var(--muted);
  font: 500 .74rem/1.45 var(--mono);
  letter-spacing: .02em;
  text-align: center;
}
.doc-figure figcaption::before { content: ""; flex: none; width: 5px; height: 5px; background: var(--signal); transform: translateY(-1px); }
.figure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.4rem; margin: 2rem 0; }
.figure-grid .doc-figure { margin: 0; }
.figure-grid .doc-figure img { border-radius: 10px; }

/* Edit link, previous / next */
.edit-page { margin: 2.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--glass-line); font-size: .875rem; }
.doc-paper .edit-page a { color: var(--muted); }
.docs-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.docs-pagination a {
  position: relative;
  display: grid;
  gap: .3rem;
  padding: 1.15rem 1.4rem 1.25rem;
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow-soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text);
  text-decoration: none;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.docs-pagination a:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-soft); }
.motion .docs-pagination a:hover { transform: translateY(-2px); }
.docs-pagination .pager-next { grid-column: 2; text-align: right; }
.pager-direction {
  color: var(--muted);
  font: 500 .7rem/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pager-prev .pager-direction::before { content: "\2190\00a0\00a0" / ""; }
.pager-next .pager-direction::after { content: "\00a0\00a0\2192" / ""; }
.pager-title { font-size: 1.06rem; font-weight: 620; letter-spacing: -.015em; }
.docs-pagination a:hover .pager-title { color: var(--accent); }

/* ------------------------------------------------------------------ mobile bar and drawers */
.docs-mobilebar {
  position: sticky;
  top: calc(var(--header-h) + .6rem);
  z-index: 30;
  gap: .5rem;
  margin-bottom: 1rem;
  transition: top .45s var(--ease);
}
body:has(.site-header.is-hidden) .docs-mobilebar { top: .6rem; }
.docs-mobilebar details { position: static; min-width: 0; }
.docs-mobilebar summary {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.75rem;
  padding: 0 2.3rem 0 1rem;
  position: relative;
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow-soft);
  -webkit-backdrop-filter: saturate(1.3) blur(18px);
  backdrop-filter: saturate(1.3) blur(18px);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}
.docs-mobilebar summary::-webkit-details-marker { display: none; }
.docs-mobilebar summary::after {
  content: "";
  position: absolute;
  right: 1.05rem;
  top: calc(50% - 5px);
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .3s var(--ease);
}
.docs-mobilebar details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.docs-mobilebar summary:focus-visible { outline-offset: 2px; }
.mobilebar-sep { color: var(--muted); font-weight: 400; }
.mobilebar-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 500; }
.drawer-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + .5rem);
  max-height: min(72vh, 36rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .6rem .5rem;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 24px 60px -20px color-mix(in srgb, var(--text) 35%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(24px);
  backdrop-filter: saturate(1.3) blur(24px);
}
.motion details[open] > .drawer-panel { animation: drawer-in .35s var(--ease) both; }
@keyframes drawer-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.drawer-panel .docs-nav { padding-bottom: .4rem; }
.drawer-panel .docs-toc { padding: .5rem .6rem; }
.drawer-panel .docs-toc p { display: none; }

/* ------------------------------------------------------------------ docs home */
.docs-home .docs-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; width: min(1120px, calc(100% - 48px)); padding-top: clamp(2rem, 5vw, 4rem); }
.docs-home :is(.docs-sidebar, .docs-mobilebar, .docs-layout > .docs-toc, .doc-crumbs, .docs-pagination) { display: none; }
.docs-home .doc-paper { padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.docs-hero-mark { width: min(420px, 74%); margin: 0 auto clamp(1.6rem, 3.5vw, 2.4rem); line-height: 0; }
.docs-wordmark { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.docs-wordmark .mark-static { fill: var(--mark-ink); }
[data-theme="dark"] .docs-wordmark { filter: drop-shadow(0 0 20px color-mix(in srgb, var(--signal) 45%, transparent)); }
.docs-hero-sieve {
  display: block;
  height: 2px;
  margin-top: clamp(.9rem, 2vw, 1.3rem);
  background: repeating-linear-gradient(90deg, var(--muted) 0 calc(100% / 27), transparent calc(100% / 27) calc(200% / 27));
  opacity: .35;
}
.docs-home .doc-head { text-align: center; }
.docs-home .doc-head h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); letter-spacing: -.045em; }
.docs-home .doc-paper .doc-lead { margin-inline: auto; max-width: 34em; text-wrap: balance; }
.docs-home .doc-sieve { max-width: 30rem; margin: 1.5rem auto .75rem; }
.docs-home .doc-sieve::before { -webkit-mask: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); mask: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent); }
.docs-home .doc-sieve i:nth-child(1) { left: 40%; }
.docs-home .doc-sieve i:nth-child(2) { left: 50%; }
.docs-home .doc-sieve i:nth-child(3) { left: 59%; }
.docs-home .doc-sieve + p { max-width: 44em; margin: 0 auto; color: var(--muted); text-align: center; text-wrap: pretty; }
.quick-links { margin-top: 1.6rem; }
.quick-links ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.4rem;
  padding: 0 1rem;
  border-radius: 99px;
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text) !important;
  font-size: .9rem;
  font-weight: 520;
  text-decoration: none !important;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.quick-links a::before { content: ""; width: 5px; height: 5px; background: var(--signal); }
.quick-links a:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-soft); }
.motion .quick-links a:hover { transform: translateY(-1px); }

.docs-home .doc-paper h2 {
  margin: clamp(3.5rem, 7vw, 5rem) 0 1.4rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -.035em;
}
.docs-home .heading-anchor { display: none; }

/* Start here: a three-step path */
.docs-home #start-here + ol {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: start;
}
.docs-home #start-here + ol::before {
  content: "";
  position: absolute;
  left: 2.6rem;
  right: 2.6rem;
  top: 2.3rem;
  height: 2px;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent) 0 8px, transparent 8px 16px);
}
.docs-home #start-here + ol > li {
  position: relative;
  counter-increment: start;
  margin: 0;
  padding: 1.25rem 1.35rem 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 62%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow-soft);
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.55;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.docs-home #start-here + ol > li::before {
  content: counter(start, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font: 650 .78rem/1 var(--mono);
}
.docs-home #start-here + ol > li:first-child::before { background: var(--signal); color: var(--on-accent); }
.motion .docs-home #start-here + ol > li:has(a:hover) { transform: translateY(-3px); }
.docs-home #start-here + ol > li > a {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -.015em;
  text-decoration: none;
}
.docs-home #start-here + ol > li > a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.docs-home #start-here + ol > li > a:hover { color: var(--accent); }
.docs-home #start-here + ol > li > a:focus-visible { outline: none; }
.docs-home #start-here + ol > li:has(> a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.docs-home #start-here + ol code { position: relative; z-index: 1; }

/* Pick a task: filter and glass cards grouped by section */
.task-filter {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 30rem;
  margin: 0 0 1.25rem;
  flex-wrap: wrap;
}
.task-filter input {
  width: 100%;
  min-height: 3rem;
  padding: 0 3rem 0 2.75rem;
  border: 0;
  border-radius: 99px;
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow-soft);
  color: var(--text);
  font: inherit;
  font-size: .98rem;
  -webkit-appearance: none;
  appearance: none;
}
.task-filter input::placeholder { color: var(--muted); opacity: 1; }
.task-filter input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.task-filter input::-webkit-search-cancel-button { display: none; }
.task-filter-icon {
  position: absolute;
  left: 1.05rem;
  top: 1.5rem;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  pointer-events: none;
}
.task-filter-key { position: absolute; right: .85rem; top: 1.5rem; transform: translateY(-50%); }
.task-filter-status { flex-basis: 100%; margin: .55rem 0 0 1.1rem; min-height: 1.4em; color: var(--muted); font-size: .85rem; }
.task-group { margin-top: 2.25rem; }
.task-group h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--glass-line);
  color: var(--muted);
  font: 600 .72rem/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.task-group h3 span:first-child { color: var(--text); }
.task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.task-cards li { margin: 0; }
.task-cards a {
  display: grid;
  align-content: start;
  gap: .4rem;
  height: 100%;
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: 16px;
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow-soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-decoration: none !important;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.task-cards a:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent), 0 2px 4px color-mix(in srgb, var(--text) 5%, transparent), 0 22px 40px -18px color-mix(in srgb, var(--accent) 35%, transparent); }
.motion .task-cards a:hover { transform: translateY(-3px); }
.task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 620;
  line-height: 1.35;
  letter-spacing: -.012em;
}
.task-arrow { flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease), stroke .2s; }
.task-cards a:hover .task-arrow { stroke: var(--accent); }
.motion .task-cards a:hover .task-arrow { transform: translateX(3px); }
.task-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  color: var(--muted);
  font-size: .89rem;
  line-height: 1.5;
}
.docs-home .doc-paper > :is(.table-scroll, .callout, p:not(.doc-lead)):not(.doc-sieve + p) { max-width: 52rem; }

/* ------------------------------------------------------------------ 404 */
main.not-found { max-width: 52rem; text-align: center; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.nf-stage { width: min(520px, 92%); margin: 0 auto clamp(1.5rem, 4vw, 2.5rem); line-height: 0; }
.nf-mark { display: block; width: 100%; height: auto; overflow: visible; }
.nf-word { fill: var(--mark-ink); }
[data-theme="dark"] .nf-mark { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--signal) 35%, transparent)); }
.nf-ghost { fill: none; stroke: var(--muted); stroke-width: .06; stroke-dasharray: .16 .12; opacity: .55; }
.nf-grain { fill: var(--mark-dust); transform-box: fill-box; transform-origin: 50% 50%; }
.nf-sieve { fill: var(--muted); opacity: .4; }
.motion .nf-grain { animation: nf-drain 1.5s cubic-bezier(.5, 0, .75, .3) both; animation-delay: calc(.35s + var(--i) * .13s); }
.motion .nf-ghost { animation: nf-fade .8s var(--ease) both; animation-delay: 1.2s; }
@keyframes nf-drain {
  0% { transform: translateY(calc(var(--dy) * -1)) scale(2.1); fill: var(--mark-ink); }
  45% { fill: var(--mark-dust); }
  100% { transform: none; opacity: 1; }
}
@keyframes nf-fade { from { opacity: 0; } }
main.not-found .not-found-code {
  margin: 0 0 .8rem;
  color: var(--accent);
  font: 600 .74rem/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
main.not-found h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 650; line-height: 1.05; letter-spacing: -.042em; }
main.not-found .not-found-lede { max-width: 32em; margin-inline: auto; }
main.not-found .not-found-links { margin-top: 2rem; text-align: left; gap: .9rem; }
main.not-found .not-found-links a {
  border: 0;
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow-soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
main.not-found .not-found-links a:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-soft); }
.motion main.not-found .not-found-links a:hover { transform: translateY(-2px); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 14rem minmax(0, 1fr); grid-template-areas: "side bar" "side main"; column-gap: 2rem; }
  .docs-layout > .docs-toc { display: none; }
  .docs-sidebar { grid-row: 1 / span 2; }
  .docs-mobilebar { display: flex; }
  .docs-mobile-menu { display: none; }
  .docs-toc-menu { flex: 1; }
  .docs-toc-menu summary { width: max-content; max-width: 100%; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .docs-toc-menu .drawer-panel { right: auto; width: min(22rem, 100%); }
}
@media (max-width: 760px) {
  .docs-layout { display: block; width: calc(100% - 28px); padding-block: 1rem 3rem; }
  .docs-sidebar { display: none; }
  .docs-mobile-menu { display: block; flex: 1 1 auto; }
  .docs-toc-menu { flex: 0 0 auto; }
  .docs-toc-menu summary { width: auto; }
  .doc-paper { border-radius: var(--radius); font-size: 1.03rem; }
  .doc-head h1 { font-size: clamp(2rem, 8.6vw, 2.6rem); }
  .heading-anchor { display: none; }
  .docs-main table { min-width: 34rem; }
  .docs-main :is(th, td):first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 8.5rem;
    max-width: 10.5rem;
    box-shadow: inset -1px 0 0 var(--border);
  }
  .docs-main th:first-child { z-index: 2; }
  .figure-grid { grid-template-columns: minmax(0, 1fr); }
  .docs-pagination { grid-template-columns: minmax(0, 1fr); }
  .docs-pagination .pager-next { grid-column: 1; }
  .docs-home .docs-layout { width: calc(100% - 32px); }
  .docs-home #start-here + ol { grid-template-columns: minmax(0, 1fr); }
  .docs-home #start-here + ol::before { left: 2.4rem; right: auto; top: 2rem; bottom: 2rem; width: 2px; height: auto; background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--accent) 45%, transparent) 0 8px, transparent 8px 16px); }
  .docs-home #start-here + ol > li { padding-left: 4.4rem; }
  .docs-home #start-here + ol > li::before { position: absolute; left: 1.35rem; top: 1.2rem; }
  .task-filter-key { display: none; }
  .docs-home .doc-sieve + p { text-align: left; }
}
