/* Thème Aurora (repris des jeux PWA : dégradés doux, panneaux translucides, coins arrondis), variantes claire et foncée.
   Aucune valeur n'est écrite en dur dans les composants : tout passe par les variables ci-dessous.

   @version  1.0.1
   @since    0.1.2
 */
:root {
  color-scheme: light;
  --bg: #e8edfb; --fg: #1b2142; --muted: #4f5a85; --panel: rgba(255, 255, 255, .72); --line: rgba(120, 130, 190, .38);
  --line-strong: #3b4690; --sel: rgba(120, 140, 255, .4); --hl: rgba(120, 140, 255, .14); --err: #c62828; --errbg: rgba(255, 120, 120, .3);
  --acc: #4659e0; --accfg: #ffffff; --ok: #16743a; --okbg: rgba(70, 190, 140, .28); --shadow: 0 4px 18px rgba(80, 90, 170, .18);
  --veil: rgba(60, 70, 130, .35); --btn-radius: 16px; --board-radius: 12px; --bf: blur(14px) saturate(1.4);
  --bg-image: linear-gradient(135deg, #d6e4ff 0%, #ece3ff 48%, #ffe3ee 100%);
  --head-bg: rgba(70, 89, 224, .16);
  --adm: #b3400d; --admbg: rgba(255, 140, 70, .24);
  --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="fonce"] {
  color-scheme: dark;
  --bg: #17142b; --fg: #ece9ff; --muted: #a29cc9; --panel: rgba(34, 30, 66, .84); --line: rgba(255, 255, 255, .17);
  --line-strong: #b8bfff; --sel: rgba(143, 156, 255, .38); --hl: rgba(143, 156, 255, .14); --err: #ff8080; --errbg: rgba(255, 100, 100, .26);
  --acc: #8f9cff; --accfg: #10131a; --ok: #6fe08c; --okbg: rgba(80, 200, 150, .26); --shadow: 0 4px 18px rgba(0, 0, 0, .35);
  --veil: rgba(5, 3, 20, .6); --bf: blur(14px) saturate(1.3);
  --bg-image: linear-gradient(135deg, #1a1840 0%, #2a1a4a 50%, #3a1a38 100%);
  --head-bg: rgba(143, 156, 255, .24);
  --adm: #ffa174; --admbg: rgba(255, 120, 70, .28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--ui-font); font-size: 1rem; line-height: 1.45;
  color: var(--fg); background: var(--bg-image) fixed, var(--bg);
}
main { flex: 1; width: 100%; margin: 0; padding: 1.25rem 1.5rem 2rem; } /* pleine largeur ; les formulaires étroits gardent .etroite */
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; letter-spacing: .02em; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
a { color: var(--acc); }
.note { color: var(--muted); font-size: .92rem; }
.erreur { color: var(--err); background: var(--errbg); padding: .5rem .75rem; border-radius: 10px; margin: .4rem 0; }
.positif { color: var(--ok); } .negatif { color: var(--err); } .alerte-texte { color: var(--err); font-weight: 600; }
.multiligne { white-space: pre-wrap; }
.en-ligne { display: inline; margin: 0; }
[hidden] { display: none !important; }

/* Barre de navigation */
.navbar { position: sticky; top: 0; z-index: 20; background: var(--panel); backdrop-filter: var(--bf); -webkit-backdrop-filter: var(--bf);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.navbar nav { margin: 0; padding: .5rem 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.marque { font-weight: 700; font-size: 1.2rem; letter-spacing: .06em; text-decoration: none; color: var(--fg); margin-right: .5rem; }
.liens { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; flex: 1; }
.liens > a, .menu > summary { padding: .4rem .8rem; border-radius: var(--btn-radius); text-decoration: none; color: var(--fg); cursor: pointer; list-style: none; }
.liens > a:hover, .menu > summary:hover { background: var(--hl); }
.liens > a.actif, .menu > summary.actif { background: var(--sel); font-weight: 600; }
.menu { position: relative; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-liste { position: absolute; top: 110%; left: 0; min-width: 12rem; background: var(--panel); backdrop-filter: var(--bf); border: 1px solid var(--line);
  border-radius: var(--board-radius); box-shadow: var(--shadow); padding: .35rem; display: flex; flex-direction: column; }
.menu-liste a { padding: .45rem .7rem; border-radius: 10px; text-decoration: none; color: var(--fg); }
.menu-liste a:hover, .menu-liste a.actif { background: var(--hl); }
.droite { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.panneau { display: contents; } /* ordinateur : les liens et le compte restent dans la barre */
.navbar .plein-ecran { display: none; margin-left: auto; width: 2.75rem; height: 2.75rem; padding: 0; align-items: center; justify-content: center; }
.plein-ecran[aria-pressed="false"] .ico-reduire, .plein-ecran[aria-pressed="true"] .ico-agrandir { display: none; }
.navbar .burger { display: none; margin-left: auto; width: 2.75rem; height: 2.75rem; padding: 0; position: relative; }
.burger-barres, .burger-barres::before, .burger-barres::after { content: ""; position: absolute; left: 50%; width: 1.3rem; height: 2px; margin-left: -.65rem;
  background: var(--fg); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger-barres { top: 50%; margin-top: -1px; } .burger-barres::before { top: -7px; left: 50%; } .burger-barres::after { top: 7px; left: 50%; }
.ouvert .burger-barres { background: transparent; }
.ouvert .burger-barres::before { transform: translateY(7px) rotate(45deg); } .ouvert .burger-barres::after { transform: translateY(-7px) rotate(-45deg); }
.utilisateur { color: var(--muted); }

/* Boutons */
.btn { display: inline-block; font: inherit; cursor: pointer; padding: .45rem 1rem; border-radius: var(--btn-radius); text-decoration: none;
  color: var(--fg); background: var(--panel); border: 1px solid var(--line-strong); backdrop-filter: var(--bf); }
.btn:hover { background: var(--hl); }
.btn .ico { vertical-align: -.25em; margin-right: .45rem; flex: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, th:focus-visible, summary:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.btn-primaire { background: var(--acc); color: var(--accfg); border-color: var(--acc); font-weight: 600; }
.btn-primaire:hover { background: var(--acc); filter: brightness(1.08); }
.btn-danger { color: var(--err); border-color: var(--err); }
/* Bouton de paiement d'une ligne de participants : état lisible d'un coup d'œil, cible de toucher d'au moins 44 px. */
.paiement-form { margin: 0; }
.btn-paiement { min-width: 6.2rem; min-height: 2.75rem; font-weight: 600; white-space: nowrap; padding-left: .6rem; padding-right: .6rem; }
.btn-paiement.a-payer { color: var(--err); border-color: var(--err); }
.btn-paiement.paye { color: var(--ok); border-color: var(--ok); background: var(--okbg); }
.btn-paiement[disabled] { opacity: .6; cursor: progress; }
.btn-colonnes { display: none; }   /* utile seulement sur téléphone (voir plus bas) */
/* Menu « Vue » de la liste des manifestations : cases à cocher, sous le bouton (déplie la page, rien ne déborde sur téléphone). */
.menu-vue { margin: 0 0 .8rem; }
.menu-vue > summary { list-style: none; cursor: pointer; display: inline-block; }
.menu-vue > summary::-webkit-details-marker { display: none; }
.menu-vue-corps { margin-top: .5rem; padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--board-radius); box-shadow: var(--shadow); max-width: 36rem; }
.menu-vue-corps label { display: flex; align-items: center; gap: .6rem; min-height: 2.75rem; }
.btn-discret { border-color: transparent; background: transparent; }
.btn-petit { padding: .15rem .6rem; font-size: .88rem; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Cartes, formulaires */
.carte { background: var(--panel); backdrop-filter: var(--bf); -webkit-backdrop-filter: var(--bf); border: 1px solid var(--line); border-radius: var(--board-radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem; margin: 0 0 1rem; }
.etroite { max-width: 640px; margin-left: auto; margin-right: auto; }
.accueil { text-align: center; margin-top: 4rem; }
.formulaire { display: flex; flex-direction: column; gap: .85rem; }
.champ { display: flex; flex-direction: column; gap: .25rem; font-size: .95rem; }
.champ > span { color: var(--muted); }
.champ-case { flex-direction: row; align-items: center; gap: .5rem; }
input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], input[type="date"], input[type="password"], input[type="file"], select, textarea {
  font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; padding: .45rem .65rem; width: 100%; }
select { width: auto; min-width: 8rem; }
textarea { resize: vertical; }
.actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .5rem; }
.fiche { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0 0 1rem; }
.fiche dt { color: var(--muted); } .fiche dd { margin: 0; }
.fiche-ligne { grid-template-columns: repeat(4, max-content 1fr); }
.flash { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; border-radius: var(--board-radius); margin-bottom: .75rem;
  background: var(--okbg); border: 1px solid var(--ok); }
.flash-erreur { background: var(--errbg); border-color: var(--err); }

/* Listes */
.liste-entete { display: flex; flex-direction: column; gap: .5rem; margin: 0 0 .75rem; }
.barre-outils, .barre-recherche { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 0; }
.barre-recherche .filtre { flex: 1 1 14rem; max-width: 24rem; }
.barre-journal input[type="search"] { max-width: 14rem; }
.barre-recherche label { display: inline-flex; align-items: center; gap: .4rem; }
.compteur { color: var(--muted); font-size: .92rem; }
.tableau-conteneur { overflow-x: auto; background: var(--panel); backdrop-filter: var(--bf); border: 1px solid var(--line); border-radius: var(--board-radius); box-shadow: var(--shadow); }
.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tableau th, .tableau td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tableau thead th { background: var(--head-bg); font-weight: 700; font-size: .85rem; letter-spacing: .03em; text-transform: uppercase; border-bottom: 2px solid var(--line-strong); vertical-align: middle; }
.tableau thead th:first-child { border-top-left-radius: calc(var(--board-radius) - 1px); } .tableau thead th:last-child { border-top-right-radius: calc(var(--board-radius) - 1px); }
.tableau th[data-tri] { cursor: pointer; user-select: none; white-space: nowrap; }
.tableau th[data-tri]::after { content: " ↕"; color: var(--muted); font-size: .8em; }
.tableau th[aria-sort="ascending"]::after { content: " ▲"; color: var(--acc); }
.tableau th[aria-sort="descending"]::after { content: " ▼"; color: var(--acc); }
.tableau tbody tr[data-id] { cursor: pointer; }
.tableau thead th[data-tri]:hover { background: var(--sel); }
.tableau tbody tr:hover { background: var(--hl); }
.tableau tbody tr.selection { background: var(--sel); }
.sans-coupure { white-space: nowrap; }
.col-case { width: 2.2rem; text-align: center !important; }
.tableau pre { white-space: pre-wrap; margin: .3rem 0 0; font-size: .82rem; }
.synthese { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.synthese > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--board-radius); padding: .6rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.synthese span { color: var(--muted); font-size: .88rem; } .synthese strong { font-size: 1.35rem; }
.barre-annee { display: flex; gap: .6rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.tuile { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem 1.25rem; border-radius: var(--board-radius); text-decoration: none; color: var(--fg);
  background: var(--panel); backdrop-filter: var(--bf); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tuile:hover { background: var(--hl); } .tuile span { color: var(--muted); font-size: .92rem; }
.pagination { display: flex; gap: .5rem; margin-top: 1rem; }

/* Boîtes de dialogue (confirmation) */
dialog { border: 1px solid var(--line-strong); border-radius: var(--board-radius); background: var(--bg); color: var(--fg); box-shadow: var(--shadow); padding: 0; max-width: 32rem; width: calc(100% - 2rem); }
dialog::backdrop { background: var(--veil); }
.dialogue { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .8rem; }
.dialogue h2 { margin: 0; }

.pied { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem; }

/* Menu burger : écran étroit, ou téléphone couché (plus large que 720 px mais de 520 px de haut au plus) */
@media (max-width: 720px), (max-width: 1000px) and (max-height: 520px) {
  .navbar nav { gap: .5rem; }
  .navbar .burger { display: inline-block; margin-left: 0; }
  .navbar .plein-ecran { display: inline-flex; }
  .navbar .plein-ecran[hidden] { display: none; }
  .panneau { display: flex; flex-direction: column; align-items: stretch; flex-basis: 100%; gap: .6rem; padding: .4rem 0 .6rem; border-top: 1px solid var(--line); }
  .js .panneau { display: none; } .js .ouvert .panneau { display: flex; max-height: calc(100vh - 4.5rem); overflow-y: auto; }
  .panneau .liens { flex-direction: column; align-items: stretch; flex: none; gap: .15rem; }
  .panneau .liens > a, .panneau .menu > summary { display: block; padding: .7rem .9rem; }
  .menu-liste { position: static; box-shadow: none; backdrop-filter: none; background: transparent; border: 0; padding: 0 0 0 1rem; }
  .menu-liste a { padding: .7rem .9rem; }
  .panneau .droite { margin-left: 0; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .6rem; }
  /* Boutons d'action des listes : pictogramme seul (le texte reste pour les lecteurs d'écran) */
  .barre-outils .btn .txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .barre-outils .btn:has(.ico) { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .4rem; position: relative; }
  .barre-outils .btn .ico { margin-right: 0; vertical-align: 0; }
}
@media (max-width: 720px) {
  .fiche, .fiche-ligne { grid-template-columns: 1fr; }
  /* Liste des participants au téléphone : nom, paiement et solde seulement (« Toutes les colonnes » rend le reste), cibles de 44 px. */
  table[data-table="participants"]:not(.toutes) .col-sec, table[data-table="vue"]:not(.toutes) .col-sec { display: none; }
  table[data-table="participants"] th, table[data-table="participants"] td { padding-left: .4rem; padding-right: .4rem; }
  table[data-table="participants"] .col-case { width: 1.8rem; }
  .btn-colonnes { display: inline-block; }
  .barre-recherche .btn { min-height: 2.75rem; }
  .btn-paiement { min-width: 5.2rem; }
  .barre-recherche .filtre { max-width: none; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .tableau tbody tr, .tuile { transition: background .15s, filter .15s; } }

/* Boîte « Brouillons Gmail » : groupes de choix et liste des demandes récentes */
fieldset.choix { border: 1px solid var(--line-strong); border-radius: var(--board-radius); padding: .5rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
fieldset.choix legend { font-weight: 600; padding: 0 .3rem; }
fieldset.choix label { display: flex; gap: .5rem; align-items: baseline; }
.liste-simple { list-style: none; padding: 0; margin: .3rem 0 1rem; display: flex; flex-direction: column; gap: .2rem; }
form.en-ligne { display: inline; }

/* Administration : statistiques (histogrammes SVG, chiffres clés) et infos (historique des versions) */
.chiffres { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; }
.chiffre { display: flex; flex-direction: column; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--board-radius); }
.chiffre .valeur { font-size: 1.35rem; font-weight: 700; color: var(--acc); }
.chiffre .titre { font-size: .8rem; opacity: .8; }
svg.graphe { width: 100%; height: auto; display: block; }
svg.graphe .axe { stroke: var(--line-strong); stroke-width: 1; }
svg.graphe .barre-a { fill: var(--acc); }
svg.graphe .barre-b { fill: #d62839; }
svg.graphe .etiquette { fill: currentColor; font-size: 10px; opacity: .75; }
.pastille { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: middle; }
.pastille-a { background: var(--acc); }
.pastille-b { background: #d62839; }
details.version { border-top: 1px solid var(--line); padding: .4rem 0; }
details.version summary { cursor: pointer; }
details.version h3 { font-size: .95rem; margin: .6rem 0 .2rem; }
details.version ul { margin: .2rem 0 .4rem 1.2rem; padding: 0; }

/* Réglages en sections (v0.3.0) : onglets, règlement en Markdown, zone de saisie large. */
.onglets { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.onglets a { padding: .4rem .8rem; border-radius: var(--btn-radius); border: 1px solid var(--line); text-decoration: none; color: var(--fg); background: var(--panel); }
.onglets a:hover { background: var(--hl); }
.onglets a.actif { background: var(--acc); color: var(--accfg); border-color: var(--acc); }
.zone-large { width: 100%; min-height: 20rem; font-family: ui-monospace, Consolas, monospace; font-size: .92rem; }
.markdown { line-height: 1.6; }
.markdown h2, .markdown h3, .markdown h4, .markdown h5 { margin: 1.2rem 0 .4rem; }
.markdown ul, .markdown ol { padding-left: 1.4rem; }
.markdown.apercu { border: 1px dashed var(--line-strong); border-radius: var(--board-radius); padding: .6rem 1rem; }

/* Décorations saisonnières : un fin liseré et un petit motif dans la barre du haut ; aucune image, rien qui gêne la lecture. */
.navbar { position: relative; }
body[data-deco] .navbar::after { position: absolute; right: .6rem; bottom: -.15rem; font-size: .9rem; letter-spacing: .3rem; pointer-events: none; opacity: .85; }
body.deco-noel .navbar { border-bottom: 3px double #c62828; }
body.deco-noel .navbar::after { content: "\1F384 \2744 \1F384"; }
body.deco-hiver .navbar { border-bottom: 3px solid #7fb2e5; }
body.deco-hiver .navbar::after { content: "\2744 \2744 \2744"; }
body.deco-printemps .navbar { border-bottom: 3px solid #5cb85c; }
body.deco-printemps .navbar::after { content: "\1F337 \1F33C \1F337"; }
body.deco-ete .navbar { border-bottom: 3px solid #f0b429; }
body.deco-ete .navbar::after { content: "\2600 \1F33B \2600"; }
body.deco-automne .navbar { border-bottom: 3px solid #c2682a; }
body.deco-automne .navbar::after { content: "\1F342 \1F341 \1F342"; }

/* Envoi de mail (v0.4.0) */
.liste-cases { max-height: 14rem; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .15rem .8rem; padding: .4rem; border: 1px solid var(--line); border-radius: var(--board-radius); }
.apercu-mail { white-space: pre-wrap; word-break: break-word; padding: .7rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--board-radius); font-family: inherit; }

/* Messagerie (v0.5.0) */
.messagerie { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; gap: 1rem; align-items: start; }
.dossiers { display: flex; flex-direction: column; gap: .2rem; }
.dossiers a { padding: .4rem .7rem; border-radius: 10px; text-decoration: none; color: var(--fg); }
.dossiers a:hover, .dossiers a.actif { background: var(--hl); }
.dossiers a.actif { font-weight: 600; }
tr.non-lu td { font-weight: 700; }
.corps-mail { white-space: pre-wrap; word-break: break-word; font-family: inherit; line-height: 1.5; padding: .5rem 0; }
.cadre-mail { width: 100%; min-height: 28rem; border: 1px solid var(--line); border-radius: var(--board-radius); background: #fff; }
.entetes-mail { display: grid; grid-template-columns: max-content 1fr; gap: .15rem 1rem; }
.entetes-mail dt { color: var(--muted); }
.entetes-mail dd { margin: 0; word-break: break-word; }
@media (max-width: 720px), (max-width: 1000px) and (max-height: 520px) { .messagerie { grid-template-columns: 1fr; } .dossiers { flex-direction: row; flex-wrap: wrap; } }

/* Section Asso du menu Administration (v0.6.0) */
.menu-titre { padding: .35rem .7rem .1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Taille du texte (v0.10.1) : boutons − T + de la barre du haut ; tout est en rem/em, donc tout suit la taille de la racine. */
html[data-taille="-2"] { font-size: 85%; }
html[data-taille="-1"] { font-size: 92%; }
html[data-taille="1"] { font-size: 112%; }
html[data-taille="2"] { font-size: 125%; }
html[data-taille="3"] { font-size: 140%; }
html[data-taille="4"] { font-size: 160%; }
.taille { display: inline-flex; gap: .1rem; align-items: center; }
.taille .btn { padding: .2rem .5rem; min-width: 1.9rem; }
.taille .btn:disabled { opacity: .4; cursor: default; }

/* Pictogrammes (v0.12.0) : de la couleur et de la taille du texte, donc ils suivent le thème et les boutons − T +. */
.picto { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; margin-right: .4em; }
h1.titre-icone { display: flex; align-items: center; gap: .1rem; }
h1.titre-icone .picto { width: 1.1em; height: 1.1em; margin-right: .35em; vertical-align: baseline; color: var(--acc); }
.navbar .liens a, .navbar summary, .menu-liste a, .onglets a { display: inline-flex; align-items: center; }
.menu-liste a { display: flex; }
.tuile strong { display: flex; align-items: center; }
.tuile strong .picto { color: var(--acc); width: 1.3em; height: 1.3em; }
@media (max-width: 720px) { .navbar .liens a .picto, .navbar summary .picto { margin-right: .5em; } }

/* Cartouches de la barre du haut (v0.12.3) : « − T + » et le bouton de thème, chacun dans son cadre ; petites séparations entre les trois boutons de taille. */
.taille, .cartouche { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .2rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); }
.taille .btn, .cartouche .btn { position: relative; padding: .2rem .55rem; min-width: 1.9rem; border-radius: 999px; line-height: 1.2; }
.taille .btn + .btn::before { content: ""; position: absolute; left: -.17rem; top: 22%; bottom: 22%; border-left: 1px solid var(--line-strong); }
/* Boutons discrets du contenu des pages (Lire, Annuler, Retour…) : un cadre fin pour qu'on les voie ; ceux de la barre du haut gardent leur cartouche. */
main .btn-discret { border-color: var(--line-strong); }

/* Notes (pense-bêtes) et Agenda (v0.15.0) */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.post-it { position: relative; padding: .9rem 1rem .7rem; border: 1px solid var(--line); border-radius: 6px 6px 18px 6px; box-shadow: var(--shadow); background: var(--fond-note, var(--panel)); }
.post-it h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.post-it .texte-note { margin: 0 0 .6rem; word-break: break-word; }
.post-it .meta-note { margin: 0 0 .5rem; font-size: .8rem; }
.post-it .actions-note { display: flex; flex-wrap: wrap; gap: .3rem; }
.post-it .epingle { position: absolute; top: .4rem; right: .5rem; color: var(--acc); }
.note-jaune { --fond-note: rgba(255, 224, 102, .38); } .note-rose { --fond-note: rgba(255, 138, 170, .30); } .note-vert { --fond-note: rgba(120, 220, 140, .30); }
.note-bleu { --fond-note: rgba(110, 170, 255, .30); } .note-violet { --fond-note: rgba(180, 140, 255, .30); } .note-gris { --fond-note: rgba(150, 150, 160, .25); }
.note-formulaire textarea { width: 100%; }
.agenda-liste { list-style: none; padding: 0; margin: .3rem 0 1rem; }
.agenda-ligne { padding: .35rem .2rem; border-bottom: 1px solid var(--line); }
.agenda-date { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: .4rem; }
.agenda-type { display: inline-block; padding: 0 .5rem; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .8rem; margin-right: .4rem; }
.agenda-ligne.retard .agenda-date, .agenda-ligne.retard .agenda-type { color: var(--err); border-color: var(--err); }
.agenda-ligne.fait a { text-decoration: line-through; opacity: .7; }
.rappels h2 { display: flex; align-items: center; }
.mois-entete { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .6rem; }
table.mois { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 44rem; }
table.mois th { background: var(--head-bg); padding: .3rem; font-size: .85rem; }
table.mois td { vertical-align: top; height: 6.2rem; padding: .25rem; border: 1px solid var(--line); }
table.mois td.hors-mois { opacity: .5; }
table.mois td.aujourdhui { outline: 2px solid var(--acc); outline-offset: -2px; }
table.mois .jour { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
table.mois .jour a { text-decoration: none; opacity: .5; }
table.mois .evt { display: block; margin-top: .15rem; padding: 0 .3rem; border-radius: 4px; font-size: .78rem; text-decoration: none; color: var(--fg); background: var(--hl); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.mois .evt-echeance, table.mois .evt-rappel { background: rgba(255, 140, 70, .30); } table.mois .evt-reunion { background: rgba(110, 170, 255, .30); }
table.mois .evt-manifestation { background: rgba(120, 220, 140, .30); } table.mois .evt.fait { text-decoration: line-through; opacity: .7; }

/* Notes personnelles par page (v0.16.0) : note épinglée en haut de page, bouton flottant « Ma note » en bas à droite */
.note-page { margin: 0 0 1rem; max-width: 40rem; }
.note-page h2 { display: flex; align-items: center; }
.note-flottante { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; }
.note-flottante > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; padding: .45rem .8rem; border-radius: 999px; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.note-flottante > summary::-webkit-details-marker { display: none; }
.note-flottante.avec-note > summary { background: var(--acc); color: var(--accfg); border-color: var(--acc); }
.note-flottante .panneau-note { position: absolute; right: 0; bottom: 3.2rem; width: min(24rem, calc(100vw - 2rem)); max-height: 70vh; overflow-y: auto; padding: 1rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--board-radius); box-shadow: var(--shadow); }
.note-flottante .panneau-note h2 { margin-top: 0; }
@media (max-width: 720px), (max-width: 1000px) and (max-height: 520px) { .note-flottante > summary .lib { display: none; } .note-flottante > summary .picto { margin-right: 0; } }
@media print { .note-flottante { display: none; } }

/* Aide (bouton « ? », fenêtre et page /aide) */
#aide-ouvrir { font-weight: 700; border: 1px solid var(--line-strong); border-radius: 999px; min-width: 2rem; text-align: center; }
.aide-onglets { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.aide-onglets .btn.actif { background: var(--accent, var(--fg)); color: var(--bg); }
.aide-volet { display: none; }
.aide-volet.actif { display: block; }
.aide-carte { border: 1px solid var(--line); border-radius: var(--board-radius); padding: .8rem 1.1rem; margin: 0 0 .9rem; background: var(--bg); }
.aide-carte h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.aide-cible { border-color: var(--line-strong); box-shadow: var(--shadow); }
.aide-dialogue { max-width: 46rem; max-height: 85vh; padding: 0; overflow: hidden; }
.aide-dialogue[open] { display: flex; flex-direction: column; }
.aide-haut { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.aide-corps { overflow: auto; padding: 1rem; }
@media print { #aide-ouvrir, .aide-dialogue { display: none; } }
.aide-corps .aide-onglets { position: sticky; top: -1rem; z-index: 1; background: var(--bg); padding: .6rem 0; margin: -1rem 0 .6rem; }

/* Page institutionnelle (accueil) */
.institution { text-align: center; max-width: 36rem; margin: 5rem auto; padding: 0 1rem; }
.institution .logo-zencan { width: 8rem; height: 8rem; color: var(--accent, var(--fg)); }
.institution h1 { font-size: 2.4rem; letter-spacing: .08em; margin: .6rem 0 .2rem; }
.institution .slogan { font-size: 1.15rem; opacity: .85; margin-bottom: 1.5rem; }

/* Barre du haut : tous les boutons à la même hauteur ; liseret des cartouches (aide, taille du texte, thème) très léger. */
.navbar .droite > .btn, .navbar .droite > .utilisateur, .navbar .droite .en-ligne .btn, .navbar .droite > .taille, .navbar .droite > .cartouche {
  box-sizing: border-box; height: 2.4rem; display: inline-flex; align-items: center; }
.navbar .droite > .btn, .navbar .droite .en-ligne .btn { padding-top: 0; padding-bottom: 0; }
.navbar .droite > .utilisateur { padding: 0 .6rem; }
.navbar .droite .en-ligne { display: inline-flex; margin: 0; }
/* Bouton « Mon compte » de la barre du haut : sa couleur dit la nature du compte (lecture : sans couleur ; bureau : vert ; administrateur : orange-rouge). */
.navbar .droite > .utilisateur.role-bureau { color: var(--ok); background: var(--okbg); border: 1px solid var(--ok); border-radius: var(--btn-radius); font-weight: 600; text-decoration: none; }
.navbar .droite > .utilisateur.role-administrateur { color: var(--adm); background: var(--admbg); border: 1px solid var(--adm); border-radius: var(--btn-radius); font-weight: 600; text-decoration: none; }
.navbar .taille .btn, .navbar .cartouche .btn { align-self: stretch; display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; }
.navbar #aide-ouvrir, .navbar .taille, .navbar .cartouche { border-color: color-mix(in srgb, var(--line) 40%, transparent); }
.navbar .taille .btn + .btn::before { border-left-color: color-mix(in srgb, var(--line) 40%, transparent); top: 28%; bottom: 28%; }
.navbar #aide-ouvrir { justify-content: center; min-width: 2.4rem; padding: 0; }

/* Consultation seule : champs figés d'un formulaire (agenda pour le bureau) */
fieldset.lecture-seule { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: inherit; min-width: 0; }
fieldset.lecture-seule :disabled { opacity: 1; color: var(--fg); cursor: default; }

/* Boîte Mail : lignes cliquables, cases à cocher et barre d'actions de groupe */
tr.ligne-cliquable { cursor: pointer; }
tr.ligne-cliquable:hover, tr.ligne-cliquable:focus-visible, tr.ligne-cliquable.coche { background: var(--hl); }
.barre-groupe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.barre-groupe select { max-width: 14rem; }
.messagerie-liste .col-case { width: 2.2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Bouton flottant « Note » : jaune fluo (écriture et liseret en thème foncé, fond en thème clair) */
.note-flottante > summary { background: #f4ff2e; color: #1b2142; border: 1px solid #b9c400; font-weight: 600; }
:root[data-theme="fonce"] .note-flottante > summary { background: var(--panel); -webkit-backdrop-filter: var(--bf); backdrop-filter: var(--bf); color: #f4ff2e; border: 1px solid #f4ff2e; font-weight: inherit; }
.note-flottante.avec-note > summary { background: #f4ff2e; color: #1b2142; border-color: #f4ff2e; box-shadow: 0 0 0 3px color-mix(in srgb, #f4ff2e 45%, transparent), var(--shadow); }
:root[data-theme="fonce"] .note-flottante.avec-note > summary { background: var(--panel); color: #f4ff2e; border-color: #f4ff2e; box-shadow: 0 0 0 3px color-mix(in srgb, #f4ff2e 40%, transparent), var(--shadow); }

/* Boîte Mail : dossiers avec pictogrammes (seul le pictogramme reste sur téléphone, sauf pour le dossier ouvert) */
.dossiers a { display: flex; align-items: center; gap: .55rem; }
.dossiers a .picto { flex: none; }
@media (max-width: 720px), (max-width: 1000px) and (max-height: 520px) {
  .dossiers { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: .4rem; }
  .dossiers a { flex: none; }
  .dossiers a:not(.actif) .lib { display: none; }
}

/* Boîte Mail sur téléphone : tous les boutons réduits à leur pictogramme (gain de place, surtout en paysage) */
@media (max-width: 720px), (max-width: 1000px) and (max-height: 520px) {
  body[data-actif="messagerie"] .btn .lib { display: none; }
  body[data-actif="messagerie"] .btn .picto { margin-right: 0; }
  body[data-actif="messagerie"] .btn { min-width: 2.6rem; min-height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; padding-left: .6rem; padding-right: .6rem; }
  body[data-actif="messagerie"] .barre-groupe, body[data-actif="messagerie"] .barre-outils { gap: .35rem; }
  body[data-actif="messagerie"] .dossiers a .lib { display: none; }
  body[data-actif="messagerie"] .dossiers a.actif .lib { display: inline; }
}

/* Couleurs des notes : fluo, adoucies vers le pastel pour ne pas jurer avec le thème ; texte toujours sombre (clair ou foncé) */
.note-jaune { --fond-note: #f7ff6b; } .note-rose { --fond-note: #ff9bd8; } .note-vert { --fond-note: #86ff9a; }
.note-bleu { --fond-note: #7fe0ff; } .note-violet { --fond-note: #c8a4ff; } .note-gris { --fond-note: #d4d8e6; }
.post-it[class*="note-"] { color: #1b2142; border-color: rgba(27, 33, 66, .35);
  --fg: #1b2142; --muted: #3d4670; --panel: rgba(255, 255, 255, .55); --hl: rgba(255, 255, 255, .8); --line: rgba(27, 33, 66, .3); --line-strong: #1b2142; --acc: #1b2142; --err: #a1122e; }

/* Bouton « Ma note » : aucun liseret terne (clair : le fond fluo suffit ; foncé : liseret fluo franc) ; page annotée = texte en gras */
.note-flottante > summary { border: 0; padding: calc(.45rem + 1px) calc(.8rem + 1px); }
:root[data-theme="fonce"] .note-flottante > summary { border: 1px solid #f4ff2e; padding: .45rem .8rem; }
.note-flottante.avec-note > summary, :root[data-theme="fonce"] .note-flottante.avec-note > summary { box-shadow: var(--shadow); font-weight: 800; }
.note-flottante.avec-note > summary { background: #f4ff2e; color: #1b2142; }
:root[data-theme="fonce"] .note-flottante.avec-note > summary { background: var(--panel); color: #f4ff2e; border-color: #f4ff2e; }

/* Réglages → API : exemples et clé affichée une fois */
.exemple { background: var(--hl); padding: .8rem 1rem; border-radius: 8px; overflow-x: auto; font-family: ui-monospace, Consolas, monospace; font-size: .9em; white-space: pre-wrap; word-break: break-all; }
#cle-api { user-select: all; font-weight: 600; border: 1px dashed var(--line-strong); }

/* Maintenance : bandeau rouge visible des administrateurs quand le site est fermé */
.bandeau-maintenance { margin: 0 0 1rem; padding: .7rem 1rem; border: 1px solid var(--err); border-radius: 10px; background: var(--errbg); color: var(--fg); }
.bandeau-maintenance a { color: inherit; font-weight: 600; }

/* Rédaction d'un message : pièces jointes */
.pieces-jointes { border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem; }
.pieces-jointes legend { padding: 0 .4rem; color: var(--muted); }
.pieces-jointes ul { margin: 0 0 .6rem; }

/* Tableau de bord personnalisable (v0.34.0) : contenu centré, tuiles avec croix, épingle orange à côté du bouton « Ma note » */
.tdb { min-height: calc(100vh - 11rem); min-height: calc(100dvh - 11rem); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: .4rem; }
.tdb-partie { width: 100%; max-width: 62rem; margin: 1rem auto; }
.tdb-partie h2 { margin-bottom: .6rem; }
.tdb-partie > form { margin-top: 1.1rem; }
.tdb .tuiles { justify-content: center; grid-template-columns: repeat(auto-fit, minmax(14rem, 18rem)); }
.tdb .tuile { text-align: left; height: 100%; }
.tdb .tuile strong { padding-right: 1.4rem; }
.tuile-bloc { position: relative; }
.tuile-croix { position: absolute; top: .35rem; right: .45rem; margin: 0; }
.tuile-croix button { width: 1.6rem; height: 1.6rem; line-height: 1; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 1.25rem; cursor: pointer; }
.tuile-croix button:hover, .tuile-croix button:focus-visible { background: var(--errbg); color: var(--err); }
.flottants { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; display: flex; align-items: flex-end; gap: .5rem; }
.flottants .note-flottante { position: relative; right: auto; bottom: auto; }
.epingle-form { margin: 0; }
.epingle-flottante { display: inline-flex; align-items: center; justify-content: center; padding: .45rem .65rem; border-radius: 999px; border: 0; cursor: pointer; background: #ff9a1f; color: #1b2142; box-shadow: var(--shadow); }
.epingle-flottante .picto { width: 1.25em; height: 1.25em; margin: 0; }
.epingle-flottante:hover, .epingle-flottante:focus-visible { filter: brightness(1.08); }
.epingle-flottante.epinglee { box-shadow: 0 0 0 3px color-mix(in srgb, #ff9a1f 45%, transparent), var(--shadow); }
.epingle-flottante.epinglee .picto { fill: currentColor; }
@media print { .flottants { display: none; } }
.donnees { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.tuile-donnees { align-items: center; text-align: center; }
.tuile-donnees .synthese { margin: .4rem 0 0; justify-content: center; }
.btn-plus { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; margin-left: .4rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: var(--acc); font-size: 1.1rem; font-weight: 700; line-height: 1; text-decoration: none; vertical-align: middle; }
.btn-plus:hover, .btn-plus:focus-visible { background: var(--acc); color: var(--accfg); }
.tuile-bloc.donnee .tuile-donnees { height: 100%; padding-right: 2rem; }
.choix-donnees { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.choix-donnee .apercu { margin: .6rem 0 1rem; pointer-events: none; }

/* Boîte Mail : trombone des messages avec pièce jointe, bandeau de la surveillance des contrats (v0.38.0) */
.pj { display: inline-block; margin-left: .35rem; color: var(--muted); vertical-align: middle; }
.pj .picto { width: 1em; height: 1em; margin: 0; }
.bandeau-surveillance { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .6rem 0 1rem; padding: .55rem .9rem; border: 1px solid #2e9e5b; border-radius: var(--board-radius); background: color-mix(in srgb, #2e9e5b 24%, var(--bg)); box-shadow: var(--shadow); }
.bandeau-surveillance p { margin: 0; flex: 1 1 24rem; }
.bandeau-surveillance form { margin: 0; }
.bandeau-surveillance.inactive { border-color: #ff9a1f; background: color-mix(in srgb, #ff9a1f 28%, var(--bg)); }
.bandeau-surveillance.en-erreur { border-color: var(--err); }
.bandeau-surveillance .erreur-surveillance { color: var(--err); font-weight: 600; }
@media print { .bandeau-surveillance { display: none; } }
.interrupteur { display: inline-flex; align-items: center; gap: .55rem; padding: .2rem .3rem; border: 0; background: transparent; color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.interrupteur-piste { position: relative; display: inline-block; width: 2.9rem; height: 1.55rem; border-radius: 999px; background: #2e9e5b; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); transition: background .15s; }
.interrupteur-bouton { position: absolute; top: .17rem; left: 1.5rem; width: 1.21rem; height: 1.21rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: left .15s; }
.interrupteur[aria-checked="false"] .interrupteur-piste { background: #8a8f9c; }
.interrupteur[aria-checked="false"] .interrupteur-bouton { left: .17rem; }
.interrupteur:focus-visible .interrupteur-piste { outline: 3px solid var(--acc); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .interrupteur-piste, .interrupteur-bouton { transition: none; } }
