/*
 * Planning-asso — planning commun des associations.
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Mobile d'abord. Gros boutons, texte lisible, couleurs en jetons.
 * Aucun style en ligne : la politique de sécurité (CSP) l'interdit.
 */

/* ------------------------------------------------------------------ */
/* Jetons                                                              */
/* ------------------------------------------------------------------ */
:root {
  --fond: #fff8ec;
  --fond-2: #fbefdd;
  --surface: #ffffff;
  --surface-2: #fdf7ee;
  --encre: #2b2620;
  --encre-douce: #6b6258;
  --ligne: #e6dccb;
  --ligne-douce: #efe7d9;
  --marque: #2f6f9f;
  --marque-fonce: #24577d;
  --marque-fond: #e9f1f8;
  --vert: #3f8f86;
  --vert-fonce: #2f6f68;
  --or: #e0a13a;
  --or-fonce: #9a6a14;
  --ok: #2e7d4f;
  --ok-fond: #e3f3e9;
  --alerte: #a33b2e;
  --alerte-fond: #fbe7e4;
  --brouillon: #7a6a2e;
  --brouillon-fond: #f5efd6;
  --chip-encre: #1d1b18;
  --ombre: 0 1px 2px rgba(60, 45, 20, 0.06), 0 6px 18px rgba(60, 45, 20, 0.07);
  --ombre-haute: 0 10px 30px rgba(40, 30, 10, 0.18);
  --r: 14px;
  --r-petit: 8px;
  --cible: 44px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #1d1b18;
    --fond-2: #171512;
    --surface: #27241f;
    --surface-2: #2e2a24;
    --encre: #f1ebe0;
    --encre-douce: #b5aa98;
    --ligne: #3d382f;
    --ligne-douce: #342f28;
    --marque: #8dbfe6;
    --marque-fonce: #6fa6d2;
    --marque-fond: #243544;
    --vert: #6fc0b4;
    --vert-fonce: #8dd2c7;
    --or: #e8b45a;
    --or-fonce: #f0c878;
    --ok: #7fd09c;
    --ok-fond: #1f3327;
    --alerte: #f2a091;
    --alerte-fond: #3a2220;
    --brouillon: #e0cf82;
    --brouillon-fond: #36321f;
    --ombre: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.3);
    --ombre-haute: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --fond: #1d1b18;
  --fond-2: #171512;
  --surface: #27241f;
  --surface-2: #2e2a24;
  --encre: #f1ebe0;
  --encre-douce: #b5aa98;
  --ligne: #3d382f;
  --ligne-douce: #342f28;
  --marque: #8dbfe6;
  --marque-fonce: #6fa6d2;
  --marque-fond: #243544;
  --vert: #6fc0b4;
  --vert-fonce: #8dd2c7;
  --or: #e8b45a;
  --or-fonce: #f0c878;
  --ok: #7fd09c;
  --ok-fond: #1f3327;
  --alerte: #f2a091;
  --alerte-fond: #3a2220;
  --brouillon: #e0cf82;
  --brouillon-fond: #36321f;
  --ombre: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.3);
  --ombre-haute: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  background-image: linear-gradient(180deg, var(--fond) 0%, var(--fond-2) 100%);
  background-repeat: no-repeat;
  color: var(--encre);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--marque); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--marque-fonce); }

main { width: 100%; max-width: 820px; margin: 0 auto; padding: 20px 16px 32px; flex: 1; }
main:has(.plan-layout) { max-width: 1160px; }

h1 { font-size: 1.75em; line-height: 1.2; margin: 8px 0 12px; color: var(--marque-fonce); letter-spacing: -0.01em; }
h2 { font-size: 1.2em; line-height: 1.3; margin: 28px 0 10px; color: var(--vert-fonce); }
h1 + .aide, h1 + p { margin-top: 0; }
p { margin: 10px 0; }
ol, ul { padding-left: 1.3em; }
li { margin: 4px 0; }
.aide, .meta, small { color: var(--encre-douce); }
small { font-size: 0.88em; }

/* Sous-titre de page, sous le h1 */
.sous-titre { margin: -6px 0 16px; color: var(--encre-douce); }

footer {
  text-align: center; color: var(--encre-douce); font-size: 0.85em; padding: 20px 16px;
  background: var(--surface); border-top: 1px solid var(--ligne);
}

/* ------------------------------------------------------------------ */
/* En-tête : sobre, blason, liseré de fête                             */
/* ------------------------------------------------------------------ */
.haut {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--ligne);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.haut::before {
  content: ""; display: block; height: 5px;
  background: linear-gradient(90deg, var(--marque) 0 34%, var(--vert) 34% 67%, var(--or) 67% 100%);
}
.haut-int {
  max-width: 1160px; margin: 0 auto; padding: 10px 16px 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px;
}
.marque {
  display: flex; align-items: center; gap: 12px; min-height: var(--cible);
  color: var(--encre); text-decoration: none; padding: 4px 0 8px;
}
.marque img.logo-mairie {
  height: 44px; width: 44px; object-fit: contain; flex: none;
  background: #fff; border-radius: 10px; padding: 3px; border: 1px solid var(--ligne);
}
.marque-texte { display: flex; flex-direction: column; line-height: 1.15; }
.marque-texte strong { font-size: 1.12em; font-weight: 750; letter-spacing: -0.01em; }
.marque-texte small { font-size: 0.8em; color: var(--encre-douce); }

.haut nav {
  /* Pas de défilement : il rognerait le menu « Mon compte ». Sur petit écran, la navigation passe à la ligne. */
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 2px;
  max-width: 100%; overflow: visible;
  margin: 0 -16px; padding: 0 12px;
}
.haut nav a, .haut nav summary {
  display: inline-flex; align-items: center; min-height: var(--cible);
  padding: 8px 12px; border-bottom: 3px solid transparent;
  color: var(--encre); font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: 6px 6px 0 0;
}
.haut nav a:hover, .haut nav summary:hover { background: var(--marque-fond); color: var(--marque-fonce); }
.haut nav a[aria-current="page"] { color: var(--marque-fonce); border-bottom-color: var(--marque); }
.haut nav a.action { color: var(--vert-fonce); }
.haut nav a.action::before { content: "+"; font-weight: 800; margin-right: 6px; }

/* Menu « Mon compte » : détails natifs, sans JavaScript */
.mon-espace { position: relative; display: flex; }
.mon-espace summary { list-style: none; cursor: pointer; }
.mon-espace summary::-webkit-details-marker { display: none; }
.mon-espace summary::after { content: ""; width: 7px; height: 7px; margin-left: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.mon-espace[open] summary { background: var(--marque-fond); color: var(--marque-fonce); }
.mon-espace .sous-menu {
  position: absolute; right: 0; top: 100%; z-index: 10; min-width: 220px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r);
  box-shadow: var(--ombre-haute); padding: 6px; display: flex; flex-direction: column;
}
.mon-espace .sous-menu a { display: block; color: var(--encre); padding: 10px 14px; border-radius: var(--r-petit); text-decoration: none; min-height: var(--cible); display: flex; align-items: center; }
.mon-espace .sous-menu a:hover { background: var(--marque-fond); color: var(--marque-fonce); }
.mon-espace .sous-menu a.sortie { color: var(--alerte); border-top: 1px solid var(--ligne-douce); margin-top: 4px; border-radius: 0 0 var(--r-petit) var(--r-petit); }

/* ------------------------------------------------------------------ */
/* Bandeau d'accueil : texte + illustration locale                     */
/* ------------------------------------------------------------------ */
.bandeau {
  display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r);
  padding: 20px; margin: 4px 0 20px; box-shadow: var(--ombre); overflow: hidden;
}
.bandeau h1 { margin: 0 0 6px; }
.bandeau p { margin: 0; color: var(--encre-douce); }
.bandeau-illustration { width: 100%; max-width: 320px; height: auto; display: block; border-radius: 18px; justify-self: center; }
@media (min-width: 640px) {
  .bandeau { grid-template-columns: minmax(0, 1fr) 280px; padding: 24px 28px; }
}

/* ------------------------------------------------------------------ */
/* Cartes, listes, états vides                                         */
/* ------------------------------------------------------------------ */
.carte {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r);
  padding: 18px; margin: 12px 0; box-shadow: var(--ombre);
}
.carte > :first-child { margin-top: 0; }
.carte > :last-child { margin-bottom: 0; }
.carte .carte { box-shadow: none; background: var(--surface-2); }
p.carte.aide { background: var(--surface-2); color: var(--encre); box-shadow: none; }

.vide {
  color: var(--encre-douce); text-align: center; padding: 28px 18px;
}
.carte.vide::before, p.vide::before {
  content: ""; display: block; width: 72px; height: 72px; margin: 0 auto 10px;
  background: url("vide.svg") center / contain no-repeat; opacity: 0.9;
}
.carte.vide { background: var(--surface); }

.ligne-liste {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px;
  padding: 12px 0; border-bottom: 1px solid var(--ligne-douce);
}
.ligne-liste:last-child { border-bottom: 0; }
.ligne-liste > span { flex: 1 1 240px; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.ligne-liste small { font-size: 0.9em; }
.ligne-liste form { margin: 0; }
.ligne-liste button, .ligne-liste .bouton { margin: 0; min-height: 40px; padding: 8px 14px; }
.ligne-liste:hover { background: transparent; }
.carte.ligne-liste { padding: 14px 18px; }
.carte.ligne-liste:last-child { border-bottom: 1px solid var(--ligne); }
.journal .ligne-liste { display: block; font-size: 0.92em; }
.journal .ligne-liste small { font-variant-numeric: tabular-nums; }

/* Étiquettes et badges */
.badge, .etiq {
  display: inline-block; font-size: 0.76em; font-style: normal; font-weight: 700; line-height: 1.4;
  padding: 2px 9px; border-radius: 999px; vertical-align: middle; white-space: nowrap;
}
.badge { margin-right: 6px; }
.etiq { margin-left: 6px; background: var(--brouillon-fond); color: var(--brouillon); }
.badge.ok { background: var(--ok-fond); color: var(--ok); }
.badge.brouillon { background: var(--brouillon-fond); color: var(--brouillon); }

/* ------------------------------------------------------------------ */
/* Formulaires                                                         */
/* ------------------------------------------------------------------ */
label { display: block; margin: 14px 0; font-weight: 600; }
label small { display: block; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit; min-height: var(--cible);
  color: var(--encre); background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r-petit);
}
input::placeholder { color: var(--encre-douce); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--encre-douce) 50%), linear-gradient(135deg, var(--encre-douce) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
textarea { resize: vertical; min-height: 96px; }
input[type="file"] { padding: 8px; background: var(--surface-2); }
input:focus, select:focus, textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--marque) 35%, transparent); outline-offset: 1px; border-color: var(--marque);
}

form.ligne { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
form.ligne label { flex: 1 1 180px; }
form.ligne button { margin-bottom: 12px; }

/* Formulaires en grille (administration, membres, documents, espaces) */
.grille {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 16px; align-items: end;
}
.grille label { margin: 10px 0; font-weight: 600; font-size: 0.95em; }
.grille label select, .grille label input { margin-top: 4px; }
.grille button { margin: 0 0 10px; min-height: var(--cible); white-space: nowrap; }
.carte > .grille + .ligne-liste { margin-top: 10px; border-top: 1px solid var(--ligne); }

/* Cases à cocher : grandes, bien visibles, texte à côté */
input[type="checkbox"] {
  appearance: auto; width: 22px; height: 22px; min-width: 22px; min-height: 0; margin: 2px 12px 0 0;
  display: inline-block; flex: none; padding: 0; accent-color: var(--marque); cursor: pointer;
}
label.accord {
  display: flex; align-items: flex-start; gap: 0; font-weight: 500; font-size: 0.98em;
  line-height: 1.45; margin: 16px 0; padding: 12px 14px; border: 2px solid var(--marque);
  border-radius: 10px; background: var(--marque-fond); cursor: pointer;
}
label.accord input[type="checkbox"] { margin-top: 3px; }
.salle-mairie { border-left: 4px solid var(--or); }

/* ------------------------------------------------------------------ */
/* Boutons                                                             */
/* ------------------------------------------------------------------ */
button, .bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--cible); margin-top: 12px; padding: 10px 20px; font: inherit; font-weight: 600; line-height: 1.2;
  color: #fff; background: var(--marque-fonce); border: 2px solid transparent; border-radius: 999px;
  cursor: pointer; text-decoration: none; box-shadow: 0 2px 6px rgba(36, 87, 125, 0.25);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
:root[data-theme="dark"] button, :root[data-theme="dark"] .bouton { color: #15202b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button, :root:not([data-theme="light"]) .bouton { color: #15202b; }
}
button:hover, .bouton:hover { filter: brightness(1.07); box-shadow: 0 4px 12px rgba(36, 87, 125, 0.3); color: inherit; }
button:active, .bouton:active { transform: translateY(1px); }
button.secondaire, .bouton.secondaire {
  background: var(--surface); color: var(--marque-fonce); border-color: var(--marque); box-shadow: none;
}
button.secondaire:hover, .bouton.secondaire:hover { background: var(--marque-fond); color: var(--marque-fonce); box-shadow: none; }
:root[data-theme="dark"] button.secondaire, :root[data-theme="dark"] .bouton.secondaire { color: var(--marque); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button.secondaire, :root:not([data-theme="light"]) .bouton.secondaire { color: var(--marque); }
}
button.danger { background: var(--alerte); box-shadow: 0 2px 6px rgba(163, 59, 46, 0.25); }
:root[data-theme="dark"] button.danger { color: #2b1512; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.danger { color: #2b1512; } }

:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { button, .bouton { transition: none; } }

/* ------------------------------------------------------------------ */
/* Messages                                                            */
/* ------------------------------------------------------------------ */
.alerte, .avis { padding: 12px 16px; border-radius: var(--r-petit); margin: 12px 0; border-left: 4px solid; }
.alerte { background: var(--alerte-fond); color: var(--alerte); border-color: var(--alerte); }
.avis { background: var(--ok-fond); color: var(--ok); border-color: var(--ok); }
.alerte ul, .avis ul { margin: 6px 0; }

.secret { background: var(--brouillon-fond); padding: 14px; border-radius: var(--r-petit); margin: 12px 0; }
.secret code { font-size: 1.05em; word-break: break-all; background: transparent; padding: 0; }
code { background: var(--brouillon-fond); padding: 2px 6px; border-radius: 4px; font-size: 0.95em; }

.qr { width: 220px; max-width: 100%; margin: 12px auto; background: #fff; padding: 8px; border-radius: var(--r-petit); border: 1px solid var(--ligne); }
.qr svg { display: block; width: 100%; height: auto; }

/* Connexion de contrôle : bannière toujours visible */
.controle { background: #b3261e; color: #fff; padding: 12px 16px; border-radius: var(--r-petit); margin: 0 0 16px; }
.controle .bouton { background: #fff; color: #b3261e; margin: 8px 0 0; box-shadow: none; }
.controle .bouton:hover { color: #b3261e; }

/* ------------------------------------------------------------------ */
/* Mes événements                                                      */
/* ------------------------------------------------------------------ */
.evt { display: flex; gap: 14px; align-items: flex-start; }
.evt.carte { padding: 16px 18px; border-left: 5px solid var(--vert); }
.evt.carte:has(.badge.brouillon) { border-left-color: var(--or); }
.evt .detail { flex: 1; min-width: 0; }
.evt .detail strong { font-size: 1.05em; }
.detail .meta { display: block; margin-top: 2px; }
.detail p { margin: 6px 0 0; }
.horaire { min-width: 84px; font-weight: 700; }
.horaire small { display: block; font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }
.actions button, .actions .bouton { margin-top: 0; min-height: 40px; padding: 8px 16px; }
.evt:hover { background: transparent; }
@media (max-width: 560px) {
  .evt { flex-direction: column; gap: 10px; }
  .evt .actions { width: 100%; }
}

/* ------------------------------------------------------------------ */
/* Planning commun : calendrier mensuel + colonne « à venir »          */
/* ------------------------------------------------------------------ */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }

.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.cal-nav .bouton { margin: 0; padding: 6px 14px; min-width: var(--cible); font-size: 1.1em; }
.cal-nav .cal-aujourdhui { font-size: 0.9em; padding: 6px 14px; }
.cal-nav-groupe { display: flex; align-items: center; gap: 8px; }
.cal-titre { text-transform: capitalize; font-size: 1.25em; font-weight: 750; color: var(--encre); }

.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--ligne); border-radius: var(--r); overflow: hidden;
  background: var(--surface); box-shadow: var(--ombre);
}
.cal-entete {
  text-align: center; font-size: 0.74em; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 8px 0; color: var(--encre-douce); background: var(--surface-2); border-bottom: 1px solid var(--ligne);
}
.cal-jour {
  min-height: 96px; border-right: 1px solid var(--ligne-douce); border-bottom: 1px solid var(--ligne-douce);
  padding: 6px 5px 5px; min-width: 0; display: flex; flex-direction: column; gap: 3px;
}
.cal-jour:nth-child(7n) { border-right: 0; }
.cal-jour:nth-child(7n), .cal-jour:nth-child(7n - 1) { background: var(--surface-2); }
.cal-jour.hors-mois { opacity: 0.4; }
.cal-num {
  font-size: 0.82em; font-weight: 700; width: 26px; height: 26px; line-height: 26px; text-align: center;
  border-radius: 999px; color: var(--encre-douce); flex: none;
}
.cal-jour.aujourdhui { background: var(--marque-fond); box-shadow: inset 0 0 0 2px var(--marque); }
.cal-jour.aujourdhui .cal-num { background: var(--marque-fonce); color: #fff; }

.chip {
  display: block; font-size: 0.72em; line-height: 1.3; padding: 3px 6px; border-radius: 6px;
  color: var(--chip-encre); background: #eee; border-left: 4px solid #888;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.mairie { font-style: italic; border-left-style: dashed; }
.chip-h { font-weight: 700; }

/* Colonne « à venir » */
.plan-avenir { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r); padding: 16px; box-shadow: var(--ombre); }
.plan-avenir h2 { font-size: 1.05em; margin: 0 0 6px; }
.plan-avenir .vide { padding: 18px 8px; font-size: 0.95em; }
.plan-avenir .vide::before { width: 56px; height: 56px; }
.avenir-jour { font-size: 0.78em; font-weight: 700; text-transform: capitalize; color: var(--encre-douce); margin: 14px 0 4px; letter-spacing: 0.02em; }
.avenir-jour:first-of-type { margin-top: 8px; }
.avenir-evt { white-space: normal; font-size: 0.9em; padding: 6px 8px; margin: 4px 0 6px; line-height: 1.35; }
.avenir-evt span { font-weight: 700; font-variant-numeric: tabular-nums; }
.avenir-evt small { display: block; font-size: 0.88em; color: #3d382f; }

/* Légende */
.legende {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; font-size: 0.85em;
}
.legende > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.legende strong { margin-right: 4px; color: var(--encre-douce); font-weight: 600; }
.pastille, .pastille-asso { display: inline-block; font-size: 0.95em; padding: 2px 9px; border-radius: 6px; line-height: 1.4; }
.pastille { color: var(--chip-encre); }
.pastille-asso { background: transparent; border-left: 5px solid #888; color: var(--encre); padding-left: 6px; border-radius: 3px; }

/* Couleurs : fond = salle (s0…s9), bordure = association (a0…a9) */
.s0 { background: #cfe8ff; } .s1 { background: #d9f2d0; } .s2 { background: #ffe0b3; } .s3 { background: #f5ccf0; } .s4 { background: #fff3a8; }
.s5 { background: #c8f2ee; } .s6 { background: #ffd1d1; } .s7 { background: #e2d6ff; } .s8 { background: #d8e4c4; } .s9 { background: #ffd9c2; }
.a0 { border-left-color: #1f5fa8; } .a1 { border-left-color: #2e7d4f; } .a2 { border-left-color: #c25e00; } .a3 { border-left-color: #8e2f9e; } .a4 { border-left-color: #a8891a; }
.a5 { border-left-color: #0f7b74; } .a6 { border-left-color: #b3261e; } .a7 { border-left-color: #5a3ea8; } .a8 { border-left-color: #5e7b1e; } .a9 { border-left-color: #a0461f; }

/* Téléphone : calendrier pleine largeur, pastilles sans texte, « à venir » dessous */
@media (max-width: 760px) {
  .plan-layout { grid-template-columns: 1fr; }
  .cal-jour { min-height: 60px; padding: 4px 3px 3px; gap: 2px; }
  .cal-num { width: 24px; height: 24px; line-height: 24px; font-size: 0.78em; }
  .cal-entete { font-size: 0.66em; padding: 6px 0; }
  .chip { font-size: 0.62em; padding: 2px 4px; border-left-width: 3px; border-radius: 4px; }
}
@media (max-width: 520px) {
  /* Heure seule, lisible ; le titre complet est dans « À venir » juste en dessous */
  .cal .chip { font-size: 0.66rem; line-height: 1.2; padding: 2px 2px 2px 3px; border-left-width: 3px; white-space: nowrap; }
  .cal .chip-t { display: none; }
  .cal .chip-h { letter-spacing: -0.03em; }
  .cal-nav .cal-aujourdhui { display: none; }
  .cal-titre { font-size: 1.1em; }
}

/* Bouton d'action en pied de planning */
.plan-action { margin: 16px 0 0; }
.plan-action .bouton { margin: 0; }

/* ------------------------------------------------------------------ */
/* Petits écrans : en-tête et marges                                   */
/* ------------------------------------------------------------------ */
@media (max-width: 480px) {
  body { font-size: 16px; }
  main { padding: 16px 16px 28px; }
  .haut-int { padding-top: 8px; }
  .marque img.logo-mairie { height: 38px; width: 38px; }
  .marque-texte strong { font-size: 1.02em; }
  .carte { padding: 16px; }
  .haut nav a, .haut nav summary { padding: 8px 10px; font-size: 0.95em; }
  .mon-espace .sous-menu { right: -8px; }
}
/* Téléphone : la navigation passe à la ligne plutôt que de disparaître hors écran */
@media (max-width: 600px) {
  .haut-int { padding-top: 6px; }
  .marque { padding-bottom: 2px; }
  .haut nav { flex-wrap: wrap; overflow: visible; gap: 0 2px; width: 100%; margin: 0; padding: 0; }
  .haut nav a, .haut nav summary { min-height: 42px; padding: 6px 10px; }
  .mon-espace { margin-left: auto; }
  .mon-espace .sous-menu { right: 0; }
}
