/* ============================================================
   TÉHILIM COLLECTIF : styles
   Palette conservée (vert profond, or, crème), formes adoucies.
   ============================================================ */

:root {
  --bg: #efe8da;
  --card-bg: #fbf7ee;
  --primary: #1f3468;
  --primary-dark: #121f42;
  --banner-end: #091226;
  --appbar-start: #1b2f63;
  --appbar-end: #091226;
  --accent: #c9a24b;
  --accent-text: #8f6c14;
  --accent-soft: rgba(201, 162, 75, 0.17);
  --accent-ink: #3a2a08;
  --text: #1f2840;
  --text-muted: #6b6f7d;
  --border: #e2d8c3;
  --hairline: rgba(39, 64, 122, 0.12);
  --row-bg: #f3ecdd;
  --row-bg-read: #e4eaf6;
  --warn-bg: #fff3cd;
  --warn-text: #7a5a00;
  --danger: #b23b3b;
  --glow-1: rgba(39, 64, 122, 0.15);
  --glow-2: rgba(255, 255, 255, 0.55);
  --verse-font-size: 19px;
  --radius: 22px;
  --radius-lg: 30px;
  --shadow-sm: 0 2px 8px -2px rgba(14, 27, 61, 0.22);
  --shadow: 0 10px 30px -12px rgba(14, 27, 61, 0.28);
  --shadow-lg: 0 28px 60px -24px rgba(14, 27, 61, 0.45);
  --heading-font: "Playfair Display", "David Libre", Georgia, serif;
  --he-font: "David Libre", "Times New Roman", serif;
  --ui-font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #070c1d;
  --card-bg: #0f1731;
  --primary: #5b84d1;
  --primary-dark: #ffffff;
  --banner-end: #14244a;
  --appbar-start: #16295a;
  --appbar-end: #070e22;
  --accent: #e3bd6a;
  --accent-text: #f3d284;
  --accent-soft: rgba(227, 189, 106, 0.14);
  --accent-ink: #2d2006;
  --text: #ffffff;
  --text-muted: #b4bbd0;
  --border: #222d54;
  --hairline: rgba(255, 255, 255, 0.08);
  --row-bg: #172148;
  --row-bg-read: #17254a;
  --warn-bg: rgba(227, 189, 106, 0.14);
  --warn-text: #e3bd6a;
  --danger: #ff8d8d;
  --glow-1: rgba(91, 132, 209, 0.16);
  --glow-2: rgba(130, 165, 255, 0.07);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.6);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 28px 60px -24px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  transition: background 0.25s;
}

body {
  margin: 0;
  font-family: var(--ui-font);
  color: var(--text);
  min-height: 100vh;
  background: transparent;
  -webkit-font-smoothing: antialiased;
}

/* Halos de couleur très doux en arrière-plan */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 0% 0%, var(--glow-1), transparent 62%),
    radial-gradient(100% 50% at 100% 100%, var(--glow-2), transparent 62%);
}

button, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

button:not(:disabled):active,
.whatsapp-btn:active { transform: scale(0.97); }

/* ---------- Animations d'entrée ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(44px); }
  to { opacity: 1; transform: none; }
}

#dashboard-screen > *,
.login-card { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
#dashboard-screen > :nth-child(2) { animation-delay: 0.05s; }
#dashboard-screen > :nth-child(3) { animation-delay: 0.1s; }
#dashboard-screen > :nth-child(4) { animation-delay: 0.14s; }
#dashboard-screen > :nth-child(5) { animation-delay: 0.18s; }
#dashboard-screen > :nth-child(n+6) { animation-delay: 0.22s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Bouton thème flottant (page de connexion) ---------- */
.theme-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--card-bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.on-dashboard .theme-toggle { display: none; }

/* ---------- CONNEXION ---------- */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  border-radius: 36px;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  text-align: center;
  overflow: hidden;
}

/* La photo se fond dans la carte */
.login-hero {
  display: block;
  width: 100%;
  aspect-ratio: 828 / 1104;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

.login-card-body {
  position: relative;
  margin-top: -64px;
  padding: 0 28px 34px;
}

.login-card h1 {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-family: var(--heading-font);
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0.2px;
}

.dedication {
  direction: rtl;
  font-family: var(--he-font);
  color: var(--primary-dark);
  font-size: 16px;
  line-height: 1.7;
  margin: 6px 0 0;
}
.dedication::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.dedication-small {
  text-align: center;
  font-size: 13px;
  margin: 4px 0 20px;
  color: var(--text-muted);
}
.dedication-small::after { display: none; }

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 14px 0 26px;
}

.login-card label {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#name-select {
  width: 100%;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid var(--hairline);
  font-size: 16px;
  margin-bottom: 16px;
  background: var(--row-bg);
  color: var(--text);
}

#login-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--banner-end));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 30px -14px rgba(39, 64, 122, 0.85);
  transition: transform 0.15s, box-shadow 0.15s;
}
#login-btn:disabled {
  background: var(--row-bg);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------- TABLEAU DE BORD ---------- */
#dashboard-screen {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 72px;
}

/* ---------- Barre du haut (façon application) ---------- */
.app-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: -20px -16px 24px;
  padding: 16px 18px 22px;
  background: linear-gradient(165deg, var(--appbar-start), var(--appbar-end));
  color: #fff;
  border-radius: 0 0 36px 36px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-header::before,
.app-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.app-header::before {
  width: 280px;
  height: 280px;
  right: -90px;
  top: -120px;
  background: radial-gradient(circle, rgba(190, 215, 255, 0.28), transparent 65%);
}
.app-header::after {
  width: 240px;
  height: 240px;
  left: -90px;
  bottom: -130px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 65%);
}

.app-header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.app-header-top > :first-child { justify-self: start; }
.app-header-top > :last-child { justify-self: end; }

.appbar-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.appbar-icon-btn:hover { background: rgba(255, 255, 255, 0.22); }

.appbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.header-label { font-size: 11.5px; color: rgba(255, 255, 255, 0.7); }
#user-name {
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar-text-btn {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}


/* Hier / date / Demain dans une capsule */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-header .date-nav {
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.current-date {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#display-date {
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}
.app-header #display-date { color: #fff; }

.ghost-btn,
.nav-btn,
.link-btn {
  border: 1px solid var(--hairline);
  background: var(--card-bg);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}
.ghost-btn:hover,
.nav-btn:hover { background: var(--row-bg); }

.app-header .nav-btn {
  border: none;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  padding: 9px 13px;
  font-size: 13px;
}
.app-header .nav-btn:hover { background: rgba(255, 255, 255, 0.24); }

.link-btn {
  border: none;
  background: none;
  color: var(--primary);
  text-decoration: underline;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 500;
}
.app-header .link-btn { color: var(--accent); }

/* Lever / coucher du soleil */
.sun-times { text-align: center; margin-bottom: 16px; }
.sun-greeting {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary-dark);
}
.sun-details {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.app-header .sun-times { margin: 0; }
.app-header .sun-greeting { color: #fff; }
.app-header .sun-details { color: rgba(255, 255, 255, 0.7); }

/* ---------- Carrousel photos ---------- */
.photo-carousel {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 22px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #0e1b3d;
}
.photo-carousel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent);
  pointer-events: none;
}

.carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.carousel-img.active { opacity: 1; }

.carousel-dots {
  position: absolute;
  z-index: 2;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.3s, background 0.3s;
}
.carousel-dots .dot.active { width: 18px; background: #fff; }

/* ---------- Bannière du jour ---------- */
.assignment-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--banner-end));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 20px 24px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.assignment-banner::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -60px;
  top: -80px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(190, 215, 255, 0.2), transparent 65%);
}
.assignment-banner p {
  margin: 0;
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.86);
}
.assignment-banner strong {
  display: block;
  margin-top: 4px;
  font-family: var(--heading-font);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
}

.status-message {
  text-align: center;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--warn-bg);
  color: var(--warn-text);
  margin-bottom: 16px;
  font-size: 14px;
}

/* ---------- Taille du texte ---------- */
.font-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 18px;
  padding: 5px;
  border-radius: 999px;
  background: var(--row-bg);
  border: 1px solid var(--hairline);
}
.font-size-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, background 0.15s;
}
.font-size-btn:hover { background: var(--bg); }
.font-size-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.font-size-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ---------- Prières avant / après (facultatives) ---------- */
.prayer {
  margin-bottom: 18px;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
#chapters-container + .prayer { margin-top: 18px; }

.prayer summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}
.prayer summary::-webkit-details-marker { display: none; }

.prayer-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}
.prayer-title {
  direction: rtl;
  font-family: var(--he-font);
  font-size: 16px;
  color: var(--primary-dark);
}
.prayer-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
}
.prayer-chevron {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent-text);
  background: var(--accent-soft);
  transition: transform 0.25s;
}
.prayer[open] .prayer-chevron { transform: rotate(180deg); }

.prayer-body {
  direction: rtl;
  text-align: right;
  font-family: var(--he-font);
  font-size: calc(var(--verse-font-size, 19px) * 0.85);
  line-height: 1.85;
  color: var(--text);
  padding: 2px 18px 16px;
  border-top: 1px solid var(--hairline);
}
.prayer-body p { margin: 10px 0 0; }
.prayer-note { color: var(--text-muted); font-size: 0.85em; }

/* ---------- Chapitres ---------- */
#chapters-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chapter-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  padding: 24px 22px 14px;
}

.chapter-card h2 {
  position: relative;
  margin: 0 0 8px;
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}
.chapter-card h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 85%);
}

.chapter-hebrew-num {
  direction: rtl;
  font-family: var(--he-font);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #e8c777, var(--accent));
  padding: 4px 14px 5px;
  border-radius: 999px;
  box-shadow: 0 6px 14px -6px rgba(201, 162, 75, 0.85);
}

.chapter-loading { color: var(--text-muted); font-style: italic; font-size: 14px; }
.chapter-error { color: var(--danger); font-size: 14px; }

.verse-row {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.verse-row:last-child { border-bottom: none; }

.verse-num {
  flex: 0 0 36px;
  height: 26px;
  margin-top: calc(var(--verse-font-size, 19px) * 0.85 - 13px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.verse-text-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }

.verse-he {
  direction: rtl;
  text-align: right;
  font-size: var(--verse-font-size, 19px);
  line-height: 1.7;
  font-family: var(--he-font);
}

/* ---------- J'ai terminé ma lecture ---------- */
.read-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 26px 18px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow);
}
.read-status-phrase {
  margin: 0;
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
}

.mark-read-btn {
  width: 100%;
  max-width: 360px;
  border: none;
  border-radius: 999px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #e8c777, var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 16px 30px -14px rgba(201, 162, 75, 0.95);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mark-read-btn:not(:disabled):hover { transform: translateY(-2px); }
.mark-read-btn.done {
  background: linear-gradient(135deg, var(--primary), var(--banner-end));
  color: #fff;
  box-shadow: 0 16px 30px -14px rgba(39, 64, 122, 0.85);
  cursor: default;
  transform: none;
}
.mark-read-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Fenêtres (montent du bas comme sur une appli) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 14, 30, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease both;
}

.overlay-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.45);
  padding: 12px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: sheetUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.overlay-card::before {
  content: "";
  flex: 0 0 auto;
  width: 42px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: var(--text-muted);
  opacity: 0.35;
}

@media (min-width: 640px) {
  .overlay { align-items: center; padding: 20px; }
  .overlay-card {
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
    padding-bottom: 24px;
  }
  .overlay-card::before { display: none; }
}

.overlay-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.overlay-header h2 {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 23px;
  color: var(--primary-dark);
}

.tracking-summary {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 14px;
}

.tracking-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Lignes du suivi (qui a lu) */
.tracking-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--row-bg);
  font-size: 14px;
}
.tracking-row.read { background: var(--row-bg-read); }

.tracking-block-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.tracking-row.read .tracking-block-num { background: var(--accent); color: var(--accent-ink); }

.tracking-info { display: flex; flex-direction: column; min-width: 0; }
.tracking-name {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tracking-range {
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.tracking-badge { font-size: 12.5px; white-space: nowrap; }
.tracking-badge.read {
  color: var(--primary);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(39, 64, 122, 0.12);
}
:root[data-theme="dark"] .tracking-badge.read { background: rgba(91, 132, 209, 0.22); }
.tracking-badge.unread { color: var(--text-muted); }

/* Boutons WhatsApp / liste */
.whatsapp-btn {
  flex: 0 0 auto;
  display: block;
  margin-top: 16px;
  padding: 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2bdc6e, #1faa52);
  color: #fff;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 16px 28px -14px rgba(31, 170, 82, 0.95);
  transition: transform 0.15s;
}
.whatsapp-btn.celebrate {
  background: linear-gradient(135deg, #e8c777, #c9a24b);
  color: var(--accent-ink);
  box-shadow: 0 16px 28px -14px rgba(201, 162, 75, 0.95);
}

.sheet-link-btn {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--row-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Liste de samedi */
.day-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--row-bg);
}
.day-row.me { box-shadow: inset 0 0 0 2px var(--accent); }
.day-name {
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-range {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}
.day-range-fr {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.day-range-he {
  direction: rtl;
  font-family: var(--he-font);
  font-size: 15.5px;
  color: var(--primary-dark);
}

/* ---------- Finir mon livre ---------- */
.progress-dots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 8px 0 16px;
}
.progress-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--row-bg);
  border: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}
.progress-dot.read {
  background: linear-gradient(135deg, var(--primary), var(--banner-end));
  border-color: transparent;
  color: #fff;
}
.progress-dot.today { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--accent); }
.progress-dot.future { opacity: 0.4; }

.progress-total {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

/* ---------- Message « copié » ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 200;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(14, 22, 48, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* ---------- Petits écrans ---------- */
@media (max-width: 380px) {
  .app-header { padding-left: 14px; padding-right: 14px; }
  .app-header .nav-btn { padding: 8px 10px; font-size: 12.5px; }
  .appbar-btn { font-size: 13px; }
  .assignment-banner strong { font-size: 32px; }
  .chapter-card { padding-left: 18px; padding-right: 18px; }
}

/* ---------- Bouton menu (trois barres) ---------- */
.burger { display: flex; flex-direction: column; gap: 4px; }
.burger i {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}
.burger i:nth-child(2) { width: 13px; }
.appbar-spacer { width: 40px; height: 40px; }

/* ---------- Menu latéral ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(8, 14, 30, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease both;
}
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: none; } }
.menu-drawer {
  width: min(82vw, 320px);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 0 32px 32px 0;
  box-shadow: var(--shadow-lg);
  padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  animation: drawerIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 18px;
}
.menu-title {
  font-family: var(--heading-font);
  font-size: 21px;
  font-weight: 700;
  color: var(--primary-dark);
}
.menu-close {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: var(--row-bg);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.menu-list { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; min-height: 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item:hover { background: var(--row-bg); }
.menu-ico {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  font-size: 17px;
}
.menu-item-accent { background: var(--accent-soft); }
.menu-item-quiet { color: var(--text-muted); font-weight: 500; }
.menu-foot { border-top: 1px solid var(--hairline); padding-top: 10px; }

@media (max-width: 420px) {
  #display-date { font-size: 13px; }
}

/* ---------- Choix d'affichage (clair / sombre / auto) ---------- */
.menu-theme { padding: 0 6px 12px; }
.menu-theme-title { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin: 0 10px 8px; }
.theme-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--row-bg);
  border: 1px solid var(--hairline);
}
.theme-opt {
  border: none;
  border-radius: 999px;
  padding: 10px 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.theme-opt.active {
  background: linear-gradient(135deg, var(--primary), var(--banner-end));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.menu-theme-hint { display: block; margin: 8px 10px 0; font-size: 11.5px; color: var(--text-muted); }

/* ---------- Rappel quotidien ---------- */
.reminder-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin: 6px 0 8px; }
.reminder-time {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--hairline);
  background: var(--row-bg);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
}
.reminder-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin: 14px 4px 0; }
.reminder-btn-main {
  background: linear-gradient(135deg, var(--primary), var(--banner-end));
  box-shadow: 0 16px 28px -14px rgba(39, 64, 122, 0.85);
}

/* ---------- Livres complets / récap ---------- */
.stats-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--banner-end));
  color: #fff;
}
.stats-big { font-family: var(--heading-font); font-size: 64px; font-weight: 700; line-height: 1; color: var(--accent); }
.stats-caption { margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, 0.85); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: 18px;
  background: var(--row-bg);
  text-align: center;
}
.stats-val { font-size: 17px; font-weight: 700; color: var(--primary-dark); }
.stats-lab { font-size: 12px; color: var(--text-muted); }
.stats-sub { margin: 16px 4px 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.stats-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stats-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 700;
}
.stats-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* ---------- Birkat Hamazon ---------- */
.menu-sub { font-weight: 500; font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.bh-card { max-height: 92vh; max-height: 92dvh; }
.bh-font { margin-bottom: 8px; }
.bh-body { padding-bottom: 8px; }
.bh-section { margin-top: 22px; }
.bh-title {
  margin: 0 0 12px;
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--hairline);
}
.bh-title-he { font-family: var(--he-font); font-size: 23px; font-weight: 700; color: var(--primary-dark); direction: rtl; }
.bh-title-fr { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.bh-para { margin: 0 0 12px; }
.bh-text {
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: var(--he-font);
  font-size: var(--verse-font-size, 19px);
  line-height: 1.9;
  color: var(--text);
}
.bh-optional { padding: 10px 12px 12px; border-radius: 18px; background: var(--row-bg); }
.bh-label {
  display: inline-block;
  direction: rtl;
  margin-bottom: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--he-font);
  font-size: 14px;
  font-weight: 700;
}
.bh-optional { text-align: right; }

.bh-optional > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bh-optional > summary::-webkit-details-marker { display: none; }
.bh-optional > summary .bh-label { margin-bottom: 0; }
.bh-chev { color: var(--accent-text); font-size: 12px; transition: transform 0.25s; }
.bh-optional[open] > summary .bh-chev { transform: rotate(180deg); }
.bh-optional[open] > summary { margin-bottom: 8px; }
.bh-optional { padding: 8px 12px; }
.bh-optional[open] { padding-bottom: 12px; }

.bh-hint { margin: 12px 0 8px; font-size: 12px; color: var(--text-muted); text-align: center; }
.bh-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.bh-option {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--card-bg);
}
.bh-option .bh-label { margin-bottom: 0; flex: 0 0 auto; }
.bh-opt-text {
  direction: rtl;
  text-align: left;
  font-family: var(--he-font);
  font-size: var(--verse-font-size, 19px);
  color: var(--text);
}

.bh-line { margin: 0 0 12px; text-align: right; }
.bh-line:last-child { margin-bottom: 0; }
.bh-line .bh-label { margin-bottom: 4px; }

/* Birkat adaptatif */
.bh-now { padding: 12px 14px; border-radius: 18px; background: var(--accent-soft); margin-bottom: 8px; }
.bh-now-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.bh-now-list { display: flex; flex-wrap: wrap; gap: 6px; }
.bh-now-pill { padding: 5px 12px; border-radius: 999px; background: linear-gradient(135deg, #e8c777, var(--accent)); color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.bh-now-plain { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.bh-now-note { display: block; margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }
.bh-adjust { margin-bottom: 4px; }
.bh-adjust > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary); padding: 6px 4px; list-style: none; }
.bh-adjust > summary::-webkit-details-marker { display: none; }
.bh-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.bh-chip { border: 1px solid var(--hairline); background: var(--row-bg); color: var(--text-muted); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.bh-chip.on { background: linear-gradient(135deg, var(--primary), var(--banner-end)); color: #fff; border-color: transparent; }
.bh-yaaleh { text-align: right; }

.bh-ra .bh-text { margin-bottom: 8px; }
.bh-ra .bh-text:last-child { margin-bottom: 0; }

/* Après collation */
.col-foods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.col-food {
  border: 1px solid var(--hairline);
  background: var(--row-bg);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 13px 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.col-food.on { background: linear-gradient(135deg, var(--primary), var(--banner-end)); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
.col-ey { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.col-ey-note { font-size: 11.5px; color: var(--text-muted); }
.bh-chatima { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--hairline); }

/* Menu organisé par rubriques */
.menu-section {
  margin: 14px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.menu-section:first-child { margin-top: 0; }
.menu-item-soon { opacity: 0.55; cursor: default; }
.menu-item-soon:hover { background: transparent; }
.menu-soon {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11.5px;
  font-weight: 700;
}
/* Onglets Mon livre / Nos livres complets */
.seg2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 4px 0 14px;
  border-radius: 999px;
  background: var(--row-bg);
  border: 1px solid var(--hairline);
}
.seg2-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.seg2-btn.on { background: linear-gradient(135deg, var(--primary), var(--banner-end)); color: #fff; box-shadow: var(--shadow-sm); }

/* Menu plus compact pour tout tenir à l'écran */
.menu-drawer { padding-top: 16px; }
.menu-head { padding-bottom: 8px; }
.menu-item { padding: 8px 12px; gap: 12px; font-size: 15px; }
.menu-ico { flex: 0 0 32px; height: 32px; font-size: 15px; }
.menu-section { margin: 10px 10px 2px; }
.menu-theme { padding-bottom: 6px; }
.menu-theme-title { margin-bottom: 6px; }
.menu-theme-hint { display: none; }
.theme-opt { padding: 8px 4px; }
.menu-foot { padding-top: 8px; }

/* Le défilement reste dans le menu / la fenêtre ouverte */
html.modal-open, body.modal-open { overflow: hidden; }
.overlay, .menu-overlay, .overlay-card, .menu-list, .tracking-list, .bh-body, .stats-body { overscroll-behavior: contain; }

/* Tikkoun Haklali */
.tk-heb { margin: 0 0 4px; text-align: center; direction: rtl; font-family: var(--he-font); font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.tk-body { display: flex; flex-direction: column; gap: 14px; }
.tk-card { box-shadow: var(--shadow-sm); padding: 18px 16px 8px; }

/* ---------- Mes étincelles ---------- */
.mz-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 16px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--appbar-start), var(--appbar-end));
  color: #fff;
  text-align: center;
}
.mz-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -70px;
  left: 50%;
  width: 260px;
  height: 260px;
  margin-left: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(190, 215, 255, 0.28), transparent 65%);
}
.mz-flame { font-size: 46px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(227, 160, 40, 0.6)); animation: mzFlicker 2.4s ease-in-out infinite; }
@keyframes mzFlicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.mz-level { font-family: var(--heading-font); font-size: 24px; font-weight: 700; color: var(--accent); }
.mz-level small { font-family: var(--he-font); font-size: 16px; color: rgba(255, 255, 255, 0.8); margin-left: 6px; }
.mz-total { font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.mz-bar-track { width: 100%; max-width: 280px; height: 9px; margin-top: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.mz-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e8c777, #f4a93b); transition: width 0.6s ease; }
.mz-next { font-size: 12px; color: rgba(255, 255, 255, 0.75); margin-top: 4px; }

.mz-streak {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--accent-soft);
}
.mz-streak-n { font-family: var(--heading-font); font-size: 30px; font-weight: 700; color: var(--accent-text); line-height: 1; }
.mz-streak-t { font-size: 13px; font-weight: 600; color: var(--text); }

.seg3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--row-bg);
  border: 1px solid var(--hairline);
}
.seg3-btn { border: none; border-radius: 999px; padding: 10px 4px; background: transparent; color: var(--text-muted); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.seg3-btn.on { background: linear-gradient(135deg, var(--primary), var(--banner-end)); color: #fff; box-shadow: var(--shadow-sm); }
.mz-period-note { text-align: center; font-size: 13px; color: var(--text-muted); margin: 10px 0; }
.mz-period-note strong { color: var(--primary-dark); font-size: 16px; }

.mz-list { display: flex; flex-direction: column; gap: 8px; }
.mz-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: var(--row-bg); }
.mz-ico { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--card-bg); font-size: 18px; }
.mz-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mz-name { font-size: 14px; font-weight: 600; }
.mz-mini { height: 6px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.mz-mini-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.5s ease; }
.mz-n { font-family: var(--heading-font); font-size: 22px; font-weight: 700; color: var(--primary-dark); min-width: 28px; text-align: right; }

.mz-msg { text-align: center; font-size: 13.5px; font-style: italic; color: var(--text-muted); margin: 16px 8px 8px; }
.mz-group { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 8px 0; padding: 12px; border-radius: 18px; border: 1px dashed var(--accent); }
.mz-group:empty { display: none; }
.mz-group-n { font-family: var(--heading-font); font-size: 26px; font-weight: 700; color: var(--accent-text); }
.mz-group-t { font-size: 13px; font-weight: 600; color: var(--text); }
.mz-private { text-align: center; font-size: 11.5px; color: var(--text-muted); margin: 8px 8px 0; }

/* Bouton « J'ai lu » collé en bas de chaque prière */
.mz-donebar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 8px -20px calc(-22px - env(safe-area-inset-bottom, 0px));
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--card-bg) 72%, transparent);
}
.mz-done {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #e8c777, var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 14px 26px -14px rgba(201, 162, 75, 0.95);
}
.mz-done.added { background: linear-gradient(135deg, var(--primary), var(--banner-end)); color: #fff; box-shadow: 0 14px 26px -14px rgba(39, 64, 122, 0.85); }
.mz-done:disabled { opacity: 0.6; }

/* Dédicace en doré, plus grande, avec la bénédiction de guérison */
.dedication-block { text-align: center; margin: 6px 0 20px; }
.dedication-block .dedication { margin: 0; }
.dedication-small,
.dedication-heal {
  background: linear-gradient(135deg, #a9791a 10%, #dcb548 50%, #a9791a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 700;
}
.dedication-small { font-size: 21px; line-height: 1.6; margin: 0; }
.dedication-heal { font-size: 19px; line-height: 1.6; margin-top: 4px; }
.dedication-heal-fr { margin: 2px 0 0; font-size: 12.5px; font-style: italic; color: var(--text-muted); }
:root[data-theme="dark"] .dedication-small,
:root[data-theme="dark"] .dedication-heal { background-image: linear-gradient(135deg, #e3bd6a 10%, #f6dc96 50%, #e3bd6a 90%); }

/* Écriture hébraïque : poids et justification */
.verse-he, .bh-text, .prayer-body, .bh-opt-text { font-weight: 500; }
.bh-text, .prayer-body p { text-align: justify; text-align-last: right; }

/* Fenêtre « Écriture » */
#hestyle-overlay { z-index: 70; }
.he-style-btn { width: auto; padding: 0 14px; border-radius: 999px; font-size: 13px; }
.he-sec { margin: 14px 4px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.he-fonts { display: flex; flex-direction: column; gap: 8px; }
.he-font {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: 10px 14px; border-radius: 18px; text-align: left; cursor: pointer;
  border: 2px solid transparent; background: var(--row-bg); color: var(--text);
}
.he-font.on { border-color: var(--accent); background: var(--accent-soft); }
.he-font-name { font-size: 13.5px; font-weight: 700; }
.he-font-name small { font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.he-font-sample { direction: rtl; text-align: right; font-size: 22px; line-height: 1.7; }
.he-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 12px 14px; margin-bottom: 8px; border-radius: 18px; border: none; cursor: pointer;
  background: var(--row-bg); color: var(--text); font-size: 14.5px; font-weight: 600; text-align: left;
}
.he-switch i { flex: 0 0 46px; height: 26px; border-radius: 999px; background: var(--hairline); position: relative; transition: background 0.2s; }
.he-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s; }
.he-switch.on i { background: var(--primary); }
.he-switch.on i::after { transform: translateX(20px); }
.he-switch.disabled { opacity: 0.45; cursor: not-allowed; }

.save-btn { background: linear-gradient(135deg, #e8c777, var(--accent)); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.save-btn:hover { background: linear-gradient(135deg, #efd085, #d4ac55); }

/* Chnayim Mikra */
.cm-parasha { margin: 0 0 8px; font-family: var(--heading-font); font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.cm-parasha-he { font-family: var(--he-font); margin-left: 6px; color: var(--accent-text); }
.cm-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.cm-chip { aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--hairline); background: var(--row-bg); color: var(--text-muted); font-weight: 700; font-size: 14px; cursor: pointer; padding: 0; }
.cm-chip.late { border-color: #d98c3d; color: #b36a14; }
.cm-chip.today { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--accent); }
.cm-chip.done { background: linear-gradient(135deg, var(--primary), var(--banner-end)); color: #fff; border-color: transparent; }
.cm-chip.sel:not(.done) { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.cm-status { margin: 4px 0 10px; font-size: 13px; color: var(--text-muted); }
.cm-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; margin-bottom: 8px; border-radius: 18px; background: var(--accent-soft); text-align: center; }
.cm-aliyah { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.cm-ref-he { font-family: var(--he-font); font-size: 20px; font-weight: 700; color: var(--primary-dark); direction: rtl; }
.cm-ref-fr { font-size: 12.5px; color: var(--text-muted); }
.cm-rule { margin-top: 4px; font-size: 12px; font-style: italic; color: var(--text-muted); }
.cm-chapter { margin: 14px 0 4px; text-align: center; direction: rtl; font-family: var(--he-font); font-weight: 700; color: var(--accent-text); }
.cm-targum { display: flex; flex-direction: row-reverse; align-items: baseline; gap: 8px; margin-top: 6px; padding: 8px 12px; border-radius: 14px; background: var(--accent-soft); direction: rtl; }
.cm-tg-tag { flex: 0 0 auto; font-family: var(--he-font); font-size: 12px; font-weight: 700; color: var(--accent-text); }
.cm-tg-text { flex: 1; direction: rtl; text-align: right; font-family: var(--he-font); font-size: calc(var(--verse-font-size, 19px) * 0.92); line-height: 1.7; font-weight: 500; }
.cm-donebar { position: sticky; bottom: 0; z-index: 3; margin: 8px -20px calc(-22px - env(safe-area-inset-bottom, 0px)); padding: 10px 20px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--card-bg) 72%, transparent); }

.cm-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.cm-options .he-switch { margin-bottom: 0; padding: 9px 12px; font-size: 13.5px; }

.cm-numcol { flex: 0 0 36px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cm-numcol .verse-num { flex: 0 0 auto; width: 36px; }
.cm-x { font-size: 11px; font-weight: 700; color: var(--text-muted); }

/* Choix de la nusach (Sépharade / Ashkenaz) */
.nus-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 999px; background: var(--row-bg); border: 1px solid var(--hairline); }
.nus-btn { border: none; border-radius: 999px; padding: 10px 6px; background: transparent; color: var(--text-muted); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.nus-btn.on { background: linear-gradient(135deg, var(--primary), var(--banner-end)); color: #fff; box-shadow: var(--shadow-sm); }

.cm-from-to { font-family: var(--he-font); font-size: 21px; font-weight: 700; color: var(--primary-dark); direction: rtl; line-height: 1.5; }
.cm-head .cm-ref-he { font-size: 14px; font-weight: 500; color: var(--text-muted); }

.cm-from-to { display: flex; flex-direction: column; gap: 2px; }
.cm-ft b { margin-left: 6px; color: var(--accent-text); font-size: 15px; }

/* Chnayim Mikra : le bouton « J'ai lu » n'apparaît qu'en bas du texte (plus collé à l'écran) */
.cm-donebar { position: static; margin: 20px 0 4px; padding: 0; background: none; }

/* Mode sombre : dédicace et bénédiction en or clair, bien visibles */
:root[data-theme="dark"] .dedication-small,
:root[data-theme="dark"] .dedication-heal {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: #f6dc94;
  color: #f6dc94;
  text-shadow: 0 0 14px rgba(246, 220, 148, 0.35);
}
:root[data-theme="dark"] .dedication-heal-fr { color: #c9c6bd; }

/* Page « Participer » (pour les nouveaux) */
.join-link { display: block; width: 100%; margin-top: 14px; padding: 10px; border: none; background: none; color: var(--primary); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
body.modal-open .theme-toggle { display: none; }
.join-sec { margin-bottom: 18px; }
.join-sec h3 { margin: 0 0 6px; font-family: var(--heading-font); font-size: 18px; color: var(--primary-dark); }
.join-sec p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; color: var(--text); }
.join-table { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 6px; }
.join-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-radius: 14px; background: var(--row-bg); font-size: 13.5px; }
.join-row.now { background: var(--accent-soft); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent); }
.join-note { font-size: 12.5px; font-style: italic; color: var(--text-muted); }
.join-steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.join-ask { padding: 14px; border-radius: 20px; background: var(--accent-soft); }
.join-input { width: 100%; padding: 13px 14px; margin: 4px 0 4px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--card-bg); color: var(--text); font-size: 15px; font-family: inherit; }

/* Seul le haut de page est bleu nuit ; le reste est « normal » (noir sur fond clair) */
.assignment-banner { background: linear-gradient(135deg, var(--appbar-start), var(--appbar-end)); }
.assignment-banner strong { color: #fff; }
:root .dedication-heal, :root[data-theme="dark"] .dedication-heal {
  background: none;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
  text-shadow: none;
}
:root .dedication-heal-fr, :root[data-theme="dark"] .dedication-heal-fr { color: var(--text-muted); }
:root:not([data-theme="dark"]) { --text: #1b1b1d; --text-muted: #6a6a70; }
:root:not([data-theme="dark"]) .chapter-card h2,
:root:not([data-theme="dark"]) .overlay-header h2,
:root:not([data-theme="dark"]) .join-sec h3,
:root:not([data-theme="dark"]) .cm-parasha,
:root:not([data-theme="dark"]) .menu-title,
:root:not([data-theme="dark"]) .login-card h1,
:root:not([data-theme="dark"]) .bh-title-he,
:root:not([data-theme="dark"]) .cm-from-to,
:root:not([data-theme="dark"]) .stats-val,
:root:not([data-theme="dark"]) .mz-n,
:root:not([data-theme="dark"]) .prayer-title,
:root:not([data-theme="dark"]) .tk-heb { color: var(--text); }

/* Mode sombre : écriture blanche partout (sauf la dédicace dorée) */
:root[data-theme="dark"] .chapter-card h2,
:root[data-theme="dark"] .overlay-header h2,
:root[data-theme="dark"] .menu-title,
:root[data-theme="dark"] .bh-title-he,
:root[data-theme="dark"] .tk-heb,
:root[data-theme="dark"] .login-card h1 { color: #ffffff; }

a.menu-item { text-decoration: none; color: var(--text); }

/* Bannière du jour : écrite directement en bas de la photo, sans bloc */
.photo-carousel::after { height: 62%; background: linear-gradient(to top, rgba(4, 9, 24, 0.82), rgba(4, 9, 24, 0.38) 55%, transparent); }
.photo-carousel .assignment-banner {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 36px;
  margin: 0;
  padding: 0 18px;
  background: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  isolation: auto;
}
.photo-carousel .assignment-banner::before { display: none; }
.photo-carousel .assignment-banner p { font-size: 15px; color: rgba(255, 255, 255, 0.92); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); }
.photo-carousel .assignment-banner strong {
  margin-top: 2px;
  font-size: 40px;
  color: #fff;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   MODE SOMBRE : palette dédiée (nuit bleue, pas un simple « clair assombri »)
   Surfaces à plusieurs niveaux, bleu d'action, or doux, vert menthe pour « lu ».
   ============================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b1a;
  --card-bg: #0f162d;
  --row-bg: #172040;
  --border: #243059;
  --hairline: rgba(150, 175, 255, 0.11);
  --text: #f5f7ff;
  --text-muted: #9aa6cd;
  --primary: #4f74d9;
  --primary-dark: #ffffff;
  --banner-end: #0b1430;
  --appbar-start: #1f3578;
  --appbar-end: #0a1129;
  --accent: #e8c470;
  --accent-text: #f2d791;
  --accent-soft: rgba(232, 196, 112, 0.13);
  --accent-ink: #2a1d04;
  --row-bg-read: #12294f;
  --glow-1: rgba(79, 116, 217, 0.24);
  --glow-2: rgba(124, 104, 232, 0.10);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.6);
  --shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 30px 64px -26px rgba(0, 0, 0, 0.9);
}

/* Cartes : léger relief (bord clair en haut) */
:root[data-theme="dark"] .chapter-card,
:root[data-theme="dark"] .prayer,
:root[data-theme="dark"] .read-status,
:root[data-theme="dark"] .login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 38%), var(--card-bg);
  border-color: var(--hairline);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(160, 185, 255, 0.10);
}
:root[data-theme="dark"] .overlay-card,
:root[data-theme="dark"] .menu-drawer {
  background: linear-gradient(180deg, #131c3a, #0c1226 70%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(160, 185, 255, 0.12);
}
:root[data-theme="dark"] .app-header {
  background: linear-gradient(165deg, #22397f 0%, #101c45 55%, #090f26 100%);
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.9), inset 0 -1px 0 rgba(160, 185, 255, 0.10);
}
:root[data-theme="dark"] .app-header::before { background: radial-gradient(circle, rgba(120, 160, 255, 0.34), transparent 65%); }
:root[data-theme="dark"] .app-header::after { background: radial-gradient(circle, rgba(150, 120, 255, 0.16), transparent 65%); }

/* Boutons et états actifs : un seul bleu, bien lisible */
:root[data-theme="dark"] #login-btn,
:root[data-theme="dark"] .theme-opt.on,
:root[data-theme="dark"] .nus-btn.on,
:root[data-theme="dark"] .seg2-btn.on,
:root[data-theme="dark"] .seg3-btn.on,
:root[data-theme="dark"] .col-food.on,
:root[data-theme="dark"] .bh-chip.on,
:root[data-theme="dark"] .cm-chip.done,
:root[data-theme="dark"] .progress-dot.read,
:root[data-theme="dark"] .mz-done.added,
:root[data-theme="dark"] .mark-read-btn.done {
  background: linear-gradient(135deg, #5a80e4, #2f4fae);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px -12px rgba(79, 116, 217, 0.9);
}
:root[data-theme="dark"] .he-switch.on i { background: #4f74d9; }
:root[data-theme="dark"] #login-btn:disabled { background: var(--row-bg); color: var(--text-muted); box-shadow: none; }

/* Éléments « lu » : vert menthe discret */
:root[data-theme="dark"] .tracking-badge.read { color: #8fe3b8; background: rgba(143, 227, 184, 0.12); }
:root[data-theme="dark"] .tracking-row.read { background: linear-gradient(90deg, rgba(143, 227, 184, 0.10), var(--row-bg-read) 60%); }

/* Champs, pastilles, lignes */
:root[data-theme="dark"] #name-select,
:root[data-theme="dark"] .join-input,
:root[data-theme="dark"] .reminder-time { background: #141d3b; border-color: var(--border); color: var(--text); }
:root[data-theme="dark"] .menu-ico { background: rgba(160, 185, 255, 0.10); }
:root[data-theme="dark"] .menu-item:hover,
:root[data-theme="dark"] .ghost-btn:hover { background: rgba(160, 185, 255, 0.10); }
:root[data-theme="dark"] .ghost-btn { background: rgba(160, 185, 255, 0.07); border-color: var(--hairline); color: var(--text); }
:root[data-theme="dark"] .font-size-control,
:root[data-theme="dark"] .theme-seg,
:root[data-theme="dark"] .nus-seg,
:root[data-theme="dark"] .seg2,
:root[data-theme="dark"] .seg3 { background: #111a36; border-color: var(--hairline); }
:root[data-theme="dark"] .font-size-btn { background: #1b2650; color: var(--text); }
:root[data-theme="dark"] .overlay,
:root[data-theme="dark"] .menu-overlay { background: rgba(3, 6, 16, 0.66); }
:root[data-theme="dark"] .toast { background: rgba(23, 32, 64, 0.96); border: 1px solid var(--hairline); }
:root[data-theme="dark"] .verse-row,
:root[data-theme="dark"] .prayer-body { border-color: var(--hairline); }
:root[data-theme="dark"] .photo-carousel { box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--hairline); }
