:root {
  --paper: #faf7f2;
  --paper-warm: #f5f0e6;
  --ink: #1d1d1b;
  --ink-soft: #4a4744;
  --ink-faint: #8e8a83;
  --ink-faintest: #b8b4ac;
  --rubric: #9a2419;
  --rubric-soft: #c44a3d;
  --line: #ddd6c8;
  --line-soft: #e8e2d3;
  --highlight: rgba(154, 36, 25, 0.06);
  --shadow: rgba(29, 29, 27, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* ========== Splash rapide ========== */
.splash {
  position: fixed; inset: 0; background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 1000; transition: opacity 0.5s ease-out;
}
.splash.fade { opacity: 0; pointer-events: none; }
.splash-cross { font-size: 76px; color: var(--rubric); line-height: 1; margin-bottom: 18px; }
.splash-title { font-size: 26px; letter-spacing: 0.04em; color: var(--ink); font-weight: 400; }
.splash-subtitle { font-size: 13px; color: var(--ink-faint); font-style: italic; margin-top: 4px; }

/* ========== Header global ========== */
.header {
  display: flex; align-items: center; justify-content: center;
  padding: 18px 20px 14px;
  position: relative;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.header-logo { font-size: 42px; color: var(--rubric); font-weight: 400; line-height: 1; cursor: pointer; user-select: none; transition: opacity 0.15s; }
.header-logo:hover, .header-logo:active { opacity: 0.7; }
.header-settings { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--ink-faintest); font-size: 22px; cursor: pointer; padding: 6px; user-select: none; }
.header-back { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-faintest); font-size: 28px; cursor: pointer; padding: 6px 10px; user-select: none; display: none; line-height: 1; }

.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; }

/* Cadre canonique */
.canonical-frame {
  margin: 22px 20px 26px; padding: 18px 22px;
  background: var(--paper-warm); border-left: 3px solid var(--rubric);
  border-radius: 0 4px 4px 0; text-align: center;
}
.canonical-date { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rubric); font-weight: 500; margin-bottom: 4px; }
.canonical-name { font-size: 24px; font-weight: 500; color: var(--ink); line-height: 1.25; margin-bottom: 8px; }
.canonical-meta { font-size: 15px; color: var(--ink-soft); font-style: italic; line-height: 1.4; }
.canonical-meta strong { font-style: normal; font-weight: 500; color: var(--ink); }
.canonical-warning { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-faint); font-style: italic; letter-spacing: 0.02em; }

/* Entry */
.entry-title { text-align: center; font-size: 14px; color: var(--ink-faint); letter-spacing: 0.06em; margin: 4px 0 24px; font-style: italic; }
.entry-options { padding: 0 20px 40px; }
.entry-option { display: block; width: 100%; margin-bottom: 14px; padding: 24px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; text-align: left; font-family: inherit; font-size: 22px; color: var(--ink); font-weight: 500; cursor: pointer; transition: all 0.15s; position: relative; }
.entry-option:hover, .entry-option:active { background: var(--paper-warm); border-color: var(--rubric-soft); }
.entry-option-arrow { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); color: var(--ink-faintest); font-size: 26px; }

/* Checklist */
.checklist { padding: 0 20px 110px; }
.master-slot { margin: 0 -4px 14px; padding: 16px 20px; background: linear-gradient(180deg, #f6f1e6 0%, #f1ecdf 100%); border: 1px solid var(--line); border-left: 4px solid var(--rubric); border-radius: 6px; cursor: pointer; position: relative; }
.master-slot-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rubric); font-weight: 500; margin-bottom: 4px; }
.master-slot-value { font-size: 20px; color: var(--ink); font-weight: 500; }
.master-slot-arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-faintest); font-size: 20px; }

.derogation-slot { margin: -8px 6px 14px 28px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.derogation-icon { color: var(--rubric-soft); font-size: 13px; font-style: italic; }
.derogation-content { flex: 1; }
.derogation-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2px; }
.derogation-value { font-size: 15px; color: var(--ink-soft); }
.derogation-tip { font-size: 11px; color: var(--ink-faint); font-style: italic; margin-top: 2px; }
.slot-arrow { color: var(--ink-faintest); font-size: 16px; }

.phase { margin-top: 22px; }
.phase-header { display: flex; align-items: center; gap: 12px; padding: 4px 6px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }
.phase-bullet { font-size: 14px; color: var(--rubric); }
.phase-title { font-size: 14px; color: var(--ink-soft); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.slot { display: flex; align-items: center; padding: 14px; margin-bottom: 4px; background: var(--paper); border: 1px solid transparent; border-radius: 4px; cursor: pointer; transition: all 0.12s; }
.slot:hover { background: var(--paper-warm); border-color: var(--line-soft); }
.slot-label { font-size: 16px; color: var(--ink-soft); flex: 1; }
.slot-value { font-size: 18px; color: var(--ink); font-weight: 500; margin-right: 14px; text-align: right; }

.celebrate-bar { position: sticky; bottom: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(250, 247, 242, 0) 0%, var(--paper) 30%); z-index: 10; }
.celebrate-btn { width: 100%; padding: 17px; background: var(--rubric); color: white; border: none; border-radius: 6px; font-family: inherit; font-size: 19px; font-weight: 500; letter-spacing: 0.04em; cursor: pointer; box-shadow: 0 4px 14px var(--shadow); }

/* Bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(29, 29, 27, 0.4); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; background: var(--paper); border-radius: 16px 16px 0 0; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1); box-shadow: 0 -8px 32px rgba(29, 29, 27, 0.15); }
.sheet.open { transform: translateY(0); }
.sheet-handle { width: 38px; height: 4px; background: var(--ink-faintest); border-radius: 2px; margin: 10px auto 0; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 8px; border-bottom: 1px solid var(--line-soft); }
.sheet-title { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rubric); font-weight: 500; }
.sheet-close { font-size: 22px; color: var(--ink-faint); cursor: pointer; padding: 4px 8px; }
.sheet-body { padding: 12px 18px 30px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sub-question { font-size: 14px; color: var(--ink-soft); font-style: italic; padding: 8px 4px; }
.sheet-option { display: flex; padding: 14px; margin-bottom: 8px; background: var(--paper-warm); border: 1px solid var(--line-soft); border-radius: 6px; cursor: pointer; position: relative; }
.sheet-option.selected { background: var(--highlight); border-color: var(--rubric); }
.sheet-option.selected::after { content: "✓"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--rubric); font-size: 18px; }
.sheet-option-title { font-size: 17px; color: var(--ink); font-weight: 500; }
.sheet-option-desc { font-size: 13px; color: var(--ink-faint); font-style: italic; margin-top: 2px; }
.sheet-option-warning { margin-top: 6px; padding: 6px 10px; background: rgba(154, 36, 25, 0.07); border-radius: 3px; font-size: 12px; color: var(--rubric); font-style: italic; }

.placeholder-screen { padding: 60px 30px; text-align: center; color: var(--ink-faint); }
.placeholder-screen h2 { font-size: 24px; color: var(--ink); margin-bottom: 10px; font-weight: 500; }

@media (min-width: 700px) {
  .checklist, .entry-options { padding-left: 60px; padding-right: 60px; }
  .canonical-frame { margin-left: 60px; margin-right: 60px; }
  body { font-size: 19px; }
  .canonical-name { font-size: 28px; }
  .canonical-meta { font-size: 16px; }
  .master-slot { padding: 18px 22px; }
  .master-slot-value { font-size: 22px; }
  .slot-label { font-size: 17px; }
  .slot-value { font-size: 19px; }
  .entry-option { padding: 26px 26px; font-size: 24px; }
}

/* ============================================
   MODE CÉLÉBRATION
   ============================================ */

body.in-celebration .header { display: none; }
body.in-celebration .splash { display: none !important; }

.cel-header {
  display: flex; align-items: center; justify-content: center;
  padding: 16px 20px 8px; padding-top: calc(16px + env(safe-area-inset-top));
  position: relative; background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}
.cel-page-num { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-faintest); letter-spacing: 0.08em; padding-top: calc(env(safe-area-inset-top) / 2); }
.cel-logo { font-size: 38px; color: var(--rubric); line-height: 1; user-select: none; }
.cel-gear { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-faintest); font-size: 22px; cursor: pointer; padding: 8px; user-select: none; padding-top: calc(8px + env(safe-area-inset-top) / 2); }
.cel-gear.hidden { visibility: hidden; }

.cel-moment {
  text-align: center; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--rubric); font-weight: 500; padding: 6px 20px 14px;
  background: var(--paper); border-bottom: 1px solid var(--line-soft);
}

.cel-content {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 30px 24px 80px; position: relative; z-index: 1;
}

.cel-tapzone { position: fixed; top: 110px; bottom: 80px; width: 35%; z-index: 5; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cel-tapzone-left { left: 0; }
.cel-tapzone-right { right: 0; }

.cel-footer { position: fixed; bottom: 0; left: 0; right: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); text-align: center; background: linear-gradient(180deg, rgba(250, 247, 242, 0) 0%, var(--paper) 50%); z-index: 6; pointer-events: none; }
.cel-back-link { display: inline-block; font-size: 12px; font-style: italic; color: var(--ink-faintest); cursor: pointer; padding: 8px 16px; pointer-events: auto; }

.cel-page-content {
  max-width: 760px; margin: 0 auto;
  font-size: 22px; line-height: 1.6; color: var(--ink);
}

/* === Conventions Missel === */

/* Rubrique : italique rouge, regular (non gras) */
.cel-rubric {
  color: var(--rubric); font-style: italic; font-size: 15px; font-weight: 400;
  line-height: 1.5; margin: 14px 0;
}
.cel-rubric.center { text-align: center; }
.cel-rubric.inline {
  display: block; padding-left: 60px; margin: 4px 0;
}

/* Référence biblique discrète */
.cel-ref { font-size: 14px; letter-spacing: 0.04em; color: var(--ink-faint); font-style: italic; text-align: center; margin-bottom: 14px; }

/* Croix rouge inline */
.cross { color: var(--rubric); }

/* N. en rouge (placeholders pape/évêque) */
.placeholder-N { color: var(--rubric); font-style: italic; font-weight: 500; }

/* Sous-moment (sous-titre de page) */
.cel-submoment {
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); text-align: center; font-style: italic;
  margin-bottom: 18px;
}

/* Subtitle (sous-titre de section, ex. évangile) */
.cel-section-subtitle {
  font-size: 17px; font-style: italic; color: var(--ink-soft);
  text-align: left; margin-bottom: 14px; line-height: 1.4;
}

/* === Paroles du prêtre, paroles communes, réponses === */

/* Parole du prêtre à voix haute : GRAS */
.cel-priest {
  font-size: 22px; line-height: 1.6; margin: 10px 0;
  font-weight: 500;
}

/* Parole du prêtre à voix basse : italique, regular, taille normale */
.cel-priest.silent {
  font-style: italic;
  font-weight: 400;
}

/* Réponse de l'assemblée : GRAS, préfixe R/ rouge italique non gras */
.cel-response {
  font-size: 22px; line-height: 1.6; margin: 8px 0;
  padding-left: 32px; text-indent: -32px;
  font-weight: 500;
}
.cel-response::before {
  content: "R/ ";
  color: var(--rubric); font-style: italic; font-weight: 500;
}

/* Acclamation commune (avec le peuple) : GRAS */
.cel-common { font-size: 22px; line-height: 1.6; margin: 10px 0; font-weight: 500; }

/* Bloc V/R "collés" (préface) */
.cel-vr-pair {
  margin: 0 0 18px;
}
.cel-vr-pair .cel-priest { margin: 0; }
.cel-vr-pair .cel-response { margin: 0; }
.cel-vr-pair:last-child { margin-bottom: 0; }

/* Texte courant (lectures, narrations) — non gras */
.cel-text { margin: 8px 0; line-height: 1.6; white-space: pre-line; font-size: 21px; }
.cel-divider { border: none; border-top: 1px solid var(--line-soft); margin: 22px 0; }

/* Bloc consécration */
.cel-consecration-box {
  position: relative;
  margin: 28px 0 18px;
  padding: 38px 24px 26px;
  background: linear-gradient(180deg, #f8f3e6 0%, #f5efe1 100%);
  border: 1px solid var(--line); border-radius: 6px;
  text-align: center;
}
.cel-consecration-box::before {
  content: "✠";
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--paper); color: var(--rubric); font-size: 22px;
  padding: 0 12px; line-height: 1;
}
.cel-paroles-consecration {
  font-size: 23px; line-height: 1.5; letter-spacing: 0.04em;
  font-variant: small-caps; font-weight: 600; color: var(--ink);
}
.cel-paroles-consecration p { margin: 0 0 4px; }

/* === Lettrines rouges PE et oraisons === */
.cel-paragraph-pe {
  position: relative;
  margin: 20px 0;
  padding-left: 0;
}
.cel-paragraph-pe .cel-pe-lines { font-weight: 500; }

/* Lettrine rouge (paragraphe ordinaire de PE) */
.cel-lettrine {
  float: left;
  color: var(--rubric);
  font-weight: 700;
  font-size: 3em;
  line-height: 0.85;
  margin-right: 6px;
  margin-top: 4px;
  font-family: 'EB Garamond', Georgia, serif;
}

/* Trait horizontal devant la lettrine (marque de concélébration) */
.cel-paragraph-pe.with-trait::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  width: 26px;
  border-top: 2px solid var(--rubric);
  border-bottom: 1px solid var(--rubric);
  height: 6px;
}

.cel-paragraph-pe.with-trait .cel-lettrine {
  margin-left: 22px;
}

/* Lignes d'un paragraphe PE */
.cel-pe-lines {
  font-size: 22px;
  line-height: 1.65;
}

.cel-pe-line {
  display: block;
}

.cel-pe-line.indent {
  padding-left: 32px;
}

/* === Oraisons (collecte, prières) === */
.cel-oraison {
  position: relative;
  margin: 16px 0;
  padding-left: 0;
  font-size: 22px;
  line-height: 1.65;
  font-weight: 500;
}
.cel-oraison .cel-lettrine {
  font-size: 2.6em;
  margin-top: 2px;
}

/* Conclusion d'oraison */
.cel-conclusion {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.65;
  font-weight: 500;
}

/* === Anamnèses === */
.cel-anamnese {
  margin: 14px 0;
  padding: 12px 18px;
}
.cel-anamnese-num {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--rubric);
  font-style: italic;
  font-weight: 500;
  margin-bottom: 4px;
}
.cel-anamnese-monition {
  font-size: 19px;
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 500;
}
.cel-anamnese-response {
  font-size: 21px; line-height: 1.55;
  padding-left: 28px; text-indent: -28px;
  font-weight: 500;
}
.cel-anamnese-response::before {
  content: "R/ "; color: var(--rubric); font-style: italic; font-weight: 500;
}

/* === Listes d'options inline (style "Ou bien") — tout en noir === */
.cel-option-block {
  margin: 14px 0;
}
.cel-option-separator {
  font-style: italic; color: var(--rubric);
  font-size: 15px; margin: 14px 0 10px; font-weight: 400;
}
.cel-option-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--rubric);
  font-style: italic;
  font-weight: 500;
  margin-bottom: 4px;
}

/* iPad */
@media (min-width: 700px) {
  .cel-content { padding: 40px 60px 100px; }
  .cel-page-content { font-size: 24px; }
  .cel-priest, .cel-response, .cel-common { font-size: 24px; }
  .cel-pe-lines, .cel-oraison, .cel-conclusion { font-size: 24px; }
  .cel-text { font-size: 22px; }
  .cel-paroles-consecration { font-size: 26px; }
  .cel-anamnese-monition { font-size: 21px; }
  .cel-anamnese-response { font-size: 23px; }
  .cel-rubric { font-size: 16px; }
}
@media (min-width: 1000px) {
  .cel-content { padding: 50px 100px 120px; }
}
