/* Docs (site/docs/*, built by scripts/build-docs.mjs; docs/design/docs-site-2026-10-13.md), plus the pages that share
   the docs sidebar (/trust) and the old help home (support.html, kept for the language copies). Shared tokens, .prose,
   .prompt-line and .copy-btn live in /styles.css. */

/* Docs use the same page width as the rest of the site, so the header, sidebar and footer line up across pages. */

/* ---- Sidebar (all pages with nav.docs-nav) ---- */
.docs-nav { font-size: var(--fs-sm); }
.docs-nav-home { display: block; padding: 6px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.docs-nav-title { margin: 18px 0 6px; padding: 0 12px; font: 500 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: block; position: static; }
.docs-nav li { margin: 0; }
.docs-nav ul a { display: block; padding: 6px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink); text-decoration: none; line-height: 1.35; }
.docs-nav a:hover { background: var(--line); }
.docs-nav a[aria-current="page"] { background: var(--hl); font-weight: 700; box-shadow: inset 3px 0 0 var(--line-strong); }
.docs-layout .crumbs { margin-bottom: 18px; }
.docs-layout .crumbs [aria-current] { color: var(--ink); }

/* Pages that only borrow the sidebar (/trust): column from 900px, after the article on phones. */
.docs-layout:not([data-built]) .docs-nav { padding: 0; }
@media (min-width: 900px) {
  .docs-layout:not([data-built]) .docs-nav { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 104px); overflow-y: auto; }
}
@media (max-width: 899px) {
  .docs-layout:not([data-built]) .docs-nav { order: 2; padding-top: 24px; border-top: 1px solid var(--line); }
}

/* ---- Built docs layout: sidebar | article | on this page ---- */
.docs-layout[data-built] { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; padding-top: 20px; padding-bottom: 56px; }
.docs-main { min-width: 0; }
.docs-side { min-width: 0; }
@media (min-width: 900px) {
  .docs-layout[data-built] { grid-template-columns: 236px minmax(0, 1fr); padding-top: 32px; }
  .docs-side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding: 2px 4px 24px 2px; margin-left: -12px; }
  .docs-toc, .docs-toc-empty { display: none; }
}
@media (min-width: 1240px) {
  .docs-layout[data-built] { grid-template-columns: 216px minmax(0, 1fr) 176px; gap: 0 32px; }
  .docs-layout[data-built]:has(.docs-home) { grid-template-columns: 216px minmax(0, 1fr); gap: 0 48px; }
  .docs-toc { display: block; position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
  .docs-toc-empty { display: block; }
  .toc-inline { display: none; }
}
/* Phones: the "Docs menu" button opens the sidebar (js/docs.js). Without JS the sidebar follows the article. */
.docs-menu-btn { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin: 0 0 16px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 600 15px/1 var(--body); cursor: pointer; }
.docs-menu-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.docs-menu-btn[hidden] { display: none; }
@media (max-width: 899px) {
  .docs-side { order: 3; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
  .docs-js .docs-side { order: 0; margin: 0 0 24px; padding: 16px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .docs-js .docs-side:not(.is-open) { display: none; }
  .docs-toc, .docs-toc-empty { display: none; }
}
@media (min-width: 900px) { .docs-menu-btn { display: none !important; } }

/* ---- Search (js/docs.js shows it) ---- */
.docs-search { position: relative; margin: 0 0 8px; }
.docs-search[hidden] { display: none; }
.docs-q { width: 100%; min-height: 42px; padding: 9px 40px 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 15px/1.3 var(--body); }
.docs-q:focus { outline: none; border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--hl); }
.docs-kbd { position: absolute; right: 10px; top: 11px; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--muted); font-size: 12px; text-align: center; pointer-events: none; }
.docs-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 480px); overflow-y: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(20, 20, 40, 0.16); }
.docs-results[hidden] { display: none; }
.docs-results ul { list-style: none; margin: 0; padding: 0; }
.docs-results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.docs-results a:hover, .docs-results a[aria-selected="true"] { background: var(--hl); }
.docs-results .r-title { display: block; font-weight: 600; font-size: 15px; }
.docs-results .r-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.docs-results .r-none { padding: 10px; color: var(--muted); font-size: 14px; margin: 0; }
@media (max-width: 899px) { .docs-side .docs-results { position: static; box-shadow: none; margin-top: 6px; } }

/* ---- Article ---- */
.docs-article { max-width: 760px; }
.docs-article h1 { color: var(--brand); font: 700 clamp(30px, 3vw + 14px, 44px)/1.12 var(--body); letter-spacing: -0.02em; margin: 0 0 14px; }
.docs-article h2 { scroll-margin-top: 88px; }
.docs-article h3 { scroll-margin-top: 88px; }
.docs-article .lead { margin-top: 0; }
.docs-article .updated { margin: 0 0 24px; font-size: var(--fs-xs); }
.docs-article .updated a { color: var(--muted); }
.docs-article :target { animation: docs-flash 1.6s ease-out; }
@keyframes docs-flash { from { background: var(--hl); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .docs-article :target { animation: none; } }

/* On this page */
.toc-title { margin: 0 0 8px; font: 500 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.docs-toc ul, .toc-inline ul { list-style: none; margin: 0; padding: 0 !important; }
.docs-toc li, .toc-inline li { margin: 0; }
.docs-toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; }
.docs-toc a:hover { color: var(--ink); }
.docs-toc a.is-current { color: var(--ink); border-left-color: var(--line-strong); font-weight: 600; }
.toc-inline { margin: 0 0 28px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.toc-inline summary { margin: 0; cursor: pointer; list-style-position: inside; }
.toc-inline[open] summary { margin-bottom: 8px; }
.toc-inline ul { columns: 2 200px; column-gap: 24px; }
.toc-inline a { display: inline-block; padding: 3px 0; font-size: 15px; }

/* "Say this to your AI" */
.say { margin: 16px 0 20px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 3px 3px 0 var(--line-strong); }
.say-label { margin: 0 0 10px !important; font: 600 13px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand); }
.say .prompt-line code { font-size: 15px; }
.say-note { margin: 10px 0 0 !important; color: var(--muted); font-size: var(--fs-sm); }

/* Code blocks */
.code-block { position: relative; margin: 16px 0 20px; }
.code-block pre { margin: 0; padding-top: 36px; }
.code-lang { position: absolute; left: 14px; top: 10px; font: 500 12px/1 var(--mono); color: var(--muted); text-transform: lowercase; }
.copy-btn.copy-code { position: absolute; right: 8px; top: 6px; min-height: 30px; min-width: 64px; padding: 6px 10px; font-size: 13px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.copy-btn.copy-code:hover { border-color: var(--line-strong); }
.copy-btn.copy-code[data-copied] { background: var(--ink); color: var(--paper); }

/* Callouts */
.prose .callout { position: relative; margin: 20px 0; padding: 14px 16px 14px 18px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: var(--surface); }
.prose .callout p { margin: 0; }
.callout-title { margin-right: 4px; }
.callout-note { border-left-color: var(--primary) !important; }
.callout-tip { border-left-color: var(--live) !important; }
.callout-warn { border-left-color: var(--alert) !important; background: var(--alert-bg) !important; }
.callout-plans { border-left-color: var(--line-strong) !important; background: var(--bg) !important; }

/* Tables scroll on their own on phones */
.table-wrap { max-width: 100%; overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.table-wrap table { margin: 0; }
.prose .table-wrap td code { white-space: normal; overflow-wrap: anywhere; }

/* Feedback and prev/next */
.docs-feedback { max-width: 760px; margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.prev-next { max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.prev-next a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0; }
.prev-next a:hover { border-color: var(--line-strong); }
.pn-next { text-align: right; grid-column: 2; }
.pn-label { display: block; color: var(--muted); font-size: 13px; }
.pn-title { display: block; font-weight: 600; overflow-wrap: anywhere; }

/* ---- Docs home ---- */
.docs-home { max-width: 980px; }
.docs-hero { padding: 8px 0 8px; }
.docs-hero h1 { margin-bottom: 12px; }
.docs-hero .lead { max-width: 680px; margin: 0 0 20px; font-size: var(--fs-lede); color: var(--muted); }
.docs-search-big { max-width: 560px; margin-bottom: 18px; }
.docs-search-big .docs-q { min-height: 52px; font-size: 17px; border-color: var(--line-strong); }
.docs-search-big .docs-kbd { top: 15px; }
.docs-hero-say { max-width: 560px; }
.docs-moved { display: none; }
@media (min-width: 900px) { .docs-layout:has(.docs-home) .docs-side .docs-search { display: none; } }
.docs-group { margin-top: 48px; scroll-margin-top: 88px; }
.docs-group h2 { margin: 0 0 6px; font-size: var(--fs-h2); }
.docs-group-lede { margin: 0 0 18px; color: var(--muted); max-width: 680px; }
.docs-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .docs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .docs-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } .docs-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.docs-cards li { margin: 0; }
.docs-card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color var(--ease), transform var(--ease); }
.docs-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.docs-card-title { font-weight: 700; font-size: 17px; }
.docs-card-text { color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.docs-step { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-bottom: 6px; border-radius: 50%; background: var(--field); color: var(--brand); font-weight: 700; font-size: 14px; border: 1.5px solid var(--line-strong); }
.docs-cards-steps .docs-card { border-color: var(--line-strong); }
.docs-help-row { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .docs-help-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.docs-help-row .say { margin: 0; }
.docs-for-ai { padding-top: 24px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .docs-card { transition: none; } .docs-card:hover { transform: none; } }

/* ---- Old help home (support.html) and older docs bits ---- */
.prose table.records td code { overflow-wrap: anywhere; word-break: break-word; }
.help-top { padding-bottom: var(--s-7); }
.help-top .page-head { margin-bottom: var(--s-5); }
.help-group { scroll-margin-top: 72px; }
.help-group .section-head { margin-bottom: var(--s-5); }
.help-card { display: flex; flex-direction: column; gap: var(--s-2); height: 100%; }
.help-card h3 { font-size: var(--fs-h3); line-height: 1.3; margin: 0; }
.help-card p { font-size: var(--fs-sm); }
.help-card .text-link { margin-top: auto; padding-top: var(--s-2); color: var(--primary); font-size: var(--fs-sm); }
a.help-card:hover .text-link { text-decoration: underline; }
a.help-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.help-contact-row { margin-top: var(--s-5); }
.support-ask { max-width: 760px; margin: 0 0 var(--s-4); padding: 18px 18px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.support-ask p { margin: 0; }
.support-ask .act-label { margin-bottom: 10px; }
.support-ask .act-hint { margin-top: 10px; }
.jump { list-style: none; margin: 12px 0 8px; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.jump li { margin: 0; }
.jump a { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); }
