/* The docs site (ATLAS.md §20.3): built on the deck's own tokens and fonts (the runtime's page.css, linked before this),
   so a walkthrough reads as a part of the page around it. */

html.docs-site, html.docs-site body { height: auto; overflow: visible; }
html.docs-site { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
html.docs-site body { margin: 0; background: var(--ground); color: var(--text-2); font: 400 17px/1.65 var(--font); }
.docs-site a { color: var(--p-text); }
.docs-site :focus-visible { outline: 2px solid var(--p500); outline-offset: 2px; }

/* the top bar */
.docs-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 24px; box-sizing: border-box;
  background: var(--surface); border-bottom: 1px solid var(--edge); }
.docs-brand { display: flex; align-items: center; gap: 8px; flex: none; text-decoration: none; }
.docs-logo { display: block; width: 28px; height: 28px; }
.docs-logo svg { display: block; width: 100%; height: 100%; }
.docs-brand-word { font: 500 19px var(--display); color: var(--navy); }
.docs-brand-docs { font: 300 19px var(--display); color: var(--text-3); }
.docs-search { position: relative; flex: 1 1 auto; max-width: 520px; margin: 0 auto; }
.docs-search input { width: 100%; box-sizing: border-box; height: 38px; padding: 0 14px; border: 1px solid var(--edge); border-radius: 8px;
  background: var(--ground); color: var(--text); font: 400 15px var(--font); }
.docs-search input::placeholder { color: var(--text-3); }
.docs-search-results { position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto; padding: 6px; border: 1px solid var(--edge);
  border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(16, 24, 40, .16); }
.docs-search-results a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text-2); }
.docs-search-results a:hover, .docs-search-results a.active { background: var(--ground); }
.docs-search-results b { display: block; font: 500 15px var(--display); color: var(--navy); }
.docs-search-results small { display: block; font-size: 12px; color: var(--text-3); }
.docs-search-results span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; }
.docs-search-results p { margin: 6px 10px; font-size: 14px; color: var(--text-3); }
.docs-lang { position: relative; display: flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 8px; border: 1px solid var(--edge);
  border-radius: 8px; color: var(--text-2); font-size: 13px; }
.docs-lang select { appearance: none; border: 0; background: none; color: var(--text); font: 500 14px/32px var(--font); cursor: pointer; padding-right: 4px; }
.docs-lang select option { color: initial; }
.docs-icon { font: 500 13px var(--display); color: var(--text-3); }
.docs-theme, .docs-menu { flex: none; width: 34px; height: 34px; border: 1px solid var(--edge); border-radius: 8px; background: none; color: var(--text-2);
  font-size: 16px; cursor: pointer; }
.docs-theme::before { content: '◐'; }
.docs-menu { display: none; }
.docs-preview-line { padding: 6px 24px; background: var(--amber-soft); color: var(--amber); font: 500 13px var(--font); text-align: center; }

/* the tree, the page, its contents */
.docs-embed .docs-main { max-width: none; padding: 20px 20px 80px; }
.docs-embed .docs-main h1 { font-size: 28px; }
.docs-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr) 220px; gap: 48px; max-width: 1480px; margin: 0 auto; padding: 0 24px; }
.docs-nav { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 28px 0 40px; box-sizing: border-box; font-size: 14px; line-height: 1.4; }
.docs-nav ul { margin: 0; padding: 0; list-style: none; }
.docs-nav ul ul { margin: 2px 0 6px 12px; padding-left: 10px; border-left: 1px solid var(--fill-line); }
.docs-nav > ul > li { margin-bottom: 6px; }
.docs-nav > ul > li > a { font: 500 14px var(--display); color: var(--navy); }
.docs-nav a { display: block; padding: 5px 10px; border-radius: 6px; text-decoration: none; color: var(--text-2); }
.docs-nav a:hover { background: var(--surface); }
.docs-nav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 0 0 1px var(--edge); }
.docs-main { min-width: 0; max-width: 860px; padding: 36px 0 140px; }
.docs-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--text-3); }
.docs-crumbs a { color: var(--text-3); text-decoration: none; }
.docs-crumbs a:hover { color: var(--p-text); }
.docs-main h1 { margin: 0 0 18px; font: 500 38px/1.15 var(--display); color: var(--navy); letter-spacing: -0.01em; }
.docs-body h2, .docs-main .deck-doc-chapter h2 { margin: 48px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--fill-line); font: 500 30px/1.25 var(--display); color: var(--navy); }
.docs-body h3, .docs-main .deck-doc-step h3 { margin: 30px 0 8px; font: 600 21px/1.3 var(--display); color: var(--text); }
.docs-main .deck-doc-step h3 { margin-top: 8px; }
.docs-body h4 { margin: 22px 0 6px; font: 600 17px var(--display); color: var(--text); }
.docs-body p, .docs-body ul, .docs-body ol { margin: 0 0 14px; color: var(--text); }
.docs-body ul, .docs-body ol { padding-left: 24px; }
.docs-body li { margin: 4px 0; }
.docs-body strong { color: var(--text); }
.docs-body code { font: 400 0.88em var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
.docs-body pre { overflow-x: auto; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); font-size: 14px; line-height: 1.5; }
.docs-body pre code { padding: 0; background: none; }
.docs-body blockquote { margin: 0 0 16px; padding: 12px 16px 2px; border-left: 3px solid var(--p300); background: var(--surface); border-radius: 0 6px 6px 0; }
.docs-body img { max-width: 100%; height: auto; border: 1px solid var(--edge); border-radius: 8px; }
.docs-table { overflow-x: auto; margin: 0 0 16px; }
.docs-table table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
.docs-table th, .docs-table td { padding: 8px 10px; border-bottom: 1px solid var(--fill-line); text-align: left; vertical-align: top; }
.docs-table th { font-weight: 700; color: var(--text); background: var(--surface-2); }
.docs-ref { margin: 0 0 18px; }
.docs-ref .docs-body h2 { margin-top: 16px; font-size: 20px; border: 0; padding: 0; }
.docs-callout { margin: 0 0 16px; padding: 12px 16px 2px; border: 1px solid var(--hair); border-left: 3px solid var(--p300); border-radius: 0 8px 8px 0; background: var(--surface); }
.docs-callout-tip { border-left-color: var(--ok); background: var(--ok-soft); }
.docs-callout-warning { border-left-color: var(--amber); background: var(--amber-soft); }
.docs-notice { margin: 0 0 20px; padding: 10px 14px; border: 1px solid var(--hair); border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 14px; }
.docs-empty { color: var(--text-3); }
.docs-toc { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 40px 0; box-sizing: border-box; font-size: 13px; line-height: 1.4; }
.docs-toc[hidden], .docs-toc:not(.has-entries) { visibility: hidden; }
.docs-toc-title { margin-bottom: 8px; font: 600 12px var(--display); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.docs-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--fill-line); }
.docs-toc li a { display: block; margin-left: -1px; padding: 3px 0 3px 12px; border-left: 2px solid transparent; color: var(--text-3); text-decoration: none; }
.docs-toc li.sub a { padding-left: 24px; }
.docs-toc li a:hover { color: var(--p-text); }
.docs-toc li a.active { border-left-color: var(--navy); color: var(--text); font-weight: 600; }

/* the walkthrough: the deck's document walkthrough, a part of the page */
.docs-walkthrough { margin-top: 36px; }
.docs-walkthrough-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); }
.docs-walkthrough-label { flex: 1; font: 600 12px var(--display); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.docs-button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--navy); border-radius: 8px; background: var(--navy);
  color: var(--surface) !important; font: 500 14px var(--display); text-decoration: none; cursor: pointer; }
.docs-button .docs-icon { color: inherit; font-size: 11px; }
.docs-button-quiet { background: none; border-color: var(--edge); color: var(--text-2) !important; }
.docs-loading { color: var(--text-3); }
.docs-watch { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: rgba(10, 16, 24, .72); }
.docs-watch[hidden] { display: none; }
.docs-watch-box { position: relative; width: min(1280px, 100%, calc((100vh - 48px) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.docs-watch iframe { display: block; width: 100%; height: 100%; border: 0; }
.docs-watch-close { position: absolute; top: -2px; right: 4px; z-index: 1; border: 0; background: none; color: #fff; font-size: 30px; cursor: pointer; }

/* the start page and a page's pages */
.docs-hero { padding: 24px 0 12px; }
.docs-hero h1 { font-size: 44px; }
.docs-hero p { max-width: 640px; margin: 0; font: 300 20px/1.5 var(--display); color: var(--text-2); }
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 36px; }
.docs-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); text-decoration: none; }
.docs-card:hover { border-color: var(--p300); }
.docs-card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font: 500 18px/1.3 var(--display); color: var(--navy); }
.docs-card-kind { flex: none; font: 600 11px var(--display); color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.docs-card-text { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.docs-card-more { font-size: 13px; color: var(--text-3); }

@media (max-width: 1240px) {
  .docs-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-top { gap: 8px; padding: 0 16px; }
  .docs-brand-docs, .docs-lang .docs-icon { display: none; }
  .docs-menu { display: block; }
  .docs-layout { display: block; padding: 0 16px; }
  .docs-nav { position: fixed; top: 60px; left: 0; bottom: 0; z-index: 9; width: 290px; max-height: none; padding: 20px 16px; background: var(--ground);
    border-right: 1px solid var(--edge); transform: translateX(-100%); transition: transform .2s; }
  body.docs-nav-open .docs-nav { transform: none; }
  .docs-main { padding-top: 24px; }
  .docs-main h1 { font-size: 30px; }
  .docs-body h2, .docs-main .deck-doc-chapter h2 { font-size: 25px; }
}
@media (max-width: 560px) {
  .docs-brand-word { display: none; }
  .docs-lang { padding: 0 4px; }
  .docs-lang select { max-width: 76px; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { .docs-nav { transition: none; } }
@media print {
  .docs-top, .docs-nav, .docs-toc, .docs-walkthrough-bar, .docs-preview-line { display: none; }
  .docs-layout { display: block; }
  html.docs-site body { background: #fff; }
}
