/* GoPhore Support — help center
   Brand tokens (navy / teal, Poppins headings) are PROVISIONAL: docs/BRAND.md
   Tokens first; components keep the class names documented in docs/ARTICLE-STYLE.md
   (.ui, .steps, .quick-answer, .callout-*, figure, .table-scroll, .option-list, .badge).
   Theme: <html data-theme="light|dark"> is set before paint by the inline script in
   templates/layout.php (System / Light / Dark switch, saved in localStorage). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/InterVariable.woff2") format("woff2");
}
/* Poppins — gophore.com's heading face (H1/H2 only). Self-hosted latin subset, SIL OFL. */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Poppins-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/Poppins-Bold.woff2") format("woff2");
}

/* ——— Tokens: light ——— */
:root {
  color-scheme: light;

  /* Brand (PROVISIONAL — from gophore.com live CSS; see docs/BRAND.md) */
  --brand-navy: #202e5c;        /* gophore.com header background */
  --brand-indigo: #4b507b;      /* gophore.com --color_1 (H1 colour) */
  --brand-teal: #00b3e0;        /* gophore.com --color_2 (buttons, H2) = logo cloud */
  --brand-tint: #edf1ff;        /* gophore.com --color_4 */

  --bg: #ffffff;
  --bg-subtle: #f6f8fb;
  --bg-muted: #eef2f7;
  --surface: #ffffff;           /* cards, inputs, menus */
  --surface-raised: #ffffff;
  --header-solid: var(--bg);
  --header-bg: rgba(255, 255, 255, 0.8);

  --text: #151c33;              /* headings — navy-tinted ink, 16.9:1 on bg */
  --text-2: #363f55;            /* body, 10.5:1 */
  --muted: #5c6579;             /* secondary text, 5.85:1 on bg / 5.2:1 on bg-muted */
  --faint: #8a93a6;             /* icons, separators, placeholders only */
  --border: #e3e8ef;
  --border-strong: #d0d7e2;

  /* Teal accent. Brand teal #00b3e0 is only 2.46:1 on white, so text uses a darker
     shade of the same hue (#00728f, 5.52:1); brand teal is kept for fills. */
  --accent: #00728f;            /* links, active nav, TOC, eyebrow */
  --accent-hover: #005c74;
  --accent-fill: var(--brand-teal);  /* step numbers, Quick answer tile */
  --accent-ink: var(--brand-navy);   /* text on teal fill, 5.31:1 */
  --accent-bright: #00728f;     /* checkmarks */
  --accent-soft: #e6f6fb;
  --accent-line: #b5e3f1;
  --focus: #008bad;             /* focus ring, 3.96:1 on white (non-text ≥ 3:1) */

  --tip-bg: #ecf8fc;   --tip-border: #c3e7f2;  --tip-ink: #0b4f63;
  --note-bg: #f1f4fb;  --note-border: #d8dfef; --note-ink: #2d3a5e;
  --warn-bg: #fff8ec;  --warn-border: #f0dcb0; --warn-ink: #734a00;
  --draft-bg: #f0f2f4; --draft-ink: #555e68;
  --ready-bg: #fff3dc; --ready-ink: #855000;
  --blocked-bg: #fdecec; --blocked-ink: #9b1c1c;

  --qa-bg: linear-gradient(180deg, #eef9fd 0%, #f9fdfe 100%);
  --well-bg: #edf1f6;
  --code-bg: #eef2f7;
  --img-filter: none;
  --hero-glow: rgba(0, 179, 224, 0.13);

  /* Shape scale */
  --r-xs: 5px;    /* chips, kbd */
  --r-sm: 8px;    /* buttons, inputs, nav items */
  --r-md: 10px;   /* tables, callouts, images */
  --r-lg: 14px;   /* cards */
  --r-xl: 18px;   /* hero search */

  /* Elevation scale */
  --shadow-1: 0 1px 2px rgba(16, 24, 32, 0.05);
  --shadow-2: 0 1px 2px rgba(16, 24, 32, 0.04), 0 4px 12px rgba(16, 24, 32, 0.05);
  --shadow-3: 0 2px 6px rgba(16, 24, 32, 0.05), 0 12px 32px rgba(16, 24, 32, 0.10);
  --shadow-4: 0 16px 56px rgba(16, 24, 32, 0.22);

  /* Layout */
  --header-h: 60px;
  --sidebar-w: 264px;
  --toc-w: 232px;
  --measure: 44rem;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: .14s;
  --t: .2s;

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

/* ——— Tokens: dark (soft GoPhore navy, not black) ——— */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #172036;
  --bg-subtle: #1b2540;
  --bg-muted: #26324f;
  --surface: #1d2844;
  --surface-raised: #23304f;
  --header-solid: var(--brand-navy);  /* same navy as the gophore.com header */
  --header-bg: rgba(32, 46, 92, 0.86);

  --text: #edf1ff;              /* 14.4:1 on bg */
  --text-2: #d5dbea;            /* 11.7:1 */
  --muted: #a8b2c9;             /* 7.6:1 on bg, 6.0:1 on bg-muted */
  --faint: #7d88a3;
  --border: #2d3a5a;
  --border-strong: #3c4a6e;

  --accent: #00b3e0;            /* brand teal passes on navy: 6.58:1 on bg */
  --accent-hover: #5ccbea;
  --accent-fill: #00b3e0;
  --accent-ink: #0d1a33;        /* 7.0:1 on teal */
  --accent-bright: #3fc4e8;
  --accent-soft: rgba(0, 179, 224, 0.12);
  --accent-line: rgba(0, 179, 224, 0.34);
  --focus: #00b3e0;

  --tip-bg: rgba(0, 179, 224, 0.08);    --tip-border: rgba(0, 179, 224, 0.26);   --tip-ink: #a9e4f5;
  --note-bg: rgba(150, 170, 230, 0.08); --note-border: rgba(150, 170, 230, 0.24); --note-ink: #cdd7f0;
  --warn-bg: rgba(230, 175, 70, 0.08);  --warn-border: rgba(230, 175, 70, 0.26); --warn-ink: #f0d295;
  --draft-bg: #2a3553; --draft-ink: #bcc5da;
  --ready-bg: rgba(230, 175, 70, 0.14); --ready-ink: #f2cb85;
  --blocked-bg: rgba(230, 90, 90, 0.14); --blocked-ink: #f4abab;

  --qa-bg: linear-gradient(180deg, rgba(0, 179, 224, 0.09) 0%, rgba(0, 179, 224, 0.03) 100%);
  --well-bg: #222d4a;
  --code-bg: #26324f;
  --img-filter: brightness(.92) contrast(1.04);
  --hero-glow: rgba(0, 179, 224, 0.14);

  --shadow-1: 0 1px 2px rgba(5, 10, 25, 0.3);
  --shadow-2: 0 1px 2px rgba(5, 10, 25, 0.25), 0 4px 14px rgba(5, 10, 25, 0.28);
  --shadow-3: 0 2px 8px rgba(5, 10, 25, 0.3), 0 14px 36px rgba(5, 10, 25, 0.4);
  --shadow-4: 0 18px 60px rgba(5, 10, 25, 0.55);
}

/* ——— Base ——— */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.theme-changing *, .theme-changing *::before, .theme-changing *::after { transition: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01", "ss03";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent-hover); }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; color: var(--bg); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--faint); color: var(--text); background: var(--bg-subtle); }
.btn:active { transform: translateY(1px); }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, #fff); border-color: var(--accent-fill); color: var(--accent-ink); }

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--accent);
}
.section-label {
  margin: 0 0 18px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted);
}

/* ——— Header ——— */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--header-solid);
  border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.page-home .site-header:not(.is-scrolled) { background: var(--bg-subtle); border-bottom-color: transparent; }
[data-theme="dark"] .site-header,
[data-theme="dark"] .page-home .site-header:not(.is-scrolled) { background: var(--header-solid); border-bottom-color: rgba(255, 255, 255, 0.06); }
.site-header.is-scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
          backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--border), 0 6px 20px -12px rgba(21, 28, 51, 0.2);
  border-bottom-color: transparent;
}
.header-inner {
  height: 100%;
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); font-weight: 650; font-size: 15px; letter-spacing: -0.012em;
  flex-shrink: 0; border-radius: var(--r-sm);
}
.brand:hover { color: var(--text); }
.brand-mark { display: block; width: auto; height: 32px; flex-shrink: 0; }
.footer-brand .brand-mark { height: 24px; }
.brand-divider { width: 1px; height: 16px; background: var(--border-strong); }
.brand-product { color: var(--muted); font-weight: 500; }

.site-nav { display: flex; gap: 2px; }
.site-nav a {
  padding: 6px 11px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.site-nav a:hover { color: var(--text); background: var(--bg-muted); }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }

.header-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-link {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 550; color: var(--text); white-space: nowrap;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.header-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-muted); }
.header-link svg { color: var(--muted); }
.menu-btn { display: none; margin-left: -8px; }

/* Theme switch — icon segmented control */
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-subtle);
}
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 28px; height: 26px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-checked="true"] {
  color: var(--text); background: var(--surface-raised);
  box-shadow: var(--shadow-1), 0 0 0 1px var(--border);
}
.theme-switch button:focus-visible { outline-offset: 1px; border-radius: 999px; }
.theme-switch-labeled { display: flex; width: 100%; border-radius: var(--r-sm); }
.theme-switch-labeled button { flex: 1; width: auto; height: 32px; border-radius: 6px; font-size: 13.5px; font-weight: 500; }
.theme-switch-labeled button[aria-checked="true"] { border-radius: 6px; }

/* ——— Search ——— */
.search { position: relative; }
.search-input {
  width: 100%;
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--faint); opacity: 1; }
.search-input:hover { border-color: var(--faint); }
.search-input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-input:focus ~ .search-kbd,
.search-input:not(:placeholder-shown) ~ .search-kbd { display: none; }

.search-compact { width: 248px; }
.search-compact .search-input { height: 34px; padding: 0 32px 0 34px; font-size: 13.5px; background: var(--bg-subtle); border-color: var(--border); }
.search-compact .search-input:hover { border-color: var(--border-strong); }
.search-compact .search-input:focus { background: var(--surface); border-color: var(--focus); }

.search-results {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 6px;
  max-height: min(420px, 70vh); overflow-y: auto;
  text-align: left;
  animation: pop-in var(--t-fast) var(--ease);
}
.search-compact .search-results { left: auto; width: 400px; }
.search-result { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); }
.search-result:hover, .search-result.is-active { background: var(--bg-muted); color: var(--text); }
.search-result-title { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.search-result-cat { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.search-result-snippet {
  margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--muted);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.search-result mark { background: transparent; color: var(--accent); font-weight: 600; }
.search-empty { margin: 0; padding: 14px 12px; font-size: 14px; color: var(--muted); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ——— Main / footer ——— */
.site-main { flex: 1; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); color: var(--muted); font-size: 14px; }
.footer-inner {
  max-width: 1440px; margin: 0 auto; padding: 32px 24px 36px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px 48px; flex-wrap: wrap;
}
.footer-about { display: flex; flex-direction: column; gap: 8px; }
.footer-brand { font-size: 14px; }
.footer-tagline { margin: 0; font-size: 13.5px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 2px; }
.footer-links a { color: var(--muted); font-size: 13.5px; font-weight: 500; border-radius: 4px; }
.footer-links a:hover { color: var(--text); }

/* ——— Badges ——— */
.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px;
  font-size: 12px; font-weight: 560; line-height: 1; letter-spacing: 0.005em;
  border-radius: 999px; white-space: nowrap;
  background: var(--bg-muted); color: var(--text-2);
}
.badge.audience { background: var(--accent-soft); color: var(--accent); }
.badge.status-draft { background: var(--draft-bg); color: var(--draft-ink); }
.badge.status-ready-for-review { background: var(--ready-bg); color: var(--ready-ink); }
.badge.status-blocked { background: var(--blocked-bg); color: var(--blocked-ink); }
.badge.status-published { background: var(--accent-soft); color: var(--accent); }

/* ——— Home ——— */
.hero {
  position: relative;
  padding: 92px 24px 80px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 55% 75% at 50% -10%, var(--hero-glow) 0%, transparent 70%),
    var(--bg-subtle);
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.4vw, 3.1rem);
  line-height: 1.12; font-weight: 600; letter-spacing: -0.022em;
  color: var(--text);
}
.hero-lede { margin: 16px auto 34px; max-width: 32rem; font-size: 18px; line-height: 1.55; color: var(--muted); letter-spacing: -0.006em; }
.search-hero { max-width: 600px; margin: 0 auto; }
.search-hero .search-input {
  height: 56px; padding: 0 52px 0 50px; font-size: 16.5px;
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  border-color: var(--border);
}
.search-hero .search-input:hover { border-color: var(--border-strong); box-shadow: var(--shadow-3); }
.search-hero .search-input:focus { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent), var(--shadow-2); }
.search-hero .search-icon { left: 18px; }
.search-hero .search-kbd { right: 16px; }
.search-hero .search-results { top: calc(100% + 8px); }
.hero-suggest {
  margin: 20px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--muted);
}
.suggest-chip {
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.suggest-chip:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

.home-body { max-width: 1120px; margin: 0 auto; padding: 64px 24px 96px; }
.home-section + .home-section { margin-top: 64px; }

.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.category-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.category-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.category-card:target { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-2); }
.category-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.category-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  transition: transform var(--t) var(--ease);
}
.category-card:hover .category-icon { transform: scale(1.05); }
.category-count { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.category-count.is-empty { padding: 2px 8px; border-radius: 999px; background: var(--bg-muted); }
.category-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 650; letter-spacing: -0.018em; color: var(--text); }
.category-desc { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.category-links { list-style: none; margin: 20px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); }
.category-links li { display: flex; align-items: center; gap: 8px; }
.category-links a {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 0;
  font-size: 14.5px; font-weight: 550; color: var(--text); border-radius: 4px;
}
.category-links a svg { color: var(--faint); transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.category-links a:hover { color: var(--accent); }
.category-links a:hover svg { color: var(--accent); transform: translateX(3px); }
.category-empty {
  margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 13.5px; color: var(--muted);
}

.recent-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.recent-list li + li { border-top: 1px solid var(--border); }
.recent-item {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 20px; color: var(--text);
  transition: background var(--t-fast) var(--ease);
}
.recent-item:hover { background: var(--bg-subtle); color: var(--text); }
.recent-item:focus-visible { outline-offset: -2px; border-radius: 0; }
.recent-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.recent-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.recent-summary { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.recent-meta svg { color: var(--faint); transition: transform var(--t) var(--ease), color var(--t) var(--ease); }
.recent-item:hover .recent-meta svg { color: var(--accent); transform: translateX(3px); }

/* ——— Article shell ——— */
.doc-shell {
  max-width: 1440px; margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
  background: linear-gradient(var(--border), var(--border)) no-repeat calc(var(--sidebar-w) - 1px) 0 / 1px 100%;
}

.doc-sidebar {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 32px 16px 40px 24px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar-head, .sidebar-search, .sidebar-theme { display: none; }
.nav-group + .nav-group { margin-top: 26px; }
.nav-group-title {
  margin: 0 0 6px; padding: 0 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group li + li { margin-top: 1px; }
.nav-group a {
  display: block; padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 14px; line-height: 1.4; color: var(--text-2);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-group a:hover { color: var(--text); background: var(--bg-muted); }
.nav-group a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-empty { margin: 0; padding: 4px 10px; font-size: 13.5px; color: var(--muted); }

.doc-main { min-width: 0; padding: 44px 56px 104px; container-type: inline-size; }
.doc-main > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }

.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 22px; font-size: 13.5px; color: var(--faint); }
.breadcrumb a { color: var(--muted); font-weight: 500; border-radius: 4px; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb svg { color: var(--faint); }

.doc-header { padding-bottom: 32px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.doc-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.2vw, 2.45rem);
  line-height: 1.16; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text);
}
.doc-summary { margin: 14px 0 0; font-size: 18.5px; line-height: 1.55; color: var(--text-2); letter-spacing: -0.008em; max-width: 40rem; }
.doc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 20px; }
.meta-text { margin-left: 4px; font-size: 13px; color: var(--muted); }

.doc-toc {
  position: sticky; top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 48px 24px 40px 8px;
  scrollbar-width: thin;
}
.toc-title { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.doc-toc ul, .toc-inline ul { list-style: none; margin: 0; padding: 0; }
.doc-toc ul { border-left: 1px solid var(--border); }
.doc-toc li a {
  display: block; margin-left: -1px; padding: 4px 0 4px 14px;
  border-left: 2px solid transparent;
  font-size: 13.5px; line-height: 1.45; color: var(--muted);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.doc-toc li.toc-l3 a { padding-left: 26px; font-size: 13px; }
.doc-toc li a:hover { color: var(--text); }
.doc-toc li a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 560; }
.doc-toc li a:focus-visible { outline-offset: -2px; border-radius: 4px; }
.toc-top { display: inline-flex; margin-top: 20px; font-size: 13px; color: var(--muted); border-radius: 4px; }
.toc-top:hover { color: var(--text); }

.toc-inline { display: none; }

/* ——— Prose ——— */
.prose { font-size: 16px; line-height: 1.72; color: var(--text-2); letter-spacing: -0.003em; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose .lead { font-size: 18px; line-height: 1.6; color: var(--text-2); }
.prose strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.prose .muted { color: var(--muted); }
.prose a { color: var(--accent); font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.prose a:hover { text-decoration-color: currentColor; }

.prose h2, .prose h3, .prose h4 { position: relative; color: var(--text); }
.prose h2 { margin: 64px 0 14px; font-family: var(--font-display); font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -0.014em; }
.prose h3 { margin: 40px 0 10px; font-size: 18px; line-height: 1.4; font-weight: 640; letter-spacing: -0.014em; }
.prose h4 { margin: 28px 0 8px; font-size: 16px; font-weight: 620; }
.prose h2 + h3 { margin-top: 22px; }
.prose h2 + p, .prose h3 + p { margin-top: 0; }
.anchor {
  margin-left: 8px; color: var(--faint) !important; font-weight: 400;
  text-decoration: none !important; opacity: 0; transition: opacity var(--t-fast) var(--ease);
  border-radius: 4px;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus-visible { opacity: 1; }

.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 6px 0; padding-left: 4px; }
.prose li::marker { color: var(--faint); }

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 44px 0; }

.prose code {
  font-family: var(--mono); font-size: 0.85em;
  padding: 0.14em 0.4em; border-radius: var(--r-xs);
  background: var(--code-bg); color: var(--text);
  border: 1px solid var(--border);
}
.prose pre {
  margin: 0 0 20px; padding: 16px 18px; overflow-x: auto;
  border-radius: var(--r-md); background: #141c33; color: #e6ebf7; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--border);
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
kbd, .prose kbd {
  display: inline-block; min-width: 1.6em; padding: 0.08em 0.45em;
  font-family: var(--font); font-size: 0.76em; font-weight: 560; line-height: 1.55; text-align: center;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-xs);
}

/* UI label chip — neutral, so a page full of labels stays calm */
.ui {
  display: inline;
  padding: 0.1em 0.38em;
  font-size: 0.88em; font-weight: 560; font-style: normal; letter-spacing: -0.003em;
  color: var(--text);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  white-space: nowrap;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* Numbered steps */
.prose ol.steps { list-style: none; padding: 0; margin: 0 0 24px; counter-reset: step; }
.prose ol.steps > li {
  position: relative; counter-increment: step;
  margin: 0; padding: 1px 0 18px 42px; min-height: 28px;
}
.prose ol.steps > li:last-child { padding-bottom: 0; }
.prose ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-size: 13px; font-weight: 650; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.prose ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 4px;
  width: 1px; background: var(--border);
}
.prose ol.steps > li > :first-child { margin-top: 0; }
.prose ol.steps figure { margin: 14px 0 6px; }

/* Plain Markdown ordered lists: same marker language as .steps, compact */
.prose ol:not(.steps) { list-style: none; padding-left: 0; counter-reset: li; }
.prose ol:not(.steps) > li { position: relative; counter-increment: li; padding-left: 34px; margin: 8px 0; }
.prose ol:not(.steps) > li::before {
  content: counter(li);
  position: absolute; left: 0; top: 3px;
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg-muted); box-shadow: inset 0 0 0 1px var(--border);
  font-size: 12px; font-weight: 650; color: var(--text-2); line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Quick answer card */
.prose .quick-answer {
  margin: 0 0 28px; padding: 24px 26px 26px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: var(--qa-bg);
  box-shadow: var(--shadow-1);
}
.prose .quick-answer h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 18px;
  font-family: var(--font);
  font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.prose .quick-answer h2::before {
  content: ""; width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23202e5c' d='M9.3 1 3 9.2h4.4L6.6 15 13 6.7H8.6z'/%3E%3C/svg%3E") center / 12px no-repeat,
    var(--accent-fill);
}
[data-theme="dark"] .prose .quick-answer h2::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%230d1a33' d='M9.3 1 3 9.2h4.4L6.6 15 13 6.7H8.6z'/%3E%3C/svg%3E") center / 12px no-repeat,
    var(--accent-fill);
}
.prose .quick-answer .anchor { display: none; }
.prose .quick-answer ol.steps { margin: 0; }
.prose .quick-answer ol.steps > li { padding-bottom: 14px; color: var(--text); }
.prose .quick-answer ol.steps > li:last-child { padding-bottom: 0; }
.prose .quick-answer ol.steps > li::before { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.prose .quick-answer ol.steps > li:not(:last-child)::after { background: var(--accent-line); }
.prose .quick-answer figure { margin: 24px 0 0; }
/* Toolbar screenshot becomes the card's footer, edge to edge, at true size */
.prose .quick-answer figure.fig-toolbar {
  margin: 24px -26px -26px; padding: 12px 11px 0;
  border: 0; border-top: 1px solid var(--accent-line);
  border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px);
}
.prose .quick-answer figure.fig-toolbar > img { margin: 0 auto; }
.prose .quick-answer figure.fig-toolbar figcaption { margin: 12px -11px 0; padding: 11px 26px 13px; border-top-color: var(--accent-line); }

/* Figures */
.prose figure { margin: 32px 0; }
.prose figure img,
.prose > p > img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  background: #fff;
  filter: var(--img-filter);
  transition: box-shadow var(--t) var(--ease), filter var(--t) var(--ease);
}
.prose figure img { cursor: zoom-in; }
.prose figure img:hover { box-shadow: var(--shadow-3); }
[data-theme="dark"] .prose figure img { border-color: var(--border-strong); }
[data-theme="dark"] .prose figure img:hover { filter: none; }
.prose figcaption { margin-top: 12px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.prose figcaption .ui { font-size: 0.92em; }
@container (min-width: 50rem) {
  .prose figure.fig-wide { width: min(100cqw, 56rem); margin-left: calc((100% - min(100cqw, 56rem)) / 2); }
  .prose figure.fig-wide figcaption { max-width: var(--measure); }
}
/* Inside the Quick answer card, fig-wide stays in the card so the image
   and caption line up with the card text (no desktop breakout). */
.prose .quick-answer figure.fig-wide {
  width: auto;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.prose .quick-answer figure.fig-wide figcaption {
  max-width: none;
}

/* Toolbar strip in a soft "well" (keeps a thin light screenshot calm in both themes) */
.prose figure.fig-toolbar {
  position: relative;
  padding: 12px 12px 0;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--well-bg);
  overflow: hidden;
}
.prose figure.fig-toolbar > img { box-shadow: none; border-radius: 6px; border-color: var(--border-strong); }
.prose figure.fig-toolbar figcaption {
  margin: 12px -12px 0; padding: 10px 14px 12px;
  border-top: 1px solid var(--border); background: var(--surface);
}

/* Framed screenshot: a small capture shown at its natural size (never upscaled),
   centred in a soft well; click to zoom. */
.prose figure.fig-frame {
  padding: 20px 20px 0;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--well-bg);
  overflow: hidden;
}
.prose figure.fig-frame > img { margin: 0 auto; border-radius: 6px; border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.prose figure.fig-frame figcaption {
  margin: 20px -20px 0; padding: 11px 16px 13px;
  border-top: 1px solid var(--border); background: var(--surface);
}

/* Callouts */
.callout {
  display: block;
  margin: 28px 0; padding: 14px 18px 15px 46px;
  position: relative;
  border: 1px solid var(--note-border); border-radius: var(--r-md);
  background: var(--note-bg); color: var(--note-ink);
  font-size: 15px; line-height: 1.6;
}
.callout::before {
  content: ""; position: absolute; left: 17px; top: 17px; width: 16px; height: 16px;
  background: currentColor; opacity: .9;
  -webkit-mask: var(--callout-icon) center / contain no-repeat; mask: var(--callout-icon) center / contain no-repeat;
}
.callout > strong:first-child,
.callout-title { display: block; margin: 0 0 2px; font-weight: 650; color: inherit; }
.callout p { margin: 0 0 8px; color: inherit; }
.callout > :last-child { margin-bottom: 0; }
.callout .ui { background: color-mix(in srgb, var(--bg) 65%, transparent); border-color: color-mix(in srgb, currentColor 20%, transparent); color: inherit; }
.callout-note { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1Zm.9 10.6H7.1V7h1.8v4.6ZM8 5.9a1.05 1.05 0 1 1 0-2.1 1.05 1.05 0 0 1 0 2.1Z'/%3E%3C/svg%3E"); }
.callout-tip { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a5 5 0 0 0-3 9c.6.5 1 1.1 1 1.8V12h4v-.2c0-.7.4-1.3 1-1.8a5 5 0 0 0-3-9Zm-2 12.2V14a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-.8H6Z'/%3E%3C/svg%3E");
  background: var(--tip-bg); border-color: var(--tip-border); color: var(--tip-ink); }
.callout-warn { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8.9 1.6a1 1 0 0 0-1.8 0L.6 13.4A1 1 0 0 0 1.5 15h13a1 1 0 0 0 .9-1.6L8.9 1.6ZM8.9 12.6H7.1v-1.8h1.8v1.8Zm0-3H7.1V5.4h1.8v4.2Z'/%3E%3C/svg%3E");
  background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }

/* Tables */
.table-scroll {
  margin: 20px 0 32px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose th {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  background: var(--bg-subtle); white-space: nowrap;
  padding-top: 9px; padding-bottom: 9px;
}
.prose tbody tr { transition: background var(--t-fast) var(--ease); }
.prose tbody tr:hover { background: var(--bg-subtle); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--text); width: 42%; }
.prose td .ui { white-space: nowrap; }
.prose table.matrix td:first-child { width: auto; }
.prose table.matrix th:not(:first-child),
.prose table.matrix td:not(:first-child) { text-align: center; width: 17%; }
.prose table.matrix td.yes { color: var(--accent-bright); font-weight: 700; }

/* Option chips (dropdown / radio values) */
.option-list,
.prose .option-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.prose .option-list li {
  margin: 0; padding: 2px 10px;
  font-size: 13.5px; font-weight: 500; line-height: 1.6;
  color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 999px;
}
.prose .option-list li::marker { content: none; }
.prose .option-list li.is-default { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.prose .option-list li.is-default::after { content: "default"; margin-left: 6px; font-size: 11.5px; font-weight: 500; opacity: .8; }

.prose .option-rows {
  display: grid; grid-template-columns: 136px minmax(0, 1fr); column-gap: 12px;
  margin: 16px 0 28px; padding: 0 18px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.prose .option-rows dt, .prose .option-rows dd { margin: 0; padding: 13px 0; }
.prose .option-rows dt { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.9; }
.prose .option-rows dt:not(:first-of-type),
.prose .option-rows dt:not(:first-of-type) + dd { border-top: 1px solid var(--border); }

.field-block { margin: 0 0 20px; }
.field-block > p { margin: 0 0 8px; font-size: 14.5px; }

/* FAQ / troubleshooting */
.prose dl.faq { margin: 16px 0 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); }
.prose dl.faq dt { margin: 0; padding: 16px 20px 0; font-weight: 620; color: var(--text); border-top: 1px solid var(--border); }
.prose dl.faq dt:first-child { border-top: 0; }
.prose dl.faq dd { margin: 4px 0 0; padding: 0 20px 16px; }

/* ——— Article footer ——— */
.related { margin-top: 48px; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li + li { margin-top: 6px; }

.feedback {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px;
  margin-top: 64px; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--bg-subtle);
}
.feedback-q { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.feedback-actions { display: flex; gap: 8px; }
.feedback-thanks { margin: 0; font-size: 14px; color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.pager-link {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--r-lg);
  color: var(--text); background: var(--surface);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.pager-link:hover { border-color: var(--accent-line); color: var(--text); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.pager-next { text-align: right; grid-column: 2; }
.pager-label { font-size: 12.5px; color: var(--muted); }
.pager-prev .pager-label::before { content: "← "; }
.pager-next .pager-label::after { content: " →"; }
.pager-title { font-size: 15px; font-weight: 600; }

/* ——— Lightbox ——— */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 56px 24px 24px;
  background: rgba(13, 20, 40, 0.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: zoom-out;
  animation: fade-in var(--t) var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: min(1600px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox-figure img {
  max-width: 100%; max-height: calc(100vh - 140px);
  border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-4);
  animation: zoom-in var(--t) var(--ease);
}
.lightbox-figure figcaption { margin-top: 14px; max-width: 60ch; text-align: center; font-size: 14px; color: #d6dade; }
.lightbox-figure figcaption .ui { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.lightbox-close { position: absolute; top: 14px; right: 14px; color: #fff; }
.lightbox-close:hover { background: rgba(255,255,255,.12); color: #fff; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }

.not-found { max-width: 560px; margin: 0 auto; padding: 120px 24px; text-align: center; }
.not-found h1 { margin: 0 0 8px; font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.not-found p { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ——— Responsive ——— */
@media (max-width: 1279px) {
  .doc-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .doc-toc { display: none; }
  .toc-inline {
    display: block; margin-bottom: 32px;
    border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--surface);
    font-size: 14px;
  }
  .toc-inline summary {
    padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--text);
    list-style: none; display: flex; justify-content: space-between; align-items: center;
    border-radius: var(--r-md);
  }
  .toc-inline summary::-webkit-details-marker { display: none; }
  .toc-inline summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg) translateY(-2px); transition: transform var(--t) var(--ease); }
  .toc-inline[open] summary::after { transform: rotate(225deg) translateY(-2px); }
  .toc-inline ul { padding: 6px 14px 12px; border-top: 1px solid var(--border); }
  .toc-inline li a { display: block; padding: 5px 0; color: var(--muted); }
  .toc-inline li.toc-l3 a { padding-left: 14px; }
  .toc-inline li a:hover { color: var(--text); }
  .search-compact { width: 210px; }
}

@media (max-width: 1023px) {
  .site-nav { display: none; }
  .has-sidebar .menu-btn { display: inline-grid; }
  .header-inner { gap: 12px; padding: 0 16px; }
  .has-sidebar .search-compact,
  .has-sidebar .header-theme { display: none; }

  .doc-shell { display: block; background: none; }
  .doc-main { padding: 28px 24px 72px; }

  .doc-sidebar {
    position: fixed; z-index: 60; top: 0; left: 0; bottom: 0;
    width: min(320px, 86vw); height: 100%;
    padding: 12px 16px 24px;
    display: flex; flex-direction: column;
    background: var(--bg);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-4);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .24s var(--ease), visibility 0s linear .24s;
  }
  .nav-open .doc-sidebar { transform: none; visibility: visible; transition: transform .24s var(--ease); }
  .sidebar-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -6px 10px 4px; }
  .sidebar-title { font-size: 14px; font-weight: 650; color: var(--text); }
  .sidebar-search { display: block; margin-bottom: 22px; }
  .sidebar-search .search-input { height: 40px; padding: 0 12px 0 34px; font-size: 15px; background: var(--bg-subtle); }
  .sidebar-nav { flex: 1; }
  .sidebar-theme { display: block; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
  .sidebar-theme .nav-group-title { padding: 0 2px; margin-bottom: 10px; }
  .nav-group a { padding: 8px 10px; font-size: 15px; }
  .nav-backdrop {
    position: fixed; inset: 0; z-index: 55;
    background: rgba(13, 20, 40, 0.5);
    animation: fade-in var(--t) var(--ease);
  }
  .nav-backdrop[hidden] { display: none; }
  .nav-open { overflow: hidden; }

  .category-grid { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 640px) {
  .brand-divider { display: none; }
  .header-link-text { display: none; }
  .header-link { width: 34px; padding: 0; justify-content: center; }
  .header-link svg { width: 14px; height: 14px; }
  .hero { padding: 56px 20px 52px; background: radial-gradient(ellipse 140% 70% at 50% -10%, var(--hero-glow) 0%, transparent 70%), var(--bg-subtle); }
  .hero-lede { font-size: 16px; margin-bottom: 26px; }
  .search-hero .search-input { height: 52px; font-size: 16px; padding-right: 16px; }
  .search-hero .search-kbd { display: none; }
  .home-body { padding: 44px 20px 72px; }
  .home-section + .home-section { margin-top: 48px; }
  .category-card { padding: 20px; }
  .category-card:hover { transform: none; }
  .category-empty { display: none; }
  .category-head { margin-bottom: 14px; }
  .recent-item { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; }
  .recent-summary { white-space: normal; }

  .doc-main { padding: 20px 20px 64px; }
  .doc-header { padding-bottom: 24px; margin-bottom: 26px; }
  .doc-summary { font-size: 17px; }
  .prose h2 { margin-top: 52px; font-size: 22px; }
  .prose h3 { margin-top: 32px; font-size: 17px; }
  .prose .quick-answer { padding: 20px 18px 20px; }
  .prose .quick-answer figure.fig-toolbar { margin: 20px -18px -20px; }
  .prose .quick-answer figure.fig-toolbar figcaption { padding: 11px 18px 13px; }
  .prose th, .prose td { padding: 10px 12px; }
  .prose .option-rows { grid-template-columns: 1fr; padding: 0 14px; }
  .prose figure.fig-frame { padding: 12px 12px 0; }
  .prose figure.fig-frame figcaption { margin: 12px -12px 0; padding: 10px 14px 12px; }
  .prose .option-rows dt { padding-bottom: 0; line-height: 1.5; }
  .prose .option-rows dd { padding-top: 8px; }
  .prose .option-rows dt:not(:first-of-type) + dd { border-top: 0; }
  .prose dl.faq dt { padding: 14px 16px 0; }
  .prose dl.faq dd { padding: 0 16px 14px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .feedback { flex-direction: column; align-items: flex-start; }
  .footer-inner { padding: 28px 20px 32px; }

  /* Toolbar strip: show it at true size, centred on the highlighted button */
  .prose figure.fig-toolbar > img {
    max-width: none; width: 679px; height: auto;
    margin-left: calc(50% - 304px) !important;
  }
  .prose figure.fig-toolbar::before,
  .prose figure.fig-toolbar::after {
    content: ""; position: absolute; top: 0; height: 47px; width: 44px; z-index: 1; pointer-events: none;
  }
  .prose figure.fig-toolbar::before { left: 0; background: linear-gradient(90deg, var(--well-bg) 15%, transparent); }
  .prose figure.fig-toolbar::after { right: 0; background: linear-gradient(270deg, var(--well-bg) 15%, transparent); }

  /* Two-column field tables stack into label + description */
  .prose table:has(th:nth-child(2):last-child) thead { display: none; }
  .prose table:has(th:nth-child(2):last-child),
  .prose table:has(th:nth-child(2):last-child) tbody,
  .prose table:has(th:nth-child(2):last-child) tr,
  .prose table:has(th:nth-child(2):last-child) td { display: block; width: auto; }
  .prose table:has(th:nth-child(2):last-child) tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .prose table:has(th:nth-child(2):last-child) tr:last-child { border-bottom: 0; }
  .prose table:has(th:nth-child(2):last-child) td { padding: 0; border: 0; }
  .prose table:has(th:nth-child(2):last-child) td + td { margin-top: 4px; color: var(--muted); }
}
