/* Masque visuellement un élément sans le retirer de l'arbre d'accessibilité
   (pattern "sr-only" standard) : utilisé pour le titre <h2> ajouté avant
   #pp-app, qui donne un repère de navigation aux lecteurs d'écran sans
   dupliquer visuellement un titre de page déjà posé par le thème. */
.pp-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================== Variables ===================== */
#pp-app {
  --pp-border: #cbd5e1;
  --pp-bg: #ffffff;
  --pp-bg-alt: #f8fafc;
  --pp-text: #1e293b;
  --pp-muted: #64748b;
  --pp-accent: #2563eb;
  --pp-accent-text: #ffffff;
  --pp-danger: #dc2626;
  --pp-warning: #d97706;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Taille de base explicite plutôt que dépendre du thème (qui peut poser
     13-14px) : tous les textes du plugin sont dimensionnés en px à partir
     d'ici, une base plus généreuse relève donc l'ensemble. */
  font-size: 16px;
  color: var(--pp-text, #1e293b);
  max-width: 100%;
  position: relative;
}

#pp-app *, #pp-app *::before, #pp-app *::after { box-sizing: border-box; }

.pp-loading { color: #64748b; font-style: italic; }

/* Titre visible + paragraphe d'introduction, optionnels (réglage "Affichage"
   > "Titre au-dessus du planning"). Volontairement en dehors de #pp-app
   (voir le commentaire dans planning-paroisse.php, pp_render_shortcode()) :
   des valeurs par défaut proches de celles de #pp-app (police, couleur de
   texte) sont donc redéfinies ici explicitement plutôt qu'héritées. */
.pp-planning-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.5em;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1e293b;
  text-align: center;
}
.pp-planning-intro {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 16px;
  color: #1e293b;
}
.pp-planning-intro a {
  color: #2563eb; /* PP_DEFAULT_ACCENT_COLOR ; surchargé en inline si une couleur d'accent personnalisée est enregistrée, voir pp_render_shortcode() */
  text-decoration: underline;
}
.pp-planning-intro p:last-child { margin-bottom: 0; }

/* Bloc réservé aux membres validés (voir includes/helpers.php,
   pp_show_members_block_enabled()) : léger encadré pour bien signaler que
   ce paragraphe n'est visible que des personnes connectées et validées,
   même quand le planning est par ailleurs public. */
.pp-planning-members {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 16px;
}
.pp-planning-members a {
  color: #2563eb; /* PP_DEFAULT_ACCENT_COLOR ; surchargé en inline si une couleur d'accent personnalisée est enregistrée, voir pp_render_shortcode() */
  text-decoration: underline;
}
.pp-planning-members p:last-child { margin-bottom: 0; }
/* Le contenu de ce bloc (pp_get_members_block_html()) est saisi dans un
   éditeur qui l'enveloppe systématiquement dans un ou plusieurs <p>, dont le
   navigateur applique par défaut une marge haute (~1em) : combinée au
   padding du bloc lui-même, elle créait un espace disgracieux tout en haut
   de l'encadré. On la retire uniquement sur le tout premier enfant, pour ne
   pas toucher à l'espacement entre plusieurs paragraphes. */
.pp-planning-members > *:first-child { margin-top: 0; }

/* Barre tout en haut de la PAGE (avant même le titre du planning), avec la
   zone de connexion (.pp-auth-area) collée à droite — comme le bloc compte/
   connexion d'un site classique. Montée par mountAuthBar() (assets/
   script.js) en dehors de #pp-app, au-dessus de .pp-planning-title/
   .pp-sr-only : comme .pp-planning-title/.pp-planning-intro/.pp-planning-
   members ci-dessus, elle redéfinit donc elle-même sa police/couleur/
   box-sizing par défaut plutôt que d'en hériter de #pp-app (voir aussi, plus
   bas, les règles dupliquées avec le sélecteur ".pp-top-bar" pour les
   boutons/icônes qu'elle contient, pour la même raison). */
.pp-top-bar {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: #1e293b;
  display: flex;
  justify-content: flex-end;
  margin: 0 0 6px;
}
.pp-top-bar *, .pp-top-bar *::before, .pp-top-bar *::after { box-sizing: border-box; }

/* Lien "Guide d'utilisation", tout en haut à droite de l'écran de planning
   (voir assets/script.js, renderGuideLink()/mountGuideLink()), juste sous la
   barre de connexion ci-dessus (.pp-top-bar) et avant le titre du planning.
   Montée par mountGuideLink() en dehors de #pp-app, comme .pp-top-bar
   ci-dessus : elle redéfinit donc elle-même sa police/box-sizing par défaut
   plutôt que d'en hériter de #pp-app, pour la même raison. */
.pp-guide-link-row {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  text-align: right;
  margin: 0 0 6px;
  font-size: 13px;
}
.pp-guide-link-row a {
  color: var(--pp-accent, #2563eb);
  text-decoration: underline;
}

/* ===================== Barre d'outils ===================== */
.pp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.pp-toolbar .pp-spacer { flex: 1 1 auto; }

/* Zone de connexion (bouton "Se connecter", ou pour un compte connecté :
   bouton "Inviter", cloche de notification, bulle "Avatar" — dans cet
   ordre, la bulle restant la plus à droite), affichée dans la barre tout en
   haut de la page (.pp-top-bar). Pas de flex-wrap : sur un écran étroit, la
   zone reste sur une seule ligne collée à droite (voir la media query
   "Responsive" plus bas), la bulle ayant remplacé l'ancien texte "nom ·
   rôle" qui pouvait, lui, passer à la ligne. */
.pp-auth-area { display: flex; align-items: center; gap: 8px; }

/* Onglets Connexion / Créer un compte de la fenêtre d'authentification. */
.pp-auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }

.pp-tabs { display: flex; gap: 6px; }
#pp-app .pp-tab-btn {
  padding: 9px 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}
#pp-app .pp-tab-btn.pp-active { background: var(--pp-accent, #2563eb); color: var(--pp-accent-text, #ffffff); border-color: var(--pp-accent, #2563eb); }

/* Boutons ronds/carrés à icône seule : bascule tableau/liste, icône de
   filtrage, icône de paramétrage (⚙), cloche de notification. Remplacent
   les anciens boutons textuels de la barre d'outils. Dupliqué avec le
   sélecteur ".pp-top-bar" : la cloche de notification vit désormais dans
   la barre du haut, montée en dehors de #pp-app (voir mountAuthBar() dans
   assets/script.js), qui ne peut donc plus la sélectionner via "#pp-app". */
#pp-app .pp-icon-btn, .pp-top-bar .pp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  position: relative;
  font-family: inherit;
}
#pp-app .pp-icon-btn:hover, .pp-top-bar .pp-icon-btn:hover { background: #f1f5f9; color: #1e293b; }
#pp-app .pp-icon-btn.pp-active, .pp-top-bar .pp-icon-btn.pp-active {
  background: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
  border-color: var(--pp-accent, #2563eb);
}
#pp-app .pp-icon-btn .pp-icon, .pp-top-bar .pp-icon-btn .pp-icon { display: inline-flex; }

/* Point indicateur affiché sur l'icône de filtrage quand au moins un
   filtre est actif alors que le volet des filtres est masqué (cf.
   anyFiltersActive() dans script.js), pour ne pas cacher un filtre en
   cours d'application à l'utilisateur. */
#pp-app .pp-icon-btn-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pp-warning, #d97706);
  border: 1.5px solid #ffffff;
}
#pp-app .pp-icon-btn.pp-active .pp-icon-btn-dot { border-color: var(--pp-accent, #2563eb); }

/* Menu déroulant "Paramètres" : regroupe Gérer les églises / Exporter CSV /
   Importer CSV, auparavant en boutons séparés dans la barre d'outils. */
.pp-settings-menu { position: relative; }
.pp-settings-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .15);
  padding: 6px;
  gap: 2px;
}
#pp-app .pp-settings-item {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: none;
  background: none;
  color: #1e293b;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
#pp-app .pp-settings-item:hover { background: #f1f5f9; }

/* Cloche de notification (demandes d'accès en attente), à gauche de la
   bulle "Avatar" (.pp-user-menu, plus bas) dans la zone de connexion : même
   structure bouton-icône + menu déroulant que .pp-settings-menu ci-dessus,
   avec en plus une pastille de compte sur l'icône (voir renderNotifBell()
   dans assets/script.js). Règles ci-dessous dupliquées avec le sélecteur
   ".pp-top-bar" pour la même raison que .pp-icon-btn plus haut. */
.pp-notif-menu { position: relative; }
#pp-app .pp-notif-badge, .pp-top-bar .pp-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--pp-warning, #d97706);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1.5px solid #ffffff;
}
.pp-notif-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: calc(100vw - 24px);
  max-height: 360px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .15);
  padding: 6px;
  gap: 6px;
}
#pp-app .pp-notif-empty, .pp-top-bar .pp-notif-empty { padding: 10px 8px; color: #64748b; font-size: 14px; }
#pp-app .pp-notif-item, .pp-top-bar .pp-notif-item {
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
#pp-app .pp-notif-item-name, .pp-top-bar .pp-notif-item-name { font-weight: 600; color: #1e293b; font-size: 14px; }
#pp-app .pp-notif-item-meta, .pp-top-bar .pp-notif-item-meta { color: #64748b; font-size: 12px; margin-top: 2px; }
#pp-app .pp-notif-item-actions, .pp-top-bar .pp-notif-item-actions { display: flex; gap: 6px; margin-top: 8px; }

#pp-app .pp-btn, .pp-top-bar .pp-btn {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  font-family: inherit;
}
#pp-app .pp-btn:hover, .pp-top-bar .pp-btn:hover { background: #f1f5f9; color: #1e293b; }
#pp-app .pp-btn-primary { background: var(--pp-accent, #2563eb); color: var(--pp-accent-text, #ffffff); border-color: var(--pp-accent, #2563eb); }
#pp-app .pp-btn-primary:hover { background: var(--pp-accent, #2563eb); filter: brightness(0.88); color: var(--pp-accent-text, #ffffff); }
/* Bouton "+ Nouvelle célébration" : icône "+" toujours visible, libellé
   masqué sur mobile (cf. media query plus bas) pour que le bouton se
   réduise à sa seule icône dans le groupe de gauche de la barre d'outils. */
#pp-app .pp-new-celebration-icon { font-weight: 700; }
#pp-app .pp-btn-danger { color: #dc2626; border-color: #fca5a5; background: #fff; }
#pp-app .pp-btn-danger:hover { background: #fef2f2; }
#pp-app .pp-btn-small, .pp-top-bar .pp-btn-small { padding: 5px 11px; font-size: 13px; }
#pp-app .pp-add-btn { margin-top: 4px; }

/* Bulle "Avatar" du compte connecté, la plus à droite de la zone de
   connexion (voir renderUserMenu() dans assets/script.js) : bouton rond,
   initiale du nom, qui ouvre au clic un menu déroulant (e-mail, statut,
   déconnexion) — même structure bouton + menu que .pp-settings-menu/
   .pp-notif-menu ci-dessus. */
.pp-user-menu { position: relative; }
.pp-top-bar .pp-user-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.pp-top-bar .pp-user-avatar-btn:hover,
.pp-top-bar .pp-user-avatar-btn.pp-active { filter: brightness(0.9); }
.pp-top-bar .pp-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .15);
  padding: 10px 12px;
}
.pp-top-bar .pp-user-dropdown-email {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  word-break: break-all;
}
.pp-top-bar .pp-user-dropdown-status { font-size: 13px; color: #64748b; margin-top: 2px; }
.pp-top-bar .pp-user-dropdown-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 10px -12px;
}
.pp-top-bar .pp-user-dropdown-logout {
  display: block;
  width: 100%;
  padding: 7px 0;
  border: none;
  background: none;
  color: var(--pp-danger, #dc2626);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  font-family: inherit;
}
.pp-top-bar .pp-user-dropdown-logout:hover { text-decoration: underline; }

.pp-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 15px; }
.pp-filters label { display: flex; align-items: center; gap: 5px; cursor: pointer; }

.pp-filterbar { font-size: 15px; }
.pp-filterbar-groups { align-items: stretch; }
.pp-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  min-width: 200px;
}
#pp-app .pp-filter-group-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  background: none;
  border: none;
  padding: 2px 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
#pp-app .pp-filter-group-title:hover { color: #334155; }
#pp-app .pp-filter-group-title-active { color: var(--pp-accent, #2563eb); }
.pp-filter-group-caret { font-size: 11px; width: 11px; display: inline-block; }
.pp-filter-group-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.pp-filter-group-collapsed { padding-bottom: 8px; }
.pp-reset-btn-all { align-self: center; }
.pp-filter-item { display: flex; align-items: center; gap: 5px; cursor: pointer; }
#pp-app .pp-filter-item select,
#pp-app .pp-filter-item input[type="date"] {
  padding: 6px 8px;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  font-size: 14px;
  background: #ffffff;
  color: #1e293b;
  font-family: inherit;
}
.pp-church-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#pp-app .pp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
#pp-app .pp-chip.pp-chip-active {
  background: #eff6ff;
  border-color: var(--pp-accent, #2563eb);
  color: #1e3a8a;
  font-weight: 600;
}
#pp-app .pp-reset-btn { font-size: 13px; color: #64748b; background: none; border: 1px solid #cbd5e1; border-radius: 5px; padding: 5px 10px; cursor: pointer; font-family: inherit; }
#pp-app .pp-reset-btn:hover { background: #f1f5f9; color: #334155; }

/* ===================== Pastille couleur église ===================== */
.pp-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  flex: 0 0 auto;
  border: 1px solid rgba(0,0,0,.15);
}

.pp-church-label { display: inline-flex; align-items: center; font-weight: 600; }

/* Pastille de légende dans les filtres "Sans chanteur"/"Sans musicien" :
   reprend les mêmes couleurs que .pp-alert-dot-strong/-light pour que le
   filtre serve aussi de rappel du code couleur utilisé ailleurs (tableau,
   liste). Purement décorative (aria-hidden), le texte du filtre porte déjà
   le sens. */
.pp-legend-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin: 0 5px 0 1px;
}
.pp-legend-dot-strong { background: #dc2626; }
.pp-legend-dot-light { background: #fde68a; border: 1px solid rgba(0,0,0,.15); }

/* ===================== Alertes (couleur seule) ===================== */
/* Ce sont des <button> : on retire le style natif du navigateur puis on
   réapplique l'apparence "pastille", en ajoutant un état actif (filtre
   engagé) et un retour visuel au survol / focus clavier. */
.pp-alert {
  display: inline-block; padding: 3px 9px; border-radius: 10px; font-size: 12px; font-weight: 700;
  margin: 2px 4px 2px 0; border: 2px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.4;
}
.pp-alert-strong { background: #fecaca; color: #7f1d1d; } /* sans chanteur : rouge */
.pp-alert-light { background: #fde68a; color: #78350f; }  /* sans musicien : orange, plus doux */
.pp-alert:hover { filter: brightness(0.95); }
.pp-alert:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 1px; }
.pp-alert-active { border-color: currentColor; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
/* 2.37.0 : coche dessinée (masque SVG à la couleur du texte) au lieu du
   caractère ✓, dont le rendu variait selon les appareils. */
.pp-alert-active::after {
  content: '';
  display: inline-block;
  width: .95em;
  height: .95em;
  margin-left: .3em;
  vertical-align: -.12em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Variante "pastille" compacte des alertes, vue liste uniquement (voir
   alertBadge()/alertsFor() dans script.js, appelées avec {compact:true}
   par listItem()). Remplace le badge texte pleine largeur par un rond
   couleur + icône, plus discret sur mobile. La distinction forte (sans
   chanteur) / légère (sans musicien) reste portée par la couleur (comme la
   vue tableau) et renforcée par la taille et le remplissage : la pastille
   "forte" est plus grande et pleine couleur, la "légère" plus petite et
   plus douce, pour rester lisible même par les daltoniens qui ne
   distinguent pas rouge/orange. */
.pp-alert-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; margin: 2px 4px 2px 0;
  border-radius: 50%; border: 2px solid transparent; line-height: 1;
}
.pp-alert-dot::after { content: none; } /* pas de coche texte dans la pastille */
.pp-alert-dot.pp-alert-active { box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 0 0 2px #fff; }
.pp-alert-dot.pp-alert-strong {
  width: 22px; height: 22px;
  background: #dc2626; color: #fff; /* rouge plein : alerte forte */
}
.pp-alert-dot.pp-alert-light {
  width: 18px; height: 18px;
  background: #fde68a; color: #78350f; /* orange doux : alerte légère */
}
.pp-alert-dot svg { display: block; }

/* ===================== Vue tableau ===================== */
/* Remarque technique : dès qu'un axe a "overflow-x: auto", les navigateurs
   calculent aussi l'autre axe ("overflow-y") comme "auto" (règle du
   "scrolling box" en CSS). Le conteneur devient alors lui-même la zone de
   défilement de référence pour les cellules "position: sticky" qu'il
   contient — mais comme sa hauteur suit celle du tableau (elle ne défile
   jamais verticalement), les en-têtes figés ne restent pas visibles lors
   du défilement de la page. On fixe donc explicitement une hauteur
   maximale avec "overflow-y: auto" pour que ce soit le corps du tableau
   qui défile *dans* ce conteneur, et que l'en-tête sticky s'y accroche
   correctement, quelle que soit la façon dont la page défile par ailleurs. */
.pp-grid-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}
table.pp-grid { border-collapse: collapse; width: 100%; min-width: 1100px; table-layout: fixed; }
.pp-date-col { width: 155px; }
table.pp-grid th, table.pp-grid td {
  border: 1px solid #e2e8f0;
  padding: 8px;
  vertical-align: top;
  text-align: left;
  overflow-wrap: break-word;
}
table.pp-grid thead th {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 #cbd5e1;
}
/* Remarque : l'en-tête sticky s'accroche désormais au conteneur défilant
   ".pp-grid-wrap" (voir plus haut), pas à la fenêtre du navigateur. Il n'y a
   donc plus besoin de décaler "top" pour la barre d'administration
   WordPress : celle-ci reste au-dessus du conteneur, qui défile lui-même
   indépendamment de la page. */
/* Coin haut-gauche : la case d'en-tête "Date" reste figée à la fois en haut
   et à gauche, comme les cases "date" de chaque ligne. */
table.pp-grid thead th.pp-date-col-header { position: sticky; left: 0; z-index: 4; }
table.pp-grid td.pp-date-row-header {
  background: #f8fafc;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: break-word;
  position: sticky; left: 0; z-index: 1;
}
.pp-cell { min-width: 210px; }

/* Repère visuel temporaire sur la célébration qu'on vient de créer ou de
   déplacer (date/église modifiée), une fois que la vue s'est déplacée dessus
   automatiquement — voir focusCelebration() dans script.js. S'estompe seule
   après quelques secondes (ne bloque aucune interaction, pas d'opacité). */
.pp-just-updated {
  outline: 2px solid var(--pp-accent, #2563eb);
  outline-offset: 2px;
  border-radius: 6px;
  transition: outline-color 1.6s ease, outline-offset 1.6s ease;
}
.pp-just-updated.pp-just-updated-fade {
  outline-color: transparent;
}
.pp-cell-empty { color: #cbd5e1; text-align: center; }
.pp-cell-date { font-weight: 700; text-transform: capitalize; }
.pp-cell-heure { color: #334155; margin-bottom: 4px; font-weight: 700; text-align: center; }
.pp-cell-block { margin-top: 8px; font-size: 15px; }

/* Bloc "Important" : avertissement du gestionnaire, placé juste sous
   l'horaire (voir celebrationCellContent() dans script.js). Se démarque des
   autres champs par un fond/bordure d'alerte dès qu'un texte est saisi
   (classe .pp-important-active) ; reste discret (juste le champ de saisie,
   sans mise en couleur) quand il est vide, pour ne pas alerter sans raison. */
.pp-important-block { margin-top: 4px; margin-bottom: 8px; font-size: 15px; }
.pp-important-block.pp-important-active {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 4px 6px;
}
.pp-important-block.pp-important-active .pp-label { color: #b91c1c; }
.pp-important-text { color: #b91c1c; font-weight: 700; text-align: center; }
#pp-app .pp-inline-important { font-weight: 700; text-align: center; }
#pp-app .pp-important-block.pp-important-active .pp-inline-important { color: #b91c1c; }

/* En vue liste, le bloc "Important" rejoint l'en-tête de la carte (date,
   heure, église) au lieu de rester dans le corps : c'est un avertissement
   qui doit se voir en un coup d'œil, pas un champ de détail parmi d'autres
   (voir listItem() dans script.js). Il occupe sa propre ligne, juste sous
   la ligne date/heure/église/alertes (.pp-list-item-head-top), plutôt que
   de partager cette ligne et de ne retomber à la ligne que si elle
   déborde. Les marges verticales de .pp-important-block n'ont pas lieu
   d'être ici, l'espacement est déjà géré par le "gap" de
   .pp-list-item-head. */
.pp-list-item-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pp-list-item-head-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pp-list-item-head .pp-important-block {
  margin: 0;
  width: 100%;
}
.pp-cell-block .pp-label,
.pp-attachments .pp-label { color: #334155; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: 2px; }
.pp-tags-wrap { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }

/* ===================== Vue liste ===================== */
/* Cartes "app mobile" plutôt que lignes de tableur : on remplace la fine
   bordure grise omniprésente par une ombre douce (+ un fond à peine
   contrasté), on agrandit le rayon des coins, et on ajoute un léger effet
   de surélévation au survol. Le liseré de couleur gauche (église) et le
   fond coloré piloté par cellColorMode (voir listItem() dans script.js, qui
   pose background-color en style inline) sont conservés tels quels : le
   style inline l'emporte simplement sur le fond ci-dessous quand il est
   présent. */
.pp-list { display: flex; flex-direction: column; gap: 14px; }
.pp-list-item {
  border: 1px solid rgba(15, 23, 42, .05);
  border-left: 4px solid #94a3b8;
  border-radius: 16px;
  padding: 16px 18px;
  background: #fbfcfe;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 16px rgba(15, 23, 42, .06);
  transition: box-shadow .15s ease;
}
.pp-list-item:hover {
  box-shadow: 0 2px 6px rgba(15, 23, 42, .06), 0 10px 26px rgba(15, 23, 42, .09);
}
/* Bloc fusionné date + heure : les deux champs restent des éléments
   distincts (voir listItem() dans script.js), réunis dans un même bloc
   visuel — bordure et fond communs, comme un champ unique — plutôt que
   juxtaposés. Pour le gestionnaire, tout le bloc est cliquable (voir le
   gestionnaire de clic ajouté en JS) et prend l'apparence "façon tableur"
   des autres champs de saisie de la page. */
.pp-list-datetime {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 3px 7px;
}
.pp-list-datetime-editable {
  cursor: pointer;
}
.pp-list-datetime-editable:hover {
  border-color: transparent;
  background: rgba(37, 99, 235, .08);
}
.pp-list-date { font-weight: 700; text-transform: capitalize; }
.pp-list-heure { font-weight: 700; color: #334155; }
/* Le champ "façon tableur" (gestionnaire) doit garder une largeur compacte
   dans la ligne d'en-tête de la liste, plutôt que les 100% appliqués par
   défaut à .pp-inline-heure dans la vue tableau, et se fondre dans le bloc
   fusionné (plus de bordure/fond propres : c'est .pp-list-datetime qui les
   porte désormais). */
#pp-app .pp-list-item-head input.pp-inline-heure.pp-list-heure {
  width: auto;
  min-width: 62px;
  flex: 0 0 auto;
  padding: 3px 0;
}
/* Au repos et au survol, le champ heure n'affiche plus sa propre
   bordure/fond (c'est .pp-list-datetime qui les porte) ; le focus clavier
   (accessibilité) reste visible normalement, voir la règle générale
   #pp-app .pp-inline-heure:focus plus bas. */
#pp-app .pp-list-item-head input.pp-inline-heure.pp-list-heure,
#pp-app .pp-list-item-head input.pp-inline-heure.pp-list-heure:hover {
  border-color: transparent;
  background: transparent;
}
/* Hiérarchie visuelle de la carte : empilement vertical (et non plus une
   grille à 5 colonnes de poids égal) pour que l'œil suive dans l'ordre
   prêtre (discret) → intervenants (mis en avant) → remarques → pièces
   jointes (repliées, cf. .pp-list-attachments-toggle plus bas). Les blocs
   internes (.pp-cell-block, .pp-remarques-block, .pp-attachments)
   gardent leur marge haute d'origine pour la vue tableau : on la neutralise
   ici pour laisser le "gap" ci-dessous gérer l'espacement, en évitant un
   double espacement. */
.pp-list-body { display: flex; flex-direction: column; gap: 10px; }
.pp-list-body > .pp-cell-block,
.pp-list-body .pp-list-signups .pp-cell-block,
.pp-list-body .pp-attachments { margin-top: 0; }
.pp-list-col .pp-label { color: #334155; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: 2px; }
.pp-list-empty-msg { color: #64748b; font-style: italic; padding: 20px; text-align: center; }

/* Intervenants (chanteurs/musiciens) : juste après le prêtre, priorité n°2
   dans la carte. Toujours sur 2 colonnes côte à côte, même sur une carte
   étroite (contrairement à .pp-list-body qui, lui, s'empile), pour que
   "qui chante" et "qui joue" restent lisibles d'un coup d'œil. */
.pp-list-signups { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* Prêtre : priorité la plus basse des champs visibles (après l'en-tête),
   donc traité en simple ligne discrète plutôt qu'en bloc labellisé comme
   les autres champs — sans pour autant être moins lisible pour le
   gestionnaire, dont le champ de saisie reste normal. Masqué entièrement
   côté script.js (buildPretreListLine()) quand vide et non-gestionnaire. */
.pp-list-pretre { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: #64748b; }
.pp-list-pretre .pp-label {
  margin-bottom: 0; font-size: 12px; font-weight: 600; text-transform: none;
  letter-spacing: normal; white-space: nowrap;
}
.pp-list-pretre > div { color: #334155; }
#pp-app .pp-list-pretre input.pp-inline-text { width: auto; min-width: 130px; flex: 1 1 auto; padding: 2px 5px; }

/* Prêtre, Important (en-tête) et Remarques (corps) en vue liste : même
   principe que le champ heure et le sélecteur d'église ci-dessus (voir
   #pp-app .pp-list-item-head input.pp-inline-heure.pp-list-heure et
   .pp-church-label-editable select.pp-inline-select plus haut) — on ne
   change ni le comportement (clic, popovers, sauvegarde : bindInlineCommit()
   dans script.js) ni le focus clavier (accessibilité, cf. la règle générale
   #pp-app .pp-inline-text:focus etc. plus bas, non touchée ici), seulement
   le survol "façon tableur" (bordure grise nette + fond blanc plein) qu'on
   remplace par un halo doux et arrondi, cohérent avec
   .pp-list-datetime-editable:hover ci-dessus. Spécificité (ancêtre propre à
   la vue liste + sélecteur de classe) suffisante pour l'emporter sur la
   règle tableur commune sans y toucher, et sans affecter la vue tableau. */
#pp-app .pp-list-pretre input.pp-inline-text:hover,
#pp-app .pp-list-item-head .pp-inline-important:hover,
#pp-app .pp-list-body .pp-inline-textarea:hover {
  border-color: transparent;
  background: rgba(37, 99, 235, .08);
  border-radius: 8px;
}

/* Pièces jointes : volontairement secondaires visuellement (dernier de la
   liste, hors de vue par défaut). Repliées en une pastille compacte
   n'indiquant que leur nombre (voir buildAttachmentsListToggle() dans
   script.js) ; un clic la remplace par l'affichage complet habituel
   (.pp-attachments), qui se referme comme les autres boîtes au clic
   extérieur. */
.pp-list-attachments-toggle {
  display: inline-flex; align-self: flex-start; align-items: center;
  border: 1px solid transparent; border-radius: 12px; padding: 4px 11px;
  font-size: 13px; background: rgba(100, 116, 139, .08); color: #64748b; cursor: pointer;
  /* #64748b plutôt que #94a3b8 : contraste ~4.6:1 sur fond blanc (seuil AA
     texte normal), l'ancienne couleur tombait autour de 2.5:1. */
}
.pp-list-attachments-toggle:hover { background: rgba(100, 116, 139, .14); border-color: transparent; }
.pp-list-attachments-toggle.pp-list-attachments-has { color: #334155; background: rgba(37, 99, 235, .10); }

/* ===================== Intervenants (tags) ===================== */
.pp-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f1f5f9; border-radius: 12px; padding: 4px 5px 4px 10px;
  font-size: 13px;
}
.pp-tag button { border: none; background: none; cursor: pointer; color: #64748b; font-size: 16px; line-height: 1; padding: 0 5px; }
.pp-tag button:hover { color: #dc2626; }

/* Boîte qui regroupe les bulles chanteurs/musiciens : repliée par défaut
   (bulles seules, pas de bouton d'ajout), elle s'active au clic pour
   afficher les croix de suppression sur chaque bulle et le champ de
   saisie d'un nouveau nom (cf. signupBlock() dans script.js). */
.pp-signup-box {
  border: 1px dashed transparent;
  border-radius: 8px;
  padding: 3px 4px;
  margin: -3px -4px;
  cursor: pointer;
}
.pp-signup-box:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}
.pp-signup-box-open {
  cursor: default;
  border-style: solid;
  border-color: var(--pp-accent, #2563eb);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .15);
}
.pp-signup-box-hint {
  font-size: 13px;
  font-style: italic;
  color: #64748b; /* contraste AA, voir .pp-list-attachments-toggle plus haut */
}

/* Variante lecture seule (visiteur non connecté, animateur en attente de
   validation) : signupBlock()/attachmentsBlock()/remarquesBlock() dans
   script.js ajoutent cette classe en plus de .pp-signup-box quand la boîte
   n'a aucune action associée (ni clic, ni ajout). Sans ceci, la bordure
   pointillée et le curseur "pointeur" au survol de .pp-signup-box (ci-dessus)
   laissaient croire à tort que la case était modifiable. */
.pp-signup-box-ro {
  cursor: default;
}
.pp-signup-box-ro:hover {
  border-color: transparent;
  background: transparent;
}

/* ===================== Remarques ===================== */
.pp-remarques-text { font-size: 15px; color: #334155; white-space: pre-wrap; margin-bottom: 4px; }

/* ===================== Saisie "tableur" ===================== */
/* Champs de saisie directement dans les cellules (horaire, prêtre, remarques,
   ajout de chanteur/musicien), pour remplacer les fenêtres modales et se
   rapprocher d'une saisie façon tableur. */
#pp-app .pp-inline-heure,
#pp-app .pp-inline-text,
#pp-app .pp-inline-textarea,
#pp-app .pp-inline-select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 15px;
  font-family: inherit;
  color: inherit;
}
#pp-app .pp-cell-heure input.pp-inline-heure { font-weight: 700; text-align: center; color: #334155; }
#pp-app .pp-cell-heure input.pp-inline-heure[readonly] { cursor: pointer; caret-color: transparent; }
#pp-app .pp-inline-textarea { resize: vertical; min-height: 34px; }
#pp-app .pp-inline-heure:hover,
#pp-app .pp-inline-text:hover,
#pp-app .pp-inline-textarea:hover,
#pp-app .pp-inline-select:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}
#pp-app .pp-inline-heure:focus,
#pp-app .pp-inline-text:focus,
#pp-app .pp-inline-textarea:focus,
#pp-app .pp-inline-select:focus {
  outline: none;
  border-color: var(--pp-accent, #2563eb);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
#pp-app .pp-inline-heure:disabled,
#pp-app .pp-inline-text:disabled,
#pp-app .pp-inline-textarea:disabled,
#pp-app .pp-inline-select:disabled { opacity: .6; }
/* Église en vue liste (gestionnaire) : pastille de couleur + menu déroulant
   à la place du simple libellé, sans bordure/fond au repos pour rester
   discret dans l'en-tête de la carte (comme .pp-list-heure ci-dessus). */
.pp-church-label-editable { cursor: default; }
#pp-app .pp-church-label-editable select.pp-inline-select {
  width: auto;
  max-width: 220px;
  font-weight: 600;
  border-color: transparent;
  background: transparent;
  padding: 3px 4px;
  cursor: pointer;
}
#pp-app .pp-church-label-editable select.pp-inline-select:hover,
#pp-app .pp-church-label-editable select.pp-inline-select:focus {
  border-color: #cbd5e1;
  background: #ffffff;
}

.pp-inline-add-row { display: flex; align-items: center; gap: 4px; margin-top: 3px; width: 100%; }
/* Ligne "remarques" : bouton "Enregistrer" aligné en bas du champ, qui peut
   faire plusieurs lignes (contrairement au simple champ texte d'ajout d'un
   chanteur/musicien). */
.pp-remarques-edit-row { align-items: flex-end; }
.pp-remarques-edit-row .pp-inline-textarea { flex: 1 1 auto; width: auto; }
#pp-app .pp-inline-add {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: #1e293b;
}
#pp-app .pp-inline-add:focus { outline: none; border-color: var(--pp-accent, #2563eb); border-style: solid; }
#pp-app .pp-inline-add-btn {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--pp-accent, #2563eb);
  cursor: pointer;
  line-height: 1;
  font-size: 15px;
  padding: 0;
}
#pp-app .pp-inline-add-btn:hover { background: #eff6ff; }

/* ===================== Pièces jointes ===================== */
.pp-attachments { margin-top: 8px; font-size: 15px; }
.pp-attachment-line { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.pp-programme-link { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; color: var(--pp-accent, #2563eb); text-decoration: none; }
.pp-programme-link:hover { text-decoration: underline; }
.pp-tag-remove { border: none; background: none; cursor: pointer; color: #94a3b8; font-size: 15px; line-height: 1; padding: 0 4px; }
.pp-tag-remove:hover { color: #dc2626; }

/* ===================== Actions créateur ===================== */
.pp-creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-width: 100%;
}
.pp-creator-actions .pp-btn {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================== Modale ===================== */
.pp-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100000; padding: 16px;
}
#pp-app .pp-modal {
  background: #ffffff; color: #1e293b; border-radius: 10px; padding: 22px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  border: 1px solid #e2e8f0;
}
#pp-app .pp-modal h3 { margin-top: 0; margin-bottom: 14px; color: #1e293b; }
#pp-app .pp-modal-hint { font-size: 14px; color: #64748b; margin: 14px 0 4px; }
#pp-app .pp-field { margin-bottom: 14px; }
#pp-app .pp-field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; color: #1e293b; }
#pp-app .pp-field input[type="text"],
#pp-app .pp-field input[type="date"],
#pp-app .pp-field input[type="time"],
#pp-app .pp-field input[type="file"],
#pp-app .pp-field input[type="password"],
#pp-app .pp-field input[type="email"],
#pp-app .pp-field select,
#pp-app .pp-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #94a3b8 !important;
  border-radius: 6px;
  font-size: 16px;
  background: #ffffff !important;
  color: #1e293b !important;
  font-family: inherit;
  box-shadow: none;
  appearance: auto;
}
#pp-app .pp-field input:focus,
#pp-app .pp-field select:focus,
#pp-app .pp-field textarea:focus {
  outline: 2px solid var(--pp-accent, #2563eb);
  outline-offset: 1px;
  border-color: var(--pp-accent, #2563eb) !important;
}
#pp-app .pp-field textarea { min-height: 70px; resize: vertical; }

/* Champ + bouton "Copier" (lien/code de parrainage, cf. buildCopyField()) */
#pp-app .pp-copy-row { display: flex; gap: 8px; }
#pp-app .pp-copy-row input[type="text"] {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f5f9 !important;
}
#pp-app .pp-copy-row .pp-btn { flex-shrink: 0; }

/* QR code du lien de cooptation (cf. openCooptationModal()) */
#pp-app .pp-qr-container {
  margin-top: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  justify-content: center;
}
#pp-app .pp-qr-container svg { width: 180px; height: 180px; max-width: 100%; }

#pp-app .pp-modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
#pp-app .pp-modal-actions .pp-spacer { flex: 1; }
#pp-app .pp-modal-actions .pp-btn { min-width: 90px; text-align: center; }

/* ===================== Popover date+heure ===================== */
/* Petite fenêtre flottante (pas une modale plein écran) ouverte au clic sur
   le champ heure "façon tableur" (voir openHeurePopover() dans script.js),
   pour modifier la date et l'heure ensemble sans passer par la modale
   complète "Modifier". Positionnée en JS (position: fixed) pour rester
   toujours visible même dans le conteneur défilant de la vue tableau. */
#pp-app .pp-heure-popover {
  position: fixed;
  z-index: 100000;
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  padding: 14px;
  width: 240px;
}
#pp-app .pp-heure-popover .pp-field { margin-bottom: 10px; }
#pp-app .pp-heure-popover .pp-modal-actions { margin-top: 6px; }

.pp-msg { padding: 10px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 12px; }
.pp-msg-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.pp-msg-ok { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.pp-msg-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ===================== Accès refusé (formulaire de connexion inline) ===================== */
.pp-access-denied { max-width: 480px; margin: 0 auto; }
#pp-app .pp-access-denied-card {
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ===================== Import / Export ===================== */
.pp-import-report { font-size: 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; margin-bottom: 14px; }
.pp-import-report ul { margin: 6px 0 0 18px; }

/* ===================== Responsive ===================== */
/* 782px (2.31.0, au lieu de 700px) : même seuil que le script (vue liste
   par défaut, regroupement par jour) et que WordPress. */
@media (max-width: 782px) {
  /* La barre d'outils principale reste sur une seule ligne sur mobile
     (elle ne passe plus en colonne) : à gauche, le groupe filtres /
     paramètres / nouvelle célébration ; à droite, la bascule tableau/liste.
     `order` ci-dessous pilote cette disposition indépendamment de l'ordre
     des éléments dans le DOM (inchangé, partagé avec le desktop). Le volet
     de filtres (.pp-filterbar, qui porte aussi la classe .pp-toolbar) garde
     sa mise en page en groupes empilés définie plus haut. */
  .pp-main-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .pp-tabs, .pp-filters { flex-wrap: wrap; }
  .pp-list-signups { grid-template-columns: 1fr; }

  /* Groupe de gauche, dans l'ordre demandé : filtres, paramètres, nouveau. */
  .pp-main-toolbar > .pp-filter-toggle-btn { order: 1; }
  .pp-main-toolbar > .pp-settings-menu { order: 2; }
  .pp-main-toolbar > .pp-new-celebration-btn { order: 3; }
  /* Bascule tableau/liste : seule à droite, poussée par une marge auto
     plutôt que par .pp-spacer (masqué ci-dessous, devenu inutile ici
     puisque tous les autres boutons sont regroupés à gauche par `order`). */
  .pp-main-toolbar > .pp-tabs { order: 4; margin-left: auto; }
  .pp-main-toolbar > .pp-spacer { display: none; }

  /* "+ Nouvelle célébration" est réduit à sa seule icône "+" (le libellé
     est masqué) pour tenir à côté des icônes filtre/paramètres. */
  .pp-main-toolbar > .pp-new-celebration-btn {
    width: 38px; height: 38px;
    padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .pp-main-toolbar > .pp-new-celebration-btn .pp-new-celebration-label { display: none; }

  /* Sur mobile, .pp-settings-menu (le bouton ⚙, ci-dessus) se retrouve
     désormais dans le groupe de gauche de la barre, mais peut être proche
     du bord gauche de l'écran selon la largeur des autres boutons. La
     règle ".pp-settings-dropdown" plus haut ancre le menu déroulant par
     son bord droit ("right: 0"), pensée pour un bouton en bout de barre
     d'outils à droite (cas desktop) : appliquée ici, elle risquerait de
     faire déborder le menu hors de l'écran. On ancre plutôt le menu par
     son bord gauche ("left: 0"), aligné sur le bouton lui-même, pour qu'il
     reste entièrement visible. */
  .pp-settings-dropdown { left: 0; right: auto; }
}

/* ===================== Admin (réglages) ===================== */
.pp-admin-table { margin-top: 10px; }
.pp-admin-table .pp-drag {
  cursor: grab; color: #64748b; text-align: center; width: 68px; font-size: 16px;
  display: flex; align-items: center; gap: 4px; justify-content: center;
}
.pp-admin-table tr.pp-row-inactive .pp-drag { cursor: default; opacity: .3; }
.pp-admin-table .pp-drag:active { cursor: grabbing; }
/* Boutons Monter/Descendre : alternative clavier au glisser-déposer de la
   poignée (icône à 6 points), qui n'est pas utilisable sans souris (voir moveChurch() dans
   admin.js). */
.pp-reorder-btns { display: inline-flex; flex-direction: column; gap: 1px; }
.pp-admin-table .pp-reorder-btn {
  width: 20px; height: 18px; line-height: 1; padding: 0; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pp-admin-table tr.pp-dragging { opacity: .4; }
.pp-admin-table tr.pp-drop-target { box-shadow: inset 0 2px 0 #2563eb, inset 0 -2px 0 #2563eb; }
.pp-admin-table input.pp-church-name { min-width: 200px; }
.pp-row-inactive { opacity: .55; }
.pp-admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-admin-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.pp-admin-save-hint { font-size: 13px; color: #b45309; font-style: italic; }
.pp-admin-msg { font-size: 14px; }
.pp-admin-msg-ok { color: #166534; }
.pp-admin-msg-error { color: #991b1b; }
.pp-admin-count { font-size: 13px; color: #64748b; }
.pp-field-label { font-weight: 600; margin: 0 0 6px; font-size: 14px; }

/* Modale « maison » utilisée en dehors de #pp-app (écran de réglages admin) :
   duplique la présentation de la modale du planning, dont les règles ci-dessus
   sont scoping à #pp-app et ne s'appliquent donc pas dans wp-admin. */
body.wp-admin .pp-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100000; padding: 16px;
}
body.wp-admin .pp-modal {
  background: #ffffff; color: #1e293b; border-radius: 10px; padding: 22px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  border: 1px solid #e2e8f0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body.wp-admin .pp-modal h3 { margin-top: 0; margin-bottom: 14px; color: #1e293b; }
body.wp-admin .pp-modal input[type="text"] {
  width: 100%; padding: 9px 11px; border: 1px solid #94a3b8; border-radius: 6px; font-size: 15px;
}
body.wp-admin .pp-modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
body.wp-admin .pp-modal-actions .pp-spacer { flex: 1; }

/* ===================== Application installable (2.30.0) =====================
   Invite d'installation sur téléphone (assets/pwa.js), insérée juste
   au-dessus de #pp-app — donc en dehors : elle redéfinit elle-même police,
   box-sizing et variables d'accent (voir aussi pp_render_shortcode(), qui
   l'ajoute au sélecteur de la couleur d'accent personnalisée). */
.pp-pwa-banner {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #1e293b;
  position: relative;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 12px 40px 12px 14px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--pp-accent, #2563eb);
  border-radius: 8px;
}
.pp-pwa-banner *, .pp-pwa-banner *::before, .pp-pwa-banner *::after { box-sizing: border-box; }
.pp-pwa-banner p { margin: 0 0 6px; }
.pp-pwa-banner .pp-pwa-title { font-weight: 600; }
.pp-pwa-banner .pp-pwa-text { color: #334155; }
.pp-pwa-banner .pp-pwa-nowrap { white-space: nowrap; }
.pp-pwa-banner .pp-pwa-share-icon { vertical-align: -3px; }
.pp-pwa-banner .pp-pwa-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pp-pwa-banner button {
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  padding: 8px 16px;
  min-height: 40px; /* cible tactile confortable */
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
}
.pp-pwa-banner .pp-pwa-install {
  background: var(--pp-accent, #2563eb);
  border-color: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
  font-weight: 600;
}
.pp-pwa-banner .pp-pwa-install:hover { filter: brightness(0.9); }
.pp-pwa-banner .pp-pwa-close {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
}
.pp-pwa-banner button:focus-visible { outline: 2px solid var(--pp-accent, #2563eb); outline-offset: 2px; }

/* ===================== Vue mobile modernisée (2.31.0) =====================
   Ravalement de façade "application mobile", uniquement sous 782px (même
   seuil que le script). Aucun changement sur ordinateur. Toutes les
   couleurs passent par les variables --pp-m-* ci-dessous, redéfinies plus
   bas pour le mode sombre : un seul endroit à retoucher pour la palette. */
#pp-app {
  --pp-m-app: transparent;
  --pp-m-surface: #ffffff;
  --pp-m-surface-2: #f1f5f9;
  --pp-m-surface-3: #e2e8f0;
  --pp-m-line: rgba(15, 23, 42, .08);
  --pp-m-line-strong: #cbd5e1;
  --pp-m-text: #0f172a;
  --pp-m-text-2: #334155;
  --pp-m-muted: #64748b;
  --pp-m-glass: rgba(255, 255, 255, .82);
  --pp-m-input: #ffffff;
  --pp-m-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .07);
  --pp-m-shadow-lg: 0 10px 32px rgba(15, 23, 42, .18);
  --pp-m-accent-soft: rgba(37, 99, 235, .12);
  --pp-m-accent-ink: var(--pp-accent, #2563eb);
  --pp-m-danger-soft: #fef2f2;
  --pp-m-danger-line: #fecaca;
  --pp-m-danger-ink: #b91c1c;
  /* Hauteur occupée en haut d'écran par la barre d'administration
     WordPress (fixe entre 601 et 782px, voir plus bas), à laquelle
     s'accrochent les éléments collants. */
  --pp-sticky-top: 0px;
  --pp-toolbar-h: 58px;
  -webkit-tap-highlight-color: transparent;
  color: var(--pp-m-text);
  background: var(--pp-m-app);
}
@media (max-width: 782px) {

  /* ---------- Barre d'outils collante, effet "verre dépoli" ---------- */
  #pp-app .pp-main-toolbar {
    position: -webkit-sticky;
    position: sticky;
    top: var(--pp-sticky-top);
    z-index: 30;
    flex-wrap: nowrap;
    gap: 4px;
    min-height: var(--pp-toolbar-h);
    margin: 0 0 14px;
    padding: 7px;
    background: var(--pp-m-glass);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid var(--pp-m-line);
    border-radius: 18px;
    box-shadow: var(--pp-m-shadow);
  }
}
#pp-app .pp-icon-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--pp-m-text-2);
}
#pp-app .pp-icon-btn:hover { background: var(--pp-m-surface-2); color: var(--pp-m-text); }
#pp-app .pp-icon-btn.pp-active,
#pp-app .pp-icon-btn.pp-active:hover {
  background: var(--pp-m-accent-soft);
  color: var(--pp-m-accent-ink);
}
#pp-app .pp-icon-btn .pp-icon svg { width: 20px; height: 20px; }
#pp-app .pp-icon-btn-dot { top: 7px; right: 7px; border-color: var(--pp-m-surface); }
#pp-app .pp-icon-btn.pp-active .pp-icon-btn-dot { border-color: var(--pp-m-surface); }

/* Bascule tableau/liste : contrôle segmenté façon iOS/Android. */
#pp-app .pp-main-toolbar > .pp-tabs {
  gap: 2px;
  padding: 3px;
  background: var(--pp-m-surface-2);
  border-radius: 12px;
  flex-wrap: nowrap;
}
#pp-app .pp-tabs .pp-tab-btn.pp-icon-btn { width: 40px; height: 36px; border-radius: 9px; }
#pp-app .pp-tabs .pp-tab-btn.pp-icon-btn.pp-active {
  background: var(--pp-m-surface);
  color: var(--pp-m-accent-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .15);
}
@media (max-width: 782px) {

  /* "+ Nouvelle célébration" : bouton plein, carré arrondi. */
  #pp-app .pp-main-toolbar > .pp-new-celebration-btn {
    width: 42px; height: 42px;
    min-height: 42px;
    padding: 0;
    border: none;
    border-radius: 12px;
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
  }
}
/* ---------- Boutons ---------- */
#pp-app .pp-btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 12px;
  background: var(--pp-m-surface);
  color: var(--pp-m-text);
  font-weight: 600;
}
#pp-app .pp-btn:hover { background: var(--pp-m-surface-2); color: var(--pp-m-text); }
#pp-app .pp-btn-primary,
#pp-app .pp-btn-primary:hover {
  border-color: var(--pp-accent, #2563eb);
  background: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
}
#pp-app .pp-btn-danger { color: var(--pp-m-danger-ink); border-color: var(--pp-m-danger-line); background: var(--pp-m-surface); }
#pp-app .pp-btn-danger:hover { background: var(--pp-m-danger-soft); color: var(--pp-m-danger-ink); }
#pp-app .pp-btn-small { min-height: 36px; padding: 6px 12px; border-radius: 10px; font-size: 14px; }

/* ---------- Menus déroulants (paramètres) ---------- */
#pp-app .pp-settings-dropdown {
  min-width: 230px;
  padding: 6px;
  background: var(--pp-m-surface);
  border: 1px solid var(--pp-m-line);
  border-radius: 16px;
  box-shadow: var(--pp-m-shadow-lg);
}
#pp-app .pp-settings-item {
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--pp-m-text);
  font-size: 16px;
}
#pp-app .pp-settings-item:hover { background: var(--pp-m-surface-2); }

/* ---------- Volet des filtres ---------- */
#pp-app .pp-filterbar {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--pp-m-surface);
  border: 1px solid var(--pp-m-line);
  border-radius: 18px;
  box-shadow: var(--pp-m-shadow);
}
#pp-app .pp-filter-group {
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 14px;
  background: var(--pp-m-surface-2);
}
#pp-app .pp-filter-group-title { color: var(--pp-m-muted); min-height: 32px; font-size: 12px; }
#pp-app .pp-filter-group-title:hover { color: var(--pp-m-text); }
#pp-app .pp-filter-group-title-active { color: var(--pp-m-accent-ink); }
#pp-app .pp-filter-item { min-height: 36px; }
#pp-app .pp-filter-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--pp-accent, #2563eb); }
#pp-app .pp-filter-item select,
#pp-app .pp-filter-item input[type="date"] {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 10px;
  font-size: 16px; /* 16px minimum : évite le zoom automatique d'iOS au focus */
  background: var(--pp-m-input);
  color: var(--pp-m-text);
}
#pp-app .pp-chip {
  min-height: 36px;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 999px;
  background: var(--pp-m-surface);
  color: var(--pp-m-text-2);
  font-size: 14px;
}
#pp-app .pp-chip.pp-chip-active {
  border-color: var(--pp-accent, #2563eb);
  background: var(--pp-m-accent-soft);
  color: var(--pp-m-accent-ink);
}
#pp-app .pp-reset-btn {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--pp-m-muted);
  font-size: 14px;
}
#pp-app .pp-reset-btn:hover { background: var(--pp-m-surface-3); color: var(--pp-m-text); }
@media (max-width: 782px) {

  /* ---------- Liste : groupes par jour ---------- */
  #pp-app .pp-list.pp-list-grouped { gap: 24px; }
  #pp-app .pp-day-group { display: flex; flex-direction: column; gap: 12px; }
  #pp-app .pp-day-header {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--pp-sticky-top) + var(--pp-toolbar-h) + 8px);
    z-index: 20;
    margin: 0;
    padding: 0 2px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .05em;
    text-transform: uppercase;
    pointer-events: none;
  }
  #pp-app .pp-day-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--pp-m-glass);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border: 1px solid var(--pp-m-line);
    color: var(--pp-m-text-2);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  }
  #pp-app .pp-day-header-rel {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pp-accent, #2563eb);
    color: var(--pp-accent-text, #ffffff);
    font-size: 11px;
    letter-spacing: .04em;
  }
  #pp-app .pp-day-header-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* La date est portée par l'intertitre : on ne la répète pas dans la carte. */
  #pp-app .pp-list-grouped .pp-list-date { display: none; }
}
/* ---------- Carte de célébration ---------- */
#pp-app .pp-list-item {
  padding: 14px 16px 16px;
  border: 1px solid var(--pp-m-line);
  border-left-width: 5px; /* liseré couleur de l'église (couleur posée en ligne par le script) */
  border-radius: 20px;
  background-color: var(--pp-m-surface);
  box-shadow: var(--pp-m-shadow);
  /* Une carte ciblée par le script (création, déplacement) ne doit pas
     finir cachée sous la barre d'outils et l'intertitre collants. */
  scroll-margin-top: calc(var(--pp-sticky-top) + var(--pp-toolbar-h) + 60px);
}
#pp-app .pp-list-item-head { gap: 10px; margin-bottom: 12px; }
#pp-app .pp-list-item-head-top { gap: 8px 10px; }
#pp-app .pp-list-datetime { padding: 0; border-radius: 10px; }
#pp-app .pp-list-heure {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--pp-m-text);
  font-variant-numeric: tabular-nums;
}
/* Champ heure du gestionnaire (type="time", en lecture seule : la
   modification passe par le popover date + heure) : sans l'icône
   d'horloge du navigateur, qui tronquait l'heure. */
#pp-app .pp-list-item-head input.pp-inline-heure.pp-list-heure::-webkit-calendar-picker-indicator { display: none; }
#pp-app .pp-list-item-head input.pp-inline-heure.pp-list-heure {
  width: 3.4em;
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  padding: 2px 4px;
  font-size: 24px;
  color: var(--pp-m-text);
}
#pp-app .pp-list-date { color: var(--pp-m-text-2); }

/* Église : pastille arrondie. */
#pp-app .pp-list-item-head .pp-church-label {
  min-height: 30px;
  max-width: 100%;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--pp-m-surface-2);
  color: var(--pp-m-text-2);
  font-size: 14px;
}
#pp-app .pp-list-item-head .pp-church-label .pp-dot { margin-right: 7px; }
#pp-app .pp-church-label-editable select.pp-inline-select,
#pp-app .pp-church-label-editable select.pp-inline-select:hover,
#pp-app .pp-church-label-editable select.pp-inline-select:focus {
  max-width: 200px;
  padding: 0 2px;
  font-size: 16px;
  border-color: transparent;
  background: transparent;
  color: var(--pp-m-text-2);
}

/* En-tête de carte sur deux lignes : heure + alertes (à droite), puis
   l'église. Pur réordonnancement visuel (order), l'ordre de lecture au
   clavier/lecteur d'écran reste celui du DOM. */
#pp-app .pp-list-item-head-top > .pp-list-datetime { order: 0; }
#pp-app .pp-list-item-head-top > button.pp-alert { order: 1; }
#pp-app .pp-list-item-head-top::after { content: ''; order: 1; flex-basis: 100%; height: 0; }
#pp-app .pp-list-item-head-top > .pp-church-label { order: 2; }
#pp-app .pp-list-item-head-top { row-gap: 8px; }
/* Alertes : rangées à droite de la ligne d'en-tête. */
#pp-app .pp-list-item-head-top > button.pp-alert:first-of-type { margin-left: auto; }
#pp-app .pp-alert-dot.pp-alert-strong { width: 28px; height: 28px; }
#pp-app .pp-alert-dot.pp-alert-light { width: 24px; height: 24px; }
#pp-app .pp-alert-dot.pp-alert-active { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 0 2px var(--pp-m-surface); }

/* Bandeau "Important". */
#pp-app .pp-important-block.pp-important-active {
  padding: 8px 12px;
  border: 1px solid var(--pp-m-danger-line);
  border-radius: 12px;
  background: var(--pp-m-danger-soft);
}
#pp-app .pp-important-block.pp-important-active .pp-label,
#pp-app .pp-important-text,
#pp-app .pp-important-block.pp-important-active .pp-inline-important { color: var(--pp-m-danger-ink); }

/* Corps de la carte. */
#pp-app .pp-list-body { gap: 12px; }
#pp-app .pp-cell-block .pp-label,
#pp-app .pp-attachments .pp-label,
#pp-app .pp-list-col .pp-label {
  margin-bottom: 6px;
  color: var(--pp-m-muted);
  font-size: 12px;
  letter-spacing: .06em;
}
#pp-app .pp-list-pretre { font-size: 14px; color: var(--pp-m-muted); }
#pp-app .pp-list-pretre > div { color: var(--pp-m-text-2); }
#pp-app .pp-list-pretre .pp-label { font-size: 13px; margin-bottom: 0; }

/* Chanteurs / musiciens : deux tuiles côte à côte. */
#pp-app .pp-list-signups { grid-template-columns: 1fr 1fr; gap: 8px; }
#pp-app .pp-list-signups .pp-list-col {
  min-width: 0;
  padding: 10px 10px 12px;
  border-radius: 14px;
  background: var(--pp-m-surface-2);
}
#pp-app .pp-tags-wrap { gap: 6px; }
#pp-app .pp-tag {
  min-height: 30px;
  max-width: 100%;
  padding: 4px 4px 4px 11px;
  border: 1px solid var(--pp-m-line);
  border-radius: 999px;
  background: var(--pp-m-surface);
  color: var(--pp-m-text);
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
#pp-app .pp-tag button {
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 50%;
  color: var(--pp-m-muted);
  font-size: 18px;
}
#pp-app .pp-signup-box { margin: -4px; padding: 4px; border-radius: 12px; }
#pp-app .pp-signup-box:hover { border-color: transparent; background: transparent; }
#pp-app .pp-signup-box-open,
#pp-app .pp-signup-box-open:hover {
  border-color: var(--pp-accent, #2563eb);
  background: var(--pp-m-surface);
  box-shadow: 0 0 0 3px var(--pp-m-accent-soft);
}
#pp-app .pp-signup-box-hint { color: var(--pp-m-muted); font-size: 14px; }

/* Saisie dans la carte : 16px minimum (pas de zoom iOS), cibles 36px+. */
#pp-app .pp-inline-add-row { gap: 6px; margin-top: 8px; }
#pp-app .pp-inline-add {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 999px;
  background: var(--pp-m-input);
  color: var(--pp-m-text);
  font-size: 16px;
}
#pp-app .pp-inline-add-btn {
  width: 38px; height: 38px;
  border: none;
  background: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
  font-size: 17px;
}
#pp-app .pp-inline-add-btn:hover { background: var(--pp-accent, #2563eb); filter: brightness(.9); }
#pp-app .pp-inline-heure,
#pp-app .pp-inline-text,
#pp-app .pp-inline-textarea,
#pp-app .pp-inline-select { font-size: 16px; border-radius: 10px; }
#pp-app .pp-inline-heure:hover,
#pp-app .pp-inline-text:hover,
#pp-app .pp-inline-textarea:hover,
#pp-app .pp-inline-select:hover { border-color: var(--pp-m-line-strong); background: var(--pp-m-input); }
#pp-app .pp-inline-heure:focus,
#pp-app .pp-inline-text:focus,
#pp-app .pp-inline-textarea:focus,
#pp-app .pp-inline-select:focus {
  background: var(--pp-m-input);
  color: var(--pp-m-text);
  box-shadow: 0 0 0 3px var(--pp-m-accent-soft);
}
#pp-app .pp-remarques-text { color: var(--pp-m-text-2); }

/* Pièces jointes. */
#pp-app .pp-list-attachments-toggle {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pp-m-surface-2);
  color: var(--pp-m-muted);
  font-size: 14px;
}
#pp-app .pp-list-attachments-toggle:hover { background: var(--pp-m-surface-3); }
#pp-app .pp-list-attachments-toggle.pp-list-attachments-has { background: var(--pp-m-accent-soft); color: var(--pp-m-accent-ink); }
#pp-app .pp-programme-link { min-height: 32px; font-size: 15px; color: var(--pp-m-accent-ink); }
#pp-app .pp-tag-remove { min-width: 32px; min-height: 32px; color: var(--pp-m-muted); }

/* Actions gestionnaire, séparées du contenu. */
#pp-app .pp-list-item .pp-creator-actions {
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--pp-m-line);
}
#pp-app .pp-creator-actions .pp-btn {
  flex: 1 1 0;
  min-height: 40px;
  border-color: transparent;
  background: var(--pp-m-surface-2);
}
#pp-app .pp-creator-actions .pp-btn-danger { background: var(--pp-m-danger-soft); }

#pp-app .pp-list-empty-msg {
  padding: 32px 16px;
  border-radius: 18px;
  background: var(--pp-m-surface-2);
  color: var(--pp-m-muted);
  font-style: normal;
}
@media (max-width: 782px) {

  /* ---------- Vue tableau (si choisie sur téléphone) ---------- */
  #pp-app .pp-grid-wrap {
    max-height: calc(100vh - var(--pp-sticky-top) - var(--pp-toolbar-h) - 40px);
    border-color: var(--pp-m-line-strong);
    border-radius: 16px;
    background: var(--pp-m-surface);
  }

  /* ---------- Fenêtres : "feuille" qui monte du bas de l'écran ---------- */
  #pp-app .pp-modal-overlay { align-items: flex-end; padding: 0; }
  #pp-app .pp-modal {
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    border: none;
    border-radius: 24px 24px 0 0;
    background: var(--pp-m-surface);
    color: var(--pp-m-text);
    box-shadow: 0 -8px 40px rgba(15, 23, 42, .25);
    animation: pp-sheet-up .26s cubic-bezier(.2, .8, .2, 1);
  }
  /* 2.32.0 : plus de poignée en haut de la feuille (elle laissait croire
     qu'on pouvait la faire glisser pour la fermer). */
  #pp-app .pp-modal { padding-top: 20px; }
}
#pp-app .pp-modal h3 { color: var(--pp-m-text); font-size: 20px; padding-right: 44px; }
#pp-app .pp-modal-hint { color: var(--pp-m-muted); }
#pp-app .pp-field label { color: var(--pp-m-text-2); }
#pp-app .pp-field input[type="text"],
#pp-app .pp-field input[type="date"],
#pp-app .pp-field input[type="time"],
#pp-app .pp-field input[type="file"],
#pp-app .pp-field input[type="password"],
#pp-app .pp-field input[type="email"],
#pp-app .pp-field select,
#pp-app .pp-field textarea {
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--pp-m-line-strong) !important;
  border-radius: 12px;
  background: var(--pp-m-input) !important;
  color: var(--pp-m-text) !important;
  font-size: 16px;
}
#pp-app .pp-copy-row input[type="text"] { background: var(--pp-m-surface-2) !important; }
@media (max-width: 782px) {
  #pp-app .pp-modal-actions { gap: 10px; }
  #pp-app .pp-modal-actions .pp-spacer { display: none; }
  #pp-app .pp-modal-actions .pp-btn { flex: 1 1 0; min-width: 0; min-height: 48px; }
}
/* Petite fenêtre date + heure (positionnée par le script). */
#pp-app .pp-heure-popover {
  border: 1px solid var(--pp-m-line);
  border-radius: 18px;
  background: var(--pp-m-surface);
  color: var(--pp-m-text);
  box-shadow: var(--pp-m-shadow-lg);
}

/* ---------- Messages, connexion, import ---------- */
#pp-app .pp-msg { border-radius: 14px; padding: 12px 14px; font-size: 15px; }
#pp-app .pp-access-denied-card {
  border: 1px solid var(--pp-m-line);
  border-radius: 22px;
  background: var(--pp-m-surface);
  box-shadow: var(--pp-m-shadow);
}
#pp-app .pp-auth-tabs .pp-tab-btn {
  flex: 1 1 0;
  min-height: 44px;
  border-color: var(--pp-m-line-strong);
  border-radius: 12px;
  background: var(--pp-m-surface);
  color: var(--pp-m-text);
}
#pp-app .pp-auth-tabs .pp-tab-btn.pp-active {
  border-color: var(--pp-accent, #2563eb);
  background: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
}
#pp-app .pp-import-report { border-radius: 12px; background: var(--pp-m-surface-2); border-color: var(--pp-m-line); }

/* ---------- Barre du haut (compte), hors #pp-app ---------- */
.pp-top-bar { margin-bottom: 10px; }
.pp-top-bar .pp-auth-area { gap: 6px; }
.pp-top-bar .pp-icon-btn { width: 42px; height: 42px; border: none; border-radius: 50%; background: transparent; }
.pp-top-bar .pp-icon-btn:hover { background: #f1f5f9; }
.pp-top-bar .pp-user-avatar-btn { width: 40px; height: 40px; font-size: 16px; box-shadow: 0 2px 6px rgba(15, 23, 42, .18); }
.pp-top-bar .pp-btn { min-height: 40px; border-radius: 999px; padding: 8px 16px; font-weight: 600; }
.pp-top-bar .pp-btn-small { min-height: 36px; padding: 6px 14px; }
.pp-top-bar .pp-user-dropdown,
.pp-notif-dropdown { border-radius: 16px; box-shadow: 0 10px 32px rgba(15, 23, 42, .18); }
.pp-top-bar .pp-user-dropdown-logout { min-height: 40px; }
.pp-top-bar .pp-notif-item { border-radius: 12px; }
@media (max-width: 782px) {

  /* ---------- Invite d'installation (2.30.0), hors #pp-app ---------- */
  .pp-pwa-banner {
    border: none;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .08);
    padding: 14px 44px 14px 16px;
  }
  .pp-pwa-banner button { border-radius: 12px; min-height: 44px; }

  /* Pas d'effet de survol "collant" sur écran tactile. */
  @media (hover: none) {
    #pp-app .pp-list-item:hover { box-shadow: var(--pp-m-shadow); }
  }
}

/* ---------- Fenêtre des filtres sur téléphone (2.32.0) ----------
   Voir openFilterSheet() dans script.js. */
@media (max-width: 782px) {
  #pp-app .pp-modal { position: relative; }
}
#pp-app .pp-fs-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--pp-m-surface-2);
  color: var(--pp-m-text-2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
#pp-app .pp-fs-close:hover { background: var(--pp-m-surface-3); }
#pp-app .pp-fs-groups { display: flex; flex-direction: column; gap: 10px; }
#pp-app .pp-fs-group {
  border-radius: 16px;
  background: var(--pp-m-surface-2);
  overflow: hidden;
}
#pp-app .pp-fs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--pp-m-text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
#pp-app .pp-fs-head-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
#pp-app .pp-fs-title { font-size: 16px; font-weight: 700; }
#pp-app .pp-fs-summary {
  font-size: 14px;
  color: var(--pp-m-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#pp-app .pp-fs-group-active .pp-fs-summary { color: var(--pp-m-accent-ink); font-weight: 600; }
/* Chevron dessiné en CSS, tourné quand le groupe est ouvert. */
#pp-app .pp-fs-chevron {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid var(--pp-m-muted);
  border-bottom: 2px solid var(--pp-m-muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}
#pp-app .pp-fs-group-open .pp-fs-chevron { transform: rotate(-135deg) translate(-2px, -2px); }
#pp-app .pp-fs-body { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
#pp-app .pp-fs-body[hidden] { display: none; }
#pp-app .pp-fs-body .pp-church-chips { gap: 8px; }
#pp-app .pp-fs-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#pp-app .pp-fs-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--pp-m-muted); }
#pp-app .pp-fs-field input[type="date"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 12px;
  background: var(--pp-m-input);
  color: var(--pp-m-text);
  font-size: 16px;
  font-family: inherit;
}
#pp-app .pp-fs-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 4px 4px 4px 14px;
  border-radius: 12px;
  background: var(--pp-m-surface);
  color: var(--pp-m-text);
  font-size: 15px;
  cursor: pointer;
}
#pp-app .pp-fs-check-label { display: inline-flex; align-items: center; }
#pp-app .pp-fs-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0 10px 0 0;
  accent-color: var(--pp-accent, #2563eb);
}
/* Pied de fenêtre collé en bas : Tout effacer + Afficher N célébrations. */
#pp-app .pp-fs-footer {
  position: -webkit-sticky;
  position: sticky;
  bottom: calc(-20px - env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
  margin: 16px -18px calc(-20px - env(safe-area-inset-bottom, 0px));
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--pp-m-surface);
  border-top: 1px solid var(--pp-m-line);
}
#pp-app .pp-fs-footer .pp-btn { min-height: 50px; }
#pp-app .pp-fs-clear { flex: 0 0 auto; }
#pp-app .pp-fs-clear:disabled { opacity: .45; cursor: default; }
#pp-app .pp-fs-apply { flex: 1 1 auto; }

/* ---------- Fenêtre date/heure/église (2.33.0, vue liste téléphone) ---------- */
@media (max-width: 782px) {
  #pp-app .pp-heure-popover-full { width: min(320px, calc(100vw - 16px)); padding: 16px; }
  #pp-app .pp-heure-popover .pp-field input,
  #pp-app .pp-heure-popover .pp-field select { min-height: 44px; }
  #pp-app .pp-heure-popover .pp-modal-actions { flex-wrap: nowrap; gap: 8px; }
  #pp-app .pp-heure-popover .pp-modal-actions .pp-btn { min-height: 44px; }
  #pp-app .pp-heure-popover .pp-modal-actions .pp-heure-popover-delete {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: transparent;
    background: var(--pp-m-danger-soft);
    color: var(--pp-m-danger-ink);
  }
  #pp-app .pp-heure-popover-delete .pp-icon { display: inline-flex; }
}

/* ---------- Inscriptions et remarques en fenêtre (2.35.0, vue liste téléphone) ----------
   Voir signupTileMobile(), remarquesTileMobile(), openSignupSheet() et
   openRemarquesSheet() dans script.js. Les tuiles de la carte sont des
   boutons ; la saisie se fait dans une "feuille" au style de la fenêtre
   des filtres. */
#pp-app .pp-m-tile {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  /* Un <button> centre son contenu verticalement : on aligne en haut, pour
     que les deux tuiles côte à côte gardent leur titre sur la même ligne. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
/* Tuiles de la carte. */
#pp-app .pp-list-signups .pp-m-tile {
  min-height: 74px;
  padding: 8px 8px 12px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--pp-m-surface-2);
  transition: background-color .15s ease, border-color .15s ease;
}
#pp-app .pp-m-tile-remarques {
  padding: 8px 8px 12px 12px;
  border: 1px solid var(--pp-m-line);
  border-radius: 14px;
  background: var(--pp-m-surface);
  transition: background-color .15s ease;
}
#pp-app .pp-m-tile:active { background: var(--pp-m-surface-3); }
#pp-app .pp-m-tile .pp-label { display: block; }
#pp-app .pp-m-tile .pp-tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
#pp-app .pp-m-tile .pp-tag { padding: 4px 11px; }
#pp-app .pp-m-tile .pp-signup-box-hint { font-style: normal; }
#pp-app .pp-m-tile-remarques .pp-remarques-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  margin: 0;
}
/* 2.45.1 : en-tête de tuile = titre + bouton côte à côte. Le titre ne se
   coupe jamais au milieu d'un mot : s'il manque de place, il se termine
   par « … » (le texte complet reste dans l'étiquette d'accessibilité). */
#pp-app .pp-m-tile-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  margin-bottom: 4px;
}
#pp-app .pp-m-tile-head .pp-label {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
#pp-app .pp-m-tile-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pp-m-accent-soft);
  color: var(--pp-m-accent-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
#pp-app .pp-m-tile-badge-edit { font-size: 14px; }

/* Feuille. */
#pp-app .pp-sheet-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: -8px 44px 16px 0;
  color: var(--pp-m-muted);
  font-size: 14px;
  line-height: 1.4;
}
#pp-app .pp-sheet-context .pp-dot { margin: 0 5px; }
#pp-app .pp-sheet-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
#pp-app .pp-sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 6px 6px 6px 16px;
  border-radius: 14px;
  background: var(--pp-m-surface-2);
}
#pp-app .pp-sheet-row-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--pp-m-text);
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
#pp-app .pp-sheet-row-remove {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--pp-m-muted);
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
#pp-app .pp-sheet-row-remove:hover,
#pp-app .pp-sheet-row-remove:active { background: var(--pp-m-danger-soft); color: var(--pp-m-danger-ink); }
#pp-app .pp-sheet-row-confirm {
  flex-wrap: wrap;
  padding: 8px 8px 8px 16px;
  background: var(--pp-m-danger-soft);
  box-shadow: inset 0 0 0 1px var(--pp-m-danger-line);
}
#pp-app .pp-sheet-row-confirm .pp-sheet-row-name { color: var(--pp-m-danger-ink); font-weight: 600; }
#pp-app .pp-sheet-row-actions { display: flex; gap: 6px; margin-left: auto; }
#pp-app .pp-sheet-row-actions .pp-btn { min-height: 40px; }
#pp-app .pp-sheet-row-actions .pp-btn-danger,
#pp-app .pp-sheet-row-actions .pp-btn-danger:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #ffffff;
}
#pp-app .pp-sheet-empty {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--pp-m-surface-2);
  color: var(--pp-m-muted);
  font-size: 15px;
  text-align: center;
}
#pp-app .pp-sheet-section-title {
  display: block;
  margin-bottom: 6px;
  color: var(--pp-m-text-2);
  font-size: 13px;
  font-weight: 600;
}
#pp-app .pp-sheet-add-row { display: flex; gap: 8px; }
#pp-app .pp-sheet-add-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 12px;
  background: var(--pp-m-input);
  color: var(--pp-m-text);
  font-family: inherit;
  font-size: 16px; /* pas de zoom automatique sur iOS */
}
#pp-app .pp-sheet-add-row input[type="text"]:focus {
  outline: none;
  border-color: var(--pp-accent, #2563eb);
  box-shadow: 0 0 0 3px var(--pp-m-accent-soft);
}
#pp-app .pp-sheet-add-btn { flex: 0 0 auto; min-height: 48px; padding: 0 18px; }
#pp-app .pp-sheet-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--pp-m-danger-soft);
  color: var(--pp-m-danger-ink);
  font-size: 14px;
}
#pp-app .pp-sheet-error[hidden] { display: none; }
#pp-app .pp-sheet-remarques .pp-field { margin-bottom: 0; }
/* Hauteur limitée pour que la zone de texte reste au-dessus du clavier
   une fois celui-ci ouvert (il occupe environ 40 % de l'écran). */
#pp-app .pp-sheet-remarques .pp-field textarea {
  height: 28vh;
  min-height: 120px;
  max-height: 280px;
  line-height: 1.45;
  resize: none;
}
#pp-app .pp-sheet-remarques .pp-field textarea:focus {
  outline: none;
  border-color: var(--pp-accent, #2563eb) !important;
  box-shadow: 0 0 0 3px var(--pp-m-accent-soft);
}
@media (hover: hover) {
  #pp-app .pp-list-signups .pp-m-tile:hover { border-color: var(--pp-m-line-strong); }
  #pp-app .pp-m-tile-remarques:hover { background: var(--pp-m-surface-2); }
}

/* ---------- Anneaux de focus sur téléphone (2.32.1) ----------
   Le navigateur (ou le thème) dessinait son propre anneau de focus — blanc
   en mode sombre — après un toucher : lignes blanches parasites. On le
   remplace par un anneau à la couleur d'accent, réservé à la navigation
   au clavier (:focus-visible), donc toujours accessible. Les champs de
   saisie gardent leur propre mise en évidence (bordure + halo). */
@media (max-width: 782px) {
  #pp-app button:focus,
  #pp-app a:focus,
  #pp-app [tabindex]:focus,
  .pp-top-bar button:focus,
  .pp-top-bar a:focus,
  .pp-guide-link-row a:focus { outline: none; box-shadow: none; }
  #pp-app button:focus-visible,
  #pp-app a:focus-visible,
  .pp-top-bar button:focus-visible,
  .pp-top-bar a:focus-visible,
  .pp-guide-link-row a:focus-visible {
    outline: 2px solid var(--pp-accent, #2563eb);
    outline-offset: 2px;
  }
  /* En-têtes de groupe des filtres : anneau intérieur arrondi (le groupe
     coupe ce qui dépasse). */
  #pp-app .pp-fs-head { border-radius: 16px; }
  #pp-app .pp-fs-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--pp-accent, #2563eb); }
  /* La fenêtre elle-même ne reçoit le focus qu'en dernier recours : pas
     d'anneau autour de toute la feuille. */
  #pp-app .pp-modal:focus,
  #pp-app .pp-modal:focus-visible { outline: none; box-shadow: 0 -8px 40px rgba(15, 23, 42, .25); }
}

/* Barre d'administration WordPress : fixe en haut entre 601 et 782px
   (46px), elle défile avec la page en dessous de 600px. */
@media (min-width: 601px) and (max-width: 782px) {
  body.admin-bar #pp-app { --pp-sticky-top: 46px; }
}

/* Teinte "accent" adoucie, calculée depuis la couleur d'accent réglée par le
   gestionnaire quand le navigateur sait le faire (repli bleu sinon). */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  #pp-app { --pp-m-accent-soft: color-mix(in srgb, var(--pp-accent, #2563eb) 14%, transparent); }
}

/* Application installée : marge pour la barre gestuelle / l'encoche. */
@media (max-width: 782px) {
  html.pp-standalone #pp-app { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

@keyframes pp-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #pp-app .pp-modal { animation: none; }
}

/* ===================== Mode sombre de la vue mobile (2.31.0) =====================
   Uniquement sur petit écran, quand la classe pp-dark est posée sur <html>
   par le script (2.42.0, voir applyTheme() dans script.js) : choix
   « Sombre » de la personne dans le menu de son avatar, ou choix « Auto »
   avec le téléphone en mode sombre — et seulement si le réglage
   « Application mobile > Mode sombre » est sur Automatique. Ne s'applique qu'au
   planning lui-même (#pp-app) : le reste de la page suit le thème
   WordPress, d'où le fond propre et les coins arrondis du bloc. */
html.pp-dark #pp-app {
  color-scheme: dark;
  --pp-text: #e5e9f0;
  --pp-m-app: #0b1220;
  --pp-m-surface: #172033;
  --pp-m-surface-2: #1f2a40;
  --pp-m-surface-3: #2a3650;
  --pp-m-line: rgba(148, 163, 184, .16);
  --pp-m-line-strong: rgba(148, 163, 184, .32);
  --pp-m-text: #e5e9f0;
  --pp-m-text-2: #cbd5e1;
  --pp-m-muted: #94a3b8;
  --pp-m-glass: rgba(23, 32, 51, .82);
  --pp-m-input: #0f172a;
  --pp-m-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --pp-m-shadow-lg: 0 10px 32px rgba(0, 0, 0, .5);
  --pp-m-accent-soft: rgba(96, 165, 250, .18);
  --pp-m-accent-ink: #93c5fd;
  --pp-m-danger-soft: rgba(220, 38, 38, .16);
  --pp-m-danger-line: rgba(248, 113, 113, .35);
  --pp-m-danger-ink: #fca5a5;
}
html.pp-dark #pp-app .pp-loading { color: #94a3b8; }
html.pp-dark #pp-app .pp-dot { border-color: rgba(255, 255, 255, .25); }
html.pp-dark #pp-app .pp-list-datetime-editable:hover { background: var(--pp-m-accent-soft); }
html.pp-dark #pp-app .pp-list-pretre input.pp-inline-text:hover,
html.pp-dark #pp-app .pp-list-item-head .pp-inline-important:hover,
html.pp-dark #pp-app .pp-list-body .pp-inline-textarea:hover { background: var(--pp-m-accent-soft); }
html.pp-dark #pp-app .pp-cell-heure,
html.pp-dark #pp-app .pp-cell-heure input.pp-inline-heure { color: var(--pp-m-text-2); }
/* Vue tableau. */
html.pp-dark #pp-app table.pp-grid th,
html.pp-dark #pp-app table.pp-grid td { border-color: var(--pp-m-line); }
html.pp-dark #pp-app table.pp-grid thead th,
html.pp-dark #pp-app table.pp-grid td.pp-date-row-header { background: var(--pp-m-surface-2); box-shadow: 0 1px 0 var(--pp-m-line-strong); }
html.pp-dark #pp-app .pp-cell-empty { color: #475569; }
/* Messages. */
html.pp-dark #pp-app .pp-msg-error { background: rgba(220, 38, 38, .16); color: #fca5a5; border-color: rgba(248, 113, 113, .35); }
html.pp-dark #pp-app .pp-msg-ok { background: rgba(22, 163, 74, .16); color: #86efac; border-color: rgba(74, 222, 128, .3); }
html.pp-dark #pp-app .pp-msg-info { background: rgba(37, 99, 235, .18); color: #bfdbfe; border-color: rgba(96, 165, 250, .35); }
/* QR code (2.32.1) : plus de grand pavé blanc. Tuile gris clair
   arrondie, juste autour du code, modules bleu nuit — on garde des
   modules foncés sur fond clair, le seul sens lu par tous les lecteurs
   de QR code, avec un contraste élevé. Couleurs appliquées au <svg>
   produit par la bibliothèque (rect = fond, path = modules). */
html.pp-dark #pp-app .pp-qr-container {
  padding: 8px 0;
  background: transparent;
  border: none;
}
html.pp-dark #pp-app .pp-qr-container svg {
  box-sizing: content-box;
  width: 176px;
  height: 176px;
  padding: 14px;
  border-radius: 20px;
  background: #e2e8f0;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, .25), 0 8px 24px rgba(0, 0, 0, .35);
}
html.pp-dark #pp-app .pp-qr-container svg rect { fill: #e2e8f0; }
html.pp-dark #pp-app .pp-qr-container svg path { fill: #0b1220; }
/* Barres de défilement discrètes dans les fenêtres. */
html.pp-dark #pp-app .pp-modal { scrollbar-color: rgba(148, 163, 184, .35) transparent; }
html.pp-dark #pp-app .pp-modal-overlay { background: rgba(0, 0, 0, .6); }
html.pp-dark #pp-app .pp-modal,
html.pp-dark #pp-app .pp-modal:focus { box-shadow: 0 -8px 40px rgba(0, 0, 0, .55), 0 -1px 0 rgba(148, 163, 184, .16); }
html.pp-dark #pp-app a { color: var(--pp-m-accent-ink); }
/* 2.31.1 : le mode sombre couvre toute la page du planning (et plus
   seulement le bloc #pp-app) : fond de page, conteneurs du thème autour du
   planning (marqués .pp-dark-host par le script), barre du compte, titre,
   introduction, bloc membres, lien du guide, invite d'installation. La
   classe pp-dark n'est posée que sur la page qui contient le planning. */
html.pp-dark,
html.pp-dark body {
  background: #0b1220 !important;
  color: #e5e9f0;
  color-scheme: dark;
}
html.pp-dark .pp-dark-host {
  background-color: transparent !important;
  background-image: none !important;
  color: #e5e9f0;
}
html.pp-dark .pp-planning-title,
html.pp-dark .pp-planning-intro { color: #e5e9f0; }
html.pp-dark .pp-planning-members {
  background: #172033;
  border-color: rgba(148, 163, 184, .32);
  color: #e5e9f0;
}
html.pp-dark .pp-planning-intro a,
html.pp-dark .pp-planning-members a,
html.pp-dark .pp-guide-link-row a { color: #93c5fd; }

/* Barre du compte (Inviter, cloche, avatar) et ses menus. */
html.pp-dark .pp-top-bar { color: #e5e9f0; }
html.pp-dark .pp-top-bar .pp-btn {
  background: #172033;
  border-color: rgba(148, 163, 184, .32);
  color: #e5e9f0;
}
html.pp-dark .pp-top-bar .pp-btn:hover { background: #1f2a40; color: #e5e9f0; }
html.pp-dark .pp-top-bar .pp-icon-btn { color: #cbd5e1; }
html.pp-dark .pp-top-bar .pp-icon-btn:hover,
html.pp-dark .pp-top-bar .pp-icon-btn.pp-active { background: #1f2a40; color: #e5e9f0; }
html.pp-dark .pp-top-bar .pp-notif-badge { border-color: #0b1220; }
html.pp-dark .pp-top-bar .pp-user-dropdown,
html.pp-dark .pp-top-bar .pp-notif-dropdown {
  background: #172033;
  border-color: rgba(148, 163, 184, .16);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .5);
}
html.pp-dark .pp-top-bar .pp-user-dropdown-email,
html.pp-dark .pp-top-bar .pp-notif-item-name { color: #e5e9f0; }
html.pp-dark .pp-top-bar .pp-user-dropdown-status,
html.pp-dark .pp-top-bar .pp-notif-item-meta,
html.pp-dark .pp-top-bar .pp-notif-empty { color: #94a3b8; }
html.pp-dark .pp-top-bar .pp-user-dropdown-divider { border-top-color: rgba(148, 163, 184, .16); }
html.pp-dark .pp-top-bar .pp-user-dropdown-logout { color: #fca5a5; }
html.pp-dark .pp-top-bar .pp-notif-item { background: #1f2a40; border-color: rgba(148, 163, 184, .16); }

/* Invite d'installation. */
html.pp-dark .pp-pwa-banner {
  background: #172033;
  color: #e5e9f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
}
html.pp-dark .pp-pwa-banner .pp-pwa-text { color: #cbd5e1; }
html.pp-dark .pp-pwa-banner button { background: #1f2a40; border-color: rgba(148, 163, 184, .32); color: #e5e9f0; }
html.pp-dark .pp-pwa-banner .pp-pwa-install {
  background: var(--pp-accent, #2563eb);
  border-color: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
}
html.pp-dark .pp-pwa-banner .pp-pwa-close { background: transparent; color: #94a3b8; }

@supports (color: color-mix(in srgb, red 50%, blue)) {
  html.pp-dark #pp-app {
    --pp-m-accent-soft: color-mix(in srgb, var(--pp-accent, #2563eb) 26%, transparent);
    --pp-m-accent-ink: color-mix(in srgb, var(--pp-accent, #2563eb) 45%, #ffffff);
  }
}

/* ---------- Fenêtres de saisie plein écran + page figée (2.36.0) ----------
   Le clavier du téléphone décalait sans cesse la fenêtre "feuille" (ancrée
   en bas, là où arrive le clavier) et la page derrière. Désormais :
   - page figée tant qu'une fenêtre est ouverte (classe posée par
     lockPageScroll() dans script.js) ;
   - fenêtres de saisie de la vue liste en plein écran, champs en haut :
     le clavier arrive en dessous sans rien recouvrir, rien n'a à bouger ;
   - simple fondu à l'ouverture, plus de glissement depuis le bas. */
@media (max-width: 782px) {
  html.pp-modal-open,
  html.pp-modal-open body { overflow: hidden !important; }
  #pp-app .pp-modal-overlay { overscroll-behavior: contain; }
  #pp-app .pp-modal { overscroll-behavior: contain; }

  #pp-app .pp-modal-overlay-fullscreen { align-items: stretch; padding: 0; }
  #pp-app .pp-modal.pp-modal-fullscreen {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0 18px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
    animation: pp-fade-in .16s ease-out;
  }
  #pp-app .pp-modal.pp-modal-fullscreen:focus,
  #pp-app .pp-modal.pp-modal-fullscreen:focus-visible { box-shadow: none; }
  #pp-app .pp-modal-fullscreen .pp-modal-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin: 0 -18px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    background: var(--pp-m-surface);
    border-bottom: 1px solid var(--pp-m-line);
  }
  #pp-app .pp-modal-fullscreen .pp-modal-header h3 {
    margin: 0;
    padding: 0;
    font-size: 17px;
    text-align: center;
    white-space: nowrap;
  }
}
#pp-app .pp-modal-header-start { justify-self: start; display: flex; }
#pp-app .pp-modal-header-end { justify-self: end; display: flex; }
#pp-app .pp-sheet-header-btn {
  min-height: 38px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
}
#pp-app .pp-sheet-header-link {
  min-height: 40px;
  padding: 8px 6px;
  border: none;
  background: none;
  color: var(--pp-m-accent-ink);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}
@media (max-width: 782px) {
  #pp-app .pp-modal-fullscreen .pp-sheet-context { margin: 12px 0 18px; }
}
#pp-app .pp-sheet-list-section { margin-top: 24px; }
#pp-app .pp-sheet-list-section .pp-sheet-list { margin-bottom: 0; }
@keyframes pp-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #pp-app .pp-modal.pp-modal-fullscreen { animation: none; }
}

/* ===================== Icônes SVG (2.37.0) =====================
   Remplacent les emoji et symboles (📎 🔗 📱 ✎ ✓ × ↗ ↑ ↓ ⚠️ ✅).
   Taille = 1em (font-size du parent), couleur = currentColor. */
.pp-i { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 0; }
.pp-i svg { display: block; }
.pp-i-after { margin-left: .3em; font-size: .9em; }
.pp-guide-link-row a { display: inline-flex; align-items: center; }
.pp-tag button .pp-i,
.pp-tag-remove .pp-i { font-size: 14px; }
#pp-app .pp-inline-add-btn .pp-i { font-size: 17px; }
#pp-app .pp-fs-close .pp-i { font-size: 20px; }
#pp-app .pp-add-btn { display: inline-flex; align-items: center; gap: 4px; }
.pp-programme-link .pp-i { font-size: 1.05em; }
.pp-list-attachments-toggle { gap: 6px; }
.pp-list-attachments-toggle .pp-i { font-size: 15px; }
.pp-pwa-banner .pp-pwa-title { display: flex; align-items: center; gap: 8px; }
.pp-pwa-banner .pp-pwa-title-icon { flex: 0 0 auto; width: 18px; height: 18px; }
.pp-pwa-banner .pp-pwa-close { display: inline-flex; align-items: center; justify-content: center; }
.pp-pwa-banner .pp-pwa-close svg { width: 20px; height: 20px; }
.pp-admin-icon { vertical-align: -3px; }
.pp-admin-icon-ok { color: #16a34a; }
.pp-admin-table .pp-drag .pp-i { font-size: 18px; }
.pp-admin-table .pp-reorder-btn .pp-i { font-size: 12px; }
#pp-app .pp-m-tile-badge .pp-i { font-size: 15px; }
#pp-app .pp-sheet-row-remove .pp-i { font-size: 20px; }
#pp-app .pp-sheet-row-remove { display: inline-flex; align-items: center; justify-content: center; }
#pp-app .pp-tag-remove { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Fenêtre « Pièces jointes » (2.37.0, vue liste téléphone) ----------
   Voir openAttachmentsSheet() dans script.js. */
#pp-app .pp-list-attachments-toggle { display: inline-flex; align-items: center; }
#pp-app .pp-sheet-header-link { display: inline-flex; align-items: center; gap: 2px; }
#pp-app .pp-sheet-header-link .pp-i { font-size: 20px; margin-left: -4px; }
#pp-app .pp-modal-header [hidden] { display: none !important; }

#pp-app .pp-sheet-att-row { padding: 6px 6px 6px 12px; align-items: center; }
#pp-app .pp-sheet-att-link {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 1px;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  color: var(--pp-m-text);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
#pp-app .pp-sheet-att-link:hover { text-decoration: none; }
#pp-app .pp-sheet-att-link > .pp-i {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--pp-m-accent-soft);
  color: var(--pp-m-accent-ink);
  font-size: 20px;
}
#pp-app .pp-sheet-att-link .pp-attachment-text { overflow-wrap: anywhere; }
#pp-app .pp-sheet-att-meta {
  grid-column: 2;
  color: var(--pp-m-muted);
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#pp-app .pp-sheet-row-tools { display: flex; flex: 0 0 auto; gap: 2px; }
#pp-app .pp-sheet-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--pp-m-muted);
  font-size: 19px;
  cursor: pointer;
}
#pp-app .pp-sheet-icon-btn:active,
#pp-app .pp-sheet-icon-btn:hover { background: var(--pp-m-surface-3); color: var(--pp-m-text); }
#pp-app .pp-sheet-icon-btn-danger:active,
#pp-app .pp-sheet-icon-btn-danger:hover { background: var(--pp-m-danger-soft); color: var(--pp-m-danger-ink); }

#pp-app .pp-sheet-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#pp-app .pp-sheet-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 16px;
  background: var(--pp-m-surface);
  color: var(--pp-m-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
#pp-app .pp-sheet-choice:active { background: var(--pp-m-surface-2); }
#pp-app .pp-sheet-choice > .pp-i {
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: var(--pp-m-accent-soft);
  color: var(--pp-m-accent-ink);
  font-size: 19px;
}
#pp-app .pp-sheet-choice-title { font-size: 16px; font-weight: 600; }
#pp-app .pp-sheet-choice-meta { color: var(--pp-m-muted); font-size: 13px; line-height: 1.3; }

#pp-app .pp-sheet-form { display: flex; flex-direction: column; gap: 14px; }
#pp-app .pp-sheet-form .pp-field { margin-bottom: 0; }
#pp-app .pp-sheet-form .pp-field input[type="url"] {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--pp-m-line-strong);
  border-radius: 12px;
  background: var(--pp-m-input);
  color: var(--pp-m-text);
  font-family: inherit;
  font-size: 16px;
  box-sizing: border-box;
}
#pp-app .pp-sheet-form .pp-field input:focus {
  outline: none;
  border-color: var(--pp-accent, #2563eb) !important;
  box-shadow: 0 0 0 3px var(--pp-m-accent-soft);
}
#pp-app .pp-sheet-form > .pp-sheet-section-title { margin-bottom: -8px; }
#pp-app .pp-sheet-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 12px;
  border-radius: 14px;
  background: var(--pp-m-surface-2);
}
#pp-app .pp-sheet-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--pp-m-accent-soft);
  color: var(--pp-m-accent-ink);
  font-size: 20px;
}
#pp-app .pp-sheet-file-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
#pp-app .pp-sheet-file-name { color: var(--pp-m-text); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
#pp-app .pp-sheet-file-meta { color: var(--pp-m-muted); font-size: 13px; }
#pp-app .pp-sheet-text-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 6px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--pp-m-accent-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
#pp-app .pp-sheet-actions { display: flex; gap: 10px; }
#pp-app .pp-sheet-actions .pp-btn { flex: 1 1 0; min-height: 48px; }
html.pp-dark #pp-app a.pp-sheet-att-link { color: var(--pp-m-text); }

/* ---------- Réordonnancement des pièces jointes (2.38.0) ----------
   Poignées à glisser (souris ou doigt), voir makeSortable() dans
   script.js. touch-action:none : glisser la poignée déplace la ligne au
   lieu de faire défiler la page. */
.pp-sort-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.pp-sort-handle:hover { color: #334155; background: rgba(100, 116, 139, .12); }
.pp-sorting,
.pp-sorting * { -webkit-user-select: none; user-select: none; cursor: grabbing !important; }
.pp-sorting .pp-sort-shift { transition: transform .18s ease; }
.pp-sort-dragging {
  position: relative;
  z-index: 5;
  border-radius: 8px;
  background: var(--pp-m-surface, #ffffff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}
#pp-app .pp-sheet-att-row { padding-left: 4px; }
#pp-app .pp-sheet-att-row .pp-sort-handle {
  width: 34px;
  height: 48px;
  border-radius: 10px;
  color: var(--pp-m-muted);
  font-size: 20px;
}
#pp-app .pp-sheet-att-row .pp-sort-handle:hover { background: transparent; }
#pp-app .pp-sheet-row.pp-sort-dragging {
  border-radius: 14px;
  background: var(--pp-m-surface);
  box-shadow: var(--pp-m-shadow-lg), 0 0 0 2px var(--pp-accent, #2563eb);
}
#pp-app .pp-sheet-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--pp-m-muted);
  font-size: 13px;
  line-height: 1.35;
}
#pp-app .pp-sheet-hint .pp-i { font-size: 16px; }
@media (prefers-reduced-motion: reduce) {
  .pp-sorting .pp-sort-shift { transition: none; }
}

/* 2.38.1 : fenêtre rouverte au retour d'une pièce jointe, sans animation
   (voir openAttachmentsSheet(..., { instant: true }) dans script.js). */
#pp-app .pp-modal.pp-modal-instant { animation: none !important; }

/* ---------- Boîte de dialogue centrée (2.38.2, téléphone) ----------
   Fenêtres réduites à un message et deux boutons (confirmation) : au
   milieu de l'écran, comme les confirmations des applications, au lieu
   d'être collées en bas. Voir l'option `dialog` de showModal(). */
#pp-app .pp-modal-overlay.pp-modal-overlay-dialog {
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#pp-app .pp-modal.pp-modal-dialog {
  width: 100%;
  max-width: 340px;
  max-height: calc(100% - 48px);
  padding: 24px 20px 20px;
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .28);
  animation: pp-dialog-in .18s cubic-bezier(.2, .8, .2, 1);
}
#pp-app .pp-modal.pp-modal-dialog:focus,
#pp-app .pp-modal.pp-modal-dialog:focus-visible { box-shadow: 0 20px 50px rgba(15, 23, 42, .28); }
#pp-app .pp-modal.pp-modal-dialog h3 {
  margin-bottom: 8px;
  padding-right: 0;
  font-size: 18px;
}
#pp-app .pp-modal-dialog .pp-dialog-message {
  margin: 0;
  color: var(--pp-m-text-2);
  font-size: 15px;
  line-height: 1.45;
}
#pp-app .pp-modal-dialog .pp-modal-actions { margin-top: 20px; flex-wrap: nowrap; }
#pp-app .pp-modal-dialog .pp-modal-actions .pp-btn { min-height: 46px; }
#pp-app .pp-modal-dialog .pp-btn-danger,
#pp-app .pp-modal-dialog .pp-btn-danger:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #ffffff;
}
html.pp-dark #pp-app .pp-modal.pp-modal-dialog,
html.pp-dark #pp-app .pp-modal.pp-modal-dialog:focus {
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(148, 163, 184, .16);
}
@keyframes pp-dialog-in {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #pp-app .pp-modal.pp-modal-dialog { animation: none; }
}

/* ===================== 2.39.0 ===================== */

/* ---------- Champs date / heure sur téléphone (2.40.0) ----------
   Voir dateTimeField() dans script.js : champ texte (pavé numérique) +
   icône qui ouvre le calendrier / l'horloge du téléphone (champ natif
   invisible posé sur l'icône). */
#pp-app .pp-dt-row { position: relative; display: flex; align-items: center; }
#pp-app .pp-field .pp-dt-text {
  width: 100%;
  padding-right: 56px !important;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
#pp-app .pp-dt-pick {
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 40px;
  border-radius: 10px;
  background: var(--pp-m-accent-soft, rgba(37, 99, 235, .12));
  color: var(--pp-m-accent-ink, #2563eb);
  font-size: 20px;
  transform: translateY(-50%);
  overflow: hidden;
}
#pp-app .pp-dt-pick .pp-dt-native {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  font-size: 16px; /* pas de zoom automatique sur iOS */
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#pp-app .pp-dt-pick .pp-dt-native::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
#pp-app .pp-dt-pick:focus-within { box-shadow: 0 0 0 2px var(--pp-accent, #2563eb); }

/* ---------- Boîtes de dialogue avec formulaire (date/heure, église) ---------- */
#pp-app .pp-modal-dialog .pp-dialog-form { text-align: left; }
#pp-app .pp-modal-dialog .pp-dialog-form .pp-field { margin-bottom: 14px; }
#pp-app .pp-modal-dialog .pp-dialog-form .pp-modal-actions { margin-top: 18px; }
#pp-app .pp-modal-dialog .pp-modal-actions .pp-dialog-icon-btn {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  background: var(--pp-m-danger-soft);
  color: var(--pp-m-danger-ink);
  font-size: 19px;
}
#pp-app .pp-modal-dialog .pp-field input[type="date"] { width: 100%; box-sizing: border-box; }
#pp-app .pp-modal.pp-modal-dialog { overflow-y: auto; }

/* Choix de l'église. */
#pp-app .pp-choice-list { display: flex; flex-direction: column; gap: 6px; }
#pp-app .pp-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--pp-m-surface-2);
  color: var(--pp-m-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
#pp-app .pp-choice-label { flex: 1 1 auto; }
#pp-app .pp-choice-on { border-color: var(--pp-accent, #2563eb); background: var(--pp-m-accent-soft); font-weight: 700; }
#pp-app .pp-choice-check { color: var(--pp-m-accent-ink); font-size: 18px; }
#pp-app .pp-choice .pp-dot { width: 12px; height: 12px; }

/* Pastille église cliquable (gestionnaire). */
#pp-app .pp-church-label-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--pp-m-line-strong);
  font-family: inherit;
  cursor: pointer;
}
#pp-app .pp-church-label-btn:active { background: var(--pp-m-surface-3); }
#pp-app .pp-church-label-chevron { margin-left: 4px; font-size: 15px; color: var(--pp-m-muted); }

/* ---------- Bandeau de la célébration en haut des fenêtres ---------- */
#pp-app .pp-sheet-event {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-left: 5px solid #94a3b8;
  border-radius: 16px;
}
#pp-app .pp-sheet-event-main { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; }
#pp-app .pp-sheet-event-time {
  color: var(--pp-m-text);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
#pp-app .pp-sheet-event-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pp-m-text);
  font-size: 17px;
  font-weight: 600;
}
#pp-app .pp-sheet-event-rel {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pp-accent, #2563eb);
  color: var(--pp-accent-text, #ffffff);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
#pp-app .pp-sheet-event-church {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--pp-m-text-2);
  font-size: 15px;
  font-weight: 600;
}
#pp-app .pp-sheet-event-church .pp-dot { width: 11px; height: 11px; margin: 0; }

/* ---------- Menu du compte et fenêtre « Mon compte » (2.39.0) ---------- */
.pp-top-bar .pp-user-dropdown-item,
.pp-top-bar .pp-user-dropdown-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.pp-top-bar .pp-user-dropdown-item {
  width: 100%;
  padding: 7px 0;
  border: none;
  background: none;
  color: #1e293b;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.pp-top-bar .pp-user-dropdown-item:hover { color: var(--pp-accent, #2563eb); }
.pp-top-bar .pp-user-dropdown-item .pp-i,
.pp-top-bar .pp-user-dropdown-logout .pp-i { font-size: 16px; }
.pp-top-bar .pp-user-dropdown-item { min-height: 40px; }
html.pp-dark .pp-top-bar .pp-user-dropdown-item { color: #e5e9f0; }

/* ---------- Mode d'affichage dans le menu de l'avatar (2.42.0) ---------- */
.pp-top-bar .pp-theme-row { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 8px; }
.pp-top-bar .pp-theme-row-label { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.pp-top-bar .pp-theme-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.pp-top-bar .pp-theme-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pp-top-bar .pp-theme-option .pp-i { font-size: 15px; }
.pp-top-bar .pp-theme-option:hover { color: #1e293b; }
.pp-top-bar .pp-theme-option-on {
  background: #ffffff;
  color: var(--pp-accent, #2563eb);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
.pp-top-bar .pp-theme-option:focus-visible { outline: 2px solid var(--pp-accent, #2563eb); outline-offset: 1px; }
html.pp-dark .pp-top-bar .pp-theme-row-label { color: #94a3b8; }
html.pp-dark .pp-top-bar .pp-theme-switch { background: #0f172a; border-color: rgba(148, 163, 184, .16); }
html.pp-dark .pp-top-bar .pp-theme-option { color: #cbd5e1; }
html.pp-dark .pp-top-bar .pp-theme-option:hover { color: #e5e9f0; }
html.pp-dark .pp-top-bar .pp-theme-option-on { background: #2a3650; color: #93c5fd; box-shadow: none; }

/* Barre de titre des fenêtres avec boutons (ordinateur). */
#pp-app .pp-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#pp-app .pp-modal-header h3 { margin: 0; }
@media (min-width: 783px) { #pp-app .pp-modal-header-start:empty { display: none; } }

#pp-app .pp-account { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
#pp-app .pp-account-section {
  border: 1px solid var(--pp-m-line, #e2e8f0);
  border-radius: 16px;
  background: var(--pp-m-surface-2, #f8fafc);
  overflow: hidden;
}
#pp-app .pp-account-section-open { background: var(--pp-m-surface, #ffffff); border-color: var(--pp-m-line-strong, #cbd5e1); }
#pp-app .pp-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--pp-m-text, #0f172a);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
#pp-app .pp-account-head-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--pp-m-accent-soft, rgba(37, 99, 235, .12));
  color: var(--pp-m-accent-ink, #2563eb);
  font-size: 19px;
}
#pp-app .pp-account-head-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
#pp-app .pp-account-title { font-size: 16px; font-weight: 700; }
#pp-app .pp-account-summary {
  overflow: hidden;
  color: var(--pp-m-muted, #64748b);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#pp-app .pp-account-chevron { color: var(--pp-m-muted, #64748b); font-size: 18px; transition: transform .18s ease; }
#pp-app .pp-account-section-open .pp-account-chevron { transform: rotate(180deg); }
#pp-app .pp-account-form { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
#pp-app .pp-account-form .pp-field { margin-bottom: 0; }
#pp-app .pp-account-form input[type="email"],
#pp-app .pp-account-form input[type="password"],
#pp-app .pp-account-form input[type="text"] { width: 100%; box-sizing: border-box; }
#pp-app .pp-account-hint { margin: 0; color: var(--pp-m-muted, #64748b); font-size: 13px; line-height: 1.4; }
#pp-app .pp-account-submit { min-height: 46px; }
#pp-app .pp-account-msg { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
#pp-app .pp-account-msg[hidden] { display: none; }
#pp-app .pp-account-msg-ok { background: rgba(22, 163, 74, .12); color: #15803d; }
#pp-app .pp-account-msg-error { background: var(--pp-m-danger-soft, #fef2f2); color: var(--pp-m-danger-ink, #b91c1c); }
html.pp-dark #pp-app .pp-account-msg-ok { color: #86efac; background: rgba(22, 163, 74, .16); }
/* 2.39.0 : menus de la barre du compte au-dessus de la barre d'outils
   collante du planning (z-index 30), qui masquait le haut du menu. */
.pp-top-bar .pp-user-dropdown,
.pp-notif-dropdown { z-index: 40; }

/* ---------- Raccourcis en haut du planning (2.40.0) ----------
   Voir renderGuideLink() dans script.js. Hors de #pp-app (comme la barre du
   compte) : police et couleurs redéfinies ici. Téléphone : une rangée qui
   défile horizontalement ; ordinateur : tuiles sur plusieurs lignes. */
.pp-shortcuts {
  --pp-sc-surface: #ffffff;
  --pp-sc-line: rgba(15, 23, 42, .08);
  --pp-sc-text: #0f172a;
  --pp-sc-muted: #64748b;
  --pp-sc-icon-bg: rgba(37, 99, 235, .10);
  margin: 0 0 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .pp-shortcuts { --pp-sc-icon-bg: color-mix(in srgb, var(--pp-accent, #2563eb) 12%, transparent); }
}
.pp-shortcuts *, .pp-shortcuts *::before, .pp-shortcuts *::after { box-sizing: border-box; }
/* 2.41.0 : tuiles centrées sur ordinateur. */
.pp-shortcuts-track { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pp-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 200px;
  max-width: 300px;
  min-height: 64px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--pp-sc-line);
  border-radius: 16px;
  background: var(--pp-sc-surface);
  color: var(--pp-sc-text);
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.pp-shortcut:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 8px 20px rgba(15, 23, 42, .10); }
.pp-shortcut:focus-visible { outline: 2px solid var(--pp-accent, #2563eb); outline-offset: 2px; }
.pp-shortcut-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--pp-sc-icon-bg);
  color: var(--pp-accent, #2563eb);
  font-size: 21px;
}
.pp-shortcut-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pp-shortcut-title {
  overflow: hidden;
  color: var(--pp-sc-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pp-shortcut-sub {
  overflow: hidden;
  color: var(--pp-sc-muted);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 782px) {
  .pp-shortcuts { margin: 0 0 14px; }
  .pp-shortcuts-track {
    flex-wrap: nowrap;
    justify-content: flex-start; /* rangée défilante : alignée à gauche */
    gap: 10px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pp-shortcuts-track::-webkit-scrollbar { display: none; }
  .pp-shortcut {
    flex: 0 0 auto;
    width: 172px;
    max-width: none;
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    scroll-snap-align: start;
  }
  .pp-shortcut:hover { transform: none; }
  .pp-shortcut:active { transform: scale(.98); }
  .pp-shortcut-title, .pp-shortcut-sub { white-space: normal; }
  .pp-shortcut-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
}
html.pp-dark .pp-shortcuts {
  --pp-sc-surface: #172033;
  --pp-sc-line: rgba(148, 163, 184, .16);
  --pp-sc-text: #e5e9f0;
  --pp-sc-muted: #94a3b8;
  --pp-sc-icon-bg: rgba(96, 165, 250, .16);
}
html.pp-dark .pp-shortcut { box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); }
html.pp-dark .pp-shortcut-icon { color: #93c5fd; }

/* Accès au back-office (gestionnaire), barre du compte. */
.pp-top-bar .pp-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  font-size: 20px;
  text-decoration: none;
}
.pp-top-bar .pp-admin-link:hover { color: var(--pp-accent, #2563eb); }
html.pp-dark .pp-top-bar .pp-admin-link { color: #cbd5e1; }

/* ---------- Message de bienvenue après création de compte (2.42.0) ---------- */
#pp-app .pp-welcome { display: flex; align-items: flex-start; gap: 10px; }
#pp-app .pp-welcome > span { flex: 1; }
#pp-app .pp-welcome-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -4px -6px -4px 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
}
#pp-app .pp-welcome-close:hover { background: rgba(0, 0, 0, .06); }
html.pp-dark #pp-app .pp-welcome-close:hover { background: rgba(255, 255, 255, .08); }

/* ---------- Bouton heure de la carte (2.45.0, gestionnaire) ----------
   Remplace le champ <input type="time"> en lecture seule (voir
   buildHeureInlineInput() dans script.js). Taille et graisse : .pp-list-heure. */
#pp-app button.pp-heure-btn {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 2px 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--pp-m-text, #0f172a);
  font-family: inherit;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
#pp-app button.pp-heure-btn:hover { background: var(--pp-m-accent-soft, rgba(37, 99, 235, .12)); }
#pp-app button.pp-heure-btn.pp-heure-btn-empty { color: var(--pp-m-muted, #64748b); }

/* ---------- Tuiles Chanteurs / Musiciens dans une carte étroite (2.45.1) ----------
   Requête de conteneur : quand la carte elle-même est étroite (colonne du
   tableau serrée, petit téléphone), les deux tuiles passent l'une sous
   l'autre au lieu de se partager une largeur trop faible (titres tronqués).
   Navigateurs anciens sans requêtes de conteneur : tuiles côte à côte,
   titres terminés par « … » si besoin. */
#pp-app .pp-list-item { container-type: inline-size; }
@container (max-width: 290px) {
  #pp-app .pp-list-signups { grid-template-columns: 1fr; }
  #pp-app .pp-list-signups .pp-m-tile { min-height: 0; }
}

/* ===================== Ordinateur : style de l'application (2.45.0) =====================
   Les styles de l'application (palette --pp-m-*, boutons, cartes, tuiles,
   fenêtres, mode sombre) s'appliquent désormais à tous les écrans ; seuls
   la mise en page propre au téléphone (feuilles qui montent du bas, plein
   écran, barres collantes, carrousel des raccourcis…) reste réservée au
   petit écran. Cette section ajoute ce qui est propre à l'ordinateur :
   tableau date × église dont chaque case contient la carte de
   l'application (listItem(), classe pp-grid-card), fenêtres centrées
   (sheetModalOptions() : classe pp-modal-sheet), densité adaptée à la
   souris. Couleurs : uniquement des variables --pp-m-*, donc le mode
   sombre suit automatiquement. */
@media (min-width: 783px) {
  /* ---------- Barre d'outils ---------- */
  #pp-app .pp-main-toolbar {
    position: relative;
    z-index: 20; /* menus déroulants au-dessus de l'en-tête du tableau */
    gap: 6px;
    margin-bottom: 16px;
    padding: 8px;
    background: var(--pp-m-glass);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid var(--pp-m-line);
    border-radius: 18px;
    box-shadow: var(--pp-m-shadow);
  }
  #pp-app .pp-main-toolbar > .pp-new-celebration-btn {
    min-height: 42px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
  }

  /* ---------- Boutons : densité souris ---------- */
  #pp-app .pp-btn { min-height: 40px; padding: 8px 16px; }
  #pp-app .pp-btn-small { min-height: 34px; padding: 5px 12px; }
  #pp-app .pp-btn:focus-visible { outline: 2px solid var(--pp-accent, #2563eb); outline-offset: 2px; }

  /* ---------- Tableau ---------- */
  #pp-app .pp-grid-wrap {
    max-height: calc(100vh - 150px);
    border: 1px solid var(--pp-m-line);
    border-radius: 20px;
    background: var(--pp-m-surface);
    box-shadow: var(--pp-m-shadow);
  }
  #pp-app table.pp-grid { border-collapse: separate; border-spacing: 0; }
  #pp-app .pp-date-col { width: 168px; }
  #pp-app table.pp-grid th,
  #pp-app table.pp-grid td {
    border: none;
    border-right: 1px solid var(--pp-m-line);
    border-bottom: 1px solid var(--pp-m-line);
    padding: 10px;
  }
  #pp-app table.pp-grid th:last-child,
  #pp-app table.pp-grid td:last-child { border-right: none; }
  #pp-app table.pp-grid tbody tr:last-child td { border-bottom: none; }
  #pp-app table.pp-grid thead th {
    padding: 12px 14px;
    background: var(--pp-m-glass);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--pp-m-line-strong);
    box-shadow: none;
    color: var(--pp-m-text);
    font-size: 15px;
    font-weight: 700;
  }
  #pp-app table.pp-grid thead th.pp-date-col-header {
    color: var(--pp-m-muted);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  #pp-app table.pp-grid thead th .pp-dot { width: 11px; height: 11px; margin-right: 8px; }
  #pp-app table.pp-grid td.pp-date-row-header {
    padding: 14px 10px;
    background: var(--pp-m-surface);
    box-shadow: 1px 0 0 var(--pp-m-line);
  }
  #pp-app table.pp-grid td.pp-cell { background-color: transparent; }
  #pp-app .pp-cell .pp-grid-card + .pp-grid-card { margin-top: 10px; }
  #pp-app .pp-cell-empty { display: block; padding: 6px 0; color: var(--pp-m-line-strong); }

  /* Date de la ligne : pastille, comme les intertitres de l'application. */
  #pp-app .pp-cell-date {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0;
    color: var(--pp-m-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
  }
  #pp-app .pp-cell-date-rel {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--pp-accent, #2563eb);
    color: var(--pp-accent-text, #ffffff);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  #pp-app .pp-cell-date-label::first-letter { text-transform: uppercase; }

  /* Carte dans une case. */
  #pp-app .pp-list-item.pp-grid-card {
    padding: 12px 14px 14px;
    border-radius: 18px;
  }
  #pp-app .pp-grid-card .pp-list-item-head { margin-bottom: 10px; }
  #pp-app .pp-grid-card .pp-list-heure { font-size: 22px; }
  #pp-app .pp-grid-card .pp-list-datetime-editable { cursor: pointer; }
  #pp-app .pp-grid-card .pp-list-signups .pp-m-tile { min-height: 64px; }
  #pp-app .pp-grid-card .pp-creator-actions .pp-btn { min-height: 36px; }
  #pp-app .pp-list-signups .pp-m-tile,
  #pp-app .pp-m-tile-remarques,
  #pp-app .pp-list-attachments-toggle { cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }

  /* ---------- Fenêtres centrées ---------- */
  #pp-app .pp-modal-overlay { background: rgba(15, 23, 42, .45); }
  #pp-app .pp-modal {
    position: relative; /* repère du bouton × de la fenêtre des filtres */
    max-width: 540px;
    padding: 22px 24px 24px;
    border: 1px solid var(--pp-m-line);
    border-radius: 22px;
    background: var(--pp-m-surface);
    color: var(--pp-m-text);
    box-shadow: var(--pp-m-shadow-lg);
    animation: pp-dialog-in .18s cubic-bezier(.2, .8, .2, 1);
  }
  #pp-app .pp-modal h3 { color: var(--pp-m-text); font-size: 19px; }
  #pp-app .pp-field input[type="text"],
  #pp-app .pp-field input[type="date"],
  #pp-app .pp-field input[type="time"],
  #pp-app .pp-field input[type="file"],
  #pp-app .pp-field input[type="password"],
  #pp-app .pp-field input[type="email"],
  #pp-app .pp-field select,
  #pp-app .pp-field textarea { min-height: 42px; padding: 9px 12px; font-size: 15px; }
  #pp-app .pp-field input:focus,
  #pp-app .pp-field select:focus,
  #pp-app .pp-field textarea:focus {
    outline: none;
    border-color: var(--pp-accent, #2563eb) !important;
    box-shadow: 0 0 0 3px var(--pp-m-accent-soft);
  }
  #pp-app .pp-modal-actions .pp-btn { min-height: 40px; }

  /* Fenêtres « feuille » (inscriptions, remarques, pièces jointes, mon
     compte) : mêmes contenus que sur téléphone, en fenêtre centrée. */
  #pp-app .pp-modal.pp-modal-sheet { max-width: 580px; padding: 18px 22px 22px; }
  #pp-app .pp-modal-sheet .pp-modal-header { margin-bottom: 6px; }
  #pp-app .pp-modal-sheet .pp-modal-header h3 { flex: 1 1 auto; margin: 0; font-size: 18px; }
  #pp-app .pp-modal-sheet .pp-modal-header-start,
  #pp-app .pp-modal-sheet .pp-modal-header-end { display: flex; }
  #pp-app .pp-modal-sheet .pp-sheet-event { margin: 8px 0 16px; padding: 12px 14px; }
  #pp-app .pp-modal-sheet .pp-sheet-event-time { font-size: 24px; }
  #pp-app .pp-modal-sheet .pp-sheet-hint { margin-bottom: 8px; }
  #pp-app .pp-modal-sheet .pp-sheet-row { min-height: 48px; }
  #pp-app .pp-modal-sheet .pp-sheet-att-link { font-size: 15px; min-height: 40px; }
  #pp-app .pp-modal-sheet .pp-sheet-att-link:hover .pp-attachment-text { text-decoration: underline; }
  #pp-app .pp-modal-sheet .pp-sheet-att-link > .pp-i { width: 36px; height: 36px; font-size: 18px; }
  #pp-app .pp-modal-sheet .pp-sheet-icon-btn { width: 36px; height: 36px; font-size: 17px; }
  #pp-app .pp-modal-sheet .pp-sheet-choice { min-height: 88px; transition: border-color .15s ease, background-color .15s ease; }
  #pp-app .pp-modal-sheet .pp-sheet-choice:hover { border-color: var(--pp-accent, #2563eb); background: var(--pp-m-surface-2); }
  #pp-app .pp-modal-sheet .pp-sheet-choice-title { font-size: 15px; }
  #pp-app .pp-modal-sheet .pp-sheet-add-row input[type="text"] { min-height: 42px; font-size: 15px; }
  #pp-app .pp-modal-sheet .pp-sheet-add-btn { min-height: 42px; }
  #pp-app .pp-modal-sheet .pp-sheet-form .pp-field input[type="url"] { min-height: 42px; font-size: 15px; }
  #pp-app .pp-modal-sheet .pp-sheet-actions { justify-content: flex-end; }
  #pp-app .pp-modal-sheet .pp-sheet-actions .pp-btn { flex: 0 0 auto; min-height: 40px; padding: 0 18px; }
  #pp-app .pp-modal-sheet .pp-sheet-header-btn { min-height: 34px; padding: 5px 14px; font-size: 14px; }
  #pp-app .pp-modal-sheet .pp-sheet-header-link { min-height: 34px; font-size: 15px; }
  #pp-app .pp-modal-sheet .pp-sheet-text-btn:hover { background: var(--pp-m-accent-soft); }
  #pp-app .pp-modal-sheet .pp-sheet-row-actions .pp-btn { min-height: 34px; }
  #pp-app .pp-modal-sheet .pp-sheet-att-row .pp-sort-handle { width: 28px; height: 40px; font-size: 18px; }
  #pp-app .pp-modal-sheet .pp-sheet-att-row .pp-sort-handle:hover { background: var(--pp-m-surface-3); }
  #pp-app .pp-modal-sheet .pp-sheet-remarques .pp-field textarea { height: 180px; max-height: none; }
}


/* ---------- Tableau sur ordinateur : 7 églises sur un écran standard (2.45.2) ----------
   Le tableau occupe toute la largeur (voir renderGrid()) ; la carte se
   compacte selon la largeur de SA colonne (requêtes de conteneur sur
   .pp-list-item, voir 2.45.1). Navigateurs sans requêtes de conteneur :
   carte normale, éventuel défilement horizontal. */
#pp-app .pp-creator-actions .pp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#pp-app .pp-creator-actions .pp-btn .pp-i { font-size: 15px; }
@media (min-width: 783px) {
  #pp-app .pp-date-col { width: 128px; }
  #pp-app table.pp-grid thead th { overflow-wrap: anywhere; }
  #pp-app table.pp-grid.pp-grid-dense th,
  #pp-app table.pp-grid.pp-grid-dense td { padding: 8px 6px; }
  #pp-app table.pp-grid.pp-grid-dense thead th { padding: 10px 8px; font-size: 14px; line-height: 1.25; }
  #pp-app table.pp-grid.pp-grid-dense td.pp-date-row-header { padding: 12px 8px; }
  #pp-app .pp-grid-dense .pp-cell-date { font-size: 14px; }
  #pp-app .pp-grid-dense .pp-list-item.pp-grid-card { padding: 10px 10px 12px; border-radius: 16px; border-left-width: 4px; }
  #pp-app .pp-grid-dense .pp-cell .pp-grid-card + .pp-grid-card { margin-top: 8px; }
}
@container (max-width: 240px) {
  #pp-app .pp-list-item-head { gap: 6px; margin-bottom: 8px; }
  #pp-app .pp-list-item-head-top { gap: 4px 6px; row-gap: 4px; }
  #pp-app .pp-list-heure,
  #pp-app button.pp-heure-btn { font-size: 19px; padding: 1px 4px; }
  #pp-app .pp-alert-dot.pp-alert-strong { width: 22px; height: 22px; }
  #pp-app .pp-alert-dot.pp-alert-light { width: 20px; height: 20px; }
  #pp-app .pp-important-block.pp-important-active { padding: 6px 8px; border-radius: 10px; }
  #pp-app .pp-important-block .pp-label { font-size: 10px; }
  #pp-app .pp-important-text,
  #pp-app .pp-inline-important { font-size: 13px; }
  #pp-app .pp-list-body { gap: 8px; }
  #pp-app .pp-list-pretre { font-size: 13px; }
  #pp-app .pp-list-pretre .pp-label { font-size: 12px; }
  #pp-app .pp-list-signups { gap: 6px; }
  #pp-app .pp-list-signups .pp-m-tile,
  #pp-app .pp-m-tile-remarques { padding: 6px 6px 8px 8px; border-radius: 12px; }
  #pp-app .pp-m-tile-head { min-height: 22px; gap: 4px; margin-bottom: 3px; }
  #pp-app .pp-m-tile .pp-label { font-size: 10.5px; letter-spacing: .04em; }
  #pp-app .pp-m-tile-badge { width: 22px; height: 22px; font-size: 14px; }
  #pp-app .pp-m-tile-badge .pp-i { font-size: 13px; }
  #pp-app .pp-m-tile .pp-tags-wrap { gap: 4px; }
  #pp-app .pp-m-tile .pp-tag { min-height: 24px; padding: 2px 8px; font-size: 13px; }
  #pp-app .pp-m-tile .pp-signup-box-hint,
  #pp-app .pp-m-tile-remarques .pp-remarques-text { font-size: 13px; }
  #pp-app .pp-list-attachments-toggle { min-height: 28px; padding: 4px 10px; font-size: 12.5px; }
  #pp-app .pp-list-item .pp-creator-actions { gap: 6px; margin-top: 10px; padding-top: 8px; }
  #pp-app .pp-creator-actions .pp-btn { min-height: 32px; padding: 4px 6px; font-size: 13px; }
}
@container (max-width: 190px) {
  #pp-app .pp-creator-action-label { display: none; }
}
@container (max-width: 240px) {
  #pp-app .pp-list-attachments-toggle .pp-att-label-long { display: none; }
  #pp-app .pp-list-attachments-toggle .pp-att-label-short { display: inline; }
  #pp-app .pp-list-pretre input.pp-inline-text { min-width: 0; }
  #pp-app textarea.pp-inline-important { font-size: 13px; }
}

/* Libellé court de la pastille Pièces jointes (2.45.2), affiché seulement
   dans une carte étroite (requête de conteneur ci-dessus). */
#pp-app .pp-att-label-short { display: none; }

/* Champ « Important » du gestionnaire (2.45.2) : zone de texte d'une ligne
   qui s'agrandit avec son contenu (voir buildImportantValueEl()). */
#pp-app textarea.pp-inline-important {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  font-family: inherit;
  box-sizing: border-box;
  field-sizing: content;
}

/* ---------- En-tête des fenêtres (2.45.3) ----------
   Toutes les fenêtres (sauf les petites boîtes de dialogue) : bouton
   « Retour » / « Annuler » à gauche, titre centré, action éventuelle
   (« Terminé », « Enregistrer ») à droite — sur téléphone comme sur
   ordinateur. Voir showModal() dans script.js. */
#pp-app .pp-modal .pp-modal-header {
  display: grid;
  grid-template-columns: 1fr fit-content(58%) 1fr;
  align-items: center;
  gap: 8px;
}
#pp-app .pp-modal .pp-modal-header h3 {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  padding: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
#pp-app .pp-modal .pp-modal-header-start { grid-column: 1; justify-self: start; display: flex; }
#pp-app .pp-modal .pp-modal-header-end { grid-column: 3; justify-self: end; display: flex; }
#pp-app .pp-modal-close-link { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
#pp-app .pp-modal-close-link .pp-i { font-size: 20px; margin-left: -4px; }
@media (max-width: 782px) {
  #pp-app .pp-modal .pp-modal-header h3 { font-size: 17px; }
}

/* ---------- Pastilles « sans chanteur / sans musicien » (2.45.4) ----------
   Boutons de filtre de la carte (alertBadge(), variante compacte) :
   inactif = contour (rouge / orange), actif = pastille pleine + halo.
   Même taille pour les deux ; plus petites dans une carte étroite. */
#pp-app button.pp-alert-dot,
#pp-app button.pp-alert-dot.pp-alert-strong,
#pp-app button.pp-alert-dot.pp-alert-light {
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  border: 2px solid currentColor;
  background: transparent;
  box-shadow: none;
}
#pp-app button.pp-alert-dot.pp-alert-strong { color: #dc2626; }
#pp-app button.pp-alert-dot.pp-alert-light { color: #d97706; }
#pp-app button.pp-alert-dot.pp-alert-strong.pp-alert-active {
  border-color: #dc2626;
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .18);
}
#pp-app button.pp-alert-dot.pp-alert-light.pp-alert-active {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .22);
}
#pp-app button.pp-alert-dot:hover { filter: none; background: rgba(148, 163, 184, .12); }
#pp-app button.pp-alert-dot.pp-alert-active:hover { filter: brightness(.95); }
html.pp-dark #pp-app button.pp-alert-dot.pp-alert-strong { color: #f87171; }
html.pp-dark #pp-app button.pp-alert-dot.pp-alert-light { color: #fbbf24; }
html.pp-dark #pp-app button.pp-alert-dot.pp-alert-strong.pp-alert-active { border-color: #dc2626; background: #dc2626; color: #ffffff; }
html.pp-dark #pp-app button.pp-alert-dot.pp-alert-light.pp-alert-active { border-color: #f59e0b; background: #f59e0b; color: #1f1300; }
html.pp-dark #pp-app button.pp-alert-dot.pp-alert-strong.pp-alert-active:hover,
html.pp-dark #pp-app button.pp-alert-dot.pp-alert-light.pp-alert-active:hover { filter: brightness(1.05); }
@container (max-width: 240px) {
  #pp-app button.pp-alert-dot,
  #pp-app button.pp-alert-dot.pp-alert-strong,
  #pp-app button.pp-alert-dot.pp-alert-light { width: 22px; height: 22px; }
  /* l'espacement entre pastilles est donné par le gap de la ligne */
  #pp-app .pp-list-item-head-top > button.pp-alert-dot { margin-right: 0; }
}

/* ---------- Raccourcis : flèches de défilement (2.45.5) ----------
   Voir renderGuideLink() / updateShortcutArrows() dans script.js. Téléphone
   uniquement : chaque flèche n'apparaît que s'il reste des tuiles hors de
   l'écran de ce côté, avec un léger fondu du bord correspondant. */
.pp-shortcuts { position: relative; }
.pp-shortcuts-arrow { display: none; }
@media (max-width: 782px) {
  .pp-shortcuts-arrow {
    position: absolute;
    top: calc(50% - 4px); /* centré sur les tuiles (marge basse de la rangée) */
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--pp-sc-line);
    border-radius: 50%;
    background: var(--pp-sc-surface);
    color: var(--pp-accent, #2563eb);
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.85);
    transition: opacity .18s ease, transform .18s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .pp-shortcuts-arrow-prev { left: -4px; }
  .pp-shortcuts-arrow-next { right: -4px; }
  .pp-shortcuts-arrow .pp-i { display: flex; }
  .pp-shortcuts.pp-sc-can-prev .pp-shortcuts-arrow-prev,
  .pp-shortcuts.pp-sc-can-next .pp-shortcuts-arrow-next {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
  }
  .pp-shortcuts-arrow:active { transform: translateY(-50%) scale(.92); }
  /* Fondu du bord où des tuiles sont cachées. */
  .pp-shortcuts.pp-sc-can-next .pp-shortcuts-track {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  }
  .pp-shortcuts.pp-sc-can-prev .pp-shortcuts-track {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent);
  }
  .pp-shortcuts.pp-sc-can-prev.pp-sc-can-next .pp-shortcuts-track {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  }
}
@media (max-width: 782px) and (prefers-reduced-motion: reduce) {
  .pp-shortcuts-arrow { transition: none; }
}
html.pp-dark .pp-shortcuts-arrow { color: #93c5fd; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }

/* ---------- Filtres : fenêtre détachée du bas (2.45.5, téléphone) ----------
   Voir openFilterSheet() dans script.js (options className /
   overlayClassName de showModal()). Marges tout autour et coins arrondis,
   au-dessus de la zone de sécurité basse (barre d'accueil iOS). */
@media (max-width: 782px) {
  #pp-app .pp-modal-overlay.pp-modal-overlay-filters {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  #pp-app .pp-modal.pp-modal-filters {
    max-height: calc(100% - 24px);
    padding-bottom: 20px;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .28);
  }
  #pp-app .pp-modal-filters .pp-fs-footer {
    bottom: -20px;
    margin-bottom: -20px;
    padding-bottom: 16px;
    border-radius: 0 0 24px 24px;
  }
  html.pp-dark #pp-app .pp-modal.pp-modal-filters {
    box-shadow: 0 12px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(148, 163, 184, .16);
  }
}
