/* =====================================================================
   Agenda public CFE-CGC Orange Fonctions Corp - feuille de style
   1. Variables (couleurs, polices, tailles, espacements, rayons, ombres, dimensions)
   2. Theme sombre (ne redefinit que des couleurs)
   3. Base et cadre : bandeau, recherche, onglets, deux colonnes
   4. Composants communs (pastilles, boutons, interrupteurs, en-tete de liste)
   5. Prochains evenements : selecteur de dates et frise horaire
   6. Cartes d'evenements (colonne droite)
   7. Agenda : calendrier mensuel
   8. Carte des evenements (Leaflet)
   9. Panneau Filtres
   10. Tablette et mobile
   Theme clair par defaut ; sombre selon le systeme, ou force par "Mode nuit"
   (attribut data-theme sur <html>).
   ===================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  color-scheme: light;

  /* Couleurs du theme */
  --bg: #f2f2f4;            /* fond de page */
  --card: #ffffff;          /* fond des colonnes et des cartes */
  --card-2: #f8f8fa;        /* fonds secondaires (survol, touches) */
  --text: #1c1c23;          /* texte principal */
  --muted: #5e5e6a;         /* texte secondaire */
  --faint: #a2a2ae;         /* jours sans rendez-vous */
  --line: #e4e0d9;          /* bordures */
  --line-soft: #efece7;     /* lignes horaires de la frise */
  --accent: #faa82b;        /* orange CFE-CGC : LE seul orange fort (bandeau, onglet, selections, pastilles, boutons) */
  --accent-dark: #9a5108;   /* orange fonce (texte, liens) */
  --accent-soft: #fff6ea;   /* orange tres pale (fonds) */
  --accent-mid: #ffe3bd;    /* date selectionnee */
  --ended-bg: #f5f5f7;      /* carte d'un rendez-vous termine */
  --grey-soft: #cfcfd8;     /* rendez-vous termines, interrupteur eteint */
  --map-attrib-bg: transparent;
  --pill-border: color-mix(in srgb, var(--accent) 45%, transparent);

  /* Couleurs fixes (identiques dans les deux themes) */
  --on-accent: #352018;     /* texte sur fond orange */
  --ev-ink: #22222b;        /* texte sur les blocs pastel de la frise */
  --white: #ffffff;  --now: #d9534f;           /* trait "maintenant" de la frise */
  --hover-light: rgba(255,255,255,.3);

  /* Ombres */
  --shadow-frame: 0 10px 30px rgba(0,0,0,.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.08);
  --shadow-card: 0 4px 14px rgba(0,0,0,.08);
  --shadow-pin: 0 2px 6px rgba(0,0,0,.3);
  --shadow-knob: 0 1px 3px rgba(0,0,0,.3);
  --shadow-logo: drop-shadow(0 2px 3px rgba(0,0,0,.25));

  /* Police */
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;   /* une seule police partout : titres, gras, texte */
  --fw-normal: 400;
  --fw-semi: 700;           /* un seul niveau de gras partout ("semi" = gras) */
  --fw-bold: 700;
  --lh-tight: 1;
  --lh-title: 1.2;
  --lh-snug: 1.3;
  --lh-base: 1.45;

  /* Tailles de texte */
  --fs-h1: 1.4rem;          /* titre du bandeau */
  --fs-h2: 1.05rem;         /* titre de la colonne droite */
  --fs-h3: .95rem;          /* titres des jours, nom du mois */
  --fs-body: .9rem;
  --fs-body-s: .85rem;
  --fs-meta: .8rem;
  --fs-small: .75rem;
  --fs-mini: .72rem;
  --fs-pill: .7rem;
  --fs-micro: .68rem;
  --fs-count: .7rem;        /* "3 rendez-vous" : sous les dates et dans l'en-tete de la liste */
  --fs-chip: .8rem;         /* "Mer 18 Nov" dans le selecteur (4 dates a 1200 px) */
  --fs-tag: .6rem;

  /* Espacements */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 6px;
  --sp-4: 8px;
  --sp-5: 10px;
  --sp-6: 12px;
  --sp-7: 14px;
  --sp-8: 16px;
  --sp-9: 20px;
  --sp-10: 24px;
  --sp-12: 32px;
  --list-indent: 22px;      /* cartes sous le titre du jour (listes sur plusieurs jours) */

  /* Rayons */
  --r-frame: 20px;
  --r-lg: 14px;
  --r-md: 12px;
  --r-sm: 10px;
  --r-xs: 6px;
  --r-2xs: 4px;
  --r-pill: 99px;

  /* Dimensions */
  /* largeur du cadre sur PC : suit l'ecran (32 px de marge de chaque cote), au moins 1320 px, au plus 1760 px.
     Ex. portable 1920 px a 125 % = 1536 px : cadre de 1472 px au lieu de 1320 (108 px de marge avant). */
  --page-max: min(1760px, max(1320px, calc(100vw - 64px)));
  --ctl-h: 36px;            /* champ de recherche et boutons du bandeau */
  --search-w: 260px;        /* largeur maxi de la recherche (PC), elle retrecit si la place manque */
  --logo-h: 48px;
  /* Mobile */
  --tap: 40px;              /* zones tactiles (icones de la barre, onglets) */
  --tap-l: 44px;            /* boutons du panneau Filtres */
  --logo-h-m: 26px;
  --fs-h1-m: 1.05rem;       /* titre sur telephone */
  --fs-time-m: .75rem;      /* horaire des cartes sur telephone */
  --fs-blk-m: .62rem;       /* duree dans les blocs de la frise sur telephone */
  --fs-h1sub: .82rem;       /* sous-titre "evenements publics" */
  --fs-h1-s: .92rem;        /* titre sur petit telephone */
  --badge-m: 18px;          /* pastille "filtres actifs" sur l icone */
  --plan-gutter-m: 32px;
  --plan-col-m: .62fr;      /* largeur de la frise a cote des cartes (onglet Prochains, mobile) */
  --day-h-m: 44px;
  --fs-filter-m: .875rem;   /* textes du panneau Filtres sur mobile (cases et liste des lieux, meme taille) */
  --sheet-r: 18px;          /* coins du panneau Filtres qui monte du bas */
  --shadow-sheet: 0 -8px 30px rgba(0,0,0,.25);
  --backdrop: rgba(0,0,0,.45);
  --col-gap: 20px;          /* entre les deux colonnes */
  --cols-min-h: 640px;      /* hauteur minimale des colonnes */
  --nav-btn: 30px;          /* boutons ronds precedent / suivant */
  --chip-h: 68px;           /* dates du selecteur : hauteur fixe, mention "Aujourd hui" comprise (le bloc ne bouge pas) */
  --chip-h-m: 62px;         /* idem sur mobile */
  --plan-gutter: 42px;      /* graduations de la frise */
  --day-h: 52px;            /* cases du calendrier */
  --cnt: 20px;              /* pastilles de comptage */
  --pin: 32px;
  --clu: 40px;              /* regroupement de lieux */
  --map-h: 560px;
  --sw-w: 38px;             /* interrupteurs */
  --sw-h: 22px;
  --knob: 16px;
  --chev: 28px;
  --icon: 18px;
}

/* ---------- 2. Theme sombre ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111116; --card: #1b1b22; --card-2: #23232b; --text: #f2f2f6; --muted: #a3a3b2; --faint: #5f5f6c;
    --line: #34343e; --line-soft: #2a2a33; --accent-dark: #f5b860; --accent-soft: #2b2112; --accent-mid: #4d3613;
    --ended-bg: #17171d; --grey-soft: #4a4a55; --map-attrib-bg: rgba(27,27,34,.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111116; --card: #1b1b22; --card-2: #23232b; --text: #f2f2f6; --muted: #a3a3b2; --faint: #5f5f6c;
  --line: #34343e; --line-soft: #2a2a33; --accent-dark: #f5b860; --accent-soft: #2b2112; --accent-mid: #4d3613;
  --ended-bg: #17171d; --grey-soft: #4a4a55; --map-attrib-bg: rgba(27,27,34,.8);
}

/* ---------- 3. Base et cadre ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: var(--lh-base);
       padding: var(--sp-9) var(--sp-8) var(--sp-12); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

.frame { max-width: var(--page-max); margin: 0 auto; background: var(--bg); border: 1px solid var(--line);
         border-radius: var(--r-frame); overflow: hidden; box-shadow: var(--shadow-frame); }

/* Bandeau : titre, logo WIP, recherche, Filtres, Mode nuit */
.banner { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-6) var(--sp-8);
          padding: var(--sp-6) var(--sp-10); background: var(--accent); color: var(--on-accent); }
.banner h1 { font-size: var(--fs-h1); line-height: var(--lh-title); letter-spacing: -.01em; }
.banner h1 a { color: inherit; text-decoration: none; }
/* sous-titre plus petit sous le titre */
.banner h1 .nw { white-space: nowrap; }   /* "CFE-CGC Orange FC" jamais coupe */
.h1sub { display: block; margin-top: var(--sp-1); font-size: var(--fs-h1sub); font-weight: var(--fw-normal); letter-spacing: 0; }
/* panneau "travaux" (site en test) : juste apres le titre */
.wip { display: block; height: var(--logo-h); width: auto; flex: none; filter: var(--shadow-logo); }
/* Panneau travaux cliquable (PC) : bulle d avertissement bien visible sous le panneau */
.wipbox { position: relative; flex: none; }
.wip-btn { display: block; padding: 0; border: 0; background: none; cursor: pointer; }
.wip-tip { position: absolute; top: calc(100% + var(--sp-4)); left: 50%; transform: translateX(-50%); z-index: 1200;
           width: max-content; max-width: 320px; padding: var(--sp-5) var(--sp-6); border-radius: var(--r-sm);
           background: var(--on-accent); color: var(--white); font-size: var(--fs-body-s); font-weight: var(--fw-semi);
           line-height: var(--lh-snug); text-align: center; box-shadow: var(--shadow-card); }
.wip-tip::before { content: ""; position: absolute; top: -6px; left: 50%; margin-left: -6px; border: 6px solid transparent;
                   border-top: 0; border-bottom-color: var(--on-accent); }
.bn-tools { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-4); }

.search { display: flex; align-items: center; gap: var(--sp-3); width: var(--search-w); height: var(--ctl-h);
          padding: 0 var(--sp-3) 0 var(--sp-5); border-radius: var(--r-sm); background: var(--card); color: var(--text);
          box-shadow: var(--shadow-sm); }
.search:focus-within { box-shadow: 0 0 0 2px var(--on-accent); }
.search > svg { flex: none; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: var(--fs-body-s); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { flex: none; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-2xs);
              background: var(--card-2); color: var(--muted); font: inherit; font-size: var(--fs-micro); line-height: 1.6; }
.search .clr { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%;
               background: var(--card-2); color: var(--muted); cursor: pointer; }
.search .clr:hover { color: var(--text); background: var(--line); }

.bn-btn { display: inline-flex; align-items: center; gap: var(--sp-3); height: var(--ctl-h); padding: 0 var(--sp-6);
          border: 0; border-radius: var(--r-sm); background: var(--card); color: var(--text); box-shadow: var(--shadow-sm);
          font-size: var(--fs-body-s); font-weight: var(--fw-semi); cursor: pointer; transition: box-shadow .15s; }
.bn-btn:hover { background: var(--accent-soft); }   /* meme survol qu un jour du calendrier */
.bn-btn .fn { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bn-btn[aria-expanded="true"] { background: var(--accent-mid); }
/* Filtres actifs (differents des reglages par defaut) : cadre noir epais, bien visible */
/* Filtres actifs : pastille rouge "moins" a cote du libelle (des rendez-vous sont masques) */
.bn-btn.act .fn { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
                  background: var(--now); color: var(--white); }
.bn-theme .ico-moon, [data-theme="dark"] .bn-theme .ico-sun { display: none; }
[data-theme="dark"] .bn-theme .ico-moon { display: block; }

/* Onglets + ligne d'informations discrete (sources, derniere mise a jour) */
.navbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0 var(--sp-8); padding: 0 var(--sp-10);
          background: var(--card); border-bottom: 1px solid var(--line); }
/* Barre orange sous les onglets : l onglet choisi (fond orange) se prolonge dedans, jolie separation */
.tabs { border-bottom: 3px solid var(--accent); }
/* PC : la barre orange court sous toute la ligne (onglets + infos a droite) */
/* PC : bande blanche entre le bandeau et les onglets (l onglet orange ne touche plus le bandeau) */
@media (min-width: 901px) { .navbar { border-bottom: 3px solid var(--accent); padding-top: var(--sp-4); } .tabs { border-bottom: 0; } }
/* tablette (701-900 px) : la ligne d infos passe au-dessus des onglets pour ne pas les ecraser */
/* PC : titre, panneau et outils toujours sur une seule ligne, centres en hauteur ; la recherche retrecit */
@media (min-width: 901px) {   /* en dessous (tablette), les outils passent a la ligne */
  .banner, .navbar { flex-wrap: nowrap; }
  .banner h1 { flex: none; white-space: nowrap; }
  .bn-btn { white-space: nowrap; flex: none; }
  .bn-tools { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; }
  .search { width: auto; flex: 0 1 var(--search-w); min-width: 120px; }
}
.tabs { display: flex; gap: var(--sp-2); }
.tab { display: inline-flex; align-items: center; gap: var(--sp-4); padding: var(--sp-6) var(--sp-8) calc(var(--sp-6) - 3px);
       border: 0; border-bottom: 3px solid transparent; border-radius: var(--r-xs) var(--r-xs) 0 0; background: none;
       color: var(--muted); font-size: var(--fs-body); font-weight: var(--fw-semi); cursor: pointer;
       transition: color .15s, background .15s; }
.tab:hover { color: var(--text); background: var(--accent-soft); }   /* meme survol qu un jour du calendrier */
/* Selection franche, comme le jour choisi du calendrier : fond orange soutenu, texte fonce */
.tab[aria-selected="true"] { color: var(--on-accent); background: var(--accent); border-bottom-color: var(--accent); }
/* ligne d'infos : au-dessus des onglets, alignee a gauche */
/* ligne d infos : PC = a droite des onglets, centree verticalement ; mobile = au-dessus des onglets */
.sub { margin-left: auto; flex: none; align-self: center; text-align: right; white-space: nowrap; padding: var(--sp-3) 0;
       font-size: var(--fs-micro); line-height: var(--lh-snug); color: var(--muted); }
.sub b { font-weight: var(--fw-semi); }
.sub a { color: inherit; }

/* Deux colonnes : outil de navigation (40 %) / rendez-vous (60 %). La hauteur de la ligne suit la
   colonne gauche (au moins --cols-min-h) ; la colonne droite defile seule. */
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--col-gap);
        min-height: var(--cols-min-h); padding: var(--sp-9) var(--sp-10) var(--sp-10); }
/* Tres grands ecrans (1536 px et plus) : colonne gauche plus etroite (36 % au lieu de 40 %), la liste
   des rendez-vous gagne la place. 36 % garde 5 jours dans le semainier a 1536 px (34 % : 4 seulement). */
@media (min-width: 1536px) { .cols { grid-template-columns: minmax(0, 36fr) minmax(0, 64fr); } }
.col { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.col-left { padding: var(--sp-8); }
.col-right { position: relative; }
.rpane { position: absolute; inset: 0; overflow-y: auto; border-radius: inherit; scroll-padding-top: 64px; }

footer { padding: 0 var(--sp-10) var(--sp-9); font-size: var(--fs-small); color: var(--muted); text-align: center; }

/* ---------- 4. Composants communs ---------- */
/* Pastille d'origine : "Calendrier national" / "Communication email" / "evenement termine" */
.src { display: inline-block; padding: 0 7px; border-radius: var(--r-pill); font-size: var(--fs-pill);
       font-weight: var(--fw-normal); line-height: 1.55; white-space: nowrap;
       color: var(--accent-dark); background: var(--accent-soft); border: 1px solid var(--pill-border); }
.src-end { color: var(--muted); background: transparent; border-color: var(--line); }

/* Pastilles de comptage */
.cnt { display: inline-block; min-width: var(--cnt); height: var(--cnt); padding: 0 var(--sp-3); border-radius: var(--r-pill);
       font-size: var(--fs-small); font-weight: var(--fw-bold); line-height: var(--cnt); text-align: center;
       background: var(--accent); color: var(--on-accent); }

/* Boutons ronds precedent / suivant (dates, mois) */
.nav { flex: none; display: grid; place-items: center; width: var(--nav-btn); height: var(--nav-btn); padding: 0;
       border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--text); cursor: pointer;
       transition: border-color .15s, background .15s; }
.nav:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.nav:disabled { color: var(--faint); cursor: default; opacity: .6; }

/* Interrupteur (Mode nuit, evenements geolocalises) */
.sw { position: relative; flex: none; width: var(--sw-w); height: var(--sw-h); border-radius: var(--r-pill);
      background: var(--grey-soft); transition: background .2s; }
.knob { position: absolute; top: 3px; left: 3px; width: var(--knob); height: var(--knob); border-radius: 50%;
        background: var(--white); box-shadow: var(--shadow-knob); transition: transform .2s; }
[aria-checked="true"] > .sw { background: var(--accent); }
[aria-checked="true"] > .sw .knob { transform: translateX(calc(var(--sw-w) - var(--knob) - 6px)); }

/* En-tete de la colonne droite (fixe pendant le defilement) */
/* en-tete en haut de la colonne : coins du haut arrondis comme le cadre (sinon ses angles carres debordent sur mobile) */
.rpane > .rhead:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.rhead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-4) var(--sp-6);
         min-height: 56px; padding: var(--sp-5) var(--sp-8); background: var(--card); border-bottom: 1px solid var(--line); }
.rhead h2 { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--fs-h2); line-height: var(--lh-snug); }
/* nombre de rendez-vous : meme police que sous les dates du selecteur (.chip .cn) */
.rhead h2 .n, .hsub { font-size: var(--fs-count); font-weight: var(--fw-normal); color: var(--muted); }
.rhead h2 svg { align-self: center; color: var(--accent-dark); }
.sort { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-meta); color: var(--muted); }
.sort select { padding: var(--sp-1) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-xs);
               background: var(--card); color: var(--text); font-size: var(--fs-meta); cursor: pointer; }
.lnk-btn { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-4); border: 1px solid var(--line);
           border-radius: var(--r-pill); background: none; font-size: var(--fs-meta); color: var(--accent-dark); cursor: pointer; }
.sort + .lnk-btn { margin-left: 0; }
.rhead h2 + .lnk-btn { margin-left: auto; }
.lnk-btn:hover { border-color: var(--accent); }
.tpill { padding: 0 var(--sp-4); border-radius: var(--r-pill); background: var(--accent-mid); color: var(--accent-dark);
         font-size: var(--fs-pill); font-weight: var(--fw-semi); line-height: 1.7; }
.rbody { padding: var(--sp-6) var(--sp-8) var(--sp-8); }
.empty { padding: var(--sp-6) 0; font-size: var(--fs-body); color: var(--muted); }
.hint { margin-bottom: var(--sp-5); font-size: var(--fs-meta); color: var(--muted); }
.dayh { margin: var(--sp-9) 0 var(--sp-4); font-size: var(--fs-h3); font-weight: var(--fw-bold); }
.dayh:first-child { margin-top: var(--sp-1); }
.dayh + .cards, .dayh + .places { margin-left: var(--list-indent); }   /* plusieurs jours : cartes en retrait sous leur jour */

/* ---------- 5. Prochains evenements : dates et frise horaire ---------- */
/* Dates serrees : app.js en met autant que possible (jusqu'a 7) sans couper les libelles */
.days { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-8); }
.chips { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: var(--sp-2); list-style: none; }
.chip { width: 100%; height: var(--chip-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: var(--sp-1); padding: var(--sp-3) var(--sp-1); overflow: hidden; border: 1px solid transparent; border-radius: var(--r-sm);
        background: none; cursor: pointer; transition: background .15s, border-color .15s; }
/* Fine ligne verticale entre deux dates (au milieu de l'ecart) */
.chips li { position: relative; }
.chips li + li::before { content: ""; position: absolute; left: calc(-1 * var(--sp-2) / 2 - .5px); top: 18%; bottom: 18%;
                         width: 1px; background: var(--line); }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); }   /* meme survol qu un jour du calendrier */
.chip .cd { font-size: var(--fs-chip); font-weight: var(--fw-bold); white-space: nowrap; }
.chip .cn { font-size: var(--fs-count); color: var(--muted); white-space: nowrap; }
.chip.sel, .chip.sel:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.sel .cn, .chip.sel .today-tag { color: var(--on-accent); }
.today-tag { font-style: normal; font-size: var(--fs-tag); font-weight: var(--fw-bold); letter-spacing: .08em; text-transform: uppercase;
             color: var(--accent-dark); }

.planbox { padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--plan-gutter); }
.plan { position: relative; height: calc(12 * var(--hh)); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line-soft);
        background-image: linear-gradient(var(--line-soft) 1px, transparent 1px); background-size: 100% var(--hh); }
.ph { position: absolute; left: calc(-1 * var(--plan-gutter)); width: calc(var(--plan-gutter) - var(--sp-4)); text-align: right;
      transform: translateY(-50%); font-size: var(--fs-micro); color: var(--muted); font-variant-numeric: tabular-nums; }
.pblk { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden;
        border-radius: var(--r-xs); background: var(--ev); color: var(--ev-ink); cursor: pointer;
        font-size: var(--fs-mini); font-weight: var(--fw-bold); line-height: var(--lh-tight); white-space: nowrap;
        transition: box-shadow .15s, filter .15s; }
.pblk:hover, .pblk.hl { z-index: 2; filter: saturate(1.25) brightness(.97); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--muted); }
.pblk.sel { z-index: 3; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.pblk.tight { border-radius: var(--r-2xs); }
.pblk.ended { background: var(--grey-soft); }
.pnow { position: absolute; left: -4px; right: 0; z-index: 4; height: 2px; background: var(--now); pointer-events: none; }
.pnow::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--now); }
.pnote { margin-top: var(--sp-5); font-size: var(--fs-mini); color: var(--muted); }

/* ---------- 6. Cartes d'evenements ---------- */
.cards { display: grid; gap: var(--sp-4); }
.ev { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-5); row-gap: var(--sp-2);
      padding: var(--sp-5) var(--sp-6) var(--sp-5) var(--sp-7); border: 1px solid var(--line); border-left: 5px solid var(--ev);
      border-radius: var(--r-sm); background: var(--card); cursor: pointer;
      transition: background-color .15s, box-shadow .15s, border-color .15s; }
.ev > * { grid-column: 1; min-width: 0; }
.ev:hover, .ev.hl { background: color-mix(in srgb, var(--ev) 14%, var(--card)); }
.ev.sel { border-color: var(--accent); border-left-color: var(--ev); box-shadow: 0 0 0 1px var(--accent), var(--shadow-card);
          background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); font-size: var(--fs-meta); }
.ev-time { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.ev-ttl { font-size: var(--fs-body); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-6); font-size: var(--fs-meta); color: var(--muted); }
.it { display: inline-flex; align-items: center; gap: var(--sp-2); }
.it svg { flex: none; }
.ev-link { margin-left: auto; font-weight: var(--fw-semi); color: var(--accent-dark); text-decoration: none; }
a.ev-link:hover, .ev-link a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ev-link a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ev-more { display: none; margin-top: var(--sp-2); padding-top: var(--sp-4); border-top: 1px dashed var(--line);
           font-size: var(--fs-body-s); color: var(--muted); }
.ev.sel .ev-more, .ev.open .ev-more { display: block; }
.ev-chev { grid-column: 2; grid-row: 1 / span 3; align-self: center; display: grid; place-items: center;
           width: var(--chev); height: var(--chev); border-radius: 50%; color: var(--muted); transition: transform .2s, background .15s; }
.ev:hover .ev-chev { background: var(--card-2); }
/* carte depliee (d office ou choisie) : chevron tourne sur fond orange, meme rendu dans les deux cas */
.ev.open .ev-chev, .ev.sel .ev-chev { background: var(--accent); color: var(--on-accent); transform: rotate(90deg); }

/* Rendez-vous termines (heure de fin atteinte) */
.ev.ended { --ev: var(--grey-soft); background: var(--ended-bg); color: var(--muted); }
.ev.ended .ev-ttl, .ev.ended .ev-time { color: var(--muted); }
.ev.ended .src { color: var(--muted); background: transparent; border-color: var(--line); }
.ev.ended .ev-link { opacity: .75; }

/* ---------- 7. Agenda : calendrier mensuel ---------- */
.mbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); margin-bottom: var(--sp-8); }
.mtitle { padding: var(--sp-2) var(--sp-8); border: 1px solid var(--line); border-radius: var(--r-pill); background: none;
          font-size: var(--fs-h3); font-weight: var(--fw-bold); text-transform: capitalize; cursor: pointer;
          transition: border-color .15s, background .15s; }
.mtitle::after { content: " \25BE"; font-size: .8em; color: var(--muted); }
.mtitle:hover { border-color: var(--accent); background: var(--accent-soft); }
.mtitle.sel, .mtitle.sel:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.mtitle.sel::after { color: var(--on-accent); }
.mgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-4); }
.mhd { padding-bottom: var(--sp-2); text-align: center; font-size: var(--fs-mini); font-weight: var(--fw-bold); color: var(--text); }
/* Traits fins : verticaux entre les colonnes de jours (au milieu de l'ecart), horizontal sous Lun...Ven */
.mgrid > * { position: relative; }
.mgrid > :not(:nth-child(5n+1))::before { content: ""; position: absolute; width: 1px; background: var(--line);
  left: calc(-1 * var(--sp-4) / 2 - .5px); top: calc(-1 * var(--sp-4) / 2); bottom: calc(-1 * var(--sp-4) / 2); }
.mgrid > :nth-child(-n+5)::before { top: 0; }
.mhd::after { content: ""; position: absolute; height: 1px; background: var(--line);
  left: calc(-1 * var(--sp-4) / 2); right: calc(-1 * var(--sp-4) / 2); bottom: calc(-1 * var(--sp-4) / 2 - .5px); }
.mhd:first-child::after { left: 0; }
.mhd:nth-child(5)::after { right: 0; }
.mday { position: relative; height: var(--day-h); border: 1px solid transparent; border-radius: var(--r-sm); background: none;
        color: var(--faint); font-size: var(--fs-h3); font-weight: var(--fw-semi); }
.mday.has { border-color: var(--line); background: var(--card); color: var(--text); font-weight: var(--fw-bold); cursor: pointer;
            transition: border-color .15s, background .15s; }
.mday.has:hover { border-color: var(--accent); background: var(--accent-soft); }
.mday.today { border: 2px solid var(--text); color: var(--text); cursor: pointer; }
.mday.today .num::after { content: " auj."; font-size: var(--fs-pill); font-weight: var(--fw-semi); color: var(--accent-dark); }
.mday.past:not(.today) { opacity: .45; }
.mday.sel, .mday.sel:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mday.sel .num::after { color: var(--on-accent); }
.mday .cnt { position: absolute; z-index: 2; right: -6px; bottom: -6px;   /* au-dessus des traits de separation */ box-shadow: 0 0 0 2px var(--card); }
.mday.sel .cnt { background: var(--white); color: var(--accent-dark);
                 box-shadow: 0 0 0 1px var(--accent), 0 0 0 3px var(--card); }   /* cercle discret : pastille blanche visible sur fond blanc */
[data-theme="dark"] .mday.sel .cnt { color: var(--on-accent); box-shadow: 0 0 0 2px var(--card); }   /* rond blanc, tour sombre, sans orange */   /* mode nuit : chiffre fonce sur pastille blanche */
.mhint { margin-top: var(--sp-8); font-size: var(--fs-mini); color: var(--muted); text-align: center; }

/* ---------- 8. Carte des evenements (Leaflet + OpenStreetMap) ---------- */
/* Grille : icone | interrupteur | periode ; dessous, "a distance..." aligne sur le libelle */
.mapbar { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: var(--sp-1) var(--sp-4);
          margin-bottom: var(--sp-6); }
.gps { display: grid; place-items: center; color: var(--accent-dark); }
.geo-sw { display: inline-flex; align-items: center; gap: var(--sp-4); padding: var(--sp-2) 0; border: 0; background: none;
          font-size: var(--fs-body-s); cursor: pointer; }
.geo-sw[aria-checked="false"] .lbl { color: var(--muted); }
.geo-sw:focus-visible .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.geo-off { grid-column: 2 / -1; font-size: var(--fs-meta); color: var(--muted); }
.mapspan { justify-self: end; text-align: right; white-space: nowrap; font-size: var(--fs-mini); color: var(--muted); }
#map { height: var(--map-h); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); z-index: 0; }
.leaflet-container { font: inherit; }
[data-theme="dark"] #map .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
[data-theme="dark"] .leaflet-control-attribution { background: var(--map-attrib-bg); color: var(--muted); }
[data-theme="dark"] .leaflet-control-attribution a { color: var(--accent-dark); }

/* Pastilles des lieux et regroupements */
.mpin { display: grid; place-items: center; }
.mpin span { display: grid; place-items: center; width: var(--pin); height: var(--pin); border-radius: 50%; cursor: pointer;
             background: var(--accent); color: var(--on-accent); border: 2px solid var(--white);
             font-size: var(--fs-body-s); font-weight: var(--fw-bold); box-shadow: var(--shadow-pin); transition: transform .15s; }
.mpin:hover span { transform: scale(1.1); }
.mpin.sel span { background: var(--on-accent); color: var(--white); border-color: var(--accent); }
.mclu span { width: var(--clu); height: var(--clu); background: var(--accent); font-size: var(--fs-body);
             box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow-pin); }
.mtip { padding: var(--sp-2) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--card);
        color: var(--text); font-size: var(--fs-meta); line-height: var(--lh-snug); box-shadow: var(--shadow-card); }
.mtip::before { display: none; }

/* Liste des lieux (colonne droite) */
.places { display: grid; gap: var(--sp-3); list-style: none; }
.place-row { width: 100%; display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-4) var(--sp-5);
             border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); text-align: left; cursor: pointer;
             transition: border-color .15s, background .15s; }
.place-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.place-row .pi { display: grid; place-items: center; color: var(--accent-dark); }
.place-row .pn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.place-row .pn b { font-size: var(--fs-body-s); }
.place-row .pn small { font-size: var(--fs-mini); color: var(--muted); }
.place-row > svg { color: var(--muted); }
.place-row.off { margin-top: var(--sp-6); border-style: dashed; }
.place-row.off .cnt { background: var(--grey-soft); color: var(--text); }

/* ---------- 9. Panneau Filtres (remplace les cartes dans la colonne droite) ---------- */
.fpanel { display: flex; flex-direction: column; min-height: 100%; }
.xbtn { margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%;
        background: none; color: var(--muted); cursor: pointer; }
.xbtn:hover { background: var(--card-2); color: var(--text); }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-9); padding: var(--sp-9) var(--sp-8); }
.fgrp { min-width: 0; border: 0; }
.fgrp legend, .fgrp .lgd { display: block; margin-bottom: var(--sp-5); font-size: var(--fs-body-s); font-weight: var(--fw-bold); }
.chk { display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-2) 0; font-size: var(--fs-body-s); cursor: pointer; }
.chk input { flex: none; width: 16px; height: 16px; margin-top: .15em; accent-color: var(--accent); cursor: pointer; }   /* case alignee sur la 1re ligne du texte */
.chk .c { color: var(--muted); }
.chkrow { display: flex; align-items: center; gap: var(--sp-2); }
.info { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none;
        color: var(--muted); cursor: pointer; }
.info:hover, .info[aria-expanded="true"] { color: var(--accent-dark); background: var(--accent-soft); }
.fsel { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); border: 1px solid var(--line);
        border-radius: var(--r-xs); color: var(--accent-dark); }
.fsel select { flex: 1; min-width: 0; padding: var(--sp-3) 0; border: 0; background: none; color: var(--text);
               font-size: var(--fs-body-s); outline: none; cursor: pointer; }
.fsel:focus-within { border-color: var(--accent); }
.fsel select option { background: var(--card); color: var(--text); }
.fnote { display: flex; gap: var(--sp-4); margin: 0 var(--sp-8); padding: var(--sp-5) var(--sp-6); border: 1px solid var(--pill-border);
         border-radius: var(--r-sm); background: var(--accent-soft); font-size: var(--fs-meta); color: var(--text); }
.fnote svg { flex: none; margin-top: 2px; color: var(--accent-dark); }
.ffoot { position: sticky; bottom: 0; margin-top: auto; display: flex; justify-content: flex-end; gap: var(--sp-5);
         padding: var(--sp-6) var(--sp-8); background: var(--card); border-top: 1px solid var(--line); }
.btn { height: var(--ctl-h); padding: 0 var(--sp-8); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card);
       font-size: var(--fs-body-s); font-weight: var(--fw-semi); cursor: pointer; transition: border-color .15s, background .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }   /* cliquable */
/* Survol de "Reinitialiser" (actif = des filtres existent) : fond orange, et "Appliquer" parait desactive */
#fReset:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ffoot:has(#fReset:hover:not(:disabled)) #fApply { opacity: .4; }
.btn-pri { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn-pri:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- 10. Tablette et mobile ---------- */
/* Tablette : colonnes empilees (outil de navigation au-dessus, rendez-vous en dessous) */
@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .rpane { position: static; overflow: visible; }
  .rhead { position: static; }
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Elements propres au mobile, caches sur PC : loupe, libelles courts, fond du panneau Filtres */
#qBtn, .tab .sh, .sub .sh, .src .sh, .ev-time .sh, .mhint .sh, .sheet-bg { display: none; }

/* Mobile et tablette (<= 900 px), pense "mobile d abord" : meme fonctionnement que sur PC, une seule colonne.
   - Barre fixe en haut (titre, loupe, Filtres, Mode nuit en icones) + ligne d'infos + 3 onglets :
     seul le contenu dessous defile.
   - Outil de l'onglet (dates + frise, calendrier, carte) puis la liste des rendez-vous dessous.
   - Filtres : panneau qui monte du bas, boutons toujours visibles, fond assombri (toucher = fermer).
   - iPhone / Android : zones tactiles >= 40 px, encoche et barre du bas (env(safe-area-inset-*)),
     champ de recherche en 16 px (sinon iOS zoome), pas de surbrillance grise au toucher. */
@media (max-width: 900px) {   /* telephone ET tablette : meme interface tactile */
  body { padding: 0; -webkit-text-size-adjust: 100%; }
  button, a, [tabindex] { -webkit-tap-highlight-color: transparent; }
  .frame { border: 0; border-radius: 0; box-shadow: none; overflow: visible; }   /* sinon la barre ne reste pas collee */
  .topbar { position: sticky; top: 0; z-index: 1100; box-shadow: var(--shadow-card); }

  /* Barre orange : titre sur 2 lignes, panneau travaux, 3 icones a droite ; recherche depliee dessous */
  .banner { flex-wrap: wrap; gap: var(--sp-3) var(--sp-3);
            padding: calc(var(--sp-4) + env(safe-area-inset-top)) calc(var(--sp-5) + env(safe-area-inset-right))
                     var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-left)); }
  .banner { flex-wrap: wrap; }
  .banner h1 { flex: 1 1 0; min-width: 0; font-size: var(--fs-h1-m); }   /* prend la place restante, passe a la ligne tout seul */
  /* Panneau travaux = icone de la meme taille que la loupe ; le toucher deroule l avertissement sous la barre */
  .wip-btn { display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-sm); background: var(--card);
             box-shadow: var(--shadow-sm); cursor: pointer; }
  .wip-btn[aria-expanded="true"] { background: var(--accent-mid); }
  .wip { height: var(--logo-h-m); filter: none; }

  /* Avertissement travaux : boite arrondie au milieu de l ecran ; un toucher n importe ou (meme dedans) la ferme */
  .wip-tip { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: calc(100vw - 2 * var(--sp-10)); max-width: 340px;
             padding: var(--sp-9) var(--sp-8); border-radius: var(--r-lg); font-size: var(--fs-body); box-shadow: var(--shadow-sheet); }
  /* Filtres : sans survol au doigt, Reinitialiser passe en orange des qu un filtre est actif */
  #fReset:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .wip-tip::before { display: none; }
  .bn-tools { display: contents; }
  #qBtn { display: inline-flex; }
  .bn-btn { position: relative; justify-content: center; width: var(--tap); height: var(--tap); padding: 0; flex: none; }
  .bn-btn svg { width: var(--icon); height: var(--icon); }
  .bn-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bn-theme .sw { display: none; }
  .bn-btn.act .fn { position: absolute; top: calc(-1 * var(--sp-2)); right: calc(-1 * var(--sp-2)); width: var(--badge-m); height: var(--badge-m);
                    box-shadow: 0 0 0 2px var(--accent); }
  .bn-btn.act .fn svg { width: 12px; height: 12px; }
  #qBtn[aria-expanded="true"] { background: var(--accent-mid); }
  .search { display: none; order: 10; flex-basis: 100%; width: auto; height: var(--tap); }
  .banner.sopen .search { display: flex; }
  .search input { font-size: 16px; }   /* 16 px minimum : sinon Safari iOS zoome sur le champ */
  .search kbd { display: none; }
  .search .clr { width: 32px; height: 32px; }

  /* Ligne d'infos courte, puis 3 onglets de meme largeur */
  .navbar { padding: 0 calc(var(--sp-4) + env(safe-area-inset-right)) 0 calc(var(--sp-4) + env(safe-area-inset-left)); }
  .sub { order: -1; flex-basis: 100%; margin-left: 0; text-align: left; white-space: normal; padding: var(--sp-3) var(--sp-1) var(--sp-2); }
  .sub .lg, .tab .lg { display: none; }
  .sub .sh, .tab .sh, .src .sh { display: inline; }
  .src .lg, .ev-time .lg, .mhint .lg { display: none; }   /* pastilles courtes "national", "mail", "terminé" ; horaire "16:00-17:00" */
  .ev-time .sh, .mhint .sh { display: inline; }
  .ft-pc { display: none; }   /* pied de page court sur mobile */
  body[data-tab="jour"] .tpill { display: none; }   /* pas de pastille "aujourd hui" dans Prochains (la date du jour garde sa mention) */
  .tabs { width: 100%; flex-basis: 100%; }
  .tab { flex: 1 1 0; justify-content: center; gap: var(--sp-3); min-height: var(--tap);
         padding: var(--sp-4) var(--sp-2) calc(var(--sp-4) - 3px); font-size: var(--fs-meta); }

  /* Une colonne : outil de navigation, puis les rendez-vous */
  .cols { padding: var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-right)) var(--sp-8) calc(var(--sp-4) + env(safe-area-inset-left));
          gap: var(--sp-5); }
  .col-left { padding: var(--sp-5) var(--sp-4); }
  .rhead { padding: var(--sp-4) var(--sp-5); min-height: 0; }
  .rhead h2 { font-size: var(--fs-h3); }   /* meme taille que les titres de jour (.dayh) */
  .rbody { padding: var(--sp-5) var(--sp-4) var(--sp-6); }
  .ev, .rhead, .dayh { scroll-margin-top: calc(var(--top-h, 0px) + var(--sp-4)); }
  .ev { padding: var(--sp-5) var(--sp-4) var(--sp-5) var(--sp-6); column-gap: var(--sp-3); }
  .ev-link { margin-left: 0; }
  .dayh + .cards, .dayh + .places { margin-left: var(--sp-4); }
  footer { padding: 0 var(--sp-6) calc(var(--sp-9) + env(safe-area-inset-bottom)); }

  /* Prochains evenements : boutons ronds plus grands, frise un peu plus serree a gauche */
  .nav { width: 36px; height: 36px; }
  .chip { height: var(--chip-h-m); }
  .planbox { padding-left: var(--plan-gutter-m); }
  .pblk { font-size: var(--fs-blk-m); letter-spacing: -.02em; }   /* duree plus petite : "2h30" tient dans 3-4 colonnes */
  /* Onglet Prochains : comme l ancienne version, dates sur toute la largeur puis frise a gauche et
     cartes a droite cote a cote (vue d un coup d oeil) ; la frise reste visible quand on fait defiler */
  body[data-tab="jour"] .cols { grid-template-columns: minmax(0, var(--plan-col-m)) minmax(0, 1fr); column-gap: var(--sp-3); row-gap: var(--sp-3); }
  body[data-tab="jour"] .col-left, body[data-tab="jour"] #vJour { display: contents; }
  /* dates collees sous la barre, frise collee sous les dates : seule la liste des cartes defile */
  body[data-tab="jour"] .days { position: sticky; top: calc(var(--top-h, 0px) + var(--sp-5));   /* meme ecart sous les onglets qu au repos : rien ne bouge */ z-index: 6; box-shadow: 0 calc(-1 * var(--sp-5)) 0 var(--bg);
                                grid-column: 1 / -1; margin: 0; padding: var(--sp-3) var(--sp-2); background: var(--card);
                                border: 1px solid var(--line); border-radius: var(--r-lg); }
  body[data-tab="jour"] .planbox { grid-column: 1; align-self: start; position: static;   /* frise et cartes defilent ensemble, a l identique (la frise collante bougeait de facon irreguliere) */
                                   padding: var(--sp-4) var(--sp-2) var(--sp-4) var(--plan-gutter-m); background: var(--card);
                                   border: 1px solid var(--line); border-radius: var(--r-lg); }
  body[data-tab="jour"] .col-right { grid-column: 2; }
  body[data-tab="jour"] .rbody { padding: var(--sp-3); }
  body[data-tab="jour"] .rhead { padding: var(--sp-3); }
  .sort { display: none; }   /* pas de "Trier par" sur telephone (place) : tri par heure */
  /* Prochains : ni date ni nombre au-dessus des cartes (deja dans le selecteur de dates) ; cartes repliees
     sans le lieu (il apparait quand on touche la carte) ; horaire et pastille sur une ligne */
  body[data-tab="jour"] .rpane > .rhead { display: none; }
  body[data-tab="jour"] .ev:not(.sel):not(.open) .ev-loc { display: none; }
  .ev-top { gap: var(--sp-1) var(--sp-3); }   /* pastille courte : tient a cote de l horaire */
  .ev-time { white-space: nowrap; font-size: var(--fs-time-m); }
  .ev .src { flex: none; }
  .ev, .rhead, .dayh { scroll-margin-top: calc(var(--top-h, 0px) + var(--sp-5) + var(--days-h, 0px) + var(--sp-4)); }
  .ph { left: calc(-1 * var(--plan-gutter-m)); width: calc(var(--plan-gutter-m) - var(--sp-3)); }

  /* Calendrier */
  .mgrid { gap: var(--sp-3); }
  .mday { height: var(--day-h-m); }
  .mday .cnt { right: -4px; bottom: -4px; min-width: 18px; height: 18px; line-height: 18px; font-size: var(--fs-micro); padding: 0 var(--sp-2); }
  .mhint { margin-top: var(--sp-6); }

  /* Carte : assez haute pour s'en servir, assez basse pour pouvoir faire defiler la page a cote */
  #map { height: auto; aspect-ratio: 1 / 1; }   /* carte carree : on voit la liste dessous */
  /* assez de place sous la liste pour qu un toucher sur la carte puisse la faire remonter sous la barre */
  body[data-tab="carte"] .col-right { min-height: calc(100vh - var(--top-h, 0px) - var(--sp-8)); }
  .mapspan { grid-column: 2 / -1; justify-self: start; text-align: left; }   /* periode sous le libelle */

  /* Panneau Filtres : monte du bas de l'ecran */
  .sheet-bg { position: fixed; inset: 0; z-index: 1250; background: var(--backdrop); }
  body.panel-open { overflow: hidden; }
  body.panel-open .sheet-bg { display: block; }
  .fpanel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300; min-height: 0; max-height: 94vh; max-height: 94dvh;
            overflow-y: auto; overscroll-behavior: contain; background: var(--card);
            border-radius: var(--sheet-r) var(--sheet-r) 0 0; box-shadow: var(--shadow-sheet); animation: sheet-up .22s ease-out; }
  .fpanel::before { content: ""; display: block; width: 40px; height: 4px; margin: var(--sp-4) auto 0; border-radius: var(--r-pill);
                    background: var(--line); }
  .fpanel .rhead { position: static; }
  .fpanel > * { flex-shrink: 0; }   /* panneau plus haut que l ecran (iPhone) : il defile, sans ecraser l en-tete "Filtres" */
  .fgrid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); padding: var(--sp-4) var(--sp-8) var(--sp-5); }   /* compact : tout tient sans faire glisser le panneau */
  .fgrp legend, .fgrp .lgd { margin-bottom: var(--sp-2); }
  .chk { padding: var(--sp-2) 0; font-size: var(--fs-filter-m); }   /* meme taille pour cases et liste des lieux */
  .chk input { width: 20px; height: 20px; }
  .fsel select { font-size: var(--fs-filter-m); padding: var(--sp-4) 0; }
  .fnote { margin: 0 var(--sp-8) var(--sp-4); }
  .ffoot { flex-wrap: wrap; gap: var(--sp-4); padding: var(--sp-4) var(--sp-8) calc(var(--sp-4) + env(safe-area-inset-bottom)); }
  .ffoot .btn { flex: 1 1 auto; height: var(--tap-l); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fpanel, .wip-tip { animation: none; } }
/* Tablette (701-900 px) : interface mobile, avec un peu plus d air pour la lecture */
@media (min-width: 701px) and (max-width: 900px) {
  .banner { padding-left: calc(var(--sp-10) + env(safe-area-inset-left)); padding-right: calc(var(--sp-10) + env(safe-area-inset-right)); }
  .navbar { padding-left: var(--sp-9); padding-right: var(--sp-9); }
  .cols { padding: var(--sp-8) var(--sp-9) var(--sp-10); gap: var(--sp-8); }
  .col-left { padding: var(--sp-8); }
  .rbody { padding: var(--sp-6) var(--sp-8) var(--sp-8); }
  #map { aspect-ratio: 16 / 10; }   /* carre trop haut sur tablette */
}
/* Petits telephones (iPhone SE, 320-375 px) */
@media (max-width: 380px) {
  .banner h1 { font-size: var(--fs-h1-s); }
}
/* Tres petits ecrans (< 340 px) : onglets sans icone */
@media (max-width: 340px) {
  .tab svg { display: none; }
}
