/* Neon design: page-specific rules for the docs pages (shared design system: /static/site.css).
   /docs            the guide index: a search, then a grid of chamfered guide cards
                    with mono labels; with ?q= the search results.
   /docs/files/*    the guide reader. A guide's HTML is a fragment from the guide
                    builder, shared with the firewall's Help viewer: the website
                    styles it only through the .guide wrapper, never changes it.
   The CSP allows no inline styles: every rule lives here. */

/* ---------- 1. Search (both pages) ---------- */
.guide-search { max-width: 42.5rem; }
.guide-search input[type=search] { padding: 0.8125rem 0.875rem 0.8125rem 2.75rem; font-size: 1.02rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318e0ff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E") 0.9375rem 50% / 1.125rem 1.125rem no-repeat var(--field); }
.guide-search .btn { flex: none; }

/* ---------- 2. Guide index: a grid of guide cards ---------- */
.docs-index { padding-top: 2.5rem; }
.docs-label { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.25rem; }
.docs-label::after { content: ""; flex: 1; min-width: 1.5rem; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.docs-count { --cut: 0.3125rem; padding: 1px 0.5rem; color: var(--cyan); background: rgba(24, 224, 255, 0.06); border: 1px solid var(--line-strong); letter-spacing: 0.08em;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.grid.docs-grid { grid-template-columns: repeat(auto-fill, minmax(min(18.75rem, 100%), 1fr)); gap: 0.875rem; counter-reset: guide; }
a.card.doc-card { --cut: 0.75rem; display: flex; flex-direction: column; gap: 0.625rem; padding: 1.125rem 1.25rem 1.25rem; counter-increment: guide;
  transition: background 0.25s; }
a.doc-card:hover { background: linear-gradient(135deg, rgba(24, 224, 255, 0.08), transparent 55%), var(--deck-2); }
a.doc-card:focus-visible { outline-offset: -0.3125rem; }
/* "Web page · PDF" becomes the card's mono label, above the title, with the
   guide's number in front (decoration only: hidden from screen readers). */
.card.doc-card p { order: -1; margin: 0; font: 500 0.68rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.doc-card p::before { content: counter(guide, decimal-leading-zero); content: counter(guide, decimal-leading-zero) / "";
  display: inline-block; margin-right: 0.625rem; padding-right: 0.625rem; border-right: 1px solid var(--line-strong); color: var(--cyan); }
.doc-card p span { color: var(--periwinkle); }
.card.doc-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.32; letter-spacing: 0.015em; text-wrap: pretty; overflow-wrap: break-word; }
.doc-card h3::after { content: " →"; content: " →" / ""; display: inline-block; color: var(--cyan); opacity: 0; transform: translateX(-0.25rem); transition: opacity 0.2s, transform 0.2s; }
a.doc-card:hover h3::after, a.doc-card:focus-visible h3::after { opacity: 1; transform: none; }

/* ---------- 3. Search results ---------- */
.docs-results { padding-top: 2.5rem; }
.docs-results .guide-hits > * { max-width: 55rem; }
.docs-found { margin: 0 0 0.375rem; font: 400 0.84rem/1.6 var(--mono); letter-spacing: 0.02em; overflow-wrap: anywhere; text-transform: none; text-wrap: wrap; }
.guide-hits .guide-hit { --cut: 0.625rem; padding: 1rem 1.25rem 1.125rem; transition: background 0.25s; }
.guide-hits .guide-hit h3 { overflow-wrap: break-word; }
.guide-hits .guide-hit p { color: var(--dim); font-size: 0.95rem; line-height: 1.6; }
a.guide-hit:focus-visible { outline-offset: -0.3125rem; }

/* ---------- 4. Guide reader: header ---------- */
.guide-head h1 { font-size: clamp(1.7rem, 3.8vw, 2.7rem); max-width: 26em; overflow-wrap: break-word; }
a.guide-crumb { text-decoration: none; }
a.guide-crumb:hover { color: var(--cyan); text-decoration: none; }
.page-head .guide-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin: 1.25rem 0 0; }

/* ---------- 5. Guide reader: layout and "On this page" ---------- */
/* Centred (owner 2026-11-24: "should all be centered"): the article (at most --wide) and "On this
   page" form one group, centred in the window; without room for "On this page" beside it, the
   article is centred alone. In the article the text is a centred column of --measure, and pictures,
   tables and code are centred on the same line, up to --wide. The head mirrors the same group, so
   the title starts where the text starts. */
.guide-sec { padding-top: 2.5rem; }
.guide-head, .guide-layout { --measure: 40rem; --wide: 55rem; --toc-w: 15.625rem; --toc-gap: 3.5rem; }
.guide { min-width: 0; }
.guide-layout > .guide { max-width: var(--wide); margin-left: auto; margin-right: auto; }
/* The head's lines start at the text's left edge: the text column is centred in the article, and the
   article (with "On this page") in the window, so that edge is half of what the text leaves free. */
.page-head.guide-head > * { margin-left: max(0px, (100% - var(--measure)) / 2); }
.guide-toc { max-width: var(--measure); margin: 0 auto 2.125rem; padding: 1rem 1.125rem 0.875rem; background: var(--deck); border: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--line-hot); }
.guide-toc .eyebrow { margin: 0 0 0.5rem; }
.guide-toc ol { list-style: none; margin: 0; padding: 0; columns: 2 17rem; column-gap: 1.75rem; }
.guide-toc li { break-inside: avoid; margin: 0; }
.guide-toc a { display: block; padding: 0.3125rem 0 0.3125rem 0.75rem; border-left: 1px solid var(--line-soft); color: var(--dim); font-size: 0.9rem; line-height: 1.4; overflow-wrap: break-word; }
.guide-toc a:hover { color: var(--text); border-left-color: var(--cyan); text-decoration: none; }
.guide-toc a:focus-visible { outline-offset: -2px; }
@media (min-width: 1100px) {
  .guide-layout.has-toc { display: grid; grid-template-columns: minmax(0, var(--wide)) var(--toc-w); justify-content: center; column-gap: var(--toc-gap); align-items: start; }
  .page-head.guide-head.has-toc > * { margin-left: max(0px, (100% - var(--toc-gap) - var(--toc-w) - var(--measure)) / 2); }
  .guide-layout.has-toc > .guide { grid-column: 1; grid-row: 1; max-width: none; margin: 0; }
  .guide-layout.has-toc > .guide-toc { grid-column: 2; grid-row: 1; position: sticky; top: 5.625rem; max-height: calc(100vh - 6.875rem); overflow-y: auto;
    margin: 0; padding: 0.25rem 0 0.25rem; background: none; border: 0; box-shadow: none; overscroll-behavior: contain; }
  .guide-layout.has-toc > .guide-toc ol { columns: auto; }
}

/* ---------- 6. Guide reader: the text ---------- */
/* A comfortable reading measure (about 65-80 characters a line); pictures,
   tables and code may be wider. Every block is centred in the article. */
.guide > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.guide > figure, .guide > table, .guide > pre { max-width: min(100%, var(--wide)); }
/* Pictures set side by side in a paragraph (two phone screens): a centred pair, one under the
   other when there is no room. */
.guide > p:has(> img) { max-width: min(100%, var(--wide)); text-align: center; }
.guide p > img { display: inline-block; vertical-align: top; width: auto; height: auto; max-height: 82vh; margin: 0.25rem; }
.guide p, .guide li { color: var(--read); font-size: 1.0625rem; line-height: 1.75; overflow-wrap: break-word; }
.guide ul, .guide ol { padding-left: 1.4em; margin: 0 auto 1.1em; }
.guide li { margin: 0.4375rem 0; }
.guide li > ul, .guide li > ol { margin: 0.375rem 0; }
.guide li > p { margin: 0 0 0.5em; }
.guide h2 { font-size: clamp(1.3rem, 2.4vw, 1.65rem); margin: 2.4em auto 0.75em; padding-top: 1.25rem; border-top: 1px solid var(--line-soft);
  background: var(--neon) top left / 4.5rem 2px no-repeat border-box; overflow-wrap: break-word; }
.guide > h2:first-child { margin-top: 0; border-top: 0; background: none; padding-top: 0; }
.guide h3 { font-size: 1.16rem; margin: 1.9em auto 0.55em; overflow-wrap: break-word; }
.guide h3::before { content: "› "; content: "› " / ""; color: var(--cyan); }
.guide h2 + h3 { margin-top: 0.9em; }
.guide strong { color: var(--text); }
.guide a:not(.btn) { overflow-wrap: anywhere; }
.guide code { font-size: 0.86em; }

/* Code blocks: mono with a hairline, scrolling inside their box. */
.guide pre { margin: 1.25rem auto 1.5rem; padding: 0.9375rem 1.125rem; background: var(--field); border: 1px solid var(--line); box-shadow: inset 2px 0 0 var(--line-hot);
  color: #cfeeff; font-size: 0.84rem; line-height: 1.6; tab-size: 2; overflow-x: auto; overscroll-behavior-x: contain; }
.guide li pre { max-width: 100%; }

/* Quotes and notes. */
.guide blockquote { --cut: 0.5rem; margin: 1.375rem auto; padding: 0.875rem 1.125rem; background: rgba(255, 47, 180, 0.05); border: 1px solid rgba(255, 47, 180, 0.22); border-left: 0;
  box-shadow: inset 0.1875rem 0 0 var(--magenta); clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%); }
.guide blockquote p:last-child { margin-bottom: 0; }

/* Pictures: a quiet HUD frame (chamfered, gradient hairline, corner ticks).
   Shown at most at their own size, so small screenshots stay sharp; tall
   phone screenshots fit the screen. */
.guide figure { --cut: 0.875rem; position: relative; width: fit-content; min-width: min(100%, 22.5rem); margin: 1.625rem auto 1.875rem; padding: 0.5rem; border: 0;
  background: linear-gradient(180deg, rgba(24, 224, 255, 0.07), rgba(255, 47, 180, 0.045)), var(--deck);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.guide figure::before { content: ""; position: absolute; inset: 0; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--line-strong), rgba(24, 224, 255, 0.07) 38%, rgba(24, 224, 255, 0.07) 62%, rgba(255, 47, 180, 0.3));
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000); -webkit-mask-composite: xor;
  mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000); mask-origin: content-box, border-box;
  mask-clip: content-box, border-box; mask-composite: exclude, add; }
.guide figure::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(135deg, transparent calc(50% - 0.8px), var(--line-strong) calc(50% - 0.8px), var(--line-strong) calc(50% + 0.8px), transparent calc(50% + 0.8px)) top left / var(--cut) var(--cut) no-repeat,
    linear-gradient(135deg, transparent calc(50% - 0.8px), rgba(255, 47, 180, 0.3) calc(50% - 0.8px), rgba(255, 47, 180, 0.3) calc(50% + 0.8px), transparent calc(50% + 0.8px)) bottom right / var(--cut) var(--cut) no-repeat; }
.guide figure img { width: auto; max-width: 100%; height: auto; max-height: 82vh; margin: 0 auto;
  clip-path: polygon(0.5625rem 0, 100% 0, 100% calc(100% - 0.5625rem), calc(100% - 0.5625rem) 100%, 0 100%, 0 0.5625rem); }
.guide figcaption { width: 0; min-width: 100%; padding: 0.625rem 0.375rem 0.1875rem; font: 400 0.76rem/1.55 var(--mono); letter-spacing: 0.03em; color: var(--dim); overflow-wrap: break-word; }

/* Tables: the box hugs the table and scrolls sideways inside itself; soft
   shadows at the edges show there is more. */
.guide table { display: block; width: fit-content; max-width: min(100%, var(--wide)); margin: 1.25rem auto 1.625rem; overflow-x: auto; overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--deck) 35%, rgba(10, 16, 32, 0)) left / 2.25rem 100% no-repeat local,
    linear-gradient(270deg, var(--deck) 35%, rgba(10, 16, 32, 0)) right / 2.25rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(24, 224, 255, 0.22), transparent) left / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(24, 224, 255, 0.22), transparent) right / 0.75rem 100% no-repeat scroll,
    var(--deck); }
.guide td { color: var(--read); font-size: 0.95rem; line-height: 1.55; }
.guide td:first-child { color: var(--text); }
/* An identifier in a cell (a driver, a file name) breaks only where it may. */
.guide td code { overflow-wrap: normal; }
/* Some tables have a header row with no words: no empty bar. */
.guide thead:not(:has(th:not(:empty))) { display: none; }

/* Bottom actions. */
.guide > .no-print { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); }

/* ---------- 7. Small screens ---------- */
@media (max-width: 600px) {
  .grid.docs-grid { gap: 0.75rem; }
  a.card.doc-card { padding: 1rem 1.125rem 1.125rem; }
  .guide-sec, .docs-index, .docs-results { padding-top: 1.875rem; }
  .guide p, .guide li { font-size: 1.03rem; line-height: 1.7; }
  .guide figure { padding: 0.375rem; margin: 1.375rem auto 1.625rem; }
  .guide pre { padding: 0.8125rem 0.875rem; font-size: 0.8rem; }
  .guide th, .guide td { padding: 0.625rem 0.75rem; }
  /* Columns stay readable: a wide table scrolls in its box instead of
     squeezing every column to one word a line. */
  .guide th, .guide td { min-width: 7.5rem; }
  .guide th:first-child, .guide td:first-child { min-width: 0; }
  .guide-toc ol { columns: 1; }
}
@media (max-width: 480px) {
  .guide-search input[type=search] { flex: 1 1 100%; }
  .guide-search .btn { flex: 1 1 100%; }
}

/* ---------- 8. Print: one plain column ---------- */
@media print {
  .guide-layout.has-toc { display: block; }
  .guide figure { background: none; border: 1px solid #ccc; break-inside: avoid; }
  .guide figure::before, .guide figure::after, .guide h3::before { display: none; }
  .guide figure img { max-height: none; }
  .guide h2 { background: none; border-top-color: #ccc; break-after: avoid; }
  .guide table { display: table; width: 100%; background: #fff; border-color: #bbb; }
  .guide pre, .guide blockquote { background: #fff; color: #000; border-color: #bbb; box-shadow: none; }
  .guide pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .guide p, .guide li, .guide td { color: #000; }
}

/* ---------- 9. Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .doc-card, .guide-hit, .doc-card h3::after { transition: none; }
}

/* ---------- 9. Polish (site-fit-check, 2026-11-24) ---------- */
/* Touch screens: the guide's "On this page" links and the Guides crumb are 40 px to tap (were 30 and 18 px);
   the crumb's larger tap area takes no extra room. */
@media (pointer: coarse), (max-width: 760px) {
  .guide-toc a { padding-top: 0.625rem; padding-bottom: 0.625rem; }
  a.guide-crumb { padding-top: 0.6875rem; padding-bottom: 0.6875rem; margin-top: -0.6875rem; margin-bottom: 1px; }
}
/* Phones: the search hint "Search every guide: a setting, a word, a device…" fits the field (it was cut by
   107 px at 360 px). Only the hint is smaller: what you type keeps the 16 px type (no zoom on iPhones). */
@media (max-width: 480px) {
  .guide-search input[type=search]::placeholder { font-size: min(1.02rem, 3.2vw); }
}
