@font-face {
  font-family: 'Trajan';
  src: local('Trajan Pro'), local('Trajan'), serif;
}

:root {
  --primary: #063970;
  --primary-dark: #052c55;
  --gold: #d4af37;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --text: #1f2a36;
  --muted: #4b5563;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eff3f7 0%, #f8fafc 100%);
  color: var(--text);
  font-family: 'Trajan', serif;
}

.bib-main {
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #eff3f7 0%, #f8fafc 100%);
  color: var(--text);
}

.bib-shell {
  max-width: 1200px;
  margin: 0 auto;
}

.bib-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  border-left: 6px solid var(--gold);
}

.bib-kicker {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.4);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.bib-title {
  margin: 0;
  font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem);
  line-height: 1.1;
  font-weight: 700;
}

.bib-subtitle {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  font-size: 1rem;
}

.bib-app {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}
.bib-panel,
.bib-book-intro-card,
.bib-content,
.bib-reader-head,
.bib-chapter-nav,
.bib-actions,
.bib-loading {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.bib-panel {
  padding: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.bib-panel h2 {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 10px;
}

.bib-panel-note {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.bib-sections {
  display: grid;
  gap: 0;
}

.bib-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-alt);
}

.bib-section summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  color: var(--primary);
  transition: background-color 0.18s ease;
}

.bib-section summary:hover {
  background-color: var(--surface);
}

.bib-section summary::-webkit-details-marker {
  display: none;
}

.bib-section-count {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(212, 175, 55, 0.1);
  padding: 4px 8px;
  border-radius: 999px;
}

.bib-book-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.bib-book-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  font-size: 0.95rem;
}

.bib-book-link:hover,
.bib-book-link.is-active {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(6, 57, 112, 0.1);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(6, 57, 112, 0.02) 100%);
}

.bib-book-number {
  grid-row: span 2;
  align-self: start;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
}

.bib-book-name {
  font-weight: 700;
  color: var(--primary);
}

.bib-book-meta {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bib-reader {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.bib-reader-head,
.bib-chapter-nav,
.bib-loading,
.bib-content {
  padding: 20px;
}

.bib-reader-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bib-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.bib-actions {
  display: inline-flex;
  gap: 10px;
  padding: 10px;
}

.bib-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bib-action-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(6, 57, 112, 0.1);
  border-color: var(--primary);
}

.bib-action-link[aria-disabled='true'] {
  opacity: 0.4;
  pointer-events: none;
}

.bib-book-intro-card {
  padding: 20px;
}

.bib-book-intro-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.bib-book-kicker {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

.bib-book-title {
  color: var(--primary);
  font-size: 1.4rem;
  margin: 8px 0 0;
  font-weight: 700;
}

.bib-book-badge {
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
}

.bib-book-source {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.bib-book-source a {
  color: var(--primary);
  font-weight: 700;
}

.bib-chapter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--primary);
}

.bib-chapter-label {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.bib-chapter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bib-chapter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.bib-chapter-pill:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--surface-alt);
}

.bib-chapter-pill.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: var(--primary);
}

.bib-content {
  min-height: 460px;
}

.bib-loading {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.bib-loading-error {
  border-color: rgba(220, 38, 38, 0.3);
  color: #991b1b;
}

.bib-chapter-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 14px;
}

.bib-book-label {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
}

.bib-chapter-header h3 {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  margin: 0;
  color: var(--primary);
  font-weight: 700;
}

.bib-verse-list {
  display: grid;
  gap: 8px;
}

.bib-verse {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--gold);
  align-items: baseline;
}

.bib-verse-number {
  color: var(--primary);
  font-weight: 800;
  min-width: 50px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.bib-verse p {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

@media (max-width: 1100px) {
  .bib-app {
    grid-template-columns: 1fr;
  }

  .bib-panel {
    position: static;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 900px) {
  .bib-app {
    grid-template-columns: 1fr;
  }

  .bib-reader-head {
    padding: 16px;
    flex-direction: column;
  }

  .bib-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .bib-main {
    padding: 16px;
  }

  .bib-hero {
    padding: 20px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
  }

  .bib-title {
    font-size: 1.6rem;
  }

  .bib-panel,
  .bib-reader-head,
  .bib-chapter-nav,
  .bib-loading,
  .bib-content,
  .bib-book-intro-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .bib-reader-head {
    flex-direction: column;
    align-items: stretch;
  }

  .bib-actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .bib-verse {
    grid-template-columns: 1fr;
  }

  .bib-chapter-pills {
    gap: 4px;
  }

  .bib-chapter-pill {
    min-width: 32px;
    padding: 0 8px;
    font-size: 0.75rem;
  }
}