/* Shared tokens, layout chrome and document typography for every page. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceff3;
  --border: rgba(15, 22, 35, .09);
  --border-strong: rgba(15, 22, 35, .16);
  --text: #0f1623;
  --muted: #4a5465;
  --faint: #677184;
  --accent: #2450c2;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefb;
  --ok: #11775a;
  --ok-soft: #e3f3ed;
  --warn: #9a5b00;
  --warn-soft: #fbf0dc;
  --risk: #c0283a;
  --risk-soft: #fce6e8;
  --info: #55657e;
  --info-soft: #edf0f5;
  --shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(15, 22, 35, .05), 0 8px 24px -16px rgba(15, 22, 35, .14);
  --radius: 14px;
  --radius-sm: 8px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --display: var(--font);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f14; --surface: #131820; --surface-2: #171d26; --surface-3: #202733;
    --border: rgba(200, 215, 240, .09); --border-strong: rgba(200, 215, 240, .16); --text: #e6eaf0; --muted: #a0aabb; --faint: #7e889a;
    --accent: #7aa2ff; --accent-ink: #0c0f14; --accent-soft: #18233d;
    --ok: #45c79a; --ok-soft: #0f2a22; --warn: #f0b44c; --warn-soft: #2e230f; --risk: #ff6f7d; --risk-soft: #36161b; --info: #9aa8c0; --info-soft: #1a2030;
    --shadow: 0 0 0 1px var(--border), 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f14; --surface: #131820; --surface-2: #171d26; --surface-3: #202733;
  --border: rgba(200, 215, 240, .09); --border-strong: rgba(200, 215, 240, .16); --text: #e6eaf0; --muted: #a0aabb; --faint: #7e889a;
  --accent: #7aa2ff; --accent-ink: #0c0f14; --accent-soft: #18233d;
  --ok: #45c79a; --ok-soft: #0f2a22; --warn: #f0b44c; --warn-soft: #2e230f; --risk: #ff6f7d; --risk-soft: #36161b; --info: #9aa8c0; --info-soft: #1a2030;
  --shadow: 0 0 0 1px var(--border), 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: absolute; inset: 0 0 auto; height: 560px; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(to bottom, #000, transparent); mask-image: linear-gradient(to bottom, #000, transparent); opacity: .7; }
h1, h2 { font-family: var(--display); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code, kbd { font-family: var(--mono); font-size: .9em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { display: none; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--text); color: var(--bg); }
.brand-mark svg { width: 17px; height: 17px; stroke-width: 2.4; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); font-weight: 550; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong), 0 1px 2px rgba(15, 22, 35, .05); color: var(--text); font-size: 14px; font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 1px 2px rgba(15, 22, 35, .2); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-light { background: var(--bg); color: var(--text); box-shadow: none; }
.btn-light:hover { background: color-mix(in srgb, var(--bg) 88%, var(--text)); }

/* Footer */
.site-footer { margin-top: 72px; border-top: 1px solid var(--border); color: var(--faint); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; padding-bottom: 32px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* Documents rendered from Markdown (research, coverage, validation, 404). */
.document { max-width: 780px; padding-top: 40px; }
.document h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 700; margin: 14px 0 22px; letter-spacing: -.025em; }
.document h2 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; margin: 48px 0 14px; padding-top: 20px; border-top: 1px solid var(--border); }
.document h3 { font-size: 17px; margin: 28px 0 10px; }
.document p, .document li { color: var(--muted); }
.document p { margin: 12px 0; }
.document strong { color: var(--text); }
.document a { color: var(--accent); text-underline-offset: 3px; }
.document ul, .document ol { padding-left: 22px; }
.document li { margin: 6px 0; }
.document code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--text); }
.document img { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.table-scroll { overflow-x: auto; margin: 18px 0; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-scroll th, .table-scroll td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table-scroll th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll td { color: var(--muted); }
.code-block { margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--border); font: 600 11px/1 var(--mono); letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
.code-toolbar button { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 4px 10px; font: 500 12px var(--font); cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--muted); }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); }
.code-block code { background: none; border: 0; padding: 0; }
.checkpoint { display: flex; gap: 12px; margin: 18px 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--text); }
.checkpoint > span { color: var(--ok); font-weight: 700; }
.checkpoint p { margin: 0; color: var(--text); }
.breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--faint); }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.related-pages { margin-top: 56px; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.related-pages h2 { margin: 0 0 10px; font-size: 17px; border: 0; padding: 0; }
.related-pages ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.related-pages a { color: var(--accent); text-decoration: none; font-size: 14px; }
.eyebrow { font: 500 12px var(--mono); letter-spacing: .02em; color: var(--muted); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .header-inner { gap: 12px; }
  .brand > span:last-child { display: none; }
  .site-nav a { padding: 6px 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
