/* ═══════════════════════════════════════════════════════
   calendrier.css — Commerce Éthique
   Direction : LIQUID GLASS iOS 2026.
   Le marché n'est plus un panneau de liège papier, c'est une
   vitrine de verre dépoli posée sur une aurore de marché à
   l'aube : pêche, sauge, ciel (clair) / émeraude, nuit, prune
   (sombre). Chaque surface (topbar, tickets, cartes, modales)
   est une plaque de verre translucide, à bord lumineux, qui
   laisse deviner l'aurore en dessous. Un reflet diagonal balaie
   lentement les surfaces principales — la signature du thème.

   Typo : inchangée dans son intention (serif éditorial /
          sans système / mono "billet"), mais les rayons de
          coin s'élargissent en "squircle" continu, signature
          géométrique du verre liquide.

   ── STRUCTURE EN 3 FICHIERS ─────────────────────────────
   Ce fichier contient le socle commun (design tokens, tous
   les composants, layout desktop par défaut — "mobile last",
   c'est-à-dire pensé pour grand écran et adapté ensuite).
   Deux fichiers complémentaires affinent le rendu :
     - calendrier-tablet.css  (≤ 1024px, tablette / petit portable)
     - calendrier-mobile.css  (≤ 640px, puis ≤ 380px téléphone étroit)

   À inclure dans le <head>, DANS CET ORDRE (la cascade CSS
   dépend de cet ordre : chaque fichier surcharge le précédent) :

     <link rel="stylesheet" href="calendrier.css">
     <link rel="stylesheet" href="calendrier-tablet.css">
     <link rel="stylesheet" href="calendrier-mobile.css">

   Les deux fichiers responsives utilisent uniquement des
   @media (max-width) qui viennent AFFINER ce socle — jamais
   le dupliquer. Ils héritent donc de toutes les règles
   ci-dessous tant qu'ils ne les surchargent pas explicitement.
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Typographie (inchangée) ──────────────────────── */
  --f-display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --f-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono:    ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;

  /* ── Aurore de fond (clair, défaut) ───────────────── */
  --bg-1: #FFE9C7;  /* pêche d'aube */
  --bg-2: #CBEBD8;  /* sauge */
  --bg-3: #BFE2EF;  /* ciel pâle */
  --bg-4: #F6E3EF;  /* blush, touche discrète */

  --ink:   #15241D;
  --ink-2: rgba(21,36,29,0.64);
  --ink-3: rgba(21,36,29,0.42);
  --ink-4: rgba(21,36,29,0.22);

  /* ── Verre ─────────────────────────────────────────── */
  --glass:        rgba(255,255,255,0.40);
  --glass-soft:   rgba(255,255,255,0.24);
  --glass-strong: rgba(255,255,255,0.62);
  --glass-border:      rgba(255,255,255,0.70);
  --glass-border-soft: rgba(255,255,255,0.32);
  --glass-shine:  rgba(255,255,255,0.85);
  --glass-shadow:    0 8px 28px rgba(21,36,29,0.14), 0 1px 1px rgba(21,36,29,0.06);
  --glass-shadow-lg: 0 22px 60px rgba(21,36,29,0.20), 0 4px 14px rgba(21,36,29,0.10);
  --blur:    22px;
  --blur-lg: 34px;

  --acc:    #1E8F5E;  /* vert forêt vif — accent principal */
  --acc-2:  #E3A73A;  /* or — accent secondaire, halos */
  --acc-bg: rgba(30,143,94,0.16);
  --acc-bd: rgba(30,143,94,0.40);

  --hh: 56px;
  --nh: 68px;
  --gap: 12px;
  --r:    26px;  /* squircle continu — signature Liquid Glass */
  --r-sm: 16px;
  --r-lg: 34px;
  --r-pill: 999px;

  /* ── Espace tactile minimal (accessibilité, cf. calendrier-mobile.css) ── */
  --tap-min: 44px;

  /* ── Zones sûres (encoches / barres système, cf. mobile) ── */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* ── Couleurs de catégories — pastilles lumineuses sur verre ── */
  --c-concert:    #A566A0;
  --c-conference: #5C7FC2;
  --c-marche:     #1E8F5E;
  --c-atelier:    #E3A73A;
  --c-sport:      #37A2A8;
  --c-festival:   #D6B22C;
  --c-projection: #7597CC;
  --c-autre:      #9C9587;
}

/* Le dark mode du site est piloté par darkmod.js, qui pose la classe
   .dark-mode (ou .light-mode) sur <body> — pas un attribut data-theme.
   On branche donc nos tokens sur cette classe pour rester la seule
   source de vérité (cf. l'en-tête de darkmod.js). */
body.dark-mode {
  --bg-1: #071B18;  /* émeraude profond */
  --bg-2: #0B2A3D;  /* bleu nuit */
  --bg-3: #241435;  /* prune */
  --bg-4: #150E29;  /* indigo, touche discrète */

  --ink:   #F1F0E4;
  --ink-2: rgba(241,240,228,0.68);
  --ink-3: rgba(241,240,228,0.44);
  --ink-4: rgba(241,240,228,0.22);

  --glass:        rgba(255,255,255,0.08);
  --glass-soft:   rgba(255,255,255,0.05);
  --glass-strong: rgba(255,255,255,0.15);
  --glass-border:      rgba(255,255,255,0.24);
  --glass-border-soft: rgba(255,255,255,0.11);
  --glass-shine:  rgba(255,255,255,0.5);
  --glass-shadow:    0 8px 28px rgba(0,0,0,0.42), 0 1px 1px rgba(0,0,0,0.3);
  --glass-shadow-lg: 0 26px 70px rgba(0,0,0,0.58), 0 6px 18px rgba(0,0,0,0.36);

  --acc:    #6FE3A6;
  --acc-2:  #F2C368;
  --acc-bg: rgba(111,227,166,0.16);
  --acc-bd: rgba(111,227,166,0.40);
}

/* ── App Shell ───────────────────────────────────────── */
body.cal-app {
  /* `height` (pas seulement `min-height`) est indispensable : sans
     hauteur bornée sur le conteneur racine, les enfants flex ne
     savent jamais où s'arrêter et le scroll interne ne s'active
     nulle part (c'était le bug : rien ne défilait, dans aucune vue). */
  height: 100vh;
  height: 100dvh; /* hauteur dynamique — évite le saut au scroll mobile, cf. mobile */
  min-height: 0;
  font-family: var(--f-body);
  color: var(--ink);
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Aurore animée — fixe derrière tout le contenu, dérive lentement */
body.cal-app::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -1;
  background:
    radial-gradient(38% 42% at 14% 8%,  var(--bg-1) 0%, transparent 70%),
    radial-gradient(46% 50% at 88% 18%, var(--bg-3) 0%, transparent 72%),
    radial-gradient(50% 55% at 30% 92%, var(--bg-2) 0%, transparent 72%),
    radial-gradient(40% 45% at 92% 88%, var(--bg-4) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg-3));
  filter: saturate(115%);
  animation: aurora-drift 42s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-2.5%, 2%, 0) scale(1.06); }
}

/* ── Marque ──────────────────────────────────────────── */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-mark { font-size: 20px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.18)); }
.logo-text {
  font-family: var(--f-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.2;
  white-space: nowrap;
}
.logo-text strong { color: var(--ink); font-weight: 700; }

/* ── Main Area ───────────────────────────────────────── */
.cal-main {
  flex: 1;
  min-width: 0;  /* évite les débordements horizontaux sur flex enfants */
  min-height: 0; /* essentiel : sans ça, ce conteneur flex grandit avec
                    son contenu au lieu de le border, et .cal-body plus
                    bas ne peut jamais devenir scrollable */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   SURFACE DE VERRE — règle commune à toutes les plaques
   translucides (topbar, filter-bar, tickets, cartes,
   modales). Un dégradé de bordure imite le bord réfractant
   du verre : lumineux en haut-gauche, sourd en bas-droite.
══════════════════════════════════════════════════════ */
.topbar,
.filter-bar,
.mini-cal-panel,
.fb-date-btn,
.sb-input-wrap,
.cat-pill,
.fb-theme-btn,
.pm-card,
.wg-day-head,
.wev,
.day-ev-card,
.mc-card,
.modal-box,
.agenda-box,
.toast,
.mbtn,
.mbtn-primary,
.dev-cat-pill,
.mc-cat-pill,
.modal-meta-row,
.modal-tag,
.related-card,
.cal-error,
.agenda-choice {
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
}

/* Reflet en balayage — signature du thème.
   Une bande de lumière diagonale traverse lentement la barre,
   comme la lumière qui glisse sur du verre.
   Ce reflet vit dans un calque dédié (.topbar-sheen), PAS
   directement en overflow:hidden sur .topbar : sinon tout élément
   qui a besoin de déborder de la barre (le panneau du sélecteur de
   date, par ex.) se ferait rogner en même temps que le reflet —
   c'est exactement le bug qu'on a eu avec .mini-cal-panel. */
.topbar, .filter-bar { position: sticky; }
.topbar-sheen {
  position: absolute;
  inset: 0;
  z-index: -1; /* sous le contenu normal de la barre, au-dessus du fond */
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.topbar-sheen::after, .filter-bar::after {
  content: "";
  position: absolute;
  top: -60%; left: -30%;
  width: 55%; height: 220%;
  background: linear-gradient(
    75deg,
    transparent 0%,
    rgba(255,255,255,0.22) 45%,
    rgba(255,255,255,0.02) 60%,
    transparent 100%
  );
  transform: rotate(8deg);
  pointer-events: none;
  animation: glass-sheen 9s ease-in-out infinite;
}
body.dark-mode .topbar-sheen::after,
body.dark-mode .filter-bar::after {
  background: linear-gradient(
    75deg,
    transparent 0%,
    rgba(255,255,255,0.10) 45%,
    rgba(255,255,255,0.01) 60%,
    transparent 100%
  );
}
.filter-bar::after { animation-delay: 3.2s; }
@keyframes glass-sheen {
  0%, 100% { left: -30%; opacity: 0; }
  35%      { opacity: 1; }
  60%      { left: 120%; opacity: 0; }
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  top: calc(10px + var(--safe-t));
  margin: 10px 12px 0;
  height: var(--hh);
  background: var(--glass);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
  display: flex;
  align-items: center;
  gap: 14px;
  /* Reçoit désormais aussi le sélecteur de date, la recherche et le
     compteur — anciennement dans .filter-bar, fusionnée ici pour que
     tout tienne sur une seule ligne au lieu de deux barres empilées. */
  padding: 0 18px;
  z-index: 50;
}

.topbar-nav { display: flex; align-items: center; gap: 6px; }
.nav-arr {
  width: 32px; height: 32px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-soft);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s, transform .12s, box-shadow .16s;
}
.nav-arr:hover { background: var(--acc-bg); color: var(--acc); box-shadow: 0 0 0 1px var(--acc-bd); }
.nav-arr:active { transform: scale(.92); }
.nav-today {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--acc-bd);
  background: linear-gradient(180deg, rgba(255,255,255,.22), transparent), var(--acc-bg);
  color: var(--acc);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: background .16s, box-shadow .16s;
}
.nav-today:hover { background: var(--acc); color: #fff; box-shadow: 0 4px 16px var(--acc-bd); }
.period-lbl {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-left: 4px;
  white-space: nowrap;
}

.topbar-views {
  display: flex;
  gap: 3px;
  margin-left: auto;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-pill);
  padding: 4px;
}
.tvtab {
  height: 26px;
  padding: 0 13px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.tvtab:hover { color: var(--ink-2); }
.tvtab.is-active {
  background: var(--acc);
  color: #fff;
  box-shadow: 0 2px 10px var(--acc-bd);
}

.topbar-stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-left: 12px;
  flex-shrink: 0;
}
.topbar-stat-n {
  font-family: var(--f-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--acc);
  line-height: 1;
}
.topbar-stat-l {
  font-size: 11px;
  color: var(--ink-3);
}

/* ══════════════════════════════════════════════════════
   BARRE DE FILTRES — plaque de verre flottante détachée,
   dans l'esprit des barres d'outils "Liquid Glass".
══════════════════════════════════════════════════════ */
.filter-bar {
  top: calc(var(--hh) + 20px + var(--safe-t));
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 10px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
  z-index: 40;
  /* Toujours sur une seule ligne : le débordement est géré par
     .fb-cats en interne (voir plus bas), jamais par la barre
     entière. Mettre overflow-x:auto ici forçait overflow-y:auto
     par la même occasion, ce qui rognait le panneau .mini-cal-panel
     qui s'ouvre en dessous — c'était le bug du sélecteur de date
     invisible au clic. */
  overflow: visible;
}

/* ── Sélecteur de date ── */
.fb-datepick { position: relative; flex-shrink: 0; }
.fb-date-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s;
}
.fb-date-btn:hover { background: var(--acc-bg); color: var(--acc); border-color: var(--acc-bd); }
.fb-date-chevron { font-size: 9px; transition: transform .16s; }
.fb-datepick:has(.mini-cal-panel.is-open) .fb-date-chevron { transform: rotate(180deg); }

.mini-cal-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 264px;
  max-width: calc(100vw - 24px);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--glass-shadow-lg), inset 0 1px 0 var(--glass-shine);
  padding: 14px;
  z-index: 80;
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.mini-cal-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}
#miniCalLabel {
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.mini-cal-nav { display: flex; gap: 4px; }
.mini-cal-nav button {
  width: 25px; height: 25px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-soft);
  color: var(--ink-2);
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .14s;
}
.mini-cal-nav button:hover { background: var(--acc-bg); color: var(--acc); }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.mini-dh {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-4);
  text-align: center;
  padding: 2px 0;
  letter-spacing: .04em;
}
.mini-d {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .14s;
}
.mini-d:hover { background: var(--acc-bg); }
.mini-d.ghost { color: var(--ink-4); cursor: default; }
.mini-d.ghost:hover { background: transparent; }
.mini-d.is-today {
  background: var(--acc);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--acc-bd);
}
.mini-d.is-today:hover { background: var(--acc); }
.mini-d.is-sel {
  background: var(--acc-bg);
  color: var(--acc);
  font-weight: 600;
}

/* ── Recherche ── */
.fb-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 160px;   /* peut rétrécir plutôt que forcer .topbar à déborder */
  max-width: 260px;
  min-width: 0;
}
.sb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  border-radius: var(--r-pill);
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  transition: border-color .16s;
}
.sb-input-wrap:focus-within { border-color: var(--acc-bd); }
.sb-input-icon {
  position: absolute;
  left: 12px;
  font-size: 12px;
  color: var(--ink-3);
  pointer-events: none;
}
.sb-input {
  width: 100%;
  height: 36px;
  padding: 0 10px 0 32px;
  background: transparent;
  border: none;
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 12px;
  outline: none;
}
.sb-input::placeholder { color: var(--ink-3); }
.sb-submit {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--acc-bd);
  border-radius: var(--r-pill);
  background: var(--acc-bg);
  color: var(--acc);
  font-size: 13px;
  cursor: pointer;
  transition: background .16s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
}
.sb-submit:hover { background: var(--acc); color: #fff; }

/* ── Catégories : pastilles de verre défilables ── */
.fb-cats {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 120px;
}
.fb-cats::-webkit-scrollbar { display: none; }

.cat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 13px;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-pill);
  background: var(--glass-soft);
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.cat-pill:hover { background: var(--acc-bg); }
.cat-pill.is-active {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
  box-shadow: 0 3px 12px var(--acc-bd);
}
.cat-pill-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-4);
  box-shadow: 0 0 6px currentColor;
}
.cat-pill-dot.concert    { background: var(--c-concert); }
.cat-pill-dot.conference { background: var(--c-conference); }
.cat-pill-dot.marche     { background: var(--c-marche); }
.cat-pill-dot.atelier    { background: var(--c-atelier); }
.cat-pill-dot.sport      { background: var(--c-sport); }
.cat-pill-dot.festival   { background: var(--c-festival); }
.cat-pill-dot.projection { background: var(--c-projection); }
.cat-pill-dot.autre      { background: var(--c-autre); }

/* ── Thème ── */
.fb-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-pill);
  background: var(--glass-soft);
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  transition: background .16s;
}
.fb-theme-btn:hover { background: var(--acc-bg); color: var(--acc); }
/* Le bouton clair/sombre du calendrier est retiré : le basculement
   de thème est déjà géré globalement par header.php. On garde la
   règle ci-dessus pour ne rien casser si le bouton reste dans le
   HTML ailleurs sur le site, mais dans le calendrier il disparaît —
   et libère de la place dans la filter-bar, utile sur mobile. */
.fb-theme-btn { display: none; }

/* ── Loader ──────────────────────────────────────────── */
.cal-loader {
  position: fixed;
  /* Recalé : une seule barre désormais (topbar + filter-bar fusionnées),
     donc plus besoin de compenser la hauteur de deux bandeaux empilés. */
  top: calc(var(--hh) + 20px + var(--safe-t));
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  transition: opacity .2s;
}
.cal-loader.is-on { opacity: 1; }
.loader-ring {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--acc), transparent);
  animation: load-slide 1.2s ease-in-out infinite;
}
@keyframes load-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── Error ───────────────────────────────────────────── */
.cal-error {
  margin: 16px;
  padding: 14px 16px;
  background: rgba(182,58,53,.14);
  border: 1px solid rgba(182,58,53,.36);
  border-radius: var(--r-sm);
  color: #B63A35;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: var(--glass-shadow);
}

/* ── Calendar Body ───────────────────────────────────── */
.cal-body {
  flex: 1;
  min-height: 0; /* idem .cal-main : condition pour que overflow:auto
                    ci-dessous ait réellement un effet */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* le scroll interne ne "fuit" plus vers la page */
  padding: var(--gap);
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border-soft) transparent;
}
.cal-body::-webkit-scrollbar { width: 4px; }
.cal-body::-webkit-scrollbar-thumb { background: var(--glass-border-soft); border-radius: 4px; }

.cal-view { display: none; }
.cal-view.is-active { display: block; }

/* ══════════════════════════════════════════════════════
   VUE MOIS — mur pêle-mêle : les photos deviennent des
   plaquettes de verre encadrées de blanc dépoli, posées en
   vrac. La légende repose sur un voile de verre sombre
   plutôt qu'un simple fondu noir opaque.
══════════════════════════════════════════════════════ */
.month-pele {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 30px 22px;
  padding: 20px 14px 40px;
}

.pm-card {
  position: relative;
  width: 178px;
  aspect-ratio: 4 / 5;
  flex-shrink: 0;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-soft);
  box-shadow: var(--glass-shadow-lg), inset 0 1px 0 var(--glass-shine);
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .2s cubic-bezier(.32,1,.28,1), box-shadow .2s;
}
.pm-card:hover, .pm-card:focus-visible {
  transform: rotate(0deg) scale(1.06) translateY(-4px);
  box-shadow: var(--glass-shadow-lg), 0 0 0 1px var(--acc-bd);
  z-index: 5;
  outline: none;
}
.pm-card.is-today { border-color: var(--acc-bd); box-shadow: var(--glass-shadow-lg), 0 0 0 1.5px var(--acc); }

/* Reflet de verre en haut de carte plutôt que ruban adhésif */
.pm-pin {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.30), transparent);
  z-index: 3;
  pointer-events: none;
  border-radius: var(--r) var(--r) 0 0;
}
body.dark-mode .pm-pin { background: linear-gradient(180deg, rgba(255,255,255,.14), transparent); }

.pm-photo, .pm-photo-ph {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.pm-photo-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
  background: linear-gradient(160deg, var(--acc-bg), var(--glass-soft));
}

/* Voile de verre sombre en bas pour la légende incrustée */
.pm-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 34%, rgba(8,16,12,.78));
  backdrop-filter: blur(0px);
  pointer-events: none;
}

.pm-cat-flag {
  position: absolute; top: 9px; left: 9px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  box-shadow: var(--glass-shadow);
}
.pm-date-tag {
  position: absolute; top: 9px; right: 9px;
  background: rgba(30,143,94,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 9px; font-weight: 700;
  line-height: 1.15;
  text-align: center;
  border-radius: 10px;
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.3);
}
.pm-date-tag b { display: block; font-size: 14px; }

.pm-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
  color: #fff;
}
.pm-cap-top {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .03em;
  color: rgba(255,255,255,.78);
}
.pm-cap-title {
  font-family: var(--f-display);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.pm-cap-lieu {
  font-size: 10px;
  color: rgba(255,255,255,.72);
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Catégorie = teinte du reflet supérieur */
.pm-card.cat-concert    .pm-pin { background: linear-gradient(180deg, rgba(165,102,160,.40), transparent); }
.pm-card.cat-conference .pm-pin { background: linear-gradient(180deg, rgba(92,127,194,.40), transparent); }
.pm-card.cat-marche     .pm-pin { background: linear-gradient(180deg, rgba(30,143,94,.40), transparent); }
.pm-card.cat-atelier    .pm-pin { background: linear-gradient(180deg, rgba(227,167,58,.40), transparent); }
.pm-card.cat-sport      .pm-pin { background: linear-gradient(180deg, rgba(55,162,168,.40), transparent); }
.pm-card.cat-festival   .pm-pin { background: linear-gradient(180deg, rgba(214,178,44,.40), transparent); }
.pm-card.cat-projection .pm-pin { background: linear-gradient(180deg, rgba(117,151,204,.40), transparent); }

.pm-card.is-fav .pm-date-tag { background: rgba(182,58,53,.85); }

/* ── Week View ───────────────────────────────────────── */
/* Le défilement vertical est désormais assuré une seule fois, par
   .cal-body (voir plus haut) — un second conteneur vertical imbriqué
   ici entrait en conflit avec lui et bloquait le scroll dans TOUTES
   les vues. .week-scroll ne gère donc plus que le débordement
   horizontal propre à la grille semaine (7 colonnes + heures). */
.week-scroll { overflow-x: auto; overflow-y: visible; scrollbar-width: thin; scrollbar-color: var(--glass-border-soft) transparent; -webkit-overflow-scrolling: touch; }
.week-grid {
  display: grid;
  grid-template-columns: 48px repeat(7, 1fr);
  min-width: 600px;
  gap: 4px;
}

.wg-corner { height: 48px; }
.wg-day-head {
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .16s;
  border-radius: var(--r-sm);
}
.wg-day-head:hover { background: var(--glass-soft); border-color: var(--glass-border-soft); }
.wg-day-head.is-today { background: var(--acc-bg); border-color: var(--acc-bd); }
.wg-day-head.is-wknd { background: rgba(227,167,58,0.05); }
.wg-dow { font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.wg-date { font-family: var(--f-display); font-size: 16px; font-weight: 700; color: var(--ink); }
.is-today .wg-date {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--acc); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 8px var(--acc-bd);
}
.wg-ev-count {
  font-family: var(--f-mono);
  font-size: 9px; font-weight: 700;
  background: var(--acc-bg);
  color: var(--acc);
  border-radius: 6px; padding: 1px 5px;
}

.wg-time-label {
  height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px 6px 0 0;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-4);
}
.wg-slot {
  height: 58px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  padding: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wev {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 3px 6px;
  border: none;
  border-left: 3px solid var(--c-conference);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--glass-strong);
  cursor: pointer;
  text-align: left;
  transition: background .14s;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}
.wev:hover { box-shadow: var(--glass-shadow-lg); }
.wev-time { font-family: var(--f-mono); font-size: 9px; color: var(--ink-3); }
.wev-title { font-size: 10px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev.cat-concert    { border-left-color: var(--c-concert); }
.wev.cat-conference { border-left-color: var(--c-conference); }
.wev.cat-marche     { border-left-color: var(--c-marche); }
.wev.cat-atelier    { border-left-color: var(--c-atelier); }
.wev.cat-sport      { border-left-color: var(--c-sport); }
.wev.cat-festival   { border-left-color: var(--c-festival); }

/* ── Day View ────────────────────────────────────────── */
.day-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 14px;
}
.day-view-header-left { display: flex; align-items: baseline; gap: 8px; }
.day-dow-label {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.day-date-label {
  font-family: var(--f-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
}
.day-count-badge {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--acc);
  background: var(--acc-bg);
  border: 1px solid var(--acc-bd);
  border-radius: var(--r-pill);
  padding: 3px 11px;
}

/* Même logique que .week-scroll : plus de second conteneur vertical
   imbriqué, .cal-body porte seul le scroll de la vue jour. */
.day-scroll { overflow-y: visible; }
.day-timeline { display: flex; flex-direction: column; }

.time-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  min-height: 52px;
  border-bottom: 1px solid var(--glass-border-soft);
}

.time-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 8px 0 0;
}
.time-hh { font-family: var(--f-mono); font-size: 13px; font-weight: 700; color: var(--ink-3); }
.time-mm { font-family: var(--f-mono); font-size: 9px; color: var(--ink-4); }
.time-content { padding: 4px 0 4px 8px; display: flex; flex-direction: column; gap: 6px; }

/* Day event card — plaquette de verre */
.day-ev-card {
  display: flex;
  align-items: stretch;
  background: var(--glass);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .16s, border-color .16s, transform .1s;
  margin: 2px 4px 2px 0;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
}
.day-ev-card:hover { box-shadow: var(--glass-shadow-lg); border-color: var(--glass-border); }
.day-ev-card:active { transform: scale(.98); }

.dev-img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  flex-shrink: 0;
}
.dev-placeholder {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--acc-bg);
}

.dev-body { flex: 1; padding: 10px 10px 10px 12px; min-width: 0; }
.dev-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
.dev-cat-pill {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-pill);
  padding: 2px 8px;
}
.dev-time-label { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 3px; }
.dev-gps-badge { font-size: 11px; color: var(--acc); }
.dev-title { font-family: var(--f-display); font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-lieu { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.dev-desc { font-size: 11px; color: var(--ink-3); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dev-auteur { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.dev-auteur-initiales { width: 18px; height: 18px; border-radius: 50%; background: var(--acc-bg); color: var(--acc); font-size: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dev-auteur-name { font-size: 10px; color: var(--ink-3); }
.dev-arrow { display: flex; align-items: center; padding: 0 12px 0 4px; color: var(--ink-4); font-size: 12px; }

.day-ev-card.cat-concert    { border-left: 3px solid var(--c-concert); }
.day-ev-card.cat-conference { border-left: 3px solid var(--c-conference); }
.day-ev-card.cat-marche     { border-left: 3px solid var(--c-marche); }
.day-ev-card.cat-atelier    { border-left: 3px solid var(--c-atelier); }
.day-ev-card.cat-sport      { border-left: 3px solid var(--c-sport); }
.day-ev-card.cat-festival   { border-left: 3px solid var(--c-festival); }
.day-ev-card.cat-projection { border-left: 3px solid var(--c-projection); }

/* ── Empty state ─────────────────────────────────────── */
.no-events {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}
.no-events-icon {
  font-size: 40px;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.no-events-title { font-family: var(--f-display); font-size: 16px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.no-events-sub { font-size: 13px; color: var(--ink-3); }

/* ── Mobile cards (grille "agenda" à une colonne — aussi utilisée en repli tablette) ── */
.mobile-cards-wrap {
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap);
}
.mc-group { display: flex; flex-direction: column; gap: 6px; }
.mc-date-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}
.mc-dow { font-family: var(--f-mono); font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.mc-date { font-family: var(--f-display); font-size: 14px; font-weight: 700; color: var(--ink-2); }
.mc-date-header.is-today .mc-date { color: var(--acc); }
.mc-today-pill {
  font-size: 9px; font-weight: 700;
  background: var(--acc-bg);
  color: var(--acc);
  border-radius: var(--r-pill); padding: 2px 8px;
}

.mc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r);
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow .16s, transform .1s;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
}
.mc-card:hover { box-shadow: var(--glass-shadow-lg); }
.mc-card:active { transform: scale(.98); }
.mc-thumb { width: 44px; height: 44px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--glass-soft); }
.mc-thumb-img { width: 44px; height: 44px; object-fit: cover; }
.mc-thumb-emoji { font-size: 22px; }
.mc-body { flex: 1; min-width: 0; }
.mc-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.mc-cat-pill { font-size: 10px; font-weight: 700; color: var(--ink-3); background: var(--glass-soft); border: 1px solid var(--glass-border-soft); border-radius: var(--r-pill); padding: 2px 8px; }
.mc-time { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 3px; }
.mc-title { font-family: var(--f-display); font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-lieu { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.mc-gps { font-size: 11px; color: var(--acc); }
.mc-arrow { color: var(--ink-4); font-size: 13px; }

/* ── Footer bar ──────────────────────────────────────── */
.cal-footer-bar {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px calc(10px + var(--safe-b));
  padding: 0 16px;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r);
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  font-size: 11px;
  color: var(--ink-3);
  flex-shrink: 0;
  box-shadow: var(--glass-shadow);
}
.footer-right { margin-left: auto; }
.footer-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--acc);
  background: var(--acc-bg);
  border: 1px solid var(--acc-bd);
  border-radius: var(--r-pill);
  padding: 2px 9px;
}

/* ══════════════════════════════════════════════════════
   MODAL ÉVÉNEMENT — grand panneau de verre, blur renforcé.
══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,16,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s;
}
.modal-overlay.is-open { opacity: 1; pointer-events: all; }

.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--glass-shadow-lg), inset 0 1px 0 var(--glass-shine);
  transform: scale(.96) translateY(8px);
  transition: transform .28s cubic-bezier(.32,1,.28,1);
  backdrop-filter: blur(var(--blur-lg)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(170%);
}
.modal-overlay.is-open .modal-box { transform: scale(1) translateY(0); }

.modal-fav-btn {
  position: absolute;
  top: 14px; left: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(10,20,16,0.40);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.30);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
  font-size: 17px;
  color: #F5F5EE;
  transition: background .16s, transform .2s;
}
.modal-fav-btn:hover { background: rgba(10,20,16,.55); }
.modal-fav-btn:active { transform: scale(.88); }
.modal-fav-btn.is-fav { background: rgba(182,58,53,.42); border-color: rgba(255,255,255,.4); }

.modal-close-x {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(10,20,16,0.40);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.30);
  color: #F5F5EE;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
  transition: background .16s;
}
.modal-close-x:hover { background: rgba(10,20,16,.6); }

/* Hero */
.modal-hero { position: relative; height: 220px; flex-shrink: 0; overflow: hidden; }
.modal-hero-img { width: 100%; height: 100%; object-fit: cover; display: none; }
.modal-hero-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1E8F5E, #0B2A3D);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.modal-hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 28%, rgba(8,16,12,.78));
}
.modal-cat-badge {
  position: absolute;
  top: 56px; right: 12px;
  font-size: 11px; font-weight: 700;
  background: rgba(10,20,16,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  color: #F5F5EE;
}

.modal-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0 16px 16px;
}
.hero-overlay-title {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 700;
  color: #F5F5EE;
  line-height: 1.25;
  margin-bottom: 6px;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.hero-overlay-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(245,245,238,.82);
}
.hero-overlay-date, .hero-overlay-lieu { display: flex; align-items: center; gap: 4px; }
.hero-overlay-sep { color: rgba(245,245,238,.42); }

/* Modal content */
.modal-content {
  flex: 1;
  min-height: 0; /* même correctif que .cal-body : sans ça la modale
                    grandit avec son contenu au lieu de scroller */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border-soft) transparent;
}
.modal-content::-webkit-scrollbar { width: 3px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--glass-border-soft); border-radius: 3px; }

.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }

/* Modal meta */
.modal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.modal-meta-row {
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.modal-meta-row dt { font-family: var(--f-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.modal-meta-row dd { font-size: 13px; font-weight: 600; color: var(--ink); }

/* Tags */
.modal-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.modal-tag {
  font-size: 11px; font-weight: 600;
  background: var(--acc-bg);
  border: 1px solid var(--acc-bd);
  color: var(--acc);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

/* Description */
.modal-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 14px;
}

/* Auteur */
.modal-auteur {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.modal-auteur-lbl { font-size: 11px; color: var(--ink-3); margin-right: 4px; }
.modal-auteur-info { display: flex; align-items: center; gap: 7px; }
.modal-auteur-initiales {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--acc-bg);
  color: var(--acc);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.modal-auteur-info span { font-size: 13px; font-weight: 600; color: var(--ink); }

/* Map */
.modal-map {
  height: 100px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  margin-bottom: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .16s;
}
.modal-map:hover { border-color: var(--glass-border); }
.modal-map-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 12px;
}
.modal-map-inner i { font-size: 24px; color: var(--acc); }

/* Related */
.modal-related { margin-bottom: 14px; }
.modal-related-title { font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.related-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.related-scroll::-webkit-scrollbar { display: none; }
.related-card {
  flex-shrink: 0;
  width: 120px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  padding: 10px;
  cursor: pointer;
  transition: background .16s;
}
.related-card:hover { background: var(--acc-bg); }
.related-emoji { font-size: 20px; margin-bottom: 5px; }
.related-title { font-size: 11px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-bottom: 3px; }
.related-date { font-size: 10px; color: var(--ink-3); }

/* Actions */
.modal-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.mbtn {
  height: 38px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background .16s;
  white-space: nowrap;
}
.mbtn:hover { background: var(--acc-bg); color: var(--acc); }
.mbtn-ghost { background: transparent; }
.mbtn-fav.is-fav { background: rgba(182,58,53,.16); border-color: rgba(182,58,53,.36); color: #B63A35; }
.mbtn-agenda { border-color: var(--c-conference); background: rgba(92,127,194,.12); color: var(--c-conference); }
.mbtn-agenda:hover { background: rgba(92,127,194,.20); }
.mbtn-share { border-color: var(--c-atelier); background: rgba(227,167,58,.12); color: var(--c-atelier); }
.mbtn-share:hover { background: rgba(227,167,58,.20); }
.mbtn-share.is-copied { border-color: var(--acc-bd); background: var(--acc-bg); color: var(--acc); }
.mbtn-primary {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, rgba(255,255,255,.22), transparent), var(--acc);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
  box-shadow: 0 4px 16px var(--acc-bd);
  transition: opacity .16s, box-shadow .16s;
}
.mbtn-primary:hover { opacity: .92; box-shadow: 0 6px 20px var(--acc-bd); }

/* ══════════════════════════════════════════════════════
   MODAL AGENDA
══════════════════════════════════════════════════════ */
.agenda-overlay { z-index: 600; }
.agenda-box {
  width: 100%;
  max-width: 360px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 24px 20px 20px;
  position: relative;
  box-shadow: var(--glass-shadow-lg), inset 0 1px 0 var(--glass-shine);
  backdrop-filter: blur(var(--blur-lg)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(170%);
}

.agenda-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.agenda-modal-ico { font-size: 22px; color: var(--c-conference); }
.agenda-modal-header h2 { font-family: var(--f-display); font-size: 18px; font-weight: 700; color: var(--ink); }
.agenda-modal-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; padding-left: 32px; }

.agenda-choices { display: flex; flex-direction: column; gap: 8px; }
.agenda-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: background .16s;
}
.agenda-choice:hover { background: var(--acc-bg); border-color: var(--acc-bd); }
.agenda-choice:last-child { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.agenda-choice-ico { width: 20px; height: 20px; flex-shrink: 0; }
.agenda-choice-ico-fa { font-size: 20px; flex-shrink: 0; }
.agenda-choice span { flex: 1; }
.agenda-choice i:last-child { color: var(--ink-4); font-size: 12px; }

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,20,16,.55);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: var(--r-pill);
  padding: 11px 19px;
  color: #F5F5EE;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: var(--glass-shadow-lg);
  transition: opacity .3s, transform .3s;
}
.toast.is-out { opacity: 0; transform: translateX(-50%) translateY(10px); }

/* ── Focus clavier visible (accessibilité) ────────────── */
.nav-arr:focus-visible,
.nav-today:focus-visible,
.tvtab:focus-visible,
.fb-date-btn:focus-visible,
.cat-pill:focus-visible,
.fb-theme-btn:focus-visible,
.mbtn:focus-visible,
.mbtn-primary:focus-visible,
.pm-card:focus-visible,
.day-ev-card:focus-visible,
.mc-card:focus-visible,
.modal-close-x:focus-visible,
.modal-fav-btn:focus-visible,
.sb-submit:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  body.cal-app::before { animation: none; }
  .topbar::after, .filter-bar::after { display: none; }
}