/* The documentation pages (/docs/, 2026-11-05). Uses the colour tokens of site.css. Mobile first: 16 px gutters,
   the menu is a drawer on a phone and a column from 900 px; "On this page" is a column from 1200 px. */
body.docs { overflow-x: hidden; }
body.nav-open, body.search-open { overflow: hidden; }
.docs .top-row { max-width: 92rem; padding: 0 16px; gap: 10px; }
.docs .wide-wrap { max-width: 92rem; padding: 0 16px; }
.docs .brand { font-size: 19px; gap: 8px; }
.brand-sub { font-size: 13px; font-weight: 600; font-style: normal; color: var(--muted); white-space: nowrap; }
.top-nav { display: none; gap: 4px; margin-left: 10px; }
.top-nav a { font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.top-nav a:hover { color: var(--accent); }
.top-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.docs .top .tools { gap: 8px; }
.menu-btn { flex: none; }

.search-btn {
  display: inline-flex; align-items: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 12px; justify-content: center; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); border-radius: 10px; font: inherit; font-size: 14px; cursor: pointer;
}
.search-btn:hover { color: var(--text); border-color: var(--accent); }
.search-btn svg, .search-field svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.search-btn .search-text, .search-btn kbd { display: none; }
kbd, .search-esc {
  font: 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px;
  background: var(--bg2); color: var(--muted);
}

/* layout */
.docs-shell { max-width: 92rem; margin: 0 auto; padding: 0 16px; display: block; }
.docs-main { min-width: 0; padding: 16px 0 56px; }

/* the menu: a drawer on a phone */
.docs-side {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(88vw, 20rem); overflow-y: auto;
  background: var(--bg); border-right: 1px solid var(--line); padding: 12px 16px 32px; transform: translateX(-104%); overscroll-behavior: contain;
  visibility: hidden; transition: transform .2s ease, visibility 0s .2s; box-shadow: var(--shadow-lg);
}
body.nav-open .docs-side { transform: none; visibility: visible; transition: transform .2s ease; }
.nav-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .45); }
.side-top a { display: inline-flex; align-items: center; min-height: 44px; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; font-size: 14px; font-weight: 600; }
.side-top a { text-decoration: none; }
.side-sec { border-top: 1px solid var(--line); padding: 4px 0; }
.side-sec summary { cursor: pointer; font-weight: 700; font-size: 15px; min-height: 44px; padding: 9px 4px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.side-sec summary::-webkit-details-marker { display: none; }
.side-sec summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.side-sec[open] summary::after { transform: rotate(45deg); }
.side-sec ul { list-style: none; margin: 0 0 8px; padding: 0; }
.side-sec li { margin: 0; }
.side-sec a {
  display: flex; align-items: center; min-height: 44px; padding: 6px 10px; margin-left: 2px; border-left: 2px solid var(--line); font-size: 15px; color: var(--muted); text-decoration: none;
}
.side-sec a:hover { color: var(--text); border-left-color: var(--muted); }
.side-sec a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; background: var(--accent-soft); border-radius: 0 8px 8px 0; }

/* breadcrumbs */
.crumbs ol { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 0; font-size: 14px; color: var(--muted); }
.crumbs li { margin: 0; }
.crumbs li:not(:last-child)::after { content: "/"; margin: 0 8px; color: var(--muted); opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; display: inline-block; padding: 11px 0; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; overflow-wrap: anywhere; display: inline-block; padding: 11px 0; }

/* the page */
.doc { min-width: 0; }
.doc-head { margin-bottom: 18px; }
.doc-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.doc-head h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); margin: 0 0 8px; }
.doc-summary { font-size: 1.08rem; color: var(--muted); max-width: 40rem; margin: 0; }
.doc-head .wiki-langnote { margin-top: 8px; }
.doc > h2, .doc > h3 { max-width: 46rem; }
.doc h2 { font-size: clamp(1.3rem, 5vw, 1.6rem); margin: 34px 0 10px; padding-top: 6px; }
.doc h3 { font-size: 1.08rem; margin: 24px 0 8px; }
.doc p, .doc li { max-width: 46rem; }
.doc ul, .doc ol { padding-left: 22px; }
.doc a.anchor { margin-left: .4em; font-weight: 400; color: var(--muted); text-decoration: none; opacity: 0; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc a.anchor:focus-visible { opacity: 1; }
@media (hover: none) { .doc a.anchor { opacity: .45; } }
.doc code { background: var(--code); border-radius: 5px; padding: 1px 5px; font-size: .92em; overflow-wrap: anywhere; }
.doc pre { overflow-x: auto; padding: 12px; background: var(--code); border-radius: var(--radius); }
.doc img, .doc video, .doc svg { max-width: 100%; height: auto; }
.doc h1, .doc h2, .doc h3 { overflow-wrap: break-word; }

.doc-table-wrap { overflow-x: auto; margin: 10px 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table th { background: var(--bg2); font-weight: 700; white-space: nowrap; }
.doc-table td:first-child { font-weight: 600; min-width: 8.5rem; }
.doc-note { background: var(--accent-soft); color: var(--text); border-left: 4px solid var(--accent-fill); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; margin: 14px 0; max-width: 46rem; }
.doc-note p:last-child { margin-bottom: 0; }
.doc-shot { max-width: 260px; margin: 16px 0; }
.doc .phone img { width: 100%; height: auto; }
.doc-dl dt { font-weight: 700; margin-top: 14px; }
.doc-dl dd { margin: 2px 0 0; color: var(--muted); max-width: 46rem; }
.doc-steps { counter-reset: step; list-style: none; padding-left: 0; }
.doc-steps > li { counter-increment: step; position: relative; padding-left: 38px; margin: 12px 0; }
.doc-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-fill); color: var(--accent-ink); font-weight: 700; font-size: 14px; display: grid; place-items: center;
}

/* on this page */
.toc-inline { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; margin: 0 0 8px; max-width: 46rem; }
.toc-inline summary { cursor: pointer; font-weight: 700; padding: 11px 0; min-height: 44px; }
.toc-inline ul, .docs-toc ul { list-style: none; margin: 0; padding: 0; }
.toc-inline ul ul, .docs-toc ul ul { padding-left: 14px; }
.toc-inline li, .docs-toc li { margin: 0; }
.toc-inline a, .docs-toc a { display: block; padding: 10px 0; font-size: 15px; overflow-wrap: anywhere; color: var(--muted); text-decoration: none; }
.toc-inline a:hover, .docs-toc a:hover, .docs-toc a[aria-current="true"] { color: var(--accent); }
.docs-toc { display: none; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text); margin: 0 0 8px; }

/* related and pager */
.doc-related { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 46rem; }
.doc-related-title { font-weight: 700; margin: 0 0 8px; }
.doc-related ul { list-style: none; padding: 0; margin: 0; }
.doc-related li { margin: 14px 0; }
.doc-related span { display: block; color: var(--muted); font-size: 14px; }
.pager { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 40px; max-width: 46rem; }
.pager a {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.pager a:hover { border-color: var(--accent); }
.pager-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.pager strong { color: var(--accent); }
.pager-next { text-align: right; }

/* search */
.search-layer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 12px 12px; }
.search-layer[hidden] { display: none; }
.search-box { width: 100%; max-width: 40rem; max-height: 82vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--text); background: none; border: 0; outline: 0; padding: 6px 0; }
.search-esc { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 32px; font-family: inherit; }
.search-esc svg { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results li { margin: 0; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--accent-soft); }
.search-results .r-title { font-weight: 700; }
.search-results .r-sec { font-size: 12px; color: var(--accent); margin-left: 8px; font-weight: 600; }
.search-results .r-snip { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.search-hint { margin: 0; padding: 10px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

@media (min-width: 720px) {
  .top-nav { display: flex; }
  .search-btn .search-text { display: inline; }
  .search-btn kbd { display: inline; }
  .pager { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .menu-btn, .side-close, .nav-scrim { display: none !important; }
  .docs-shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 40px; }
  .docs-side {
    position: sticky; top: 76px; z-index: auto; align-self: start; width: auto; height: calc(100vh - 92px); transform: none; visibility: visible;
    box-shadow: none; border-right: 0; background: none; padding: 20px 8px 24px 0; transition: none;
  }
  .side-top { display: none; }
  .docs-main { padding-top: 24px; }
}
@media (min-width: 1200px) {
  .docs-shell { grid-template-columns: 17rem minmax(0, 1fr) 14rem; }
  .toc-inline { display: none; }
  .docs-toc { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; padding: 32px 0 24px; }
}
@media print {
  .top, .docs-side, .docs-toc, .toc-inline, .pager, .bottom, .search-layer { display: none !important; }
  .docs-shell { display: block; }
}

/* ---- Phones (2026-11-05, owner: "realign for mobile") ---- */
.docs .tools { flex-wrap: nowrap; }
.docs .brand { min-width: 0; }
.docs .top #theme-toggle { margin-left: auto; }
@media (max-width: 479px) {
  /* header in two rows: menu, logo and theme button, then a wide search bar and the languages (site.css orders the items) */
  .docs .menu-btn { order: 0; }
  .docs .search-btn { order: 3; flex: 1 1 calc(100% - 150px); min-width: 0; justify-content: flex-start; padding: 0 14px; }
  .docs .search-btn .search-text { display: inline; }
  .docs .top-row { padding-inline: 12px; }
}
@media (max-width: 899px) {
  .toc-inline { max-width: none; }
  .side-top { padding-bottom: 8px; }
}
@media (min-width: 900px) {
  .side-sec a { min-height: 0; padding: 7px 10px; font-size: 14px; }
  .side-sec summary { min-height: 0; font-size: 14px; }
  .crumbs a, .crumbs [aria-current] { padding: 0; }
}
/* a table becomes stacked rows on a phone: the name above, its description below */
@media (max-width: 599px) {
  .doc-table-wrap { border: 0; background: none; overflow: visible; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .doc-table tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 10px; }
  .doc-table th, .doc-table td { padding: 0; border: 0; }
  .doc-table td { font-size: 16px; overflow-wrap: anywhere; }
  .doc-table td:first-child { min-width: 0; font-weight: 700; margin-bottom: 2px; }
  .doc-table td + td { color: var(--muted); }
  .doc-table td + td + td { margin-top: 6px; }
  .doc .doc-shot { max-width: 220px; }
}
/* the search box: the whole screen on a phone, with a close button, and it follows the on-screen keyboard (docs.js) */
@media (max-width: 599px) {
  .search-layer { padding: 0; align-items: stretch; }
  .search-box { max-width: none; max-height: none; height: 100%; border: 0; border-radius: 0; }
  .search-field { padding: 8px 8px 8px 14px; }
  .search-field input { padding: 10px 0; }
  .search-esc { min-width: 44px; min-height: 44px; padding: 0; border-radius: 10px; }
  .search-esc [data-dx] { display: none; }
  .search-esc svg { display: block; }
  .search-results { flex: 1 1 auto; padding: 6px 8px; }
  .search-results a { padding: 14px 12px; }
  .search-hint { padding: 12px 14px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .docs-side { top: 0; }
  .search-layer { padding-top: 0; }
  .search-box { max-height: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .docs-side { transition: none; }
}
@media (max-width: 560px) { .brand-sub { display: none; } }
