/* The docs: a grouped menu, the article, and what is on this page. Built only from tokens.css.
   Code panels are dark in both themes; amber inside them marks what the reader replaces. */

.docs { display: grid; grid-template-columns: 15rem minmax(0, 46rem) 13rem; justify-content: space-between; gap: var(--s-7); padding-block: var(--s-7) var(--s-9); align-items: start; }
.docs .sq { display: inline-block; flex: none; width: 9px; height: 9px; margin-right: var(--s-2); background: var(--sq, var(--fg)); vertical-align: 0.05em; }
.sq.d1 { --sq: var(--d1); } .sq.d2 { --sq: var(--d2); } .sq.d3 { --sq: var(--d3); } .sq.d4 { --sq: var(--d4); } .sq.d5 { --sq: var(--d5); }

/* The side: search and the menu */
.dside { position: sticky; top: var(--s-5); max-height: calc(100svh - var(--s-6)); overflow-y: auto; scrollbar-width: thin; display: grid; gap: var(--s-6); padding-bottom: var(--s-5); }
.dsearch { position: relative; }
.dsearch input { width: 100%; height: 44px; padding: 0 40px 0 var(--s-3); background: var(--surface); color: var(--fg); border: var(--rule) solid var(--line); border-radius: 0; font: 500 var(--t-small) var(--text); }
.dsearch input::placeholder { color: var(--muted); }
.dsearch input:focus { outline: none; border-color: var(--fg); }
.dsearch input::-webkit-search-cancel-button { display: none; }
.dsearch kbd { position: absolute; right: 10px; top: 11px; min-width: 22px; height: 22px; display: grid; place-items: center; background: var(--sunk); color: var(--muted); font: 600 0.75rem/1 var(--mono); pointer-events: none; }
.dsearch input:focus + kbd, .dsearch input:not(:placeholder-shown) + kbd { display: none; }
.dsearch-results { position: absolute; z-index: 20; left: 0; top: calc(100% + 4px); width: min(30rem, calc(100vw - 2 * var(--edge))); max-height: 70svh; overflow-y: auto; background: var(--bg); border: var(--rule) solid var(--fg); }
.dsearch-results a { display: grid; gap: 2px; padding: var(--s-3) var(--s-4); text-decoration: none; }
.dsearch-results a + a { box-shadow: 0 -1px 0 var(--line); }
.dsearch-results a[aria-selected="true"], .dsearch-results a:hover { background: var(--sunk); }
.dsearch-results small { color: var(--muted); font-size: var(--t-micro); font-weight: 600; }
.dsearch-results b { font-weight: 650; }
.dsearch-results span { color: var(--muted); font-size: var(--t-small); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dsearch-results mark { background: none; color: var(--fg); font-weight: 650; }
.dsearch-results p { padding: var(--s-4); color: var(--muted); font-size: var(--t-small); }

.dnav { display: grid; gap: var(--s-5); }
.dnav-title { display: flex; align-items: center; margin-bottom: var(--s-2); padding-inline: var(--s-3); font-size: var(--t-micro); font-weight: 700; color: var(--muted); }
.dnav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.dnav a { display: block; padding: 7px var(--s-3); text-decoration: none; font-size: var(--t-small); line-height: 1.35; color: var(--fg); transition: background-color var(--dur-fast); }
.dnav a:hover { background: var(--sunk); }
.dnav a[aria-current] { background: var(--fg); color: var(--bg); font-weight: 650; }
.dmenu { display: none; }

/* The article head */
.dmain { min-width: 0; }
.dhead { display: grid; gap: var(--s-4); margin-bottom: var(--s-7); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); font-size: var(--t-small); font-weight: 600; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs span { display: inline-flex; align-items: center; }
.dhead h1 { font: 400 var(--t-d2)/var(--lh-display) var(--display); text-wrap: balance; }
.dlead { font-size: var(--t-lead); line-height: 1.45; max-width: 36em; text-wrap: pretty; }
.toc-inline { display: none; }

/* Reading */
.docs-body { max-width: none; font-size: var(--t-body); line-height: 1.7; }
.docs-body > * + * { margin-top: 1.15em; }
.docs-body p, .docs-body li { text-wrap: pretty; }
/* Running text keeps about 70 characters a line; code, tables and screenshots use the full column. */
.docs-body > p, .docs-body > ul, .docs-body > ol { max-width: 40rem; }
.docs-body h2 { position: relative; font: 400 clamp(2rem, 2.7vw, 2.75rem)/1 var(--display); margin-top: var(--s-8); scroll-margin-top: var(--s-5); text-wrap: balance; }
.docs-body h3 { position: relative; font: 700 1.25rem/var(--lh-tight) var(--text); margin-top: var(--s-7); scroll-margin-top: var(--s-5); }
.docs-body h2 + *, .docs-body h3 + * { margin-top: var(--s-4); }
.docs-body > h2:first-child, .docs-body > h3:first-child { margin-top: 0; }
.anchor { margin-left: 0.3em; color: var(--muted); text-decoration: none; font: 500 0.7em/1 var(--mono); opacity: 0; transition: opacity var(--dur-fast); }
h2:hover > .anchor, h3:hover > .anchor, .anchor:focus-visible { opacity: 1; }
.docs-body a:not(.anchor):not(.path) { text-decoration-color: var(--link-line); text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
.docs-body a:not(.anchor):not(.path):hover { text-decoration-color: currentColor; }
.docs-body strong { font-weight: 700; }
.docs-body ul, .docs-body ol { padding-left: 1.3em; }
.docs-body li + li { margin-top: 0.5em; }
.docs-body li::marker { color: var(--muted); }
.docs-body :not(pre) > code { padding: 0.12em 0.38em; background: var(--chip-bg); color: var(--chip-fg); box-shadow: inset 0 0 0 1px var(--chip-line); font: 500 0.84em/1 var(--mono); overflow-wrap: anywhere; }
.docs-body a > code { color: inherit; }
.docs-body kbd { padding: 0.1em 0.4em; background: var(--sunk); font: 600 0.84em var(--mono); }

/* Code panels */
.code { margin-block: var(--s-5); background: var(--code-bg); color: var(--code-fg); box-shadow: 0 0 0 1px var(--code-line); }
.docs-body > .code { margin-top: var(--s-5); }
.code-bar { display: flex; align-items: stretch; justify-content: space-between; min-height: 42px; background: var(--code-bar); box-shadow: inset 0 -1px 0 var(--code-line); }
.code-title { align-self: center; padding: 0 var(--s-4); font: 500 0.8125rem/1.3 var(--mono); color: var(--code-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code .copy { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 var(--s-4); background: none; color: var(--code-muted); border: 0; font: 650 0.8125rem/1 var(--text); cursor: pointer; transition: color var(--dur-fast), background-color var(--dur-fast); }
.code .copy::before { content: ""; width: 12px; height: 12px; box-shadow: inset 0 0 0 1.5px currentColor, 3px -3px 0 -1.5px var(--code-bar), 3px -3px 0 0 currentColor; translate: -1px 1px; }
.code .copy:hover { background: var(--code-hover); color: var(--code-fg); }
.code .copy:focus-visible { outline-offset: -3px; }
.code .copy.done { color: var(--sx-str); }
.code .copy.done::before { width: 10px; height: 5px; box-shadow: none; border: solid currentColor; border-width: 0 0 2px 2px; rotate: -45deg; translate: 0 -2px; }
.code pre { margin: 0; background: transparent; color: inherit; padding: var(--s-4) var(--s-5); overflow-x: auto; font: 400 0.875rem/1.7 var(--mono); tab-size: 4; scrollbar-width: thin; scrollbar-color: var(--code-line) transparent; }
.code pre:focus-visible, .code-panel:focus-visible { outline: 2px solid var(--sx-ph); outline-offset: -2px; }
.code code { font: inherit; }
.pr { color: var(--code-muted); user-select: none; -webkit-user-select: none; }
.tp { font-weight: 700; color: var(--code-fg); }
.tf { color: var(--sx-kw); }
.tk { color: var(--sx-key); }
.ts { color: var(--sx-str); }
.tn { color: var(--sx-num); }
.tw { color: var(--sx-kw); }
.tc { color: var(--sx-com); }
.ph { color: var(--sx-ph); text-decoration: underline dotted 1px; text-underline-offset: 3px; }
.ph.filled { text-decoration: none; }
.code-tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.code-tabs button { flex: none; padding: 0 var(--s-4); background: none; color: var(--code-muted); border: 0; font: 650 0.8125rem/1 var(--text); cursor: pointer; transition: color var(--dur-fast), background-color var(--dur-fast); }
.code-tabs button:hover { color: var(--code-fg); }
.code-tabs button[aria-selected="true"] { background: var(--code-bg); color: var(--code-fg); box-shadow: 1px 0 0 var(--code-line), -1px 0 0 var(--code-line); }
.code-tabs button:first-child[aria-selected="true"] { box-shadow: 1px 0 0 var(--code-line); }
.code-tabs button:focus-visible { outline-offset: -3px; }

/* Content tabs: whole paths, such as the system you install on */
.dtabs { margin-top: var(--s-5); }
.dtabs-rail { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--sunk); max-width: 100%; }
.dtabs-rail button { padding: 9px var(--s-4); background: none; color: var(--fg); border: 0; border-radius: 0; font: 650 var(--t-small)/1 var(--text); cursor: pointer; transition: background-color var(--dur-fast), color var(--dur-fast); }
.dtabs-rail button:hover { background: var(--surface); }
.dtabs-rail button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.dtab-panel { padding-top: var(--s-5); }
.dtab-panel > * + * { margin-top: 1.15em; }

/* Notes */
.callout { padding: var(--s-4) var(--s-5); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.callout > * + * { margin-top: 0.6em; }
.callout-label { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-small); font-weight: 700; }
.callout-label i { width: 10px; height: 10px; background: var(--d1); }
.callout-tip .callout-label i { background: var(--d3); }
.callout-warn .callout-label i { background: var(--accent); }
.callout p:not(.callout-label) { font-size: var(--t-small); line-height: 1.65; }
.callout .code { margin-block: var(--s-3) 0; }

/* Screenshots */
.docs-shot { margin-block: var(--s-6); }
.docs-body > .docs-shot { margin-top: var(--s-6); }
.docs-shot figcaption { font-size: var(--t-small); }

/* Tables */
.docs-body .table-wrap { overflow-x: auto; }
.docs-body .table-wrap:focus-visible { outline-offset: 2px; }
.docs-body table { width: 100%; border-collapse: collapse; font-size: var(--t-small); line-height: 1.55; }
.docs-body th, .docs-body td { text-align: left; padding: 11px var(--s-4) 11px 0; vertical-align: top; box-shadow: inset 0 -1px 0 var(--line); }
.docs-body thead th { font-weight: 700; box-shadow: inset 0 calc(var(--rule) * -1) 0 var(--fg); white-space: nowrap; }
.docs-body td:first-child { font-weight: 600; }
.docs-body td code { white-space: nowrap; }
.docs-body td:last-child, .docs-body th:last-child { padding-right: 0; }

/* Steps: numbered blocks with the number set big */
.steps { list-style: none; padding: 0 !important; counter-reset: step; display: grid; gap: 0; }
.steps > li { position: relative; counter-increment: step; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0 var(--s-5); padding-bottom: var(--s-7); }
.steps > li + li { margin-top: 0; }
.steps > li::before { content: counter(step); grid-row: 1 / span 20; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; background: var(--fg); color: var(--bg); font: 400 1.75rem/1 var(--display); }
.steps > li::after { content: ""; position: absolute; left: calc(1.375rem - 1px); top: 3.25rem; bottom: var(--s-3); width: 2px; background: var(--line); }
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps > li > * { grid-column: 2; min-width: 0; }
.steps > li > * + * { margin-top: 0.9em; }
.steps > li > h3 { margin-top: 0.35rem; font: 700 1.25rem/var(--lh-tight) var(--text); }
.steps > li > .code, .steps > li > .dtabs { margin-block: var(--s-4) 0; }

/* Paths: what you have, and where to go */
.paths { list-style: none; padding: 0 !important; display: grid; box-shadow: inset 0 var(--rule) 0 var(--fg); }
.paths li + li { margin-top: 0; }
.paths a.path { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s-2) var(--s-5); align-items: baseline; padding: var(--s-4) var(--s-2) var(--s-4) 0; text-decoration: none; box-shadow: inset 0 -1px 0 var(--line); transition: background-color var(--dur-fast), padding var(--dur-fast); }
.paths a.path:hover { background: var(--sunk); padding-left: var(--s-3); }
.paths a.path b { font-weight: 650; }
.paths a.path span { color: var(--muted); font-size: var(--t-small); }
.paths a.path em { font-style: normal; font-weight: 650; font-size: var(--t-small); white-space: nowrap; }
.paths a.path em::after { content: " \2192"; }

/* Endpoint verbs, and facts as a two column list */
.verb { display: inline-block; padding: 0.15em 0.45em !important; background: var(--fg) !important; color: var(--bg) !important; box-shadow: none !important; font-weight: 700 !important; font-size: 0.75em !important; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; font-size: var(--t-small); }
.facts dt, .facts dd { padding: 10px 0; box-shadow: inset 0 -1px 0 var(--line); }
.facts dt { padding-right: var(--s-5); font-weight: 700; }
.facts dd { margin: 0; }

/* Fill in the examples */
.you { display: grid; gap: var(--s-3); margin-bottom: var(--s-7); padding: var(--s-4) var(--s-5) var(--s-5); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.you-title { font-weight: 700; display: flex; align-items: center; gap: var(--s-2); }
.you-title::before { content: ""; width: 10px; height: 10px; background: var(--accent); }
.you-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-3) var(--s-4); }
.you label { display: grid; gap: 6px; font-size: var(--t-micro); font-weight: 650; color: var(--muted); }
.you input { height: 42px; padding: 0 var(--s-3); background: var(--bg); color: var(--fg); border: var(--rule) solid var(--line); border-radius: 0; font: 500 0.875rem var(--mono); }
.you input:focus { outline: none; border-color: var(--fg); }
.you-note { font-size: var(--t-micro); color: var(--muted); }

/* Outline on the right */
.dtoc { position: sticky; top: var(--s-5); max-height: calc(100svh - var(--s-6)); overflow-y: auto; scrollbar-width: none; }
.toc-title { margin-bottom: var(--s-3); font-size: var(--t-micro); font-weight: 700; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: flex; gap: var(--s-2); align-items: baseline; padding: 4px 0; font-size: 0.875rem; line-height: 1.35; color: var(--muted); text-decoration: none; transition: color var(--dur-fast); }
.toc a::before { content: ""; flex: none; width: 6px; height: 6px; translate: 0 -2px; background: transparent; transition: background-color var(--dur-fast); }
.toc a:hover { color: var(--fg); }
.toc a[aria-current] { color: var(--fg); font-weight: 650; }
.toc a[aria-current]::before { background: var(--accent); }

/* The foot of a page */
.dfoot { display: grid; gap: var(--s-6); margin-top: var(--s-9); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.pager a { display: grid; gap: var(--s-1); padding: var(--s-4) var(--s-5); text-decoration: none; box-shadow: inset 0 0 0 var(--rule) var(--line); transition: box-shadow var(--dur-fast), background-color var(--dur-fast); }
.pager a:hover { box-shadow: inset 0 0 0 var(--rule) var(--fg); }
.pager span { font-size: var(--t-micro); font-weight: 650; color: var(--muted); }
.pager b { font: 400 var(--t-d4)/1.05 var(--display); }
.pager .prev b::before { content: "\2190\00a0"; }
.pager .next { text-align: right; }
.pager .next b::after { content: "\00a0\2192"; }
.dhelp { font-size: var(--t-small); color: var(--muted); }
.dhelp a { color: var(--fg); }

/* The docs home */
.docs-home .dhead { margin-bottom: var(--s-6); }
.home-install { display: grid; gap: var(--s-3); margin-bottom: var(--s-8); }
.home-install .cmd { max-width: none; }
.home-install p { font-size: var(--t-small); color: var(--muted); }
.home-start { list-style: none; margin: 0 0 var(--s-8); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rule); background: var(--fg); padding: var(--rule); counter-reset: start; }
.docs-body .home-start { padding: var(--rule); }
.home-start li { counter-increment: start; display: grid; }
.docs-body .home-start li + li { margin-top: 0; }
.home-start a { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-5); background: var(--bg); text-decoration: none; min-height: 100%; transition: background-color var(--dur-fast); }
.home-start a::before { content: counter(start); font: 400 3.5rem/0.9 var(--display); color: var(--muted); }
.home-start a:hover { background: var(--sunk); }
.home-start b { font: 400 var(--t-d4)/1.05 var(--display); }
.home-start span { color: var(--muted); font-size: var(--t-small); line-height: 1.55; }
.home-groups { display: grid; gap: var(--s-7); }
.home-group h2 { margin-top: 0; display: flex; align-items: center; margin-bottom: var(--s-3); font: 400 var(--t-d4)/1 var(--display); }
.home-group h2 .sq { width: 12px; height: 12px; margin-right: var(--s-3); }

@media (max-width: 1240px) {
  .docs { grid-template-columns: 14rem minmax(0, 1fr); gap: var(--s-7); }
  .dtoc { display: none; }
  .toc-inline { display: block; margin-top: var(--s-2); max-width: 36rem; box-shadow: inset 0 0 0 1px var(--line); }
  .toc-inline summary { padding: var(--s-3) var(--s-4); font-size: var(--t-small); font-weight: 650; cursor: pointer; }
  .toc-inline ol { margin: 0; padding: 0 var(--s-4) var(--s-4) 2.2em; font-size: var(--t-small); display: grid; gap: var(--s-1); }
  .toc-inline a { color: var(--fg); }
}
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); padding-top: var(--s-5); }
  .dside { position: static; max-height: none; overflow: visible; gap: var(--s-3); padding: 0; }
  .dnav-wide { display: none; }
  .dmenu { display: block; box-shadow: inset 0 0 0 var(--rule) var(--fg); }
  .dmenu summary { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-4); cursor: pointer; list-style: none; font-weight: 650; }
  .dmenu summary::-webkit-details-marker { display: none; }
  .dmenu summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; rotate: 45deg; translate: 0 -2px; transition: rotate var(--dur-fast); }
  .dmenu[open] summary::after { rotate: -135deg; translate: 0 2px; }
  .dmenu-label { font-size: var(--t-micro); color: var(--muted); }
  .dmenu-here { display: inline-flex; align-items: center; }
  .dmenu .dnav { padding: var(--s-2) var(--s-2) var(--s-4); }
  .dsearch-results { width: 100%; }
  .home-start { grid-template-columns: minmax(0, 1fr); }
  .paths a.path { grid-template-columns: minmax(0, 1fr) auto; }
  .paths a.path span { grid-column: 1; grid-row: 2; }
  .paths a.path em { grid-row: 1 / span 2; align-self: center; }
}
@media (max-width: 560px) {
  .code pre { padding: var(--s-3) var(--s-4); font-size: 0.8125rem; }
  .steps > li { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0 var(--s-4); }
  .steps > li::before { width: 2.25rem; height: 2.25rem; font-size: 1.5rem; }
  .steps > li::after { left: calc(1.125rem - 1px); top: 2.75rem; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { padding-bottom: 0; box-shadow: none; }
}
@media (pointer: coarse) {
  .anchor { opacity: 0.6; }
  .dsearch kbd { display: none; }
  .dnav a { padding-block: 10px; }
}
