/* ============================================================
   calendar.css v2.3 — Capteur Météo
   ============================================================
   Nouveautés v2.3 (saints + jours fériés en cellule) :
   - Nouvelle ligne .cal-cell-saint sous le numéro : nom du
     saint en accent orange, 1 ligne ellipse, font 10px (9px
     mobile). Slot vide .cal-cell-saint-empty pour conserver
     l'alignement quand pas de saint connu (rare).
   - Classe .cal-cell-ferie : fond rouge léger + bord, plus
     un point rouge .cal-cell-ferie-marker en haut-droite.
     Préserve la sélection orange si jour férié sélectionné
     (.cal-cell-ferie.cal-cell-selected).
   - min-height cellule remonté 78 → 92 px (desktop) et
     64 → 76 px (mobile) pour absorber la nouvelle ligne sans
     comprimer la météo.

   v2.2 :
   - margin-right 40px sur .cal-today-btn pour éviter le
     chevauchement avec la croix de fermeture du header.

   v2.1 :
   - Liste de suggestions Lieu : ouverture intelligente vers
     le bas OU le haut (positionnement piloté par calendar-ui.js
     v3.1, classe modifier .cal-loc-suggestions--up).
   - Animation d'apparition directionnelle (translateY -4 ou +4).
   - Box-shadow et border-radius adaptés selon le sens.
   - Le `top: calc(100% + 4px)` en CSS reste comme valeur par
     défaut (graceful fallback si JS ne tourne pas) ; JS surcharge
     en inline-style à chaque rendu via positionLocSuggestions().

   v2 :
   - Styles autocomplete Lieu : wrapper relatif, liste suggestions
     absolute, hover/active orange, spinner rotation.
   - Bordure rouge sur input invalide (.cal-f-input-error).
   - Boutons itinéraire dans le panneau jour
     (.cal-event-actions / .cal-event-action-btn).
   - Animation rotation spinner (.cal-spinner-svg).

   v1 :
   Styles dédiés à la modale calendrier.
   - Charte : navy #0b1628, orange #f47920, police Outfit
   - Réutilise les variables CSS du projet (--navy*, --orange*,
     --text-dim, --glass-border, --radius, --radius-sm, --glass-bg)
   - Classes préfixées cm-eph-* (tuile clic) et cal-* (modale)
   - Aucun emoji, aucune dépendance d'image
   ============================================================ */

/* ----------------------------------------------------------
   Tuile éphéméride : rendre cliquable (hover/active discrets,
   aligné sur le ressenti des tuiles vent/pression/humidité).
   ---------------------------------------------------------- */
.cm-eph-section-clickable .cm-eph-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cm-eph-section-clickable .cm-eph-card:hover {
  border-color: rgba(244, 121, 32, 0.35);
}
.cm-eph-section-clickable .cm-eph-card:active {
  transform: scale(0.997);
}

/* ============================================================
   MODALE CALENDRIER — shell
   ============================================================ */
.cal-modal-overlay { /* hérite de .modal-overlay */ }
.cal-modal {
  max-width: 720px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* En-tête : bandeau + nav mois ----------------------------- */
.cal-head {
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(244, 121, 32, 0.04) 0%, transparent 100%);
}
.cal-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-head-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--orange);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 121, 32, 0.10);
  border: 1px solid rgba(244, 121, 32, 0.25);
}
.cal-today-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  /* v2.2 : marge à droite pour éviter le chevauchement avec la
     croix de fermeture (.modal-close, top:14px right:14px, w 36px). */
  margin-right: 40px;
}
.cal-today-btn:hover {
  background: rgba(244, 121, 32, 0.10);
  color: var(--orange);
  border-color: rgba(244, 121, 32, 0.35);
}

.cal-head-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cal-month-label {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  text-align: center;
  flex: 1;
}
.cal-nav-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-nav-btn:hover {
  background: var(--orange);
  color: var(--navy);
  border-color: var(--orange);
}

/* Corps : grille + panneau jour ---------------------------- */
.cal-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ============================================================
   GRILLE MENSUELLE
   ============================================================ */
.cal-grid-wrap { width: 100%; }

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-grid-head {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 6px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  position: relative;
  min-height: 92px;
  padding: 6px 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.cal-cell:hover {
  background: rgba(255,255,255,0.06);
}
.cal-cell:focus {
  outline: none;
  border-color: rgba(244, 121, 32, 0.5);
}
.cal-cell-out {
  opacity: 0.4;
}
.cal-cell-today .cal-cell-num {
  background: var(--orange);
  color: var(--navy);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.cal-cell-selected {
  border-color: rgba(244, 121, 32, 0.55);
  background: rgba(244, 121, 32, 0.08);
  box-shadow: inset 0 0 0 1px rgba(244, 121, 32, 0.25);
}

.cal-cell-num {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}

.cal-cell-weather {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 28px;
}
.cal-cell-weather-empty { flex: 1; min-height: 28px; }
.cal-cell-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.cal-cell-icon svg { width: 100%; height: 100%; display: block; }
.cal-cell-temps {
  font-size: 10px;
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}
.cal-cell-tmax { color: #fff; font-weight: 600; }
.cal-cell-tmin { color: var(--text-dim); }

/* v2.3 : Saint du jour sous le numéro
   ----------------------------------------------------------
   1 ligne maximum, ellipsis si débordement, accent orange.
   Le préfixe « Saint » est implicite — le panneau jour rend
   le libellé complet « Saint X · Y · Z ». */
.cal-cell-saint {
  font-size: 10px;
  font-weight: 500;
  color: var(--orange);
  line-height: 1.1;
  margin-bottom: 4px;
  text-align: center;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-cell-saint-empty {
  height: 12px;
  margin-bottom: 4px;
}

/* v2.3 : Jour férié — teinte rouge subtile + marker top-right
   ----------------------------------------------------------
   La règle .cal-cell-ferie.cal-cell-selected re-priorise la
   sélection orange si l'utilisateur clique sur un jour férié. */
.cal-cell-ferie {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.30);
}
.cal-cell-ferie:hover {
  background: rgba(220, 38, 38, 0.16);
}
.cal-cell-ferie.cal-cell-selected {
  background: rgba(244, 121, 32, 0.08);
  border-color: rgba(244, 121, 32, 0.55);
  box-shadow: inset 0 0 0 1px rgba(244, 121, 32, 0.25);
}
.cal-cell-ferie-marker {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
  pointer-events: none;
}

.cal-cell-pill-slot {
  height: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cal-cell-pill {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
}
.cal-cell-pill-count {
  width: auto; height: 14px;
  min-width: 14px;
  padding: 0 4px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============================================================
   PANNEAU JOUR
   ============================================================ */
.cal-day-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cal-day-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 30px 0;
  font-size: 13px;
}

/* En-tête éphéméride du jour */
.cal-day-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-day-date {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.cal-day-meta {
  font-size: 12px;
  color: var(--text-dim);
}
.cal-day-saint {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.cal-day-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.cal-day-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
}
.cal-day-badge-civile {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.10);
  border-color: rgba(244, 63, 94, 0.30);
}
.cal-day-badge-ferie {
  color: var(--orange);
  background: rgba(244, 121, 32, 0.10);
  border-color: rgba(244, 121, 32, 0.30);
}

.cal-day-astro-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}
.cal-day-astro {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cal-day-astro-item, .cal-day-moon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cal-day-moon-pct { color: rgba(255,255,255,0.75); font-weight: 600; }

/* Bloc météo du jour */
.cal-day-weather {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
.cal-day-weather-icon {
  width: 56px; height: 56px;
}
.cal-day-weather-icon svg { width: 100%; height: 100%; display: block; }
.cal-day-weather-main { min-width: 0; }
.cal-day-weather-temp {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  line-height: 1.05;
}
.cal-day-weather-tmin {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 400;
  margin-left: 4px;
}
.cal-day-weather-cond {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.cal-day-weather-precip {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-day-weather-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.cal-day-weather-value {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

/* Bloc événements ----------------------------------------- */
.cal-day-events-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-day-events-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cal-day-events-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cal-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--orange);
  color: var(--navy);
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.cal-add-btn:hover { background: var(--orange-soft); }
.cal-add-btn:active { transform: scale(0.97); }

.cal-day-events-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 24px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cal-day-events-empty-icon { color: rgba(255,255,255,0.25); }
.cal-day-events-empty-text { font-size: 13px; }

.cal-event-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-event-item {
  display: grid;
  grid-template-columns: 8px 1fr 18px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cal-event-item:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(244, 121, 32, 0.30);
}
.cal-event-pill {
  width: 8px; height: 100%;
  min-height: 28px;
  border-radius: 3px;
  display: block;
}
.cal-event-main { min-width: 0; }
.cal-event-title {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  align-items: center;
}
.cal-event-type {
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.cal-event-loc {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cal-event-chevron { color: rgba(255,255,255,0.3); display: flex; }

/* ============================================================
   SUB-MODALE FORMULAIRE
   ============================================================ */
.cal-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001; /* au-dessus de la modale calendrier */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.cal-form-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: auto;
}
.cal-form-content {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  max-height: 92dvh;
  background: var(--navy-2);
  border: 1px solid var(--glass-border);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(40px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  pointer-events: auto;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
  margin: 0 auto;
}
.cal-form-visible .cal-form-backdrop { opacity: 1; }
.cal-form-visible .cal-form-content { transform: translateY(0); opacity: 1; }

@media (min-width: 641px) {
  .cal-form-overlay { align-items: center; padding: 30px; }
  .cal-form-content {
    border-radius: var(--radius);
    transform: translateY(20px);
  }
}

.cal-form-head {
  position: relative;
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--glass-border);
}
.cal-form-title {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}
.cal-form-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cal-form-close:hover { background: var(--orange); color: var(--navy); border-color: var(--orange); }

.cal-form-body {
  padding: 14px 22px 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

/* Segmenté type RDV / Note / Rappel */
.cal-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.cal-seg-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cal-seg-btn-active {
  background: var(--seg-color, var(--orange));
  color: #fff;
}

.cal-f-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin: 12px 0 4px;
}
.cal-f-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
}
.cal-f-input:focus {
  outline: none;
  border-color: var(--orange);
  background: rgba(255,255,255,0.07);
}
.cal-f-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.cal-f-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin: 6px 0 8px;
  cursor: pointer;
}
.cal-f-toggle input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--orange);
  cursor: pointer;
}

.cal-f-time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cal-f-time-col { display: flex; flex-direction: column; }

.cal-f-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
  font-style: italic;
}

.cal-f-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #fca5a5;
  font-size: 13px;
}

/* Pied formulaire */
.cal-form-foot {
  padding: 12px 22px 18px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.cal-form-foot-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.cal-form-foot-delete {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--glass-border);
  padding-top: 10px;
}

/* Boutons génériques */
.cal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.cal-btn:active { transform: scale(0.98); }
.cal-btn-primary {
  background: var(--orange);
  color: var(--navy);
}
.cal-btn-primary:hover { background: var(--orange-soft); }
.cal-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: var(--glass-border);
}
.cal-btn-secondary:hover { background: rgba(255,255,255,0.10); border-color: var(--orange); }
.cal-btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--glass-border);
}
.cal-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.20); }
.cal-btn-danger {
  background: transparent;
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}
.cal-btn-danger:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.55);
}
.cal-btn-google { background: #fff; color: #1f2937; }
.cal-btn-google:hover { background: #f3f4f6; }

/* ============================================================
   CONFIRMATION SUPPRESSION
   ============================================================ */
.cal-confirm-overlay {
  position: fixed; inset: 0;
  z-index: 10002;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.cal-confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: auto;
}
.cal-confirm-box {
  position: relative;
  background: var(--navy-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  width: calc(100% - 40px);
  max-width: 380px;
  text-align: center;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.cal-confirm-visible .cal-confirm-backdrop { opacity: 1; }
.cal-confirm-visible .cal-confirm-box { transform: scale(1); opacity: 1; }
.cal-confirm-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}
.cal-confirm-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.cal-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ============================================================
   ÉTAT NON-CONNECTÉ
   ============================================================ */
.cal-locked {
  padding: 50px 28px 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cal-locked-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(244, 121, 32, 0.10);
  border: 1px solid rgba(244, 121, 32, 0.30);
  color: var(--orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.cal-locked-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.cal-locked-sub {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 340px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.cal-locked-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 10px;
}
.cal-locked-actions .cal-btn { width: 100%; padding: 12px 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .cal-head { padding: 18px 16px 10px; }
  .cal-month-label { font-size: 19px; }
  .cal-body { padding: 12px 12px 16px; gap: 14px; }
  .cal-cell { min-height: 76px; padding: 4px 4px 6px; border-radius: 8px; }
  .cal-cell-num { font-size: 11px; }
  .cal-cell-today .cal-cell-num { width: 20px; height: 20px; font-size: 11px; }
  .cal-cell-icon { width: 22px; height: 22px; }
  .cal-cell-temps { font-size: 9px; }
  /* v2.3 : saint plus petit sur mobile, slot d'alignement réduit */
  .cal-cell-saint { font-size: 9px; margin-bottom: 3px; }
  .cal-cell-saint-empty { height: 11px; margin-bottom: 3px; }
  .cal-cell-ferie-marker { top: 4px; right: 4px; width: 5px; height: 5px; }
  .cal-grid-head { font-size: 10px; padding: 4px 0; }
  .cal-day-panel { padding: 14px 12px 12px; }
  .cal-day-date { font-size: 16px; }
  .cal-day-weather { grid-template-columns: 48px 1fr auto; gap: 10px; padding: 8px 10px; }
  .cal-day-weather-icon { width: 48px; height: 48px; }
  .cal-day-weather-temp { font-size: 19px; }
  .cal-form-body { padding: 12px 16px 4px; }
  .cal-form-head { padding: 16px 18px 10px; }
  .cal-form-foot { padding: 10px 16px 14px; }
}

/* ============================================================
   v2 — AUTOCOMPLETE LIEU
   ============================================================ */
.cal-loc-wrap {
  position: relative;
}
.cal-loc-spinner {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--orange);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-spinner-svg {
  animation: cal-spinner-rot 0.9s linear infinite;
}
@keyframes cal-spinner-rot {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Liste suggestions positionnée absolute sous le champ par défaut.
   v3.1 : top et max-height sont surchargés en inline-style par
   positionLocSuggestions() pour bascule haut/bas dynamique. */
.cal-loc-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--navy-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 10003;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Glass-morphism léger pour cohérence avec le reste de l'app */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* v2.1 : animation d'apparition (sens BAS par défaut) */
  animation: cal-loc-pop-down 0.18s ease-out;
}

/* v2.1 : variante OUVERTURE VERS LE HAUT
   - box-shadow projetée vers le haut (negative Y)
   - border-radius coins arrondis adaptés (le coin "côté champ"
     est moins arrondi pour suggérer la continuité visuelle) */
.cal-loc-suggestions--up {
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.45);
  animation: cal-loc-pop-up 0.18s ease-out;
}

@keyframes cal-loc-pop-down {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cal-loc-pop-up {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cal-loc-suggestion {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-loc-suggestion:hover,
.cal-loc-suggestion-active {
  background: rgba(244, 121, 32, 0.14);
}
.cal-loc-suggestion-main {
  font-size: 14px;
  color: #fff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-loc-suggestion-sub {
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.8;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bordure rouge pour input invalide (heure de fin < début) */
.cal-f-input-error,
.cal-f-input-error:focus {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.06);
}

/* ============================================================
   v2 — BOUTONS ITINÉRAIRE (panneau jour, sous chaque event)
   ============================================================ */
.cal-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.cal-event-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.cal-event-action-btn:hover,
.cal-event-action-btn:focus-visible {
  background: rgba(244, 121, 32, 0.12);
  color: var(--orange);
  border-color: rgba(244, 121, 32, 0.45);
  outline: none;
}
.cal-event-action-btn svg {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .cal-event-action-btn { font-size: 11px; padding: 5px 9px; }
  .cal-loc-suggestion-main { font-size: 13px; }
  .cal-loc-suggestion-sub  { font-size: 11px; }
}
