:root {
      --bg: #f6f1e9;
      --paper: #fffdf8;
      --ink: #1e1b18;
      --muted: #6d645a;
      --line: #ded2c3;
      --accent: #5b351f;
      --accent-2: #8a5a34;
      --soft: #f0e3d4;
      --quote: #fbf6ee;
      --green: #365c43;
      --blue: #31465f;
      --gold: #9a6a20;
      --warning: #7a3d00;
    }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      font-family: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
      line-height: 1.82;
      word-break: keep-all;
    }
    .page {
      max-width: 1160px;
      margin: 0 auto;
      background: var(--paper);
      box-shadow: 0 20px 70px rgba(41, 30, 20, 0.17);
      min-height: 100vh;
    }
    header.hero {
      padding: 76px 68px 52px;
      background: linear-gradient(145deg, #332015, #6f4428 58%, #a27042);
      color: #fff8ed;
      border-bottom: 7px solid #d9bd94;
    }
    .eyebrow {
      letter-spacing: 0.18em;
      text-transform: uppercase;
      font-size: 0.78rem;
      opacity: 0.84;
      margin-bottom: 20px;
    }
    h1 {
      margin: 0;
      font-size: clamp(2rem, 5vw, 4.7rem);
      line-height: 1.1;
      font-weight: 800;
    }
    .subtitle {
      max-width: 900px;
      font-size: 1.15rem;
      margin: 25px 0 0;
      opacity: 0.95;
    }
    .meta {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 30px;
    }
    .pill {
      border: 1px solid rgba(255,255,255,0.35);
      background: rgba(255,255,255,0.13);
      border-radius: 999px;
      padding: 6px 12px;
      font-size: 0.88rem;
    }
    main { padding: 46px 68px 76px; }
    h2 {
      margin-top: 58px;
      padding-bottom: 9px;
      border-bottom: 2px solid var(--line);
      font-size: 1.82rem;
      color: var(--accent);
      line-height: 1.38;
    }
    h3 {
      margin-top: 0;
      color: var(--accent);
      font-size: 1.38rem;
      line-height: 1.48;
    }
    h4 {
      margin: 24px 0 8px;
      font-size: 1.04rem;
      color: var(--green);
    }
    p { margin: 0 0 1.05rem; }
    a { color: var(--accent); }
    .notice {
      background: #fff7e7;
      border: 1px solid #e4c990;
      border-left: 6px solid #b7791f;
      padding: 22px 24px;
      border-radius: 12px;
      margin: 0 0 30px;
    }
    .notice strong { color: var(--warning); }
    .toc {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
      gap: 12px;
      margin-top: 18px;
    }
    .toc a, .toc .disabled {
      display: block;
      padding: 12px 15px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fffaf2;
      color: var(--accent);
      text-decoration: none;
      transition: transform .15s ease, background .15s ease;
    }
    .toc a:hover { transform: translateY(-1px); background: var(--soft); }
    .toc .disabled { color: #9a9083; background: #faf7f1; }
    .tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      background: #eadac7;
      color: #5b351f;
      font-size: .78rem;
      margin-right: 6px;
      vertical-align: baseline;
    }
    .section-intro {
      background: #faf2e7;
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 25px 28px;
      margin: 30px 0;
    }
    .framework-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 16px;
      margin-top: 20px;
    }
    .framework-card {
      border: 1px solid var(--line);
      background: #fffefb;
      border-radius: 15px;
      padding: 17px 19px;
    }
    .framework-card h4 { margin-top: 0; }
    .roadmap {
      width: 100%;
      border-collapse: collapse;
      margin: 20px 0 8px;
      font-size: .96rem;
    }
    .roadmap th, .roadmap td {
      border: 1px solid var(--line);
      padding: 9px 10px;
      vertical-align: top;
    }
    .roadmap th {
      background: #efe4d6;
      color: var(--accent);
      text-align: left;
    }
    .roadmap td:first-child { width: 70px; text-align: center; color: var(--muted); }
    .verse-card {
      margin: 36px 0;
      padding: 32px 34px;
      border: 1px solid var(--line);
      border-radius: 20px;
      background: linear-gradient(180deg, #fffdf8 0%, #fff9f0 100%);
      box-shadow: 0 8px 23px rgba(75, 50, 30, 0.06);
    }
    .scripture {
      margin: 18px 0 24px;
      padding: 20px 23px;
      background: var(--quote);
      border-left: 6px solid var(--accent-2);
      border-radius: 14px;
      font-size: 1.06rem;
    }
    .scripture .label, .pauline .label, .method-label {
      display: block;
      color: var(--muted);
      font-size: 0.82rem;
      margin-bottom: 7px;
      letter-spacing: 0.04em;
    }
    .pauline {
      border-left: 4px solid #c6ad8a;
      padding-left: 20px;
      margin-top: 20px;
      background: #fffdf8;
    }
    .pauline p { font-style: normal; }
    .commentary {
      margin-top: 22px;
      border-top: 1px dashed #d6c8b8;
      padding-top: 20px;
    }
    .scholia {
      margin-top: 20px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 16px;
    }
    .note-box {
      border: 1px solid var(--line);
      background: #fffefb;
      border-radius: 14px;
      padding: 17px 19px;
    }
    .note-box h4 { margin-top: 0; }
    ul { padding-left: 1.2rem; margin: 0.4rem 0 0.8rem; }
    li { margin: 0.35rem 0; }
    .synthesis {
      background: #f2efe8;
      border-radius: 18px;
      padding: 29px 31px;
      border: 1px solid var(--line);
      margin-top: 42px;
    }
    .thesis {
      font-size: 1.16rem;
      font-weight: 700;
      color: var(--accent);
      padding: 18px 20px;
      border-radius: 14px;
      background: #fff8ee;
      border: 1px solid #e5d3bc;
    }
    .quote-block {
      border-left: 5px solid var(--blue);
      background: #f5f8fb;
      padding: 17px 20px;
      border-radius: 12px;
      margin: 18px 0;
    }
    .footer {
      margin-top: 60px;
      padding-top: 24px;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 0.92rem;
    }
    .anchor-top {
      display: inline-block;
      margin-top: 12px;
      color: var(--muted);
      font-size: 0.9rem;
      text-decoration: none;
    }
    code {
      background: #f2eadf;
      border-radius: 5px;
      padding: 1px 5px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: .92em;
    }
    @media (max-width: 760px) {
      header.hero { padding: 48px 24px 36px; }
      main { padding: 30px 20px 54px; }
      .verse-card { padding: 23px 18px; }
      .scholia { grid-template-columns: 1fr; }
      .roadmap { font-size: .9rem; }
    }
    @media print {
      body { background: #fff; }
      .page { box-shadow: none; max-width: none; }
      header.hero { color: #000; background: #fff; border-bottom: 2px solid #000; }
      .toc a, .toc .disabled { border: 1px solid #999; }
      .verse-card { break-inside: avoid; box-shadow: none; }
    }

/* Split-project layout */
.reader-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}
.reader-nav a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf2;
  color: var(--accent);
  padding: 7px 13px;
  text-decoration: none;
}
.reader-nav a:hover {
  background: var(--soft);
}
.chapter-hero h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}
.chapter-navigation {
  margin-bottom: 42px;
}
.chapter-shell > h2 {
  margin-top: 0;
}
.toc-subtitle {
  margin: 30px 0 12px;
  color: var(--green);
  font-size: 1.08rem;
}
.toc-compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.unit-section {
  margin-top: 54px;
}
.unit-section:first-child {
  margin-top: 0;
}
.unit-section-continued {
  border-top: 1px dashed var(--line);
  padding-top: 22px;
}
.unit-continuation {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

@page {
  margin: 18mm 16mm;
}

@media print {
  html {
    scroll-behavior: auto;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.58;
  }
  a {
    color: #000;
    text-decoration: none;
  }
  main {
    padding: 20px 0 0;
  }
  .page {
    box-shadow: none;
    max-width: none;
    margin: 0;
    min-height: auto;
  }
  header.hero {
    background: #fff;
    border-bottom: 2px solid #000;
    color: #000;
    padding: 0 0 18px;
  }
  .reader-nav,
  .anchor-top {
    display: none;
  }
  .notice,
  .section-intro,
  .synthesis,
  .framework-card,
  .note-box,
  .verse-card {
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  h2,
  h3,
  h4 {
    break-after: avoid;
    page-break-after: avoid;
  }
}

:root {
  --ink: #222322;
  --muted: #68706c;
  --line: #d7dfdc;
  --rule: #195f72;
  --rule-dark: #0d3945;
  --green: #36634c;
  --soft-blue: #eef5f6;
  --soft-green: #eff6f1;
  --paper: #ffffff;
  --sidebar: #f7f9f8;
  --note: #f4f7f8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.study-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  line-height: 1.78;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  transform: translateY(-160%);
  background: var(--rule-dark);
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.study-masthead {
  border-bottom: 1px solid var(--line);
  padding: 24px clamp(20px, 5vw, 64px) 22px;
}

.study-top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 34px;
}

.study-top-actions a,
.study-sidebar a,
.anchor-top {
  color: var(--rule-dark);
  text-decoration: none;
}

.study-top-actions a {
  border: 1px solid var(--line);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 0.88rem;
  line-height: 1.2;
  padding: 7px 11px;
}

.study-top-actions a:hover,
.study-sidebar a:hover,
.anchor-top:hover {
  color: var(--green);
}

.study-title-row {
  border-bottom: 2px solid var(--rule);
  display: block;
  margin: 0 auto;
  max-width: 1120px;
  padding-bottom: 24px;
  text-align: center;
}

.study-kicker,
.study-meta,
.study-sidebar h2,
.study-sidebar h3,
.label,
.method-label {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.study-kicker {
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 10px;
}

.study-masthead h1 {
  color: var(--ink);
  font-size: clamp(2.9rem, 5.4vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0;
}

.study-subtitle {
  color: #39433f;
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  margin: 14px auto 0;
  max-width: 680px;
}

.study-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 16px 0 0;
}

.study-layout {
  display: grid;
  gap: clamp(26px, 3vw, 42px);
  grid-template-columns: 150px minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1240px;
  padding: 30px clamp(20px, 4vw, 54px) 80px;
}

.study-sidebar {
  align-self: start;
  background: transparent;
  border-right: 1px solid var(--line);
  min-height: calc(100vh - 90px);
  padding: 4px 16px 26px 0;
  position: sticky;
  top: 0;
  text-align: right;
}

.study-sidebar h2,
.study-sidebar h3 {
  color: var(--green);
  font-size: 0.78rem;
  letter-spacing: 0;
  margin: 0 0 12px;
}

.study-sidebar-group {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.study-sidebar-group:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.study-sidebar a {
  display: block;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 0.78rem;
  line-height: 1.28;
  padding: 4px 0;
}

.study-verse-list {
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr;
}

.study-verse-list a {
  font-size: 0.74rem;
}

.study-reader {
  min-width: 0;
}

.study-index-layout .study-reader > .notice,
.study-index-layout .study-reader > section {
  background: #fff;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  margin: 0 0 34px;
  padding: 24px 0 0;
}

.study-index-layout .study-reader > .notice {
  background: var(--soft-green);
  border-left: 4px solid var(--green);
  border-top: 0;
  padding: 18px 20px;
}

.study-index-layout .toc {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.study-index-layout .toc a {
  border: 1px solid var(--line);
  color: var(--rule-dark);
  padding: 10px 12px;
  text-decoration: none;
}

.study-index-layout .toc a:hover {
  border-color: var(--rule);
  color: var(--green);
}

.chapter-shell > h2 {
  height: 1px;
  margin: 0;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.unit-section {
  margin-top: 58px;
}

.unit-section:first-child {
  margin-top: 0;
}

.unit-section > h2 {
  color: var(--green);
  font-size: clamp(1.42rem, 2vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 20px;
}

.section-intro,
.synthesis {
  background: #f7f9f6;
  border: 0;
  border-top: 2px solid var(--green);
  border-radius: 0;
  box-shadow: none;
  margin: 0 0 34px;
  padding: 16px 18px 14px;
}

.section-intro h3,
.synthesis h3 {
  color: var(--rule-dark);
  font-size: 1.12rem;
  margin: 0 0 14px;
}

.section-intro p,
.synthesis p {
  max-width: 880px;
}

.thesis {
  background: var(--soft-green);
  border: 0;
  border-left: 4px solid var(--green);
  border-radius: 0;
  color: #25352e;
  padding: 14px 16px;
}

.framework-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0;
}

.framework-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--soft-blue);
  padding: 16px;
}

.framework-card h4,
.note-box h4,
.commentary h4 {
  color: var(--rule-dark);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: 0;
  margin-top: 0;
}

.verse-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 16px 28px;
  grid-template-areas:
    "ref scripture"
    "ref pauline"
    "ref commentary"
    "notes notes";
  grid-template-columns: 112px minmax(0, 1fr);
  margin: 0;
  padding: 30px 0 38px;
}

.verse-card > h3 {
  align-self: start;
  color: var(--rule);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 0.82rem;
  grid-area: ref;
  line-height: 1.35;
  margin: 0;
  padding-top: 4px;
  text-align: right;
}

.scripture {
  background: transparent;
  border: 0;
  border-left: 4px solid var(--rule);
  border-radius: 0;
  color: #171b1a;
  font-size: 1.16rem;
  grid-area: scripture;
  line-height: 1.82;
  margin: 0;
  padding: 0 0 0 18px;
}

.label,
.method-label {
  color: var(--green);
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 7px;
}

.pauline {
  background: var(--soft-blue);
  border: 0;
  border-left: 0;
  border-top: 2px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  color: #2c3836;
  grid-area: pauline;
  margin: 0;
  padding: 14px 16px;
}

.pauline p {
  font-style: normal;
  margin-bottom: 0;
}

.commentary {
  border: 0;
  border-top: 1px solid var(--line);
  grid-area: commentary;
  margin: 0;
  padding-top: 14px;
}

.commentary p,
.pauline p,
.note-box p,
.section-intro p,
.synthesis p,
.framework-card p {
  margin-top: 0;
}

.scholia {
  background: var(--note);
  border: 0;
  border-top: 2px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 0;
  grid-area: notes;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 2px;
  padding: 16px 0 6px;
}

.note-box {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 0 18px 12px;
}

.note-box:first-child {
  border-left: 0;
}

.anchor-top {
  display: none;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 0.86rem;
  grid-area: back;
  justify-self: start;
}

.footer-note {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 0.86rem;
  margin-top: 54px;
  padding-top: 18px;
}

@media (max-width: 1180px) {
  .study-title-row {
    grid-template-columns: 1fr;
  }

  .study-layout {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .verse-card {
    grid-template-areas:
      "ref scripture"
      "ref pauline"
      "ref commentary"
      "notes notes";
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .scholia,
  .framework-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .study-masthead {
    padding: 22px 18px;
  }

  .study-top-actions {
    justify-content: flex-start;
    margin-bottom: 28px;
  }

  .study-layout {
    display: block;
    padding: 24px 18px 58px;
  }

  .study-sidebar {
    background: var(--sidebar);
    border-bottom: 1px solid var(--line);
    border-right: 0;
    margin-bottom: 32px;
    min-height: 0;
    padding: 18px;
    position: static;
    text-align: left;
  }

  .study-verse-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .verse-card {
    display: block;
    padding: 28px 0 34px;
  }

  .verse-card > h3,
  .scripture,
  .pauline,
  .commentary,
  .scholia,
  .anchor-top {
    margin-bottom: 18px;
  }

  .anchor-top {
    display: inline-block;
  }

  .scripture {
    font-size: 1.08rem;
  }

  .scholia,
  .framework-grid {
    grid-template-columns: 1fr;
  }
}

@page {
  margin: 17mm 14mm;
}

@media print {
  html {
    scroll-behavior: auto;
  }

  body.study-page {
    color: #000;
    font-size: 10.8pt;
    line-height: 1.55;
  }

  .study-top-actions,
  .study-sidebar,
  .anchor-top,
  .skip-link {
    display: none;
  }

  .study-masthead {
    border-bottom: 2px solid #000;
    padding: 0 0 12mm;
  }

  .study-title-row,
  .study-layout,
  .verse-card {
    display: block;
  }

  .study-masthead h1 {
    font-size: 34pt;
  }

  .study-layout {
    max-width: none;
    padding: 10mm 0 0;
  }

  .section-intro,
  .synthesis,
  .verse-card,
  .framework-card,
  .note-box {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .scripture,
  .pauline,
  .scholia {
    border-color: #777;
  }
}

