/* docs12: /docs (board/pages_docs.py). Same system as board.css (redesign10/DESIGN.md): tokens only, 1px rules, 4px
   radius, no shadows, amber marks the current place, green/red never used for decoration. Three columns on wide
   screens (nav · page · on this page), two from 960px, one on phones with the nav behind a button. */
.docs { display: grid; grid-template-columns: 248px minmax(0, 1fr) 220px; gap: 0 40px; align-items: start; padding-top: 4px; }
@media (max-width: 1239px) { .docs { grid-template-columns: 232px minmax(0, 1fr); gap: 0 32px; } .docs-toc { display: none; } }
@media (max-width: 959px) { .docs { grid-template-columns: minmax(0, 1fr); } }

/* ---- left: search + nav -------------------------------------------------------------------------------------------- */
.docs-side { position: sticky; top: calc(var(--head-h) + 1px); max-height: calc(100vh - var(--head-h) - 1px); overflow-y: auto;
  padding: 14px 4px 24px 0; border-right: 1px solid var(--line); overscroll-behavior: contain; scrollbar-width: thin; }
.docs-search { position: relative; margin: 0 12px 14px 0; }
.docs-search input { width: 100%; height: 34px; padding: 0 30px 0 32px; font: inherit; font-size: var(--fs-13); color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); }
.docs-search input::placeholder { color: var(--text-dim); }
.docs-search input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-search-ico { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--text-dim); pointer-events: none; }
.docs-q-key { position: absolute; right: 8px; top: 7px; font: inherit; font-size: var(--fs-11); color: var(--text-dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; line-height: 18px; }
.docs-search input:focus ~ .docs-q-key, .docs-search input:not(:placeholder-shown) ~ .docs-q-key { display: none; }
@media (max-width: 959px), (pointer: coarse) { .docs-q-key { display: none; } }
.docs-results { position: absolute; z-index: 25; top: 38px; left: 0; width: 100%; max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 4px 0; }
.docs-results a { display: block; padding: 8px 12px; text-decoration: none; border-left: 2px solid transparent; }
.docs-results a:hover, .docs-results a[aria-selected="true"] { background: var(--surface); border-left-color: var(--closed); }
.docs-results .r-t { display: block; font-size: var(--fs-13); font-weight: 600; color: var(--text); }
.docs-results .r-s { display: block; font-size: var(--fs-11); color: var(--text-dim); margin-top: 1px; }
.docs-results .r-x { display: block; font-size: var(--fs-12); color: var(--text-dim); margin-top: 3px; line-height: 1.45; }
.docs-results mark { background: var(--tint-closed); color: var(--text); border-radius: 2px; padding: 0 1px; }
.docs-results .r-none { padding: 10px 12px; font-size: var(--fs-13); color: var(--text-dim); }

.docs-menu-btn { display: none; }
.docs-sec + .docs-sec { margin-top: 18px; }
.docs-sec-h { font-size: var(--fs-11); font-weight: 600; letter-spacing: .02em; color: var(--text-dim); margin: 0 0 4px; padding-left: 10px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 5px 10px; font-size: var(--fs-13); line-height: 1.35; color: var(--text-dim); text-decoration: none; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.docs-nav a:hover { color: var(--text); background: var(--hover); }
.docs-nav a[aria-current="page"] { color: var(--text); font-weight: 600; background: var(--surface); box-shadow: inset 2px 0 0 var(--closed); }

@media (max-width: 959px) {
  .docs-side { position: static; max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 0 10px; }
  .docs-search { margin: 0 0 8px; }
  .docs-results { width: 100%; }
  .js .docs-menu-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 10px; font: inherit; font-size: var(--fs-13);
    color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; text-align: left; }
  .docs-menu-btn svg { width: 16px; height: 16px; flex: none; color: var(--text-dim); }
  .docs-menu-btn span:first-of-type { color: var(--text-dim); white-space: nowrap; }
  .docs-menu-cur { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .docs-menu-cur::before { content: "/"; color: var(--line); margin-right: 8px; font-weight: 400; }
  .js .docs-nav { display: none; }
  .js .docs-side.is-open .docs-nav { display: block; padding: 12px 0 4px; }
  .docs-nav a { padding: 9px 10px; font-size: var(--fs-14); }
}

/* ---- the page ----------------------------------------------------------------------------------------------------- */
.docs-main { min-width: 0; max-width: 78ch; padding: 14px 0 0; font-size: 0.9375rem; }
.docs-crumb { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: var(--fs-12); color: var(--text-dim); }
.docs-crumb li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.docs-crumb a { color: var(--text-dim); }
.docs-h1 { font-size: clamp(1.625rem, 1vw + 1.25rem, 2rem); margin: 6px 0 0; }
.docs-lede { margin-top: 8px; color: var(--text-dim); font-size: var(--fs-16); line-height: 1.5; }
.docs-body { margin-top: 8px; }
.docs-body > * + * { margin-top: 14px; }
.docs-body p, .docs-body li, .docs-body dd { line-height: 1.65; }
.docs-body h2 { font-size: 1.3125rem; font-weight: 800; font-stretch: 87.5%; line-height: 1.2; margin-top: 36px; padding-top: 4px; scroll-margin-top: calc(var(--head-h) + 12px); }
.docs-body h3 { font-size: var(--fs-16); font-weight: 700; margin-top: 26px; scroll-margin-top: calc(var(--head-h) + 12px); }
.docs-body h2 + *, .docs-body h3 + * { margin-top: 8px; }
.dh-link { margin-left: 8px; font-weight: 400; color: var(--line); text-decoration: none; opacity: 0; }
h2:hover .dh-link, h3:hover .dh-link, .dh-link:focus { opacity: 1; color: var(--text-dim); }
.docs-body ul, .docs-body ol { padding-left: 1.3em; margin-bottom: 0; }
.docs-body li + li { margin-top: 6px; }
.docs-body li > ul, .docs-body li > ol { margin-top: 6px; }
.docs-body a { color: var(--text); text-decoration-color: color-mix(in srgb, var(--closed) 70%, transparent); }
.docs-body a:hover { text-decoration-color: var(--closed); }
.docs-body a.gl { text-decoration-style: dotted; text-decoration-color: var(--text-dim); }
.docs-body strong { font-weight: 650; }
.docs-body code, .docs-body kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.84em; }
.docs-body code { background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; font-weight: 400; white-space: break-spaces; }
.docs-body kbd { display: inline-block; min-width: 1.6em; text-align: center; padding: 0 5px; line-height: 1.55; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; white-space: nowrap; }
.docs-body pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font-size: var(--fs-13); line-height: 1.55; }
.docs-body pre code { background: none; border: 0; padding: 0; font-size: inherit; white-space: pre; }
.docs-body .ui { font-weight: 600; white-space: nowrap; }
.docs-body .ui::before { content: "“"; color: var(--text-dim); font-weight: 400; }
.docs-body .ui::after { content: "”"; color: var(--text-dim); font-weight: 400; }
.docs-body .num { font-variant-numeric: tabular-nums; }
.docs-body hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* steps: numbered, ruled, compact */
.docs-steps { list-style: none; padding: 0 !important; counter-reset: st; }
.docs-steps > li { position: relative; padding: 0 0 0 40px; counter-increment: st; }
.docs-steps > li + li { margin-top: 14px; }
.docs-steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center;
  font-size: var(--fs-13); font-weight: 700; color: var(--navy); background: var(--amber); border-radius: var(--radius-s); font-variant-numeric: tabular-nums; }
.docs-steps > li > strong:first-child { display: block; }

/* callouts: a ruled band with a coloured left edge (no fills that shout) */
.docs-note { border: 1px solid var(--line); border-left: 3px solid var(--text-dim); border-radius: var(--radius-s); padding: 10px 14px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.docs-note > * + * { margin-top: 8px; }
.docs-note--warn { border-left-color: var(--closed); }
.docs-note--safe { border-left-color: var(--up); }
.docs-note-h { font-weight: 700; font-size: var(--fs-14); }

/* tables: the board's dense table, scrolled sideways inside its own box on a phone */
.docs-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.docs-table table { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.docs-table th { text-align: left; font-size: var(--fs-11); font-weight: 600; color: var(--text-dim); padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
.docs-table td { padding: 8px 12px; border-top: 1px solid var(--rule); vertical-align: top; line-height: 1.5; }
.docs-table tr:first-child td { border-top: 0; }
.docs-table td.k { white-space: nowrap; }
.docs-table td.num, .docs-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.docs-table caption { caption-side: top; text-align: left; font-size: var(--fs-12); color: var(--text-dim); padding: 8px 12px 0; }
.docs-table .sub { display: block; color: var(--text-dim); font-size: var(--fs-12); margin-top: 2px; }
.docs-table .tag { display: inline-block; font-size: var(--fs-11); padding: 0 6px; border-radius: 2px; border: 1px solid var(--line); color: var(--text-dim); white-space: nowrap; }
.docs-table .tag--live { color: var(--closed); border-color: color-mix(in srgb, var(--closed) 35%, transparent); }

/* definition lists (glossary) */
.docs-gloss { margin: 0; }
.docs-gloss dt { font-weight: 700; margin-top: 18px; scroll-margin-top: calc(var(--head-h) + 12px); }
.docs-gloss dt:first-child { margin-top: 0; }
.docs-gloss dd { margin: 4px 0 0; color: var(--text); }
.docs-gloss dt:target, .docs-gloss dt:has(.docs-anchor:target) { color: var(--closed); }
.docs-anchor { scroll-margin-top: calc(var(--head-h) + 12px); }
.docs-gl-link { color: inherit; text-decoration: none; }
.docs-gloss dd ul { margin-top: 6px; }

/* screenshots */
.docs-shot { margin: 18px 0 0; }
.docs-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.docs-shot--phone { max-width: 300px; }
.docs-shot--half { max-width: 560px; }
.docs-shot figcaption { font-size: var(--fs-12); color: var(--text-dim); margin-top: 6px; line-height: 1.45; }

/* card grid on the welcome page */
.docs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; list-style: none; padding: 0 !important; }
.docs-cards li { margin: 0 !important; }
.docs-cards a { display: block; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; }
.docs-cards a:hover { border-color: var(--text-dim); background: var(--hover); }
.docs-cards strong { display: block; font-size: var(--fs-14); }
.docs-cards span { display: block; font-size: var(--fs-13); color: var(--text-dim); margin-top: 4px; line-height: 1.45; }

/* on-this-page, inline (narrow) and right column (wide) */
.docs-toc-inline { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0 12px; font-size: var(--fs-13); }
.docs-toc-inline summary { cursor: pointer; padding: 8px 0; color: var(--text-dim); font-weight: 600; }
.docs-toc-inline ul { list-style: none; margin: 0; padding: 0 0 10px; }
.docs-toc-inline li { padding: 3px 0; }
.docs-toc-inline li.lv3 { padding-left: 14px; }
.docs-toc-inline a { color: var(--text-dim); text-decoration: none; }
@media (min-width: 1240px) { .docs-toc-inline { display: none; } }
.docs-toc { position: sticky; top: calc(var(--head-h) + 1px); max-height: calc(100vh - var(--head-h) - 1px); overflow-y: auto; padding: 18px 0 24px; font-size: var(--fs-12); }
.docs-toc-h { font-size: var(--fs-11); font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; color: var(--text-dim); text-decoration: none; line-height: 1.35; border-left: 1px solid transparent; }
.docs-toc li.lv3 a { padding-left: 24px; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-on { color: var(--text); border-left-color: var(--closed); }

/* prev / next + footer line */
.docs-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 40px; }
.docs-pn a { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; }
.docs-pn a:hover { border-color: var(--text-dim); }
.docs-pn span { display: block; font-size: var(--fs-11); color: var(--text-dim); }
.docs-pn strong { display: block; font-size: var(--fs-14); margin-top: 2px; }
.docs-pn-next { text-align: right; grid-column: 2; }
@media (max-width: 479px) { .docs-pn { grid-template-columns: 1fr; } .docs-pn-next { grid-column: 1; } }
.docs-foot { margin-top: 18px; font-size: var(--fs-12); color: var(--text-dim); }

@media (max-width: 959px) {
  .docs-main { padding-top: 12px; font-size: var(--fs-16); }
  .docs-body h2 { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* agentsui15: the sidebar's link to /ai (AI assistants and the MCP server) */
.docs-nav a.docs-ai { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; margin: 0 0 12px; padding: 9px 10px;
  border: 1px solid var(--line); border-left: 2px solid var(--closed); border-radius: var(--radius-s); color: var(--text); text-decoration: none; }
.docs-nav a.docs-ai:hover { background: var(--hover); text-decoration: none; }
.docs-ai svg { width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: var(--closed); stroke-width: 1.4; stroke-linejoin: round; }
.docs-ai b { display: block; font-size: var(--fs-13); font-weight: 650; }
.docs-ai i { display: block; font-style: normal; font-size: var(--fs-12); color: var(--text-dim); }
