/* GitHub + Vercel 배포 매뉴얼 — 장별 문서 페이지 스타일
   색상·글꼴 토큰은 www/index.html 과 동일하게 유지합니다. */

:root {
  --bg: #f4f8fd;
  --bg-soft: #eaf2fb;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --border: #d9e6f5;
  --border-strong: #bcd5ef;
  --text: #0f2540;
  --text-muted: #546b86;
  --text-faint: #8197b0;
  --blue-50: #f0f7ff;
  --blue-100: #dcecfd;
  --blue-200: #bfdcf9;
  --blue-300: #93c3f2;
  --blue-400: #6aa9e8;
  --blue-500: #4a8fd6;
  --blue-600: #3574b8;
  --accent: var(--blue-500);
  --accent-strong: var(--blue-600);
  --accent-soft: var(--blue-100);
  --on-accent: #ffffff;
  --ok: #2f9e74;
  --preview: #c4891f;
  --code-bg: #0e1f36;
  --code-text: #dbe9fa;
  --code-comment: #7d97b8;
  --glow: rgba(106, 169, 232, .30);
  --shadow-sm: 0 1px 2px rgba(15, 37, 64, .05);
  --shadow: 0 1px 2px rgba(15, 37, 64, .04), 0 12px 32px -12px rgba(30, 80, 140, .18);
  --shadow-lg: 0 30px 60px -20px rgba(30, 80, 140, .28), 0 8px 20px -8px rgba(30, 80, 140, .12);

  --tone-note: #4a8fd6;
  --tone-tip: #23917f;
  --tone-important: #6457c9;
  --tone-warning: #b97c14;
  --tone-caution: #c8453f;

  --radius: 18px;
  --max: 1120px;
  --max-wide: 1320px;
  --serif: "Noto Serif KR", "Nanum Myeongjo", Georgia, serif;
  --sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --header-h: 68px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081322;
    --bg-soft: #0c1a2e;
    --surface: rgba(16, 33, 56, .72);
    --surface-solid: #10213a;
    --border: #1c3352;
    --border-strong: #2a4a72;
    --text: #e8f1fc;
    --text-muted: #9fb6d1;
    --text-faint: #6f88a6;
    --blue-50: #0e1e34;
    --accent: #8cc4f5;
    --accent-strong: #b3d8fa;
    --accent-soft: #12304f;
    --on-accent: #081322;
    --ok: #5fd3a5;
    --preview: #f0bd5a;
    --code-bg: #050d18;
    --glow: rgba(140, 196, 245, .14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 8px 20px -8px rgba(0, 0, 0, .4);
    --tone-note: #8cc4f5;
    --tone-tip: #5cd1bb;
    --tone-important: #a99cff;
    --tone-warning: #f0bd5a;
    --tone-caution: #ff8a84;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 18% -180px, var(--glow), transparent 70%),
    radial-gradient(900px 420px at 92% -160px, color-mix(in srgb, var(--blue-200) 30%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: var(--max-wide); }

/* ---------- Reading progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; pointer-events: none; }
.progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue-300), var(--blue-500));
  box-shadow: 0 0 10px var(--glow);
}

/* ---------- Header (index.html 과 동일) ---------- */
header.site {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue-200), var(--blue-500));
  box-shadow: 0 4px 12px -4px var(--glow);
}
.brand-mark svg { width: 14px; height: 14px; }
nav.links { display: flex; align-items: center; gap: 28px; font-size: 14.5px; }
nav.links a { text-decoration: none; color: var(--text-muted); transition: color .15s; }
nav.links a:hover { color: var(--text); }
nav.links a.pill {
  padding: 8px 16px; border-radius: 999px; color: var(--text);
  border: 1px solid var(--border-strong); background: var(--surface);
}
nav.links a.pill:hover { border-color: var(--accent); }

/* ---------- Layout ---------- */
.doc-shell {
  max-width: var(--max-wide); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 236px minmax(0, 1fr) 208px; gap: 56px;
}
.doc { min-width: 0; max-width: 780px; width: 100%; justify-self: center; padding-bottom: 40px; }

/* Sidebar */
.sidebar {
  position: sticky; top: calc(var(--header-h) + 28px); align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto;
  padding: 28px 4px 24px 0; scrollbar-width: thin;
}
.side-group + .side-group { margin-top: 22px; }
.side-label {
  padding: 0 12px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint);
}
.sidebar ul, .mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar a, .mobile-nav a {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 12px; border-radius: 10px;
  text-decoration: none; font-size: 14px; color: var(--text-muted); line-height: 1.45;
  transition: background .15s, color .15s;
}
.sidebar a:hover, .mobile-nav a:hover { background: var(--bg-soft); color: var(--text); }
.sidebar a .n, .mobile-nav a .n { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.sidebar a.active, .mobile-nav a.active {
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar a.active .n, .mobile-nav a.active .n { color: var(--accent-strong); }

/* Mobile chapter nav */
.mobile-nav { display: none; margin: 20px 0 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.mobile-nav summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; font-size: 14px;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary span { color: var(--text-faint); font-size: 12px; letter-spacing: .08em; }
.mobile-nav summary b { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-nav summary::after { content: "▾"; color: var(--text-faint); transition: transform .2s; }
.mobile-nav[open] summary::after { transform: rotate(180deg); }
.mobile-nav[open] summary { border-bottom: 1px solid var(--border); }
.mobile-nav .side-group { padding: 10px 6px; }
.mobile-nav .side-group + .side-group { margin-top: 0; border-top: 1px dashed var(--border); }

/* Right TOC */
.toc { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; padding-top: 28px; }
.toc-inner { max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto; scrollbar-width: thin; }
.toc-title { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a {
  display: block; margin-left: -1px; padding: 6px 0 6px 16px; border-left: 2px solid transparent;
  font-size: 13.5px; line-height: 1.45; color: var(--text-muted); text-decoration: none; transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 500; }

/* ---------- Doc hero ---------- */
.doc-hero { padding: 52px 0 36px; margin-bottom: 44px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--text-faint); margin-bottom: 22px; }
.crumbs a { text-decoration: none; color: var(--text-muted); }
.crumbs a:hover { color: var(--accent-strong); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-strong);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.doc-hero h1 {
  margin: 14px 0 20px; font-family: var(--serif); font-weight: 600;
  font-size: clamp(32px, 4.4vw, 46px); line-height: 1.25; letter-spacing: -.025em;
}
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-meta span {
  padding: 4px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
}

/* ---------- Prose ---------- */
.prose { font-size: 16.5px; line-height: 1.85; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  position: relative; margin: 72px 0 20px; font-family: var(--serif); font-weight: 600;
  font-size: clamp(24px, 2.8vw, 30px); line-height: 1.35; letter-spacing: -.02em;
}
.prose h2::before {
  content: ""; display: block; width: 36px; height: 3px; border-radius: 3px; margin-bottom: 18px;
  background: linear-gradient(90deg, var(--blue-300), var(--blue-500));
}
.prose h3 { margin: 44px 0 14px; font-size: 19.5px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }
.prose h4 { margin: 32px 0 10px; font-size: 17px; font-weight: 600; }
.prose h2 .anchor, .prose h3 .anchor, .prose h4 .anchor {
  margin-left: 10px; color: var(--text-faint); text-decoration: none; font-family: var(--sans);
  font-weight: 400; opacity: 0; transition: opacity .15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose p { margin: 0 0 18px; }
.prose strong { font-weight: 600; color: var(--text); }
.prose a:not(.anchor) {
  color: var(--accent-strong); text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--blue-300); text-underline-offset: 3px; transition: text-decoration-color .15s;
}
.prose a:not(.anchor):hover { text-decoration-color: currentColor; }
.prose a.ext::after { content: "↗"; font-size: .78em; margin-left: 2px; text-decoration: none; display: inline-block; }
.prose code {
  font-family: var(--mono); font-size: .84em;
  background: var(--blue-50); color: var(--accent-strong); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 6px; white-space: nowrap;
}
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 1.5em; }
.prose li { margin: 8px 0; padding-left: 4px; }
.prose li::marker { color: var(--accent); font-weight: 600; }
.prose ol > li::marker { font-family: var(--serif); }
.prose li > ul, .prose li > ol { margin: 8px 0 4px; }
.prose li > p { margin: 0 0 10px; }
.prose li > .codeblock, .prose li > .alert { margin: 12px 0 14px; }
.prose hr {
  border: 0; height: 1px; margin: 64px 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.prose blockquote {
  margin: 0 0 20px; padding: 4px 0 4px 20px; border-left: 3px solid var(--border-strong); color: var(--text-muted);
}

/* Tables */
.table-wrap {
  margin: 6px 0 26px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-solid); box-shadow: var(--shadow-sm);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.65; }
.prose th {
  text-align: left; font-weight: 600; font-size: 13.5px; color: var(--text);
  padding: 12px 18px; background: var(--bg-soft); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.prose td { padding: 12px 18px; border-top: 1px solid var(--border); vertical-align: top; }
.prose tbody tr:first-child td { border-top: 0; }
.prose tbody tr:hover td { background: color-mix(in srgb, var(--blue-50) 60%, transparent); }
.prose td code { white-space: normal; }

/* Code blocks */
.codeblock {
  margin: 6px 0 26px; border-radius: 14px; overflow: hidden; background: var(--code-bg);
  border: 1px solid color-mix(in srgb, var(--blue-500) 25%, transparent); box-shadow: var(--shadow);
}
.codebar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px 7px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--code-comment);
}
.copy {
  padding: 4px 12px; border-radius: 8px; cursor: pointer;
  font: 600 12px var(--sans); color: var(--code-text);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  transition: background .15s;
}
.copy:hover { background: rgba(255, 255, 255, .14); }
.codeblock pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; color: var(--code-text);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.8; tab-size: 2;
}
.codeblock pre code { all: unset; white-space: pre; }
.codeblock .c { color: var(--code-comment); }

/* Alerts */
.alert {
  --tone: var(--tone-note);
  position: relative; margin: 6px 0 26px; padding: 16px 20px 16px 22px; border-radius: 14px; overflow: hidden;
  background: color-mix(in srgb, var(--tone) 7%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--tone) 26%, var(--border));
  font-size: 15.5px; line-height: 1.8;
}
.alert::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--tone); }
.alert-tip { --tone: var(--tone-tip); }
.alert-important { --tone: var(--tone-important); }
.alert-warning { --tone: var(--tone-warning); }
.alert-caution { --tone: var(--tone-caution); }
.alert-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 13.5px; font-weight: 600; letter-spacing: .02em; color: var(--tone);
}
.alert > :last-child { margin-bottom: 0; }
.alert p { margin: 0 0 10px; }
.alert .codeblock { margin: 12px 0 4px; box-shadow: none; }

/* Task lists */
.prose ul.tasks {
  list-style: none; padding: 6px 20px; margin: 6px 0 26px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.prose ul.tasks li { margin: 0; padding: 0; border-top: 1px dashed var(--border); }
.prose ul.tasks li:first-child { border-top: 0; }
.prose ul.tasks label { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; cursor: pointer; }
.prose ul.tasks input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 4px 0 0; width: 20px; height: 20px;
  border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface-solid);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.prose ul.tasks input:checked {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.prose ul.tasks input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prose ul.tasks input:checked + span { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.prose ul.tasks .codeblock { margin: 10px 0 4px; }
.task-count { margin: -14px 0 26px; font-size: 13px; color: var(--text-faint); text-align: right; }

/* Diagrams */
.diagram {
  margin: 8px 0 30px; padding: 30px 28px; border-radius: 18px;
  background: linear-gradient(180deg, var(--blue-50), var(--surface-solid));
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.dg-row { display: flex; align-items: center; }
.dg-node {
  flex: none; min-width: 112px; padding: 14px 16px; text-align: center; line-height: 1.4;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 12px;
  font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-sm);
}
.dg-node small { display: block; margin-top: 2px; font-weight: 400; font-size: 12.5px; color: var(--text-muted); }
.dg-compact .dg-node { min-width: 0; flex: 1 1 0; padding: 12px 8px; font-size: 13.5px; }
.dg-edge { flex: 1 1 auto; min-width: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 6px; }
.dg-compact .dg-edge { flex: 0 0 34px; min-width: 34px; padding: 0 4px; }
.dg-edge span { font-family: var(--mono); font-size: 11.5px; color: var(--accent-strong); white-space: nowrap; min-height: 1em; }
.dg-edge i { position: relative; display: block; width: 100%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--blue-200), var(--blue-400)); }
.dg-edge i::after {
  content: ""; position: absolute; right: -2px; top: 50%; transform: translateY(-50%);
  border-left: 7px solid var(--blue-400); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.dg-split { position: relative; margin: 22px 0 14px; text-align: center; }
.dg-split::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--border-strong); }
.dg-split span {
  position: relative; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--text-muted);
}
.dg-fork { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dg-out {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--border); line-height: 1.5;
}
.dg-out > i { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; }
.dg-out.prod > i { background: var(--ok); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 15%, transparent); }
.dg-out.prev > i { background: var(--preview); box-shadow: 0 0 0 5px color-mix(in srgb, var(--preview) 15%, transparent); }
.dg-out b { display: block; font-weight: 600; font-size: 14.5px; }
.dg-out small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

/* Draft-only markers (--draft 빌드에서만 생성) */
.verify {
  display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; vertical-align: 1px;
  font-size: 11px; font-weight: 600; line-height: 1.7; cursor: help;
  color: var(--tone-warning); background: color-mix(in srgb, var(--tone-warning) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--tone-warning) 50%, transparent);
}
.verify-note { font-size: 13.5px; color: var(--text-muted); }
.shot {
  display: flex; gap: 16px; align-items: center; margin: 10px 0 22px; padding: 16px 18px;
  border: 1.5px dashed var(--border-strong); border-radius: 14px; background: var(--bg-soft);
}
.shot-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-solid); color: var(--accent); }
.shot figcaption { display: flex; flex-direction: column; font-size: 13.5px; line-height: 1.5; }
.shot figcaption span { color: var(--text-muted); }
.shot figcaption code { align-self: flex-start; margin-top: 4px; font-size: 11.5px; }

/* ---------- Pager ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--border); }
.pager-link {
  display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; border-radius: 16px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.pager-link:hover { border-color: var(--blue-300); transform: translateY(-2px); box-shadow: var(--shadow); }
.pager-link small { font-size: 12.5px; color: var(--text-faint); }
.pager-link b { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.45; }
.pager-link.next { text-align: right; grid-column: 2; }

/* ---------- Footer ---------- */
footer { margin-top: 40px; padding: 56px 0 64px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
footer .f-brand { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--text); }
footer .f-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
footer ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
footer a { text-decoration: none; color: var(--text-muted); border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
footer a:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .doc-shell { grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
  .toc { display: none; }
}
@media (max-width: 880px) {
  .doc-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .doc { max-width: none; }
  .doc-hero { padding-top: 32px; }
}
@media (max-width: 720px) {
  .wrap, .doc-shell { padding: 0 16px; }
  nav.links a:not(.pill) { display: none; }
  .prose { font-size: 16px; }
  .prose h2 { margin-top: 56px; }
  .prose th, .prose td { padding: 10px 14px; }
  .prose code { white-space: normal; }
  .codeblock pre { font-size: 12.5px; padding: 16px; }
  .diagram { padding: 22px 16px; }
  .dg-row, .dg-compact { flex-direction: column; align-items: stretch; }
  .dg-node, .dg-compact .dg-node { min-width: 0; flex: none; }
  .dg-edge, .dg-compact .dg-edge { flex: none; flex-direction: row; justify-content: center; min-height: 34px; padding: 4px 0; gap: 10px; }
  .dg-edge i { order: -1; width: 2px; height: 26px; background: linear-gradient(180deg, var(--blue-200), var(--blue-400)); }
  .dg-edge i::after { right: auto; left: 50%; top: auto; bottom: -2px; transform: translateX(-50%); border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--blue-400); border-bottom: 0; }
  .dg-edge span:empty { display: none; }
  .dg-fork, .pager { grid-template-columns: 1fr; }
  .pager-link.next { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pager-link, .toc a, .sidebar a { transition: none; }
}
@media print {
  header.site, .sidebar, .toc, .mobile-nav, .pager, .progress, .copy, footer { display: none !important; }
  .doc-shell { display: block; }
  body { background: #fff; }
}
