/* ============================================================
   Guide Book — design system styles
   Korean body: Pretendard · Cover serif: Noto Serif KR (명조)
   ============================================================ */

/* ─── Reset ───────────────────────────────────────────────── */
/* box-sizing이 없으면 padding이 width에 더해져 .bk-merged 등이 뷰포트보다
   넓어지고 좁은 화면(폴드)에서 오른쪽이 잘린다. border-box로 통일. */
*, *::before, *::after { box-sizing: border-box; }

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --paper: #fbfbfd;
  --paper-warm: #faf8f3;          /* book pages, chapter cover */
  --ink: #1a1a1f;
  --ink-soft: #2c2c33;
  --ink-mute: #6b6b73;
  --ink-faint: #a1a1a8;
  --rule: #e8e8ec;
  --rule-strong: #d4d4d8;
  --card: #f4f5f7;
  --card-hover: #ecedf0;

  /* Accent — minimalist grayscale + warm highlight (option 0) */
  --hl: #fff3a8;                  /* highlighter yellow */
  --hl-strong: #ffd84a;
  --accent: #1d1d1f;              /* link/strong accent — black-ish */
  --accent-soft: #3b3b40;

  /* Semantic callouts */
  --c-note: #4a6fa5;
  --c-warn: #b78a3c;
  --c-tip:  #4a7c59;
  --c-note-bg: #f0f4fa;
  --c-warn-bg: #fbf6ec;
  --c-tip-bg:  #f0f6f2;

  --font-sans: 'Pretendard', 'Pretendard Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif;
  --font-serif: 'Noto Serif KR', 'Nanum Myeongjo', 'Apple SD Gothic Neo', serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'D2Coding', 'Consolas', monospace;
}

/* Dark mode token overrides (applied via [data-bk-dark]) */
[data-bk-dark="true"] {
  --paper: #15161a;
  --paper-warm: #1a1b1f;
  --ink: #e8e8ec;
  --ink-soft: #c7c7cd;
  --ink-mute: #8a8a92;
  --ink-faint: #5a5a62;
  --rule: #2a2b30;
  --rule-strong: #3a3b42;
  --card: #1f2025;
  --card-hover: #25262b;
  --hl: #5a4a18;
  --accent: #f0f0f4;
  --accent-soft: #c7c7cd;
  --c-note-bg: #1f2a3d;
  --c-warn-bg: #2d2618;
  --c-tip-bg:  #1c2823;
}

/* ─── Highlight (==hl==) variants — Tweakable ─────────────── */
.hl {
  background: transparent;
  color: inherit;
  padding: 0 .1em;
  border-radius: 2px;
}
/* Real-marker: warm yellow band, slightly tilted look */
.hl.hl-marker {
  background: linear-gradient(180deg, transparent 0%, transparent 28%, var(--hl) 28%, var(--hl) 92%, transparent 92%);
  padding: 0 .12em;
}
/* Underline: thick warm rule below the text */
.hl.hl-underline {
  background: transparent;
  border-bottom: 3px solid var(--hl-strong);
  padding-bottom: 1px;
}
/* Fill: solid soft yellow block */
.hl.hl-fill {
  background: var(--hl);
  padding: .05em .25em;
  border-radius: 3px;
}

/* ============================================================
   LANDING (multi-doc) view
   ============================================================ */
.lan {
  width: 100%; height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.lan-bar {
  display: flex; align-items: center;
  padding: 18px 36px;
  border-bottom: 1px solid var(--rule);
  gap: 36px;
  flex: none;
}
.lan-brand { display: flex; align-items: center; gap: 10px; }
.lan-brand-mark {
  width: 28px; height: 28px;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; letter-spacing: .02em;
  border-radius: 6px;
}
.lan-brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: -.005em; white-space: nowrap; }
.lan-nav { display: flex; gap: 22px; }
.lan-nav a { font-size: 13.5px; color: var(--ink-mute); cursor: pointer; white-space: nowrap; }
.lan-nav a.cur { color: var(--ink); font-weight: 600; }
.lan-tools { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.lan-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: var(--card);
  border-radius: 8px; min-width: 260px;
  font-size: 13px; color: var(--ink-mute);
  white-space: nowrap;
}
.lan-search kbd {
  margin-left: auto; font-family: var(--font-sans);
  font-size: 11px; padding: 1px 6px;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 4px;
}
.lan-add {
  padding: 8px 14px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  border-radius: 8px; font-size: 13px; font-weight: 600;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.lan-hero { padding: 64px 60px 36px; flex: none; }
.lan-hero-eyebrow {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 600;
}
.lan-hero-h1 {
  font-family: var(--font-serif);
  font-size: 56px; line-height: 1.18;
  font-weight: 700; letter-spacing: -.015em;
  color: var(--ink); margin-top: 14px; text-wrap: pretty;
}
.lan-hero-h1 .hl { font-family: inherit; }
.lan-hero-p {
  max-width: 620px;
  margin-top: 18px; font-size: 16px; line-height: 1.75;
  color: var(--ink-mute);
}
.lan-hero-stats {
  display: flex; gap: 56px; margin-top: 36px;
  padding-top: 30px; border-top: 1px solid var(--rule);
}
.lan-hero-stats > div { display: flex; flex-direction: column; gap: 4px; }
.lan-hero-stats b {
  font-family: var(--font-serif);
  font-size: 36px; font-weight: 700; color: var(--ink);
  letter-spacing: -.01em;
}
.lan-hero-stats span {
  font-size: 12px; color: var(--ink-mute);
  letter-spacing: .04em;
  white-space: nowrap;
}

.lan-shelf { padding: 24px 60px 60px; flex: 1; overflow: auto; }
.lan-shelf-head {
  display: flex; align-items: baseline; gap: 32px;
  margin-bottom: 24px;
}
.lan-shelf-head h2 {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 700; color: var(--ink);
  letter-spacing: -.005em;
}
.lan-shelf-filter { display: flex; gap: 18px; }
.lan-shelf-filter span {
  font-size: 13px; color: var(--ink-mute); cursor: pointer;
  white-space: nowrap;
}
.lan-shelf-filter .cur {
  color: var(--ink); font-weight: 600;
  border-bottom: 2px solid var(--ink); padding-bottom: 2px;
}

.lan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.lan-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.lan-card:hover {
  border-color: var(--rule-strong);
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.lan-card.stub { opacity: .65; }
.lan-card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex; flex-direction: column;
  padding: 22px;
  color: var(--ink);
}
.lan-card-vendor { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.lan-card-version {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 13px; font-weight: 700;
}
.lan-card-mark {
  position: absolute; right: 22px; bottom: 22px;
  font-family: var(--font-serif);
  font-size: 64px; line-height: 1; color: var(--ink); opacity: .25;
}
.lan-card-stub {
  position: absolute; top: 18px; right: 18px;
  background: rgba(0,0,0,.08);
  padding: 3px 8px; border-radius: 4px;
  font-size: 10.5px; letter-spacing: .04em;
}
.lan-card-body { padding: 16px 18px 20px; }
.lan-card-title {
  font-weight: 700; font-size: 15px; color: var(--ink);
  letter-spacing: -.005em;
}
.lan-card-sub {
  font-size: 12.5px; color: var(--ink-mute);
  margin-top: 4px; line-height: 1.5;
}
.lan-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-size: 11.5px; color: var(--ink-mute);
}
.lan-card-progress { display: flex; align-items: center; gap: 8px; }
.lan-card-progress-bar {
  width: 60px; height: 4px; background: var(--card);
  border-radius: 2px; overflow: hidden;
}
.lan-card-progress-bar > span { display: block; height: 100%; background: var(--ink); }

.lan-foot {
  flex: none;
  padding: 16px 60px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--ink-faint);
}

/* ============================================================
   GUIDE TOC — opening spread for one guide
   ============================================================ */
.gtoc {
  width: 100%; height: 100%;
  display: grid; grid-template-columns: 1fr 1.3fr;
  background: var(--paper);
  font-family: var(--font-sans); color: var(--ink);
  overflow: hidden;
}
.gtoc-cover {
  background: var(--paper-warm);
  padding: 80px 60px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
  border-right: 1px solid var(--rule);
}
.gtoc-cover::after {
  content: ''; position: absolute; inset: 24px;
  border: 1px solid var(--rule-strong); pointer-events: none;
}
.gtoc-cover-vendor {
  font-size: 12px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase; font-weight: 600;
  z-index: 1; position: relative;
}
.gtoc-cover-mark {
  font-family: var(--font-serif);
  font-size: 140px; line-height: 1;
  color: var(--hl-strong);
  margin: 20px 0 12px; z-index: 1; position: relative;
}
.gtoc-cover-title {
  font-family: var(--font-serif);
  font-size: 48px; line-height: 1.2; font-weight: 700;
  color: var(--ink); letter-spacing: -.015em;
  z-index: 1; position: relative;
}
.gtoc-cover-sub {
  font-size: 16px; color: var(--ink-mute);
  margin-top: 4px; z-index: 1; position: relative;
}
.gtoc-cover-meta {
  margin-top: auto; z-index: 1; position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding-top: 28px; border-top: 1px solid var(--rule);
}
.gtoc-cover-meta > div { display: flex; gap: 16px; font-size: 13px; }
.gtoc-cover-meta dt {
  width: 70px;
  font-size: 11px; color: var(--ink-faint);
  letter-spacing: .08em; text-transform: uppercase;
  padding-top: 1px;
}
.gtoc-cover-meta dd { color: var(--ink); font-weight: 500; }
.gtoc-cover-cta { display: flex; gap: 10px; z-index: 1; position: relative; margin-top: 8px; }

.bk-btn {
  padding: 10px 18px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  border-radius: 7px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.bk-btn:hover { background: var(--card); }
.bk-btn.primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

.gtoc-toc { padding: 80px 60px; overflow-y: auto; }
.gtoc-toc-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 16px; border-bottom: 2px solid var(--ink);
  margin-bottom: 24px;
}
.gtoc-toc-head > span:first-child {
  font-family: var(--font-serif);
  font-size: 24px; font-weight: 700; color: var(--ink);
}
.gtoc-toc-head-r {
  font-size: 12px; letter-spacing: .12em; color: var(--ink-mute);
  text-transform: uppercase;
}

.gtoc-part { margin-bottom: 28px; }
.gtoc-part-h {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 8px;
}
.gtoc-part-name {
  font-family: var(--font-serif);
  font-size: 15.5px; font-weight: 700; color: var(--ink);
  letter-spacing: -.005em;
}
.gtoc-part-desc {
  font-size: 12px; color: var(--ink-mute);
}
.gtoc-part-list { list-style: none; padding: 0; margin: 0; }
.gtoc-row {
  position: relative;   /* 행 안의 절대배치 <a> 오버레이가 이 행 영역에만 깔리도록
                           (없으면 링크가 뷰포트 전체를 덮어 마지막 챕터가 모든 탭을 가로챔) */
  display: grid;
  grid-template-columns: 30px 1fr auto auto auto;
  align-items: baseline; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.gtoc-row.todo { color: var(--ink-faint); }
.gtoc-row.cur { background: linear-gradient(90deg, var(--hl) 0%, transparent 60%); padding-left: 8px; margin-left: -8px; }
.gtoc-row.cur .gtoc-row-ko { font-weight: 700; }

/* ── 호버 애니메이션 — 형광펜 스윕 + 살짝 슬라이드 + 번호·점선 강조 ── */
.gtoc-row { transition: background .2s ease, padding-left .2s ease, margin-left .2s ease; }
.gtoc-row-n, .gtoc-row-ko, .gtoc-row-en, .gtoc-row-p, .gtoc-row-dot {
  transition: color .2s ease, transform .2s ease, border-color .2s ease;
}
.gtoc-row:hover {
  background: linear-gradient(90deg, var(--hl) 0%, transparent 72%);
  padding-left: 12px; margin-left: -12px;
  border-radius: 6px;
}
.gtoc-row:hover .gtoc-row-n { color: var(--ink); font-weight: 700; }
.gtoc-row:hover .gtoc-row-ko { color: var(--ink); transform: translateX(2px); }
.gtoc-row:hover .gtoc-row-en { color: var(--ink-soft); transform: translateX(2px); }
.gtoc-row:hover .gtoc-row-dot { border-bottom-color: var(--ink); }
.gtoc-row:hover .gtoc-row-p { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .gtoc-row, .gtoc-row * { transition: none; }
}
.gtoc-row-n {
  font-family: var(--font-mono);
  font-size: 11.5px; color: var(--ink-faint);
  letter-spacing: .04em; padding-top: 3px;
}
.gtoc-row-t { display: flex; flex-direction: column; gap: 2px; }
.gtoc-row-ko { font-size: 14.5px; color: var(--ink); font-weight: 500; }
.gtoc-row-en {
  font-family: var(--font-serif);
  font-style: italic; font-size: 12px; color: var(--ink-mute);
}
.gtoc-row-dot {
  display: block; height: 1px; min-width: 16px;
  border-bottom: 1px dotted var(--ink-faint);
  align-self: center; flex: 1; transform: translateY(2px);
}
.gtoc-row-p {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--ink-mute);
}
.gtoc-row-todo {
  font-size: 10.5px; padding: 2px 6px;
  background: var(--card); color: var(--ink-mute);
  border-radius: 3px; letter-spacing: .04em;
}

/* ============================================================
   CHAPTER COVER — full-bleed paper page
   ============================================================ */
.bk-cover {
  width: 100%; height: 100%;
  background: var(--paper-warm);
  color: var(--ink);
  font-family: var(--font-sans);
  padding: 80px 96px;
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.bk-cover.dark { background: #1a1b1f; }
.bk-cover::before {
  /* subtle decorative top rule */
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 8px; background: var(--ink);
}
.bk-cover-rule {
  width: 60px; height: 4px; background: var(--ink);
  margin-bottom: 28px;
}
.bk-cover-eyebrow {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase;
  margin-bottom: 20px;
}
.bk-cover-num { color: var(--ink); font-weight: 600; }
.bk-cover-sep { color: var(--ink-faint); }
.bk-cover-pages { color: var(--ink-mute); }
.bk-cover-title {
  font-family: var(--font-serif);
  font-size: 84px; line-height: 1.1; font-weight: 700;
  color: var(--ink); letter-spacing: -.02em;
  margin-bottom: 14px; max-width: 14ch; text-wrap: balance;
}
.bk-cover-title-en {
  font-family: var(--font-serif);
  font-size: 26px; font-style: italic; font-weight: 400;
  color: var(--ink-mute); letter-spacing: -.005em;
  margin-bottom: 38px;
}
.bk-cover-lede {
  font-size: 17px; line-height: 1.85;
  color: var(--ink-soft); max-width: 64ch;
  margin-bottom: 56px; text-wrap: pretty;
}
.bk-cover-takeaways {
  border-top: 1px solid var(--rule-strong);
  padding-top: 24px;
  max-width: 700px;
}
.bk-cover-takeaways-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 600;
  margin-bottom: 16px;
}
.bk-cover-takeaways ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.bk-cover-takeaways li {
  display: grid; grid-template-columns: 36px 1fr;
  align-items: baseline; gap: 14px;
}
.bk-take-num {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700; color: var(--ink-faint);
  font-feature-settings: "tnum";
}
.bk-take-text {
  font-size: 15.5px; line-height: 1.65; color: var(--ink-soft);
}
.bk-cover-foot {
  margin-top: auto;
  display: flex; justify-content: space-between;
  padding-top: 20px;
  font-size: 12px; color: var(--ink-mute);
  letter-spacing: .04em;
}
.bk-cover-scroll {
  color: var(--ink); font-weight: 600;
}
.bk-cover-glyph {
  position: absolute; top: 78px; right: 96px;
  width: 110px; height: 110px;
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 80px; color: var(--ink);
  border-radius: 50%; line-height: 1;
}

/* ============================================================
   BOOK READING LAYOUT — 3 columns (left TOC · body · right mini)
   ============================================================ */
.bk-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  width: 100%; height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-sans);
  overflow: hidden;
}

/* Left TOC */
.bk-left {
  border-right: 1px solid var(--rule);
  padding: 28px 18px 28px 24px;
  overflow-y: auto;
  background: var(--paper);
  display: flex; flex-direction: column; gap: 14px;
}
.bk-left-home {
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 6px 14px;
  font-size: 14px; color: var(--ink); cursor: pointer;
}
.bk-left-home b { color: var(--ink); font-weight: 700; }
.bk-left-subhome {
  font-family: var(--font-serif);
  font-size: 13px; font-style: italic; color: var(--ink-mute);
}
.bk-left-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--card); border-radius: 7px;
  font-size: 12.5px; color: var(--ink-mute);
}
.bk-left-search-icon { font-size: 14px; }
.bk-left-search-ph { flex: 1; }
.bk-left-search kbd {
  font-family: var(--font-sans);
  font-size: 10.5px; padding: 1px 5px;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 3px; color: var(--ink-mute);
}
.bk-left-list {
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 6px;
}
.bk-left-chap {
  display: grid; grid-template-columns: 32px 1fr;
  align-items: baseline; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 13px; line-height: 1.4;
  color: var(--ink-soft); cursor: pointer;
}
.bk-left-chap:hover { background: var(--card); }
.bk-left-chap.cur { background: var(--hl); color: var(--ink); }
.bk-left-chap.cur .bk-left-n { color: var(--ink); font-weight: 700; }
.bk-left-chap.cur .bk-left-t { font-weight: 650; }
.bk-left-chap.todo { color: var(--ink-faint); }
.bk-left-chap.todo .bk-left-n { color: var(--ink-faint); }
.bk-left-n {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-faint);
  letter-spacing: .04em;
}

/* Right mini-TOC */
.bk-right {
  border-left: 1px solid var(--rule);
  padding: 28px 22px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--paper);
}
.bk-right-label {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase; font-weight: 600;
}
.bk-right-list { display: flex; flex-direction: column; gap: 2px; }
.bk-right-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0;
  font-size: 12.5px; color: var(--ink-mute); cursor: pointer;
  line-height: 1.5; transition: color .12s;
}
.bk-right-item:hover { color: var(--ink); }
.bk-right-item .bk-right-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-faint); flex: none;
  transform: translateY(1px);
}
.bk-right-item.cur { color: var(--ink); font-weight: 650; }
.bk-right-item.cur .bk-right-dot { background: var(--hl-strong); width: 6px; height: 6px; }
.bk-right-progress {
  margin-top: 12px; padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.bk-right-progress-bar {
  height: 3px; background: var(--card);
  border-radius: 2px; overflow: hidden;
}
.bk-right-progress-fill {
  height: 100%; background: var(--ink);
}
.bk-right-progress-txt {
  margin-top: 8px;
  font-size: 11px; color: var(--ink-mute);
}
.bk-right-actions {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: auto;
}
.bk-right-actions .bk-btn { font-size: 12px; padding: 8px 12px; }

/* Center article */
.bk-article {
  overflow-y: auto;
  padding: 60px 80px 80px;
  max-width: 760px; margin: 0 auto;
  width: 100%;
}
.bk-article-head { margin-bottom: 44px; }
.bk-article-crumb {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: .04em;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.bk-crumb-sep { color: var(--ink-faint); }
.bk-article-h1 {
  font-family: var(--font-serif);
  font-size: 44px; line-height: 1.18; font-weight: 700;
  color: var(--ink); letter-spacing: -.015em;
  position: relative; padding-left: 70px;
  text-wrap: balance;
}
.bk-article-num {
  position: absolute; left: 0; top: 8px;
  font-family: var(--font-serif);
  font-size: 56px; font-weight: 700; color: var(--hl-strong);
  font-feature-settings: "tnum";
  line-height: 1;
}
.bk-article-h1-en {
  display: block;
  font-family: var(--font-serif);
  font-size: 16px; font-style: italic;
  color: var(--ink-mute); font-weight: 400;
  margin-top: 8px;
  letter-spacing: 0;
}
.bk-article-lede {
  margin-top: 28px;
  font-size: 17px; line-height: 1.85;
  color: var(--ink-soft);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  text-wrap: pretty;
}

.bk-section { margin-top: 44px; }
.bk-h2 {
  font-family: var(--font-serif);
  font-size: 26px; line-height: 1.3; font-weight: 700;
  color: var(--ink); letter-spacing: -.01em;
  margin-bottom: 18px;
  scroll-margin-top: 20px;
}

.bk-p {
  font-size: 16px; line-height: 1.95;
  color: var(--ink-soft);
  margin-bottom: 16px;
  text-wrap: pretty;
  word-break: keep-all;
}
.bk-p b { color: var(--ink); font-weight: 650; }
.bk-p code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 1px 6px; background: var(--card);
  border-radius: 4px; color: var(--ink);
}
.bk-p a {
  color: var(--ink); border-bottom: 1px solid var(--ink-faint);
  transition: border-color .12s;
}
.bk-p a:hover { border-bottom-color: var(--ink); }

/* Quote variants (Tweakable). Default = soft card */
.bk-quote { margin: 22px 0; }
.bk-quote blockquote {
  font-size: 14.5px; line-height: 1.75;
  color: var(--ink-soft);
  font-style: normal;
  font-family: var(--font-serif);
}
.bk-quote figcaption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  margin-top: 8px; letter-spacing: .02em;
}
.bk-quote figcaption i { font-style: italic; font-family: var(--font-serif); }
.bk-quote-card blockquote {
  padding: 18px 22px;
  background: var(--card);
  border-radius: 10px;
}
.bk-quote-card figcaption { padding-left: 22px; }
.bk-quote-bar blockquote {
  border-left: 2px solid var(--ink-faint);
  padding: 4px 0 4px 20px;
}
.bk-quote-bar figcaption { padding-left: 22px; }
.bk-quote-mark blockquote {
  position: relative;
  padding: 4px 0 4px 36px;
}
.bk-quote-mark blockquote::before {
  content: '\201C';
  position: absolute; left: 0; top: -14px;
  font-size: 50px; line-height: 1;
  color: var(--ink-faint);
  font-family: var(--font-serif);
}
.bk-quote-mark figcaption { padding-left: 36px; }
.bk-quote-rule blockquote {
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.bk-quote-rule figcaption { padding-top: 8px; }

/* Sidenote (Tufte) — placed in right margin via negative pull */
.bk-sidenote {
  display: block;
  float: right;
  clear: right;
  width: 260px;
  margin-right: -286px;
  margin-top: 0; margin-bottom: 16px;
  font-family: var(--font-serif);
  font-size: 13px; line-height: 1.7;
  color: var(--ink-mute);
  border-left: 2px solid var(--hl-strong);
  padding: 4px 0 4px 12px;
}
.bk-sidenote-text { display: block; font-style: italic; }
.bk-sidenote-src {
  display: block; margin-top: 6px;
  font-family: var(--font-mono);
  font-style: normal; font-size: 11px;
  color: var(--ink-faint);
}

/* Figure */
.bk-fig { margin: 28px 0; }
.bk-fig-wrap {
  padding: 22px; background: var(--paper-warm);
  border: 1px solid var(--rule); border-radius: 10px;
}
.bk-fig img { display: block; width: 100%; height: auto; }
.bk-fig figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px; color: var(--ink-mute);
  letter-spacing: .02em;
  text-align: center;
}

/* Callouts */
.bk-callout {
  margin: 22px 0;
  border-left: 3px solid;
  padding: 14px 20px;
  border-radius: 0 8px 8px 0;
}
.bk-callout-note { border-color: var(--c-note); background: var(--c-note-bg); }
.bk-callout-warn { border-color: var(--c-warn); background: var(--c-warn-bg); }
.bk-callout-tip  { border-color: var(--c-tip);  background: var(--c-tip-bg); }
.bk-callout-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}
.bk-callout-note .bk-callout-label { color: var(--c-note); }
.bk-callout-warn .bk-callout-label { color: var(--c-warn); }
.bk-callout-tip  .bk-callout-label { color: var(--c-tip); }
.bk-callout p {
  font-size: 14.5px; line-height: 1.7;
  color: var(--ink-soft); word-break: keep-all;
}

/* Code blocks — terminal-flavored, fits paper-warm context */
.bk-code {
  margin: 16px 0;
  padding: 16px 20px;
  background: #1d2129;
  color: #e8ecf3;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  letter-spacing: .01em;
  border-left: 3px solid var(--hl-strong);
}
.bk-code code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0; color: inherit;
  white-space: pre;
}
/* In merged view, code stays in main column; sidenote can sit beside */

/* Inline tables — quiet, paper-warm, no heavy borders */
.bk-table-wrap {
  margin: 18px 0;
  overflow-x: auto;
}
.bk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.6;
  font-family: var(--font-sans);
  color: var(--ink-soft);
}
.bk-table thead th {
  text-align: left;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 10px 14px 8px;
  border-bottom: 1.5px solid var(--ink);
  letter-spacing: -.005em;
  white-space: nowrap;
}
.bk-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
  word-break: keep-all;
}
.bk-table tbody td code,
.bk-table tbody th code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  background: var(--card);
  border-radius: 3px;
  color: var(--ink);
}
.bk-table tbody tr:last-child td { border-bottom: 0; }
.bk-table-cap {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: .04em;
  margin-top: 8px;
  text-align: center;
}

/* Prev/next footer */
.bk-article-foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 60px; padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.bk-prev, .bk-next {
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none;
  transition: border-color .12s;
  cursor: pointer;
}
.bk-prev:hover, .bk-next:hover { border-color: var(--ink); }
.bk-next { text-align: right; }
.bk-foot-lbl {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-mute);
}
.bk-foot-ti { font-size: 14px; color: var(--ink); font-weight: 650; }

/* ============================================================
   MERGED READING — 3-col shell + Tufte sidenote pairing
   English quotes float into a right gutter ALONGSIDE the paragraph
   that introduces them. Korean prose stays uninterrupted.
   ============================================================ */
.bk-merged {
  overflow-y: auto;
  padding: 60px 60px 80px;
  width: 100%;
  margin: 0;
}
.bk-merged-head {
  margin-bottom: 44px;
  max-width: 880px;
}
.bk-msection { margin-top: 44px; }
.bk-mh2 { max-width: 880px; }

/* Row = main column (Korean body) + optional aside (English quote) */
.bk-mrow {
  display: grid;
  grid-template-columns: minmax(0, 880px) 280px;
  column-gap: 36px;
  align-items: start;
  margin-bottom: 4px;
}
.bk-mrow-main { min-width: 0; }
.bk-mrow-main > * { margin-bottom: 14px; }
/* Figures should stretch the available main column (not just 640) */
.bk-mrow .bk-fig { max-width: 880px; }

/* Sidenote in the right gutter */
.bk-mrow-aside {
  position: relative;
  padding: 4px 4px 4px 14px;
  font-family: var(--font-serif);
  font-size: 12.5px; line-height: 1.7;
  color: var(--ink-mute);
  font-style: italic;
}
.bk-mrow-aside-rule {
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; background: var(--hl-strong);
  border-radius: 1px;
}
.bk-mrow-aside-text {
  /* English source quote */
  font-feature-settings: "kern", "liga";
  word-break: normal; hyphens: auto;
}
.bk-mrow-aside-src {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-style: normal; font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: .02em;
}

/* When a row has no aside, the main column gets the implied right gutter as
   whitespace — same grid so vertical rhythm stays aligned. */
.bk-mrow:not(.has-aside) .bk-mrow-main { /* nothing extra needed */ }
.bk-merged-foot {
  max-width: 880px;
  margin-top: 60px;
}

/* In the merged view, use the slightly tighter line-height for body to
   keep aside and main visually paired. */
.bk-merged .bk-p {
  font-size: 16px;
  line-height: 1.9;
}

/* Chapter rail — sits in the FIRST row's aside slot (same column as the
   English-quote sidenotes that come later). This visually unifies "이 챕터" +
   sidenotes into one right gutter, so navigation and citations live together. */
.bk-rail {
  /* Override the default sidenote styling — this is a navigation widget, not italic prose */
  font-family: var(--font-sans);
  font-size: 13px; font-style: normal;
  color: var(--ink-soft);
  padding: 0;
  display: flex; flex-direction: column;
  gap: 14px;
}
.bk-rail .bk-mrow-aside-rule { display: none; } /* no yellow rule for the TOC widget */

.bk-rail-label {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase; font-weight: 600;
  padding-bottom: 4px;
}

.bk-rail-list {
  display: flex; flex-direction: column;
  gap: 1px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.bk-rail-item {
  display: grid; grid-template-columns: 26px 1fr;
  align-items: baseline; gap: 8px;
  padding: 6px 6px;
  border-radius: 5px;
  font-size: 12.5px; line-height: 1.45;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.bk-rail-item:hover { background: var(--card); color: var(--ink); }
.bk-rail-item.cur {
  background: var(--hl);
  color: var(--ink); font-weight: 650;
}
.bk-rail-n {
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--ink-faint);
  letter-spacing: .04em;
}
.bk-rail-item.cur .bk-rail-n { color: var(--ink); font-weight: 700; }
.bk-rail-t { word-break: keep-all; }

.bk-rail-progress {
  display: flex; flex-direction: column; gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.bk-rail-progress-bar {
  height: 3px; background: var(--card);
  border-radius: 2px; overflow: hidden;
}
.bk-rail-progress-fill { height: 100%; background: var(--ink); }
.bk-rail-progress-txt {
  font-size: 11px; color: var(--ink-mute);
}

.bk-rail-actions {
  display: flex; flex-direction: column; gap: 6px;
}
.bk-rail-actions .bk-btn { font-size: 12px; padding: 8px 12px; }

/* ============================================================
   RESPONSIVE — 3 breakpoints
   1024px (tablet) · 900px (narrow laptop) · 640px (mobile)
   ============================================================ */

/* Hamburger + drawer overlay — hidden on wide screens */
.bk-hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px; color: var(--ink); font-weight: 600;
  cursor: pointer;
  align-items: center; gap: 7px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.bk-hamburger svg { display: block; }
.bk-drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 90;
}
.bk-shell.drawer-open .bk-drawer-overlay { display: block; }

/* ── ≤ 1024px — Tablet: sidenotes drop below body, mini-TOC goes inline ── */
@media (max-width: 1024px) {
  /* Single-column body — quotes appear AFTER their paragraph */
  .bk-mrow {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 8px;
  }
  .bk-mrow .bk-fig { max-width: 100%; }
  /* Sidenote becomes a quiet inline card under the paragraph */
  .bk-mrow-aside {
    margin: 6px 0 14px;
    padding: 12px 16px;
    background: var(--card);
    border-radius: 8px;
    font-size: 13.5px;
  }
  .bk-mrow-aside-rule {
    position: static;
    width: 32px; height: 3px;
    background: var(--hl-strong);
    border-radius: 2px;
    margin-bottom: 10px;
  }
  .bk-mrow-aside-src { font-size: 11px; margin-top: 6px; }

  /* Mini-TOC + actions become a horizontal strip at top of article */
  .bk-mrow-head { display: block; }
  .bk-mrow-head .bk-mrow-main { width: 100%; }
  .bk-rail {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--card);
    border-radius: 10px;
    margin-top: 28px;
    max-width: 100%;
  }
  .bk-rail-label {
    padding: 0; margin-right: 4px;
    flex: 0 0 auto;
  }
  .bk-rail-list {
    display: flex; flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0; border-bottom: 0;
    flex: 1 1 auto;
  }
  .bk-rail-item {
    padding: 4px 9px;
    background: var(--paper);
    border-radius: 5px;
  }
  .bk-rail-item.cur { background: var(--hl); }
  .bk-rail-progress { display: none; }
  .bk-rail-actions {
    flex-direction: row;
    flex: 0 0 auto;
  }
}

/* ── ≤ 900px — Narrow laptop: left TOC becomes a drawer ── */
@media (max-width: 900px) {
  .bk-shell {
    display: block;
    grid-template-columns: none;
    overflow: visible;
    min-height: 100vh;
  }
  .bk-left {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 280px; z-index: 95;
    transform: translateX(-101%);
    transition: transform .22s cubic-bezier(.2,.7,.3,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
    overflow-y: auto;
  }
  .bk-shell.drawer-open .bk-left { transform: translateX(0); }
  .bk-merged {
    overflow: visible; height: auto;
    padding: 60px 32px 80px;
    margin: 0;
    width: 100%;
  }
  .bk-hamburger { display: inline-flex; }
}

/* ── ≤ 640px — Mobile: type/spacing tightened, tables scroll ── */
@media (max-width: 640px) {
  .bk-merged { padding: 60px 16px 50px; }
  .bk-article-h1 {
    font-size: 30px;
    padding-left: 0;
  }
  .bk-article-num {
    position: static;
    display: inline-block;
    font-size: 36px;
    line-height: 1;
    margin-right: 12px;
    vertical-align: -2px;
  }
  .bk-article-h1-en { font-size: 14px; }
  .bk-article-lede {
    font-size: 15px;
    line-height: 1.78;
    margin-top: 18px;
    padding-bottom: 20px;
  }
  .bk-h2 { font-size: 21px; }
  .bk-p { font-size: 15px; line-height: 1.82; }
  .bk-section, .bk-msection { margin-top: 30px; }

  /* Tables get a horizontal scroll container */
  .bk-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bk-table { min-width: 480px; font-size: 12.5px; }
  .bk-table thead th { font-size: 12px; padding: 8px 10px 6px; }
  .bk-table tbody td { padding: 7px 10px; }

  /* Code blocks slightly smaller */
  .bk-code { padding: 12px 14px; font-size: 12px; }

  /* Figures tighter */
  .bk-fig-wrap { padding: 12px; }
  .bk-fig figcaption { font-size: 11px; }

  /* Callout reads tighter */
  .bk-callout { padding: 12px 16px; }
  .bk-callout p { font-size: 13.5px; }

  /* Inline mini-TOC strip — wrap nicely */
  .bk-rail { padding: 12px 14px; gap: 10px; }
  .bk-rail-label { font-size: 9.5px; }
  .bk-rail-item { font-size: 11.5px; padding: 3px 8px; }
  .bk-rail-actions { width: 100%; margin-top: 6px; }
  .bk-rail-actions .bk-btn { flex: 1; text-align: center; font-size: 11.5px; }

  /* Prev/Next footer stacks */
  .bk-article-foot { grid-template-columns: 1fr; }
  .bk-next { text-align: left; }
}

/* Landing + Guide TOC — also bring under the same breakpoints */
@media (max-width: 1024px) {
  .lan-grid { grid-template-columns: repeat(2, 1fr); }
  .gtoc { grid-template-columns: 1fr; overflow: auto; }
  .gtoc-cover { padding: 60px 40px; }
  .gtoc-cover::after { inset: 16px; }
  .gtoc-toc { padding: 50px 40px; }
}
@media (max-width: 640px) {
  .lan-bar { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px 20px; }
  .lan-tools { margin-left: 0; width: 100%; }
  .lan-search { min-width: 0; flex: 1; }
  .lan-hero { padding: 36px 20px 24px; }
  .lan-hero-h1 { font-size: 32px; }
  .lan-hero-p { font-size: 14px; }
  .lan-hero-stats { gap: 24px; }
  .lan-hero-stats b { font-size: 26px; }
  .lan-shelf { padding: 20px; }
  .lan-grid { grid-template-columns: 1fr; }
  .gtoc-cover-title { font-size: 32px; }
  .gtoc-cover-mark { font-size: 100px; }
  .gtoc-row { grid-template-columns: 30px 1fr auto; gap: 8px; }
  .gtoc-row-dot, .gtoc-row-p { display: none; }
}

/* ============================================================
   MOBILE HARDENING — 가로 오버플로 방지 + 표지/카드 크기 보정
   (좁은 화면에서 내용이 오른쪽으로 잘리거나 목차가 안 보이던 문제)
   ============================================================ */
@media screen and (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  /* 표지+목차 펼침면을 단을 풀고 세로로 흐르게 */
  .gtoc { height: auto; min-height: 100vh; overflow: visible; }
  .gtoc-cover { padding: 48px 22px; }
  .gtoc-cover::after { inset: 12px; }
  .gtoc-toc { padding: 40px 22px; height: auto; overflow: visible; }
  /* ★ 핵심: 그리드/플렉스 자식이 줄어들 수 있게 (안 그러면 긴 영문이 칸을 밀어 가로 넘침) */
  .gtoc-cover, .gtoc-toc, .gtoc-row-t, .bk-mrow-main, .bk-rail { min-width: 0; }
  .gtoc-row-ko, .gtoc-row-en { overflow-wrap: anywhere; }
  /* 긴 단어/제목이 칸을 넘기지 않게 */
  .gtoc-cover-title, .gtoc-cover-sub,
  .lan-hero-h1, .lan-hero-p, .bk-article-h1 { overflow-wrap: anywhere; }
}

@media screen and (max-width: 640px) {
  /* 표지 거대 글자 축소 */
  .gtoc-cover-mark { font-size: 76px; margin: 6px 0 4px; }
  .gtoc-cover-title { font-size: 26px; }
  .gtoc-cover-sub { font-size: 14px; }
  /* 목차 헤더의 영문 라벨이 넘쳐서 가로 스크롤 유발하던 것 */
  .gtoc-toc-head { flex-wrap: wrap; gap: 2px 12px; }
  .gtoc-toc-head > span:last-child { font-size: 10px; letter-spacing: .08em; }
  .gtoc-row { gap: 6px; }

  /* 랜딩: 카드 표지가 폭이 꽉 차면 3:4라 세로로 거대해지던 것 → 배너 비율로 */
  .lan-card-cover { aspect-ratio: 16 / 6; padding: 16px; }
  .lan-card-mark { font-size: 40px; right: 16px; bottom: 12px; }
  .lan-foot { flex-direction: column; gap: 6px; padding: 16px 20px; }
}

/* ============================================================
   PDF book spread — A4 trade paperback, 명조 serif body
   ============================================================ */
.pdf-spread {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #d8d5cd 0%, #bfbcb4 100%);
  padding: 36px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px;
  box-sizing: border-box;
  position: relative;
}
.pdf-spread::after {
  /* book spine shadow between the two pages */
  content: ''; position: absolute;
  top: 36px; bottom: 36px;
  left: 50%; width: 18px; transform: translateX(-50%);
  background: linear-gradient(90deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.15) 40%,
    rgba(0,0,0,.22) 50%,
    rgba(0,0,0,.15) 60%,
    rgba(0,0,0,0) 100%);
  z-index: 2; pointer-events: none;
}
.pdf-page {
  background: var(--paper-warm);
  padding: 56px 52px 44px;
  position: relative;
  display: flex; flex-direction: column;
  font-family: var(--font-serif);
  color: var(--ink);
  box-shadow: 0 4px 22px rgba(0,0,0,.18);
  overflow: hidden;
}
.pdf-page-l { border-radius: 1px 0 0 1px; }
.pdf-page-r { border-radius: 0 1px 1px 0; }

.pdf-running {
  display: flex; justify-content: space-between;
  font-family: var(--font-serif);
  font-size: 10.5px; letter-spacing: .12em;
  color: var(--ink-mute); text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: .5px solid var(--ink-faint);
}
.pdf-folio {
  margin-top: auto;
  display: flex; justify-content: space-between;
  padding-top: 14px;
  font-family: var(--font-serif);
  font-size: 11px; color: var(--ink-mute);
  font-feature-settings: "onum", "lnum";
}

/* Left page (chapter opener) */
.pdf-cover-block {
  display: flex; flex-direction: column;
  padding-top: 50px; padding-right: 8px;
  flex: 1;
}
.pdf-cover-num {
  font-family: var(--font-serif);
  font-size: 13px; letter-spacing: .3em;
  color: var(--ink-mute);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 24px;
}
.pdf-cover-rule {
  width: 80px; height: 1px; background: var(--ink);
  margin: 0 auto 36px;
}
.pdf-cover-title {
  font-family: var(--font-serif);
  font-size: 38px; line-height: 1.22; font-weight: 700;
  color: var(--ink); text-align: center;
  letter-spacing: -.012em;
  margin-bottom: 8px;
  word-break: keep-all; text-wrap: balance;
}
.pdf-cover-titleEn {
  font-family: var(--font-serif);
  font-size: 14px; font-style: italic; font-weight: 400;
  color: var(--ink-mute); text-align: center;
  margin-bottom: 38px;
}
.pdf-cover-lede {
  font-family: var(--font-serif);
  font-size: 13.5px; line-height: 1.85;
  color: var(--ink-soft);
  text-align: justify; word-break: keep-all;
  margin-bottom: 40px;
}
.pdf-cover-toc-label {
  font-family: var(--font-serif);
  font-size: 11px; letter-spacing: .2em;
  color: var(--ink-mute);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 14px;
}
.pdf-cover-toc {
  list-style: none; padding: 0; margin: 0;
  font-family: var(--font-serif);
  font-size: 12.5px; line-height: 1.8;
  border-top: .5px solid var(--ink-faint);
  padding-top: 12px;
}
.pdf-cover-toc li {
  display: grid; grid-template-columns: 32px 1fr;
  gap: 10px; color: var(--ink-soft);
  padding: 4px 0;
}
.pdf-cover-toc li > span:first-child {
  font-style: italic;
  color: var(--ink-mute);
  text-align: right;
  font-feature-settings: "onum";
}

/* Right page (body) */
.pdf-body { columns: 1; flex: 1; font-feature-settings: "kern", "liga"; }
.pdf-bodysec + .pdf-bodysec { margin-top: 18px; }
.pdf-h3 {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 700; color: var(--ink);
  margin: 12px 0 8px;
  letter-spacing: -.005em;
}
.pdf-h3::before {
  content: '§ '; color: var(--hl-strong); font-weight: 700;
}
.pdf-p {
  font-family: var(--font-serif);
  font-size: 12.5px; line-height: 1.78;
  color: var(--ink-soft);
  text-indent: 1.4em;
  text-align: justify;
  word-break: keep-all;
  margin: 0 0 4px 0;
}
.pdf-p:first-child, .pdf-h3 + .pdf-p { text-indent: 0; }
.pdf-p b { font-weight: 700; color: var(--ink); }
.pdf-p .hl {
  background: linear-gradient(180deg, transparent 0%, transparent 35%, var(--hl) 35%, var(--hl) 95%, transparent 95%);
}
.pdf-p code {
  font-family: var(--font-mono);
  font-size: 11.5px; padding: 0 4px;
  background: var(--card); border-radius: 2px;
}
.pdf-q {
  margin: 10px 14px;
  padding: 10px 14px;
  background: rgba(0,0,0,.03);
  border-radius: 5px;
  font-family: var(--font-serif);
  font-size: 11.5px; line-height: 1.7;
  color: var(--ink-mute);
  font-style: italic;
}
.pdf-q cite {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 6px;
  letter-spacing: .04em;
}
.pdf-callout {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 2px solid var(--c-warn);
  background: var(--c-warn-bg);
  font-family: var(--font-serif);
  font-size: 11.5px; line-height: 1.65;
  color: var(--ink-soft);
}
.pdf-callout-lbl {
  display: block;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: var(--c-warn); text-transform: uppercase;
  margin-bottom: 4px;
}
.pdf-callout-note { border-color: var(--c-note); background: var(--c-note-bg); }
.pdf-callout-note .pdf-callout-lbl { color: var(--c-note); }
.pdf-callout-tip  { border-color: var(--c-tip);  background: var(--c-tip-bg); }
.pdf-callout-tip  .pdf-callout-lbl { color: var(--c-tip); }


/* ============================================================
   PPTX TRAINING SLIDES — 1920×1080
   ============================================================ */
.px {
  width: 1920px; height: 1080px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 80px 100px;
  box-sizing: border-box;
}
.px-deck {
  display: flex; flex-direction: column; gap: 20px;
}

/* Header bar — shows chapter context */
.px-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 100px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-sans); font-size: 18px;
  letter-spacing: .01em;
}
.px-header-l { display: flex; align-items: baseline; gap: 14px; }
.px-header-num {
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: .12em;
  color: var(--hl-strong); font-weight: 700;
}
.px-header-t { font-weight: 600; }
.px-header-r {
  font-family: var(--font-serif);
  font-size: 14px; font-style: italic; opacity: .7;
}

/* Footer page number */
.px-footer {
  position: absolute; bottom: 32px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 16px; color: var(--ink-mute);
  letter-spacing: .12em;
}

/* ── Title slide ── */
.px-title {
  background: var(--paper-warm);
  justify-content: center;
  text-align: left;
  padding: 100px 140px;
}
.px-title-eyebrow {
  font-family: var(--font-mono);
  font-size: 22px; letter-spacing: .26em;
  color: var(--ink-mute); text-transform: uppercase;
  margin-bottom: 36px; font-weight: 600;
}
.px-title-h1 {
  font-family: var(--font-serif);
  font-size: 160px; line-height: 1.05; font-weight: 700;
  color: var(--ink); letter-spacing: -.025em;
  text-wrap: balance;
}
.px-title-rule {
  width: 120px; height: 6px; background: var(--ink);
  margin: 36px 0 28px;
}
.px-title-en {
  font-family: var(--font-serif);
  font-size: 44px; font-style: italic; font-weight: 400;
  color: var(--ink-mute); letter-spacing: -.005em;
  margin-bottom: 56px;
}
.px-title-lede {
  font-size: 28px; line-height: 1.7;
  color: var(--ink-soft);
  max-width: 1200px;
  margin-bottom: auto; text-wrap: pretty;
  word-break: keep-all;
}
.px-title-foot {
  margin-top: 64px;
  display: flex; justify-content: space-between;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
  font-family: var(--font-serif);
  font-size: 22px; color: var(--ink-mute);
  font-style: italic;
}

/* ── Part / section divider ── */
.px-part {
  background: var(--ink); color: var(--paper);
  justify-content: center;
  padding: 100px 140px;
}
.px-part-num {
  font-family: var(--font-mono);
  font-size: 32px; letter-spacing: .25em;
  color: var(--hl-strong); font-weight: 700;
  margin-bottom: 36px;
}
.px-part-rule {
  width: 200px; height: 4px; background: var(--hl-strong);
  margin-bottom: 36px;
}
.px-part-h2 {
  font-family: var(--font-serif);
  font-size: 110px; line-height: 1.1; font-weight: 700;
  color: var(--paper); letter-spacing: -.02em;
  text-wrap: balance;
}
.px-part-sub {
  font-family: var(--font-serif);
  font-size: 32px; font-style: italic;
  color: rgba(255,255,255,.7);
  margin-top: 32px;
  max-width: 1300px;
  word-break: keep-all;
}

/* ── Body slide (rich text + key points sidebar) ── */
.px-h2 {
  font-family: var(--font-serif);
  font-size: 64px; line-height: 1.15; font-weight: 700;
  color: var(--ink); letter-spacing: -.012em;
  margin: 24px 0 40px;
  text-wrap: balance;
}
.px-body {
  display: grid; grid-template-columns: 1.8fr 1fr;
  gap: 80px; flex: 1;
}
.px-p {
  font-size: 28px; line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 24px;
  word-break: keep-all;
  text-wrap: pretty;
}
.px-p b { color: var(--ink); font-weight: 700; }
.px-p .hl {
  background: linear-gradient(180deg, transparent 0%, transparent 50%, var(--hl) 50%, var(--hl) 95%, transparent 95%);
  padding: 0 4px;
}
.px-body-r {
  background: var(--paper-warm);
  border-left: 6px solid var(--hl-strong);
  padding: 40px 36px;
  align-self: start;
}
.px-keypoints-label {
  font-family: var(--font-mono);
  font-size: 18px; letter-spacing: .14em;
  color: var(--ink-mute); text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 24px;
}
.px-keypoints {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 18px;
}
.px-keypoints li {
  display: flex; gap: 16px; align-items: baseline;
  font-size: 26px; line-height: 1.45; color: var(--ink);
  font-weight: 500;
}
.px-key-bullet {
  width: 10px; height: 10px;
  background: var(--ink); flex: none;
  border-radius: 2px;
  transform: rotate(45deg) translateY(2px);
}

/* ── Highlight slide — one big sentence ── */
.px-highlight {
  background: var(--paper-warm);
  justify-content: center;
  padding: 140px 200px;
}
.px-hl-eyebrow {
  font-family: var(--font-mono);
  font-size: 20px; letter-spacing: .22em;
  color: var(--ink-mute); text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 40px;
}
.px-hl-quote-mark {
  font-family: var(--font-serif);
  font-size: 240px; line-height: .8;
  color: var(--hl-strong);
  margin-left: -20px; margin-bottom: -40px;
}
.px-hl-text {
  font-family: var(--font-serif);
  font-size: 78px; line-height: 1.35; font-weight: 700;
  color: var(--ink); letter-spacing: -.015em;
  text-wrap: balance; word-break: keep-all;
  max-width: 1500px;
}
.px-hl-text .hl {
  background: linear-gradient(180deg, transparent 0%, transparent 58%, var(--hl) 58%, var(--hl) 94%, transparent 94%);
  padding: 0 6px;
}
.px-hl-foot {
  margin-top: 64px;
  font-family: var(--font-serif);
  font-size: 22px; font-style: italic;
  color: var(--ink-mute);
}

/* ── Quote slide — English source + Korean re-statement ── */
.px-quote {
  padding: 140px 160px;
  justify-content: center;
}
.px-q-eyebrow {
  font-family: var(--font-mono);
  font-size: 20px; letter-spacing: .22em;
  color: var(--ink-mute); text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 36px;
}
.px-q-text {
  font-family: var(--font-serif);
  font-size: 42px; line-height: 1.5; font-style: italic;
  color: var(--ink); font-weight: 400;
  letter-spacing: -.005em;
  padding: 36px 44px;
  background: var(--card);
  border-radius: 18px;
  position: relative;
}
.px-q-text::before {
  content: '\201C';
  position: absolute; left: 24px; top: -40px;
  font-size: 140px; line-height: 1;
  color: var(--hl-strong);
}
.px-q-src {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 20px; color: var(--ink-mute);
  letter-spacing: .04em;
}
.px-q-translation {
  margin-top: 48px; padding-top: 36px;
  border-top: 2px solid var(--ink);
  font-size: 30px; line-height: 1.65;
  color: var(--ink); word-break: keep-all;
}
.px-q-translation-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px; letter-spacing: .18em;
  color: var(--hl-strong); text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ── Image-focus slide ── */
.px-image {
  padding-top: 100px;
}
.px-image-wrap {
  flex: 1;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 36px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  overflow: hidden;
}
.px-image-wrap img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
}
.px-image-cap {
  font-family: var(--font-mono);
  font-size: 20px; color: var(--ink-mute);
  letter-spacing: .04em;
}
.px-image-note {
  margin-top: 24px;
  font-size: 26px; line-height: 1.6;
  color: var(--ink-soft);
  word-break: keep-all;
  text-wrap: pretty;
}

/* ── Summary slide ── */
.px-summary {
  background: var(--paper-warm);
  padding: 100px 140px;
  justify-content: center;
}
.px-sum-eyebrow {
  font-family: var(--font-mono);
  font-size: 22px; letter-spacing: .26em;
  color: var(--ink-mute); text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 24px;
}
.px-sum-h2 {
  font-family: var(--font-serif);
  font-size: 88px; line-height: 1.1; font-weight: 700;
  color: var(--ink); letter-spacing: -.02em;
  margin-bottom: 56px;
}
.px-sum-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 28px;
  max-width: 1500px;
}
.px-sum-list li {
  display: grid; grid-template-columns: 90px 1fr;
  gap: 28px; align-items: baseline;
}
.px-sum-n {
  font-family: var(--font-serif);
  font-size: 56px; font-weight: 700; color: var(--hl-strong);
  font-feature-settings: "tnum";
}
.px-sum-t {
  font-size: 32px; line-height: 1.55;
  color: var(--ink); font-weight: 500;
  word-break: keep-all;
}
.px-sum-t b { font-weight: 700; }
.px-sum-next {
  margin-top: 64px; padding-top: 36px;
  border-top: 2px solid var(--ink);
  display: flex; gap: 36px; align-items: baseline;
  font-family: var(--font-serif);
}
.px-sum-next span {
  font-style: italic;
  font-size: 24px; color: var(--ink-mute);
}
.px-sum-next b {
  font-size: 32px; color: var(--ink); font-weight: 700;
}

/* ============================================================
   HOW-TO cards (usage instructions) — at end of canvas
   ============================================================ */
.howto {
  width: 100%; height: 100%;
  background: var(--paper-warm);
  color: var(--ink);
  font-family: var(--font-sans);
  padding: 60px 72px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.howto-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .16em;
  color: var(--ink-mute); text-transform: uppercase; font-weight: 600;
}
.howto-h1 {
  font-family: var(--font-serif);
  font-size: 40px; line-height: 1.18; font-weight: 700;
  color: var(--ink); letter-spacing: -.012em;
  margin: 14px 0 12px;
}
.howto-sub {
  font-size: 15px; color: var(--ink-mute);
  line-height: 1.7; max-width: 700px;
}
.howto-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px; margin-top: 44px;
}
.howto-step {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px 30px;
  display: flex; flex-direction: column; gap: 14px;
}
.howto-step-h {
  display: flex; align-items: baseline; gap: 14px;
}
.howto-step-num {
  font-family: var(--font-serif);
  font-size: 44px; font-weight: 700;
  color: var(--hl-strong); line-height: 1;
}
.howto-step-ti {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700; color: var(--ink);
  letter-spacing: -.005em;
}
.howto-step p {
  font-size: 13.5px; line-height: 1.7;
  color: var(--ink-soft); word-break: keep-all;
  text-wrap: pretty;
}
.howto-step .howto-code {
  display: block;
  background: #1e2530; color: #e6e9ee;
  border-radius: 7px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all;
  margin-top: 4px;
}
.howto-step .howto-code .c { color: #8a8f9a; }
.howto-step .howto-code .k { color: #ffd84a; }
.howto-step ul {
  margin: 4px 0 0; padding-left: 18px;
  font-size: 13px; line-height: 1.75;
  color: var(--ink-soft);
}
.howto-step ul li { margin-bottom: 4px; word-break: keep-all; }
.howto-step ul code {
  font-family: var(--font-mono);
  font-size: 12px; padding: 1px 5px;
  background: var(--card); border-radius: 3px;
}

.howto-rec {
  margin-top: 36px;
  padding: 24px 28px;
  background: var(--paper);
  border: 1px dashed var(--rule-strong);
  border-radius: 12px;
  display: grid; grid-template-columns: 200px 1fr;
  gap: 28px; align-items: start;
}
.howto-rec-label {
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-mute); font-weight: 700;
}
.howto-rec-text {
  font-size: 14px; line-height: 1.75; color: var(--ink-soft);
  word-break: keep-all;
}
.howto-rec-text b { color: var(--ink); }
