/* Docs pages (/docs/...): the docs bar under the site header, the sidebar + article + "On this page"
 * layout, and the parts long-form docs need beyond site.css (code cards, option cards, notes, pager).
 * Tokens, .prose, .code, .table, .chip, .note and the .docs/.docs-nav grid come from site.css. */

/* Docs bar: page title and search, inside the ruled column */
.docs-bar-in { position: relative; max-width: 1140px; margin: 0 auto; padding: 40px 32px 20px; border-left: 1px solid var(--h-rule); border-right: 1px solid var(--h-rule); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.docs-title { font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.docs-title span { color: var(--h-text-3); font-weight: 500; }
.docs-search { position: relative; flex: 1 1 260px; max-width: 460px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--h-btn-line); border-radius: 999px; padding: 0 8px 0 16px; min-height: 44px; color: var(--h-text-3); }
.docs-search:focus-within { border-color: var(--h-blue); box-shadow: 0 0 0 4px rgba(47, 91, 234, .1); }
.docs-search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--h-ink); font: inherit; font-size: 15px; outline: none; }
.docs-search input::placeholder { color: var(--h-text-3); }
.docs-search kbd { font: 12px var(--h-mono); border: 1px solid var(--h-card-line); border-radius: 6px; padding: 1px 7px; background: var(--h-art); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout: the section below the bar; article beside an "On this page" list on wide screens */
.docs-page .col { padding-top: 48px; padding-bottom: 96px; }
.docs-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: start; }
.docs-toc { font-size: 14px; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--h-rule); padding-top: 20px; }
.docs-toc .h { font: 500 12px var(--h-mono); color: var(--h-text-3); letter-spacing: .05em; margin-bottom: 8px; }
.docs-toc a { color: var(--h-text-3); padding: 4px 0 4px 12px; border-left: 2px solid var(--h-rule); }
.docs-toc a:hover { color: var(--h-ink); }
.docs-toc a.sub { padding-left: 24px; }
.docs-toc a.sub2 { padding-left: 36px; font-size: 13px; }
.docs-toc a.top { color: var(--h-nav); font-weight: 500; }
.docs-toc a.is-active { color: var(--h-blue-hover); border-left-color: var(--h-blue); }
@media (min-width: 1180px) {
    .docs-body { grid-template-columns: minmax(0, 1fr) 168px; gap: 40px; }
    .docs-toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; border-top: 0; padding-top: 0; }
}

/* Article head and body */
.doc h1 { margin: 12px 0 0; color: var(--h-ink); font-size: clamp(34px, 4vw, 48px); line-height: 1.05; font-weight: 500; letter-spacing: -.035em; }
.doc .lede { margin-top: 16px; font-size: 19px; }
.doc .lede.sub { font-size: 16px; color: var(--h-text-3); margin-top: 12px; }
.doc ul { padding-left: 20px; }
.doc p > code, .doc li code { overflow-wrap: anywhere; }
.doc .note strong { color: var(--h-ink); }
.doc .table th { background: var(--h-art); color: var(--h-text-3); font-size: 13px; font-weight: 600; }
.doc .table tr:first-child > * { border-top: 0; }
.doc .table .w34 { width: 34%; }
.doc .table-wrap .table { min-width: 520px; }
.ok-ink { color: var(--h-ok-ink); font-weight: 500; }
.chip.ok { background: #EAF7EF; border-color: #CDEBD8; color: var(--h-ok-ink); }

/* Code: bare <pre> blocks and .code cards with a label bar and a copy button */
.doc pre { margin: 16px 0 0; background: var(--h-code-bg); color: var(--h-code-text); border-radius: 12px; padding: 16px 20px; font: 13.5px/1.75 var(--h-mono); overflow-x: auto; white-space: pre; box-shadow: 0 12px 30px rgba(10, 20, 60, .12); }
.doc pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.doc .code { padding: 0; overflow: hidden; }
.doc .code > pre { margin: 0; border-radius: 0; box-shadow: none; background: none; }
.code__bar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--h-code-line); font: 12px var(--h-mono); color: var(--h-code-dim); min-height: 40px; }
.code__bar .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code__bar button { font: 12px var(--h-mono); color: #E6E9EE; background: #1A1E27; border: 1px solid var(--h-code-line); border-radius: 999px; padding: 4px 14px; min-height: 28px; }
.code__bar button:hover { border-color: var(--h-code-faint); }
.code__bar button.is-copied { color: var(--h-pass); }
.doc .file { display: block; margin: 24px 0 -6px; font: 12px var(--h-mono); color: var(--h-text-3); scroll-margin-top: 96px; }

/* Side-by-side alternatives ("pick one") and the cards on how-it-works */
.doc .pick { margin-top: 16px; }
.doc .tray { margin-top: 20px; }
.doc .opt, .doc .mode { padding: 20px; min-width: 0; }
.doc .opt h4, .doc .opt h5, .doc .opt h6, .doc .mode h3 { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.doc .mode-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.doc .opt p, .doc .mode p, .doc .mode ul { font-size: 15px; }
.doc .opt .file { margin-top: 18px; }
.doc .opt pre { font-size: 12.5px; }
.doc .opt .note { margin-top: 12px; }
.doc div.ok, .doc div.soon { margin-top: 20px; padding: 14px 18px; border-radius: 12px; font-size: 15px; }
.doc div.ok { background: #EAF7EF; border: 1px solid #CDEBD8; color: #24553A; }
.doc div.soon { background: var(--h-art); border: 1px solid var(--h-card-line); }
.doc div.ok strong { color: var(--h-ok-ink); }

/* Tabs ([data-tabs]): a pale segmented bar, the selected tab in tray blue like the home page's tabs */
.doc .tabs { margin-top: 40px; }
.doc .tab-list { display: flex; gap: 2px; width: fit-content; max-width: 100%; padding: 4px; background: var(--h-art); border: 1px solid var(--h-card-line); border-radius: 12px; overflow-x: auto; }
.doc .tab-list [role="tab"] { flex: 0 0 auto; font: 600 15px/1 var(--h-sans); color: var(--h-text-3); background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 0 22px; min-height: 40px; cursor: pointer; transition: color .15s, background-color .15s; }
.doc .tab-list [role="tab"]:hover { color: var(--h-ink); }
.doc .tab-list [role="tab"][aria-selected="true"] { background: var(--h-tray); border-color: var(--h-tray-line); color: var(--h-blue-hover); }
.doc .tab-list [role="tab"]:focus-visible, .doc .tab-panel:focus-visible { outline: 2px solid var(--h-blue); outline-offset: 2px; }
.doc .tab-panel { position: relative; padding-top: 8px; }
.doc .tab-panel[hidden] { display: none; }
.doc .tabs.js .tab-panel > h2.platform { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; top: 0; scroll-margin-top: 200px; }
.doc .tabs:not(.js) .tab-list { display: none; }
.doc .tabs:not(.js) .tab-panel + .tab-panel { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--h-rule); }
.doc .tabs.js:not(.ready) .tab-panel ~ .tab-panel { display: none; }
.doc .tab-panel > h4.part { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--h-rule); scroll-margin-top: 64px; }
.doc .tab-panel > h3.lib { margin: 72px 0 0; font-size: 28px; line-height: 1.15; font-weight: 500; letter-spacing: -.025em; }
.doc .tab-panel > h4 { margin: 32px 0 0; font-size: 20px; letter-spacing: -.01em; scroll-margin-top: 96px; }
.doc .tab-panel > h5 { margin: 32px 0 0; color: var(--h-ink); font-size: 18px; font-weight: 600; scroll-margin-top: 96px; }
.doc .tab-panel > h2.platform + h3.lib { margin-top: 32px; }
.doc .opt h5, .doc .opt h6 { font-size: 16px; font-weight: 600; color: var(--h-ink); }
.doc .tab-panel .setup-end { margin-top: 28px; padding: 14px 18px; border-radius: 12px; background: var(--h-art); border: 1px solid var(--h-card-line); font-size: 15px; }
.doc ul.cases { list-style: none; padding: 0; margin-top: 16px; border: 1px solid var(--h-card-line); border-radius: 12px; }
.doc ul.cases li { padding: 14px 18px; font-size: 15px; color: var(--h-text-2); }
.doc ul.cases li + li { border-top: 1px solid var(--h-rule); }
.doc ul.cases li > strong:first-child { display: block; color: var(--h-ink); margin-bottom: 4px; }
.docs-toc a[hidden] { display: none; }

/* Previous / next */
.pager { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 8px; }
.doc .pager a { display: block; padding: 18px 20px; color: var(--h-ink); text-decoration: none; transition: border-color .15s; }
.doc .pager a:hover { border-color: var(--h-blue); }
.pager .dir { font-size: 13px; color: var(--h-text-3); }
.pager .to { margin-top: 4px; font-weight: 600; }
.pager .next { text-align: right; grid-column: -2; }

@media (max-width: 640px) {
    .docs-bar-in { padding: 32px 16px 16px; }
    .docs-page .col { padding-top: 32px; padding-bottom: 64px; }
    .doc .lede { font-size: 17px; }
    .doc pre { padding: 14px 16px; font-size: 12.5px; }
    .doc .code > pre { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .doc .pager a, .doc .tab-list [role="tab"] { transition: none; }
}

/* App screenshots in the "Using the app" guides */
.doc .shot { margin: 20px 0 0; }
.doc .shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--h-card-line); border-radius: 12px; }
.doc .shot-panel img { width: 240px; }
.doc .shot-dialog img { max-width: 480px; }
.doc .shot figcaption { margin-top: 8px; color: var(--h-text-3); font-size: 14px; }
