/* Chap — feuille unique. Mobile d'abord ; au-delà de 760 px la navigation passe en haut. */

:root {
  --fond: #f3f4f8;
  --carte: #ffffff;
  --encre: #161a2c;
  --doux: #5f6580;
  --pale: #8a90a8;
  --trait: #e3e6ee;
  --survol: #f6f7fb;
  --accent: #14213d;
  --accent-texte: #ffffff;
  --lien: #2f5bb7;
  --ferme: #1f8a55;
  --ferme-fond: #e2f4ea;
  --attente: #b9730a;
  --attente-fond: #fdf1dc;
  --circuit: #5d6584;
  --circuit-fond: #eceef5;
  --conflit: #c0332a;
  --conflit-fond: #fde8e6;
  --n1: #1f8a55;
  --n1-fond: #e2f4ea;
  --n2: #2f5bb7;
  --n2-fond: #e5ecfa;
  --danger: #c0332a;
  --ombre: 0 1px 2px rgba(20, 33, 61, .05), 0 2px 8px rgba(20, 33, 61, .04);
  --rayon: 14px;
  --nav-bas: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f111a; --carte: #181b27; --encre: #e9ebf4; --doux: #a0a6bf; --pale: #747a94; --trait: #2a2e40; --survol: #1f2331;
    --accent: #9db4f0; --accent-texte: #0f111a; --lien: #9db4f0;
    --ferme: #5ccb8f; --ferme-fond: #15301f; --attente: #f0b85a; --attente-fond: #33270f;
    --circuit: #a3a9c4; --circuit-fond: #232736; --conflit: #f28b82; --conflit-fond: #3a1a18;
    --n1: #5ccb8f; --n1-fond: #15301f; --n2: #9db4f0; --n2-fond: #1c2742; --danger: #f28b82;
    --ombre: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--fond); color: var(--encre);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.feuille-ouverte { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--lien); }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 0; font-weight: 650; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pale); font-weight: 600; }
small { font-size: .75em; }
.note { color: var(--doux); font-size: .88rem; }
p.note { margin: 6px 0 0; }
.sous-titre { color: var(--doux); margin: 4px 0 0; }
.erreur { color: var(--danger); margin: 10px 0 0; font-size: .92rem; }
.danger { color: var(--danger) !important; }

/* ---------------- Barre et navigation ---------------- */

.barre {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--accent); color: var(--accent-texte);
}
@media (prefers-color-scheme: dark) { .barre { background: #161a2a; color: var(--encre); } }
.marque { color: inherit; text-decoration: none; font-weight: 750; letter-spacing: .01em; display: flex; align-items: baseline; gap: 6px; }
.marque .logo { color: #f4c542; }
.marque small { font-weight: 500; opacity: .65; font-size: .78rem; }
.compte { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.compte #qui { opacity: .75; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte .lien { color: inherit; opacity: .9; text-decoration: underline; text-underline-offset: 3px; }

#nav { display: flex; gap: 4px; }
#nav a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; opacity: .78; }
#nav a.actif { opacity: 1; background: rgba(255, 255, 255, .14); }
#nav .ico { font-size: 1rem; line-height: 1; }

@media (max-width: 759px) {
  #nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; gap: 0;
    background: var(--carte); color: var(--doux); border-top: 1px solid var(--trait);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  #nav a { flex-direction: column; gap: 2px; font-size: .7rem; padding: 4px 10px; opacity: 1; border-radius: 10px; min-width: 64px; }
  #nav a .ico { font-size: 1.25rem; }
  #nav a.actif { color: var(--lien); background: none; font-weight: 650; }
  main { padding-bottom: calc(var(--nav-bas) + 28px + env(safe-area-inset-bottom, 0px)) !important; }
  .compte #qui { display: none; }
}

main { max-width: 920px; margin: 0 auto; padding: 20px 16px 48px; }

/* ---------------- Éléments communs ---------------- */

.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; margin-bottom: 12px; box-shadow: var(--ombre); }
.carte > h2 { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.centre { max-width: 380px; margin: 8vh auto 0; }
label { display: block; font-size: .85rem; color: var(--doux); margin: 12px 0 4px; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--lien); outline-offset: 2px; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; min-height: 44px;
  padding: 10px 16px; background: var(--accent); color: var(--accent-texte); font-weight: 600; cursor: pointer; margin-top: 14px;
}
.bouton.plein { width: 100%; }
.bouton.discret { background: transparent; color: var(--lien); border: 1px solid var(--trait); margin-top: 0; font-weight: 550; }
.bouton.discret.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--trait)); }
.lien { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--lien); }
.icone {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--trait); background: var(--carte); cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--encre);
}
.icone:disabled { opacity: .35; cursor: default; }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grille { grid-template-columns: 1fr; } }
.rang { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rang .bouton { margin-top: 10px; }
.rang input { flex: 1; min-width: 150px; margin-top: 10px; }

.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pastille.ferme { background: var(--ferme); }
.pastille.attente { background: var(--attente-fond); box-shadow: inset 0 0 0 2px var(--attente); }
.pastille.circuit { background: var(--circuit); }
.pastille.conflit { background: var(--conflit); }
.chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.chip.ferme { background: var(--ferme-fond); color: var(--ferme); }
.chip.attente { background: var(--attente-fond); color: var(--attente); }
.chip.circuit { background: var(--circuit-fond); color: var(--circuit); }
.chip.conflit { background: var(--conflit-fond); color: var(--conflit); }
.compteur { font-size: .75rem; background: var(--fond); color: var(--doux); border-radius: 999px; padding: 1px 8px; font-weight: 600; }

.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--doux); margin-top: 12px; }
.legende > span { display: inline-flex; align-items: center; gap: 6px; }

/* Lignes cliquables : « à traiter », journal, listes */
.element {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid var(--trait); padding: 11px 2px; cursor: pointer; min-height: 44px;
}
.carte > h2 + .element { border-top: 0; }
.element:hover { background: var(--survol); }
.element .quoi { flex: 1; min-width: 0; }
.element .quand { color: var(--doux); font-size: .85rem; white-space: nowrap; }
.a-traiter { border-left: 4px solid var(--attente); }
.vide-ok { margin: 4px 0 0; color: var(--ferme); font-weight: 550; }
.vide-ok::before { content: "✓ "; }

.rangee {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid var(--trait); padding: 10px 2px; cursor: pointer;
}
.rangee:hover { background: var(--survol); }
.rangee.passe { opacity: .5; }
.carte > h2 + .rangee, .groupe-mois + .rangee { border-top: 0; }
.date-bloc {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; height: 46px; padding: 0 4px; border-radius: 11px;
  background: var(--circuit-fond); color: var(--circuit); flex-shrink: 0; line-height: 1.05;
}
.date-bloc b { font-size: 1.15rem; }
.date-bloc small { text-transform: uppercase; font-size: .56rem; letter-spacing: .02em; white-space: nowrap; }
.date-bloc.ferme { background: var(--ferme); color: #fff; }
.date-bloc.attente { background: var(--attente-fond); color: var(--attente); box-shadow: inset 0 0 0 2px var(--attente); }
.date-bloc.conflit { background: var(--conflit); color: #fff; }
.rangee .texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rangee .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rangee .s { color: var(--doux); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groupe-mois { margin: 16px 0 4px; }
.groupe-mois:first-of-type { margin-top: 10px; }

.ligne-journal { border-top: 1px solid var(--trait); padding: 10px 0 0; margin-top: 10px; }
.ligne-journal p { margin: 2px 0 0; }
details.carte > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
details.carte > summary::-webkit-details-marker { display: none; }
details.carte > summary::after { content: "⌄"; color: var(--pale); font-size: 1.2rem; }
details.carte[open] > summary::after { content: "⌃"; }

/* ---------------- Accueil ---------------- */

.entete-page { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 12px; }
.annee-resume { display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.annee-resume:hover { border-color: var(--pale); }
.statut-ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.jauge { display: flex; height: 8px; border-radius: 999px; background: var(--fond); overflow: hidden; margin: 12px 0 4px; }
.jauge .plein.ferme { background: var(--ferme); }
.jauge .plein.attente { background: repeating-linear-gradient(135deg, var(--attente) 0 4px, color-mix(in srgb, var(--attente) 45%, transparent) 4px 8px); }

/* ---------------- Calendrier ---------------- */

.selecteur-annee { display: flex; align-items: center; gap: 10px; }
.selecteur-annee h1 { min-width: 3.2em; text-align: center; font-variant-numeric: tabular-nums; }
.segments { display: inline-flex; background: var(--carte); border: 1px solid var(--trait); border-radius: 11px; padding: 3px; }
.segments button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--doux); font-weight: 550; min-height: 36px; }
.segments button[aria-selected=true] { background: var(--accent); color: var(--accent-texte); }

.statut-annee .etiquette-statut { font-weight: 700; }
.statut-annee.valide { border-left: 4px solid var(--ferme); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--fond); color: var(--doux); font-weight: 550; }
.puce.ok { background: var(--ferme-fond); color: var(--ferme); }
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; }
.chiffres > div { display: flex; flex-direction: column; background: var(--fond); border-radius: 10px; padding: 8px 10px; }
.chiffres b { font-size: 1.25rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.chiffres b small { color: var(--pale); font-weight: 500; }
.chiffres span { font-size: .72rem; color: var(--doux); }
@media (max-width: 420px) { .chiffres { grid-template-columns: repeat(2, 1fr); } }

.selecteur-mois { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.selecteur-mois h2 { text-transform: capitalize; font-size: 1.05rem; }

.grille-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.entete-jour { text-align: center; font-size: .7rem; color: var(--pale); font-weight: 600; padding-bottom: 2px; }
.entete-jour.we { color: var(--doux); }
.jour {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0;
  height: 54px; padding: 3px; border: 1px solid var(--trait); border-radius: 8px; background: var(--carte);
  cursor: pointer; text-align: left; overflow: hidden;
}
.jour:hover { border-color: var(--pale); }
.jour.we { background: var(--survol); }
.jour .num { font-size: .78rem; font-weight: 600; color: var(--doux); font-variant-numeric: tabular-nums; line-height: 1; padding: 1px 2px; }
.jour.aujourdhui .num { color: var(--accent-texte); background: var(--lien); border-radius: 5px; align-self: flex-start; padding: 2px 4px; }
.jour.passe { opacity: .45; }
.jour.ferme { background: var(--ferme-fond); border-color: color-mix(in srgb, var(--ferme) 40%, var(--trait)); }
.jour.attente { background: var(--attente-fond); border: 1.5px dashed var(--attente); }
.jour.circuit { background: repeating-linear-gradient(135deg, var(--circuit-fond) 0 6px, var(--carte) 6px 9px); }
.jour.conflit { background: var(--conflit-fond); border: 1.5px solid var(--conflit); }
.tag {
  display: block; font-size: .6rem; font-weight: 650; line-height: 1.25; padding: 1px 4px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag.ferme { background: var(--ferme); color: #fff; }
.tag.attente { background: var(--carte); color: var(--attente); }
.tag.circuit { background: var(--circuit); color: #fff; }
.jour.conflit .tag.circuit { background: var(--conflit); }
.tag .long { display: none; }
@media (min-width: 620px) {
  .jour { height: 64px; padding: 4px; }
  .tag { font-size: .68rem; padding: 2px 5px; }
  .tag .long { display: inline; }
}
@media (prefers-color-scheme: dark) { .tag.ferme, .tag.circuit { color: #0f111a; } }

.annee-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 18px; }
.nom-mois { background: none; border: 0; padding: 0 0 6px; font-weight: 650; text-transform: capitalize; cursor: pointer; color: var(--encre); }
.nom-mois small { color: var(--ferme); font-weight: 600; margin-left: 4px; text-transform: none; }
.mini-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-size: .62rem; color: var(--pale);
  border-radius: 4px; border: 0; background: none; padding: 0; font-variant-numeric: tabular-nums;
}
button.mini { cursor: pointer; font-weight: 700; }
.mini.ferme { background: var(--ferme); color: #fff; }
.mini.attente { background: var(--attente-fond); color: var(--attente); box-shadow: inset 0 0 0 1.5px var(--attente); }
.mini.circuit { background: var(--circuit); color: #fff; }
.mini.conflit { background: var(--conflit); color: #fff; }
@media (prefers-color-scheme: dark) { .mini.ferme, .mini.circuit, .mini.conflit { color: #0f111a; } }

.filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.filtre { border: 1px solid var(--trait); background: var(--carte); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .85rem; min-height: 34px; }
.filtre[aria-pressed=true] { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.filtre b { font-variant-numeric: tabular-nums; }

.journal summary h2 { display: inline; }

/* Panneau de détail : monte du bas sur mobile, centré sur grand écran */
.feuille { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.voile { position: absolute; inset: 0; background: rgba(10, 14, 28, .42); animation: apparaitre .15s ease-out; }
.panneau {
  position: relative; width: 100%; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--carte); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  padding-bottom: env(safe-area-inset-bottom, 0px); animation: monter .2s ease-out;
}
.poignee { width: 40px; height: 4px; border-radius: 2px; background: var(--trait); margin: 8px auto 0; }
.panneau header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 10px; border-bottom: 1px solid var(--trait); }
.panneau header h2 { font-size: 1.05rem; }
.panneau header h2::first-letter { text-transform: uppercase; }
.panneau .contenu { overflow-y: auto; padding: 14px 16px 20px; }
@media (min-width: 760px) {
  .feuille { align-items: center; }
  .panneau { border-radius: 18px; max-height: 80vh; }
  .poignee { display: none; }
}
@keyframes monter { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes apparaitre { from { opacity: 0; } }

.bloc-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 12px; background: var(--fond); margin-bottom: 10px; }
.bloc-info p { margin: 0; }
.bloc-info.ferme { background: var(--ferme-fond); }
.bloc-info.attente { background: var(--attente-fond); }
.bloc-info.conflit { background: var(--conflit-fond); }
.bloc-info .bouton { margin-top: 4px; }
.alerte-conflit { color: var(--conflit); background: var(--conflit-fond); padding: 10px 12px; border-radius: 10px; margin: 0 0 10px; font-size: .92rem; }
.encart { border: 1px solid var(--trait); border-radius: 12px; padding: 12px; margin-top: 12px; }
.encart summary { cursor: pointer; font-weight: 600; color: var(--lien); }
.formulaire { margin-top: 6px; }
.formulaire > p.note:first-child { margin-top: 0; }
.types { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.option { position: relative; margin: 0; color: var(--encre); font-size: .9rem; }
.option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.option span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 12px; border: 1.5px solid var(--trait); border-radius: 999px; }
.option input:checked + span { border-color: var(--lien); background: var(--n2-fond); color: var(--lien); font-weight: 600; }
.option input:checked + span::before { content: "✓ "; white-space: pre; }
.option input:focus-visible + span { outline: 2px solid var(--lien); outline-offset: 2px; }
.option.fixe span { opacity: .7; }

/* ---------------- Fonctionnalités (admin) ---------------- */

.resume { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.section { padding: 0; overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--trait); }
.ligne.tete { border-top: 0; background: var(--survol); }
.ligne.tete .titre { font-weight: 650; }
.titre { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.article { display: inline-block; font-size: .72rem; color: var(--doux); border: 1px solid var(--trait); border-radius: 6px; padding: 0 6px; margin-left: 6px; white-space: nowrap; vertical-align: 1px; }
.detail { display: block; font-size: .84rem; color: var(--doux); margin-top: 2px; }
.ligne.tete .detail { font-weight: 400; }
.cases { display: flex; gap: 6px; flex-shrink: 0; }
.case { position: relative; display: inline-flex; margin: 0; }
.case input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.case span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 34px; padding: 0 8px;
  border: 1.5px solid var(--trait); border-radius: 9px; font-size: .78rem; font-weight: 650; color: var(--doux);
}
.case input:checked + span.n1 { background: var(--n1-fond); border-color: var(--n1); color: var(--n1); }
.case input:checked + span.n2 { background: var(--n2-fond); border-color: var(--n2); color: var(--n2); }
.case input:checked + span::before { content: "✓ "; white-space: pre; }
.case input:focus-visible + span { outline: 2px solid var(--lien); outline-offset: 1px; }
.supprimer { color: var(--pale); font-size: 1.1rem; line-height: 1; padding: 6px; }
.ajout { display: flex; gap: 8px; padding: 10px 12px 12px 16px; border-top: 1px solid var(--trait); }
.ajout input { flex: 1; padding: 8px 10px; min-height: 40px; }
.ajout .bouton { margin: 0; min-height: 40px; padding: 8px 12px; }
.legende b { margin-right: 4px; }

/* ---------------- Utilisateurs (admin) ---------------- */

.utilisateur { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--trait); }
.utilisateur:first-child { border-top: 0; padding-top: 0; }
.utilisateur .qui { flex: 1; min-width: 200px; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--n2-fond); color: var(--n2); font-weight: 650; }
.badge.inactif { background: var(--trait); color: var(--doux); }
.badge.societe { background: var(--fond); color: var(--encre); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lien-invitation { background: var(--n1-fond); border-color: color-mix(in srgb, var(--n1) 30%, var(--trait)); }
.lien-invitation code { display: block; word-break: break-all; font-size: .85rem; margin: 6px 0 8px; user-select: all; }

/* ---------------- Groupes de dates ---------------- */

.titre-section { margin: 22px 0 8px; }
.titre-section:first-of-type { margin-top: 4px; }
.surtitre { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pale); font-weight: 650; margin: 0 0 2px; }
.prochaines-dates { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; border-left: 4px solid var(--attente); }
.prochaines-dates.ferme { border-left-color: var(--ferme); }
.prochaines-dates.conflit { border-left-color: var(--conflit); }
.prochaines-dates .grand { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.prochaines-dates .grand::first-letter, .titre-dates h1::first-letter { text-transform: uppercase; }
.titre-dates { flex: 1; min-width: 0; }
.titre-dates h1 { font-size: 1.3rem; }
.entete-page > .chip { align-self: center; }
.date-bloc b i { font-style: normal; font-size: .72em; font-weight: 600; }
.chevron { color: var(--pale); font-size: 1.2rem; }
.frise { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 4px; }
.frise > div { display: flex; flex-direction: column; gap: 2px; background: var(--fond); border-radius: 10px; padding: 10px 12px; }
.frise b::first-letter { text-transform: uppercase; }
.a-venir { border-style: dashed; box-shadow: none; background: transparent; }
.voisins { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.voisins .bouton { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.bloc-info .lien { padding: 0; font-weight: 600; }

/* Fonctionnalités : deux familles */
.titre-portee { font-size: 1.1rem; margin: 26px 0 2px; display: flex; align-items: center; gap: 8px; }
.titre-portee::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--lien); }
.titre-portee.dates::before { background: var(--attente); }
.explication { margin: 0 0 10px !important; }
.portee { font-size: .72rem; font-weight: 650; color: var(--doux); border: 1px solid var(--trait); border-radius: 999px; padding: 3px 8px; white-space: nowrap; flex-shrink: 0; }

/* Cases du mois sur mobile : étiquettes plus serrées pour rester lisibles */
@media (max-width: 619px) {
  .jour { padding: 2px; }
  .tag { font-size: .56rem; padding: 1px 2px; letter-spacing: -.01em; text-overflow: clip; text-align: center; }
}
@media (max-width: 520px) {
  .ligne { flex-wrap: wrap; }
  .ligne .titre { flex-basis: 100%; }
  .ligne .portee { margin-left: auto; }
}
@media (max-width: 520px) { .rangee .chevron { display: none; } .rangee .chip { font-size: .68rem; padding: 3px 7px; } }
