/* ============================================================================
   AmourCatho — Refonte UX Bible Sprint 1
   Styles pour barre flottante glassmorphism + panneau latéral + animations
   ============================================================================
   Hiérarchie z-index :
     - Modale notes : 9999 (existant)
     - Backdrop overlay : 850
     - Panneau latéral : 800
     - Barre flottante : 700
     - Bottom sheet sélection verset existant : 600
     - Contenu Bible : 1
   ============================================================================ */

/* ────── Variables locales (definies sur :root pour exposition globale) ────── */
:root {
  --br-rose: #9C2759;
  --br-rose-dark: #7D1F47;
  --br-rose-light: #FCE7F3;
  --br-bg-glass: rgba(255, 255, 255, 0.72);
  --br-bg-glass-dark: rgba(156, 39, 89, 0.92);
  --br-shadow: 0 10px 30px rgba(26, 32, 53, 0.10), 0 4px 12px rgba(26, 32, 53, 0.06);
  --br-radius: 14px;
  --br-radius-sm: 8px;
  --br-anim: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ════════════════════════════════════════════════════════════
   1. BARRE FLOTTANTE GLASSMORPHISM
   ════════════════════════════════════════════════════════════ */

.br-floating-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--br-bg-glass, rgba(255, 255, 255, 0.72));
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(156, 39, 89, 0.18);
  border-radius: 999px;
  box-shadow: var(--br-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--br-anim), transform var(--br-anim);
  max-width: 720px;
  width: calc(100% - 32px);
}

.br-floating-bar.br-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Fallback navigateurs sans backdrop-filter (vieux Chrome, Edge legacy) */
@supports not (backdrop-filter: blur(14px)) {
  .br-floating-bar {
    background: rgba(255, 255, 255, 0.95);
  }
}

/* Champ de recherche */
.br-search-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #1a2035;
  outline: none;
  min-width: 0;
}
.br-search-input::placeholder { color: #9ca3af; }

/* Boutons icônes */
.br-icon-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--br-rose, #9C2759);
  font-size: 17px;
  transition: background var(--br-anim), transform 0.1s;
  position: relative;
}
.br-icon-btn:hover { background: var(--br-rose-light, #FCE7F3); }
.br-icon-btn:active { transform: scale(0.92); }
.br-icon-btn.br-active {
  background: var(--br-rose, #9C2759);
  color: #fff;
}

/* Séparateur visuel */
.br-icon-btn + .br-icon-btn { margin-left: 2px; }
.br-floating-bar .br-sep {
  width: 1px;
  height: 22px;
  background: rgba(26, 32, 53, 0.12);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Badge compteur sur bouton (ex : nb notes) */
.br-icon-btn .br-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--br-rose, #9C2759);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Mobile : barre flottante plus compacte, icônes only au début */
@media (max-width: 600px) {
  .br-floating-bar {
    bottom: 12px;
    padding: 8px 10px;
    gap: 6px;
  }
  .br-search-input { padding: 8px 10px; font-size: 13px; }
  .br-icon-btn { width: 34px; height: 34px; font-size: 15px; }
}

/* ════════════════════════════════════════════════════════════
   2. PANNEAU LATÉRAL DROIT (desktop) / BOTTOM SHEET (mobile)
   ════════════════════════════════════════════════════════════ */

.br-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 24px rgba(26, 32, 53, 0.10);
  z-index: 900; /* au-dessus de la barre flottante (700) et du bottom-sheet (600) */
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform var(--br-anim, 250ms cubic-bezier(0.4, 0, 0.2, 1));
}

.br-side-panel.br-open {
  transform: translateX(0);
}

/* Backdrop semi-transparent UNIQUEMENT sur mobile (< 769px).
   Sur desktop : pas de backdrop, le panneau prend 420px a droite
   et la lecture reste 100% interactive a gauche. */
.br-backdrop {
  display: none; /* cache par defaut sur desktop */
  position: fixed;
  inset: 0;
  background: rgba(26, 32, 53, 0.45);
  z-index: 850; /* sous le panneau (900) mais au-dessus du reste */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--br-anim);
}
@media (max-width: 768px) {
  .br-backdrop {
    display: block;
  }
}
.br-backdrop.br-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Header du panneau */
.br-side-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #fdf2f8 0%, #fff 100%);
  flex-shrink: 0;
}
.br-side-panel-title {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--br-rose, #9C2759);
  display: flex;
  align-items: center;
  gap: 8px;
}
.br-side-panel-close {
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.br-side-panel-close:hover { background: #f3f4f6; color: #1a2035; }

/* Corps scrollable du panneau */
.br-side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  -webkit-overflow-scrolling: touch;
}
.br-side-panel-body::-webkit-scrollbar { width: 8px; }
.br-side-panel-body::-webkit-scrollbar-thumb {
  background: rgba(156, 39, 89, 0.25);
  border-radius: 4px;
}

/* Wrapper : card resultat + bouton "comparer" a droite */
.br-result-card-wrap {
  position: relative;
  margin-bottom: 8px;
}
.br-result-card-wrap .br-result-card {
  padding-right: 44px; /* laisse place au bouton compare */
  margin-bottom: 0;
}
.br-result-compare-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--br-rose, #9C2759);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity var(--br-anim, 250ms), background var(--br-anim);
}
.br-result-compare-btn:hover {
  opacity: 1;
  background: rgba(156, 39, 89, 0.10);
}

/* Card résultat de recherche */
.br-result-card {
  display: block;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-left: 3px solid var(--br-rose-light, #FCE7F3);
  border-radius: var(--br-radius-sm, 8px);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background var(--br-anim), border-color var(--br-anim);
}
.br-result-card:hover {
  background: #fdf2f8;
  border-left-color: var(--br-rose, #9C2759);
}
.br-result-card .br-result-ref {
  font-size: 12px;
  font-weight: 700;
  color: var(--br-rose, #9C2759);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.br-result-card .br-result-text {
  font-size: 13.5px;
  color: #374151;
  line-height: 1.55;
}
.br-result-card .br-result-text mark {
  background: #fef3c7;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* État loading */
.br-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 20px;
  color: #6b7280;
  font-size: 13px;
}
.br-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid #fce7f3;
  border-top-color: var(--br-rose, #9C2759);
  border-radius: 50%;
  animation: br-spin 0.8s linear infinite;
}
@keyframes br-spin { to { transform: rotate(360deg); } }

/* État vide */
.br-empty {
  text-align: center;
  padding: 36px 20px;
  color: #9ca3af;
  font-size: 13px;
}
.br-empty i { font-size: 36px; opacity: 0.4; display: block; margin-bottom: 10px; }

/* Section "Recherches récentes" en bas du panneau résultats */
.br-history-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed #e5e7eb;
}
.br-history-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.br-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.br-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #fdf2f8;
  border: 1px solid #fce7f3;
  color: var(--br-rose, #9C2759);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--br-anim);
}
.br-history-chip:hover {
  background: #fce7f3;
}
.br-history-chip .br-history-chip-x {
  margin-left: 4px;
  opacity: 0.55;
  font-size: 10px;
}
.br-history-chip .br-history-chip-x:hover { opacity: 1; }

/* ────── Mobile : panneau plein écran sous forme de bottom sheet ────── */
@media (max-width: 768px) {
  .br-side-panel {
    width: 100%;
    height: 88vh;
    top: auto;
    bottom: 0;
    border-radius: 18px 18px 0 0;
    transform: translateY(110%);
  }
  .br-side-panel.br-open {
    transform: translateY(0);
  }
  .br-side-panel-header {
    border-radius: 18px 18px 0 0;
  }
}

/* ════════════════════════════════════════════════════════════
   3. HIGHLIGHT TEMPORAIRE SUR VERSET CIBLÉ (au clic résultat)
   ════════════════════════════════════════════════════════════ */

.br-verse-flash {
  animation: br-verse-flash-anim 2.8s ease-out;
  border-radius: 4px;
}
@keyframes br-verse-flash-anim {
  0%   { box-shadow: 0 0 0 0 rgba(156, 39, 89, 0.55); background: rgba(156, 39, 89, 0.18); }
  30%  { box-shadow: 0 0 0 6px rgba(156, 39, 89, 0.0);  background: rgba(156, 39, 89, 0.12); }
  100% { box-shadow: 0 0 0 0 rgba(156, 39, 89, 0);     background: transparent; }
}

/* ════════════════════════════════════════════════════════════
   3bis. BANDEAU "REPRENDRE LA LECTURE" (Sprint 2)
   ════════════════════════════════════════════════════════════ */

.br-resume-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px auto 22px;
  max-width: 980px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border: 1px solid #fbcfe8;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(156, 39, 89, 0.08);
  font-size: 14px;
  animation: br-resume-slide-in 350ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes br-resume-slide-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.br-resume-banner.br-resume-hide {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 250ms, transform 250ms;
}

.br-resume-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--br-rose, #9C2759);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.br-resume-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.br-resume-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  font-weight: 700;
}
.br-resume-ref {
  font-size: 16px;
  color: var(--br-rose, #9C2759);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.br-resume-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--br-rose, #9C2759);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--br-anim, 250ms), transform 0.1s;
}
.br-resume-cta:hover {
  background: var(--br-rose-dark, #7D1F47);
  text-decoration: none;
  color: #fff;
}
.br-resume-cta:active { transform: scale(0.96); }
.br-resume-cta i { font-size: 12px; }

.br-resume-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background var(--br-anim);
}
.br-resume-close:hover { background: rgba(156, 39, 89, 0.10); color: var(--br-rose, #9C2759); }

@media (max-width: 600px) {
  .br-resume-banner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    margin: 14px 12px 18px;
  }
  .br-resume-ref { font-size: 14px; }
  .br-resume-cta { padding: 8px 14px; font-size: 12px; }
  .br-resume-icon { width: 36px; height: 36px; font-size: 16px; }
}

/* ════════════════════════════════════════════════════════════
   3ter. ONGLETS PANNEAU HISTORIQUE (Recherches / Lecture) — Sprint 2
   ════════════════════════════════════════════════════════════ */

.br-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  background: #f9fafb;
  border-radius: 10px;
}
.br-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 7px;
  transition: background var(--br-anim, 250ms), color var(--br-anim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.br-tab:hover { color: var(--br-rose, #9C2759); }
.br-tab.br-tab-active {
  background: #fff;
  color: var(--br-rose, #9C2759);
  box-shadow: 0 1px 3px rgba(26, 32, 53, 0.08);
}
.br-tab i { font-size: 12px; }

/* Carte d'entree d'historique de LECTURE (different des chips de recherche) */
.br-reading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background var(--br-anim), border-color var(--br-anim);
}
.br-reading-card:hover {
  background: #fdf2f8;
  border-color: #fbcfe8;
}
.br-reading-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--br-rose-light, #FCE7F3);
  color: var(--br-rose, #9C2759);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.br-reading-card-body { flex: 1; min-width: 0; }
.br-reading-card-ref {
  font-size: 13px;
  font-weight: 700;
  color: var(--br-rose, #9C2759);
  line-height: 1.3;
}
.br-reading-card-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}
.br-reading-card-x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.br-reading-card-x:hover { background: #fce7f3; color: var(--br-rose, #9C2759); }

/* ════════════════════════════════════════════════════════════
   3quater. CARTES FAVORIS DANS LE PANNEAU (Sprint 3)
   ════════════════════════════════════════════════════════════ */

/* Banniere explicative en haut du panneau (distinction favoris vs surbrillances) */
.br-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  margin-bottom: 14px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
}
.br-info-banner i {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.br-info-banner strong { color: #78350f; }

.br-favorite-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 60%);
  border: 1px solid #fef3c7;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background var(--br-anim, 250ms), border-color var(--br-anim);
}
.br-favorite-card:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  text-decoration: none;
  color: inherit;
}

.br-favorite-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fef3c7;
  color: #f59e0b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.br-favorite-card-body { flex: 1; min-width: 0; }
.br-favorite-card-ref {
  font-size: 13px;
  font-weight: 700;
  color: var(--br-rose, #9C2759);
  line-height: 1.3;
}
.br-favorite-card-preview {
  font-size: 12px;
  color: #4b5563;
  margin: 4px 0 0;
  line-height: 1.5;
  font-style: italic;
}
.br-favorite-card-meta {
  font-size: 10.5px;
  color: #6b7280;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.br-favorite-card-x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.br-favorite-card-x:hover { background: #fef3c7; color: #f59e0b; }

/* Bouton Favori dans le bottom-sheet de selection */
#bsFavorite.bs-fav-active {
  background: #fef3c7 !important;
  color: #f59e0b !important;
  border-color: #fcd34d !important;
}

/* ════════════════════════════════════════════════════════════
   3quinquies. COMPARATEUR 2 VERSIONS (Sprint 4)
   ════════════════════════════════════════════════════════════ */

.br-comp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100; /* au-dessus du .modern-header (10000 !important) */
  background: rgba(26, 32, 53, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: br-comp-fadein 250ms ease-out;
}
.br-comp-overlay.br-comp-open { display: flex; }
@keyframes br-comp-fadein { from { opacity: 0; } to { opacity: 1; } }

.br-comp-modal {
  width: 100%;
  max-width: 1280px;
  height: 100%;
  max-height: 92vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(26, 32, 53, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: br-comp-pop 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes br-comp-pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.br-comp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--br-rose, #9C2759) 0%, var(--br-rose-dark, #7D1F47) 100%);
  color: #fff;
  flex-wrap: wrap;
}
.br-comp-header-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}
.br-comp-header-title i { font-size: 17px; opacity: 0.85; }
.br-comp-ref {
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.br-comp-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.br-comp-select {
  padding: 7px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1L6 6L11 1' stroke='white' stroke-width='2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  min-width: 150px;
}
.br-comp-select option { color: #1a2035; background: #fff; }
.br-comp-select:focus { outline: 2px solid rgba(255, 255, 255, 0.5); }

.br-comp-swap, .br-comp-close, .br-comp-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s, transform 0.15s;
}
.br-comp-swap:hover, .br-comp-close:hover, .br-comp-add:hover {
  background: rgba(255, 255, 255, 0.28);
}
.br-comp-add.br-comp-add-active {
  background: rgba(255, 255, 255, 0.30);
  transform: rotate(45deg);
}
.br-comp-add.br-comp-add-active:hover {
  background: rgba(255, 255, 255, 0.42);
}
.br-comp-select[hidden] { display: none !important; }
.br-comp-col[hidden]    { display: none !important; }

/* Corps : 2 ou 3 colonnes scrollables independantes */
.br-comp-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  background: #fafafa;
}
.br-comp-body.br-comp-cols-2 { grid-template-columns: 1fr 1fr; }
.br-comp-body.br-comp-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.br-comp-col {
  overflow-y: auto;
  padding: 0;
  background: #fff;
  border-right: 1px solid #f1f5f9;
  -webkit-overflow-scrolling: touch;
}
.br-comp-col:last-child { border-right: none; }

.br-comp-col-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 22px;
  background: linear-gradient(180deg, #fdf2f8 0%, rgba(253, 242, 248, 0.95) 100%);
  border-bottom: 1px solid #fbcfe8;
  font-size: 13px;
  font-weight: 700;
  color: var(--br-rose, #9C2759);
  display: flex;
  align-items: center;
  gap: 8px;
}
.br-comp-col-header i { font-size: 14px; opacity: 0.7; }

.br-comp-verses {
  padding: 16px 22px 30px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14.5px;
  line-height: 1.75;
  color: #1f2937;
}

.br-comp-verse {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.br-comp-verse:hover { background: #fdf2f8; }

.br-comp-vnum {
  flex-shrink: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--br-rose, #9C2759);
  min-width: 22px;
  text-align: right;
  padding-top: 3px;
  user-select: none;
}
.br-comp-vtext { flex: 1; }
.br-comp-vtext mark {
  background: #fef3c7;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

.br-comp-verse-flash {
  animation: br-comp-verse-flash 3s ease-out;
}
@keyframes br-comp-verse-flash {
  0%   { box-shadow: 0 0 0 0 rgba(156, 39, 89, 0.55); background: rgba(156, 39, 89, 0.20); }
  30%  { box-shadow: 0 0 0 5px rgba(156, 39, 89, 0); background: rgba(156, 39, 89, 0.14); }
  100% { box-shadow: 0 0 0 0 rgba(156, 39, 89, 0); background: transparent; }
}

.br-comp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 13px;
}
.br-comp-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #fce7f3;
  border-top-color: var(--br-rose, #9C2759);
  border-radius: 50%;
  animation: br-spin 0.8s linear infinite;
}
.br-comp-empty {
  padding: 60px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

/* Bloque le scroll du body quand le comparateur est ouvert */
body.br-comp-active { overflow: hidden; }

/* ────── Mobile : cartes empilees ────── */
@media (max-width: 768px) {
  .br-comp-overlay { padding: 0; }
  .br-comp-modal {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .br-comp-header {
    padding: 12px 14px;
    gap: 8px;
  }
  .br-comp-header-title {
    font-size: 14px;
    flex: 1;
    min-width: 0;
  }
  .br-comp-header-title span:not(.br-comp-ref) { display: none; }
  .br-comp-ref { font-size: 11px; padding: 3px 9px; }
  .br-comp-header-controls { width: 100%; justify-content: space-between; }
  .br-comp-select {
    flex: 1;
    min-width: 0;
    font-size: 11.5px;
    padding: 6px 26px 6px 10px;
  }
  .br-comp-body,
  .br-comp-body.br-comp-cols-2 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .br-comp-body.br-comp-cols-3 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr 1fr;
  }
  .br-comp-col { border-right: none; border-bottom: 4px solid #fdf2f8; }
  .br-comp-col:last-child { border-bottom: none; }
  .br-comp-verses { padding: 12px 16px 24px; font-size: 14px; }
  .br-comp-add { width: 32px; height: 32px; font-size: 12px; }
  .br-comp-header-controls { flex-wrap: wrap; }
}

/* ════════════════════════════════════════════════════════════
   3sexies. RANGEE D'OUTILS DANS LE HERO ROSE (Sprint 4 bis)
   ════════════════════════════════════════════════════════════
   Boutons directement accessibles des l'arrivee sur la page,
   sans avoir a scroller. Style adapte au fond rose.
   ════════════════════════════════════════════════════════════ */

.br-hero-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
  position: relative;
  z-index: 2;
}

.br-hero-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s, border-color 0.18s;
  white-space: nowrap;
}
.br-hero-tool:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}
.br-hero-tool:active { transform: scale(0.96); }
.br-hero-tool i { font-size: 13.5px; opacity: 0.9; }

/* Variante "actif" (deja pousse dans le panneau correspondant) */
.br-hero-tool.br-hero-tool-active {
  background: #fff;
  color: var(--br-rose, #9C2759);
  border-color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}
.br-hero-tool.br-hero-tool-active i { opacity: 1; }

/* Mobile : icones uniquement, labels masques */
@media (max-width: 600px) {
  .br-hero-tools {
    gap: 6px;
    margin: 12px 0 2px;
  }
  .br-hero-tool {
    padding: 8px 12px;
    font-size: 12px;
  }
  .br-hero-tool-label {
    display: none;
  }
  .br-hero-tool i { font-size: 15px; }
}

/* ════════════════════════════════════════════════════════════
   3septies. TOGGLE VERSET/CHAPITRE + CARTES COMPARAISONS (Sprint 4 raffin.)
   ════════════════════════════════════════════════════════════ */

/* Toggle Verset / Chapitre dans le header du comparateur */
.br-comp-mode-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px;
  margin-right: 4px;
}
.br-comp-mode-toggle[hidden] { display: none; }

.br-comp-mode-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.br-comp-mode-btn:hover { color: #fff; }
.br-comp-mode-btn.br-comp-mode-active {
  background: #fff;
  color: var(--br-rose, #9C2759);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* En mode verset seul : version mise en avant, plus aerien */
.br-comp-verses-single {
  padding-top: 30px;
}
.br-comp-verses-single .br-comp-verse {
  background: #fdf2f8;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid #fbcfe8;
  font-size: 16px;
  line-height: 1.85;
}
.br-comp-verses-single .br-comp-vnum {
  font-size: 13px;
  min-width: 26px;
}

/* Carte d'historique de comparaison */
.br-comparison-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: background var(--br-anim, 250ms), border-color var(--br-anim);
}
.br-comparison-card:hover {
  background: #fdf2f8;
  border-color: #fbcfe8;
}

.br-comparison-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--br-rose-light, #FCE7F3);
  color: var(--br-rose, #9C2759);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.br-comparison-card-body { flex: 1; min-width: 0; }
.br-comparison-card-ref {
  font-size: 13px;
  font-weight: 700;
  color: var(--br-rose, #9C2759);
  line-height: 1.3;
}
.br-comparison-card-versions {
  font-size: 11.5px;
  color: #4b5563;
  margin-top: 4px;
  font-weight: 600;
}
.br-comparison-card-versions i {
  font-size: 10px;
  color: var(--br-rose, #9C2759);
  margin: 0 4px;
}
.br-comparison-card-meta {
  font-size: 10.5px;
  color: #9ca3af;
  margin-top: 3px;
}
.br-comparison-card-x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.br-comparison-card-x:hover { background: #fce7f3; color: var(--br-rose, #9C2759); }

/* Mobile : toggle plus compact dans le header */
@media (max-width: 768px) {
  .br-comp-mode-toggle {
    order: -1;
    width: 100%;
    justify-content: center;
    margin-bottom: 4px;
  }
  .br-comp-mode-btn { padding: 6px 16px; font-size: 12.5px; }
}

/* ════════════════════════════════════════════════════════════
   4. UTILITAIRES + SAFE AREA (iOS notch)
   ════════════════════════════════════════════════════════════ */

.br-floating-bar {
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
}
@media (max-width: 600px) {
  .br-floating-bar {
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
  }
}

/* Désactive le scroll body quand panneau ouvert (évite double scroll mobile) */
body.br-panel-open {
  overflow: hidden;
}
@media (min-width: 769px) {
  body.br-panel-open {
    overflow: auto; /* Sur desktop, le scroll body reste actif */
  }
}
