/* 토브하우스 — 디자인 기준
   색: 돌빛 종이(stone) 위에 상록 먹색(ink), 올리브(olive), 놋쇠(brass)
   글꼴: 제목 Noto Serif KR · 본문 Pretendard · 히브리어 Frank Ruhl Libre · 헬라어 Gentium Book Plus
   움직임: 첫 화면의 טוֹב 글자 그리기 한 번 + 화면 전환 + 사용자가 누른 것에 대한 반응만 */

:root {
  --stone: #eef0ea;
  --paper: #fafbf7;
  --ink: #18231f;
  --ink-2: #2b3833;
  --olive: #56632f;
  --olive-soft: #e4e8d6;
  --brass: #a9843b;
  --brass-hi: #c9a557;
  --line: #d5d9ce;
  --muted: #5e6a63;
  --danger: #9a3b2c;

  --serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --heb: "Frank Ruhl Libre", "SBL Hebrew", "Times New Roman", serif;
  --grk: "Gentium Book Plus", "Gentium Plus", "Times New Roman", serif;

  --wrap: 1180px;
  --pad: clamp(18px, 4vw, 40px);
  --r-s: 6px;
  --r-m: 14px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font: 400 16.5px/1.75 var(--sans);
  letter-spacing: -0.005em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───────── 머리말 ───────── */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--pad);
  height: 64px;
  background: color-mix(in srgb, var(--stone) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.top.scrolled { border-bottom-color: var(--line); }
body.on-dark .top:not(.scrolled) { background: transparent; color: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-mark { font: 500 22px/1 var(--heb); color: var(--brass); direction: rtl; }
.brand-name { font: 700 18px/1 var(--serif); letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--r-s);
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 1.5px;
  background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; border: 0; background: none; cursor: pointer; margin-right: -10px;
  }
  .menu-btn span { display: block; width: 22px; height: 1.6px; background: currentColor; transition: transform .35s var(--ease); }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.8px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.8px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper); color: var(--ink); padding: 8px var(--pad) 24px;
    border-bottom: 1px solid var(--line);
    clip-path: inset(0 0 100% 0); transition: clip-path .45s var(--ease); visibility: hidden;
  }
  .nav.open { clip-path: inset(0 0 0 0); visibility: visible; }
  .nav a { font: 600 22px/1.3 var(--serif); padding: 14px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { color: var(--olive); }
  body.on-dark .top:has(.nav.open) { background: var(--paper); color: var(--ink); }
}

main { min-height: 70vh; outline: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

/* ───────── 첫 화면 ───────── */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--paper);
  margin-top: -64px; padding: calc(64px + clamp(48px, 9vw, 120px)) 0 clamp(56px, 8vw, 110px);
}
.hero::before {
  /* 놋쇠 빛이 한쪽에서 은은하게 */
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 70vw; height: 90vh;
  background: radial-gradient(closest-side, rgba(201,165,87,.16), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: clamp(24px, 5vw, 72px);
}
.hero h1 {
  font: 700 clamp(40px, 6.2vw, 78px)/1.08 var(--serif); letter-spacing: -0.04em; margin: 0 0 28px;
}
.hero-verse { max-width: 30em; margin: 0 0 36px; color: #c7cec7; font: 400 17px/1.85 var(--serif); }
.hero-verse cite { display: block; margin-top: 8px; font: 500 14px/1 var(--sans); font-style: normal; color: var(--brass-hi); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.tov-art { position: relative; aspect-ratio: 1.25; width: 100%; }
.tov-art svg { width: 100%; height: 100%; overflow: visible; }
.tov-word {
  font-family: var(--heb); font-weight: 500; font-size: 300px;
  fill: transparent; stroke: var(--brass-hi); stroke-width: 1.4;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: draw 3.2s var(--ease) .25s forwards, fillin 1.4s ease 2.6s forwards;
}
.tov-gloss { position: absolute; left: 4%; bottom: 2%; font-size: 13.5px; color: #9eaaa2; line-height: 1.6; }
.tov-gloss b { color: var(--brass-hi); font: 500 15px var(--heb); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillin { to { fill: var(--brass-hi); stroke-width: 0; } }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .tov-art { order: -1; aspect-ratio: 2.1; margin: -8px 0 8px; }
  .tov-word { font-size: 250px; }
  .tov-gloss { display: none; }
}

/* ───────── 버튼 ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid currentColor;
  text-decoration: none; font-weight: 600; font-size: 15px; cursor: pointer; background: none;
  transition: background .25s, color .25s, border-color .25s, transform .2s;
}
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--brass-hi); border-color: var(--brass-hi); color: var(--ink); }
.btn-solid:hover { background: #d8b66a; border-color: #d8b66a; }
.btn-line { color: var(--paper); border-color: rgba(250,251,247,.35); }
.btn-line:hover { border-color: var(--paper); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: 14px; }

/* ───────── 집 평면도(첫 화면 아래) ───────── */
.plan-sec { padding: clamp(56px, 8vw, 110px) 0; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.sec-head h2 { font: 700 clamp(26px, 3.4vw, 38px)/1.2 var(--serif); letter-spacing: -0.03em; margin: 0; }
.sec-head p { margin: 0; color: var(--muted); max-width: 30em; }
.plan {
  display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(180px, auto);
  border: 2px solid var(--ink); background: var(--paper);
}
.room {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  padding: clamp(20px, 2.6vw, 32px); text-decoration: none;
  border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  transition: background .35s var(--ease);
}
.room:hover { background: var(--olive-soft); }
.room h3 { font: 700 clamp(22px, 2.4vw, 28px)/1.25 var(--serif); letter-spacing: -0.03em; margin: 0 0 8px; }
.room p { margin: 0; color: var(--muted); font-size: 15px; max-width: 28em; }
.room .door { /* 문이 열리는 호 — 평면도 기호 */
  position: absolute; right: 18px; bottom: 18px; width: 34px; height: 34px;
  border-top: 1px solid var(--brass); border-left: 1px solid var(--brass); border-top-left-radius: 100%;
  opacity: .8; transition: transform .45s var(--ease);
  transform-origin: 0 100%;
}
.room:hover .door { transform: rotate(-12deg); }
.room .room-foot { font-size: 13px; color: var(--olive); font-weight: 600; }
.r-church { grid-column: span 4; grid-row: span 2; background: var(--ink); color: var(--paper); }
.r-church:hover { background: var(--ink-2); }
.r-church p { color: #b9c2bb; }
.r-church .room-foot { color: var(--brass-hi); }
.r-church h3 { font-size: clamp(28px, 3.6vw, 44px); }
.r-press { grid-column: span 2; grid-row: span 2; border-right: 0; }
.r-conf { grid-column: span 2; }
.r-bible { grid-column: span 4; border-right: 0; }
.r-lib { grid-column: span 6; border-right: 0; border-bottom: 0; flex-direction: row; align-items: center; min-height: 130px; }
.room .heb-line { font: 500 clamp(26px, 3vw, 38px)/1.2 var(--heb); direction: rtl; color: var(--olive); }
.room .grk-line { font: 400 clamp(20px, 2.2vw, 26px)/1.3 var(--grk); color: var(--muted); }
@media (max-width: 860px) {
  .plan { grid-template-columns: 1fr; }
  .room, .r-church, .r-press, .r-conf, .r-bible, .r-lib { grid-column: auto; grid-row: auto; border-right: 0; min-height: 170px; }
  .r-lib { flex-direction: column; align-items: stretch; }
}

/* 최근 설교 (첫 화면) */
.latest { padding: 0 0 clamp(56px, 8vw, 110px); }

/* ───────── 페이지 머리 ───────── */
.page-head { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(24px, 3vw, 36px); }
.page-head::after { content: ""; display: block; height: 1px; background: var(--line); margin-top: clamp(24px, 3vw, 36px); }
.page-head h1 { font: 700 clamp(34px, 5vw, 58px)/1.12 var(--serif); letter-spacing: -0.04em; margin: 0 0 14px; }
.page-head p { margin: 0; color: var(--muted); max-width: 40em; font-size: 17px; }
.crumb { display: inline-block; margin-bottom: 16px; font-size: 14px; color: var(--olive); text-decoration: none; font-weight: 600; }
.crumb:hover { text-decoration: underline; }
.section { padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(32px, 5vw, 64px); }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { font: 700 24px/1.3 var(--serif); letter-spacing: -0.02em; margin: 0 0 20px; }

/* 정보 표 (예배 시간 등) */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 2px solid var(--ink); }
.fact { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); }
.fact dt { font-size: 14px; color: var(--muted); }
.fact dd { margin: 4px 0 0; font: 600 19px/1.4 var(--serif); }
.pending { color: var(--muted); font-style: normal; font-weight: 400; font-family: var(--sans); font-size: 15px; }

.prose { max-width: 38em; font-size: 17px; line-height: 1.9; }
.prose p { margin: 0 0 1em; white-space: pre-line; }

/* 빈 상태 */
.empty {
  border: 1px dashed var(--line); border-radius: var(--r-m); padding: 36px 28px; color: var(--muted);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
}
.empty strong { display: block; color: var(--ink); font: 600 18px/1.4 var(--serif); margin-bottom: 6px; }

/* ───────── 설교 영상 ───────── */
.sermons { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px 24px; }
.sermon { display: flex; flex-direction: column; gap: 12px; }
.video {
  position: relative; aspect-ratio: 16/9; border-radius: var(--r-m); overflow: hidden; background: var(--ink);
  border: 0; padding: 0; cursor: pointer; width: 100%;
}
.video img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .3s; opacity: .92; }
.video:hover img { transform: scale(1.035); opacity: 1; }
.video .play {
  position: absolute; left: 16px; bottom: 16px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--paper); display: grid; place-items: center; transition: transform .3s var(--ease);
}
.video:hover .play { transform: scale(1.08); }
.video .play::before { content: ""; border-left: 15px solid var(--ink); border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sermon h3 { margin: 0; font: 600 19px/1.4 var(--serif); letter-spacing: -0.02em; }
.sermon .meta { font-size: 14px; color: var(--muted); }
.sermon .meta b { color: var(--olive); font-weight: 600; }

/* ───────── 책 ───────── */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 40px 28px; }
.book { display: flex; flex-direction: column; gap: 10px; }
.book .cover {
  aspect-ratio: 2/3; border-radius: 3px 8px 8px 3px; overflow: hidden; background: var(--ink); color: var(--paper);
  box-shadow: inset 6px 0 0 rgba(0,0,0,.18), 0 18px 30px -18px rgba(24,35,31,.45);
  display: flex; align-items: end; padding: 18px; font: 700 20px/1.3 var(--serif);
  transition: transform .5s var(--ease);
}
.book:hover .cover { transform: translateY(-4px) rotate(-.6deg); }
.book .cover img { width: 100%; height: 100%; object-fit: cover; margin: -18px; width: calc(100% + 36px); height: calc(100% + 36px); max-width: none; }
.book h3 { margin: 4px 0 0; font: 600 18px/1.4 var(--serif); }
.book .meta { font-size: 14px; color: var(--muted); }
.book p { margin: 0; font-size: 15px; }

/* ───────── 자료 목록 ───────── */
.rooms-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 2px solid var(--ink); background: var(--paper); margin-bottom: 8px; }
.rooms-mini .room { min-height: 160px; }
.rooms-mini .room:last-child { border-right: 0; }
.rooms-mini .room { border-bottom: 0; }
@media (max-width: 700px) { .rooms-mini { grid-template-columns: 1fr; } .rooms-mini .room { border-right: 0; border-bottom: 1px solid var(--ink); } .rooms-mini .room:last-child { border-bottom: 0; } }
.list { border-top: 2px solid var(--ink); }
.list-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 20px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.list-row:hover h3 { color: var(--olive); }
.list-row .kind { font-size: 14px; color: var(--olive); font-weight: 600; }
.list-row h3 { margin: 0; font: 600 18px/1.45 var(--serif); transition: color .2s; }
.list-row p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.list-row .date { font-size: 14px; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .list-row { grid-template-columns: 1fr; gap: 4px; } }

.search {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--paper);
  border-radius: 999px; padding: 0 16px; height: 46px; max-width: 420px; margin-bottom: 24px;
}
.search input { border: 0; background: none; outline: none; font: inherit; flex: 1; min-width: 0; }
.search:focus-within { border-color: var(--ink); }

/* ───────── 신앙고백서 ───────── */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.doc {
  display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 18px; padding: 26px 22px 26px 0;
  border-bottom: 1px solid var(--line); text-decoration: none;
}
.doc .yr { font: 600 15px/1.5 var(--serif); color: var(--brass); }
.doc h3 { margin: 0 0 6px; font: 700 20px/1.4 var(--serif); letter-spacing: -0.02em; transition: color .2s; }
.doc:hover h3 { color: var(--olive); }
.doc p { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.doc .badge { display: block; font-size: 13px; color: var(--olive); margin-bottom: 4px; font-weight: 600; }

.reader { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-top: 32px; padding-bottom: 80px; align-items: start; }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; padding-right: 8px; scrollbar-width: thin; }
.toc a {
  display: block; padding: 8px 12px; border-left: 2px solid var(--line); text-decoration: none; font-size: 14.5px; line-height: 1.45;
  color: var(--muted); transition: color .2s, border-color .2s, background .2s;
}
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--brass); background: var(--paper); font-weight: 600; }
.toc-select { display: none; }
@media (max-width: 900px) {
  .reader { grid-template-columns: 1fr; }
  .toc { display: none; }
  .toc-select { display: block; width: 100%; height: 48px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); padding: 0 12px; font: inherit; margin-bottom: 12px; }
}
.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.seg-ctl button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg-ctl button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.reader-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; position: sticky; top: 64px; z-index: 5; padding: 10px 0; background: var(--stone); }
.art h2 { font: 700 clamp(24px, 3vw, 32px)/1.3 var(--serif); letter-spacing: -0.03em; margin: 0 0 4px; }
.art .code { font-size: 14px; color: var(--brass); font-weight: 600; }
.cols { display: grid; gap: 28px; margin-top: 24px; }
.cols.both { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .cols.both { grid-template-columns: 1fr; } }
.text-en { font: 400 17.5px/1.8 var(--grk); white-space: pre-line; color: var(--ink-2); }
.text-ko { font: 400 17.5px/1.95 var(--serif); white-space: pre-line; }
.col-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.ai-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--olive-soft); color: var(--olive); font-weight: 600; }
.proofs { margin-top: 28px; padding: 18px 20px; background: var(--paper); border-left: 3px solid var(--brass); border-radius: 0 var(--r-s) var(--r-s) 0; font-size: 15px; }
.proofs h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.ref {
  display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--stone); font-size: 14px; cursor: pointer; text-decoration: none;
}
.ref:hover { border-color: var(--olive); color: var(--olive); }

.tr-box { position: relative; min-height: 3em; }
.tr-status { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.tr-status .btn { margin-left: 4px; }
.dots::after { content: "…"; display: inline-block; animation: dots 1.2s steps(4, end) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
.shimmer { height: 1em; border-radius: 4px; margin: 10px 0; background: linear-gradient(90deg, var(--line) 0%, var(--paper) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 해설서 */
.comm { margin-top: 44px; border-top: 2px solid var(--ink); padding-top: 22px; }
.comm > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.comm > summary::-webkit-details-marker { display: none; }
.comm > summary h3 { margin: 0; font: 700 21px/1.4 var(--serif); }
.comm > summary .chev { transition: transform .35s var(--ease); font-size: 20px; color: var(--brass); }
.comm[open] > summary .chev { transform: rotate(45deg); }
.comm-body { padding-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.warn { border-color: #d9b4a8; }
.author-note { font-size: 14px; color: var(--muted); margin: 4px 0 14px; }
.warn-note { font-size: 14px; color: var(--danger); background: #f6e9e4; border-radius: var(--r-s); padding: 10px 14px; margin: 0 0 14px; }

/* ───────── 원어성경 ───────── */
.bible-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 0; position: sticky; top: 64px; z-index: 6; background: var(--stone); border-bottom: 1px solid var(--line); }
.pick { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 600; }
.pick:hover { border-color: var(--ink); }
.pick small { color: var(--muted); font-weight: 400; }
.nav-arrows { display: inline-flex; gap: 6px; margin-left: auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.bible-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; padding: 28px 0 80px; align-items: start; }
@media (max-width: 1000px) { .bible-layout { grid-template-columns: 1fr; } }
.chapter-title { font: 700 clamp(28px, 3.4vw, 40px)/1.2 var(--serif); letter-spacing: -0.03em; margin: 0 0 4px; }
.chapter-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 24px; }
.verse { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 140px; }
.verse.on { background: linear-gradient(90deg, var(--olive-soft), transparent 80%); }
.vnum { font: 600 14px/2.4 var(--serif); color: var(--brass); text-align: right; text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0; }
.orig { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.orig.heb { direction: rtl; font: 400 28px/1.7 var(--heb); }
.orig.grk { font: 400 22px/1.7 var(--grk); }
.w { border: 0; background: none; padding: 0 3px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; transition: background .15s, color .15s; }
.w:hover { background: var(--olive-soft); }
.w[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.w .pf { opacity: .55; }
.ko-line { grid-column: 2; font: 400 16.5px/1.85 var(--serif); color: var(--ink-2); }
.verse-tools { grid-column: 2; display: flex; gap: 8px; }
.loading-block { padding: 40px 0; }

.panel { position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px; scrollbar-width: thin; }
.panel-empty { color: var(--muted); font-size: 15px; }
.panel-empty b { display: block; color: var(--ink); font: 600 17px var(--serif); margin-bottom: 6px; }
.lex-word { font-size: 40px; line-height: 1.2; margin: 0; }
.lex-word.heb { font-family: var(--heb); direction: rtl; text-align: right; }
.lex-word.grk { font-family: var(--grk); }
.lex-lemma { color: var(--muted); font-size: 15px; margin: 6px 0 14px; }
.lex-lemma b { color: var(--ink); font-size: 20px; }
.lex-lemma .heb { font-family: var(--heb); }
.lex-lemma .grk { font-family: var(--grk); }
.kv { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px 12px; font-size: 15px; margin: 0 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.parse { display: flex; flex-wrap: wrap; gap: 6px; }
.parse span { background: var(--olive-soft); color: var(--olive); font-weight: 600; font-size: 13.5px; padding: 3px 10px; border-radius: 999px; }
.lex-def { font-size: 15px; line-height: 1.7; border-top: 1px solid var(--line); padding-top: 14px; }
.lex-def p { margin: 0 0 8px; }
.lex-def small { color: var(--muted); }
.panel-tabs { display: flex; gap: 4px; margin: -6px 0 16px; border-bottom: 1px solid var(--line); }
.panel-tabs button { border: 0; background: none; padding: 8px 10px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.panel-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brass); }
@media (max-width: 1000px) {
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50; max-height: 70vh;
    border-radius: 20px 20px 0 0; border: 0; box-shadow: 0 -20px 40px -10px rgba(24,35,31,.25);
    transform: translateY(105%); transition: transform .45s var(--ease); padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
  .panel.open { transform: none; }
  .panel-grip { display: block; width: 44px; height: 4px; border-radius: 4px; background: var(--line); margin: -8px auto 14px; }
  .panel-close { display: grid !important; }
}
.panel-grip { display: none; }
.panel-close { display: none !important; position: absolute; right: 14px; top: 12px; width: 36px; height: 36px; }

/* 책·장 고르기 창 */
.sheet-back { position: fixed; inset: 0; background: rgba(24,35,31,.45); z-index: 60; opacity: 0; transition: opacity .3s; }
.sheet-back.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; left: 50%; top: 50%; width: min(860px, calc(100vw - 24px)); max-height: min(80vh, 760px);
  overflow: auto; background: var(--paper); border-radius: 20px; padding: 26px; transform: translate(-50%, -46%) scale(.98); opacity: 0;
  transition: transform .4s var(--ease), opacity .3s;
}
.sheet.open { transform: translate(-50%, -50%); opacity: 1; }
.sheet h3 { margin: 0 0 12px; font: 700 20px var(--serif); }
.sheet h4 { margin: 20px 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.book-grid button, .ch-grid button {
  border: 1px solid var(--line); background: var(--stone); border-radius: 8px; padding: 9px 6px; cursor: pointer; font-size: 14.5px;
}
.book-grid button:hover, .ch-grid button:hover { border-color: var(--ink); }
.book-grid button[aria-current="true"], .ch-grid button[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.sheet-close { position: absolute; right: 16px; top: 16px; }

/* 구절 팝업 */
.pop {
  position: fixed; z-index: 70; width: min(420px, calc(100vw - 24px)); background: var(--ink); color: var(--paper);
  border-radius: var(--r-m); padding: 18px 20px; font: 400 16px/1.8 var(--serif);
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.5); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .3s var(--ease);
}
.pop.open { opacity: 1; transform: none; }
.pop b { color: var(--brass-hi); font-family: var(--sans); font-size: 14px; display: block; margin-bottom: 6px; }
.pop .vv sup { color: var(--brass-hi); margin-right: 4px; font-family: var(--sans); }
.pop a { color: var(--brass-hi); font-family: var(--sans); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; z-index: 80; font-size: 15px; }

/* ───────── 바닥글 ───────── */
.foot { background: var(--ink); color: #b9c2bb; padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); }
.foot-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: auto 1fr; gap: 40px; }
.foot-brand { margin: 0; color: var(--paper); font: 700 20px var(--serif); }
.foot-sub { margin: 4px 0 0; font-size: 14px; }
.foot-credit { margin: 0; font-size: 13px; line-height: 1.8; max-width: 52em; justify-self: end; }
@media (max-width: 700px) { .foot-inner { grid-template-columns: 1fr; } .foot-credit { justify-self: start; } }

/* ───────── 화면 전환 ───────── */
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-old(root), ::view-transition-new(root) {
    animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important;
  }
  .tov-word { stroke-dashoffset: 0; fill: var(--brass-hi); }
  html { scroll-behavior: auto; }
}

/* 다듬기 */
.vnum { align-self: start; }
.orig.heb + .ko-line, .orig.grk + .ko-line { margin-top: 2px; }
@media (max-width: 700px) {
  .sec-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
.chip small { opacity: .6; margin-left: 3px; font-size: 12px; }
.sermon .meta .ref { margin-right: 6px; }
