/* Interface de Passy Live (la mise en page des slides est dans theme.css) */
:root {
  --bg: #f5f3f0; --carte: #fff; --bord: #e4e0da; --texte: #1d1b1a; --doux: #6b6560;
  --accent: #9E0E40; --accent-fonce: #7d0b33; --accent-clair: #fbeaf0; --jaune: #FFD400;
  --ok: #2e7d4f; --ok-clair: #e6f3ea; --alerte: #b3261e; --alerte-clair: #fdeceb;
  --r: 12px; --ombre: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 18px rgba(0, 0, 0, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--texte); background: var(--bg); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #e7a3bd; outline-offset: 2px; }
[hidden] { display: none !important; }
h1 { font-size: 26px; line-height: 1.2; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
p { margin: 0 0 10px; }
small, .doux { color: var(--doux); }

/* en-tête */
header.haut { background: #fff; border-bottom: 3px solid var(--jaune); position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 18px; padding: 8px 20px; }
header.haut .droite { display: flex; align-items: center; gap: 10px; justify-self: end; }
header.haut .logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; color: var(--accent); text-decoration: none; }
header.haut .logo svg { width: 26px; height: 26px; }
header.haut nav { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
header.haut nav a { padding: 7px 14px; border-radius: 20px; text-decoration: none; color: var(--texte); font-weight: 500; }
header.haut nav a:hover { background: var(--bg); }
header.haut nav a.actif { background: var(--accent-clair); color: var(--accent); }
header.haut .qui { color: var(--doux); font-size: 14px; }
header.haut form { margin: 0; }

main { width: 80%; max-width: none; margin: 0 auto; padding: 24px 0 90px; }
@media (max-width: 1000px) { main { width: 94%; } }
.entete-page { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.entete-page h1 { flex: 1; }

/* boutons et champs */
button, .btn { font: inherit; font-weight: 500; padding: 9px 16px; border: 1px solid var(--bord); background: #fff; color: var(--texte);
  border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .12s, border-color .12s, box-shadow .12s; min-height: 40px; }
button:hover, .btn:hover { background: #faf8f6; border-color: #cfc9c1; }
button.primaire, .btn.primaire { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primaire:hover, .btn.primaire:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
button.direct-btn { background: var(--jaune); border-color: #e6bd00; color: #3a2f00; }
button.direct-btn:hover { background: #ffdf33; }
button.discret { border-color: transparent; background: transparent; }
button.discret:hover { background: var(--bg); }
button.danger { color: var(--alerte); }
button.danger:hover { background: var(--alerte-clair); border-color: #f1b8b4; }
button.petit { padding: 4px 10px; min-height: 32px; font-size: 14px; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--bord); border-radius: 10px; background: #fff; max-width: 100%; min-height: 40px; color: var(--texte); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #f3c8d8; }
textarea { width: 100%; min-height: 120px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--doux); margin: 10px 0 4px; }
.champ-large { width: 100%; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--ombre); }
.carte > h2:first-child { margin-top: 0; }
.ligne { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ligne .souple { flex: 1; min-width: 180px; }
.msg { background: #fff8dc; border: 1px solid #ecd978; padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; }
.erreur { color: var(--alerte); }

.pastille { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: #efece8; color: var(--doux); }
.pastille.pret { background: var(--ok-clair); color: var(--ok); }
.pastille.brouillon { background: #fff3d1; color: #7a5b00; }
.pastille.direct { background: var(--accent); color: #fff; }
.pastille.direct::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* connexion */
.connexion { max-width: 400px; margin: 10vh auto 0; }
.connexion .marque { text-align: center; margin-bottom: 18px; }
.connexion .marque svg { width: 64px; height: 64px; }
.connexion .marque h1 { color: var(--accent); margin-top: 6px; }
.connexion .marque p { color: var(--doux); }
.connexion input { width: 100%; }
.connexion button { width: 100%; margin-top: 16px; min-height: 46px; font-size: 17px; }

/* liste des cultes */
.filtres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filtres button { border-radius: 20px; padding: 5px 14px; min-height: 34px; }
.filtres button.actif { background: var(--accent-clair); border-color: #e9b4c8; color: var(--accent); }
.culte { display: flex; align-items: center; gap: 16px; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r);
  padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--ombre); }
.culte.en-direct { border-color: var(--accent); box-shadow: 0 0 0 2px #f3c8d8, var(--ombre); }
.culte .date { width: 58px; text-align: center; flex: none; line-height: 1.1; }
.culte .date b { display: block; font-size: 26px; color: var(--accent); }
.culte .date span { font-size: 12px; text-transform: uppercase; color: var(--doux); letter-spacing: .5px; }
.culte .corps { flex: 1; min-width: 0; }
.culte .corps a.titre { font-weight: 600; font-size: 18px; text-decoration: none; color: var(--texte); display: block; overflow: hidden; text-overflow: ellipsis; }
.culte .corps a.titre:hover { color: var(--accent); }
.culte .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.vide-etat { text-align: center; padding: 50px 20px; color: var(--doux); }
.vide-etat .gros { font-size: 18px; color: var(--texte); margin-bottom: 6px; }

/* éditeur */
.topbar { position: sticky; top: 56px; z-index: 15; background: var(--bg); padding: 10px 0 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar .retour { text-decoration: none; font-weight: 500; white-space: nowrap; }
.topbar .titre-input { flex: 1; min-width: 200px; font-size: 20px; font-weight: 600; border-color: transparent; background: transparent; padding-left: 6px; }
.topbar .titre-input:hover { border-color: var(--bord); background: #fff; }
.topbar .titre-input:focus { background: #fff; }
.etat { font-size: 14px; color: var(--doux); min-width: 130px; text-align: right; }
.etat.sale { color: #9a6a00; font-weight: 600; }
.etat.ok { color: var(--ok); font-weight: 600; }
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu .menu-liste { position: absolute; right: 0; top: 46px; background: #fff; border: 1px solid var(--bord); border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: 6px; min-width: 210px; z-index: 30; display: grid; }
details.menu .menu-liste button, details.menu .menu-liste a { border: 0; justify-content: flex-start; background: transparent; }
details.menu .menu-liste button:hover, details.menu .menu-liste a:hover { background: var(--bg); }
.meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.meta > div { min-width: 170px; }
.meta label { margin-top: 0; }

.onglets { display: none; gap: 6px; margin-bottom: 12px; }
.onglets button { flex: 1; }
.onglets button.actif { background: var(--accent-clair); border-color: #e9b4c8; color: var(--accent); }
.editeur { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.editeur .col-apercu { position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow: auto; padding-right: 4px; }
@media (max-width: 960px) {
  .editeur { grid-template-columns: 1fr; }
  .editeur .col-apercu { position: static; max-height: none; }
  .onglets { display: flex; }
  .editeur:not(.vue-apercu) .col-apercu { display: none; }
  .editeur.vue-apercu .col-contenu { display: none; }
  .topbar { top: 0; position: static; }
  header.haut { position: static; }
}

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tuile { flex-direction: column; padding: 12px 8px; gap: 2px; border-style: dashed; background: #fff; }
.tuile .ico { font-size: 22px; line-height: 1; color: var(--accent); }
.tuile.principal { border: 2px solid var(--accent); border-style: solid; background: var(--accent-clair); }
.element { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; background: #fff; border: 1px solid var(--bord);
  border-left: 5px solid var(--accent); border-radius: var(--r); padding: 12px 12px 12px 10px; margin-bottom: 10px; box-shadow: var(--ombre); }
.element.t-texte { border-left-color: #2b6cb0; } .element.t-section { border-left-color: #b7791f; }
.element.t-vide { border-left-color: #a0a0a0; } .element.t-annonces { border-left-color: #2e7d4f; }
.element .num { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); color: var(--doux); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.el-tete { display: flex; gap: 4px; align-items: center; }
.el-tete .type { flex: 1; min-width: 0; font-weight: 600; }
.el-tete .genre { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--doux); font-weight: 600; }
.el-tete button { padding: 0; width: 34px; min-height: 34px; }
.couplets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.couplets label { display: inline-flex; gap: 6px; margin: 0; padding: 5px 12px; border: 1px solid var(--bord); border-radius: 20px; color: var(--texte);
  font-weight: 500; font-size: 14px; cursor: pointer; align-items: center; background: #fff; }
.couplets label:has(input:checked) { background: var(--accent-clair); border-color: #e9b4c8; color: var(--accent); }
.couplets input { accent-color: var(--accent); width: 15px; height: 15px; min-height: 0; margin: 0; }
.option { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--texte); margin-top: 8px; }
.option input { accent-color: var(--accent); width: 17px; height: 17px; min-height: 0; }

/* recherche de cantique */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(30, 20, 25, .45); }
.dlg-tete { padding: 16px 16px 10px; border-bottom: 1px solid var(--bord); }
.dlg-tete .ligne { align-items: center; margin-top: 8px; }
.dlg-tete input { flex: 1; min-width: 0; font-size: 18px; min-height: 48px; }
.resultats { max-height: min(55vh, 480px); overflow: auto; }
.resultats button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--bord);
  border-radius: 0; padding: 11px 18px; background: #fff; gap: 0; }
.resultats button:hover, .resultats button:focus { background: var(--accent-clair); outline: none; }
.resultats button b { font-weight: 600; }
.resultats small { font-size: 13px; }
.resultats .aucun { padding: 26px; text-align: center; color: var(--doux); }
.dlg-pied { padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; color: var(--doux); font-size: 13px; }

/* aperçu */
.grand { margin-bottom: 12px; box-shadow: var(--ombre); border-radius: 8px; }
.apercu { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.apercu .cell { cursor: pointer; border-radius: 8px; padding: 3px; border: 2px solid transparent; }
.apercu .cell:hover { background: #fff; }
.apercu .cell.choisie { border-color: var(--accent); background: #fff; }
.apercu .num { font-size: 12px; color: var(--doux); margin-bottom: 2px; }
.apercu .alerte { color: var(--alerte); font-size: 12px; font-weight: 600; }
.vignette { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; border: 1px solid var(--bord); border-radius: 6px; }
.compte { font-weight: 400; color: var(--doux); font-size: 14px; }
.avert { color: var(--alerte); font-weight: 600; }

.annonce-item { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--bord); padding: 8px 0; }
.annonce-item img { width: 74px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--bg); flex: none; }
.annonce-choix { border: 1px solid var(--bord); border-radius: 10px; padding: 8px 12px; margin-top: 10px; background: #fcfbfa; }
.annonce-choix label { display: flex; gap: 10px; align-items: center; color: var(--texte); font-weight: 500; margin: 0; }
.annonce-choix input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }

/* régie */
.regie { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .regie { grid-template-columns: 1fr; } }
.regie .liste { max-height: 74vh; overflow: auto; display: grid; gap: 10px; padding: 4px; }
.regie .liste .vignette { cursor: pointer; }
.regie .liste .vignette:hover { border-color: var(--accent); }
.regie .liste .courante { outline: 4px solid var(--accent); }
.gros-boutons { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; margin: 14px 0; }
.gros-boutons button { padding: 20px 10px; font-size: 20px; min-height: 66px; }
.gros-boutons button.actif { background: #333; color: #fff; border-color: #333; }
.position { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.aide { color: var(--doux); font-size: 14px; }
.badge-noir { background: #222; color: #fff; padding: 2px 10px; border-radius: 6px; font-size: 14px; margin-left: 8px; }

/* administration */
.grille-admin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .grille-admin { grid-template-columns: 1fr; } }
table { border-collapse: collapse; width: 100%; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--doux); text-align: left; }
th, td { border-bottom: 1px solid var(--bord); padding: 10px 8px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.lien-copie { display: flex; gap: 6px; margin: 4px 0 10px; }
.lien-copie input { flex: 1; min-width: 0; font-family: Consolas, monospace; font-size: 13px; background: #faf8f6; }

/* notifications */
#toasts { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: #2b2523; color: #fff; padding: 10px 18px; border-radius: 24px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-weight: 500; animation: monte .2s; }
.toast.erreur { background: var(--alerte); color: #fff; }
.toast.ok { background: var(--ok); }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } }

/* page d'affichage et impression */
body.plein { margin: 0; background: #fff; overflow: hidden; cursor: none; }
body.plein .vignette { border: 0; border-radius: 0; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; }
.page-slide { margin-bottom: 14px; }
.page-slide .vignette { width: min(100%, 960px); }
@media print {
  @page { size: 297mm 167mm; margin: 0; }
  body { background: #fff; }
  .no-print { display: none !important; }
  .page-slide { page-break-after: always; break-after: page; margin: 0; }
  .page-slide .vignette { border: 0; border-radius: 0; width: 297mm; height: 167mm; aspect-ratio: auto; }
  main { padding: 0; max-width: none; }
}
@media (max-width: 640px) {
  main { padding: 14px 0 90px; }
  header.haut { padding: 8px 12px; grid-template-columns: 1fr auto; }
  header.haut nav { grid-column: 1 / -1; grid-row: 2; }
  .culte { flex-wrap: wrap; }
  .culte .actions { width: 100%; }
  .etat { display: none; }
  .gros-boutons button { font-size: 16px; padding: 14px 6px; }
}
@media (max-width: 640px) {
  header.haut .qui { display: none; }
  header.haut .logo { font-size: 17px; }
  header.haut nav a { padding: 6px 10px; }
}

.dlg-titre { display: flex; align-items: center; justify-content: space-between; }
.dlg-titre button { width: 36px; min-height: 36px; padding: 0; font-size: 18px; }
.element.t-ouverture { border-left-color: var(--jaune); background: #fffdf2; cursor: pointer; }
.element.t-ouverture .verrou { font-size: 12px; color: var(--doux); font-weight: 600; }
.element.t-ouverture .ouv-titre { font-size: 18px; font-weight: 600; color: var(--accent); }
.select-court { min-width: 0; width: auto; }
header.haut .droite { white-space: nowrap; }
header.haut .qui { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }

.barre-riche { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.barre-riche button { min-width: 40px; padding: 4px 10px; min-height: 36px; }
.riche { min-height: 120px; border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; }
.riche:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #f3c8d8; }
.riche:empty::before { content: attr(data-placeholder); color: #9a948e; }
.riche ul, .riche ol { margin: .3em 0; padding-left: 1.4em; }

/* éditeur : barre du haut, titre avec crayon, interrupteur de statut */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.topbar .retour-gros { justify-self: start; font-size: 17px; font-weight: 600; min-height: 48px; padding: 10px 20px; border: 2px solid var(--accent);
  color: var(--accent); background: #fff; }
.topbar .retour-gros:hover { background: var(--accent-clair); }
.topbar .direct-btn { justify-self: end; min-height: 48px; font-size: 16px; }
.topbar .direct-btn.desactive { opacity: .5; cursor: not-allowed; }
.titre-zone { text-align: center; min-width: 0; }
.titre-vue { display: flex; align-items: center; justify-content: center; gap: 4px; }
.titre-affiche { font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; color: var(--texte); }
.crayon { font-size: 20px; width: 40px; padding: 0; color: var(--accent); }
.titre-edition { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.titre-edition input { font-size: 20px; font-weight: 600; min-width: 280px; flex: 1; max-width: 520px; }
.meta { align-items: flex-end; }
.meta .menu { margin-left: auto; }
.meta .etat { align-self: center; text-align: left; min-width: 150px; }
.etat.alerte { color: var(--alerte); font-weight: 600; }
.statut { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.statut .st { font-weight: 600; color: #9a948e; }
.statut .st.actif { color: var(--texte); }
#st-pret.actif { color: var(--ok); }
.interrupteur { width: 60px; min-height: 32px; height: 32px; padding: 0; border-radius: 20px; background: #e0b94a; border: 0; position: relative; flex: none; }
.interrupteur:hover { background: #d4ab38; }
.interrupteur .rond { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.interrupteur.on { background: var(--ok); }
.interrupteur.on:hover { background: #256a40; }
.interrupteur.on .rond { left: 31px; }
.element.t-fin .num { background: var(--jaune); color: #3a2f00; }
#carte-fin { cursor: default; margin-top: 10px; }
@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr; }
  .topbar .retour-gros, .topbar .direct-btn { justify-self: stretch; }
  .titre-affiche { max-width: 70vw; }
}

/* thème (couleurs) */
.theme-menu summary { min-height: 38px; padding: 6px 14px; }
.theme-menu .menu-liste { right: auto; left: 50%; transform: translateX(-50%); min-width: 220px; max-height: 70vh; overflow: auto; }
.theme-menu.verrouille summary { opacity: .45; pointer-events: none; }
.pastille-theme { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 2px solid rgba(0,0,0,.15); flex: none; }
.theme-choix { justify-content: flex-start !important; border: 0 !important; background: transparent; width: 100%; }
.theme-choix.actif { background: var(--accent-clair); font-weight: 600; }
.theme-choix:hover { background: var(--bg); }

/* glisser-déposer */
.poignee { cursor: grab; width: 30px; padding: 0; font-size: 20px; color: var(--doux); flex: none; }
.poignee:active { cursor: grabbing; }
.element.glisse, .annonce-item.glisse { opacity: .45; }
.element.cible { box-shadow: 0 -4px 0 var(--accent), var(--ombre); }
.annonce-item.cible { box-shadow: 0 -3px 0 var(--accent); }

/* fenêtre de choix des annonces : damier */
dialog.large { width: min(1000px, calc(100vw - 24px)); }
.damier { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding: 14px 16px; max-height: min(62vh, 640px); overflow: auto; }
.damier .aucun { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--doux); }
.annonce-carte { position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 4px; padding: 8px 8px 10px;
  border: 2px solid var(--bord); border-radius: 12px; background: #fff; min-height: 0; }
.annonce-carte img, .annonce-carte .sans-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: var(--bg);
  display: grid; place-items: center; color: var(--doux); font-size: 13px; }
.annonce-carte b { font-size: 15px; line-height: 1.25; }
.annonce-carte small { font-size: 13px; }
.annonce-carte .rang { position: absolute; top: 14px; right: 14px; min-width: 32px; height: 32px; border-radius: 16px; background: var(--accent); color: #fff;
  font-weight: 700; display: none; place-items: center; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.annonce-carte.choisie { border-color: var(--accent); box-shadow: 0 0 0 3px #f3c8d8; background: var(--accent-clair); }
.annonce-carte.choisie .rang { display: grid; }
.annonce-carte:not(.choisie):hover { border-color: #cfc9c1; }
.dlg-tete small { display: block; margin-top: 4px; }

/* texte libre : modes éditeur / Markdown / HTML */
.modes { display: inline-flex; border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; margin: 4px 0 6px; }
.modes .mode { border: 0; border-radius: 0; min-height: 34px; padding: 4px 14px; background: #fff; }
.modes .mode.actif { background: var(--accent); color: #fff; }
textarea.source { font-family: Consolas, "Courier New", monospace; font-size: 14px; min-height: 180px; }
.topbar .retour-gros, .topbar .direct-btn { white-space: nowrap; }
.theme-menu summary { white-space: nowrap; }
.titre-affiche { max-width: 52vw; }

/* régie : les miniatures gardent leur format 16/9 (sinon la grille les écrase dans une liste à hauteur limitée) */
.regie .liste { grid-auto-rows: max-content; align-content: start; }
.regie .liste .vignette { width: 100%; flex: none; }

/* fenêtre « Nouveau culte » */
#dlg-nouveau { width: min(640px, calc(100vw - 24px)); }
.dlg-corps { padding: 6px 18px 14px; max-height: min(70vh, 680px); overflow: auto; }
.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.carte-choix { display: flex; gap: 10px; align-items: center; border: 2px solid var(--bord); border-radius: 12px; padding: 12px; margin: 0;
  cursor: pointer; background: #fff; color: var(--texte); font-size: 16px; font-weight: 500; }
.carte-choix input { accent-color: var(--accent); width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
.carte-choix span { display: flex; flex-direction: column; gap: 2px; }
.carte-choix small { font-weight: 400; }
.carte-choix:has(input:checked) { border-color: var(--accent); background: var(--accent-clair); }
.carte-choix.centre { flex-direction: column; text-align: center; padding: 12px 8px; }
.carte-choix.centre input { position: absolute; opacity: 0; }
.carte-choix.centre span { align-items: center; }
.gros-emoji { font-size: 38px; line-height: 1.1; }
.choix-theme { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-radio { display: inline-flex; gap: 6px; align-items: center; margin: 0; padding: 5px 12px; border: 2px solid var(--bord); border-radius: 20px; cursor: pointer;
  color: var(--texte); font-weight: 500; font-size: 14px; background: #fff; }
.theme-radio input { position: absolute; opacity: 0; width: 0; min-height: 0; }
.theme-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-clair); }
.theme-radio:has(input:focus-visible) { outline: 3px solid #e7a3bd; }
.emoji-decor { font-size: 20px; width: 24px; text-align: center; }
#dlg-nouveau .dlg-pied { border-top: 1px solid var(--bord); }

.crayon-petit { color: var(--accent); font-size: 18px; }

.regie .liste.lecture .vignette { cursor: default; }
.regie .liste.lecture .vignette:hover { border-color: var(--bord); }

/* pagination, filtres en liens, règles de mot de passe */
.filtres .puce { border: 1px solid var(--bord); background: #fff; border-radius: 20px; padding: 5px 14px; text-decoration: none; color: var(--texte); font-weight: 500; }
.filtres .puce:hover { background: #faf8f6; }
.filtres .puce.actif { background: var(--accent-clair); border-color: #e9b4c8; color: var(--accent); }
.pagination { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.btn.desactive { opacity: .45; pointer-events: none; }
.regles { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; color: var(--doux); }
.regles li.ok { color: var(--ok); font-weight: 600; }
header.haut a.qui { text-decoration: none; color: var(--doux); }
header.haut a.qui:hover { color: var(--accent); text-decoration: underline; }

.historique { display: flex; gap: 2px; align-self: center; }
.historique button { min-height: 38px; padding: 4px 12px; }

.meta .historique { margin-left: auto; }
.meta .historique + .menu { margin-left: 4px; }

/* annuler / rétablir : même hauteur et même ligne que « Plus », flèches bien visibles */
.meta .historique { align-self: flex-end; gap: 8px; }
.meta .historique button { min-height: 44px; padding: 6px 18px; font-size: 17px; font-weight: 600; }
.meta .menu summary { min-height: 44px; font-size: 17px; }
.historique .fleche { font-size: 30px; line-height: 1; }
