/* The Documentation view, in the design of September 2026. The index shows the pages as a compact grid of cards; a page
   stands inside the site's one header and footer with the list of pages on its left, the page itself in a card, and its
   contents list on its right, so the title, the one-line summary and the contents list are in the first screen of a wide
   window. Every colour, typeface, radius and shadow is a token from the top of service.css. A band is 64 pixels deep above
   and below its content on a wide screen and 40 pixels on a phone, and no band is dark. */
main:has(> [data-view="docs"]:not([hidden])){max-width:none;padding:0}
[data-view="docs"]{overflow-wrap:anywhere}
.docs-band{padding:64px max(var(--band-gutter),calc((100% - var(--content-max)) / 2))}
.docs-intro{display:flex;flex-direction:column;gap:.75rem;background:var(--band);border-bottom:1px solid var(--rule)}
.docs-intro>*{margin:0}
.docs-intro h1{max-width:none;margin:0;font-size:clamp(2rem,3.2vw,2.75rem);line-height:1.08;letter-spacing:-.035em;text-wrap:balance}
.docs-lede{max-width:52rem;margin:0;color:var(--muted);font-size:var(--text-lead);line-height:1.55}
.docs-actions{margin:.5rem 0 0;gap:.75rem 1.5rem}
.docs-trail{display:flex;flex-wrap:wrap;gap:.35rem}
.docs-trail a{color:inherit;text-decoration:none}
.docs-trail a:hover{text-decoration:underline}

/* The index: one card for each page, the first one marked because a new reader starts there. The whole card follows its link. */
.docs-cards-band{border-bottom:1px solid var(--rule)}
.docs-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;list-style:none;margin:0;padding:0}
.docs-card{position:relative;display:flex;flex-direction:column;gap:.375rem;min-width:0;padding:1.25rem 1.375rem;background:var(--paper);border:1px solid var(--border);border-radius:var(--radius-card)}
.docs-card:hover{border-color:var(--line-strong)}
.docs-card.is-first{border-color:var(--button);box-shadow:inset 0 0 0 1px var(--button)}
.docs-card-section{margin:0;color:var(--subtle);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.docs-card.is-first .docs-card-section{color:var(--accent)}
.docs-card-title{margin:0;font-size:1.0625rem;line-height:1.3}
.docs-card-title a{color:var(--ink);text-decoration:none}
.docs-card-title a::after{content:"";position:absolute;inset:0;border-radius:inherit}
.docs-card-summary{margin:0;color:var(--muted);font-size:.9375rem;line-height:1.5}
.docs-status{margin:1rem 0 0;color:var(--muted)}
.docs-status:empty{display:none}

/* Below the cards: the engine a reader can install, and the technical runtime reference, side by side. */
.docs-developer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2.5rem;background:var(--band)}
.docs-developer>section{min-width:0}
.docs-developer h2{margin:0 0 .5rem;font-size:1.25rem;letter-spacing:-.015em}
.docs-developer p{margin:.5rem 0;color:var(--muted)}
.docs-developer .runtime-disclosure{padding:.75rem 0}
.docs-developer .layer-notes{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.5rem;margin-top:1rem;font-size:.9375rem}
.docs-code,.docs-article pre{margin:1rem 0;padding:1rem 1.25rem;max-height:none;background:var(--panel-head);border:1px solid var(--border);border-radius:12px;color:var(--ink);font-family:var(--font-mono);font-size:.8125rem;line-height:1.6;white-space:pre;overflow-x:auto;overflow-wrap:normal;word-break:normal}

/* A page: the list of pages, the page in a card, and its contents. The contents list moves above the page on a narrower
   screen and folds on a phone, and the list of pages gives way to the trail above the title and the links below the page. */
.docs-layout{display:grid;grid-template-columns:minmax(0,13.5rem) minmax(0,1fr) minmax(0,13.5rem);gap:1.5rem 2rem;align-items:start}
.docs-nav{grid-column:1;grid-row:1/span 2;position:sticky;top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;font-size:.9375rem}
.docs-nav-section{margin:0 0 .375rem;padding:0 .75rem;color:var(--subtle);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.docs-nav ul{display:flex;flex-direction:column;gap:.125rem;list-style:none;margin:0;padding:0}
.docs-nav a{display:block;padding:.4rem .75rem;border-radius:9px;color:var(--muted);text-decoration:none}
.docs-nav a:hover{background:var(--planned-soft);color:var(--ink)}
.docs-nav a[aria-current=page]{background:var(--info-soft);color:var(--info);font-weight:600}
.docs-article{grid-column:2;grid-row:1;min-width:0;padding:2.5rem 3rem;background:var(--paper);border:1px solid var(--border);border-radius:var(--radius-panel)}
.docs-toc{grid-column:3;grid-row:1;position:sticky;top:1.5rem;min-width:0;font-size:.875rem}
.docs-toc summary{padding:0 0 .5rem;color:var(--subtle);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;list-style:none;cursor:default;pointer-events:none}
.docs-toc summary::-webkit-details-marker{display:none}
.docs-toc ul{display:flex;flex-direction:column;gap:.375rem;list-style:none;margin:0;padding:0 0 0 .875rem;border-left:1px solid var(--border)}
.docs-toc a{color:var(--muted);text-decoration:none;line-height:1.4}
.docs-toc a:hover{color:var(--ink)}
.docs-pager{grid-column:2;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.docs-pager a{display:flex;flex-direction:column;gap:.2rem;min-width:0;padding:1rem 1.25rem;background:var(--paper);border:1px solid var(--border);border-radius:var(--radius-card);text-decoration:none}
.docs-pager a:hover{border-color:var(--line-strong)}
.docs-pager-next{grid-column:2;text-align:right}
.docs-pager-word{color:var(--subtle);font-size:.8125rem}
.docs-pager-title{color:var(--ink);font-weight:600}

/* The page itself. */
.docs-article>:first-child{margin-top:0}
.docs-article>:last-child{margin-bottom:0}
.docs-article h2{margin:2.5rem 0 .75rem;font-size:1.375rem;line-height:1.25;letter-spacing:-.02em;scroll-margin-top:1.5rem}
.docs-article h3{margin:2rem 0 .5rem;font-size:1.125rem;line-height:1.3;scroll-margin-top:1.5rem}
.docs-article h4{margin:1.5rem 0 .5rem;font-size:1rem;scroll-margin-top:1.5rem}
.docs-article p,.docs-article li{color:var(--muted);line-height:1.65}
.docs-article p{margin:.75rem 0}
.docs-article strong{color:var(--ink)}
.docs-article ul,.docs-article ol{margin:.75rem 0;padding-left:1.35rem}
.docs-article li+li{margin-top:.375rem}
.docs-article code{padding:.1em .35em;border-radius:6px;background:var(--bg);color:var(--ink);font-family:var(--font-mono);font-size:.875em;overflow-wrap:anywhere}
.docs-article pre code{padding:0;background:none;font-size:inherit;overflow-wrap:normal}
.docs-table{margin:1rem 0;overflow-x:auto;border:1px solid var(--border);border-radius:12px}
.docs-table table{width:100%;min-width:32rem;border-collapse:collapse;font-size:.875rem}
.docs-table th{padding:.625rem .875rem;border-bottom:1px solid var(--border);background:var(--panel-head);color:var(--subtle);font-size:.8125rem;font-weight:600;text-align:left;vertical-align:bottom}
.docs-table td{padding:.625rem .875rem;border-top:1px solid var(--border);color:var(--muted);vertical-align:top;line-height:1.5}
.docs-table tbody tr:first-child td{border-top:0}
.docs-table td:first-child code{white-space:nowrap}
.docs-note{color:var(--muted)}

@media(max-width:1199px){
  .docs-layout{grid-template-columns:minmax(0,13.5rem) minmax(0,1fr)}
  .docs-nav{grid-row:1/span 3}
  .docs-toc{grid-column:2;grid-row:1;position:static;padding:.75rem 1rem;background:var(--paper);border:1px solid var(--border);border-radius:12px}
  .docs-toc summary{padding:.25rem 0;pointer-events:auto;cursor:pointer}
  .docs-toc summary::after{content:"+";float:right;font-size:1rem;line-height:1}
  .docs-toc[open] summary::after{content:"−"}
  .docs-toc[open] summary{padding-bottom:.625rem}
  .docs-toc ul{columns:2;display:block;border-left:0;padding:0}
  .docs-toc li{margin:0 0 .375rem;break-inside:avoid}
  .docs-article{grid-row:2}
  .docs-pager{grid-row:3}
  .docs-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:1023px){
  .docs-layout{grid-template-columns:minmax(0,1fr)}
  .docs-nav{display:none}
  .docs-toc,.docs-article,.docs-pager{grid-column:1}
  .docs-developer{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:680px){
  .docs-band{padding-top:40px;padding-bottom:40px}
  .docs-intro h1{font-size:1.875rem}
  .docs-lede{font-size:1rem}
  .docs-cards{grid-template-columns:minmax(0,1fr);gap:.75rem}
  .docs-card{padding:1rem 1.125rem}
  .docs-article{padding:1.25rem 1.125rem;border-radius:var(--radius-card)}
  .docs-article h2{margin-top:2rem;font-size:1.25rem}
  .docs-toc ul{columns:1}
  .docs-pager{grid-template-columns:minmax(0,1fr)}
  .docs-pager-next{grid-column:1}
  .docs-developer .layer-notes{grid-template-columns:minmax(0,1fr);gap:0}
}
