/* ══════════════════════════════════════════════════════════════
   Pricely Docs — docs.pricely.me
   Same vocabulary as the in-app pricing page: static surfaces,
   1px hairlines, tabular numerals, one restrained purple accent.
   Nothing on this site animates beyond short color transitions.
   ══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #0d0d10;
  --panel-raised: #121217;
  --panel-sunken: #070709;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.045);
  --text: #ededf0;
  --text-strong: #fafafa;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #7c5cf8;
  --accent-hover: #8a6cfa;
  --accent-text: #b9a8ff;
  --accent-soft: rgba(124, 92, 248, 0.12);
  --accent-line: rgba(124, 92, 248, 0.5);
  --good: #6ee7a8;
  --good-soft: rgba(110, 231, 168, 0.09);
  --good-line: rgba(110, 231, 168, 0.28);
  --warn: #f5c76b;
  --warn-soft: rgba(245, 199, 107, 0.08);
  --warn-line: rgba(245, 199, 107, 0.28);
  --bad: #fb8b8b;
  --bad-soft: rgba(251, 139, 139, 0.08);
  --bad-line: rgba(251, 139, 139, 0.28);
  --code-bg: #0f0f13;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -32px rgba(0, 0, 0, 0.8);
  --shadow-pop: 0 0 0 1px var(--line-strong), 0 32px 80px -24px rgba(0, 0, 0, 0.85);
  --tint: rgba(124, 92, 248, 0.11);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --topbar: 60px;
  --sidebar: 272px;
  --toc: 224px;
  --content: 744px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #fafafa;
  --panel-raised: #ffffff;
  --panel-sunken: #f4f4f5;
  --line: rgba(15, 15, 25, 0.09);
  --line-strong: rgba(15, 15, 25, 0.16);
  --line-soft: rgba(15, 15, 25, 0.055);
  --text: #27272a;
  --text-strong: #09090b;
  --muted: #52525b;
  --faint: #8b8b94;
  --accent: #6d4ff0;
  --accent-hover: #5f40e6;
  --accent-text: #5b3fd9;
  --accent-soft: rgba(109, 79, 240, 0.07);
  --accent-line: rgba(109, 79, 240, 0.42);
  --good: #15803d;
  --good-soft: rgba(21, 128, 61, 0.06);
  --good-line: rgba(21, 128, 61, 0.25);
  --warn: #a16207;
  --warn-soft: rgba(202, 138, 4, 0.07);
  --warn-line: rgba(202, 138, 4, 0.3);
  --bad: #b91c1c;
  --bad-soft: rgba(185, 28, 28, 0.05);
  --bad-line: rgba(185, 28, 28, 0.25);
  --code-bg: #fafafa;
  --shadow: 0 1px 2px rgba(15, 15, 25, 0.04), 0 16px 40px -28px rgba(15, 15, 25, 0.25);
  --shadow-pop: 0 0 0 1px var(--line), 0 24px 64px -16px rgba(15, 15, 25, 0.28);
  --tint: rgba(109, 79, 240, 0.06);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar) + 24px);
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--text-strong); }

::selection { background: var(--accent-soft); color: var(--text-strong); }

:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; display: block; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.skip-link:focus { top: 12px; color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Static tint + hairline grid at the top of every page. Nothing moves. */
.backdrop {
  position: absolute;
  inset: 0 0 auto;
  height: 560px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 70% at 50% -20%, var(--tint), transparent 70%),
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px) 0 0 / 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.35) 60%, transparent);
  mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.35) 60%, transparent);
}
.page-article .backdrop { height: 360px; opacity: 0.7; }

/* ── Top bar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.topbar-inner {
  height: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--text-strong); }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.brand-mark svg { width: 15px; height: 15px; }
.brand-divider { width: 1px; height: 16px; background: var(--line-strong); }
.brand-sub { color: var(--muted); font-weight: 500; }

.search-trigger {
  flex: 0 1 340px;
  margin-left: 12px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--faint);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--muted); }
.search-trigger svg { flex-shrink: 0; width: 15px; height: 15px; }
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger .kbd-group { display: inline-flex; gap: 3px; }

.topbar-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar-links a {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 7px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.topbar-links a:hover { color: var(--text-strong); background: var(--line-soft); }
.topbar-links .btn-app {
  margin-left: 6px;
  color: #fff;
  background: var(--accent);
  padding: 7px 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.topbar-links .btn-app:hover { background: var(--accent-hover); color: #fff; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--line); background: var(--panel); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: block; }
[data-theme="light"] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; }

/* ── Layout ───────────────────────────────────────────────────── */
.layout {
  position: relative;
  isolation: isolate;
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);
  gap: 0 56px;
  padding: 0 24px;
}
.layout.no-toc { grid-template-columns: var(--sidebar) minmax(0, 1fr); }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: var(--topbar);
  align-self: start;
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 28px 12px 40px 0;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.nav-group + .nav-group { margin-top: 22px; }
.nav-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-list a:hover { color: var(--text-strong); background: var(--line-soft); }
.nav-list a[aria-current="page"] {
  color: var(--text-strong);
  background: var(--accent-soft);
  font-weight: 550;
}
.nav-list a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.nav-list .nav-badge { margin-left: auto; }
.sidebar-foot {
  margin-top: 28px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
  line-height: 1.55;
}
.sidebar-foot a { color: var(--muted); }
.sidebar-foot a:hover { color: var(--text-strong); }

/* ── Main column ──────────────────────────────────────────────── */
.main {
  min-width: 0;
  padding: 40px 0 96px;
}
.article { max-width: var(--content); }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--faint);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text-strong); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-text);
}

.article h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.028em;
  font-weight: 680;
  color: var(--text-strong);
  text-wrap: balance;
}
.lede {
  margin: 0 0 22px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 660px;
  text-wrap: pretty;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-bottom: 26px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
}
.page-meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.page-meta svg { width: 14px; height: 14px; }

.prose > :first-child { margin-top: 0; }
.prose h2 {
  margin: 52px 0 14px;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.018em;
  font-weight: 650;
  color: var(--text-strong);
  text-wrap: balance;
}
.prose h3 {
  margin: 34px 0 10px;
  font-size: 17.5px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 620;
  color: var(--text-strong);
}
.prose h4 {
  margin: 26px 0 8px;
  font-size: 15px;
  font-weight: 620;
  color: var(--text-strong);
}
.prose h2 + h3 { margin-top: 18px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin: 6px 0; padding-left: 2px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose ul li::marker { color: var(--faint); }
.prose ol li::marker { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 550; }
.prose strong { color: var(--text-strong); font-weight: 600; }
.prose em { color: var(--text-strong); }
.prose a:not(.card):not(.anchor):not(.btn) {
  color: var(--text-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}
.prose a:not(.card):not(.anchor):not(.btn):hover { color: var(--accent-text); text-decoration-color: currentColor; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.heading { position: relative; }
.anchor {
  position: absolute;
  left: -26px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.anchor svg { width: 14px; height: 14px; }
.heading:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent-text); }

/* Inline code + kbd */
.prose code, .inline-code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--text-strong);
  white-space: nowrap;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.ui {
  font-weight: 600;
  color: var(--text-strong);
}
.path {
  display: inline;
  font-weight: 550;
  color: var(--text-strong);
}
.path .sep { color: var(--faint); margin: 0 5px; font-weight: 400; }

/* Code blocks */
.code {
  margin: 20px 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  background: var(--panel);
}
.code-head .lang { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--text-strong); border-color: var(--line-strong); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn.copied { color: var(--good); border-color: var(--good-line); }
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  tab-size: 2;
}
.code pre code { all: unset; font: inherit; white-space: pre; }
.tok-k { color: var(--accent-text); }
.tok-s { color: var(--good); }
.tok-n { color: var(--warn); }
.tok-c { color: var(--faint); font-style: italic; }

/* Callouts */
.callout {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  margin: 22px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 14.5px;
  line-height: 1.65;
}
.callout-icon { padding-top: 2px; color: var(--muted); }
.callout-icon svg { width: 18px; height: 18px; display: block; }
.callout-title { display: block; margin-bottom: 2px; font-weight: 620; color: var(--text-strong); }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body p { margin: 0 0 8px; }
.callout-body ul { margin: 6px 0 0; }
.callout.note { border-color: var(--accent-line); background: var(--accent-soft); }
.callout.note .callout-icon { color: var(--accent-text); }
.callout.tip { border-color: var(--good-line); background: var(--good-soft); }
.callout.tip .callout-icon { color: var(--good); }
.callout.warning { border-color: var(--warn-line); background: var(--warn-soft); }
.callout.warning .callout-icon { color: var(--warn); }
.callout.danger { border-color: var(--bad-line); background: var(--bad-soft); }
.callout.danger .callout-icon { color: var(--bad); }

/* Steps */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 26px 0 28px;
  padding: 0;
}
.steps > li {
  position: relative;
  counter-increment: step;
  margin: 0;
  padding: 0 0 26px 46px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel-raised);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.steps > li::after {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 34px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.steps > li:last-child { padding-bottom: 4px; }
.steps > li:last-child::after { display: none; }
.step-title {
  display: block;
  margin: 1px 0 6px;
  font-size: 15.5px;
  font-weight: 620;
  color: var(--text-strong);
  line-height: 1.5;
}
.steps > li > :last-child { margin-bottom: 0; }
.steps p { margin: 0 0 10px; }
.steps .figure { margin: 16px 0 6px; }

/* Figures */
.figure { margin: 26px 0 30px; }
.figure-frame {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--panel-sunken);
  padding: 6px;
  box-shadow: var(--shadow);
}
.figure-frame img {
  width: 100%;
  border-radius: 7px;
  border: 1px solid var(--line);
}
.figure figcaption {
  margin-top: 10px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--faint);
}
.figure figcaption strong { color: var(--muted); font-weight: 600; }

/* Tables */
.table-wrap {
  margin: 20px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--panel);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.table-wrap th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-sunken);
  white-space: nowrap;
}
.table-wrap td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--text);
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { color: var(--text-strong); font-weight: 550; }
.table-wrap td.num, .table-wrap th.num { text-align: right; white-space: nowrap; }
.table-wrap td.center, .table-wrap th.center { text-align: center; }
.table-wrap .yes { color: var(--good); font-weight: 600; }
.table-wrap .no { color: var(--faint); }
.table-wrap code { white-space: nowrap; }
.table-compact td, .table-compact th { padding: 9px 14px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-raised);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: 2px;
}
.badge svg { width: 11px; height: 11px; }
.badge.plan { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.badge.status { font-weight: 550; }
.badge.s-good { border-color: var(--good-line); background: var(--good-soft); color: var(--good); }
.badge.s-warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.badge.s-bad { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.badge.s-accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }

/* Definition list (field reference) */
.fields {
  margin: 18px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.field {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
  line-height: 1.6;
}
.field:last-child { border-bottom: 0; }
.field dt { font-weight: 600; color: var(--text-strong); }
.field dt .badge { margin-left: 6px; }
.field dd { margin: 0; color: var(--text); }
.field dd .hint { display: block; margin-top: 2px; font-size: 13px; color: var(--faint); }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 30px;
}
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
a.card:hover { border-color: var(--line-strong); background: var(--panel-raised); color: var(--text); }
.card-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-raised);
  color: var(--accent-text);
}
.card-icon svg { width: 16px; height: 16px; }
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 620;
  color: var(--text-strong);
  line-height: 1.4;
}
.card-title .arrow { margin-left: auto; color: var(--faint); transition: color 0.15s ease; }
a.card:hover .card-title .arrow { color: var(--accent-text); }
.card-text { font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* Plan matrix */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 22px 0 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.plan-cell { padding: 16px 16px 18px; border-right: 1px solid var(--line); }
.plan-cell:last-child { border-right: 0; }
.plan-cell.featured { background: var(--accent-soft); box-shadow: inset 0 2px 0 var(--accent); }
.plan-name { font-size: 13px; font-weight: 620; color: var(--text-strong); }
.plan-price {
  margin: 8px 0 2px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.plan-price small { font-size: 13px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.plan-yr { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.plan-seats {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* Shortcut list */
.shortcuts { margin: 18px 0 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.shortcut { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
.shortcut:last-child { border-bottom: 0; }
.shortcut .keys { display: inline-flex; gap: 4px; align-items: center; color: var(--faint); font-size: 12px; }

/* Status flow */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.flow .arrow-sep { color: var(--faint); font-size: 13px; }

/* FAQ */
.faq { margin: 18px 0 30px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--text-strong);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--faint); transition: transform 0.15s ease; }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq .faq-a { padding: 0 2px 16px; color: var(--text); }
.faq .faq-a > :last-child { margin-bottom: 0; }

/* Pager + footer */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.15s ease;
}
.pager a:hover { border-color: var(--line-strong); }
.pager .pager-dir { font-size: 12.5px; color: var(--faint); }
.pager .pager-title { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.pager .next { text-align: right; grid-column: 2; }

.help-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--muted);
}
.help-strip a { font-weight: 600; white-space: nowrap; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 0;
}
.site-footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 24px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--faint);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text-strong); }

/* ── On this page ─────────────────────────────────────────────── */
.toc {
  position: sticky;
  top: var(--topbar);
  align-self: start;
  max-height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 44px 0 40px;
  font-size: 13px;
}
.toc-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.toc-label svg { width: 13px; height: 13px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 13px;
  border-left: 1px solid transparent;
  color: var(--muted);
  line-height: 1.45;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc a:hover { color: var(--text-strong); }
.toc .lvl-3 a { padding-left: 25px; font-size: 12.5px; }
.toc a.active { color: var(--text-strong); border-left-color: var(--accent); }
.toc-extra {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.toc-extra a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.toc-extra a:hover { color: var(--text-strong); }
.toc-extra svg { width: 13px; height: 13px; }

/* ── Home ─────────────────────────────────────────────────────── */
.home-hero { padding: 18px 0 8px; max-width: 760px; }
.home-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--text-strong);
  text-wrap: balance;
}
.home-hero .lede { font-size: 18.5px; margin-bottom: 26px; }
.hero-search {
  width: 100%;
  max-width: 560px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--panel);
  color: var(--faint);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}
.hero-search:hover { border-color: var(--accent-line); }
.hero-search svg { width: 17px; height: 17px; flex-shrink: 0; }
.hero-search span { flex: 1; }
.hero-popular { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--faint); }
.hero-popular a { color: var(--muted); }
.hero-popular a:hover { color: var(--text-strong); }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 54px 0 4px;
}
.section-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}
.section-title p { margin: 0; font-size: 13.5px; color: var(--faint); }

.home-shot { margin-top: 44px; }

/* ── Search dialog ────────────────────────────────────────────── */
.search-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  margin: 12vh auto auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--panel-raised);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.search-dialog::backdrop { background: rgba(5, 5, 8, 0.6); backdrop-filter: blur(2px); }
[data-theme="light"] .search-dialog::backdrop { background: rgba(20, 20, 30, 0.28); }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 18px;
  height: 56px;
  border-bottom: 1px solid var(--line);
}
.search-head svg { width: 18px; height: 18px; color: var(--faint); flex-shrink: 0; }
.search-head input {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  font-size: 16px;
}
.search-head input::placeholder { color: var(--faint); }
.search-results { overflow-y: auto; padding: 8px; min-height: 120px; }
.search-group-label { padding: 10px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.search-hit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
}
.search-hit svg { width: 16px; height: 16px; margin-top: 3px; color: var(--faint); flex-shrink: 0; }
.search-hit .hit-title { display: block; font-size: 14.5px; font-weight: 600; color: var(--text-strong); line-height: 1.45; }
.search-hit .hit-crumb { display: block; font-size: 12.5px; color: var(--faint); }
.search-hit .hit-text { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-hit mark { background: transparent; color: var(--accent-text); font-weight: 650; }
.search-hit[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.search-hit[aria-selected="true"] svg { color: var(--accent-text); }
.search-empty { padding: 36px 16px; text-align: center; color: var(--faint); font-size: 14px; }
.search-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
  background: var(--panel);
}
.search-foot span { display: inline-flex; align-items: center; gap: 5px; }
.search-foot kbd { height: 19px; min-width: 19px; font-size: 10.5px; }

/* ── 404 ──────────────────────────────────────────────────────── */
.notfound { padding: 80px 0; max-width: 560px; }
.notfound .code-num { font-size: 13px; font-weight: 600; color: var(--accent-text); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 0 48px; }
  .toc { display: none; }
  .topbar-links .hide-md { display: none; }
}

@media (max-width: 960px) {
  :root { --topbar: 56px; }
  .layout, .layout.no-toc { display: block; padding: 0 20px; }
  .menu-toggle { display: inline-grid; margin-left: -6px; }
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .brand-divider, .brand-sub { display: none; }
  .search-trigger { flex: 1 1 auto; margin-left: 4px; max-width: none; }
  .search-trigger .kbd-group { display: none; }
  .topbar-links a:not(.btn-app) { display: none; }
  .topbar-links { margin-left: 0; }
  .sidebar {
    position: fixed;
    top: var(--topbar);
    left: 0;
    bottom: 0;
    z-index: 35;
    width: min(320px, 86vw);
    height: auto;
    align-self: stretch;
    margin: 0;
    padding: 20px 16px 40px;
    background: var(--bg);
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
  }
  body.nav-open .sidebar { transform: none; visibility: visible; }
  .scrim {
    position: fixed;
    inset: var(--topbar) 0 0;
    z-index: 34;
    background: rgba(5, 5, 8, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  [data-theme="light"] .scrim { background: rgba(20, 20, 30, 0.25); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .main { padding: 28px 0 72px; }
  .anchor { display: none; }
  .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-cell:nth-child(3) { border-right: 0; }
  .plan-cell:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .layout, .layout.no-toc { padding: 0 16px; }
  .topbar-links .btn-app { padding: 7px 11px; font-size: 13px; }
  .article h1 { font-size: 28px; }
  .home-hero h1 { font-size: 32px; }
  .lede, .home-hero .lede { font-size: 16.5px; }
  .prose h2 { font-size: 21px; margin-top: 44px; }
  .cards, .cards.three { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
  .plan-cell { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .plan-cell:nth-child(2n) { border-right: 0 !important; }
  .plan-cell:last-child { border-bottom: 0; }
  .field { grid-template-columns: 1fr; gap: 2px; padding: 12px 14px; }
  .steps > li { padding-left: 40px; }
  .figure-frame { padding: 4px; border-radius: 10px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .help-strip { flex-direction: column; align-items: flex-start; }
  .section-title { flex-direction: column; gap: 2px; }
  .search-dialog { margin-top: 64px; }
  .search-foot { display: none; }
}

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

@media print {
  .topbar, .sidebar, .toc, .pager, .help-strip, .site-footer, .backdrop, .search-dialog { display: none !important; }
  .layout { display: block; }
  body { background: #fff; color: #000; }
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
.table-wrap td, .table-wrap th { font-variant-numeric: tabular-nums; }

/* Home: use the width freed by the absent on-page TOC; card links are not prose links. */
.page-home .article { max-width: 1000px; }
.prose .journey a:not(.card):not(.anchor):not(.btn),
.prose .topic li a:not(.card):not(.anchor):not(.btn),
.prose .hero-popular a:not(.card):not(.anchor):not(.btn) { text-decoration: none; }
.prose .topic li a:not(.card):not(.anchor):not(.btn) { color: var(--text); }
.prose .hero-popular a:not(.card):not(.anchor):not(.btn) { color: var(--muted); }
.prose .topic li a:not(.card):not(.anchor):not(.btn):hover,
.prose .hero-popular a:not(.card):not(.anchor):not(.btn):hover { color: var(--text-strong); }

/* ══════════════════════════════════════════════════════════════
   Depth layer: hero stage, journey, topic cards, framed shots,
   richer callouts and rail. All static — no motion beyond color.
   ══════════════════════════════════════════════════════════════ */
:root {
  --tint: rgba(124, 92, 248, 0.17);
  --tint-2: rgba(84, 120, 255, 0.07);
  --frame-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 2px 6px rgba(0, 0, 0, 0.35), 0 28px 64px -24px rgba(0, 0, 0, 0.8);
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0) 60%);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --stage-glow: rgba(124, 92, 248, 0.28);
}
[data-theme="light"] {
  --bg: #fcfcfd;
  --panel: #f8f8fa;
  --panel-raised: #ffffff;
  --panel-sunken: #f3f3f6;
  --tint: rgba(109, 79, 240, 0.11);
  --tint-2: rgba(59, 130, 246, 0.06);
  --frame-shadow: 0 0 0 1px rgba(20, 16, 50, 0.07), 0 1px 3px rgba(20, 16, 50, 0.06), 0 24px 56px -24px rgba(48, 32, 120, 0.25);
  --shadow: 0 1px 2px rgba(20, 16, 50, 0.04), 0 14px 34px -22px rgba(48, 32, 120, 0.2);
  --card-grad: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0) 70%);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --stage-glow: rgba(109, 79, 240, 0.18);
}

/* Backdrop: two static tints over a hairline grid */
.backdrop {
  background:
    radial-gradient(ellipse 50% 60% at 50% -12%, var(--tint), transparent 70%),
    radial-gradient(ellipse 30% 40% at 88% 4%, var(--tint-2), transparent 70%),
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px) 0 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 100% at 50% 0%, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse 90% 100% at 50% 0%, #000 35%, transparent 80%);
}
.page-home .backdrop { height: 980px; }
.page-article .backdrop { height: 420px; opacity: 0.75; }

/* Header: translucent, blurred, hairline */
.topbar {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-links .btn-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 16px -8px var(--accent);
}
.topbar-links .btn-app svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-app-short { display: none; }

/* Sidebar + breadcrumbs: section icons */
.nav-label-icon { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--faint); }
.nav-label-icon svg { width: 14px; height: 14px; }
.nav-group:has([aria-current="page"]) .nav-label-icon { color: var(--accent-text); }
.crumb-icon { display: inline-flex; vertical-align: -2px; margin-right: 6px; color: var(--accent-text); }
.crumb-icon svg { width: 14px; height: 14px; }
.breadcrumbs li { display: inline-flex; align-items: center; }
.page-meta .meta-item:first-child:not(:only-child) {
  padding: 1px 9px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 550;
}

/* Figures: hairline, soft shadow, tinted backdrop */
.figure-frame {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(110% 90% at 50% 0%, var(--accent-soft), transparent 65%),
    linear-gradient(180deg, var(--panel), var(--panel-sunken));
  box-shadow: var(--shadow), var(--hi);
}
.figure-frame img {
  border-radius: 9px;
  border: 0;
  box-shadow: var(--frame-shadow);
}
.figure figcaption {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 0 6px;
}
.figure figcaption::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 1px;
  margin-top: 0.8em;
  background: var(--accent-line);
}

/* Callouts: accent rail, icon tile, tinted wash */
.callout {
  --c: var(--muted);
  position: relative;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 18px 15px 18px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--c) 26%, var(--line));
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 8%, var(--panel)), var(--panel) 70%);
  box-shadow: var(--hi);
}
.callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--c);
  opacity: 0.85;
}
.callout .callout-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  color: var(--c);
}
.callout .callout-icon svg { width: 16px; height: 16px; }
.callout-title { margin-bottom: 3px; }
.callout.note { --c: var(--accent-text); background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel) 70%); }
.callout.tip { --c: var(--good); background: linear-gradient(100deg, color-mix(in srgb, var(--good) 7%, var(--panel)), var(--panel) 70%); }
.callout.warning { --c: var(--warn); background: linear-gradient(100deg, color-mix(in srgb, var(--warn) 8%, var(--panel)), var(--panel) 70%); }
.callout.danger { --c: var(--bad); background: linear-gradient(100deg, color-mix(in srgb, var(--bad) 8%, var(--panel)), var(--panel) 70%); }
.callout.plan {
  --c: var(--accent-text);
  border-color: var(--accent-line);
  background:
    radial-gradient(80% 140% at 100% 0%, var(--accent-soft), transparent 60%),
    linear-gradient(100deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--panel) 75%);
}

/* Steps: filled numerals on a tinted ring */
.steps > li::before {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 26%, var(--panel-raised)), color-mix(in srgb, var(--accent) 12%, var(--panel-raised)));
  color: var(--text-strong);
  box-shadow: 0 0 0 4px var(--bg), var(--hi);
}
.steps > li::after { background: linear-gradient(to bottom, var(--accent-line), var(--line) 40%); }

/* Tables */
.table-wrap { box-shadow: var(--hi); background: var(--panel); }
.table-wrap.matrix td:not(:first-child), .table-wrap.matrix th:not(:first-child) { text-align: center; }
.table-wrap tbody tr:hover td { background: var(--line-soft); }

/* Cards (in articles) */
.card { background: var(--card-grad), var(--panel); box-shadow: var(--hi); }
a.card:hover { border-color: var(--accent-line); }

/* Related guides */
.related { margin-top: 64px; }
.related-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 16px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-grad), var(--panel);
  box-shadow: var(--hi);
  color: var(--text);
  transition: border-color 0.15s ease;
}
.related-card:hover { border-color: var(--accent-line); color: var(--text); }
.related-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.related-icon svg { width: 16px; height: 16px; }
.related-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.related-group { font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.related-name { font-size: 15px; font-weight: 620; color: var(--text-strong); line-height: 1.4; }
.related-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-arrow { color: var(--faint); padding-top: 26px; transition: color 0.15s ease; }
.related-arrow svg { width: 15px; height: 15px; }
.related-card:hover .related-arrow { color: var(--accent-text); }
.related + .pager { margin-top: 28px; }

.help-strip { justify-content: flex-start; background: var(--card-grad), var(--panel); box-shadow: var(--hi); }
.help-strip-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--muted); }
.help-strip-icon svg { width: 16px; height: 16px; }
.help-strip-text { flex: 1; }
.help-strip-text strong { color: var(--text-strong); font-weight: 600; margin-right: 4px; }
.pager a { background: var(--card-grad), var(--panel); box-shadow: var(--hi); }
.pager a:hover { border-color: var(--accent-line); }

/* Right rail */
.toc-related { margin-top: 26px; }
.toc-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc-related a { padding: 3px 0; border: 0; margin: 0; color: var(--muted); }
.toc-related a:hover { color: var(--text-strong); }
.toc-card {
  display: grid;
  gap: 4px;
  margin-top: 24px;
  padding: 14px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(120% 100% at 100% 0%, var(--accent-soft), transparent 60%), var(--panel);
  box-shadow: var(--hi);
}
.toc-card-title { font-size: 13.5px; font-weight: 620; color: var(--text-strong); }
.toc-card-text { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.toc .toc-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  margin: 8px 0 0;
  padding: 5px 11px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 600;
}
.toc .toc-card-btn:hover { color: var(--text-strong); border-color: var(--accent); }
.toc-card-btn svg { width: 13px; height: 13px; }
.toc-extra { border-top: 0; padding-top: 0; margin-top: 18px; }

/* ── Home ─────────────────────────────────────────────────────── */
.page-home .main { padding-top: 56px; }
.page-home .article { max-width: 1040px; }
.hero { position: relative; }
.hero-copy { max-width: 760px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 30px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  box-shadow: var(--hi);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}
.hero-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hero-eyebrow-sep { width: 1px; height: 12px; background: var(--line-strong); }
.prose .hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.03;
  letter-spacing: -0.042em;
  font-weight: 700;
  color: var(--text-strong);
  text-wrap: balance;
}
.hero-h1-soft {
  display: block;
  background: linear-gradient(92deg, var(--accent-text) 0%, var(--muted) 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prose .hero .lede { font-size: 19px; max-width: 620px; margin: 0 0 30px; }
.hero-search { max-width: 520px; height: 50px; background: color-mix(in srgb, var(--panel-raised) 90%, transparent); box-shadow: var(--shadow), var(--hi); }
.hero-popular { margin-top: 16px; align-items: center; }
.prose .hero-popular a:not(.card):not(.anchor):not(.btn) {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
}
.prose .hero-popular a:not(.card):not(.anchor):not(.btn):hover { border-color: var(--line-strong); }

.hero-stage { position: relative; margin: 64px 0 0; padding: 0 64px 72px; isolation: isolate; }
.stage-glow {
  position: absolute;
  inset: 8% 6% 10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--stage-glow), transparent);
  filter: blur(30px);
}
.stage-window, .stage-float { margin: 0; }
.stage-window {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-sunken);
  box-shadow: var(--frame-shadow), var(--hi);
}
.window-bar {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.window-url {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-sunken);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--faint);
}
.stage-window img { width: 100%; }
.stage-float {
  position: absolute;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel-raised);
  box-shadow: var(--frame-shadow), 0 40px 80px -30px rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .stage-float { box-shadow: var(--frame-shadow), 0 40px 80px -30px rgba(48, 32, 120, 0.3); }
.stage-float img { width: 100%; }
.stage-float figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.3;
  color: var(--text-strong);
}
.stage-quote { left: 0; bottom: 0; width: 23%; }
.stage-invoice { right: 0; bottom: 28px; width: 31%; }
.hero-note { position: absolute; right: 0; bottom: -2px; margin: 0; font-size: 12px; color: var(--faint); }

.prose .facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 56px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.prose .facts li {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 20px 20px 20px 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.prose .facts li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.prose .facts strong { display: block; margin-bottom: 2px; font-size: 14.5px; font-weight: 620; color: var(--text-strong); }
.fact-icon { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--accent-text); box-shadow: var(--hi); }
.fact-icon svg { width: 15px; height: 15px; }

.section-title { margin: 72px 0 6px; align-items: flex-end; }
.section-kicker { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-text); }
.prose .section-title h2 { margin: 0; padding: 0; border: 0; font-size: 26px; letter-spacing: -0.025em; }

.prose .journey {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
}
.prose .journey li { margin: 0; padding: 0; }
.prose .journey li > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px 8px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-grad), var(--panel);
  box-shadow: var(--shadow), var(--hi);
  color: var(--text);
  transition: border-color 0.15s ease;
}
.prose .journey li > a:hover { border-color: var(--accent-line); }
.j-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-sunken); }
.j-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.j-meta { display: flex; align-items: center; gap: 10px; margin: 18px 10px 0; }
.j-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, var(--panel-raised)), color-mix(in srgb, var(--accent) 14%, var(--panel-raised)));
  font-size: 12px;
  font-weight: 650;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
/* the connector runs past the card edge into the next card */
.j-line { flex: 1; height: 1px; margin-right: -35px; background: linear-gradient(90deg, var(--accent-line), color-mix(in srgb, var(--accent) 25%, transparent)); position: relative; z-index: 1; }
.journey li:last-child .j-line { margin-right: 0; background: linear-gradient(90deg, var(--accent-line), transparent); }
.j-title { display: block; margin: 14px 10px 4px; font-size: 15.5px; font-weight: 630; color: var(--text-strong); line-height: 1.35; }
.j-text { display: block; margin: 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.j-cta { display: inline-flex; align-items: center; gap: 6px; margin: auto 10px 0; padding-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.j-cta svg { width: 13px; height: 13px; }

.topic-grid { gap: 16px; margin-top: 24px; }
.topic {
  position: relative;
  padding: 20px 20px 12px;
  border-radius: 14px;
  background: var(--card-grad), var(--panel);
  box-shadow: var(--shadow), var(--hi);
  overflow: hidden;
}
.topic::before {
  content: "";
  position: absolute;
  inset: 0 20% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
.topic-head { justify-content: space-between; margin-bottom: 16px; }
.topic-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
  color: var(--accent-text);
  box-shadow: var(--hi);
}
.topic-icon svg { width: 18px; height: 18px; }
.topic-count { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-sunken); font-size: 12px; font-weight: 550; color: var(--faint); }
.prose .topic h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 640; letter-spacing: -0.01em; color: var(--text-strong); }
.prose .topic-text { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.prose .topic ul { padding: 0; margin: 0; }
.prose .topic li { margin: 0; padding: 0; }
.topic li a { padding: 7px 0; }

.home-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: radial-gradient(60% 160% at 100% 0%, var(--accent-soft), transparent 60%), var(--panel);
  box-shadow: var(--hi);
}
.home-help > div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--muted); }
.home-help strong { font-size: 15.5px; font-weight: 620; color: var(--text-strong); }
.prose .home-help-btn:not(.card):not(.anchor):not(.btn) {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel-raised);
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.prose .home-help-btn:not(.card):not(.anchor):not(.btn):hover { border-color: var(--accent-line); color: var(--text-strong); }
.home-help-btn svg { width: 15px; height: 15px; }

@media (max-width: 1100px) {
  .hero-stage { padding: 0 32px 64px; }
}
@media (max-width: 960px) {
  .prose .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journey li:nth-child(2n) .j-line { margin-right: 0; background: linear-gradient(90deg, var(--accent-line), transparent); }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-home .main { padding-top: 36px; }
}
@media (max-width: 620px) {
  .btn-app-long { display: none; }
  .btn-app-short { display: inline; }
  .topbar-links .btn-app svg { display: none; }
  .prose .hero h1 { font-size: 36px; }
  .prose .hero .lede { font-size: 16.5px; }
  .hero-stage { margin-top: 40px; padding: 0 0 0; }
  .stage-float { display: none; }
  .window-url { display: none; }
  .hero-note { position: static; margin-top: 10px; }
  .prose .facts { grid-template-columns: 1fr; }
  .prose .facts li { padding: 16px 0; }
  .prose .facts li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .section-title { margin-top: 56px; }
  .prose .journey { grid-template-columns: 1fr; }
  .j-line { margin-right: 0 !important; background: linear-gradient(90deg, var(--accent-line), transparent) !important; }
  .topic-grid { grid-template-columns: 1fr; }
  .home-help { flex-direction: column; align-items: flex-start; }
  .related-grid { grid-template-columns: 1fr; }
  .figure-frame { padding: 6px; border-radius: 12px; }
  .figure-frame img { border-radius: 7px; }

  /* Stacked tables: each row becomes a labelled card, no sideways scroll */
  .table-wrap.stack { border: 0; background: none; box-shadow: none; overflow: visible; }
  .table-wrap.stack table, .table-wrap.stack tbody, .table-wrap.stack tr, .table-wrap.stack td { display: block; width: 100%; }
  .table-wrap.stack thead { display: none; }
  .table-wrap.stack tr {
    margin: 0 0 10px;
    padding: 6px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
  }
  .table-wrap.stack td { padding: 6px 14px; border: 0; text-align: left !important; }
  .table-wrap.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .table-wrap.stack td:first-child { padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
  .table-wrap.stack td:first-child::before { display: none; }
  .table-wrap.stack tbody tr:hover td { background: none; }
  .table-wrap.stack code { white-space: normal; word-break: break-word; }

  /* Compact matrices (yes/no grids) fit the width */
  .table-wrap.matrix table { table-layout: fixed; font-size: 13px; }
  .table-wrap.matrix th { white-space: normal; font-size: 10.5px; letter-spacing: 0.02em; padding: 9px 4px; }
  .table-wrap.matrix td { padding: 9px 4px; }
  .table-wrap.matrix td:first-child, .table-wrap.matrix th:first-child { width: 38%; padding-left: 12px; }
}

/* topic lists */
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .topic-grid { grid-template-columns: 1fr; } }
.topic { border: 1px solid var(--line); }
.topic-head { display: flex; align-items: center; gap: 10px; }
.topic ul { list-style: none; }
.topic li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--muted);
}
.topic li:first-child a { border-top: 0; }
.topic li a svg { width: 13px; height: 13px; color: var(--faint); flex-shrink: 0; }
.topic li a:hover svg { color: var(--accent-text); }
@media (max-width: 960px) {
  .search-trigger { min-width: 0; width: auto; }
  .topbar-links { flex-shrink: 0; }
}
@media (max-width: 620px) {
  .section-title { align-items: flex-start; }
  .topbar-inner { gap: 8px; padding: 0 12px; }
  .topbar-links { gap: 2px; }
}
@media (max-width: 400px) {
  .brand-name { display: none; }
}
@media (max-width: 420px) {
  .search-trigger { flex: 0 0 38px; width: 38px; padding: 0; justify-content: center; margin-left: auto; }
  .search-trigger span { display: none; }
}

.toc-related ul { border-left: 1px solid var(--line); }
.toc .toc-related a { padding: 4px 0 4px 13px; margin-left: -1px; border-left: 1px solid transparent; }
.toc .toc-related a:hover { border-left-color: var(--line-strong); }
.toc-extra > * { margin: 0; padding: 0; }
