/* Docs pages (/docs, /docs/*). Page-specific additions on top of style.css (docs layout lives there, section 6).
   Loaded by every docs page through its front-matter `head:` line. Tokens only, no hex. */

/* ---- sidebar ---- */
.docs-nav details > summary { list-style: none; }
.docs-nav details > summary::-webkit-details-marker { display: none; }
@media (min-width: 821px) { .docs-nav details > summary { display: none; } }
@media (max-width: 820px) {
  .docs-nav details > summary { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }
  .docs-nav details > summary::after { content: "+"; font: 500 18px/1 var(--mono); color: var(--muted); }
  .docs-nav details[open] > summary::after { content: "−"; }
  .docs-nav details[open] > summary { margin-bottom: 12px; }
}
.docs-nav .ver { display: flex; align-items: center; gap: 8px; font: 500 12px var(--mono); color: var(--muted); margin: 0 0 18px; }
.docs-nav .ver b { color: var(--ink); font-weight: 600; }

/* search (JS only: hidden without it) */
.docs-search { position: relative; margin: 0 0 22px; }
.no-js .docs-search { display: none; }
.docs-search input { width: 100%; height: 38px; padding: 0 44px 0 34px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--card); color: var(--ink); font: 400 14px var(--sans); }
.docs-search input::placeholder { color: var(--muted); }
.docs-search input:focus-visible { border-color: var(--ink); }
.docs-search > svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.docs-search kbd { position: absolute; right: 9px; top: 9px; font-size: 11px; color: var(--muted); }
.docs-search .results { position: absolute; z-index: 30; left: 0; top: 44px; width: min(420px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; margin: 0; list-style: none; }
.docs-search .results a { display: block; padding: 9px 10px; margin: 0; border-radius: 7px; text-decoration: none; color: var(--text); }
.docs-search .results a:hover, .docs-search .results a[aria-selected="true"] { background: var(--bg-2); color: var(--ink); }
.docs-search .results b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.docs-search .results span { display: block; font: 500 11.5px var(--mono); color: var(--muted); margin-top: 2px; }
.docs-search .results mark { background: var(--amber-bg); color: var(--ink); border-radius: 2px; }
.docs-search .results .none { padding: 10px; color: var(--muted); font-size: 14px; }

/* ---- article ---- */
.docs-main .lab { margin-bottom: 14px; }
.docs-main > h1 { margin-bottom: 14px; }
.docs-main > .lede { font-size: 19px; margin-bottom: 28px; }
.docs-main.prose h2 { padding-top: 8px; scroll-margin-top: calc(var(--header-h) + 16px); }
.docs-main.prose h2:first-of-type { margin-top: 1.4em; }
.docs-main.prose h3 { font-size: 19px; scroll-margin-top: calc(var(--header-h) + 16px); }
.docs-main :not(pre) > code { white-space: normal; overflow-wrap: anywhere; }
.docs-main .table-wrap { margin: 1.4em 0 1.6em; }
.docs-main .table-wrap .table { margin: 0; }
.docs-main .table td code, .docs-main .table th code { white-space: nowrap; }
.docs-main .window, .docs-main .tabs, .docs-main .grid, .docs-main .doc-tool { margin: 1.6em 0; }
.docs-main .window { box-shadow: var(--shadow); }
.docs-main .card h3 { margin-top: 0; font-size: 17px; }
.docs-main .card p { font-size: 15px; }
.docs-main hr { margin: 40px 0; }
.docs-main .anchor { color: var(--faint); text-decoration: none; margin-left: 8px; font-weight: 400; opacity: 0; }
.docs-main h2:hover .anchor, .docs-main h3:hover .anchor, .docs-main .anchor:focus-visible { opacity: 1; }
.docs-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 48px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font: 500 12.5px var(--mono); color: var(--muted); }
.docs-meta a { color: var(--muted); }
.docs-pager a.prev-only { grid-column: 1; }
@media (max-width: 560px) { .docs-pager { grid-template-columns: 1fr; } .docs-pager a.next { grid-column: 1; } }

/* quickstart steps: big mono numbers down a rule */
.qs { list-style: none; counter-reset: qs; padding: 0 !important; margin: 1.6em 0 !important; }
.qs > li { counter-increment: qs; position: relative; padding: 0 0 28px 58px; margin: 0 !important; }
.qs > li::before { content: counter(qs, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); display: grid; place-items: center; font: 600 13px var(--mono); color: var(--ink); }
.qs > li::after { content: ""; position: absolute; left: 19px; top: 44px; bottom: 6px; width: 1px; background: var(--line); }
.qs > li:last-child::after { display: none; }
.qs > li > h3 { margin: 6px 0 6px !important; font-size: 18px !important; }
.qs > li > p { color: var(--text); margin-bottom: .6em; }
.qs > li .code, .qs > li .window { margin: 12px 0 4px; }

/* endpoint blocks for the API reference */
.ep { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); margin: 1.4em 0 2em; overflow: hidden; }
.ep > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ep > header code { background: none !important; border: 0 !important; padding: 0 !important; font: 600 14.5px var(--mono); color: var(--ink); overflow-wrap: anywhere; white-space: normal; }
.ep > header .auth { margin-left: auto; font: 500 11.5px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.ep > .body { padding: 16px 18px 4px; }
.ep > .body > p { font-size: 15.5px; }
.ep .code { margin: 12px 0 14px; }
.ep .code pre { font-size: 12.5px; }
.ep dl.fields { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 6px 16px; margin: 4px 0 14px; font-size: 14.5px; }
.ep dl.fields dt { font: 500 13px var(--mono); color: var(--ink); padding-top: 2px; }
.ep dl.fields dt i { font-style: normal; color: var(--muted); font-weight: 400; }
.ep dl.fields dd { margin: 0; color: var(--text); }
.ep .codes { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 500 12.5px var(--mono); color: var(--muted); margin: 0 0 14px; }
.ep .codes b { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .ep dl.fields { grid-template-columns: minmax(0, 1fr); gap: 2px; } .ep dl.fields dd { margin-bottom: 8px; } .ep > header .auth { margin-left: 0; } }
.method { display: inline-block; min-width: 52px; text-align: center; }

/* endpoint index table */
.ep-index td:first-child { white-space: nowrap; width: 1%; }
.ep-index td code { font-size: 13px; }

/* live tools on docs pages (verifier, badge builder, try-it) */
.doc-tool { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--card); padding: 22px; box-shadow: var(--shadow); }
.doc-tool > .lab { margin-bottom: 10px; }
.doc-tool h3 { margin: 0 0 6px !important; font-size: 18px !important; }
.doc-tool > p { color: var(--muted); font-size: 15px; }
.doc-tool .fields-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 14px 0 4px; }
.doc-tool .fields-row .field { flex: 1 1 260px; margin: 0; }
.doc-tool textarea { width: 100%; min-height: 120px; font: 400 12.5px/1.55 var(--mono); }
.doc-tool .out { margin-top: 14px; }
.doc-tool .out:empty { display: none; }
.doc-tool .result-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 15px; margin: 0 0 10px; }
.doc-tool pre.json { margin: 0; max-height: 360px; overflow: auto; padding: 14px 16px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); font: 400 12.5px/1.6 var(--mono); color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.no-js .doc-tool .needs-js { display: none; }
.doc-tool .nojs-note { display: none; }
.no-js .doc-tool .nojs-note { display: block; }
.doc-tool .badge-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--bg); margin: 12px 0; min-height: 52px; }
.doc-tool .badge-preview img { height: 20px; width: auto; }

/* badge state samples (unused: docs inline the real badge SVGs) */
.badge-sample { display: inline-flex; border-radius: 4px; overflow: hidden; font: 500 11.5px/20px var(--sans); color: #fff; white-space: nowrap; vertical-align: middle; }
.badge-sample > span { padding: 0 7px; }
.badge-sample > span:first-child { background: #1c1917; }
.badge-sample .s-green { background: #2ea44f; } .badge-sample .s-amber { background: #dfb317; color: #1c1917; } .badge-sample .s-grey { background: #6e6e6e; }

/* small two-column "you / we" or definition grids */
.defs { display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); overflow: hidden; margin: 1.4em 0 1.8em; }
.defs dt, .defs dd { padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.defs dt { font-weight: 600; color: var(--ink); background: var(--bg-2); }
.defs dd { font-size: 15.5px; }
.defs dt:last-of-type, .defs dd:last-of-type { border-bottom: 0; }
.defs dt code { font-size: 13px; }
@media (max-width: 560px) { .defs { grid-template-columns: minmax(0, 1fr); } .defs dt { border-bottom: 0; padding-bottom: 4px; } .defs dd { padding-top: 6px; } }

/* glossary */
.gloss { margin: 1.2em 0 2em; }
.gloss dt { font-weight: 650; color: var(--ink); font-size: 17px; margin-top: 22px; scroll-margin-top: calc(var(--header-h) + 16px); }
.gloss dt .lab { margin: 0 0 0 8px; font-size: 11px; vertical-align: middle; }
.gloss dd { margin: 4px 0 0; color: var(--text); }
.gloss-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none !important; }
.gloss-letters li { margin: 0 !important; }
.gloss-letters a { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font: 600 13px var(--mono); background: var(--card); }
.gloss-letters a:hover { border-color: var(--ink); }

/* docs home */
.docs-hero { padding: 6px 0 8px; }
.docs-hero h1 { font-size: clamp(36px, 4.6vw, 54px) !important; line-height: 1.05; }
.docs-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 1.6em 0 2em; }
.docs-paths .card { padding: 20px 22px; }
.docs-paths .card .n-big { display: block; font: 500 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.docs-paths .card h3 { font-size: 17px; margin: 0 0 4px; }
.docs-paths .card p { font-size: 14.5px; margin: 0; }
@media (max-width: 640px) { .docs-paths { grid-template-columns: minmax(0, 1fr); } }

.status-key { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; align-items: center; margin: 1.2em 0 1.8em; }
.status-key dt { margin: 0; } .status-key dd { margin: 0; font-size: 15.5px; }
@media (max-width: 560px) { .status-key { grid-template-columns: minmax(0, 1fr); gap: 4px; } .status-key dd { margin-bottom: 10px; } }

.platforms { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.4em; padding: 0; list-style: none !important; }
.platforms li { margin: 0 !important; }
.platforms a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; text-decoration: none; background: var(--card); }
.platforms a:hover { border-color: var(--ink); }
.ep > header h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 !important; font-size: inherit !important; line-height: 1.3; }
.ep > header h3 .method { flex: none; }
.ep-index th[scope="rowgroup"] { background: var(--bg-2); font: 600 12.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.ep-index th[scope="rowgroup"] a { color: var(--ink); text-decoration: none; }
.ep-index td a { text-decoration: none; }
.ep-index td a:hover code { border-color: var(--ink); }
.gloss-letters + h2 { margin-top: 1em !important; }
/* phones: two-column tables wrap; wider tables keep a readable width and scroll sideways inside .table-wrap */
@media (max-width: 560px) {
  .docs-main .table td code, .docs-main .table th code { white-space: normal; overflow-wrap: anywhere; }
  .docs-main .table.compact th, .docs-main .table.compact td { padding: 10px 12px; }
  .docs-main .table:has(thead th:nth-child(3)) { min-width: 600px; }
  .docs-main .table:has(thead th:nth-child(3)) td code, .docs-main .table:has(thead th:nth-child(3)) th code { white-space: nowrap; }
}
.ep > .body > p.codes { font-size: 12.5px; line-height: 1.5; }
@media (min-width: 821px) { .docs-nav a { padding-top: 5px; padding-bottom: 5px; } .docs-nav h2 { margin: 22px 0 8px; } .docs-search { margin-bottom: 18px; } }
/* long "Send GET /path" labels wrap inside the try-it panel on phones */
.doc-tool [data-send] { white-space: normal; text-align: left; max-width: 100%; height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; line-height: 1.35; overflow-wrap: anywhere; }
