/* SPDX-License-Identifier: AGPL-3.0-only
 * Copyright (C) 2026 G ROX EOOD
 *
 * FR-60 (#1165) — the docs theme.
 *
 * Every colour below is lifted from what already ships, so the docs read
 * as the same product rather than a bolted-on subdomain:
 *   #009688 / #ef5350        ui/src/plugins/vuetify.ts  (lightTheme)
 *   #1a1a2e                  LandingView.vue            (body text, code bg)
 *   #e0f2f1 #e8f5e9 #e0f7fa  LandingView.vue            (hero gradient)
 *   0 12px 40px rgba(0,150,136,.12)  LandingView.vue    (card hover)
 *
 * Ships LIGHT ONLY for v1 — LandingView wraps itself in
 * <v-theme-provider theme="light">, and every hero SVG is a light-palette
 * artwork the tutorial already paints on a fixed light panel in BOTH
 * themes rather than forking per theme. The palette is tokenised on
 * :root, so dark mode later is one block plus a decision about artwork.
 */

/* ── tokens ─────────────────────────────────────────────────────────── */
:root {
  --teal: #009688;
  --teal-deep: #00796b;
  --teal-soft: #e0f2f1;
  --coral: #ef5350;
  --coral-soft: #ffebee;
  --amber: #ffc107;
  --amber-soft: #fff8e1;

  --ink: #1a1a2e;
  --ink-muted: #5b6570;
  --ink-faint: #68727d;

  --bg: #ffffff;
  --bg-soft: #f5faf9;
  --bg-rail: #fbfdfd;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --border-teal: rgba(0, 150, 136, 0.18);

  --code-bg: #1a1a2e;
  --code-fg: #e0f2f1;

  --shadow-card: 0 12px 40px rgba(0, 150, 136, 0.12);
  --shadow-pop: 0 24px 64px rgba(26, 26, 46, 0.18);

  --radius: 10px;
  --radius-lg: 14px;

  --sidebar-w: 274px;
  --toc-w: 232px;
  --topbar-h: 60px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ── reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
kbd {
  font-family: var(--font-mono); font-size: .74em; line-height: 1;
  padding: .28em .45em; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 5px; background: #fff; color: var(--ink-muted);
}
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--teal); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { left: 12px; }

/* ── topbar ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100; height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-teal);
}
.topbar__inner {
  max-width: 1440px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
}
.brand { display: flex; align-items: baseline; gap: 7px; font-weight: 700; font-size: 1.16rem; color: var(--teal-deep); }
.brand:hover { text-decoration: none; }
.brand__docs { font-size: .8rem; font-weight: 600; color: var(--ink-faint); letter-spacing: .04em; text-transform: uppercase; }
.topbar__burger { display: none; }

.search-open {
  flex: 1 1 auto; max-width: 380px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; font: inherit; font-size: .88rem; color: var(--ink-faint);
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: left;
}
.search-open:hover { border-color: var(--teal); color: var(--ink-muted); }
.search-open span { flex: 1 1 auto; }
.search-open kbd { flex: 0 0 auto; }

.topbar__links { display: flex; align-items: center; gap: 6px; }
.topbar__links > a:not(.btn) { padding: 7px 11px; font-size: .9rem; font-weight: 500; color: var(--ink-muted); border-radius: 8px; }
.topbar__links > a:not(.btn):hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: .9rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; }
/* ⚠️ The background is --teal-deep, not --teal. White on #009688 is only
   3.67:1 — the button fails WCAG AA at its 14.4px size even with white
   text, so recolouring the TEXT was never going to be the fix. Measured,
   not eyeballed: white on #00796b is 5.32:1. */
.btn--primary { background: var(--teal-deep); color: #fff; }
.btn--primary:hover { background: #00655a; }
.btn--tonal { background: var(--teal-soft); color: var(--teal-deep); border-color: var(--border-teal); }
.btn--tonal:hover { background: #cfe9e6; }

/* ── layout ─────────────────────────────────────────────────────────── */
.layout {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 32px; padding: 0 18px;
  align-items: start;
}
@media (max-width: 1200px) { .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); } .toc-rail { display: none; } }
@media (max-width: 900px)  { .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }

.sidebar {
  position: sticky; top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 22px 6px 48px 0; border-right: 1px solid var(--border);
}
@media (max-width: 900px) {
  .sidebar {
    display: none; position: static; max-height: none; border-right: 0;
    border-bottom: 1px solid var(--border); padding: 12px 0;
  }
  .sidebar.is-open { display: block; }
  .topbar__burger {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px; background: none; border: 1px solid var(--border); border-radius: 8px;
    color: var(--ink-muted); cursor: pointer;
  }
  .topbar__links > a:not(.btn) { display: none; }
}

.side-group { margin-bottom: 2px; }
.side-group > summary {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: .9rem; list-style: none;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary:hover { background: var(--bg-soft); }
.side-group__title { flex: 1 1 auto; }
.side-group__icon { display: inline-flex; color: var(--teal); }
.side-group__icon--coral { color: var(--coral); }
.side-group__icon--deep { color: var(--teal-deep); }
.side-group__chev { color: var(--ink-faint); transition: transform .18s ease; }
.side-group[open] > summary .side-group__chev { transform: rotate(180deg); }
.side-group ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 28px; }
.side-group li a {
  display: block; padding: 5px 10px; border-radius: 7px;
  font-size: .875rem; color: var(--ink-muted); border-left: 2px solid transparent;
}
.side-group li a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.side-group li a.is-active {
  color: var(--teal-deep); font-weight: 600;
  background: var(--teal-soft); border-left-color: var(--teal);
}

.content { min-width: 0; padding: 26px 0 64px; }

/* ── page head ──────────────────────────────────────────────────────── */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 14px; padding: 0; font-size: .82rem; color: var(--ink-faint); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a { color: var(--ink-muted); }
.crumbs__sep { color: var(--ink-faint); opacity: .6; }

.page-title { font-size: 2.1rem; line-height: 1.2; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.015em; }
@media (max-width: 600px) { .page-title { font-size: 1.65rem; } }
.page-lead { font-size: 1.08rem; color: var(--ink-muted); margin: 0 0 16px; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 22px; padding: 0; }
.chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .01em;
  background: var(--teal-soft); color: var(--teal-deep); border: 1px solid var(--border-teal);
}
a.chip--link:hover { background: #cfe9e6; text-decoration: none; }

.hero { margin: 0 0 28px; padding: 18px; background: linear-gradient(135deg, #e0f2f1 0%, #e8f5e9 50%, #e0f7fa 100%); border-radius: var(--radius-lg); border: 1px solid var(--border-teal); }
.hero img { display: block; width: 100%; height: auto; }

/* ── prose ──────────────────────────────────────────────────────────── */
.prose { font-size: 1rem; }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-size: 1.5rem; font-weight: 700; margin: 2.2em 0 .6em; padding-bottom: .3em;
  border-bottom: 1px solid var(--border); letter-spacing: -0.01em; scroll-margin-top: 76px;
}
.prose h3 { font-size: 1.19rem; font-weight: 700; margin: 1.9em 0 .5em; scroll-margin-top: 76px; }
.prose h4 { font-size: 1.02rem; font-weight: 700; margin: 1.6em 0 .4em; color: var(--ink-muted); }
.prose p { margin: 0 0 1.05em; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose em { font-style: italic; }
.prose ul, .prose ol { margin: 0 0 1.05em; padding-left: 1.5em; }
.prose li { margin: .3em 0; }
.prose li > ul, .prose li > ol { margin: .3em 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.prose blockquote {
  margin: 0 0 1.05em; padding: .1em 0 .1em 1.1em;
  border-left: 3px solid var(--teal); color: var(--ink-muted);
}
.prose img { border-radius: var(--radius); }

.heading-anchor { margin-left: .4em; color: var(--ink-faint); opacity: 0; transition: opacity .15s ease; vertical-align: middle; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }

.link-external::after { content: "↗"; font-size: .8em; margin-left: .15em; color: var(--ink-faint); }

/* inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: .875em;
  padding: .14em .38em; border-radius: 5px;
  background: var(--teal-soft); color: var(--teal-deep);
  overflow-wrap: break-word;
}

/* ── tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.table-wrap th, .table-wrap td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap th { background: var(--bg-soft); font-weight: 700; white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: 0; }

/* ── code blocks ────────────────────────────────────────────────────── */
.code-block { margin: 0 0 1.3em; border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 6px 3px 14px; border-bottom: 1px solid rgba(224, 242, 241, 0.10);
}
.code-block pre { margin: 0; padding: 12px 16px 14px; overflow-x: auto; }
.code-block code {
  font-family: var(--font-mono); font-size: .855rem; line-height: 1.6;
  color: var(--code-fg); white-space: pre; display: block;
}
.code-lang {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .07em; text-transform: uppercase;
  color: rgba(224, 242, 241, 0.6); user-select: none;
}
.code-copy {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; padding: 0; cursor: pointer;
  background: transparent; border: 0; border-radius: 6px;
  color: rgba(224, 242, 241, 0.55); transition: color .15s ease, background .15s ease;
}
.code-copy:hover { background: rgba(255, 255, 255, 0.12); color: var(--code-fg); }
.code-copy.is-copied { background: var(--teal); color: #fff; }
/* The scrollbar sits inside the block rather than under the page. */
.code-block pre::-webkit-scrollbar { height: 9px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(224, 242, 241, 0.22); border-radius: 5px; }
.code-block pre::-webkit-scrollbar-track { background: transparent; }

/* ── callouts ───────────────────────────────────────────────────────── */
.callout {
  margin: 0 0 1.4em; padding: 13px 16px;
  border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius);
  background: var(--bg-soft);
}
.callout__head { display: flex; align-items: center; gap: 8px; margin: 0 0 .4em; font-weight: 700; font-size: .93rem; }
.callout__body > *:last-child { margin-bottom: 0; }
.callout__body { font-size: .95rem; }
.callout--note    { border-left-color: var(--teal);  background: #f2fbfa; }
.callout--note .callout__head { color: var(--teal-deep); }
.callout--tip     { border-left-color: #43a047; background: #f3faf3; }
.callout--tip .callout__head { color: #2e7d32; }
.callout--warning { border-left-color: var(--amber); background: var(--amber-soft); }
.callout--warning .callout__head { color: #8a6600; }
.callout--danger  { border-left-color: var(--coral); background: var(--coral-soft); }
.callout--danger .callout__head { color: #c62828; }

/* ── cards / badges / steps ─────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 14px; margin: 0 0 1.6em; }
.card {
  padding: 17px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.card__icon { display: inline-flex; color: var(--teal); margin-bottom: 9px; }
.card__title { font-size: 1rem; font-weight: 700; margin: 0 0 5px; border-bottom: 0; padding-bottom: 0; scroll-margin-top: 0; }
.card__text { font-size: .9rem; color: var(--ink-muted); margin: 0; }

.badge-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 14px; margin: 0 0 1.6em; }
.badge-card { display: flex; gap: 11px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-soft); }
.badge-card__icon {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-deep);
}
.badge-card__title { font-weight: 700; font-size: .93rem; }
.badge-card__text { font-size: .93rem; color: var(--ink-muted); }

.doc-steps { counter-reset: step; margin: 0 0 1.6em; }
.doc-steps ol { list-style: none; margin: 0; padding: 0; }
.doc-steps ol > li {
  counter-increment: step; position: relative;
  padding: 0 0 18px 42px; margin: 0;
  border-left: 2px solid var(--border); margin-left: 15px;
}
.doc-steps ol > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.doc-steps ol > li::before {
  content: counter(step);
  position: absolute; left: -16px; top: -2px;
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-deep);
  border: 1px solid var(--border-teal);
  font-size: .82rem; font-weight: 700;
}

/* ── OS tabs (CSS-only; JS only persists the choice) ────────────────── */
.os-tabs { margin: 0 0 1.5em; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.os-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.os-tablist { display: flex; gap: 2px; padding: 6px 6px 0; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.os-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer;
  font-size: .875rem; font-weight: 600; color: var(--ink-muted);
  border: 1px solid transparent; border-bottom: 0;
}
.os-tab:hover { color: var(--ink); background: rgba(0, 150, 136, 0.06); }
.os-panel { display: none; padding: 16px 17px 4px; }
.os-panel > *:last-child { margin-bottom: 12px; }

.os-radio--windows:checked ~ .os-panels > .os-panel--windows,
.os-radio--macos:checked   ~ .os-panels > .os-panel--macos,
.os-radio--linux:checked   ~ .os-panels > .os-panel--linux { display: block; }

.os-radio--windows:checked ~ .os-tablist > .os-tab[data-os="windows"],
.os-radio--macos:checked   ~ .os-tablist > .os-tab[data-os="macos"],
.os-radio--linux:checked   ~ .os-tablist > .os-tab[data-os="linux"] {
  background: var(--bg); color: var(--teal-deep);
  border-color: var(--border); box-shadow: 0 1px 0 0 var(--bg);
}
/* Keyboard reachability: the radios are visually hidden but still focusable,
   so a focused radio must visibly ring its own label. */
.os-radio:focus-visible ~ .os-tablist > .os-tab[data-os] { outline: none; }
.os-radio--windows:focus-visible ~ .os-tablist > .os-tab[data-os="windows"],
.os-radio--macos:focus-visible   ~ .os-tablist > .os-tab[data-os="macos"],
.os-radio--linux:focus-visible   ~ .os-tablist > .os-tab[data-os="linux"] { outline: 2px solid var(--teal); outline-offset: -2px; }

/* Pre-hydration override, set by os-preference.js before first paint and
   REMOVED by docs.js the moment the real radios hold the stored choice.
   Without it a macOS reader with a stored preference watches the Windows
   panel paint and then swap, on exactly the pages where the install
   command is above the fold. `!important` is what lets a plain attribute
   selector outrank the `:checked ~` rules for that one frame. */
html[data-os] .os-panel { display: none !important; }
html[data-os="windows"] .os-panels > .os-panel--windows,
html[data-os="macos"]   .os-panels > .os-panel--macos,
html[data-os="linux"]   .os-panels > .os-panel--linux { display: block !important; }
html[data-os] .os-tablist > .os-tab { background: transparent; color: var(--ink-muted); border-color: transparent; }
html[data-os="windows"] .os-tablist > .os-tab[data-os="windows"],
html[data-os="macos"]   .os-tablist > .os-tab[data-os="macos"],
html[data-os="linux"]   .os-tablist > .os-tab[data-os="linux"] {
  background: var(--bg); color: var(--teal-deep); border-color: var(--border);
}

.os-block-label { font-size: .82rem; font-weight: 600; color: var(--ink-muted); margin: 0 0 6px; }
.os-note { display: flex; gap: 7px; font-size: .87rem; color: var(--ink-muted); margin: 4px 0 0; }
.os-note svg { flex: 0 0 auto; margin-top: 3px; color: var(--teal); }

/* ── pager / meta ───────────────────────────────────────────────────── */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 3em 0 1.4em; }
.pager__link {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.pager__link:hover { border-color: var(--teal); box-shadow: var(--shadow-card); text-decoration: none; }
.pager__link--next { justify-content: flex-end; text-align: right; }
.pager__link svg { flex: 0 0 auto; color: var(--teal); }
.pager__dir { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.pager__title { display: block; font-weight: 600; font-size: .93rem; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } }

.page-meta { font-size: .82rem; color: var(--ink-faint); margin: 1.6em 0 0; }

/* Links inside running text are UNDERLINED, not just recoloured.
   ⚠️ This one cannot be fixed with colour: the audit wants 3:1 between the
   link and the surrounding text, and teal-deep against any grey in this
   palette is ~1.1:1. Underline is the only distinguisher that works, which
   is also why it is scoped to text blocks — card titles and nav links are
   unambiguous from their position and stay clean. */
.prose p a, .prose li a, .prose td a, .prose blockquote a, .page-meta a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: from-font;
}
.prose p a:hover, .prose li a:hover, .prose td a:hover, .page-meta a:hover {
  text-decoration-thickness: 2px;
}

/* ── on-this-page ───────────────────────────────────────────────────── */
.toc-rail { position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 30px 0 48px; }
.toc__head { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); margin: 0 0 9px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc__item a { display: block; padding: 4px 0 4px 13px; margin-left: -1px; font-size: .845rem; color: var(--ink-muted); border-left: 2px solid transparent; }
.toc__item a:hover { color: var(--ink); text-decoration: none; }
.toc__item a.is-current { color: var(--teal-deep); font-weight: 600; border-left-color: var(--teal); }
.toc__item--h3 a { padding-left: 25px; font-size: .82rem; }

/* ── footer ─────────────────────────────────────────────────────────── */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.site-footer__inner {
  max-width: 1440px; margin: 0 auto; padding: 34px 18px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 26px;
}
@media (max-width: 760px) { .site-footer__inner { grid-template-columns: 1fr 1fr; } }
.site-footer__brand { font-weight: 700; color: var(--teal-deep); margin: 0 0 7px; }
.site-footer__blurb { font-size: .88rem; color: var(--ink-muted); margin: 0; max-width: 42ch; }
.site-footer__head { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin: 0 0 9px; }
.site-footer a { display: block; font-size: .89rem; color: var(--ink-muted); padding: 2px 0; }
.site-footer a:hover { color: var(--teal-deep); }

/* ── search ─────────────────────────────────────────────────────────── */
.search-dialog {
  width: min(680px, calc(100vw - 28px)); max-height: min(72vh, 620px);
  margin: 9vh auto auto; padding: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); background: var(--bg); color: var(--ink);
  overflow: hidden;
}
.search-dialog::backdrop { background: rgba(26, 26, 46, 0.42); backdrop-filter: blur(2px); }
.search-form { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.search-form__icon { flex: 0 0 auto; color: var(--ink-faint); }
.search-input { flex: 1 1 auto; font: inherit; font-size: 1rem; border: 0; outline: none; background: none; color: var(--ink); min-width: 0; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-close { display: inline-flex; padding: 5px; background: none; border: 0; border-radius: 7px; color: var(--ink-faint); cursor: pointer; }
.search-close:hover { background: var(--bg-soft); color: var(--ink); }

.search-results { overflow-y: auto; max-height: calc(min(72vh, 620px) - 106px); padding: 6px; }
.search-group__head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); padding: 10px 10px 5px; }
.search-hit { display: block; padding: 9px 11px; border-radius: 8px; color: var(--ink); }
.search-hit:hover, .search-hit.is-active { background: var(--teal-soft); text-decoration: none; }
.search-hit__title { display: block; font-weight: 600; font-size: .93rem; }
.search-hit__crumb { display: block; font-size: .76rem; color: var(--ink-faint); }
.search-hit__excerpt { display: block; font-size: .84rem; color: var(--ink-muted); margin-top: 2px; }
.search-hit mark { background: #fff3bf; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 26px 14px; text-align: center; color: var(--ink-faint); font-size: .92rem; }
.search-hint { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: center; margin: 0; padding: 9px; border-top: 1px solid var(--border); font-size: .76rem; color: var(--ink-faint); }

/* ── home / section index ───────────────────────────────────────────── */
.home-hero { padding: 34px 0 8px; }
.home-hero h1 { font-size: 2.5rem; line-height: 1.14; margin: 0 0 12px; letter-spacing: -0.02em; }
.home-hero .accent { color: var(--teal); }
@media (max-width: 600px) { .home-hero h1 { font-size: 1.9rem; } }

.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 15px; margin: 0 0 2em; }
.section-card { display: block; padding: 19px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--ink); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.section-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--border-teal); text-decoration: none; }
.section-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 11px; background: var(--teal-soft); color: var(--teal-deep); margin-bottom: 11px; }
.section-card__icon--coral { background: var(--coral-soft); color: #c62828; }
.section-card__icon--deep { background: #e0f2f1; color: var(--teal-deep); }
.section-card__title { font-size: 1.06rem; font-weight: 700; margin: 0 0 5px; border-bottom: 0; padding-bottom: 0; scroll-margin-top: 0; }
.section-card__blurb { font-size: .9rem; color: var(--ink-muted); margin: 0 0 9px; }
.section-card__count { font-size: .78rem; color: var(--ink-faint); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 2em; padding: 0; list-style: none; }

@media print {
  .topbar, .sidebar, .toc-rail, .pager, .search-dialog, .site-footer { display: none !important; }
  .layout { display: block; }
  .code-block { border: 1px solid #ccc; }
}
