:root {
  color-scheme: light;
  --background: #F0EFF4;
  --blue: #8CA9D3;
  --coral: #F26659;
  --gold: #EBC999;
  --ink: #303849;
  --muted: #606878;
  --line: #dedee8;
  --verse-size: 20px;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button, select { color: var(--ink); }
a { color: #405d87; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #496b9b; outline-offset: 4px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }

.site-header {
  max-width: 1440px;
  margin: auto;
  padding: 38px 48px;
  display: flex;
  align-items: center;
  gap: 42px;
}
.logo { width: 245px; height: auto; display: block; }
.header-title { border-left: 1px solid #d4d2df; padding-left: 40px; }
.eyebrow { margin: 0 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.header-title .eyebrow { color: #685e58; }
h1 { font: 400 38px/1.2 Georgia, "Times New Roman", serif; margin: 0 0 9px; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.edition { margin-left: auto; padding: 9px 15px; border: 1px solid #d8c19f; border-radius: 30px; font-size: 12px; white-space: nowrap; }

.layout { max-width: 1344px; margin: 8px auto 56px; display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 36px; padding: 0 24px; align-items: start; }
.sidebar { padding: 24px 0; position: sticky; top: 16px; }
.sidebar-heading h2 { font-size: 19px; font-weight: 600; margin: 0 0 24px; }
.sidebar-heading .eyebrow { color: var(--muted); font-size: 10px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.compact-navigation { display: none; }
.book-list { max-height: calc(100vh - 240px); min-height: 250px; overflow-y: auto; scrollbar-width: thin; padding-right: 12px; }
.book-group h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 24px 0 12px; color: #596477; }
.book-group:first-child h3 { margin-top: 0; }
.book-group ul { margin: 0; padding: 0; list-style: none; }
.book-button { width: 100%; text-align: left; background: transparent; border: 0; border-left: 3px solid transparent; border-radius: 0 6px 6px 0; padding: 9px 14px; font-size: 14px; }
.book-button:hover { background: #e5e7ee; }
.book-button[aria-current="true"] { background: #dce5f2; border-left-color: var(--coral); color: #344f78; font-weight: 600; }
.source-note { font-size: 12px; color: var(--muted); line-height: 1.6; max-width: 230px; margin: 24px 0 0; }
main { min-width: 0; }
.reader { border: 1px solid #e1dfe8; border-radius: 12px; background: #fff; box-shadow: 0 8px 30px #30384905; overflow: hidden; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 30px; border-bottom: 1px solid #eeedf2; background: #fcfbfd; gap: 16px; }
.chapter-choice { display: flex; align-items: center; gap: 12px; }
.chapter-choice label { font-size: 13px; color: var(--muted); }
select { background: white; border: 1px solid #d7d9e2; border-radius: 6px; padding: 8px 30px 8px 12px; }
.font-controls { display: flex; gap: 5px; }
.font-controls button { min-width: 44px; background: white; border: 1px solid #d7d9e2; border-radius: 6px; font-family: Georgia, "Times New Roman", serif; font-size: 19px; }
.font-controls button:not(:disabled):hover { background: #eaf0f8; }
.reading-page { max-width: 780px; margin: auto; padding: 48px 54px 38px; }
.reading-page > .eyebrow { color: #596b86; text-align: center; }
.reading-page h2 { font: 400 42px/1.2 Georgia, "Times New Roman", serif; text-align: center; margin: 16px 0 8px; overflow-wrap: anywhere; }
.chapter-caption { text-align: center; color: var(--muted); font-size: 15px; margin: 0; }
.gold-rule { height: 3px; width: 42px; background: var(--gold); margin: 26px auto 34px; border-radius: 3px; }
.verses { font: var(--verse-size)/1.85 Georgia, "Times New Roman", serif; color: #343641; overflow-wrap: break-word; }
.verse { margin: 0 0 12px; }
.verse-number { font-family: "Segoe UI", Arial, sans-serif; font-size: .58em; line-height: 0; vertical-align: super; color: #516b90; margin-right: .65em; user-select: none; }
.verse-text { white-space: pre-wrap; }
.empty-notice, .warning-message { background: #fff5e7; border-left: 3px solid var(--gold); padding: 12px 16px; font-size: 13px; line-height: 1.6; }
.empty-notice { margin: 0 0 24px; }
.chapter-navigation { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #eeedf2; padding: 24px 30px; }
.chapter-navigation button { background: white; border: 1px solid #d7d9e2; border-radius: 6px; padding: 12px 16px; font-size: 13px; }
.chapter-navigation button:not(:disabled):hover { background: #eaf0f8; border-color: var(--blue); }
#next-chapter { background: #e8eef7; border-color: #c2d1e6; }
.load-status { display: flex; align-items: center; gap: 14px; padding: 48px 24px; }
.spinner { width: 24px; height: 24px; border: 3px solid #d4deed; border-top-color: #516b90; border-radius: 50%; animation: spin 1s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-message { border-left: 3px solid var(--coral); padding: 20px; background: #fff1ee; line-height: 1.6; }
.site-footer { padding: 28px 24px 34px; border-top: 1px solid #dedce6; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }
.site-footer strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.site-footer p { margin: 6px 0 0; }

@media (max-width: 1000px) {
  .site-header { padding: 28px 24px; gap: 26px; }
  .logo { width: 210px; }
  .header-title { padding-left: 26px; }
  .edition { display: none; }
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
  .reading-page { padding: 36px 30px 28px; }
  .reader-toolbar, .chapter-navigation { padding: 16px 20px; }
}
@media (max-width: 760px) {
  .site-header { flex-direction: column; gap: 24px; text-align: center; padding: 26px 20px; }
  .logo { width: 230px; max-width: 100%; }
  .header-title { padding-left: 0; border: 0; }
  h1 { font-size: 33px; }
  .layout { display: block; padding: 0 16px; margin-bottom: 32px; }
  .sidebar { position: static; padding: 0 0 22px; }
  .sidebar-heading, .book-list { display: none; }
  .compact-navigation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px 12px; }
  .compact-navigation label { font-size: 12px; color: var(--muted); }
  .compact-navigation label[for="testament-select"] { grid-column: 1; grid-row: 1; }
  .compact-navigation label[for="book-select"] { grid-column: 2; grid-row: 1; }
  .compact-navigation select { width: 100%; min-width: 0; font-size: 13px; }
  .source-note { max-width: none; margin-top: 12px; font-size: 11px; }
  .reading-page { padding: 30px 24px 20px; }
  .reading-page h2 { font-size: 35px; }
  .reader-toolbar, .chapter-navigation { padding: 14px 16px; }
  .chapter-navigation { gap: 10px; }
  .chapter-navigation button { flex: 1; padding: 10px 8px; font-size: 12px; }
  .verses { line-height: 1.8; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
