:root {
  color-scheme: light;
  /* Base surfaces and text */
  --ink: #292b2a;
  --muted: #85857f;
  --paper: #fbfaf6;
  --canvas: #f6f4f9;
  --line: #e9e6de;

  /* Shared pastel theme palette */
  --blue: #defefc;
  --blue-strong: var(--blue);
  --lavender: #dcd7f7;
  --yellow: #fffecf;
  --pink: #fad4e0;
  --green: #d6f2b9;

  /* Higher-contrast gradient stops for the chapter number */
  --chapter-blue: #72c6d3;
  --chapter-lavender: #dcd7f7;
  --chapter-pink: #fad4e0;
  --chapter-green: #d6f2b9;

  /* Shared interaction accents */
  --focus: #799da8;
  --focus-border: #9ab8c0;
  --focus-ring: rgba(141,180,196,.14);
  --grain: rgba(99,95,78,.075);
  --serif: "Gelasio", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", "Avenir Next", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: radial-gradient(var(--grain) .65px, transparent .65px);
  background-size: 7px 7px;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { width: min(1540px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 42px; }
.topbar { height: 98px; display: grid; grid-template-columns: 280px minmax(280px, 560px) auto auto; align-items: center; gap: 24px; border-bottom: 1px solid rgba(71, 72, 67, .13); }
.brand { display: inline-flex; align-items: center; gap: 13px; width: fit-content; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(-7deg); }
.brand-mark i { border-radius: 2px; display: block; }
.brand-mark i:nth-child(1) { background: var(--blue-strong); border-radius: 9px 3px 3px; }
.brand-mark i:nth-child(2) { background: var(--lavender); border-radius: 3px 9px 3px 3px; }
.brand-mark i:nth-child(3) { background: var(--pink); border-radius: 3px 3px 3px 9px; }
.brand-mark i:nth-child(4) { background: var(--green); border-radius: 3px 3px 9px; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-family: var(--serif); font-size: 23px; font-weight: 500; line-height: 1; }
.brand-copy small { color: #777972; font-size: 8px; font-weight: 700; letter-spacing: 1.25px; }
.search-wrap { position: relative; z-index: 5; }
.search-box { height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 13px 0 16px; border: 1px solid #e5e2da; border-radius: 5px; background: rgba(255,255,255,.62); transition: border-color .2s, box-shadow .2s, background .2s; }
.search-box:focus-within { border-color: var(--focus-border); background: #fff; box-shadow: 0 0 0 3px var(--focus-ring); }
.search-icon { position: relative; flex: 0 0 14px; height: 14px; border: 1.5px solid #858780; border-radius: 50%; }
.search-icon::after { position: absolute; right: -4px; bottom: -3px; width: 6px; height: 1.5px; background: #858780; content: ""; transform: rotate(45deg); }
.search-box input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: #999991; }
.search-box kbd { padding: 4px 6px; border: 1px solid #e8e5de; border-radius: 3px; color: #96958e; font-size: 9px; white-space: nowrap; }
.topbar-note { justify-self: end; display: flex; align-items: center; gap: 9px; color: #777a72; font-size: 9px; font-weight: 700; letter-spacing: 1.1px; }
.theme-dots { display: flex; align-items: center; gap: 4px; }
.theme-dots i { width: 7px; height: 7px; display: block; border-radius: 50%; }
.theme-dots i:nth-child(1) { background: var(--blue-strong); }
.theme-dots i:nth-child(2) { background: var(--lavender); }
.theme-dots i:nth-child(3) { background: var(--pink); }
.theme-dots i:nth-child(4) { background: var(--green); }
.live-dot, .meta-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #a9bd9a; }
.shortcuts-trigger { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.48); color: #777970; font-size: 8px; font-weight: 700; letter-spacing: .75px; cursor: pointer; transition: background .16s, border-color .16s; }
.shortcuts-trigger:hover { border-color: #d3ccec; background: var(--lavender); }
.shortcuts-trigger > span:first-child { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: #514d69; font-family: var(--serif); font-size: 12px; font-weight: 600; }
.shortcuts-trigger:hover > span:first-child { background: var(--yellow); }
.shortcuts-dialog { width: min(440px, calc(100vw - 32px)); max-width: none; padding: 0; overflow: visible; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgba(41,43,42,.2); }
.shortcuts-dialog[open] { animation: dialog-in .22s ease-out both; }
.shortcuts-dialog::backdrop { background: rgba(41,43,42,.34); backdrop-filter: blur(3px); }
.shortcuts-panel { padding: 27px 29px 23px; }
.shortcuts-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.shortcuts-eyebrow { color: #85857f; font-size: 8px; font-weight: 700; letter-spacing: 1.2px; }
.shortcuts-heading h2 { margin: 7px 0 0; font-family: var(--serif); font-size: 27px; font-weight: 400; line-height: 1.15; }
.shortcuts-close { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.55); color: #66675f; font-size: 20px; line-height: 1; cursor: pointer; }
.shortcuts-close:hover { background: var(--lavender); }
.shortcuts-intro { margin: 12px 0 19px; color: #777970; font-family: var(--serif); font-size: 14px; }
.shortcut-list { border-top: 1px solid var(--line); }
.shortcut-row { --shortcut-key-color: var(--yellow); --shortcut-key-ink: #65603d; --shortcut-key-edge: #e7e2bb; min-height: 58px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); color: #454640; font-size: 12px; }
.shortcut-row--previous { --shortcut-key-color: var(--green); --shortcut-key-ink: #4b5a40; --shortcut-key-edge: #b5d998; }
.shortcut-row--next { --shortcut-key-color: var(--yellow); --shortcut-key-ink: #65603d; --shortcut-key-edge: #e7e2bb; }
.shortcut-row--previous > span { color: #4b5a40; }
.shortcut-row kbd { width: 43px; height: 34px; display: grid; place-items: center; border: 1px solid var(--shortcut-key-edge); border-radius: 3px; background: var(--shortcut-key-color); color: var(--shortcut-key-ink); font-family: var(--sans); font-size: 16px; box-shadow: 0 2px 0 var(--shortcut-key-edge); }
.shortcuts-note { margin: 16px 0 0; color: #898981; font-size: 10px; line-height: 1.5; }

.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(430px, 65vh); overflow: auto; padding: 7px; border: 1px solid #e8e4dc; border-radius: 5px; background: #fffefa; box-shadow: 0 16px 42px rgba(48, 47, 42, .14); }
.search-results[hidden] { display: none; }
.search-summary { padding: 9px 10px 8px; color: #898981; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.search-result { display: block; width: 100%; padding: 10px; border: 0; border-radius: 3px; background: transparent; text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus-visible { background: #f1f5f2; }
.search-more { width: 100%; padding: 11px 9px; border: 0; border-top: 1px solid #eeece6; background: transparent; color: #628694; font-size: 11px; font-weight: 600; cursor: pointer; }
.search-more:hover { background: #f1f5f2; }
.result-reference { display: block; margin-bottom: 4px; color: #628694; font-size: 10px; font-weight: 700; }
.result-text { display: -webkit-box; overflow: hidden; color: #44443e; font-family: var(--serif); font-size: 15px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.result-text mark { border-radius: 2px; background: var(--yellow); color: inherit; }
.search-empty { padding: 17px 10px; color: #77776f; font-size: 13px; }

.workspace { min-height: calc(100vh - 99px); display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: calc(100vh - 30px); min-height: 590px; display: flex; flex-direction: column; padding: 31px 25px 20px 4px; border-right: 1px solid rgba(71, 72, 67, .13); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 11px 21px; }
.eyebrow { color: #81827b; font-size: 9px; font-weight: 700; letter-spacing: 1.1px; }
.book-total { color: #4a4b45; font-family: var(--serif); font-size: 18px; }
.book-total span { color: #8a8b83; font-family: var(--sans); font-size: 10px; }
.testament-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0 5px 15px; padding: 4px; border-radius: 5px; background: var(--pink); }
.testament-tab { height: 34px; border: 0; border-radius: 3px; background: transparent; color: #777970; font-size: 11px; font-weight: 600; cursor: pointer; transition: background .18s, color .18s; }
.testament-tab span { margin-left: 4px; color: #a09f97; font-size: 9px; }
.testament-tab.is-active { background: #fffefa; color: #343631; box-shadow: 0 1px 3px rgba(48,47,42,.08); }
.testament-tab.is-active span { color: #8e8d85; }
.book-list { flex: 1; overflow: auto; padding: 0 5px 15px; scrollbar-color: #d5d2c9 transparent; scrollbar-width: thin; }
.book-row { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 3px; background: transparent; color: #676860; text-align: left; cursor: pointer; transition: background .16s, color .16s; }
.book-row:hover { background: rgba(255,255,255,.58); color: var(--ink); }
.book-row.is-current { border: 1px solid transparent; border-radius: 4px; background: linear-gradient(var(--blue), var(--blue)) padding-box, linear-gradient(120deg, var(--blue-strong), var(--lavender), var(--pink), var(--green)) border-box; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); color: #304c56; }
.book-index { width: 19px; color: #a09f97; font-size: 9px; font-variant-numeric: tabular-nums; }
.book-row.is-current .book-index { color: #708f99; }
.book-name { flex: 1; font-size: 12px; font-weight: 500; }
.book-chapters { color: #a4a39b; font-size: 9px; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; padding: 14px 10px 1px; border-top: 1px solid rgba(71,72,67,.11); color: #96968e; font-family: var(--serif); font-size: 12px; font-style: italic; }
.foot-flower { color: var(--lavender); font-size: 14px; font-style: normal; }

.reader { width: min(100%, 930px); min-width: 0; margin: 0 auto; padding: 25px clamp(28px, 6vw, 92px) 48px; animation: page-in .45s ease both; }
.reader-topline { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #84857d; font-size: 9px; font-weight: 700; letter-spacing: .95px; }
.crumb-slash { color: #c6c3b9; }
.chapter-navigation { display: flex; align-items: center; gap: 7px; }
.chapter-arrow { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #e5e2da; border-radius: 3px; background: rgba(255,255,255,.48); color: #74756e; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s; }
.chapter-arrow:hover { border-color: #c8d8d5; background: #e8f0ea; }
.chapter-picker { position: relative; display: flex; align-items: center; }
.chapter-select { min-width: 69px; height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 9px; border: 1px solid var(--pink); border-radius: 4px; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 14px; cursor: pointer; box-shadow: 0 2px 0 #edc4d0; transition: background .16s, border-color .16s, box-shadow .16s; }
.chapter-select:hover, .chapter-select[aria-expanded="true"] { border-color: #e9aebf; background: var(--pink); box-shadow: 0 2px 0 #e9aebf; }
.chapter-select-flower { color: #b86f84; font-size: 9px; }
.select-caret { color: #85857c; font-family: var(--sans); font-size: 14px; line-height: 1; }
.chapter-popover { position: absolute; z-index: 8; top: calc(100% + 9px); right: 0; width: min(286px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--pink); border-radius: 6px; background: var(--paper); box-shadow: 0 14px 36px rgba(100,65,75,.18); transform-origin: top right; animation: chapter-menu-in .18s ease-out both; }
.chapter-popover[hidden] { display: none; }
.chapter-menu-heading { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 3px 4px 10px; border-bottom: 1px solid var(--line); }
.chapter-menu-flower { color: #d18499; font-size: 18px; }
.chapter-menu-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chapter-menu-kicker { color: #898981; font-size: 7px; font-weight: 700; letter-spacing: 1px; }
.chapter-menu-heading h2 { overflow: hidden; margin: 0; color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 400; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.chapter-options-count { color: #898981; font-size: 7px; font-weight: 700; letter-spacing: .55px; white-space: nowrap; }
.chapter-options-grid { max-height: min(272px, 50vh); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; overflow: auto; padding: 10px 2px 2px; scrollbar-color: #d9b3bf transparent; scrollbar-width: thin; }
.chapter-option { min-width: 0; min-height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #4a4745; font-family: var(--serif); font-size: 13px; cursor: pointer; transition: background .14s, border-color .14s, color .14s, box-shadow .14s; }
.chapter-option:hover { border-color: var(--lavender); background: var(--lavender); }
.chapter-option[aria-selected="true"] { border-color: #e9aebf; background: var(--pink); color: #67434e; box-shadow: 0 2px 0 #e9aebf; }
.chapter-option[aria-selected="true"]:hover { border-color: #e9aebf; background: var(--pink); }
.chapter-option:focus-visible { outline: 2px solid #9a7481; outline-offset: 2px; }
.chapter-label { color: #92928a; font-size: 8px; font-weight: 700; letter-spacing: .8px; }
.chapter-heading { padding: 54px 0 27px; }
.chapter-kicker { display: flex; align-items: center; gap: 10px; color: #8a8b82; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.kicker-dash { width: 23px; height: 1px; background: var(--lavender); }
.chapter-heading h1 { margin: 13px 0 12px; font-family: var(--serif); font-size: clamp(42px, 5vw, 58px); font-weight: 400; line-height: 1.05; letter-spacing: 0; }
.heading-number {
  background-image: var(--chapter-gradient, linear-gradient(0deg, var(--chapter-blue) 0%, var(--chapter-lavender) 33%, var(--chapter-pink) 66%, var(--chapter-green) 100%));
  background-clip: text;
  -webkit-text-stroke: 1.5px var(--ink);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  paint-order: stroke fill;
}
.chapter-meta { display: flex; align-items: center; gap: 9px; margin: 0; color: #85867e; font-size: 10px; }
.meta-dot { width: 5px; height: 5px; }
.meta-divider { color: #c4c1b8; }
.reader-rule { display: flex; align-items: center; gap: 5px; height: 1px; margin-bottom: 25px; background: var(--line); }
.reader-rule span { width: 4px; height: 4px; display: block; border-radius: 50%; background: var(--lavender); }
.reader-rule span:nth-child(2) { background: var(--yellow); }
.reader-rule span:nth-child(3) { background: var(--green); }
.verse-list { padding: 0 0 9px; }
.verse { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 7px; margin: 0; padding: 8px 10px 8px 0; border-radius: 3px; color: #40413c; font-family: var(--serif); font-size: 18px; line-height: 1.78; transition: background .45s; scroll-margin-top: 28px; }
.verse-number { padding-top: 5px; color: #a7a49a; font-family: var(--sans); font-size: 9px; font-weight: 600; text-align: right; }
.verse-text { min-width: 0; }
.verse.is-focused { background: var(--yellow); animation: verse-glow 2.2s ease both; }
.chapter-footer { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 23px 0 28px; color: #a2a198; font-size: 8px; font-weight: 700; letter-spacing: 1.3px; }
.footer-ornament { color: var(--lavender); font-size: 11px; }
.bottom-navigation { display: flex; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--line); }
.bottom-chapter { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 3px; background: transparent; color: #77786f; text-align: left; cursor: pointer; }
.bottom-chapter:hover { background: rgba(255,255,255,.62); }
.bottom-chapter > span:first-child:last-child, .bottom-chapter > span:last-child { color: #8daab0; font-size: 18px; }
.bottom-chapter.next { text-align: right; }
.bottom-chapter small, .bottom-chapter strong { display: block; }
.bottom-chapter small { margin-bottom: 3px; color: #999991; font-size: 8px; font-weight: 700; letter-spacing: .9px; }
.bottom-chapter strong { color: #4d4e48; font-family: var(--serif); font-size: 13px; font-weight: 500; }
.mobile-menu, .sidebar-scrim { display: none; }

@keyframes page-in { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes chapter-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes verse-glow { 0%, 100% { background: transparent; } 20%, 65% { background: var(--yellow); } }

@media (min-width: 1250px) {
  .chapter-heading { padding-top: 66px; }
  .verse { font-size: 19px; }
}

@media (max-width: 900px) {
  .app-shell { padding: 0 24px; }
  .topbar { grid-template-columns: 235px minmax(220px, 1fr) auto; gap: 16px; }
  .topbar-note { display: none; }
  .workspace { grid-template-columns: 235px minmax(0, 1fr); }
  .sidebar { padding-right: 15px; }
  .reader { padding-right: 34px; padding-left: 34px; }
}

@media (max-width: 640px) {
  .app-shell { padding: 0 17px; }
  .topbar { height: 76px; grid-template-columns: 32px 1fr auto; gap: 10px; }
  .mobile-menu { width: 30px; height: 34px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 5px; border: 0; background: transparent; cursor: pointer; }
  .mobile-menu span { width: 18px; height: 1.5px; background: #55574f; }
  .brand { gap: 9px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-copy strong { font-size: 20px; }
  .brand-copy small { font-size: 7px; letter-spacing: .9px; }
  .shortcuts-trigger { grid-column: 3; grid-row: 1; width: 34px; min-height: 34px; padding: 0; }
  .shortcuts-trigger-label { display: none; }
  .search-wrap { grid-column: 1 / -1; grid-row: 2; margin: 0 0 10px; }
  .topbar { height: 132px; align-content: center; }
  .search-box { height: 40px; }
  .search-box kbd { display: none; }
  .workspace { min-height: calc(100vh - 133px); display: block; }
  .sidebar { position: fixed; z-index: 10; top: 0; bottom: 0; left: 0; width: min(310px, 86vw); height: 100dvh; min-height: 0; padding: 24px 19px 16px; border-right: 1px solid var(--line); background: var(--paper); box-shadow: 14px 0 45px rgba(42,41,37,.08); transform: translateX(-105%); transition: transform .24s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 9; inset: 0; display: block; background: rgba(40,40,36,.28); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
  .sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }
  .reader { padding: 17px 5px 35px; }
  .reader-topline { align-items: flex-start; }
  .breadcrumbs { gap: 6px; padding-top: 10px; font-size: 8px; letter-spacing: .55px; }
  .chapter-navigation { gap: 5px; }
  .chapter-label { display: none; }
  .chapter-arrow { width: 29px; height: 29px; }
  .chapter-select { min-width: 62px; }
  .chapter-heading { padding: 42px 0 23px; }
  .chapter-heading h1 { font-size: 45px; }
  .shortcuts-panel { padding: 23px 21px 19px; }
  .verse { grid-template-columns: 27px minmax(0, 1fr); gap: 5px; padding: 7px 4px 7px 0; font-size: 17px; line-height: 1.72; }
  .verse-number { font-size: 8px; }
  .reader-rule { margin-bottom: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}