/* Cantiques — l'image de départ est le tableau des cantiques d'une salle de culte : des cartes
   à gros chiffres glissées sur un panneau. Le numéro d'un chant est donc toujours une carte ;
   le programme du jour est le panneau. Autour : la toile verte d'une reliure, un peu de dorure,
   et un ruban de couleur par recueil. Aucune police ni ressource externe :
   l'app doit s'ouvrir vite et sans réseau. */

/* La couleur de l'app (reliure) : chaque teinte donne ses valeurs claires (c-) et sombres (s-). */
:root, [data-couleur="vert"] {
  --c-toile: #1d3a32; --c-ombre: #152c26; --c-papier: #eef1ec; --c-trait: #d6dbd3;
  --s-toile: #14271f; --s-ombre: #0f1e18; --s-papier: #0d1311; --s-feuille: #141c19; --s-trait: #2a3631;
}
[data-couleur="bleu"] {
  --c-toile: #1c2f52; --c-ombre: #142340; --c-papier: #edf0f4; --c-trait: #d4d9e0;
  --s-toile: #152238; --s-ombre: #0e1828; --s-papier: #0c1016; --s-feuille: #141a22; --s-trait: #29323f;
}
[data-couleur="bordeaux"] {
  --c-toile: #4d1f29; --c-ombre: #3a161e; --c-papier: #f3eeec; --c-trait: #e0d6d3;
  --s-toile: #33171d; --s-ombre: #251015; --s-papier: #130e0f; --s-feuille: #1c1517; --s-trait: #3a2b2e;
}
[data-couleur="ardoise"] {
  --c-toile: #2e353b; --c-ombre: #22282d; --c-papier: #eff0f0; --c-trait: #d8dadb;
  --s-toile: #1f2428; --s-ombre: #171b1e; --s-papier: #0f1112; --s-feuille: #17191b; --s-trait: #2f3437;
}

:root {
  --papier: var(--c-papier);
  --feuille: #fcfcf9;
  --encre: #16211c;
  --doux: #57635c;
  --trait: var(--c-trait);
  --toile: var(--c-toile);            /* reliure */
  --toile-ombre: var(--c-ombre);
  --sur-toile: #f3f1e6;
  --or: #b88a2e;               /* dorure : ce qui est choisi, ce qui a le focus */
  --or-texte: #7d5a0c;
  /* les rubans des recueils */
  --r-rouge: #a8322d; --r-bleu: #2b5a94; --r-violet: #6d4a8f; --r-vert: #2f7a4d; --r-ocre: #a86a12; --r-turquoise: #1f7f86;
  --r-rose: #b23f72; --r-gris: #6b736e;
  --carte-fond: #16211c;
  --carte-texte: #f6f4ea;
  --marque: #f4e2a2;
  --alerte: #7d5a0c;
  --alerte-fond: #f8eecd;
  --danger: #a8322d;
  --champ: var(--feuille); --champ-texte: var(--encre); --champ-doux: var(--doux);     /* la case de recherche */
  --chiffres: "Avenir Next Condensed", "Bahnschrift", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", sans-serif-condensed, sans-serif;
  --texte: "Iowan Old Style", "Charter", "Sitka Text", "Cambria", "Noto Serif", Georgia, serif;
  --interface: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --taille-paroles: 1.1875rem;
  color-scheme: light dark;
}
/* Sombre : quand l'appareil le demande, ou quand on l'a choisi dans Apparence. Les deux blocs sont identiques. */
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="clair"]) {
    --papier: var(--s-papier); --feuille: var(--s-feuille); --encre: #e6eae3; --doux: #9ba8a0; --trait: var(--s-trait);
    --toile: var(--s-toile); --toile-ombre: var(--s-ombre); --or: #d3ab55; --or-texte: #e0bd6e;
    --r-rouge: #e37e77; --r-bleu: #86aee3; --r-violet: #bb9ddb; --r-vert: #7fc79a; --r-ocre: #e0aa57; --r-turquoise: #6fc6cc;
    --r-rose: #e58bb3; --r-gris: #a7b0aa;
    --carte-fond: #ece9dd; --carte-texte: #16211c; --marque: #5e4c12; --alerte: #ecc971; --alerte-fond: #2f270e; --danger: #ef8d86;
    --champ: color-mix(in srgb, var(--sur-toile) 13%, var(--s-toile)); --champ-texte: var(--sur-toile);
    --champ-doux: color-mix(in srgb, var(--sur-toile) 60%, transparent);
  }
}
:root[data-mode="sombre"] {
    --papier: var(--s-papier); --feuille: var(--s-feuille); --encre: #e6eae3; --doux: #9ba8a0; --trait: var(--s-trait);
    --toile: var(--s-toile); --toile-ombre: var(--s-ombre); --or: #d3ab55; --or-texte: #e0bd6e;
    --r-rouge: #e37e77; --r-bleu: #86aee3; --r-violet: #bb9ddb; --r-vert: #7fc79a; --r-ocre: #e0aa57; --r-turquoise: #6fc6cc;
    --r-rose: #e58bb3; --r-gris: #a7b0aa;
    --carte-fond: #ece9dd; --carte-texte: #16211c; --marque: #5e4c12; --alerte: #ecc971; --alerte-fond: #2f270e; --danger: #ef8d86;
    --champ: color-mix(in srgb, var(--sur-toile) 13%, var(--s-toile)); --champ-texte: var(--sur-toile);
    --champ-doux: color-mix(in srgb, var(--sur-toile) 60%, transparent);
  color-scheme: dark;
}
:root[data-mode="clair"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 1rem/1.45 var(--interface); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }
[data-ruban="rouge"] { --ruban: var(--r-rouge); }
[data-ruban="bleu"] { --ruban: var(--r-bleu); }
[data-ruban="violet"] { --ruban: var(--r-violet); }
[data-ruban="vert"] { --ruban: var(--r-vert); }
[data-ruban="ocre"] { --ruban: var(--r-ocre); }
[data-ruban="turquoise"] { --ruban: var(--r-turquoise); }
[data-ruban="rose"] { --ruban: var(--r-rose); }
[data-ruban="gris"] { --ruban: var(--r-gris); }

/* ------------------------------------------------------------ la carte du numéro */
.carte { display: inline-flex; align-items: baseline; justify-content: center; gap: .1em; min-width: 3.9rem;
  padding: .2rem .5rem .14rem .4rem; border-left: .3rem solid var(--ruban, var(--or)); border-radius: 2px;
  background: var(--carte-fond); color: var(--carte-texte); white-space: nowrap;
  font: 700 1.1875rem/1.25 var(--chiffres); font-stretch: condensed; font-variant-numeric: lining-nums tabular-nums; }
.carte .lettre { font-weight: 500; opacity: .72; margin-right: .14em; }
.carte .bis { font-size: .58em; font-weight: 600; margin-left: .2em; }

/* ------------------------------------------------------------ structure */
.app { min-height: 100dvh; }
.volet-liste { background: var(--feuille); min-height: 100dvh; }
.volet-chant { min-height: 100dvh; background: var(--feuille); outline: none; }
body[data-vue="liste"] .volet-chant { display: none; }
body[data-vue="chant"] .volet-liste { display: none; }
body.ferme .volet-liste { display: none !important; }
body.ferme .app { display: block; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: minmax(340px, 410px) 1fr; height: 100dvh; }
  .volet-liste, .volet-chant { min-height: 0; height: 100dvh; overflow-y: auto; }
  .volet-liste { border-right: 1px solid var(--trait); }
  .volet-chant { background: var(--papier); }
  body[data-vue] .volet-liste, body[data-vue] .volet-chant { display: block; }
  .retour { display: none !important; }
}

/* ------------------------------------------------------------ en-tête, recherche, filtres */
.entete, .menu, .hors-ligne, .recherche, .filtres { background: var(--toile); color: var(--sur-toile); padding-inline: 1rem; }
.entete { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-top: max(.875rem, env(safe-area-inset-top)); padding-bottom: .25rem; }
.marque { font: 600 1.4375rem/1.2 var(--texte); letter-spacing: .005em; text-decoration: none; }
.raccourcis { display: flex; align-items: baseline; gap: 1.1rem; font-size: .9375rem; }
.raccourcis a, .raccourcis button { background: none; border: 0; padding: .3rem 0; text-decoration: none; white-space: nowrap; }
.raccourcis a:hover, .raccourcis button:hover { text-decoration: underline; text-underline-offset: 4px; }
.raccourcis button[aria-expanded="true"] { text-decoration: underline; text-decoration-color: var(--or); text-underline-offset: 4px; }
.pastille { display: inline-block; min-width: 1.35em; margin-left: .35em; padding: 0 .35em; border-radius: 2px;
  background: var(--sur-toile); color: var(--toile); text-align: center; font: 700 .875em/1.35 var(--chiffres); }
.menu { display: grid; gap: .1rem; padding-block: .4rem .6rem; background: var(--toile-ombre); font-size: .9375rem; }
.menu a, .menu button { justify-self: start; background: none; border: 0; padding: .4rem 0; text-align: left;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
.menu p { margin: .35rem 0 0; max-width: 34rem; font-size: .875rem; opacity: .8; }
.menu .menu-eglise { margin: .3rem 0 .2rem; font: 600 1.0625rem/1.3 var(--texte); opacity: 1; }
.menu select { margin: .3rem 0; }
.hors-ligne { margin: 0; padding-block: .45rem; background: var(--or); color: #1c1503; font-size: .875rem; font-weight: 600; }
.recherche { position: sticky; top: 0; z-index: 3; padding-block: .5rem; }
.recherche input { width: 100%; padding: .72rem .875rem; border: 0; border-radius: 4px; background: var(--champ);
  color: var(--champ-texte); font-size: 1.0625rem; }
.recherche input::placeholder { color: var(--champ-doux); }
.recherche input:focus-visible { outline-offset: 1px; }
.filtres { display: grid; gap: .45rem; padding-bottom: .8rem; }
.filtres-bas { display: grid; grid-template-columns: 1fr auto; gap: .45rem; }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: 1px; padding: 1px; border-radius: 4px;
  background: color-mix(in srgb, var(--sur-toile) 30%, transparent); overflow-x: auto; scrollbar-width: none; }
.segments button { min-width: 2.9rem; padding: .42rem .5rem; border: 0; border-radius: 3px; background: var(--toile);
  color: var(--sur-toile); font-weight: 600; font-size: .9375rem; }
.segments button[aria-pressed="true"] { background: var(--sur-toile); color: var(--toile); }
.segments.sur-feuille { max-width: 26rem; background: var(--trait); }
.segments.sur-feuille button { background: var(--feuille); color: var(--encre); }
.segments.sur-feuille button[aria-pressed="true"] { background: var(--toile); color: var(--sur-toile); }
.filtres select, .menu select { width: 100%; min-width: 0; padding: .42rem .5rem; border-radius: 4px; font-size: .9375rem;
  border: 1px solid color-mix(in srgb, var(--sur-toile) 30%, transparent); background: var(--toile); color: var(--sur-toile); }

/* ------------------------------------------------------------ liste */
.compte { margin: 0; padding: .6rem 1rem; color: var(--doux); font-size: .875rem; border-bottom: 1px solid var(--trait); }
.lettres { display: flex; flex-wrap: wrap; gap: .15rem; padding: .5rem .75rem; border-bottom: 1px solid var(--trait); }
.lettres button { min-width: 2rem; padding: .25rem .4rem; border: 0; border-radius: 3px; background: none;
  font: 600 1rem/1.3 var(--chiffres); font-stretch: condensed; color: var(--doux); }
.lettres button:hover { color: var(--encre); background: var(--papier); }
.lettres button[aria-pressed="true"] { background: var(--encre); color: var(--feuille); }
.resultats { list-style: none; margin: 0; padding: 0; }
.resultats a { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start;
  padding: .68rem 1rem .68rem .7rem; text-decoration: none; border-bottom: 1px solid var(--trait); border-left: .3rem solid transparent; }
.resultats a:hover { background: var(--papier); }
.resultats a[aria-current="true"] { background: color-mix(in srgb, var(--or) 14%, var(--feuille)); border-left-color: var(--or); }
.resultats .titre { font: 1.0625rem/1.35 var(--texte); overflow-wrap: anywhere; }
.resultats .extrait { display: block; margin-top: .15rem; color: var(--doux); font: italic .9375rem/1.35 var(--texte); }
.ton { color: var(--doux); font-size: .875rem; white-space: nowrap; padding-top: .2rem; }
.signal { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 2px; background: var(--alerte-fond);
  color: var(--alerte); font: 600 .75rem/1.5 var(--interface); vertical-align: .1em; }
mark { background: var(--marque); color: inherit; border-radius: 2px; padding: 0 .05em; }
.vide { padding: 1.5rem 1rem; color: var(--doux); }
.vide strong { color: var(--encre); display: block; margin-bottom: .25rem; }
.suite { display: block; width: calc(100% - 2rem); margin: 1rem; padding: .7rem; border: 1px solid var(--trait);
  border-radius: 4px; background: transparent; font-weight: 600; }

/* ------------------------------------------------------------ feuille, barre, boutons */
.feuille { max-width: 45rem; margin: 0 auto; padding: 0 1.25rem 4rem; background: var(--feuille); min-height: 100%; }
.feuille:has(.regie) { max-width: 72rem; }
@media (min-width: 900px) { .feuille { padding: 0 3rem 5rem; border-inline: 1px solid var(--trait); } }
.barre { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin: 0 -1.25rem; padding: max(.5rem, env(safe-area-inset-top)) 1.25rem .5rem; background: var(--feuille);
  border-bottom: 1px solid var(--trait); }
@media (min-width: 900px) { .barre { margin: 0 -3rem; padding-inline: 3rem; } }
.espace { flex: 1; }
.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: .4rem .85rem;
  border: 1px solid var(--trait); border-radius: 4px; background: var(--feuille); color: var(--encre);
  text-decoration: none; font-size: .9375rem; font-weight: 600; }
.bouton:hover { border-color: var(--doux); }
.bouton.plein { background: var(--toile); border-color: var(--toile); color: var(--sur-toile); }
.bouton.plein:hover { background: var(--toile-ombre); }
.bouton.actif, .bouton[aria-pressed="true"] { border-color: var(--or); background: color-mix(in srgb, var(--or) 16%, var(--feuille)); }
.bouton.danger { color: var(--danger); }
.bouton[disabled] { opacity: .45; cursor: default; }
.paire { display: inline-flex; }
.paire .bouton:first-child { border-radius: 4px 0 0 4px; }
.paire .bouton:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.note { margin: .75rem 0 0; max-width: 36rem; color: var(--doux); font-size: .9375rem; }
.gestes { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.nb { color: var(--doux); font-size: .9375rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ accueil */
.accueil { padding-top: 2.75rem; }
.accueil h1 { margin: 0 0 .75rem; font: 600 2.625rem/1.1 var(--texte); letter-spacing: -.01em; }
.chapeau { max-width: 35rem; margin: 0; color: var(--doux); font: 1.125rem/1.5 var(--texte); }
.bloc { margin-top: 2.75rem; }
.bloc h2 { margin: 0 0 .875rem; font: 600 1.3125rem/1.25 var(--texte); }

/* le panneau : le programme du jour */
.tableau { list-style: none; margin: 0; padding: .5rem; display: grid; background: var(--toile); border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--toile-ombre), inset 0 2px 6px rgba(0, 0, 0, .25); }
.tableau li { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.tableau li + li { border-top: 1px solid color-mix(in srgb, var(--sur-toile) 12%, transparent); }
.tableau a { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center;
  padding: .4rem .5rem .4rem .25rem; border-radius: 3px; color: var(--sur-toile); text-decoration: none; }
.tableau a:hover { background: color-mix(in srgb, var(--sur-toile) 8%, transparent); }
.tableau .carte { --carte-fond: #f3f1e6; --carte-texte: #16211c; min-width: 5.4rem; font-size: 1.625rem; }
.tableau-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 1.0625rem/1.3 var(--texte); }
.tableau-titre small { display: block; overflow: hidden; text-overflow: ellipsis; opacity: .65; font: .8125rem/1.3 var(--interface); }
.tableau .ton { color: color-mix(in srgb, var(--sur-toile) 65%, transparent); padding: 0; }
.tableau-absent { flex: 1; padding: .6rem .5rem; color: color-mix(in srgb, var(--sur-toile) 65%, transparent); }
.tableau-gestes { display: flex; gap: .25rem; padding-right: .25rem; }
.tableau-gestes button { min-width: 2.25rem; min-height: 2.25rem; padding: .2rem .5rem; border-radius: 3px; background: none;
  border: 1px solid color-mix(in srgb, var(--sur-toile) 28%, transparent); color: var(--sur-toile); font-size: .875rem; }
.tableau-gestes button:hover { background: color-mix(in srgb, var(--sur-toile) 12%, transparent); }
.tableau-gestes button[disabled] { opacity: .3; cursor: default; }
@media (max-width: 520px) { .tableau .ton { display: none; } .tableau .carte { min-width: 4.6rem; font-size: 1.375rem; } }

.themes { list-style: none; margin: 0; padding: 0; columns: 2 15rem; column-gap: 2.5rem; }
.themes li { break-inside: avoid; }
.themes button, .rayons button, .liste-programmes button { width: 100%; display: flex; align-items: baseline; gap: .75rem;
  padding: .5rem 0; border: 0; border-bottom: 1px solid var(--trait); background: none; text-align: left; }
.themes button span:first-child { flex: 1; font: 1.0625rem/1.3 var(--texte); }
.themes button:hover span:first-child, .rayons button:hover strong, .liste-programmes button:hover span:first-child {
  text-decoration: underline; text-decoration-color: var(--or); text-underline-offset: 4px; }
.rayons, .liste-programmes { list-style: none; margin: 0; padding: 0; }
.rayons button { align-items: center; gap: 1rem; padding: .65rem 0; }
.rayons .carte { min-width: 3rem; font-size: 1.5rem; }
.rayons strong { flex: 1; font: 600 1.125rem/1.3 var(--texte); }
.rayons button[aria-pressed="true"] strong { text-decoration: underline; text-decoration-color: var(--or); text-underline-offset: 4px; }

/* ------------------------------------------------------------ historique, églises, import */
.chante { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; margin: .5rem 0 0; color: var(--doux); font-size: .9375rem; }
.chante button { padding: 0; border: 0; background: none; color: var(--or-texte); font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; }
.signaler { margin-top: 2rem; }
.signaler > button { padding: 0; border: 0; background: none; color: var(--doux); font-size: .9375rem; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; }
.signaler > button:hover { color: var(--or-texte); }
.signaler .formulaire { padding-top: 0; }
.signaler .champ textarea { min-height: 6.5rem; font: 1rem/1.5 var(--interface); }
.signalements { list-style: none; margin: 0; padding: 0; }
.signalements li { padding: 1.1rem 0; border-bottom: 1px solid var(--trait); }
.signalements .tete { display: flex; align-items: center; gap: .875rem; margin: 0; text-decoration: none; font: 600 1.0625rem/1.3 var(--texte); }
.signalements a.tete:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.signalements blockquote { margin: .7rem 0 0; padding-left: .9rem; border-left: 3px solid var(--or); white-space: pre-wrap; overflow-wrap: anywhere; }
.historique { list-style: none; margin: 0; padding: 0; }
.historique li { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--trait); }
.historique a { flex: 1; min-width: 0; display: flex; align-items: center; gap: .875rem; text-decoration: none; }
.historique a > span:last-child, .historique .absent { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 1.0625rem/1.3 var(--texte); }
.historique a:hover > span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.historique .absent { color: var(--doux); }
.historique button { padding: .25rem .6rem; border: 1px solid var(--trait); border-radius: 4px; background: none; color: var(--doux);
  font-size: .8125rem; }
.historique button:hover { color: var(--danger); border-color: currentColor; }
.communs { display: grid; gap: .55rem; }
.import input[type="file"] { width: 100%; padding: .55rem; border: 1px dashed var(--doux); border-radius: 4px; background: var(--feuille); }
.import-zone { margin-top: 1rem; }
.import-zone > p { margin: 0 0 .6rem; }
.import-apercu { margin: 0 0 .6rem; padding: .6rem .9rem; list-style: none; border-left: .3rem solid var(--trait); font: 1rem/1.5 var(--texte); }
.import-apercu strong { font: 700 1rem/1 var(--chiffres); font-stretch: condensed; margin-right: .4rem; }

/* ------------------------------------------------------------ télécommande (sur le téléphone) */
.tele { margin: .9rem 0 0; }
.tele.active { padding: .7rem .9rem; border: 1px solid var(--or); border-radius: 4px; background: color-mix(in srgb, var(--or) 10%, var(--feuille)); }
.tele.active p { margin: 0 0 .6rem; font-size: .9375rem; }
.tele-code { padding: .05rem .4rem; border-radius: 2px; background: var(--carte-fond); color: var(--carte-texte); white-space: nowrap;
  font: 700 1.25rem/1.3 var(--chiffres); font-stretch: condensed; letter-spacing: .04em; }
.telecommande { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1.25rem; }
.tele-vue h1 span:last-child { min-width: 0; }
.tele-vue { min-height: 9.5rem; }
.tele-vue h1 { display: flex; align-items: center; gap: .75rem; margin: 0; font: 600 1.25rem/1.25 var(--texte); }
.tele-vue .note, .tele-vue .erreur { margin: 0 0 .6rem; }
.tele-ou { display: flex; justify-content: space-between; gap: 1rem; margin: .6rem 0 .2rem; color: var(--doux);
  font: 600 .8125rem/1.4 var(--interface); font-variant-numeric: tabular-nums; }
.tele-diapo { padding: .6rem .9rem; border-left: .3rem solid var(--or); border-radius: 3px;
  background: color-mix(in srgb, var(--or) 12%, var(--feuille)); font: 1.0625rem/1.4 var(--texte); }
.tele-diapo.eteinte { border-left-color: var(--trait); background: none; color: var(--doux); }
.tele-diapo p { margin: 0; }
.tele-ensuite { margin: .5rem 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--doux); font: italic .9375rem/1.4 var(--texte); }
.tele-touches { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tele-touches button { min-height: 3.5rem; padding: .6rem; border: 1px solid var(--trait); border-radius: 6px; background: var(--feuille);
  font-size: 1rem; font-weight: 600; touch-action: manipulation; }
.tele-touches button:active { background: var(--trait); }
.tele-touches .principal { grid-column: 1 / -1; grid-row: 1; min-height: 9rem; border-color: var(--toile); background: var(--toile);
  color: var(--sur-toile); font-size: 1.5rem; }
.tele-touches .principal:active { background: var(--toile-ombre); }
.tele-touches button[aria-pressed="true"] { border-color: var(--or); background: color-mix(in srgb, var(--or) 30%, var(--feuille)); }
.tele-touches button:last-child { grid-column: 1 / -1; min-height: 2.75rem; font-size: .9375rem; font-weight: 500; }
.telecommande .file { margin-top: 0; }

/* ------------------------------------------------------------ apparence */
.libelle { margin: 1.25rem 0 .45rem; font-weight: 600; font-size: .9375rem; }
.nuancier { display: flex; flex-wrap: wrap; gap: .5rem; }
.nuancier button { display: flex; align-items: center; gap: .55rem; padding: .4rem .8rem .4rem .45rem; border: 1px solid var(--trait);
  border-radius: 4px; background: var(--feuille); font-size: .9375rem; }
.nuancier button[aria-pressed="true"] { border-color: var(--or); box-shadow: inset 0 0 0 1px var(--or); font-weight: 600; }
.echantillon { width: 1.6rem; height: 1.6rem; border-radius: 3px; background: var(--c-toile); }
.essai { margin: .9rem 0 0; padding-top: .9rem; }
.style-ecran { display: grid; gap: .5rem; margin-top: .7rem; }
.style-ecran select { width: 100%; min-width: 0; padding: .5rem .6rem; border: 1px solid var(--trait); border-radius: 4px;
  background: var(--feuille); font-size: .9375rem; }
.style-ecran .case { font-size: .9375rem; }
.liste-programmes button span:first-child { flex: 1; font: 1.0625rem/1.3 var(--texte); }
.liste-programmes button[aria-pressed="true"] span:first-child { font-weight: 600; }
.liste-programmes button[aria-pressed="true"] { border-bottom-color: var(--or); box-shadow: inset 0 -1px 0 var(--or); }

/* ------------------------------------------------------------ chant */
.chant-tete { padding: 2rem 0 1.25rem; }
.chant-tete .carte { font-size: 3rem; line-height: 1.12; padding: .3rem 1rem .2rem .8rem; border-left-width: .5rem; border-radius: 3px; min-width: 0; }
.chant-tete h1 { margin: 1.1rem 0 .5rem; font: 600 1.9375rem/1.18 var(--texte); letter-spacing: -.005em; text-wrap: balance; }
.fiche { display: flex; flex-wrap: wrap; gap: .2rem 0; margin: 0; color: var(--doux); font-size: .9375rem; }
.fiche span + span { margin-left: .75rem; padding-left: .75rem; border-left: 1px solid var(--trait); }
.etiquettes { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .6rem 0 0; }
.etiquettes button { padding: .15rem 0; border: 0; background: none; color: var(--or-texte); font-size: .9375rem;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--or) 55%, transparent); text-underline-offset: 3px; }
.avis { margin: 1rem 0 0; padding: .6rem .8rem; border-radius: 4px; background: var(--alerte-fond); color: var(--alerte); font-size: .9375rem; }
.fil { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .5rem; border-radius: 5px;
  background: var(--toile); color: var(--sur-toile); font-size: .9375rem; text-align: center; }
.fil > a:not(.bouton) { text-underline-offset: 3px; }
.fil .bouton { min-height: 2.1rem; background: var(--sur-toile); border-color: var(--sur-toile); color: #16211c;
  font: 700 1rem/1 var(--chiffres); font-stretch: condensed; }
.paroles { padding-top: 1.75rem; border-top: 1px solid var(--trait); font: var(--taille-paroles)/1.6 var(--texte); }
.fil + .paroles { border-top: 0; }
.strophe { position: relative; margin: 0 0 1.4em; padding-left: 2.1em; }
.strophe p { margin: 0; padding-left: 1.1em; text-indent: -1.1em; }   /* une ligne trop longue se replie en retrait */
.strophe .rang { position: absolute; left: 0; top: 0; width: 1.5em; text-align: right; color: var(--ruban);
  font: 700 1.05em/1.52 var(--chiffres); font-stretch: condensed; }
.strophe.refrain { font-style: italic; margin-left: .9em; padding-left: 1.2em; box-shadow: inset 2px 0 0 var(--or); }
.strophe .nom { display: block; font: 600 .8125rem/1.8 var(--interface); color: var(--or-texte); }
.voisins { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--trait); }

/* ------------------------------------------------------------ programme */
.programme { padding-top: 1.75rem; }
.titre-programme { width: 100%; margin-bottom: 1rem; padding: .2rem 0; border: 0; border-bottom: 1px solid var(--trait);
  background: none; font: 600 1.9375rem/1.2 var(--texte); }
.titre-programme:focus-visible { outline: 0; border-bottom-color: var(--or); box-shadow: 0 2px 0 var(--or); }
.ajout { display: flex; gap: .5rem; margin-top: 1rem; }
.ajout input { width: 7rem; padding: .5rem .7rem; border: 1px solid var(--trait); border-radius: 4px; background: var(--feuille);
  font: 700 1.125rem/1.2 var(--chiffres); font-stretch: condensed; text-transform: uppercase; }
.ajout input::placeholder { font-weight: 500; color: var(--doux); }
.programme > .note, .programme > .erreur { margin: 0 0 1rem; }

/* ------------------------------------------------------------ régie de projection */
.regie { display: grid; gap: 1.5rem; padding-top: 1.5rem; }
#apercu, #essai-ecran { width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; box-shadow: 0 0 0 1px var(--trait); }
#essai-ecran { max-width: 34rem; }
@media (min-width: 620px) {
  .accueil .style-ecran { max-width: 34rem; grid-template-columns: 1fr 1fr; }
  .accueil .style-ecran .case { grid-column: 1 / -1; }
}
.regie-commandes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .6rem; }
.regie-commandes .bouton { padding-inline: .3rem; white-space: nowrap; }
@media (min-width: 1250px) {
  .regie { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .regie-direct { position: sticky; top: 4.75rem; }
}
@media (max-width: 1249px) {
  /* une seule colonne : l'aperçu et ses commandes restent en haut pendant qu'on fait défiler les diapositives */
  .regie { display: flex; flex-direction: column; }     /* en colonne souple, l'aperçu peut rester collé en haut */
  .regie-direct { display: contents; }
  .regie-ecran { position: sticky; top: 0; z-index: 3; margin: 0 -1.25rem; padding: .6rem 1.25rem; background: var(--feuille);
    border-bottom: 1px solid var(--trait); }
  .regie-ecran #apercu { width: min(100%, 30rem); margin-inline: auto; }
  .regie-diapos { order: 2; }
  .file { order: 3; }
  .regie .note { order: 4; }
  .regie .style-ecran { order: 5; margin-top: 1.25rem; }
  .regie .tele { order: 5; }
  .feuille:has(.regie) .barre { position: static; }
  .diapos button { scroll-margin-top: 21rem; }
  .regie-commandes .bouton { font-size: .8125rem; }
}
.regie-diapos h1 { display: flex; align-items: center; gap: .875rem; margin: 0 0 1rem; font: 600 1.375rem/1.25 var(--texte); }
.regie-diapos h1 .carte { font-size: 1.5rem; }
.diapos, .file { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.diapos button { width: 100%; display: grid; gap: .05rem; padding: .6rem .9rem .7rem; text-align: left; border: 1px solid var(--trait);
  border-left: .3rem solid var(--trait); border-radius: 3px; background: var(--feuille); font: 1rem/1.4 var(--texte); }
.diapos button:hover { border-color: var(--doux); }
.diapos button[aria-current="true"] { border-color: var(--or); background: color-mix(in srgb, var(--or) 14%, var(--feuille)); }
.diapo-nom { margin-bottom: .15rem; color: var(--doux); font: 600 .75rem/1.5 var(--interface); }
.diapos .refrain .diapo-ligne { font-style: italic; }
.diapos .fin .diapo-ligne { color: var(--doux); }
.file { margin: 1.25rem 0 0; padding: .4rem; gap: 0; background: var(--toile); border-radius: 5px; }
.file li + li { border-top: 1px solid color-mix(in srgb, var(--sur-toile) 12%, transparent); }
.file button { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .35rem .4rem; border: 0; border-radius: 3px;
  background: none; color: var(--sur-toile); text-align: left; font: 1rem/1.3 var(--texte); }
.file button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .carte { --carte-fond: #f3f1e6; --carte-texte: #16211c; }
.file button[aria-current="true"] { background: color-mix(in srgb, var(--or) 38%, transparent); }

/* l'écran projeté : dans l'aperçu, en plein écran ou dans la fenêtre du second écran */
.ecran { --e-fond: #000; --e-texte: #f7f4e8; --e-refrain: #f1dc98; --e-carte: #f3f1e6; --e-carte-texte: #16211c;
  container-type: size; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  background: var(--e-fond); color: var(--e-texte); font-family: var(--texte); }
.ecran[data-fond="blanc"] { --e-fond: #fff; --e-texte: #000; --e-refrain: #5a3f00; --e-carte: #16211c; --e-carte-texte: #f6f4ea; }
.ecran[data-fond="bleu"] { --e-fond: #0e1d3a; --e-texte: #fff; --e-refrain: #f3dc94; }
.ecran[data-fond="vert"] { --e-fond: #12302a; --e-texte: #f6f1dc; --e-refrain: #f0d68a; }
.ecran[data-police="simple"] { font-family: var(--interface); }
.ecran.noir { background: #000; }
.ecran-tete { grid-row: 1; }
.ecran-corps { grid-row: 2; }
.ecran-pied { grid-row: 3; }
.ecran.sans-tete .ecran-tete { display: none; }
.ecran.sans-tete .ecran-corps { margin-top: 5cqh; }
.ecran-tete { display: flex; align-items: center; gap: 1.6cqw; min-width: 0; padding: 3.5cqh 4cqw 0; font-size: 3.1cqh; }
.ecran-tete .carte { --carte-fond: var(--e-carte); --carte-texte: var(--e-carte-texte); min-width: 0; padding: .1em .45em .04em .35em;
  border-left-width: .25em; font-size: 4.4cqh; }
.ecran-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .62; }
.ecran-corps { min-height: 0; min-width: 0; margin: 2.5cqh 5cqw; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ecran-texte { flex: none; width: max-content; text-align: center; white-space: nowrap; line-height: 1.3; font-weight: 500; }
.ecran-texte.replie { width: 100%; white-space: normal; text-wrap: balance; }
.ecran-texte p { margin: 0; }
.ecran-texte.refrain { font-style: italic; color: var(--e-refrain); }
.ecran-pied { display: flex; justify-content: space-between; gap: 2cqw; padding: 0 4cqw 3cqh; opacity: .5;
  font: 2.3cqh/1.2 var(--interface); font-variant-numeric: tabular-nums; }

.scene { position: fixed; inset: 0; z-index: 10; background: #000; cursor: none; }
.scene.reveil { cursor: default; }
.scene .ecran { width: 100%; height: 100%; }
.scene-barre { position: absolute; left: 50%; bottom: max(1.25rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: .4rem; padding: .4rem; border-radius: 6px; background: rgba(22, 33, 28, .9); opacity: 0; pointer-events: none; }
.scene.reveil .scene-barre { opacity: 1; pointer-events: auto; }
.scene-barre button { padding: .55rem .9rem; border: 1px solid rgba(243, 241, 230, .3); border-radius: 4px; background: none;
  color: #f3f1e6; font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.saisie { position: fixed; left: 50%; bottom: 5.5rem; z-index: 20; transform: translateX(-50%); margin: 0; padding: .6rem 1rem;
  border-radius: 4px; background: #f3f1e6; color: #16211c; box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  font: 600 1.0625rem/1.3 var(--interface); white-space: nowrap; }

.page-ecran { background: #000; overflow: hidden; }
.page-ecran .ecran { width: 100vw; height: 100vh; height: 100dvh; }
.ecran-accueil { position: fixed; inset: 0; display: grid; place-content: center; gap: .75rem; padding: 2rem; border: 0;
  background: #0b1210; color: #f3f1e6; text-align: center; font: 1.25rem/1.4 var(--interface); }
.ecran-accueil strong { font: 600 2.25rem/1.2 var(--texte); }
.ecran-accueil span { max-width: 30rem; opacity: .75; }

/* ------------------------------------------------------------ formulaires */
.formulaire { display: grid; gap: 1.1rem; padding-top: 1.5rem; }
.formulaire h1 { margin: 0; font: 600 1.75rem/1.2 var(--texte); }
.formulaire > p { margin: 0; max-width: 34rem; color: var(--doux); }
.champ { display: grid; gap: .3rem; }
.champ > label, .choix-themes legend { font-weight: 600; font-size: .9375rem; }
.champ small { color: var(--doux); }
.champ input[type="text"], .champ input[type="number"], .champ input[type="password"], .champ input[type="email"], .champ select,
.champ textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--trait); border-radius: 4px; background: var(--feuille); font-size: 1rem; }
.champ textarea { min-height: 24rem; font: 1.0625rem/1.55 var(--texte); resize: vertical; }
.ligne { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.case { display: flex; gap: .6rem; align-items: flex-start; }
.case input { flex: none; width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--toile); }
.choix-themes { margin: 0; padding: .75rem .9rem .9rem; border: 1px solid var(--trait); border-radius: 4px;
  columns: 2 14rem; column-gap: 1.5rem; }
.choix-themes legend { padding: 0 .4rem; }
.choix-themes .case { break-inside: avoid; padding: .2rem 0; }
.erreur { margin: 0; padding: .6rem .8rem; border-radius: 4px; background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger); font-weight: 600; }
.pied-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.oublis { max-width: 34rem; margin-top: .4rem; padding-top: 1rem; border-top: 1px solid var(--trait); }
.oublis h2 { margin: 0 0 .5rem; font: 600 1rem/1.3 var(--interface); }
.oublis p { margin: .3rem 0 0; color: var(--doux); font-size: .9375rem; }
.oublis strong { color: var(--encre); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .resultats a, .bouton, .segments button { transition: background-color .12s, border-color .12s; }
  .scene-barre { transition: opacity .2s; }
}
@media print {
  .volet-liste, .barre, .voisins, .fil, .etiquettes, .scene, .saisie, .signaler { display: none !important; }
  .volet-chant { display: block !important; height: auto; overflow: visible; }
  .feuille { border: 0; max-width: none; }
}
