:root {
  --bg: #f6f1e8;
  --surface: rgba(255, 252, 246, 0.92);
  --surface-2: #fffaf1;
  --text: #2c2118;
  --muted: #7b6a59;
  --accent: #9a6a2f;
  --accent-2: #c99a4a;
  --border: rgba(91, 61, 28, 0.16);
  --shadow: 0 18px 45px rgba(75, 45, 18, 0.12);
}

:root.dark {
  --bg: #12100d;
  --surface: rgba(30, 26, 21, 0.94);
  --surface-2: #1b1712;
  --text: #f4eadb;
  --muted: #c4b49d;
  --accent: #d9ad66;
  --accent-2: #f2d18b;
  --border: rgba(242, 209, 139, 0.18);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(201,154,74,.22), transparent 32rem),
    linear-gradient(135deg, var(--bg), var(--surface-2));
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 14px clamp(16px, 4vw, 42px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.brand {
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--accent);
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.06);
}
.theme-icon::before { content: '☀️'; }
:root.dark .theme-icon::before { content: '🌙'; }
.index-main, .reader {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0;
}
.index-header, .chapter-header {
  text-align: center;
  margin-bottom: clamp(26px, 5vw, 48px);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.index-title, .chapter-num {
  margin: 0;
  font-size: clamp(3rem, 12vw, 7rem);
  line-height: .95;
  color: var(--text);
  text-shadow: 0 2px 0 rgba(255,255,255,.3);
}
.index-sub { margin: 14px 0 0; color: var(--muted); font-size: 1.05rem; }
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.ch-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.ch-card:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.ch-num {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
}
.ch-title { font-size: .98rem; color: var(--text); }
.chapter-body {
  padding: clamp(22px, 4vw, 46px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.section {
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: clamp(1.45rem, 4vw, 2.15rem);
  line-height: 1.25;
}
.verse {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  margin: 0 0 13px;
  font-size: clamp(1.05rem, 2.6vw, 1.23rem);
}
.vnum {
  color: var(--accent);
  font-weight: 800;
  text-align: right;
  font-size: .9em;
  padding-top: .12em;
}
.vtext { min-width: 0; }
.chapter-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}
.nav-link, .nav-index {
  min-width: 72px;
  text-align: center;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.nav-index { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.disabled { opacity: .35; pointer-events: none; }
@media (max-width: 600px) {
  .verse { grid-template-columns: 32px 1fr; }
  .chapter-body { border-radius: 20px; padding: 20px 16px; }
  .chapter-nav { gap: 8px; }
  .nav-link, .nav-index { min-width: auto; padding: 10px 13px; }
}