/* The docs: menu, text, and "On this page". */
.docs { display: grid; grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
.docs-main { min-width: 0; }

/* Menu and search. On phones and tablets they are one closed "Docs menu" above the text. */
.docs-menu { margin: 0 0 24px; border: 1px solid var(--line); }
.docs-menu > summary { padding: 10px 14px; color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; }
.docs-menu[open] > summary { border-bottom: 1px solid var(--line); }
.docs-search { position: relative; margin: 14px 14px 0; }
.docs-search input { width: 100%; height: 38px; padding: 0 34px 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink); font: 400 15px var(--sans); }
.docs-search input::placeholder { color: var(--muted); opacity: 1; }
.docs-search kbd { display: none; position: absolute; top: 9px; right: 9px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; line-height: 18px; pointer-events: none; }
.docs-search input:not(:placeholder-shown) ~ kbd { display: none; }
#docs-results { margin-top: 6px; border: 1px solid var(--line); background: var(--paper); font-size: 15px; }
#docs-results ul { list-style: none; margin: 0; padding: 0; }
#docs-results li + li { border-top: 1px solid var(--line); }
#docs-results a { display: block; padding: 10px 12px; color: var(--ink); text-decoration: none; }
#docs-results a:hover, #docs-results a:focus { background: var(--paper-2); }
#docs-results a:focus-visible { outline-offset: -2px; }
#docs-results span { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
#docs-results p { margin: 0; padding: 12px; color: var(--muted); }
#docs-results mark { background: none; color: var(--ink); font-weight: 600; }
.docs-nav { padding: 14px; font-size: 15px; }
.docs-nav h2 { margin: 18px 0 4px; color: var(--muted); font: 600 13.5px var(--sans); letter-spacing: 0; }
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 4px 10px; border-left: 1px solid var(--line); color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.docs-nav a:hover { color: var(--ink); text-decoration: underline; }
.docs-nav a[aria-current="page"] { border-left-color: var(--teal); color: var(--ink); font-weight: 600; }
.docs-toc { display: none; font-size: var(--fs-small); }

/* Scrollbars: a thin bar, without a track or arrows. Firefox has no ::-webkit-scrollbar, and Chrome would drop it for scrollbar-width. */
.docs ::-webkit-scrollbar { width: 6px; height: 6px; }
.docs ::-webkit-scrollbar-track, .docs ::-webkit-scrollbar-corner { background: transparent; }
.docs ::-webkit-scrollbar-button { display: none; }
.docs ::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--line); }
.docs ::-webkit-scrollbar-thumb:hover { background: var(--muted); }
@supports not selector(::-webkit-scrollbar) { .docs * { scrollbar-width: thin; scrollbar-color: var(--line) transparent; } }

/* Text */
.docs h1 { margin: 0 0 14px; font-size: clamp(32px, 3.6vw, 42px); line-height: 1.1; }
.docs-page .prose h1 { margin: 0 0 16px; }
.docs .crumbs { margin-bottom: 12px; }
.docs .lede, .docs-body > p:first-child { margin: 0 0 20px; color: var(--ink-2); font-size: var(--fs-lede); line-height: 1.55; }
.docs-body { overflow-wrap: break-word; }
.docs-body h2 { margin: 44px 0 12px; font-size: 26px; line-height: 1.2; }
.docs-body h3 { margin: 32px 0 8px; font-size: 20px; line-height: 1.3; }
.docs-body :is(h2, h3) { scroll-margin-top: 20px; }
.docs-body :is(p, li) { max-width: 40em; }
.docs-body > :is(ul, ol) { padding-left: 22px; }
.docs-body li { margin-bottom: 6px; }
.docs-body code { color: var(--ink); }
.docs-body strong { color: var(--ink); font-weight: 600; }
.docs-body pre { margin: 16px 0; padding: 14px; border: 1px solid var(--line); background: var(--paper-2); font-size: 14px; line-height: 1.5; }
.docs-body pre code { font-size: inherit; }
.docs-body .cmds { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 14px; }
.docs-body .cmds li { min-width: 0; max-width: none; margin: 0; }
.docs-body .cmds p { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.docs-body table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.docs-body :is(th, td) { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-body th { background: var(--paper-2); color: var(--ink); font-weight: 600; }
.docs-body tr:last-child td { border-bottom: 0; }
.docs-body td { min-width: 7em; overflow-wrap: break-word; }
/* Docs home: the search, then each section as big cards, small cards or a list. A card's link covers the card. */
.docs-home .docs-search { margin: 0; max-width: 100%; }
.docs-home .docs-search input { height: 54px; padding: 0 48px 0 18px; font-size: 18px; }
.docs-home .docs-search kbd { top: 16px; right: 16px; font-size: 13px; line-height: 20px; }
.docs-home .docs-search #docs-results { position: absolute; z-index: 3; top: 56px; left: 0; width: 100%; max-height: 460px; overflow-y: auto; border-color: var(--muted); }
.docs-home .docs-main h2 { margin: 40px 0 14px; font-size: 24px; line-height: 1.2; }
.docs-cards { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 20px; }
.docs-home .docs-main h2 + .docs-cards { margin-top: 0; }
.docs-cards > li { position: relative; min-width: 0; border: 1px solid var(--line); transition: background-color .15s ease; }
.docs-cards > li:hover { background: var(--paper-2); }
.docs-cards > li:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.docs-cards h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.25; }
.docs-cards h3 a { color: var(--ink); text-decoration: none; }
.docs-cards h3 a::after { content: ""; position: absolute; inset: 0; }
.docs-cards h3 a:focus-visible { outline: none; }
.docs-cards p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.docs-cards .docs-text { padding: 16px 18px; }
.docs-art svg { display: block; width: 100%; }
.docs-big .docs-art { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.docs-big .docs-art svg { height: auto; aspect-ratio: 360 / 150; }
.docs-big h3 { font-size: 21px; }
.docs-big p { font-size: 15.5px; }
.docs-small { grid-auto-rows: 1fr; }
.docs-small > li { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; padding-left: 14px; }
.docs-small .docs-art svg { height: 96px; }
.docs-cards.docs-small .docs-text { padding: 18px 20px 18px 14px; }
.docs-list { list-style: none; margin: 0; padding: 0; }
.docs-list li { padding: 12px 0; }
.docs-list li + li { border-top: 1px solid var(--line); }
.docs-list li a { font-weight: 600; }
.docs-list li p { margin: 2px 0 0; max-width: 40em; }
.da :is(path, circle) { fill: none; stroke: var(--teal); stroke-linecap: round; stroke-linejoin: round; }
.da .da-main { fill: var(--teal); fill-opacity: .1; stroke-width: 1.6; }
.da .da-l { stroke-width: 2; }
.da :is(.da-d, .da-back) { stroke-width: 1.2; stroke-opacity: .55; }
.da .da-cover { fill: var(--paper); stroke: none; }
:is(.docs-big, li:hover) .da .da-cover { fill: var(--paper-2); }
.docs-foot { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }
.docs-foot a { color: inherit; }
.docs-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; font-size: var(--fs-body); }
.docs-steps a { color: var(--link); font-weight: 600; text-decoration: none; }
.docs-steps a:hover { text-decoration: underline; }
.docs-steps span { display: block; color: var(--muted); font-size: 13.5px; font-weight: 400; }
.docs-next { grid-column: 2; text-align: right; }

@media (min-width: 640px) { .docs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Laptops: the menu stays in view beside the text. */
@media (min-width: 1024px) {
  .docs { grid-template-columns: 200px minmax(0, 1fr); column-gap: 72px; padding-top: 0; }
  .docs-left, .docs-main, .docs-toc { padding-top: 32px; }
  .docs-main { position: relative; }
  /* Pages of the site that keep the menu: their grids and lists run from its line to the frame. */
  .docs-page { --outer: var(--gutter); }
  .docs-page .docs-main { --gutter: 36px; }
  .docs-page .prose :is(.routes, .changelog) { margin-right: calc(-1 * var(--outer)); }
  .docs-page .routes li:last-child, .docs-page .changelog section { padding-right: var(--outer); }
  .docs-main::before { content: ""; position: absolute; top: 0; bottom: calc(-1 * var(--section)); left: -36px; border-left: 1px solid var(--line); }
  .docs-menu { position: sticky; top: 24px; z-index: 2; margin: 0; border: 0; }
  .docs-menu > summary { display: none; }
  .docs-nav { max-height: calc(100vh - 90px); margin: 6px -16px 0 0; padding: 10px 10px 10px 0; overflow-y: auto; scrollbar-gutter: stable; }
  .docs-search { margin: 0; }
  .docs-search kbd { display: block; }
  #docs-results { position: absolute; top: 40px; left: 0; width: 460px; max-height: calc(100vh - 100px); overflow-y: auto; border-color: var(--muted); }
}
@media (min-width: 1200px) {
  .docs { grid-template-columns: 200px minmax(0, 1fr) 168px; column-gap: 64px; }
  .docs-main::before { left: -32px; }
  :is(.docs-home, .docs-page) .docs-main { grid-column: 2 / -1; }
  .docs-page .docs-main { --gutter: 32px; }
  .docs-toc { display: block; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; }
}
@media print {
  .docs-left, .docs-toc, .docs-steps, .docs .copy, .top, .foot { display: none; }
  .docs { display: block; }
  .docs-main::before { content: none; }
  .docs-body pre, .docs-body .cmd code { overflow: visible; white-space: pre-wrap; }
}
