/* IWW Help Centre — design system v2.
   Zoho-style help centre: blue chrome, card grid, light paper body. */
   /* Fonts loaded via <link> in each page <head> for parallel loading — no @import blocking */

:root {
  color-scheme: light;
  /* Surfaces */
  --bg:          #EEF1F4;          /* outer page bg */
  --paper:       #FFFFFF;          /* inner card */
  --paper-2:     #F6F8FA;          /* subtle inset / muted card */
  --paper-3:     #F0F3F7;          /* code block bg */
  --canvas-2:    #F6F8FA;          /* alias used in HTML inline styles */
  --surface-2:   #F0F3F7;          /* ai-bot message bg */
  --surface-3:   rgba(13,27,42,0.06); /* inline code inside ai-bot */

  /* Ink */
  --ink-1:       #0D1B2A;
  --ink-2:       #1C2A3A;
  --ink-3:       #3A4856;
  --ink-4:       #5B6876;
  --ink-5:       #8A95A2;
  --ink-6:       #B8BFC8;

  /* Brand */
  --blue:        #1E4E8F;          /* topbar + primary accent */
  --blue-deep:   #163B6E;
  --blue-bright: #2766B5;          /* links */
  --blue-soft:   #E8EFF8;          /* current step bg, callouts */
  --blue-softer: #F3F7FC;
  --blue-border: #C4D4E8;
  --blue-ring:   rgba(30, 78, 143, 0.12);

  --mint:        #3DB287;
  --amber:       #B77719;
  --amber-fill:  #FDF4E4;
  --rose:        #B43A4E;

  /* Rules */
  --rule-ink:    rgba(13, 27, 42, 0.10);
  --rule-fine:   rgba(13, 27, 42, 0.06);
  --rule-blue:   rgba(30, 78, 143, 0.18);

  /* Fonts */
  --f-serif: 'Instrument Serif', Georgia, serif;
  --f-body:  'Inter', system-ui, -apple-system, sans-serif;
  --f-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --f-mono:  'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --nav-w:     360px;
  --toc-w:     310px;
  --topbar-h:  52px;
  --crumb-h:   40px;
  --page-max:  1700px;
  --card-radius: 12px;
}

/* ================= Dark theme ================= */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0D1117;
  --paper:       #161B22;
  --paper-2:     #1A2028;
  --paper-3:     #0E141A;
  --canvas-2:    #1A2028;
  --surface-2:   #21262D;
  --surface-3:   rgba(255,255,255,0.08);

  --ink-1:       #F0F6FC;
  --ink-2:       #E6EDF3;
  --ink-3:       #B7C0CB;
  --ink-4:       #8B949E;
  --ink-5:       #6E7681;
  --ink-6:       #484F58;

  --blue:        #2766B5;
  --blue-deep:   #1E4E8F;
  --blue-bright: #58A6FF;
  --blue-soft:   #1A2C42;
  --blue-softer: #131F30;
  --blue-border: #2A4263;
  --blue-ring:   rgba(88, 166, 255, 0.18);

  --mint:        #4DCFA0;
  --amber:       #D29922;
  --amber-fill:  #2A2417;
  --rose:        #F85149;

  --rule-ink:    rgba(240, 246, 252, 0.12);
  --rule-fine:   rgba(240, 246, 252, 0.07);
  --rule-blue:   rgba(88, 166, 255, 0.22);
}
/* Auto-apply dark when user prefers it AND hasn't manually picked light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg:          #0D1117;
    --paper:       #161B22;
    --paper-2:     #1A2028;
    --paper-3:     #0E141A;
    --canvas-2:    #1A2028;
    --surface-2:   #21262D;
    --surface-3:   rgba(255,255,255,0.08);
    --ink-1:       #F0F6FC;
    --ink-2:       #E6EDF3;
    --ink-3:       #B7C0CB;
    --ink-4:       #8B949E;
    --ink-5:       #6E7681;
    --ink-6:       #484F58;
    --blue:        #2766B5;
    --blue-deep:   #1E4E8F;
    --blue-bright: #58A6FF;
    --blue-soft:   #1A2C42;
    --blue-softer: #131F30;
    --blue-border: #2A4263;
    --blue-ring:   rgba(88, 166, 255, 0.18);
    --mint:        #4DCFA0;
    --amber:       #D29922;
    --amber-fill:  #2A2417;
    --rose:        #F85149;
    --rule-ink:    rgba(240, 246, 252, 0.12);
    --rule-fine:   rgba(240, 246, 252, 0.07);
    --rule-blue:   rgba(88, 166, 255, 0.22);
  }
}

/* Dark-mode-specific overrides for elements that hard-code light colors */
:root[data-theme="dark"] .topbar { background: #0D1B2A; }
:root[data-theme="dark"] .ai-msg.ai-user { background: var(--blue); color: #fff; }
:root[data-theme="dark"] .ai-msg.ai-bot  { background: var(--paper-2); color: var(--ink-2); }
:root[data-theme="dark"] code { color: var(--blue-bright); }
:root[data-theme="dark"] .prose code {
  background: var(--blue-softer); border-color: var(--blue-border); color: var(--blue-bright);
}
:root[data-theme="dark"] .ai-err { background: #3a1a1d; color: #ff8d92; }
:root[data-theme="dark"] img { opacity: 0.92; }
:root[data-theme="dark"] img:hover { opacity: 1; }
:root[data-theme="dark"] .ai-sug-chip { background: var(--blue-soft); color: var(--blue-bright); }
:root[data-theme="dark"] .ai-sug-chip:hover { background: var(--blue-softer); border-color: var(--blue-bright); }

/* ── Inline text colors that are hardcoded dark — invisible on dark bg ── */

/* Step/heading titles set to #0F2744 (dark navy) */
:root[data-theme="dark"] [style*="color:#0F2744"] {
  color: var(--ink-1) !important;
}
/* Right-side step labels using ink-5 uppercase (e.g. "OPEN THE WIDGET") — too muted */
:root[data-theme="dark"] [style*="color:var(--ink-5);text-transform:uppercase"] {
  color: var(--ink-3) !important;
}

/* ── Inline light gradients ("Before You Start" cards and similar) ── */
/* 180deg white-to-light-blue gradients (17+5+2 occurrences) */
:root[data-theme="dark"] [style*="background:linear-gradient(180deg,#f"] {
  background: var(--blue-softer) !important;
}
/* 135deg and 145deg light variants */
:root[data-theme="dark"] [style*="background:linear-gradient(135deg,#f5"],
:root[data-theme="dark"] [style*="background:linear-gradient(145deg,#f"] {
  background: var(--paper-2) !important;
}

/* ── Inline-style cards with hardcoded light backgrounds ── */
:root[data-theme="dark"] [style*="background:#fbfdff"] {
  background: var(--paper-2) !important;
}
/* Step-card containers (border:1px solid #c7d8ea + background:#fff / #ffffff) */
:root[data-theme="dark"] [style*="background:#fff;"],
:root[data-theme="dark"] [style*="background:#ffffff;"],
:root[data-theme="dark"] [style*="background:#ffffff,"] {
  background: var(--paper-2) !important;
}
:root[data-theme="dark"] [style*="border:1px solid #c7d8ea"] {
  border-color: var(--rule-fine) !important;
}
/* Step-divider rules hardcoded in light blue (#C4D4E8) */
:root[data-theme="dark"] [style*="background:#C4D4E8"] {
  background: var(--blue-border) !important;
  opacity: 0.5;
}
/* Light blue tinted surfaces (#f8fbff, #d6e4f2) */
:root[data-theme="dark"] [style*="background:#f8fbff"] { background: var(--paper-2) !important; }
:root[data-theme="dark"] [style*="background:#d6e4f2"] { background: var(--paper-2) !important; }
:root[data-theme="dark"] [style*="color:#16314d"]      { color: var(--ink-1) !important; }
/* Alternating table rows (#F8FAFB / #F6F8FA) */
:root[data-theme="dark"] [style*="background:#F8FAFB"] { background: var(--paper-2) !important; }
:root[data-theme="dark"] [style*="background:#F6F8FA"] { background: var(--paper-2) !important; }
:root[data-theme="dark"] [style*="background:#F5F7FA"] { background: var(--paper-2) !important; }
/* Warm amber/warning rows (#FFF3E0 = amber-fill equivalent) */
:root[data-theme="dark"] [style*="background:#FFF3E0"] { background: var(--amber-fill) !important; }
:root[data-theme="dark"] [style*="color:#4E342E"]      { color: var(--ink-2) !important; }
:root[data-theme="dark"] [style*="color:#BF360C"]      { color: var(--amber) !important; }
/* Status / semantic badges */
:root[data-theme="dark"] [style*="background:#E8F4F0"] { background: rgba(15,110,86,0.15) !important; }
:root[data-theme="dark"] [style*="color:#0F6E56"]      { color: var(--mint) !important; }
:root[data-theme="dark"] [style*="background:#FEF0E7"] { background: rgba(201,73,34,0.12) !important; }
:root[data-theme="dark"] [style*="color:#c94922"]      { color: #FF8C66 !important; }
/* Blue step highlights (#E8EFF8 bg + #1E4E8F border/text) */
:root[data-theme="dark"] [style*="background:#E8EFF8"] { background: var(--blue-soft) !important; }
:root[data-theme="dark"] [style*="color:#1E4E8F"]      { color: var(--blue-bright) !important; }
:root[data-theme="dark"] [style*="border-left:3px solid #1E4E8F"] { border-left-color: var(--blue-border) !important; }

/* ── Callout variants with hardcoded light colors ── */
:root[data-theme="dark"] .callout.success {
  background: #0F2A1E;
  border-color: rgba(77, 207, 160, 0.22);
}
:root[data-theme="dark"] .callout.success .callout-head { color: var(--mint); }
:root[data-theme="dark"] .callout.success p { color: var(--ink-2); }

:root[data-theme="dark"] .callout.warn .callout-head { color: var(--amber); }
:root[data-theme="dark"] .callout.warn p { color: var(--ink-3); }

:root[data-theme="dark"] .callout.err {
  background: #2A1215;
  border-color: rgba(248, 81, 73, 0.22);
}
:root[data-theme="dark"] .callout.err .callout-head { color: var(--rose); }
:root[data-theme="dark"] .callout.err p { color: var(--ink-2); }

/* Step-card caution strip */
:root[data-theme="dark"] .step-card-caution {
  background: #2A1A0E;
  border-top-color: rgba(232, 93, 4, 0.2);
}
:root[data-theme="dark"] .step-card-caution .caution-label { color: #FF9966; }
:root[data-theme="dark"] .step-card-caution p { color: var(--ink-3); }

/* Feature view cells (hardcoded #F5F7FA bg and #0F2744 label) */
:root[data-theme="dark"] .feat-view-cell { background: var(--paper-3); }
:root[data-theme="dark"] .feat-view-cell-label { color: var(--ink-3); }

/* Step heading badge number (hardcoded color: #0F2744) */
:root[data-theme="dark"] .prose h2.step-heading .step-num { color: var(--blue-bright); }

/* Status banners with hardcoded light palettes */
:root[data-theme="dark"] .status-banner.local,
:root[data-theme="dark"] .status-banner.draft {
  background: #2A2005;
  border-color: #C4A820;
  color: #D4B822;
}
:root[data-theme="dark"] .status-banner.local .status-icon,
:root[data-theme="dark"] .status-banner.draft .status-icon { background: #D4B822; }
:root[data-theme="dark"] .status-banner.hidden {
  background: #2A1010;
  border-color: #C04040;
  color: #FF8080;
}
:root[data-theme="dark"] .status-banner.hidden .status-icon { background: #FF8080; }

/* Meta pill — marketplace variant */
:root[data-theme="dark"] .meta-strip .meta-pill.marketplace {
  background: #0D2018;
  color: var(--mint);
  border-color: rgba(77, 207, 160, 0.25);
}

/* AI chat — links inside bot messages */
:root[data-theme="dark"] .ai-bot a.ai-link {
  color: var(--blue-bright);
  border-bottom-color: rgba(88, 166, 255, 0.35);
}
:root[data-theme="dark"] .ai-bot a.ai-link:hover { border-bottom-color: var(--blue-bright); }

/* Sidebar page badge — hidden variant */
:root[data-theme="dark"] .sidebar .nav-link .page-badge.hidden {
  background: #2A1010;
  color: #FF8080;
}

/* Keyboard shortcut chips (use dark rgba — need light variant in dark mode) */
:root[data-theme="dark"] .palette .inp .kbd,
:root[data-theme="dark"] .palette .foot .kbd,
:root[data-theme="dark"] .home-search .kbd {
  background: rgba(255,255,255,0.08);
  color: var(--ink-4);
  border-color: rgba(255,255,255,0.15);
}

/* Code block copy button hover */
:root[data-theme="dark"] .code-head .copy:hover {
  background: rgba(255,255,255,0.08);
  color: var(--ink-2);
}

/* num-cell hover — uses hardcoded var(--paper-1, #fff) fallback */
:root[data-theme="dark"] .num-cell:hover { background: var(--paper-2); }

/* Theme toggle button in topbar */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.9);
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.22); color: #fff; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Thin scrollbars (sidebar, content area, TOC, AI panel) ── */
.sidebar, .content-wrap, .toc, .ai-msgs {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-4) transparent;
}
.sidebar::-webkit-scrollbar,
.content-wrap::-webkit-scrollbar,
.toc::-webkit-scrollbar,
.ai-msgs::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track,
.content-wrap::-webkit-scrollbar-track,
.toc::-webkit-scrollbar-track,
.ai-msgs::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb,
.content-wrap::-webkit-scrollbar-thumb,
.toc::-webkit-scrollbar-thumb,
.ai-msgs::-webkit-scrollbar-thumb {
  background: var(--ink-4);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover,
.content-wrap::-webkit-scrollbar-thumb:hover,
.toc::-webkit-scrollbar-thumb:hover,
.ai-msgs::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
body {
  font-family: var(--f-body);
  font-size: 15px; line-height: 1.6;
  color: var(--ink-2); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
em { font-style: italic; }

.mono  { font-family: var(--f-mono); }
.serif { font-family: var(--f-serif); }
.kbd {
  font-family: var(--f-mono); font-size: 11px; padding: 2px 6px;
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 4px;
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; }

/* Override legacy inline max-width:720px constraints on content blocks so
   they flow with the available main column on desktop. Inline styles in
   older HTML can't otherwise be overridden by class-based CSS. */
.prose [style*="max-width:720px"],
.prose [style*="max-width: 720px"] {
  max-width: var(--prose-w, 100%) !important;
}

/* ================= Page shell ================= */
.page-card {
  width: 100%;
  margin: 0;
  background: var(--paper);
  border-radius: 0;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ================= Topbar ================= */
.topbar {
  position: relative; z-index: 40;
  flex-shrink: 0;
  height: var(--topbar-h);
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center;
  padding: 0 28px; gap: 28px;
}
.topbar .wordmark {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-sans); font-size: 15px; font-weight: 600;
  color: #fff; line-height: 1; white-space: nowrap;
  letter-spacing: -0.01em;
}
.topbar .wordmark .dotmark {
  width: 7px; height: 7px; border-radius: 2px; background: #fff; opacity: 0.85;
}
.topbar .mobile-menu {
  display: none; background: none; border: none; padding: 6px;
  color: #fff;
}
.topbar .nav { display: flex; align-items: center; height: 100%; gap: 0; }
.topbar .nav a {
  display: inline-flex; align-items: center; height: 100%;
  font-family: var(--f-sans); font-size: 13.5px; font-weight: 500;
  color: rgba(255,255,255,0.78);
  padding: 0 16px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.topbar .nav a:hover { color: #fff; }
.topbar .nav a.active {
  color: #fff; border-bottom-color: #fff;
}
.topbar .spacer { flex: 1; }
.topbar .ext-name {
  font-family: var(--f-sans); font-size: 13.5px; font-weight: 500;
  color: rgba(255,255,255,0.88);
  max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.topbar .search-launcher {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 13px;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 220px;
}
.topbar .search-launcher:hover { background: rgba(255,255,255,0.16); color: #fff; }
.topbar .search-launcher .search-icon { color: rgba(255,255,255,0.7); flex-shrink: 0; }
.topbar .search-launcher .search-text { flex: 1; text-align: left; }


/* ================= Language selector ================= */
.lang-wrap { position: relative; flex-shrink: 0; }
.lang-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; color: rgba(255,255,255,0.85);
  font-family: var(--f-sans); font-size: 12px; font-weight: 600;
  padding: 4px 9px; cursor: pointer; transition: background 0.15s;
}
.lang-btn:hover, .lang-wrap.open .lang-btn { background: rgba(255,255,255,0.22); color: #fff; }
.lang-btn.lang-active { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.35); }
.lang-icon { display: flex; align-items: center; opacity: 0.8; }
.lang-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--paper); border: 1px solid var(--rule-fine);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 190px; z-index: 200; overflow-y: auto; max-height: 360px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-4) transparent;
}
.lang-dropdown::-webkit-scrollbar { width: 4px; }
.lang-dropdown::-webkit-scrollbar-track { background: transparent; }
.lang-dropdown::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 2px; }
.lang-group-label {
  padding: 6px 14px 3px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-5); pointer-events: none; border-top: 1px solid var(--rule-fine);
}
.lang-group-label:first-child { border-top: none; }
.lang-option.lang-auto {
  border-bottom: 1px solid var(--rule-fine);
  color: var(--blue);
  font-weight: 600;
}
.lang-option.lang-auto .lang-opt-abbr {
  font-size: 14px; color: var(--blue); font-weight: 700;
}
.lang-option.lang-auto:hover { background: var(--blue-soft); }
.lang-wrap.open .lang-dropdown { display: block; }
.lang-option {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 18px 8px 14px;
  background: none; border: none; cursor: pointer;
  font-family: var(--f-sans); font-size: 13px; color: var(--ink-2);
  transition: background 0.1s;
}
.lang-option:hover { background: var(--surface-2); color: var(--ink-1); }
.lang-option.active { color: var(--blue); font-weight: 600; }
.lang-opt-abbr { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.04em; }
.lang-option.active .lang-opt-abbr { color: var(--blue); }

/* ================= Auto-detect language banner ================= */
.lang-banner {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: #fff;
  padding: 11px 24px; min-height: 50px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.18);
  z-index: 1100; font-size: 14px; line-height: 1.4;
  transform: translateY(-100%);
  transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-banner.show { transform: translateY(0); }
.lang-banner-icon { opacity: 0.9; display: flex; align-items: center; flex-shrink: 0; }
.lang-banner-msg  { font-weight: 500; }
.lang-banner-yes {
  background: #fff; color: var(--blue); border: none; border-radius: 6px;
  padding: 6px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.lang-banner-yes:hover  { background: var(--blue-soft); }
.lang-banner-yes:active { transform: scale(0.97); }
.lang-banner-no {
  background: transparent; color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.35); border-radius: 6px;
  padding: 6px 14px; font-size: 13px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.lang-banner-no:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.55); }
.lang-banner-close {
  background: transparent; color: rgba(255,255,255,0.75); border: none;
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 0 4px; flex-shrink: 0; margin-left: 2px;
}
.lang-banner-close:hover { color: #fff; }

/* When banner is visible, push the page-card down and trim its height. */
body.has-lang-banner .page-card {
  margin-top: 50px;
  height: calc(100svh - 50px);
}
@media (max-width: 640px) {
  .lang-banner { padding: 10px 14px; font-size: 13px; gap: 10px; }
  .lang-banner-msg { width: 100%; text-align: center; }
  body.has-lang-banner .page-card {
    margin-top: 72px;
    height: calc(100svh - 72px);
  }
}

/* Suppress Google Translate banner and layout shift */
.goog-te-banner-frame, .skiptranslate { display: none !important; }
body { top: 0 !important; }
.goog-te-menu-value:hover { text-decoration: none; }
font { background-color: transparent !important; box-shadow: none !important; }

/* ================= Breadcrumb ================= */
.breadcrumb-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule-fine);
  padding: 0 36px;
  height: var(--crumb-h);
  flex-shrink: 0;
  display: flex; align-items: center;
  overflow: hidden;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-5);
}
.breadcrumb-bar a { color: var(--ink-5); transition: color .15s; flex-shrink: 0; }
.breadcrumb-bar a:hover { color: var(--blue-bright); }
.breadcrumb-bar .bc-sep { color: var(--ink-6); margin: 0 8px; flex-shrink: 0; }
.breadcrumb-bar .bc-current {
  color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

/* ================= Layout ================= */
.layout {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  gap: 0;
  background: var(--paper);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.layout.two-col { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
.layout.one-col { grid-template-columns: 1fr; }

/* Content + TOC wrapper — scrollbar appears at far right (right of TOC) */
.content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  overflow-y: auto;
  min-height: 0;
}

/* ================= Sidebar ================= */
.sidebar {
  padding: 28px 58px 32px 68px;
  font-family: var(--f-sans);
  border-right: 1px solid var(--rule-fine);
  background: var(--paper);
  overflow-y: auto;
  display: flex; flex-direction: column;
}

.sidebar .ext-card {
  margin-bottom: 18px;
}
.sidebar .ext-card .ext-name {
  font-family: var(--f-sans); font-size: 17px; font-weight: 600;
  color: var(--blue); line-height: 1.2;
  letter-spacing: -0.01em;
}
.sidebar .ext-card .ext-sub {
  font-family: var(--f-sans); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-5); margin-top: 3px;
}

.sidebar .side-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-2);
  border: 1px solid var(--rule-fine);
  border-radius: 7px;
  padding: 7px 11px;
  margin-bottom: 22px;
  font-family: var(--f-sans); font-size: 12.5px;
  color: var(--ink-5);
  cursor: text;
}
.sidebar .side-search:hover { border-color: var(--blue-border); }
.sidebar .side-search .si { color: var(--ink-5); flex-shrink: 0; }
.sidebar .side-search input {
  flex: 1; border: none; background: none; outline: none;
  font-family: inherit; font-size: inherit; color: var(--ink-2);
}
.sidebar .side-search input::placeholder { color: var(--ink-5); }

/* Collapsible category group */
.sidebar .cat-group { margin-bottom: 2px; }
.sidebar .cat-group:first-of-type .cat-label { margin-top: 2px; }
.sidebar .cat-label {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: none; border: none;
  font-family: var(--f-sans);
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-5); font-weight: 600;
  margin: 20px 0 6px;
  padding: 4px 6px 4px 4px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.sidebar .cat-label:hover { background: var(--surface-2); color: var(--ink-3); }
.sidebar .cat-label:focus-visible { outline: 2px solid var(--blue-ring); outline-offset: 1px; }
.sidebar .cat-chevron {
  display: inline-grid; place-items: center;
  color: var(--ink-5);
  transition: transform 0.18s ease;
}
.sidebar .cat-group.collapsed .cat-chevron { transform: rotate(-90deg); }
.sidebar .cat-pages {
  display: flex; flex-direction: column;
  overflow: hidden;
  max-height: 1200px;
  transition: max-height 0.22s ease;
}
.sidebar .cat-group.collapsed .cat-pages { max-height: 0; }

.sidebar .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px;
  margin: 1px 0;
  border-radius: 6px;
  font-size: 13px; line-height: 1.5;
  color: var(--ink-3);
  transition: color .15s, background .15s;
}
.sidebar .nav-link::before {
  content: ''; width: 5px; height: 5px; border-radius: 999px;
  background: var(--ink-6); flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.sidebar .nav-link:hover { color: var(--ink-1); background: var(--paper-2); }
.sidebar .nav-link:hover::before { background: var(--ink-4); transform: translateX(2px); }
.sidebar .nav-link.active {
  color: var(--blue); background: var(--blue-soft); font-weight: 600;
}
.sidebar .nav-link.active::before { background: var(--blue); }
.sidebar .nav-link.unpublished {
  opacity: 0.6;
}
.sidebar .nav-link .new-pill {
  margin-left: auto;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em;
  background: var(--mint); color: #fff;
  padding: 2px 6px; border-radius: 3px;
  text-transform: none;
}
.sidebar .nav-link .page-badge {
  margin-left: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 5px; border-radius: 3px;
}
.sidebar .nav-link .page-badge.draft {
  background: var(--amber-fill);
  color: var(--amber);
}
.sidebar .nav-link .page-badge.local {
  background: var(--paper-2);
  color: var(--ink-4);
}
.sidebar .nav-link .page-badge.hidden {
  background: #FEE2E2;
  color: #B91C1C;
}

.sidebar .side-foot {
  margin-top: auto; padding-top: 24px;
  border-top: 1px solid var(--rule-fine);
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--f-sans); font-size: 12.5px;
}
.sidebar .side-foot a { color: var(--blue-bright); }
.sidebar .side-foot a:hover { color: var(--blue); text-decoration: underline; }
.sidebar .side-foot .ver {
  margin-top: 6px; color: var(--ink-5); font-size: 11.5px;
}

/* ================= Main ================= */
.main {
  padding: 32px 44px 64px;
  min-width: 0;
  min-height: 0;
  background: var(--paper);
  overflow-y: auto;
}
/* Article pages scroll via .content-wrap, not .main itself */
.content-wrap .main { overflow-y: visible; }

/* ================= Article hero ================= */
/* Keep legacy kicker-rule for landing pages */
.kicker-rule { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.kicker-rule::before {
  content: ''; width: 22px; height: 2px; background: var(--blue); flex-shrink: 0;
}
.kicker {
  font-family: var(--f-sans);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue); font-weight: 600;
}

/* Article title */
.article-title {
  font-family: var(--f-sans); font-weight: 700;
  font-size: 30px; line-height: 1.2; letter-spacing: -0.02em;
  color: var(--ink-1);
  margin: 0 0 10px;
  max-width: var(--prose-w, 100%);
}

/* Status banner for local/draft/hidden pages */
.status-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  border: 1px solid;
}
.status-banner .status-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.status-banner.local {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}
.status-banner.local .status-icon {
  background: #F59E0B;
}
.status-banner.draft {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #B45309;
}
.status-banner.draft .status-icon {
  background: #F59E0B;
}
.status-banner.hidden {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #B91C1C;
}
.status-banner.hidden .status-icon {
  background: #EF4444;
}

/* Editorial (italic payoff — landings) */
.editorial-headline {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 54px; line-height: 1.02; letter-spacing: -0.02em;
  color: var(--ink-1);
  margin: 0 0 20px;
  max-width: 12ch;
}
.editorial-headline em { color: var(--blue); font-style: italic; }

/* Standfirst */
.article-standfirst {
  font-family: var(--f-sans); font-weight: 400;
  font-size: 16px; line-height: 1.55;
  color: var(--ink-4);
  max-width: var(--prose-w, 100%);
  margin: 0 0 16px;
}
.standfirst {
  font-family: var(--f-sans); font-style: italic; font-weight: 400;
  font-size: 18px; line-height: 1.5;
  color: var(--ink-3);
  max-width: 40ch;
  margin: 0 0 24px;
}

/* Meta strip (screenshot style: Updated X · Y min read · pill · pill) */
.meta-strip {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 12px;
  margin: 0 0 32px;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-5);
}
.meta-strip .meta-left {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
.meta-strip .meta-left > span { display: inline-flex; align-items: center; gap: 6px; }
.meta-strip .status-dot { display: none; }
.meta-strip .meta-sep { color: var(--ink-6); font-size: 10px; }
.meta-strip .meta-pill {
  font-family: var(--f-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.01em;
  padding: 2px 8px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue);
  border: 1px solid var(--blue-border);
}
.meta-strip .meta-pill.marketplace {
  background: #E9F4EC; color: #2E7D4F; border-color: #C3DFCE;
}
.meta-strip .feedback { display: none; } /* hidden at top; relocated to page foot */

/* Legacy byline */
.byline { display: none; }

/* ================= Prose ================= */
.prose {
  font-family: var(--f-body);
  font-size: 14.5px; line-height: 1.7;
  color: var(--ink-2);
  max-width: var(--prose-w, 100%);
}
.prose p { margin: 14px 0; }
.prose p:first-child { margin-top: 0; }
.prose strong { font-weight: 600; color: var(--ink-1); }
.prose a { color: var(--blue-bright); text-decoration: underline; text-decoration-color: rgba(39, 102, 181, 0.30); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--blue-bright); }
.prose code {
  font-family: var(--f-mono); font-size: 0.86em; color: var(--blue);
  background: var(--blue-softer); padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--blue-border);
}
.prose ul, .prose ol { margin: 14px 0; padding-left: 22px; }
.prose li { margin: 6px 0; }
/* TOC-only anchors: keep in flow so getBoundingClientRect() returns a real position,
   but take up no space and remain invisible. */
.prose h2[data-toc-title], .prose h3[data-toc-title] {
  display: block !important;
  height: 0; overflow: hidden; visibility: hidden;
  margin: 0; padding: 0; border: 0;
}
.prose h2 {
  font-family: var(--f-sans); font-size: 20px; font-weight: 600;
  color: var(--ink-1); margin: 40px 0 14px;
  letter-spacing: -0.01em; line-height: 1.25;
}
.prose h2.step-heading {
  font-size: 17px;
  margin: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.prose h2.step-heading .step-num {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #0F2744;
  white-space: nowrap;
}
.prose h2.step-heading .step-divider {
  flex: 1;
  height: 1px;
  background: var(--rule-fine);
}
.prose h3 { font-family: var(--f-sans); font-size: 15px; font-weight: 600; color: var(--ink-1); margin: 24px 0 8px; }

p code, li code, td code {
  font-family: var(--f-mono); font-size: 12.5px; color: var(--blue);
  background: var(--blue-softer); padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--blue-border);
}
p a, li a {
  color: var(--blue-bright); text-decoration: underline;
  text-decoration-color: rgba(39, 102, 181, 0.30); text-underline-offset: 3px;
}
p a:hover, li a:hover { text-decoration-color: var(--blue-bright); }
p strong { font-weight: 600; color: var(--ink-1); }

/* Pull quote */
.pullquote {
  position: relative;
  margin: 40px 0;
  padding: 28px 56px 28px 32px;
  background: linear-gradient(180deg, rgba(31,79,214,0.06) 0%, rgba(31,79,214,0.02) 100%);
  border: 1px solid var(--blue-border);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  font-family: var(--f-serif); font-style: italic; font-weight: 500;
  font-size: 20px; line-height: 1.5;
  color: var(--ink-1);
  box-shadow: 0 1px 0 rgba(31,79,214,0.08), 0 8px 24px -16px rgba(31,79,214,0.30);
  max-width: var(--prose-w, 100%);
}
.pullquote::before {
  content: '\201C';
  position: absolute;
  top: 4px; left: 18px;
  font-family: var(--f-serif);
  font-size: 56px; line-height: 1;
  color: var(--blue);
  font-style: normal;
  opacity: 0.45;
  pointer-events: none;
}
.pullquote::after {
  content: '';
  position: absolute;
  top: 18px; right: 22px;
  width: 22px; height: 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231f4fd6' opacity='0.30'><path d='M7 7h4v4H8c0 2 1 3 3 3v2c-3 0-5-2-5-5V7zm8 0h4v4h-3c0 2 1 3 3 3v2c-3 0-5-2-5-5V7z'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
}
.pullquote em { color: var(--blue); font-style: italic; }

/* Section kicker (small uppercase headers above grids) */
.section-kicker,
.section-label {
  font-family: var(--f-sans);
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-5); font-weight: 600;
  margin: 40px 0 14px;
}

/* ================= Numbered card grid (2×2) ================= */
.num-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0 36px;
  max-width: var(--prose-w, 100%);
}
.num-cell {
  position: relative;
  padding: 22px 22px 22px 22px;
  background: var(--paper-2);
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
  display: block;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.num-cell:hover {
  background: var(--paper-1, #fff);
  border-color: var(--blue-border);
  box-shadow: 0 1px 0 var(--blue-border), 0 6px 18px -10px rgba(31,79,214,0.35);
  transform: translateY(-1px);
}
.num-cell:hover .n { color: var(--blue); }
.num-cell .n {
  font-family: var(--f-sans); font-size: 26px; font-weight: 700;
  color: var(--ink-6); line-height: 1; margin-bottom: 10px;
  letter-spacing: -0.02em;
  display: block;
  transition: color .18s ease;
}
.num-cell .t {
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
  color: var(--ink-1); margin-bottom: 6px; line-height: 1.3;
}
.num-cell .d {
  font-family: var(--f-sans); font-size: 13px; color: var(--ink-4); line-height: 1.55;
}
.num-cell.current,
.num-cell[data-current] {
  background: var(--blue-soft);
  border-color: var(--blue-border);
}
.num-cell.current .n,
.num-cell[data-current] .n { color: var(--blue); }
.num-cell.current::before,
.num-cell[data-current]::before {
  content: 'Current step';
  position: absolute; top: 14px; left: 14px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 4px;
  background: var(--blue); color: #fff;
}
.num-cell.current .n,
.num-cell[data-current] .n { margin-top: 14px; }

/* Numbered simple list (legacy .steps reskinned as vertical list) */
.steps {
  margin: 14px 0 36px; max-width: var(--prose-w, 100%);
}
.steps .step {
  display: grid; grid-template-columns: 56px 1fr;
  gap: 0 18px;
  padding: 18px 20px;
  background: var(--paper-2);
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.steps .step:hover { border-color: var(--blue-border); }
.steps .step .n {
  font-family: var(--f-sans); font-size: 28px; font-weight: 700;
  color: var(--blue); line-height: 1;
  letter-spacing: -0.02em;
}
.steps .step .t {
  font-family: var(--f-sans); font-size: 15px; font-weight: 600;
  color: var(--ink-1); margin-bottom: 4px; line-height: 1.35;
}
.steps .step .d {
  font-family: var(--f-sans); font-size: 13.5px; color: var(--ink-3); line-height: 1.6;
}
.steps .step .d code {
  font-family: var(--f-mono); font-size: 12.5px; color: var(--blue);
  background: var(--blue-softer); padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--blue-border);
}
.steps .step .d a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 2px; }

.steps .step .tip-box {
  margin-top: 10px; padding: 8px 12px;
  border-left: 2px solid var(--rule-ink);
  font-size: 12.5px; color: var(--ink-4); line-height: 1.55;
}
.steps .step .tip-box .tip-label {
  font-family: var(--f-sans); font-size: 9.5px; letter-spacing: 0.10em;
  text-transform: uppercase; font-weight: 600; color: var(--ink-5); margin-bottom: 3px;
}

/* ================= Step card (numbered instruction card) ================= */
.step-card {
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
  overflow: hidden;
  margin: 28px 0;
  max-width: var(--prose-w, 100%);
  box-shadow: 0 1px 3px rgba(13,27,42,0.04);
}
.step-card-header {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule-fine);
  padding: 13px 20px;
  display: flex; align-items: center; gap: 10px;
}
.step-card-badge {
  font-family: var(--f-sans);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--blue); background: var(--blue-soft);
  border: 1px solid var(--blue-border);
  padding: 2px 8px; border-radius: 4px; flex-shrink: 0;
}
.step-card-label {
  font-family: var(--f-sans);
  font-size: 14px; font-weight: 600; color: var(--ink-1);
}
.step-card-body {
  padding: 16px 20px; background: var(--paper);
}
.step-card-body > p {
  font-size: 14px; color: var(--ink-2); line-height: 1.65;
  margin: 0 0 14px;
}
.step-card-body > p:last-child { margin-bottom: 0; }
.step-card-body > img, .step-card-body img {
  width: 100%; height: auto;
  border-radius: 6px; border: 1px solid var(--rule-fine);
  box-shadow: none;
  display: block; margin-top: 12px;
}
.step-card-body > img:only-child,
.step-card-body img:only-child { margin-top: 0; }
.step-card-body:not(:last-child) {
  border-bottom: 1px solid var(--rule-fine);
}
.step-card-caution {
  padding: 12px 16px;
  background: #FEF0E7;
  border-top: 1px solid rgba(232,93,4,0.15);
}
.step-card-caution .caution-label {
  font-family: var(--f-sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #e85d04; margin-bottom: 4px;
}
.step-card-caution p { font-size: 13px; color: #5C2200; line-height: 1.6; margin: 0; }

/* ================= Feature rows (dark panel + content split) ================= */
.feat-section {
  border: 1px solid var(--rule-fine);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
  max-width: var(--prose-w, 100%);
}
.feat-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-top: 1px solid var(--rule-fine);
}
.feat-row:first-child { border-top: none; }
.feat-panel {
  background: #0F2744;
  padding: 24px 20px;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.feat-row + .feat-row .feat-panel { border-top: 1px solid rgba(255,255,255,0.08); }
.feat-num {
  font-family: var(--f-sans); font-size: 32px; font-weight: 900;
  color: rgba(255,255,255,0.15); line-height: 1; margin-bottom: 6px;
}
.feat-title {
  font-family: var(--f-sans); font-size: 13px; font-weight: 700;
  color: #fff; line-height: 1.3;
}
.feat-sub { font-family: var(--f-sans); font-size: 11px; color: #A8C4E8; margin-top: 3px; }
.feat-body { background: var(--paper); padding: 22px 24px; }
.feat-body p { font-size: 14px; color: var(--ink-2); line-height: 1.65; margin: 0 0 12px; }
.feat-body p:last-child { margin-bottom: 0; }
.feat-body ul { margin: 0; padding-left: 20px; }
.feat-body li { font-size: 14px; color: var(--ink-2); line-height: 1.65; margin-bottom: 9px; }
.feat-body li:last-child { margin-bottom: 0; }
.feat-view-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 14px;
}
.feat-view-cell {
  background: #F5F7FA; border-radius: 7px; padding: 12px;
}
.feat-view-cell-label {
  font-family: var(--f-sans); font-size: 10px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #0F2744; margin-bottom: 5px;
}
.feat-view-cell-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.feat-body .feat-view-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin-bottom: 4px; }
.feat-body .feat-view-desc:last-of-type { margin-bottom: 12px; }
.feat-body .feat-note { font-size: 13px; color: var(--ink-3); line-height: 1.55; margin: 0; }

@media (max-width: 600px) {
  .feat-row { grid-template-columns: 1fr; }
  .feat-panel {
    flex-direction: row; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
  }
  .feat-row + .feat-row .feat-panel { border-top: none; }
  .feat-num { font-size: 22px; margin-bottom: 0; flex-shrink: 0; }
  .feat-view-grid { grid-template-columns: 1fr; }
}

/* ================= Key-value rows ================= */
.kv-table {
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 20px;
  max-width: var(--prose-w, 100%);
}
.kv-table-head {
  background: #0F2744;
  padding: 12px 20px;
}
.kv-table-head h3 {
  font-family: var(--f-sans); font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #A8C4E8; margin: 0;
}
.kv-row {
  display: grid; grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--rule-fine);
}
.kv-row:last-child { border-bottom: none; }
.kv-key {
  padding: 13px 16px;
  font-family: var(--f-sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--blue); background: var(--blue-soft);
  border-right: 1px solid var(--rule-fine);
  display: flex; align-items: center;
}
.kv-val {
  padding: 13px 16px;
  font-size: 14px; color: var(--ink-2);
  line-height: 1.65; background: var(--paper);
}
.kv-val strong { font-weight: 600; color: var(--ink-1); }
.kv-val code {
  font-family: var(--f-mono); font-size: 12px; color: var(--blue);
  background: var(--blue-softer); padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--blue-border);
}
.kv-row.muted .kv-key { color: var(--ink-3); background: var(--paper-2); }
.kv-row.muted .kv-val { background: var(--paper-2); }

/* ================= Section intro paragraph ================= */
.section-intro {
  font-family: var(--f-sans);
  font-size: 15px; color: var(--ink-1); line-height: 1.65;
  margin: 0 0 20px; max-width: var(--prose-w, 100%);
}

/* Typeset list (landing) */
.typeset-list {
  font-family: var(--f-serif);
  font-size: 20px; line-height: 1.5;
  color: var(--ink-1);
  margin: 0 0 28px; max-width: 42ch;
}
.typeset-list .sep { color: var(--ink-5); margin: 0 6px; }
.typeset-list .tail { font-style: italic; color: var(--blue); }

/* ================= Callouts ================= */
.callout {
  margin: 24px 0;
  padding: 14px 18px;
  border: 1px solid var(--rule-ink);
  border-left: 4px solid var(--ink-5);
  border-radius: 7px;
  background: var(--paper-2);
  font-family: var(--f-sans); font-size: 13.5px;
  color: var(--ink-2); max-width: var(--prose-w, 100%); line-height: 1.6;
}
.callout .callout-head {
  font-family: var(--f-sans);
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 600; margin-bottom: 6px;
}
.callout p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.callout.before-you-begin {
  border-left-color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-softer);
}
.callout.before-you-begin .callout-head { color: var(--blue); }
.callout.before-you-begin p { color: var(--ink-2); }

.callout.note {
  border-left-color: var(--blue);
  border-color: var(--blue-border);
  background: var(--blue-softer);
}
.callout.note .callout-head { color: var(--blue); }
.callout.note p { color: var(--ink-2); }

.callout.success {
  border-left-color: var(--mint);
  border-color: rgba(61, 178, 135, 0.28);
  background: #F0FAF6;
}
.callout.success .callout-head { color: #207554; }
.callout.success p { color: #0F3D2A; }

.callout.warn {
  border-left-color: var(--amber);
  border-color: rgba(183, 119, 25, 0.25);
  background: var(--amber-fill);
}
.callout.warn .callout-head { color: #8A5712; }
.callout.warn p { color: #3E2705; }

.callout.err {
  border-left-color: var(--rose);
  border-color: rgba(180, 58, 78, 0.22);
  background: #FBEEEF;
}
.callout.err .callout-head { color: var(--rose); }
.callout.err p { color: var(--ink-2); }

.callout.tip {
  padding: 10px 14px;
  border-left-color: var(--rule-ink);
  border-color: var(--rule-fine);
  background: transparent;
  font-size: 13px; margin: 14px 0;
}
.callout.tip .callout-head { color: var(--ink-5); margin-bottom: 3px; }
.callout.tip p { font-size: 13px; color: var(--ink-4); }

/* ================= Code block ================= */
.code {
  border: 1px solid var(--rule-fine); border-radius: 7px;
  margin: 22px 0; background: var(--paper-3);
  font-family: var(--f-mono); font-size: 12.5px; line-height: 1.7;
  max-width: var(--code-w, 920px); overflow: hidden;
}
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 12px; height: 30px;
  background: var(--paper-2); border-bottom: 1px solid var(--rule-fine);
  color: var(--ink-5); font-family: var(--f-sans); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
}
.code-head .code-lang {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border);
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 10px;
}
:root[data-theme="dark"] .code-head .code-lang { color: var(--blue-bright); }
.code-head .copy {
  border: none; background: none; color: var(--ink-5);
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.06em;
  font-weight: 600;
  padding: 3px 7px; border-radius: 3px; text-transform: uppercase;
}
.code-head .copy:hover { background: rgba(13,27,42,0.06); color: var(--ink-2); }
.code pre { padding: 12px 14px; overflow-x: auto; color: var(--ink-1); }

/* Path-breadcrumb code variant (screenshot "CRM → Setup → ..." bar) */
.code.path {
  display: flex; align-items: center; justify-content: space-between;
  height: 40px; padding: 0 14px;
  background: var(--paper-3);
  font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2);
  border-radius: 7px;
  max-width: var(--code-w, 920px);
}
.code.path .code-head { display: none; }
.code.path pre { padding: 0; background: none; overflow-x: auto; }
.code.path::after {
  content: 'PATH';
  font-family: var(--f-sans); font-size: 10px; font-weight: 600;
  letter-spacing: 0.10em; color: var(--ink-5);
  padding-left: 12px; flex-shrink: 0;
}

/* ================= Feature list (key-features page) ================= */
.feature-list {
  border: 1px solid var(--rule-fine); border-radius: 8px;
  overflow: hidden; margin-bottom: 1.6rem;
}
.feature-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 20px; border-bottom: 1px solid var(--rule-fine);
}
.feature-item:last-child { border-bottom: none; }
.feature-item-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0; margin-top: 6px;
}
.feature-item-title {
  font-family: var(--f-sans); font-size: 14px; font-weight: 700;
  color: var(--ink-1); margin-bottom: 4px;
}
.feature-item-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin: 0; }

/* ================= Doc table ================= */
.doc-table {
  border-collapse: collapse; width: 100%; max-width: var(--prose-w, 100%);
  margin: 22px 0; font-family: var(--f-sans); font-size: 13px;
}
.doc-table thead th {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--ink-5); font-weight: 600;
  text-align: left; padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule-ink);
}
.doc-table td {
  padding: 10px 14px 10px 0; color: var(--ink-2); vertical-align: top;
  border-bottom: 1px solid var(--rule-fine); line-height: 1.5;
}
.doc-table td.mono { font-family: var(--f-mono); font-size: 12px; color: var(--ink-1); }

/* ================= Prev / Next pager ================= */
.page-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 48px 0 0; max-width: var(--prose-w, 100%);
}
.pager-card {
  display: block; padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--rule-fine);
  border-radius: 9px;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
  min-height: 74px;
}
.pager-card,
.pager-card *,
.pager-card:hover,
.pager-card:hover * { text-decoration: none !important; }
.pager-card:hover {
  border-color: var(--blue-border);
  background: var(--blue-softer);
  box-shadow: 0 2px 8px rgba(30,78,143,0.07);
  text-decoration: none;
}
.pager-card.pager-next { text-align: right; }
.pager-card.pager-empty { display: none; }
/* When PREV is missing, NEXT keeps its right-aligned half-width slot. */
.page-pager:has(.pager-empty) {
  grid-template-columns: 1fr 1fr;
  justify-items: end;
}
.page-pager:has(.pager-empty) .pager-card.pager-next { grid-column: 2; width: 100%; }
.pager-dir {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.10em;
  text-transform: uppercase; font-weight: 600; color: var(--ink-5);
  margin-bottom: 6px;
}
.pager-card:hover .pager-dir { color: var(--blue); }
.pager-title {
  font-family: var(--f-sans); font-size: 14.5px; font-weight: 600;
  color: var(--ink-1); line-height: 1.3; margin-bottom: 3px;
}
.pager-card:hover .pager-title { color: var(--blue); }
.pager-cat {
  font-family: var(--f-sans); font-size: 11.5px; color: var(--ink-5);
}

@media (max-width: 560px) {
  .page-pager { grid-template-columns: 1fr; }
  .pager-card.pager-next { text-align: left; }
}

/* ================= Related articles ================= */
.related-articles {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-fine);
  max-width: var(--prose-w, 100%);
}
.related-articles .rel-label {
  font-family: var(--f-sans);
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-5); font-weight: 600; margin-bottom: 14px;
}
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.related-card {
  display: block; padding: 16px 18px;
  background: var(--paper-2); border-radius: 9px;
  border: 1px solid var(--rule-fine);
  transition: border-color .15s, background .15s;
  text-decoration: none;
}
.related-card,
.related-card *,
.related-card:hover,
.related-card:hover * { text-decoration: none !important; }
.related-card:hover { border-color: var(--blue-border); background: var(--blue-softer); }
.related-card .rel-tag {
  font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--ink-5); font-weight: 600; margin-bottom: 6px;
}
.related-card .rel-title {
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
  color: var(--ink-1); line-height: 1.35; margin-bottom: 5px;
}
.related-card:hover .rel-title { color: var(--blue); }
.related-card .rel-desc {
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-4);
  line-height: 1.5;
}

.pagefoot, .helpful { display: none; }

/* Module tags */
.module-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; }
.mod-tag {
  font-family: var(--f-mono); font-size: 11px;
  padding: 4px 9px; background: var(--paper-2);
  border: 1px solid var(--rule-fine); border-radius: 4px; color: var(--ink-3);
}
.mod-tag.more { color: var(--ink-5); font-style: italic; border-style: dashed; }

.screenshot {
  aspect-ratio: 16/9; border: 1px dashed var(--rule-ink);
  background: var(--paper-2); display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-5);
  margin: 24px 0; max-width: var(--prose-w, 100%); border-radius: 8px;
}

/* ================= Right rail (TOC) ================= */
.toc {
  padding: 30px 64px 40px 64px;
  font-family: var(--f-sans);
  overflow-y: auto;
  border-left: 1px solid var(--rule-fine);
  background: var(--paper);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 40px);
}
.toc-label {
  font-family: var(--f-sans);
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-5); font-weight: 600; margin-bottom: 10px;
}
.toc ul { list-style: none; margin-bottom: 16px; }
.toc li { margin: 0; }
.toc a {
  display: block; font-size: 12.5px; color: var(--ink-4);
  padding: 5px 10px; line-height: 1.45;
  transition: color .15s, border-left-color .2s;
  border-left: 2px solid transparent;
  margin-left: -10px;
}
.toc li.h3 a { padding-left: 20px; font-size: 12px; color: var(--ink-5); }
.toc a:hover { color: var(--ink-1); }
.toc a.active {
  color: var(--blue); font-weight: 600;
  border-left-color: var(--blue);
  background: var(--blue-softer);
}

/* Next-steps block at bottom of TOC */
.toc .toc-next {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-fine);
  display: flex; flex-direction: column; gap: 6px;
}
.toc .toc-next a {
  font-size: 12.5px; color: var(--ink-4);
  padding: 3px 0; border-left: none; margin-left: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.toc .toc-next a::after { content: '→'; color: var(--ink-5); margin-left: 8px; }
.toc .toc-next a:hover { color: var(--blue-bright); }
.toc .toc-next a:hover::after { color: var(--blue-bright); }

.toc .support-card { display: none; }

/* ================= Search palette ================= */
.palette-root {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 88px;
  background: rgba(13, 27, 42, 0.35);
  backdrop-filter: blur(5px);
}
.palette-root.open { display: flex; }
.palette {
  width: 100%; max-width: 560px;
  background: var(--paper); border: 1px solid var(--rule-ink);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 20px 48px rgba(13,27,42,0.22);
}
.palette .inp {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; height: 50px;
  border-bottom: 1px solid var(--rule-fine);
}
.palette .inp .kbd {
  background: rgba(13,27,42,0.06); color: var(--ink-4);
  border-color: var(--rule-ink);
}
.palette .inp input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--f-sans); font-size: 15px; color: var(--ink-1);
}
.palette .inp input::placeholder { color: var(--ink-5); }
.palette .results { max-height: 480px; overflow-y: auto; }
.palette .grp-label {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--ink-5); font-weight: 600;
  padding: 12px 18px 6px;
}
.palette .hit {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 9px 18px; border-left: 2px solid transparent;
}
.palette .hit:hover, .palette .hit.active {
  background: var(--blue-softer); border-left-color: var(--blue);
}
.palette .h-t { font-family: var(--f-sans); font-size: 14px; font-weight: 500; color: var(--ink-1); }
.palette .h-p { font-family: var(--f-mono); font-size: 11px; color: var(--ink-5); margin-top: 2px; }
.palette .h-s {
  font-family: var(--f-sans); font-size: 11.5px; color: var(--ink-4);
  line-height: 1.5; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette .hit mark { background: var(--blue-soft); color: inherit; padding: 0 1px; border-radius: 2px; }
.palette .h-s mark { background: none; color: var(--blue-bright); font-weight: 600; }
/* Recent search chips in the empty-state */
.palette .pal-recent {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 18px;
  background: none; border: none;
  border-left: 2px solid transparent;
  font-family: var(--f-sans); font-size: 13.5px; color: var(--ink-2);
  cursor: pointer; text-align: left;
  transition: background 0.1s, color 0.1s;
}
.palette .pal-recent:hover { background: var(--blue-softer); border-left-color: var(--blue); color: var(--ink-1); }
.palette .pal-recent-icon { color: var(--ink-5); display: inline-grid; place-items: center; }
.palette .pal-recent-text { flex: 1; }
.palette .foot {
  display: flex; gap: 14px; padding: 10px 18px;
  border-top: 1px solid var(--rule-fine); background: var(--paper-2);
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-5); font-weight: 600;
}
.palette .foot .sp { margin-left: auto; }
.palette .foot .kbd {
  background: rgba(13,27,42,0.06); color: var(--ink-4);
  border-color: var(--rule-ink);
}
.palette .empty {
  padding: 30px; text-align: center;
  font-family: var(--f-sans); color: var(--ink-4);
}
.palette .pal-empty { padding: 26px 24px 22px; }
.palette .pal-empty-title {
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
  color: var(--ink-1); margin-bottom: 4px;
}
.palette .pal-empty-sub {
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-4);
  margin-bottom: 14px;
}
.palette .pal-ask-ai {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--blue); color: #fff;
  border: none; border-radius: 8px;
  font-family: var(--f-sans); font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.palette .pal-ask-ai:hover { background: var(--blue-deep); }
.palette .pal-ask-ai:active { transform: scale(0.98); }
.palette .pal-ask-ai svg { flex-shrink: 0; }

.drawer-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(13, 27, 42, 0.35); display: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.drawer-scrim.open { display: block; }

/* ================= Portal home ================= */
.home-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Dynamic horizontal padding: at least 44px gutter, otherwise grow it so
     the inner 1080px content stays centered. Scrollbar still sits at the
     viewport's right edge because the wrap itself is full-width. */
  padding: 64px max(44px, calc((100% - 1080px) / 2)) 96px;
  background: radial-gradient(ellipse 80% 50% at 0% 0%, rgba(30,78,143,0.04) 0%, var(--paper) 65%);
}
.home-kicker { margin-bottom: 24px; }
.home-headline {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 76px; line-height: 0.98; letter-spacing: -0.025em;
  color: var(--ink-1); max-width: 14ch; margin-bottom: 24px;
}
.home-headline em { color: var(--blue); font-style: italic; }
.home-standfirst {
  font-family: var(--f-sans); font-style: italic;
  font-size: 18px; line-height: 1.5; color: var(--ink-4);
  max-width: 52ch; margin-bottom: 32px;
}
.home-search {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border: 1px solid var(--rule-ink);
  border-radius: 8px;
  color: var(--ink-3); font-family: var(--f-sans); font-size: 14px;
  background: var(--paper-2); margin-bottom: 64px;
}
.home-search:hover { border-color: var(--blue-border); color: var(--ink-1); background: var(--blue-softer); }
.home-search .kbd {
  background: rgba(13,27,42,0.06); color: var(--ink-4);
  border-color: var(--rule-ink);
}

.ext-list { margin-top: 20px; }
.ext-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 4px 20px;
  padding: 20px 22px;
  margin-bottom: 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.ext-row:hover {
  border-color: var(--blue-border);
  background: var(--blue-softer);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(30,78,143,0.08);
}
.ext-row .ext-top {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: baseline;
}
.ext-row .ext-num {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--blue); font-weight: 600;
}
.ext-row .ext-pages {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-5); font-weight: 500;
}
.ext-row .ext-name {
  font-family: var(--f-sans); font-weight: 700;
  font-size: 22px; color: var(--ink-1);
  letter-spacing: -0.02em; line-height: 1.2;
}
.ext-row:hover .ext-name { color: var(--blue); }
.ext-row .ext-summary {
  font-family: var(--f-sans);
  font-size: 14px; color: var(--ink-4); max-width: 62ch; line-height: 1.55;
}

/* ================= Extension landing ================= */
.ext-hero { margin-bottom: 48px; }
.ext-hero h1.ext-title {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 54px; line-height: 1.05; letter-spacing: -0.02em;
  color: var(--ink-1); margin-bottom: 20px; max-width: 14ch;
}
.ext-hero h1.ext-title em { color: var(--blue); font-style: italic; }
.ext-hero .ext-standfirst {
  font-family: var(--f-sans); font-style: italic;
  font-size: 18px; line-height: 1.5; color: var(--ink-3);
  max-width: 54ch; margin-bottom: 28px;
}

.landing-cats { margin-top: 40px; }
.landing-cat { padding: 28px 0; border-top: 1px solid var(--rule-fine); }
.landing-cat:last-child { border-bottom: 1px solid var(--rule-fine); }
.landing-cat .cat-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px;
}
.landing-cat .cat-kicker {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--blue); font-weight: 600;
}
.landing-cat .cat-count {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-5); font-weight: 500;
}
.landing-cat .pages { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.landing-cat .page-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--rule-fine);
}
.landing-cat .page-row .t { font-family: var(--f-sans); font-size: 15px; color: var(--ink-1); font-weight: 500; }
.landing-cat .page-row:hover .t { color: var(--blue); }
.landing-cat .page-row .p { display: none; }
.landing-cat .page-row .t::after { content: ' →'; color: var(--ink-5); }

.quicklinks, .cat-sections, .ext-head { display: none; }

/* ================= Landing page (rich) ================= */
.lp-hero {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 44px; align-items: start;
  padding: 36px 0 48px;
}
.lp-hero-preview { padding-top: 8px; }
.lp-cta-group { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 18px; }
.lp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 7px;
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.lp-btn-primary { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
.lp-btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.lp-btn-secondary { background: var(--paper); color: var(--ink-2); border: 1px solid var(--rule-ink); }
.lp-btn-secondary:hover { border-color: var(--blue-border); color: var(--blue); }

.lp-author-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-5);
  flex-wrap: wrap;
}
.lp-author-meta .dot { background: var(--mint); width: 7px; height: 7px; }
.lp-author-meta .sep { color: var(--ink-6); }
.lp-author-meta .ver { font-family: var(--f-mono); font-size: 11px; color: var(--ink-5); }

.lp-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper-2);
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
  margin-bottom: 56px;
}
.lp-stat { padding: 18px 22px; }
.lp-stat + .lp-stat { border-left: 1px solid var(--rule-fine); }
.lp-stat-num {
  font-family: var(--f-sans); font-size: 28px; font-weight: 700;
  color: var(--blue); line-height: 1; margin-bottom: 4px; letter-spacing: -0.02em;
}
.lp-stat-label { font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-4); line-height: 1.4; }

.lp-section { margin-bottom: 56px; }
.lp-h2 {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 32px; line-height: 1.15; letter-spacing: -0.01em;
  color: var(--ink-1); margin: 8px 0 26px;
}

.lp-4steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.lp-4step {
  padding: 20px;
  background: var(--paper-2);
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
}
.lp-4step .n {
  font-family: var(--f-sans); font-size: 24px; font-weight: 700;
  color: var(--blue); line-height: 1; margin-bottom: 10px; letter-spacing: -0.02em;
}
.lp-4step .t { font-family: var(--f-sans); font-size: 14px; font-weight: 600; color: var(--ink-1); margin-bottom: 6px; line-height: 1.3; }
.lp-4step .d { font-family: var(--f-sans); font-size: 13px; color: var(--ink-4); line-height: 1.55; }
.lp-4step .d a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 2px; }

.lp-paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lp-path-card {
  display: block; padding: 20px 22px;
  background: var(--paper-2); border: 1px solid var(--rule-fine);
  border-radius: 10px; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.lp-path-card:hover { border-color: var(--blue-border); background: var(--blue-softer); }
.lp-path-card.recommended {
  border-color: var(--blue-border); background: var(--blue-softer);
}
.lp-path-tag {
  font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--ink-5); font-weight: 600; margin-bottom: 10px;
}
.lp-path-card.recommended .lp-path-tag { color: var(--blue); }
.lp-path-title { font-family: var(--f-sans); font-size: 16px; font-weight: 600; color: var(--ink-1); margin-bottom: 6px; line-height: 1.3; }
.lp-path-card:hover .lp-path-title { color: var(--blue); }
.lp-path-desc { font-family: var(--f-sans); font-size: 13px; color: var(--ink-3); line-height: 1.55; margin-bottom: 14px; }
.lp-path-meta { font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-5); font-weight: 500; }

.lp-rel-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0;
}
.lp-rel-head a { font-family: var(--f-sans); font-size: 12.5px; color: var(--blue-bright); text-decoration: underline; text-underline-offset: 2px; }
.lp-release-row {
  display: grid; grid-template-columns: 110px 52px 1fr;
  gap: 0 24px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--rule-fine);
}
.lp-release-date { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-5); padding-top: 2px; }
.lp-release-ver  { font-family: var(--f-mono); font-size: 11.5px; color: var(--blue); padding-top: 2px; font-weight: 600; }
.lp-release-title { font-family: var(--f-sans); font-size: 14px; font-weight: 600; color: var(--ink-1); margin-bottom: 4px; }
.lp-release-desc  { font-family: var(--f-sans); font-size: 13px; color: var(--ink-4); line-height: 1.55; }

.lp-footer-cta {
  margin-top: 56px; padding: 32px 36px;
  border: 1px solid var(--blue-border); border-radius: 12px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 32px; align-items: center;
  background: var(--blue-softer);
}
.lp-footer-cta .fc-kicker {
  font-family: var(--f-sans); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--blue); font-weight: 600; margin-bottom: 10px;
}
.lp-footer-cta .fc-title {
  font-family: var(--f-serif); font-size: 28px; font-weight: 400;
  color: var(--ink-1); line-height: 1.2; margin-bottom: 8px;
}
.lp-footer-cta .fc-body { font-family: var(--f-sans); font-size: 13.5px; color: var(--ink-4); line-height: 1.6; }
.lp-footer-cta .fc-actions { display: flex; flex-direction: column; gap: 8px; min-width: 180px; }
.lp-footer-cta .fc-secondary { text-align: center; font-family: var(--f-sans); font-size: 12.5px; color: var(--ink-5); }
.lp-footer-cta .fc-secondary a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 2px; }

/* Widget preview card */
.widget-preview {
  background: var(--paper); border: 1px solid var(--rule-ink);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(13,27,42,0.06);
  font-family: var(--f-sans);
}
.wp-topbar {
  background: var(--paper-2); border-bottom: 1px solid var(--rule-fine);
  padding: 9px 14px; display: flex; justify-content: space-between; align-items: center;
}
.wp-title { font-size: 13px; font-weight: 600; color: var(--ink-1); }
.wp-actions { display: flex; gap: 6px; }
.wp-action {
  font-size: 11px; color: var(--blue); font-weight: 500;
  background: var(--blue-soft); border-radius: 4px; padding: 3px 8px;
}
.wp-breadcrumb {
  padding: 6px 14px; background: var(--paper-3); border-bottom: 1px solid var(--rule-fine);
  font-size: 11px; color: var(--ink-5); font-family: var(--f-mono);
}
.wp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--rule-fine);
  font-size: 13px; color: var(--ink-2);
}
.wp-row:last-child { border-bottom: none; }
.wp-row.file { padding-left: 30px; color: var(--ink-3); }
.wp-row .wp-name { display: flex; align-items: center; gap: 8px; }
.wp-row .wp-icon { font-size: 11px; }
.wp-row.folder .wp-icon { color: var(--blue); }
.wp-count, .wp-size { font-size: 11px; color: var(--ink-5); font-family: var(--f-mono); }
.wp-footer {
  padding: 8px 14px; background: var(--paper-2); border-top: 1px solid var(--rule-fine);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--ink-5);
}
.wp-footer-actions { display: flex; gap: 10px; }
.wp-footer-action { color: var(--blue); font-size: 11px; font-weight: 500; }

/* Address preview */
.addr-preview { font-family: var(--f-sans); }
.addr-input-wrap {
  background: var(--paper); border: 1px solid var(--rule-ink); border-radius: 6px;
  padding: 9px 12px; font-size: 13.5px; color: var(--ink-1);
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.addr-input-wrap .pin { color: var(--blue); }
.addr-dropdown {
  background: var(--paper); border: 1px solid var(--rule-fine);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(13,27,42,0.08);
}
.addr-option {
  padding: 9px 12px; border-bottom: 1px solid var(--rule-fine);
  font-size: 13px; color: var(--ink-2);
}
.addr-option:last-child { border-bottom: none; }
.addr-option:first-child { background: var(--blue-softer); color: var(--ink-1); font-weight: 500; }
.addr-option .addr-main { margin-bottom: 2px; }
.addr-option .addr-sub { font-size: 11px; color: var(--ink-5); }
.addr-validated {
  margin-top: 8px; padding: 8px 12px;
  background: var(--blue-softer); border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--blue); font-weight: 600;
}

/* ================= Responsive ================= */

/* Laptop (1024-1440px): both rails visible but compact, more room for main. */
@media (min-width: 1024px) and (max-width: 1440px) {
  :root {
    --nav-w: 260px;
    --toc-w: 220px;
  }
  .sidebar { padding: 24px 22px 28px 28px; }
  .sidebar .ext-card .ext-name { font-size: 16px; }
  .sidebar .nav-link { font-size: 13px; padding: 5px 8px; }
  .sidebar .cat-label { font-size: 10.5px; }
  .toc { padding: 26px 22px 32px 22px; }
  .toc-label { font-size: 10.5px; }
  .toc a { font-size: 12px; padding: 4px 0; }
  .main { padding: 28px 32px 56px; }
}

/* Tablet (760-1023px): hide TOC, collapse sidebar to overlay. */
@media (max-width: 1023px) {
  :root { --toc-w: 0; }
  .toc { display: none; }
}
@media (max-width: 1023px) {
  .lp-hero { grid-template-columns: 1fr; }
  .lp-hero-preview { display: none; }
  .lp-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-4steps { grid-template-columns: repeat(2, 1fr); }
  .lp-paths { grid-template-columns: 1fr; }
  .lp-footer-cta { grid-template-columns: 1fr; }
  .lp-release-row { grid-template-columns: 100px 48px 1fr; gap: 4px 12px; }
  .home-headline { font-size: 58px; }
  .main { padding: 28px 28px 56px; }
  /* Inline 4-col grids → 2 col on tablet */
  div[style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  /* Inline 3-col grids → 1 col on tablet (cards become readable instead of word-per-line) */
  div[style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; }

  /* Collapse sidebar into an overlay at tablet width so main gets the full
     viewport. Hamburger appears in the topbar (.mobile-menu). */
  :root { --nav-w: 0; }
  .layout, .layout.two-col { grid-template-columns: 1fr; padding: 0; }
  .content-wrap { grid-template-columns: 1fr; overflow-y: auto; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: 320px; max-width: 82vw;
    background: var(--paper); padding: 24px 20px;
    transform: translateX(-100%); transition: transform .22s;
    z-index: 70;
    box-shadow: 0 10px 30px rgba(13,27,42,0.15);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .nav-link { padding: 8px 10px; font-size: 14px; }
  .topbar .mobile-menu { display: inline-grid; place-items: center; }
  .topbar .nav { display: none; }
}
@media (max-width: 760px) {
  .topbar .search-launcher { min-width: 0; }
  .topbar .search-launcher .search-text { display: none; }
  .topbar .search-launcher .kbd { display: none; }
  .lang-code { display: none; }
  .lang-btn { padding: 5px 8px; }
  .topbar .ai-topbar-btn span { display: none; }
  .topbar .ext-name {
    font-size: 11.5px; font-weight: 600;
    max-width: 140px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .topbar { padding: 0 16px; gap: 10px; }
  .main { padding: 24px 20px 48px; }
  .breadcrumb-bar { padding: 0 20px; }
  .article-title { font-size: 24px; }
  .editorial-headline { font-size: 36px; max-width: 100%; }
  .standfirst { font-size: 16px; max-width: 100%; }
  .ext-hero h1.ext-title { font-size: 36px; }
  .home-headline { font-size: 42px; line-height: 1.05; }
  .home-wrap { padding: 40px 20px 72px; }
  .home-search { width: 100%; justify-content: center; padding: 12px 20px; font-size: 15px; }
  .ext-row .ext-name { font-size: 19px; }
  .num-grid { grid-template-columns: 1fr; }
  .landing-cat .pages { grid-template-columns: 1fr; }
  .steps .step { grid-template-columns: 44px 1fr; }
  .steps .step .n { font-size: 22px; }
  .related-grid { grid-template-columns: 1fr; }
  .kv-row { grid-template-columns: 1fr; }
  .kv-key { border-right: none; border-bottom: 1px solid var(--rule-fine); }
  .step-card-header { flex-wrap: wrap; }
  /* Pullquote: reduce oversized padding on mobile */
  .pullquote { padding: 20px 20px 20px 26px; font-size: 17px; }
  .pullquote::before { font-size: 42px; top: 2px; left: 12px; }
  /* Tables: horizontal scroll on mobile */
  .doc-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Path code: scroll instead of overflow */
  .code.path { overflow-x: auto; }
  /* Release rows: collapse to 1-col on mobile */
  .lp-release-row { grid-template-columns: 1fr; gap: 2px; }
  .lp-release-date, .lp-release-ver { padding-top: 0; }
  /* lp-4steps: 2-col on tablet → 1-col on phone */
  .lp-4steps { grid-template-columns: 1fr !important; }
  /* Search palette: full width on mobile */
  .palette-root { padding: 60px 16px 16px; align-items: flex-start; }
  .palette { max-width: 100%; }
  /* Inline 3-col and 4-col grids → single column */
  .grid-cols-3 { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:repeat(4"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: repeat(4"] { grid-template-columns: 1fr !important; }
  /* Inline unequal 2-col grids → single column (catch all ratio variants) */
  div[style*="grid-template-columns:1.0"],
  div[style*="grid-template-columns:1.1"],
  div[style*="grid-template-columns:1.2"] { grid-template-columns: 1fr !important; }
  /* Inline fixed-width first column (kv-table style) → single column */
  div[style*="grid-template-columns:180px"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:110px"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:140px"] { grid-template-columns: 1fr !important; }
  /* Fix border on inline kv-style cells when stacked */
  div[style*="grid-template-columns:180px"] > div:first-child,
  div[style*="grid-template-columns:110px"] > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid rgba(196,212,232,0.5);
  }
  /* Inline iframes always fill width */
  iframe { width: 100% !important; }
}

/* ===== 600px: collapse equal 2-col grids ===== */
@media (max-width: 600px) {
  div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  /* Equal 2-col repeat grids → single column */
  div[style*="grid-template-columns:repeat(2"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: repeat(2"] { grid-template-columns: 1fr !important; }
  .lp-stats { grid-template-columns: 1fr !important; }
  /* Fix lp-stat borders when stacked: side border → top border */
  .lp-stat + .lp-stat { border-left: none; border-top: 1px solid var(--rule-fine); }
  .page-pager { grid-template-columns: 1fr; }
  .pager-card.pager-next { text-align: left; }
  /* Breadcrumb: hide extension name, keep category visible */
  .bc-ext { display: none; }
  .breadcrumb-bar .bc-sep { margin: 0 4px; }
  .breadcrumb-bar { font-size: 11.5px; }
}

/* ===== 480px: small phones ===== */
@media (max-width: 480px) {
  /* Typography */
  .editorial-headline { font-size: 28px; }
  .home-headline { font-size: 32px; line-height: 1.08; }
  .home-standfirst { font-size: 15px; }
  .lp-h2 { font-size: 24px; }
  .lp-stat-num { font-size: 22px; }
  .ext-row .ext-name { font-size: 17px; }
  /* Truncate long extension summaries on smallest screens */
  .ext-row .ext-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* Spacing */
  .main { padding: 20px 16px 40px; }
  .breadcrumb-bar { padding: 0 16px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .home-wrap { padding: 32px 16px 64px; }
  /* Narrower ext-name limit */
  .topbar .ext-name { max-width: 110px; }
  /* Components */
  .lp-footer-cta { padding: 22px 18px; gap: 20px; }
  .lp-btn { padding: 9px 14px; font-size: 13px; }
  .home-cta { padding: 22px 18px; }
  .home-cta-text h2 { font-size: 21px; }
  .lp-hero { padding: 24px 0 32px; }
  .ext-hero h1.ext-title { font-size: 28px; }
  /* Palette */
  .palette-root { padding: 52px 12px 12px; }
  /* Hide extension name on very small phones to prevent topbar overflow */
  .topbar .ext-name { display: none; }
}

/* Pre-JS skeleton */
[data-prose-source] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ─── Lightbox ────────────────────────────────────────────────────── */
.prose img, .main img {
  cursor: zoom-in;
  border-radius: 7px;
  box-shadow: 0 1px 4px rgba(13,27,42,0.06), 0 4px 14px rgba(13,27,42,0.07);
  transition: opacity .15s, box-shadow .2s;
}
.prose img:hover, .main img:hover {
  opacity: .9;
  box-shadow: 0 2px 8px rgba(13,27,42,0.09), 0 8px 24px rgba(13,27,42,0.09);
}

#lx {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10,16,26,.9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
#lx.open { opacity: 1; pointer-events: all; }
#lx-img {
  max-width: 92vw; max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 32px 96px rgba(0,0,0,.6);
  cursor: zoom-out;
  display: block;
}
#lx-close {
  position: absolute; top: 16px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; line-height: 1;
  transition: background .15s;
}
#lx-close:hover { background: rgba(255,255,255,.24); }
#lx-close:focus-visible { outline: 2px solid rgba(255,255,255,.8); outline-offset: 2px; }
*:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* ─── Ask AI ─────────────────────────────────────────────────────── */
.topbar .ai-topbar-btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 20px;
  color: rgba(255,255,255,0.95);
  font-family: var(--f-sans); font-size: 13px; font-weight: 500;
  padding: 5px 14px 5px 11px; cursor: pointer; flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.topbar .ai-topbar-btn svg {
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.topbar .ai-topbar-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.38);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.topbar .ai-topbar-btn:hover svg { transform: rotate(30deg) scale(1.1); }
.topbar .ai-topbar-btn[aria-expanded="true"] {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.38);
}

.ai-backdrop {
  display: none; position: fixed; inset: 0; z-index: 74;
  background: rgba(13,27,42,0.25);
}
.ai-backdrop.show { display: block; }

.ai-panel {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0;
  width: clamp(380px, 28vw, 520px); max-width: 100vw;
  background: var(--paper); border-left: 1px solid var(--rule-fine);
  display: flex; flex-direction: column;
  z-index: 75; transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 24px rgba(13,27,42,0.10);
}
.ai-panel.open { transform: translateX(0); }

.ai-hdr {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 16px; border-bottom: 1px solid var(--rule-fine);
  flex-shrink: 0;
}
.ai-hdr-title {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--f-sans); font-size: 14px; font-weight: 700;
  color: var(--ink-1);
  margin-right: auto;
}
.ai-hdr-title svg { color: var(--blue); flex-shrink: 0; }
.ai-lang-pill {
  font-family: var(--f-sans); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border);
  border-radius: 999px;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ai-lang-pill:hover { background: var(--blue-softer); border-color: var(--blue); }
:root[data-theme="dark"] .ai-lang-pill {
  background: var(--blue-soft); color: var(--blue-bright); border-color: var(--blue-border);
}
.ai-clear {
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); font-size: 12px; font-weight: 500;
  padding: 4px 8px; border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}
.ai-clear:hover { background: var(--surface-2); color: var(--ink-1); }
.ai-close {
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); font-size: 20px; line-height: 1;
  padding: 2px 6px; border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}
.ai-close:hover { background: var(--surface-2); color: var(--ink-1); }

.ai-msgs {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.ai-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; gap: 10px;
  color: var(--ink-4); text-align: center; padding: 32px 16px;
}
.ai-empty svg {
  opacity: 0.45;
  animation: sparkle-idle 3.5s ease-in-out infinite;
}
@keyframes sparkle-idle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.4; }
  50%       { transform: scale(1.12) rotate(20deg); opacity: 0.6; }
}
.ai-empty p { font-family: var(--f-sans); font-size: 13px; margin: 0; }

.ai-suggestions {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 14px; width: 100%; max-width: 340px;
}
.ai-sug-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-5);
  margin-bottom: 2px; align-self: flex-start;
}
.ai-sug-chip {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.ai-sug-chip:hover {
  background: var(--blue-softer);
  border-color: var(--blue);
}
.ai-sug-chip:active { transform: scale(0.98); }

.ai-msg {
  font-family: var(--f-sans); font-size: 14px; line-height: 1.65;
  max-width: 100%; word-break: break-word;
}
.ai-user {
  align-self: flex-end; background: var(--blue); color: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px; max-width: 82%;
}
.ai-bot {
  align-self: flex-start; background: var(--surface-2);
  border-radius: 4px 14px 14px 14px;
  padding: 14px 16px; max-width: 95%;
  color: var(--ink-1);
}
.ai-bot > *:first-child { margin-top: 0; }
.ai-bot > *:last-child  { margin-bottom: 0; }
.ai-bot p { margin: 0 0 10px; }
.ai-bot strong { color: var(--ink-1); font-weight: 600; }
.ai-bot ul, .ai-bot ol { margin: 6px 0 10px; padding-left: 22px; }
.ai-bot li { margin-bottom: 6px; line-height: 1.55; }
.ai-bot li::marker { color: var(--ink-4); }
.ai-bot code {
  font-family: var(--f-mono); font-size: 12.5px;
  background: var(--surface-3, rgba(0,0,0,0.06));
  border-radius: 4px; padding: 2px 5px;
}
.ai-bot a.ai-link {
  color: #2563EB; text-decoration: none; font-weight: 500;
  border-bottom: 1px solid rgba(37, 99, 235, 0.45);
  transition: border-color 0.15s ease, background 0.15s ease;
  padding: 1px 2px; border-radius: 2px;
}
.ai-bot a.ai-link:hover {
  border-bottom-color: #2563EB;
  background: rgba(37, 99, 235, 0.08);
}
.ai-err { background: #fff3f3; color: #c0392b; }
.ai-cursor { display: inline-block; animation: ai-blink 0.9s step-end infinite; }
@keyframes ai-blink { 50% { opacity: 0; } }

.ai-dot { display: flex; align-items: center; gap: 4px; padding: 12px 14px; }
.ai-dot span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3); display: inline-block;
  animation: ai-bounce 1.2s ease-in-out infinite;
}
.ai-dot span:nth-child(1) { animation-delay: 0s; }
.ai-dot span:nth-child(2) { animation-delay: 0.2s; }
.ai-dot span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%            { transform: translateY(-5px); opacity: 1; }
}

.ai-foot {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px; border-top: 1px solid var(--rule-fine);
  flex-shrink: 0;
}
.ai-textarea {
  flex: 1; resize: none; border: 1px solid var(--rule-fine);
  border-radius: 8px; padding: 9px 12px; min-height: 38px; max-height: 120px;
  font-family: var(--f-sans); font-size: 13.5px; color: var(--ink-1);
  background: var(--paper); line-height: 1.5;
  transition: border-color 0.15s;
  overflow-y: auto; field-sizing: content;
}
.ai-textarea:focus { outline: none; border-color: var(--blue); }
.ai-textarea::placeholder { color: var(--ink-4); }
.ai-send {
  width: 36px; height: 36px; border-radius: 8px; border: none; flex-shrink: 0;
  background: var(--blue); color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: background 0.15s; align-self: flex-end;
}
.ai-send:hover { background: var(--blue-deep); }
.ai-send:disabled { background: var(--ink-4); cursor: not-allowed; }
.ai-send.stopping { background: var(--ink-2); }
.ai-send.stopping:hover { background: var(--ink-1); }

@media (max-width: 480px) {
  .ai-panel { width: 100vw; top: 0; }
}
/* Tablet / narrow desktop: snap to full panel min instead of clamp's lower bound */
@media (min-width: 481px) and (max-width: 768px) {
  .ai-panel { width: min(420px, 90vw); }
}

/* ─── Back to top ────────────────────────────────────────────────── */
.back-top {
  position: fixed;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px));
  right: max(28px, calc(env(safe-area-inset-right) + 16px));
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(30,78,143,0.28);
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, background .15s;
  z-index: 50; cursor: pointer;
}
.back-top.show { opacity: 1; pointer-events: all; transform: translateY(0); }
.back-top:hover { background: var(--blue-deep); }

/* ─── Article fade-in ────────────────────────────────────────────── */
@keyframes doc-fadein {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
#article { animation: doc-fadein .22s ease-out both; }

/* ─── Platform section (home) ────────────────────────────────────── */
.platform-section {
  margin-top: 64px; padding-top: 48px;
  border-top: 1px solid var(--rule-fine);
}
.platform-kicker {
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--blue); font-weight: 600; margin-bottom: 10px;
}
.platform-headline {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 32px; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--ink-1); margin-bottom: 36px; max-width: 30ch;
}
.platform-headline em { color: var(--blue); font-style: italic; }
.platform-pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 48px;
}
.platform-pillar {
  padding: 24px; background: var(--paper-2);
  border: 1px solid var(--rule-fine); border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.platform-pillar:hover { border-color: var(--blue-border); background: var(--blue-softer); }
.platform-pillar-icon {
  width: 36px; height: 36px; border-radius: 8px; background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; color: var(--blue);
}
.platform-pillar h3 {
  font-family: var(--f-sans); font-size: 14.5px; font-weight: 600;
  color: var(--ink-1); margin-bottom: 6px; line-height: 1.3;
}
.platform-pillar p {
  font-family: var(--f-sans); font-size: 13.5px; color: var(--ink-4); line-height: 1.6;
}

/* ─── Home CTA block ─────────────────────────────────────────────── */
.home-cta {
  background: var(--blue); border-radius: 12px; padding: 36px 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  margin-bottom: 8px;
}
.home-cta-text h2 {
  font-family: var(--f-serif); font-weight: 400;
  font-size: 26px; color: #fff; line-height: 1.25;
  letter-spacing: -0.01em; margin-bottom: 6px;
}
.home-cta-text h2 em { font-style: italic; color: rgba(255,255,255,0.82); }
.home-cta-text p {
  font-family: var(--f-sans); font-size: 14px; color: rgba(255,255,255,0.72); line-height: 1.5;
}
.home-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 8px;
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
  background: #fff; color: var(--blue);
  border: none; cursor: pointer; white-space: nowrap; text-decoration: none;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.home-cta-btn:hover { background: var(--blue-softer); transform: translateY(-1px); }
@media (max-width: 760px) {
  .platform-pillars { grid-template-columns: 1fr; }
  .home-cta { flex-direction: column; align-items: flex-start; padding: 28px 24px; }
  .home-cta-btn { width: 100%; justify-content: center; }
  .ext-row { grid-template-columns: 1fr; }
  .lp-cta-group { flex-direction: column; }
  .lp-btn { width: 100%; justify-content: center; }
  .back-top { bottom: 20px; right: 16px; width: 36px; height: 36px; }
}

/* ============================================================
   Heading anchors — hover-revealed "#" button next to h2/h3
   ============================================================ */
.prose h2, .prose h3 { position: relative; }
.heading-anchor {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  margin-left: 8px;
  vertical-align: middle;
  background: transparent; border: none;
  color: var(--ink-5); font-weight: 600;
  font-size: 14px; line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }
.heading-anchor:hover { background: var(--surface-2); color: var(--blue); }

/* ============================================================
   Global toast (heading-anchor copy, first-visit hint, etc.)
   ============================================================ */
.iww-toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(24px, env(safe-area-inset-right));
  z-index: 200;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  background: var(--ink-1, #0F1A2E);
  color: #fff;
  border-radius: 8px;
  font-family: var(--f-sans);
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(13,27,42,0.22);
  opacity: 0; transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.iww-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.iww-toast.clickable { cursor: pointer; }
:root[data-theme="dark"] .iww-toast { background: var(--paper-2); color: var(--ink-1); border: 1px solid var(--rule-fine); }

/* ============================================================
   Skip-to-content link (accessibility)
   ============================================================ */
.skip-to-content {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--blue);
  color: #fff;
  font-family: var(--f-sans);
  font-size: 13px; font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
  box-shadow: 0 6px 18px rgba(13,27,42,0.25);
}
.skip-to-content:focus { transform: translateY(0); outline: none; }

/* ============================================================
   AI source preview cards — appear under bot bubbles that contain links
   ============================================================ */
.ai-sources {
  display: flex; flex-direction: column; gap: 8px;
  margin: -4px 0 4px;
  align-self: flex-start;
  max-width: 95%;
}
.ai-source-card {
  display: block;
  padding: 10px 13px;
  background: var(--paper);
  border: 1px solid var(--rule-fine);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.ai-source-card:hover {
  border-color: var(--blue-border);
  background: var(--blue-softer);
}
.ai-source-card:active { transform: scale(0.99); }
.ai-source-crumb {
  font-family: var(--f-sans); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-5); font-weight: 600;
  margin-bottom: 2px;
}
.ai-source-title {
  font-family: var(--f-sans); font-size: 13.5px; font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 3px;
}
.ai-source-summary {
  font-family: var(--f-sans); font-size: 12.5px; line-height: 1.5;
  color: var(--ink-3);
}

/* ============================================================
   AI per-message actions row — retry + thumbs feedback
   ============================================================ */
.ai-actions {
  display: flex; align-items: center; gap: 4px;
  margin: -6px 0 6px;
  align-self: flex-start;
  padding-left: 2px;
}
.ai-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--ink-5);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ai-act:hover { background: var(--surface-2); color: var(--ink-2); }
.ai-act.active { color: var(--blue); background: var(--blue-soft); }
.ai-act-up.active { color: var(--mint); background: rgba(61, 178, 135, 0.15); }
.ai-act-down.active { color: var(--rose); background: rgba(180, 58, 78, 0.15); }
:root[data-theme="dark"] .ai-act-up.active { color: var(--mint); background: rgba(77, 207, 160, 0.18); }
:root[data-theme="dark"] .ai-act-down.active { color: #ff8d92; background: rgba(248, 81, 73, 0.18); }

/* ============================================================
   AI context-shift divider — shown when conversation crosses pages
   ============================================================ */
.ai-context-shift {
  align-self: stretch;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-sans); font-size: 11.5px;
  color: var(--ink-5);
  padding: 4px 0;
  margin: 6px 0 -2px;
  text-align: center;
  justify-content: center;
}
.ai-context-shift::before,
.ai-context-shift::after {
  content: ''; flex: 1; height: 1px; background: var(--rule-fine);
}
.ai-context-shift strong { color: var(--ink-3); font-weight: 600; }

/* ============================================================
   "Was this page helpful?" widget
   ============================================================ */
.page-feedback {
  margin: 48px 0 8px;
  padding: 18px 22px;
  background: var(--paper-2);
  border: 1px solid var(--rule-fine);
  border-radius: 10px;
  max-width: var(--prose-w, 100%);
}
.pf-question {
  font-family: var(--f-sans); font-size: 14px; font-weight: 600;
  color: var(--ink-1);
  margin-bottom: 12px;
}
.pf-buttons { display: flex; gap: 10px; }
.pf-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: var(--paper);
  border: 1px solid var(--rule-fine);
  border-radius: 6px;
  font-family: var(--f-sans); font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s, transform 0.08s;
}
.pf-btn:hover { border-color: var(--blue-border); color: var(--ink-1); }
.pf-btn:active { transform: scale(0.97); }
.pf-btn svg { flex-shrink: 0; }
.pf-yes:hover { border-color: var(--mint); color: var(--mint); background: rgba(61, 178, 135, 0.06); }
.pf-no:hover  { border-color: var(--rose); color: var(--rose); background: rgba(180, 58, 78, 0.06); }
.pf-textarea {
  width: 100%; box-sizing: border-box;
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--rule-fine);
  border-radius: 6px;
  font-family: var(--f-sans); font-size: 13px; line-height: 1.5;
  color: var(--ink-1);
  resize: vertical;
  min-height: 70px;
}
.pf-textarea:focus { outline: none; border-color: var(--blue); }
.pf-row {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 10px;
}
.pf-skip, .pf-send {
  padding: 7px 14px; border-radius: 6px;
  font-family: var(--f-sans); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--rule-fine);
  background: var(--paper); color: var(--ink-3);
}
.pf-skip:hover { color: var(--ink-1); }
.pf-send { background: var(--blue); color: #fff; border-color: var(--blue); }
.pf-send:hover { background: var(--blue-deep); }
.pf-thanks {
  font-family: var(--f-sans); font-size: 13.5px;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
}
.pf-thanks::before {
  content: '✓'; color: var(--mint); font-weight: 700;
}

/* ============================================================
   Print stylesheet — strip chrome so docs PDF-export cleanly
   ============================================================ */
@media print {
  /* Force light theme regardless of selection */
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    background: #fff !important;
  }
  body { background: #fff !important; color: #000 !important; }

  /* Hide all interactive / navigational chrome */
  .topbar, .sidebar, .toc, .breadcrumb-bar,
  .back-top, .ai-topbar-btn, .ai-panel, .ai-backdrop,
  .iww-toast, .skip-to-content,
  .lang-banner, .palette-root,
  .heading-anchor, .drawer-scrim,
  .page-pager { display: none !important; }

  /* Reset shell to print on full page */
  .page-card {
    width: 100% !important; height: auto !important;
    margin: 0 !important; padding: 0 !important;
    box-shadow: none !important; border: none !important;
    overflow: visible !important;
  }
  .layout, .layout.two-col {
    display: block !important;
    grid-template-columns: none !important;
    padding: 0 !important;
  }
  .content-wrap {
    display: block !important;
    grid-template-columns: none !important;
    overflow: visible !important;
  }
  .main {
    padding: 0 !important;
    overflow: visible !important;
  }
  .prose { max-width: 100% !important; color: #000 !important; }

  /* Honest link references — show URL after each external link */
  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em; color: #555;
  }

  /* Avoid splitting key blocks across pages */
  .step, .step-card, .callout, .code, .doc-table { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }

  /* Images get a sensible cap so they don't span 5 pages */
  img { max-width: 100% !important; max-height: 80vh; }
}
