/* ============================================================
   BÍBLIA & HARPA — ASSEMBLÉIA DE DEUS
   Paleta: Verde escuro AD + dourado + tons quentes
   ============================================================ */

/* ── VARIÁVEIS ─────────────────────────────────────────────── */
:root {
  /* MODO ESCURO (padrão) */
  --bg-primary:      #0a1a12;
  --bg-secondary:    #0f2218;
  --bg-card:         #152d1f;
  --bg-hover:        #1c3828;
  --bg-sidebar:      #0b1e14;
  --bg-topbar:       rgba(10,26,18,0.95);

  --text-primary:    #e8f0eb;
  --text-secondary:  #b8cec0;
  --text-muted:      #6b8c76;
  --text-verse:      #ddeae1;

  --brand:           #4caf7d;
  --brand-dark:      #2e7d52;
  --brand-light:     #6ecf97;
  --brand-bg:        rgba(76,175,125,0.10);
  --brand-bg-strong: rgba(76,175,125,0.18);

  --gold:            #c9a84c;
  --gold-light:      #e8c96a;
  --gold-bg:         rgba(201,168,76,0.12);

  --border:          rgba(76,175,125,0.20);
  --border-soft:     rgba(255,255,255,0.06);
  --border-card:     rgba(76,175,125,0.14);

  --shadow-sm:       0 1px 4px rgba(0,0,0,0.3);
  --shadow:          0 4px 16px rgba(0,0,0,0.4);
  --shadow-card:     0 2px 8px rgba(0,0,0,0.25);

  --sidebar-w:       284px;
  --topbar-h:        56px;
  --font-verse:      16px;
  --radius:          8px;
  --radius-lg:       14px;
  --radius-xl:       20px;
  --transition:      0.18s ease;
}

/* MODO CLARO */
body:not(.dark-mode) {
  --bg-primary:      #f4f9f6;
  --bg-secondary:    #eaf3ee;
  --bg-card:         #ffffff;
  --bg-hover:        #e4f0e9;
  --bg-sidebar:      #f0f8f3;
  --bg-topbar:       rgba(244,249,246,0.96);

  --text-primary:    #0f2e1c;
  --text-secondary:  #2d5c3d;
  --text-muted:      #6b9478;
  --text-verse:      #1a3d27;

  --brand:           #1b7a48;
  --brand-dark:      #0f4a2c;
  --brand-light:     #2ea05e;
  --brand-bg:        rgba(27,122,72,0.08);
  --brand-bg-strong: rgba(27,122,72,0.14);

  --gold:            #9a6e20;
  --gold-light:      #b88830;
  --gold-bg:         rgba(154,110,32,0.10);

  --border:          rgba(27,122,72,0.20);
  --border-soft:     rgba(0,0,0,0.08);
  --border-card:     rgba(27,122,72,0.14);

  --shadow-sm:       0 1px 3px rgba(0,0,0,0.08);
  --shadow:          0 4px 16px rgba(0,0,0,0.10);
  --shadow-card:     0 2px 6px rgba(0,0,0,0.08);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ── INSTALL BANNER ─────────────────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 2px solid var(--brand);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  z-index: 9998;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.install-banner.visible { display: flex; }
.install-banner-logo img {
  border-radius: 50%;
  flex-shrink: 0;
}
.install-banner-text {
  flex: 1;
  min-width: 0;
}
.install-banner-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.install-banner-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}
.install-banner-btn {
  padding: 8px 18px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background var(--transition);
}
.install-banner-btn:hover { background: var(--brand-light); }
.install-banner-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  border-radius: 6px;
  flex-shrink: 0;
}
.install-banner-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── OFFLINE BADGE ──────────────────────────────────────────── */
.offline-badge {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  left: 50%; transform: translateX(-50%);
  background: #7a3a00;
  color: #ffd180;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  z-index: 500;
  display: none;
  white-space: nowrap;
}
.offline-badge.visible { display: block; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh; height: 100dvh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.sidebar.open { transform: translateX(0); }

/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-dark) 0%, #0d3520 100%);
}

.logo { display: flex; align-items: center; gap: 10px; }

.logo-img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(201,168,76,0.3);
}

.logo-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}
.logo-sub {
  display: block;
  font-size: 9.5px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6);
  border-radius: 6px;
  font-size: 13px;
  transition: all var(--transition);
}
.sidebar-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Mode switch */
.mode-switch {
  display: flex;
  gap: 6px;
  padding: 10px 12px 6px;
  flex-shrink: 0;
}
.mode-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  font-size: 12px; font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  transition: all var(--transition);
}
.mode-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.mode-btn.active {
  background: var(--brand-bg-strong);
  border-color: var(--brand);
  color: var(--brand);
}
.mode-icon { font-size: 14px; }

/* Sidebar search */
.sidebar-search { padding: 8px 12px 4px; flex-shrink: 0; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 10px;
  color: var(--text-muted); font-size: 15px;
  pointer-events: none; z-index: 1;
}
.search-wrap input {
  width: 100%;
  padding: 8px 30px 8px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-bg);
}
.search-clear {
  position: absolute; right: 8px;
  color: var(--text-muted); font-size: 11px;
  padding: 4px; border-radius: 4px;
  display: none; transition: color var(--transition);
}
.search-clear.visible { display: block; }
.search-clear:hover { color: var(--text-primary); }

/* Sidebar module */
.sidebar-module {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0; overflow: hidden;
}

/* Testament tabs */
.testament-tabs {
  display: flex; gap: 4px;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}
.tab-btn {
  flex: 1; padding: 7px 8px;
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.tab-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }
.tab-btn.active {
  background: var(--brand-bg-strong);
  color: var(--brand);
  border-color: var(--border);
}

/* Books nav */
.books-nav { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.book-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px;
  border-radius: 7px; cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.book-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.book-item.active { background: var(--brand-bg-strong); color: var(--brand); }
.book-abbr {
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--text-muted); width: 26px; flex-shrink: 0; text-align: right;
}
.book-item.active .book-abbr { color: var(--brand); }
.book-name-text { font-size: 13px; flex: 1; }
.book-chapters { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }

/* Harpa filter */
.harpa-filter { padding: 6px 12px 4px; flex-shrink: 0; }
.harpa-filter-input {
  width: 100%; padding: 7px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  color: var(--text-primary); font-size: 12px; outline: none;
  transition: border-color var(--transition);
}
.harpa-filter-input:focus { border-color: var(--brand); }
.harpa-filter-input::placeholder { color: var(--text-muted); }

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; gap: 8px;
}
.theme-toggle {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px;
  border-radius: 8px; border: 1px solid var(--border-soft);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  transition: all var(--transition); flex: 1;
}
.theme-toggle:hover { background: var(--bg-hover); border-color: var(--brand); }
.theme-icon { font-size: 15px; }
.font-controls { display: flex; gap: 4px; }
.font-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid var(--border-soft);
  color: var(--text-secondary); font-size: 11px; font-weight: 600;
  transition: all var(--transition);
}
.font-btn:hover { background: var(--bg-hover); border-color: var(--brand); color: var(--brand); }

/* ── OVERLAY ────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 250; opacity: 0; pointer-events: none;
  transition: opacity 0.28s;
}
.overlay.active { opacity: 1; pointer-events: all; }

/* ── TOPBAR ─────────────────────────────────────────────────── */
.main { margin-left: 0; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-soft);
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.menu-btn {
  width: 36px; height: 36px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; border-radius: 8px; flex-shrink: 0;
  transition: background var(--transition);
}
.menu-btn:hover { background: var(--bg-hover); }
.menu-btn span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text-primary); border-radius: 1px;
}

/* Topbar logo (home) */
.topbar-logo {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.topbar-logo-img {
  width: 28px; height: 28px;
  border-radius: 50%; border: 1.5px solid var(--gold);
  object-fit: cover; flex-shrink: 0;
}
.topbar-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

/* Breadcrumb */
.breadcrumb {
  flex: 1; display: flex; align-items: center;
  gap: 5px; overflow: hidden; min-width: 0;
}
.breadcrumb.hidden { display: none; }
.bc-item {
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: color var(--transition);
}
.bc-item:hover { color: var(--brand); }
.bc-item.bc-current { color: var(--text-primary); font-weight: 500; cursor: default; }
.bc-sep { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }

.topbar-actions { display: flex; gap: 2px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-secondary); font-size: 16px;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--brand); }
.icon-btn.active { color: var(--brand); }

/* Mobile search */
.mobile-search {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: none; background: var(--bg-primary);
}
.mobile-search.visible { display: block; }

/* ── CONTENT & VIEWS ────────────────────────────────────────── */
.content { flex: 1; position: relative; }

.view {
  display: none;
  padding: 0 16px 100px;
  animation: fadeIn 0.2s ease;
}
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-header {
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 22px;
}
.view-title {
  font-family: 'Lora', serif;
  font-size: 24px; font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.4px; line-height: 1.2;
}
.view-sub {
  margin-top: 5px; font-size: 13px; color: var(--text-muted);
}

/* ── HOME VIEW ──────────────────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: 32px 16px 28px;
}

.hero-logo-wrap {
  display: flex; justify-content: center;
  margin-bottom: 18px;
}
.hero-logo {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px var(--gold-bg), 0 8px 32px rgba(0,0,0,0.3);
}

.hero-title {
  font-family: 'Lora', serif;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.8px;
  line-height: 1.1;
  margin-bottom: 6px;
}

.hero-church {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  opacity: 0.9;
}

.hero-sub {
  font-size: 12px; color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* Home tabs */
.home-tabs {
  display: flex; gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-soft);
}
.home-tab {
  flex: 1; padding: 11px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  text-align: center;
}
.home-tab:hover { color: var(--brand); }
.home-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Home panels */
.home-panel { display: none; }
.home-panel.active { display: block; }

/* Card of day */
.card-of-day {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-of-day::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--gold), var(--brand));
}
.card-of-day::after {
  content: '';
  position: absolute; top: 3px; right: 0; bottom: 0;
  width: 120px;
  background: radial-gradient(ellipse at top right, var(--brand-bg) 0%, transparent 70%);
  pointer-events: none;
}

.cod-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
}

.vod-text {
  font-family: 'Lora', serif;
  font-size: clamp(15px, 2.8vw, 19px);
  font-style: italic; font-weight: 400;
  color: var(--text-verse);
  line-height: 1.8; margin-bottom: 10px;
  border-left: 3px solid var(--brand);
  padding-left: 14px;
}

.vod-ref {
  font-size: 12px; font-weight: 600;
  color: var(--brand); font-style: normal;
  display: block; margin-bottom: 16px;
  cursor: pointer; transition: color var(--transition);
  letter-spacing: 0.2px;
}
.vod-ref:hover { color: var(--brand-light); }

.cod-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.action-btn {
  padding: 7px 14px;
  font-size: 12px; font-weight: 500;
  border-radius: 7px; border: 1px solid var(--border);
  color: var(--text-secondary); background: var(--bg-hover);
  transition: all var(--transition);
}
.action-btn:hover { background: var(--brand-bg-strong); border-color: var(--brand); color: var(--brand); }
.action-btn.primary {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.action-btn.primary:hover { background: var(--brand-light); border-color: var(--brand-light); }
.action-btn.ghost { background: transparent; }
.action-btn.favorited { background: var(--gold-bg); border-color: var(--gold); color: var(--gold); }

/* Hino do dia */
.hino-do-dia { }
.hod-num {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 5px;
}
.hod-title {
  font-family: 'Lora', serif;
  font-size: clamp(17px, 3vw, 22px); font-weight: 500;
  color: var(--text-primary); margin-bottom: 3px; line-height: 1.3;
}
.hod-autor { font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }
.hod-preview {
  font-family: 'Lora', serif; font-size: 14px; font-style: italic;
  color: var(--text-verse); line-height: 1.8;
  border-left: 3px solid var(--brand); padding-left: 14px;
  margin-bottom: 16px; white-space: pre-line;
}

/* Home section */
.home-section { margin-bottom: 36px; }
.section-title {
  font-family: 'Lora', serif;
  font-size: 17px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  letter-spacing: -0.2px;
}

/* Books grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}
.book-card {
  padding: 11px 13px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-sm);
}
.book-card:hover {
  border-color: var(--brand);
  background: var(--brand-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.book-card-name {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.book-card-chapters { font-size: 10px; color: var(--text-muted); }

/* Hymns grid */
.hymns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 6px;
}
.hymn-card {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
  display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow-sm);
}
.hymn-card:hover {
  border-color: var(--brand);
  background: var(--brand-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.hymn-card-num {
  font-size: 10px; font-weight: 700;
  color: var(--brand); letter-spacing: 0.3px;
}
.hymn-card-name {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4;
}

/* ── BOOK VIEW ──────────────────────────────────────────────── */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
}
.chapter-card {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
}
.chapter-card:hover {
  background: var(--brand-bg-strong);
  border-color: var(--brand); color: var(--brand);
  transform: scale(1.05);
}

/* ── CHAPTER VIEW ───────────────────────────────────────────── */
.chapter-nav-top {
  display: flex; align-items: center; gap: 10px;
}
.chapter-title-wrap { flex: 1; text-align: center; }

.chapter-picker {
  margin-top: 6px;
  padding: 5px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text-secondary); font-size: 12px; outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.chapter-picker:focus { border-color: var(--brand); }

.nav-arrow {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--border-soft);
  color: var(--text-secondary); font-size: 16px; flex-shrink: 0;
  transition: all var(--transition);
}
.nav-arrow:hover { background: var(--brand-bg); border-color: var(--brand); color: var(--brand); }
.nav-arrow:disabled { opacity: 0.3; cursor: not-allowed; }

/* Verses */
.verses-container {
  max-width: 720px; margin: 0 auto;
  padding: 8px 0 28px;
}
.verse-row {
  display: flex; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: background var(--transition);
  position: relative;
}
.verse-row:hover { background: var(--bg-hover); }
.verse-row.highlighted { background: var(--brand-bg); }

.verse-num {
  font-size: 10px; font-weight: 700;
  color: var(--gold); min-width: 22px; padding-top: 4px;
  flex-shrink: 0; text-align: right;
  font-family: 'Inter', sans-serif;
}
.verse-text {
  font-family: 'Lora', serif;
  font-size: var(--font-verse);
  color: var(--text-verse); line-height: 1.88; flex: 1;
}
.verse-actions {
  display: none; gap: 3px; align-items: flex-start;
  padding-top: 2px; flex-shrink: 0;
}
.verse-row:hover .verse-actions { display: flex; }
.verse-action-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px; color: var(--text-muted); font-size: 13px;
  transition: all var(--transition);
}
.verse-action-btn:hover { background: var(--bg-card); color: var(--brand); }
.verse-action-btn.favorited { color: var(--gold); }

/* Nav bottom */
.chapter-nav-bottom {
  display: flex; gap: 12px; justify-content: center;
  padding: 20px 0; border-top: 1px solid var(--border-soft);
}
.nav-btn {
  padding: 10px 22px; border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 13px; font-weight: 500; transition: all var(--transition);
}
.nav-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-bg); }
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── HYMN VIEW ──────────────────────────────────────────────── */
.hymn-nav-top {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px;
}
.hymn-title-wrap { flex: 1; text-align: center; }
.hymn-num-badge {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--brand); margin-bottom: 4px;
}
.hymn-meta { margin-top: 4px; font-size: 12px; color: var(--text-muted); }

.hymn-actions-header {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 2px;
}

/* Hymn body */
.hymn-body {
  max-width: 660px; margin: 0 auto;
  padding: 8px 0 28px;
  display: flex; flex-direction: column; gap: 22px;
}
.stanza { display: flex; gap: 12px; align-items: flex-start; }
.stanza-num {
  font-size: 10px; font-weight: 700; color: var(--gold);
  min-width: 16px; padding-top: 5px; flex-shrink: 0;
  text-align: right; font-family: 'Inter', sans-serif;
}
.stanza-text {
  font-family: 'Lora', serif;
  font-size: var(--font-verse);
  color: var(--text-verse); line-height: 1.9; flex: 1;
}
.coro-block {
  background: var(--brand-bg);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.coro-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--brand);
  min-width: 32px; padding-top: 4px; flex-shrink: 0;
}
.coro-text {
  font-family: 'Lora', serif;
  font-size: var(--font-verse); font-style: italic;
  color: var(--text-verse); line-height: 1.9; flex: 1;
}

/* ── SEARCH VIEW ────────────────────────────────────────────── */
.search-results { display: flex; flex-direction: column; gap: 7px; }
.results-section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 4px 2px 8px;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 6px;
}
.search-result-item {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition);
  display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.search-result-item:hover {
  border-color: var(--brand);
  background: var(--brand-bg);
  box-shadow: var(--shadow-card);
}
.result-ref {
  font-size: 11px; font-weight: 600; color: var(--brand);
  white-space: nowrap; min-width: 96px; padding-top: 2px;
  letter-spacing: 0.2px;
}
.result-text {
  font-family: 'Lora', serif;
  font-size: 14px; color: var(--text-verse); line-height: 1.7; flex: 1;
}
.result-text mark {
  background: var(--gold-bg); color: var(--gold);
  border-radius: 2px; padding: 0 2px;
}
.no-results {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.no-results-icon { font-size: 36px; margin-bottom: 14px; opacity: 0.4; }
.no-results-title { font-size: 16px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.no-results-sub { font-size: 13px; }

/* ── FAVORITES VIEW ─────────────────────────────────────────── */
.fav-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.fav-tab {
  padding: 8px 18px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-radius: 8px;
  border: 1px solid var(--border-soft); transition: all var(--transition);
}
.fav-tab:hover { background: var(--bg-hover); color: var(--text-secondary); }
.fav-tab.active {
  background: var(--brand-bg-strong);
  border-color: var(--brand); color: var(--brand);
}

.favorites-list { display: flex; flex-direction: column; gap: 7px; }
.favorite-item {
  padding: 14px 16px; background: var(--bg-card);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  display: flex; gap: 12px; align-items: flex-start;
  transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.favorite-item:hover { border-color: var(--border-card); }
.fav-ref { font-size: 11px; font-weight: 600; color: var(--brand); white-space: nowrap; min-width: 96px; padding-top: 2px; }
.fav-text {
  font-family: 'Lora', serif; font-size: 14px;
  color: var(--text-verse); line-height: 1.7; flex: 1; cursor: pointer;
}
.fav-actions { display: flex; gap: 4px; }
.fav-remove-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--text-muted); font-size: 12px;
  transition: all var(--transition);
}
.fav-remove-btn:hover { background: rgba(220,50,50,0.1); color: #e55; }

.empty-state {
  text-align: center; padding: 70px 20px; color: var(--text-muted);
}
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.3; display: block; }
.empty-title { font-size: 17px; font-weight: 500; color: var(--text-secondary); margin-bottom: 7px; }
.empty-sub { font-size: 13px; }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 22px;
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  box-shadow: var(--shadow); z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: all 0.28s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap; max-width: 88vw; text-align: center;
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* ── DESKTOP ────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .sidebar { transform: translateX(0) !important; }
  .main { margin-left: var(--sidebar-w); }
  .menu-btn { display: none; }
  .sidebar-close { display: none; }
  .overlay { display: none !important; }
  .topbar-logo { display: none; }
  .breadcrumb { display: flex !important; }
}

/* ── TABLET ─────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .view { padding: 0 24px 100px; }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .chapters-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
  .hymns-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

/* ── WIDE ───────────────────────────────────────────────────── */
@media (min-width: 1280px) {
  .view { max-width: 980px; padding: 0 40px 100px; }
}

/* ── SAFE AREA (notch) ──────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .install-banner { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .sidebar { padding-top: env(safe-area-inset-top); }
}
