/* ============================================================
   L'Atelier de la Danse · Maxime Pouplier
   app.css v3 · direction « barre au sol » : quasi-monochrome,
   encre chaude sur blanc cassé, filets fins, un seul accent
   discret : l'or de scène. Display Fraunces (italique pour le
   mot qui danse), texte Instrument Sans. Signature : le geste,
   un filet courbe à l'encre.
   Paddings normalisés : <a.btn> et <button.btn> partagent la
   même boîte (line-height, margin, appearance).
   ============================================================ */

:root {
  color-scheme: light;
  --blanc: #fbfaf7;
  --surface: #ffffff;
  --encre: #1a1917;
  --encre-2: #4a4843;
  --or: #a0762c;
  --or-2: #8a6524;
  --voile: #f3f1ea;
  --ligne: #e8e4dc;
  --gris: #8a857b;
  --ok: #2e7d46;
  --warn: #a9741f;
  --err: #b53a3a;
  --rayon: 14px;
  --display: 'Fraunces', serif;
  --texte: 'Instrument Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* La barre de défilement apparaît sur les vues longues (planning) et
     disparaît sur les courtes (réglages). Sans cette réserve, la largeur
     utile change et tout ce qui est centré — dont la barre d'onglets —
     se décale d'un onglet à l'autre. */
  scrollbar-gutter: stable;
}
/* Repli pour les navigateurs sans `scrollbar-gutter` : on force la barre. */
@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--texte);
  font-weight: 400;
  color: var(--encre);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 400; color: inherit; }
a { color: var(--or-2); }
button { font-family: var(--texte); cursor: pointer; }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }

.geste { display: block; width: 120px; height: auto; }
.geste path { stroke: var(--encre); stroke-width: 3; fill: none; stroke-linecap: round; }

/* -- Logo ----------------------------------------------------- */
.site-logo { display: block; height: 46px; width: auto; }
.marque-logo { display: block; width: min(260px, 80%); height: auto; margin: 0 auto; }
.app-logo { display: block; height: 30px; width: auto; }

/* -- Animations d'entrée (si le mouvement est accepté) --------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes entree {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
  }
  .hero-sur, .hero h1, .hero .geste, .hero-sous, .hero-actions {
    opacity: 0;
    animation: entree 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .hero h1 { animation-delay: 0.08s; }
  .hero .geste { animation-delay: 0.22s; }
  .hero-sous { animation-delay: 0.34s; }
  .hero-actions { animation-delay: 0.46s; }

  @keyframes trace { to { stroke-dashoffset: 0; } }
  .hero .geste path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: trace 1.2s ease 0.5s forwards;
  }

  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.65s ease, transform 0.65s ease; }
  .reveal.visible { opacity: 1; transform: none; }
  .cours-grille .reveal:nth-child(2) { transition-delay: 0.07s; }
  .cours-grille .reveal:nth-child(3) { transition-delay: 0.14s; }
  .cours-grille .reveal:nth-child(4) { transition-delay: 0.21s; }
}

/* -- Boutons -------------------------------------------------
   Même boîte pour <a> et <button> : line-height, margin et
   appearance explicites pour éviter les écarts de hauteur.   */
.btn {
  display: inline-block;
  margin: 0;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-family: var(--texte);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-align: center;
  border: 1px solid var(--encre);
  background: transparent;
  color: var(--encre);
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s ease;
}
.btn:hover { background: var(--encre); color: var(--blanc); }
.btn:active { transform: scale(0.97); }
.btn-ligne { /* alias explicite du style filet par défaut */ }
.btn-plein { background: var(--encre); border-color: var(--encre); color: var(--blanc); }
.btn-plein:hover { background: #000; border-color: #000; color: #fff; }
.btn-petit { padding: 0.38rem 0.9rem; font-size: 0.85rem; }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* -- Formulaires --------------------------------------------- */
.pile { display: flex; flex-direction: column; gap: 0.9rem; }
.rang-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; min-width: 0; }
.rang-2 > label { min-width: 0; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.88rem; font-weight: 500; }
label small { color: var(--gris); font-weight: 400; }
label > input, label > select, label > textarea { width: 100%; min-width: 0; }
select { max-width: 100%; }
input, select, textarea {
  margin: 0;
  font-family: var(--texte);
  font-size: 1rem;
  line-height: 1.3;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--ligne);
  border-radius: 10px;
  background: var(--surface);
  color: var(--encre);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
  box-sizing: border-box;
  max-width: 100%;
}
/* Safari iOS élargit les champs date/heure au-delà de leur conteneur :
   on force la largeur pleine et on neutralise l'apparence native gonflée. */
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
}
/* iOS : le contenu interne du champ date a une marge et un alignement qui
   le font déborder ; on le cale à gauche et sans marge. */
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}
input[type="date"]::-webkit-calendar-picker-indicator { margin-left: auto; }
/* Hauteur unique pour tous les contrôles d'une ligne : champs texte,
   date, heure et sélecteurs rendent exactement la même boîte. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%231a1917' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}
input:hover, select:hover, textarea:hover { border-color: #d5d0c5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px rgba(160, 118, 44, 0.16); }
textarea { resize: vertical; min-height: 90px; }

.form-erreur, .form-retour.err { color: var(--err); font-size: 0.9rem; margin: 0; }
.form-retour.ok { color: var(--ok); font-size: 0.9rem; margin: 0; }

.carte {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 1.5rem;
}

/* ============================================================
   PAGE PUBLIQUE
   ============================================================ */
.site-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 5vw, 4rem);
  border-bottom: 1px solid var(--ligne);
  position: sticky;
  top: 0;
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 20;
}
.site-nom {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--encre);
}
.site-tete nav { display: flex; align-items: center; gap: 1.7rem; }
.site-tete nav a { text-decoration: none; color: var(--encre-2); font-size: 0.92rem; font-weight: 500; }
.site-tete nav a:hover { color: var(--encre); }
.site-tete .btn { padding: 0.45rem 1.1rem; font-size: 0.88rem; }

/* Les ancres laissent le titre visible sous le header sticky */
.section, .bande { scroll-margin-top: 82px; }

/* Bouton menu (mobile) */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 9px;
  margin: 0;
  background: none;
  border: 1px solid var(--ligne);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}
.menu-btn span {
  display: block;
  height: 2px;
  background: var(--encre);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-ouvert .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-ouvert .menu-btn span:nth-child(2) { opacity: 0; }
.menu-ouvert .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
  padding: clamp(4.5rem, 11vw, 8.5rem) clamp(1rem, 5vw, 4rem) clamp(3.5rem, 8vw, 6rem);
  max-width: 1200px;
  margin: 0 auto;
}
.hero-sur {
  margin: 0 0 1.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--or);
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2.6rem, 7.5vw, 5.2rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero .geste { margin: 2.4rem 0; }
.hero-sous {
  max-width: 540px;
  margin: 0 0 2.4rem;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--encre-2);
}
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* -- Bande défilante ------------------------------------------- */
.bande { border-block: 1px solid var(--ligne); overflow: hidden; }
.bande-piste { display: flex; width: max-content; padding: 0.85rem 0; }
.bande-piste span {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--encre-2);
  white-space: nowrap;
  margin-right: 2.6rem;
}
.bande-piste .sep { color: var(--or); font-style: normal; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes defile { to { transform: translateX(-50%); } }
  .bande-piste { animation: defile 38s linear infinite; }
}

/* -- La scène (photo du spectacle) -------------------------------- */
.scene {
  margin: 2.2rem 0 0;
  border: 1px solid var(--ligne);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}
.scene img { display: block; width: 100%; height: auto; }
.scene figcaption {
  padding: 0.8rem 1.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--or);
  border-top: 1px solid var(--ligne);
}

.section { padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 5vw, 4rem); max-width: 1200px; margin: 0 auto; }
.section-titre {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}
.section-sous { max-width: 600px; color: var(--encre-2); line-height: 1.65; margin: 0 0 2rem; }

.cours-grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 2.4rem;
}
.cours-carte {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.cours-carte:hover { border-color: #d5cfc2; }
.cours-corps { padding: 1.6rem 1.6rem 1.7rem; }
.cours-corps .qui {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--or);
  margin-bottom: 0.7rem;
}
.cours-corps h3 { font-size: 1.4rem; font-weight: 500; margin-bottom: 0.6rem; }
.cours-corps p { margin: 0; line-height: 1.65; font-size: 0.95rem; color: var(--encre-2); }

.section-sombre {
  background: var(--encre);
  color: var(--blanc);
  max-width: none;
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.section-sombre > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.section-sombre :focus-visible { outline-color: var(--blanc); }

.ecole-grille {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.ecole-sur {
  margin: 0 0 1.4rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--or);
}
.ecole-titre {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--blanc);
  max-width: 15ch;
  margin-bottom: 1.4rem;
}
.ecole-texte {
  max-width: 56ch;
  line-height: 1.8;
  font-size: 1.03rem;
  color: #cfccc4;
  margin: 0 0 2.4rem;
}
.ecole-chiffres {
  display: flex;
  gap: clamp(1.6rem, 4vw, 3.2rem);
  flex-wrap: wrap;
  border-top: 1px solid rgba(251, 250, 247, 0.14);
  padding-top: 1.6rem;
}
.chiffre { display: flex; flex-direction: column; gap: 0.3rem; }
.chiffre strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1;
  color: var(--blanc);
}
.chiffre span {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #8f8b82;
}

.ecole-carte {
  border: 1px solid rgba(251, 250, 247, 0.16);
  border-radius: 18px;
  background: rgba(251, 250, 247, 0.035);
  padding: 2rem 1.9rem;
  overflow: hidden;
}
.ecole-portrait { margin: -2rem -1.9rem 0; }
.ecole-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3.6; object-fit: cover; }
.ecole-portrait figcaption {
  padding: 0.9rem 1.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--or);
}
.ecole-carte-ligne {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 0;
  border-top: 1px solid rgba(251, 250, 247, 0.12);
  font-size: 0.97rem;
  color: #e8e6df;
}
.ecole-carte-ligne a { color: var(--blanc); text-decoration-color: rgba(251, 250, 247, 0.4); }
.ecole-carte-ligne a:hover { text-decoration-color: var(--or); }
.ecole-carte-lib {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--or);
}
.ecole-carte-btn {
  display: block;
  text-align: center;
  margin-top: 1.4rem;
  border-color: rgba(251, 250, 247, 0.45);
  color: var(--blanc);
}
.ecole-carte-btn:hover { background: var(--blanc); border-color: var(--blanc); color: var(--encre); }

.inscription-grille {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.inscription-sur { color: var(--or); }
.inscription-titre {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 1.2rem;
}
.etapes { list-style: none; margin: 2.2rem 0 0; padding: 0; }
.etape {
  display: flex;
  gap: 1.3rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--ligne);
}
.etape-num {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--or);
  line-height: 1.1;
  flex-shrink: 0;
  min-width: 2.2rem;
}
.etape strong { display: block; font-size: 1.02rem; font-weight: 600; margin-bottom: 0.3rem; }
.etape p { margin: 0; font-size: 0.93rem; line-height: 1.6; color: var(--encre-2); }

.inscription-carte {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 18px;
  padding: 2rem 1.9rem;
}
.inscription-carte-sur {
  margin: 0 0 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--ligne);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--or);
}
.inscription-carte .btn { width: 100%; }
.inscription-rgpd { margin: 0.2rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--gris); text-align: center; }
.inscription-rgpd a { color: var(--gris); }
.inscription-rgpd a:hover { color: var(--or-2); }

.inscription-merci { text-align: center; padding: 2.5rem 0.5rem; }
.inscription-merci .geste { margin: 0 auto 1.4rem; }
.inscription-merci .geste path { stroke: var(--or); }
.inscription-merci h3 { font-size: 1.5rem; font-weight: 500; margin-bottom: 0.8rem; }
.inscription-merci p { margin: 0 auto; max-width: 40ch; line-height: 1.7; color: var(--encre-2); }

.site-pied {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.6rem clamp(1rem, 5vw, 4rem);
  border-top: 1px solid var(--ligne);
  font-size: 0.85rem;
  color: var(--gris);
}

/* ============================================================
   LOGIN
   ============================================================ */
.page-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 18px;
  padding: 2.4rem 2.2rem;
}
.login-retour { font-size: 0.85rem; text-decoration: none; color: var(--gris); }
.login-retour:hover { color: var(--encre); }
.marque { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; margin: 1.4rem 0 0.6rem; text-align: center; }
.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;
}
.login-intro { text-align: center; color: var(--gris); margin: 0 0 1.6rem; font-size: 0.94rem; }
.login-pied { text-align: center; font-size: 0.9rem; margin: 1.2rem 0 0; color: var(--gris); }

/* ============================================================
   ESPACE CONNECTÉ
   ============================================================ */
.page-app { background: var(--blanc); }

.app-tete {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem clamp(0.8rem, 3vw, 2rem);
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne);
  position: sticky;
  top: 0;
  z-index: 30;
}
.app-actions { justify-self: end; display: flex; align-items: center; gap: 0.5rem; }
.app-nom {
  justify-self: start;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
  color: var(--encre);
  text-decoration: none;
}
.app-nom:hover { color: var(--or-2); }
.app-onglets {
  justify-self: center;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--voile);
  border: 1px solid var(--ligne);
  border-radius: 999px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-onglets::-webkit-scrollbar { display: none; }
.app-onglets a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  color: var(--encre-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.app-onglets a:hover { background: rgba(255, 255, 255, 0.9); color: var(--encre); }
.app-onglets a.lit { background: var(--encre); color: var(--blanc); }
/* Le badge des messages non lus disparaît dès qu'on ouvre la messagerie.
   Plutôt que de le retirer d'un coup (la barre, centrée, sautait), on le
   replie : sa largeur s'anime jusqu'à zéro, donc la barre se recentre en
   glissant. Même chose à l'apparition d'un nouveau message. */
.app-onglets a .badge {
  max-width: 40px;
  overflow: hidden;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
}
.app-onglets a .badge[hidden] {
  display: inline-block;   /* on garde l'élément pour pouvoir l'animer */
  max-width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  margin-left: -0.4rem;    /* absorbe l'espacement du conteneur */
}
.tab-ico { display: none; }
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--or);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.app-sortie {
  margin: 0;
  background: none;
  border: 1px solid var(--ligne);
  color: var(--encre-2);
  border-radius: 999px;
  padding: 0.38rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.12s, color 0.12s;
}
.app-sortie:hover { border-color: var(--encre); color: var(--encre); }

.app-cloche {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  background: none;
  border: 1px solid var(--ligne);
  border-radius: 50%;
  color: var(--encre-2);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.12s, color 0.12s;
}
.app-cloche svg { width: 18px; height: 18px; }
.app-cloche:hover { border-color: var(--encre); color: var(--encre); }
.app-cloche.active { color: var(--or-2); border-color: #e0d2b2; }
.cloche-point {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--or);
  border: 1.5px solid var(--blanc);
}

.app-vue { padding: clamp(1rem, 3vw, 2rem); max-width: 1100px; margin: 0 auto; }

/* -- Entrée de vue : blocs qui montent en fondu, en cascade douce -- */
@keyframes vue-entre {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.vue-anime > * {
  animation: vue-entre 0.5s cubic-bezier(0.22, 0.7, 0.24, 1) both;
}
.vue-anime > *:nth-child(1) { animation-delay: 0.02s; }
.vue-anime > *:nth-child(2) { animation-delay: 0.07s; }
.vue-anime > *:nth-child(3) { animation-delay: 0.12s; }
.vue-anime > *:nth-child(4) { animation-delay: 0.17s; }
.vue-anime > *:nth-child(5) { animation-delay: 0.22s; }
.vue-anime > *:nth-child(n+6) { animation-delay: 0.26s; }
/* Les items d'une liste ondulent à leur tour, en interne */
@keyframes item-entre {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.vue-anime .liste > *, .vue-anime .agenda-jour {
  animation: item-entre 0.42s cubic-bezier(0.22, 0.7, 0.24, 1) both;
}
.vue-anime .liste > *:nth-child(1) { animation-delay: 0.06s; }
.vue-anime .liste > *:nth-child(2) { animation-delay: 0.10s; }
.vue-anime .liste > *:nth-child(3) { animation-delay: 0.14s; }
.vue-anime .liste > *:nth-child(4) { animation-delay: 0.18s; }
.vue-anime .liste > *:nth-child(5) { animation-delay: 0.22s; }
.vue-anime .liste > *:nth-child(6) { animation-delay: 0.26s; }
.vue-anime .liste > *:nth-child(n+7) { animation-delay: 0.3s; }
.vue-anime .agenda-jour:nth-child(2) { animation-delay: 0.08s; }
.vue-anime .agenda-jour:nth-child(3) { animation-delay: 0.14s; }
.vue-anime .agenda-jour:nth-child(4) { animation-delay: 0.2s; }
.vue-anime .agenda-jour:nth-child(n+5) { animation-delay: 0.24s; }

.vue-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}
.vue-tete h2 { font-size: 1.7rem; font-weight: 500; }
.vue-sous { color: var(--gris); font-size: 0.92rem; margin: 0.2rem 0 0; }

.vide { color: var(--gris); padding: 2.2rem 0; text-align: center; }

/* -- Listes / lignes ----------------------------------------- */
.liste { display: flex; flex-direction: column; gap: 0.55rem; }
.ligne {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.ligne-clic { cursor: pointer; }
@media (hover: hover) {
  .ligne-clic:hover { border-color: #d9d3c6; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26, 25, 23, 0.07); }
}
.ligne-clic:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(26, 25, 23, 0.06); }
.ligne-corps { flex: 1; min-width: 0; }
.ligne-titre { font-weight: 600; }
.ligne-detail { font-size: 0.85rem; color: var(--gris); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-fin { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.pastille {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.18rem 0.62rem;
  border-radius: 999px;
  white-space: nowrap;
}
.appel-choix { flex-direction: row; align-items: center; gap: 0.45rem; font-weight: 400; white-space: nowrap; }
.appel-choix input { accent-color: var(--encre); width: 16px; height: 16px; }
.reglement-choix { white-space: normal; align-items: flex-start; }
.reglement-choix input { margin-top: 2px; flex-shrink: 0; }

/* -- Dossier d'inscription ------------------------------------- */
.dossier { display: flex; flex-direction: column; }
.dossier-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
  border-top: 1px solid var(--ligne);
}
.dossier-ligne:first-child { border-top: 0; padding-top: 0.2rem; }
.dossier-corps strong { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dossier-detail { display: block; font-size: 0.82rem; color: var(--gris); margin-top: 0.15rem; }
.dossier-champs { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.dossier-champs label { min-width: 130px; }

.mineur-note {
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 0.8rem 1rem;
  border: 1px solid #e6d8ba;
  background: #fdfbf4;
  border-radius: 12px;
  color: var(--encre-2);
}
.pastille.actif { background: #e6f0e8; color: var(--ok); }
.pastille.en_attente { background: #f4ecdc; color: var(--warn); }
.pastille.inactif { background: #edebe6; color: var(--gris); }
.pastille.paye { background: #e6f0e8; color: var(--ok); }
.pastille.admin { background: #f1e8d4; color: var(--or-2); }
.pastille.prof { background: #e4ebe0; color: #4a6b52; }
.pastille.categorie { background: #ece7f0; color: #6a5a7a; }
.pastille.cat-enfants { background: #e7f0ea; color: #4a6b52; }
.pastille.cat-ados { background: #eef0e6; color: #5f6b3a; }
.pastille.cat-adultes { background: #e8edf2; color: #445a72; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--voile);
  flex-shrink: 0;
}
.avatar-lettres {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--encre);
  color: var(--blanc);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-grand { width: 88px; height: 88px; font-size: 1.6rem; }

/* -- Planning : grille horaire 8h-22h, Lun-Sam + Dim grisé ------ */
.grille-scroll {
  overflow-x: auto;
  background: linear-gradient(180deg, #fffdf9 0%, var(--surface) 100%);
  border: 1px solid var(--ligne);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(26, 25, 23, 0.05), 0 1px 2px rgba(26, 25, 23, 0.04);
  padding: 0 2px 2px;
}
.grille {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(112px, 1fr));
  min-width: 900px;
}
.grille-coin {
  border-bottom: 1px solid var(--ligne);
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fffdf9;
}
.grille-tete {
  padding: 0.85rem 0.3rem 0.7rem;
  text-align: center;
  border-bottom: 1px solid var(--ligne);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fffdf9;
}
.gt-jour {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gris);
}
.gt-num {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--encre);
  line-height: 1;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.grille-tete.dim .gt-jour, .grille-tete.dim .gt-num { color: #bcb6a9; }
/* Jour courant : en-tête mis en valeur avec la pastille dorée */
.grille-tete.auj .gt-jour { color: var(--or-2); }
.grille-tete.auj .gt-num {
  background: linear-gradient(180deg, #b58a34, #9a6f24);
  color: #fff;
  box-shadow: 0 2px 6px rgba(154, 111, 36, 0.35);
}
.grille-heures { position: relative; }
.grille-heure {
  position: absolute;
  right: 9px;
  transform: translateY(-0.5em);
  font-size: 0.72rem;
  font-weight: 500;
  color: #b0a99c;
}
.grille-heure small { font-size: 0.62rem; opacity: 0.7; }
.grille-heures .grille-heure:first-child { transform: none; }
.grille-jour {
  position: relative;
  border-left: 1px solid #efece4;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 51px,
    #f2efe8 51px 52px
  );
}
/* demi-heures en repère très léger */
.grille-jour::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 25px,
    #f8f6f1 25px 26px,
    transparent 26px 52px
  );
  pointer-events: none;
}
.grille-jour.dim { background-color: #faf8f3; }
/* Colonne du jour courant subtilement mise en valeur */
.grille-jour.auj { background-color: #fefbf4; }
.grille-jour.auj::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(180, 138, 52, 0.16);
  pointer-events: none;
}
body[data-role="admin"] .grille-jour:not(.dim) { cursor: copy; }
body[data-role="admin"] .grille-jour:not(.dim):hover { background-color: #fdfcf9; }

/* Trait « maintenant » qui traverse le jour courant */
.grille-now {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid #c0392b;
  z-index: 4;
  pointer-events: none;
}
.grille-now-pt {
  position: absolute;
  left: -1px; top: -4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #c0392b;
}

.grille .cours { position: absolute; overflow: hidden; margin: 0; }
.cours {
  display: flex;
  background: var(--fond, var(--surface));
  border: 1px solid rgba(26, 25, 23, 0.08);
  border-color: color-mix(in srgb, var(--bord, var(--or)) 22%, transparent);
  border-radius: 11px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  box-shadow: 0 1px 3px rgba(26, 25, 23, 0.06);
}
.cours-bar {
  flex-shrink: 0;
  width: 4px;
  background: var(--bord, var(--or));
  border-radius: 11px 0 0 11px;
}
.cours-in {
  padding: 0.36rem 0.55rem 0.36rem 0.5rem;
  min-width: 0;
  overflow: hidden;
}
@media (hover: hover) {
  .cours:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26, 25, 23, 0.14); z-index: 5; }
}
.cours.mien {
  box-shadow: 0 0 0 1.5px var(--bord, var(--or)), 0 2px 6px rgba(26, 25, 23, 0.1);
}
.cours.mien .cours-nom::after {
  content: '★';
  font-size: 0.62rem;
  color: var(--bord, var(--or));
  margin-left: 0.3rem;
  vertical-align: 1px;
}
.cours-heure { font-weight: 600; font-size: 0.7rem; color: var(--bord, var(--encre)); filter: brightness(0.82); letter-spacing: 0.01em; }
.cours-nom { font-weight: 600; font-size: 0.8rem; color: var(--encre); margin-top: 0.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cours-niv {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--encre-2);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 5px;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
  vertical-align: 1px;
}
.cours-meta { color: var(--gris); font-size: 0.68rem; margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Cours courts (≤45 min) : on masque la métadonnée pour ne pas déborder */
.cours.court .cours-in { padding-top: 0.28rem; padding-bottom: 0.28rem; }
.cours.court .cours-meta { display: none; }
.cours.court .cours-nom { font-size: 0.75rem; }

/* -- Vue agenda (mobile) ------------------------------------------ */
.agenda { display: none; }
.agenda-jour { display: flex; gap: 0.9rem; padding: 0.5rem 0; }
.agenda-jour + .agenda-jour { border-top: 1px solid var(--ligne); }
.agenda-date {
  flex-shrink: 0;
  width: 44px;
  padding-top: 0.55rem;
  text-align: center;
}
.agenda-j {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--or);
}
.agenda-jj { display: none; }
.agenda-cours { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.4rem 0; min-width: 0; }
.agenda-item {
  display: flex;
  align-items: stretch;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: var(--fond, var(--surface));
  border: 1px solid var(--ligne);
  border-left: 3px solid var(--bord, var(--or));
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(26, 25, 23, 0.06);
  transition: transform 0.1s ease;
  -webkit-appearance: none;
  appearance: none;
}
.agenda-item:active { transform: scale(0.98); }
.agenda-item.mien { box-shadow: inset 0 0 0 1.5px var(--bord, var(--or)); }
.agenda-heure {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--encre);
  line-height: 1.25;
}
.agenda-heure small { font-size: 0.7rem; font-weight: 400; color: var(--gris); }
.agenda-corps { display: flex; flex-direction: column; justify-content: center; gap: 0.15rem; min-width: 0; }
.agenda-nom { font-weight: 500; font-size: 0.95rem; }
.agenda-meta { font-size: 0.78rem; color: var(--gris); }
.agenda-vide { margin: 0; padding: 0.6rem 0; font-size: 0.85rem; color: #b9b3a7; }

/* -- Compta ------------------------------------------------------ */
.synthese {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}
.synthese-carte {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 1.1rem 1.25rem;
}
.synthese-carte .libelle {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gris);
}
.synthese-carte .valeur { font-family: var(--display); font-weight: 500; font-size: 1.75rem; margin-top: 0.3rem; }
.valeur.positif { color: var(--ok); }
.valeur.negatif { color: var(--err); }

.sous-titre {
  font-family: var(--texte);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gris);
  margin: 1.8rem 0 0.8rem;
}

/* -- Messagerie --------------------------------------------------- */
.chat {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1rem;
  height: calc(100dvh - 140px);
  min-height: 420px;
}
.chat-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
}
.chat-col .barre-rech { margin-bottom: 0; }
.chat-contacts {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
}
.grp-contacts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.grp-contacts[hidden] { display: none; }
.chat-contacts .ligne-clic.actif {
  border-color: #d9d3c6;
  box-shadow: inset 3px 0 0 var(--or);
}
.chat-fil {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  overflow: hidden;
}
.chat-fil-tete {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--ligne);
  font-weight: 600;
}
.chat-fil-retour { display: none; margin: 0; background: none; border: none; font-size: 1.2rem; color: var(--encre); padding: 0.2rem 0.4rem; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.bulle {
  max-width: 72%;
  padding: 0.55rem 0.9rem;
  border-radius: 15px;
  font-size: 0.94rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
@keyframes bulle-entre { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.bulle.neuve { animation: bulle-entre 0.24s cubic-bezier(0.22, 0.8, 0.3, 1); }
.bulle.moi { align-self: flex-end; background: var(--encre); color: var(--blanc); border-bottom-right-radius: 5px; }
.bulle.lui { align-self: flex-start; background: var(--voile); border-bottom-left-radius: 5px; }
.bulle time { display: block; font-size: 0.68rem; opacity: 0.6; margin-top: 0.2rem; }
/* Message en cours d'envoi : légèrement estompé, l'heure « envoi… » pulse */
.bulle.envoi { opacity: 0.72; }
.bulle.envoi time { animation: envoi-pulse 1.1s ease-in-out infinite; }
@keyframes envoi-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.85; } }
/* Échec d'envoi : liseré discret d'alerte */
.bulle.erreur { background: #7a2e2e; }
.bulle.erreur time { opacity: 0.85; }
.fil-statut {
  align-self: flex-end;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--gris);
  margin: -0.1rem 0.5rem 0.15rem 0;
}
.chat-saisie {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem;
  border-top: 1px solid var(--ligne);
}
.chat-saisie input { flex: 1; }
.chat-saisie .btn { height: 42px; padding-top: 0; padding-bottom: 0; }

/* -- Annonces ------------------------------------------------------ */
.annonce {
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
  padding: 1.4rem 1.5rem;
  transition: border-color 0.12s;
}
.annonce[data-id] { cursor: pointer; }
.annonce[data-id]:hover { border-color: var(--encre); }
.annonce-date {
  flex-shrink: 0;
  min-width: 58px;
  text-align: center;
  padding-right: 1.3rem;
  border-right: 1px solid var(--ligne);
}
.annonce-date strong {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.9rem;
  line-height: 1.05;
}
.annonce-date span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gris);
}
.annonce-corps { min-width: 0; }
.annonce-badges { display: flex; gap: 0.4rem; margin-bottom: 0.45rem; }
.badge-annonce {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--voile);
  color: var(--encre-2);
}
.badge-annonce.or { background: #f1e8d4; color: var(--or-2); }
.annonce h3 { font-size: 1.2rem; font-weight: 500; margin-bottom: 0.3rem; }
.annonce p { margin: 0; line-height: 1.65; white-space: pre-wrap; color: var(--encre-2); }
.annonce time { display: block; font-size: 0.75rem; color: var(--gris); margin-top: 0.6rem; }
.annonce.epinglee { border-color: #e6d8ba; background: #fdfbf4; }
.annonce.epinglee .annonce-date { border-right-color: #ecdfc4; }
.annonces-vide { text-align: center; padding: 3rem 1rem; color: var(--gris); }
.annonces-vide .geste { margin: 0 auto 1.2rem; }
.annonces-vide .geste path { stroke: var(--or); }

/* -- Profil --------------------------------------------------------- */
.profil-tete { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.5rem; }
.profil-photo-btn { font-size: 0.85rem; }

/* -- Dialogue (modale) ----------------------------------------------- */
dialog {
  border: 1px solid var(--ligne);
  border-radius: 16px;
  padding: 1.6rem;
  width: min(480px, calc(100vw - 2rem));
  background: var(--surface);
  color: var(--encre);
  box-shadow: 0 18px 50px rgba(26, 25, 23, 0.16);
}
@keyframes dialog-entre {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes backdrop-entre { from { opacity: 0; } to { opacity: 1; } }
dialog[open] { animation: dialog-entre 0.28s cubic-bezier(0.22, 0.9, 0.3, 1); }
dialog[open]::backdrop { animation: backdrop-entre 0.28s ease; }
dialog::backdrop { background: rgba(26, 25, 23, 0.45); }
dialog h3 { margin-bottom: 1rem; font-weight: 500; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.dialog-actions .btn { min-width: 104px; }

/* Confirmation animée d'enregistrement sur un bouton */
.btn-ok, .btn-ok:hover { background: var(--ok); border-color: var(--ok); color: var(--blanc); }
.btn-ok-in { display: inline-flex; align-items: center; gap: 0.4rem; animation: btn-ok-pop 0.25s ease; }
.btn-ok-in svg { width: 16px; height: 16px; }
.btn-ok-in path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: btn-ok-trace 0.4s 0.05s ease forwards; }
@keyframes btn-ok-pop { from { transform: scale(0.9); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
@keyframes btn-ok-trace { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .btn-ok-in, .btn-ok-in path { animation: none; stroke-dashoffset: 0; }
}

/* -- Responsive -------------------------------------------------------- */
@media (max-width: 760px) {
  /* · Planning : grille masquée, vue agenda en liste par jour · */
  .grille-scroll { display: none; }
  .agenda { display: block; }

  /* · Site public : menu déroulant complet (sections + session) · */
  .menu-btn { display: flex; }
  .site-tete nav#menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem clamp(1rem, 5vw, 4rem) 1.1rem;
    background: rgba(251, 250, 247, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ligne);
  }
  .menu-ouvert nav#menu { display: flex; }
  .site-tete nav#menu a:not(.btn) {
    padding: 0.8rem 0;
    font-size: 1.02rem;
    border-bottom: 1px solid var(--ligne);
  }
  .site-tete nav#menu .btn { margin-top: 0.9rem; text-align: center; padding: 0.6rem 1.1rem; }
  .site-logo { height: 38px; }
  .section, .bande { scroll-margin-top: 72px; }

  /* · App : barre de navigation en bas d'écran, façon app native · */
  .app-tete {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(251, 250, 247, 0.97);
  }
  .app-nom { margin-right: auto; }
  .app-logo { height: 24px; max-width: 170px; object-fit: contain; object-position: left; }
  .app-onglets {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    width: auto;
    max-width: calc(100vw - 28px);
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 7px 9px;
    background: rgba(28, 26, 24, 0.42);
    backdrop-filter: blur(22px) saturate(1.7);
    -webkit-backdrop-filter: blur(22px) saturate(1.7);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    overflow: visible;
    box-shadow: 0 10px 32px rgba(26, 25, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    animation: barre-monte 0.4s cubic-bezier(0.34, 1.3, 0.64, 1) both;
  }
  @keyframes barre-monte {
    from { opacity: 0; transform: translateX(-50%) translateY(14px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  .app-onglets a {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    gap: 0;
    font-size: 0;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72);
    transition: color 0.2s ease, background 0.25s ease, width 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
  }
  .app-onglets a:hover { background: transparent; color: rgba(255, 255, 255, 0.9); }
  .tab-ico {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.5, 1);
  }
  .tab-ico svg { width: 24px; height: 24px; display: block; stroke-width: 1.7; }
  /* Libellé masqué par défaut, révélé sur l'onglet actif facon "pill" */
  .tab-lib {
    display: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
  .app-onglets a .badge {
    position: absolute;
    top: 4px;
    right: 6px;
    left: auto;
    line-height: 16px;
    min-width: 16px;
    font-size: 0.58rem;
    box-shadow: 0 0 0 2px rgba(28, 26, 24, 0.6);
  }
  /* En absolu, le badge ne pousse rien : il apparaît et disparaît en fondu. */
  .app-onglets a .badge[hidden] {
    margin-left: 0;
    max-width: 40px;
    min-width: 16px;
    padding: 0 5px;
    opacity: 0;
  }
  /* Onglet actif : capsule claire qui s'élargit, icône + libellé */
  .app-onglets a.lit {
    width: auto;
    gap: 6px;
    padding: 0 14px 0 11px;
    grid-auto-flow: column;
    background: rgba(255, 255, 255, 0.95);
    color: var(--encre);
  }
  .app-onglets a.lit .tab-ico { width: auto; }
  .app-onglets a.lit .tab-ico svg { stroke: var(--or-2); animation: ico-pop 0.4s ease; }
  .app-onglets a.lit .tab-lib { display: block; animation: lib-entre 0.28s ease both; }
  .app-onglets a.lit .badge { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95); }
  @keyframes ico-pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
  @keyframes lib-entre { from { opacity: 0; max-width: 0; } to { opacity: 1; max-width: 120px; } }
  /* Écrans étroits : icônes compactes pour les 7 onglets admin */
  @media (max-width: 420px) {
    .app-onglets { gap: 1px; padding: 6px 7px; }
    .app-onglets a { width: 40px; height: 40px; }
    .tab-ico svg { width: 21px; height: 21px; }
    .app-onglets a.lit { padding: 0 12px 0 9px; gap: 5px; }
    .app-onglets a.lit .tab-lib { font-size: 0.66rem; }
  }
  @media (max-width: 360px) {
    .app-onglets a { width: 36px; height: 36px; }
    .tab-ico svg { width: 20px; height: 20px; }
    .app-onglets a.lit .tab-lib { display: none; }
    .app-onglets a.lit { width: 36px; padding: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .app-onglets, .app-onglets a, .tab-ico, .app-onglets a.lit .tab-ico svg, .app-onglets a.lit .tab-lib { animation: none; transition: none; }
  }
  .app-vue { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .chat { height: calc(100dvh - 200px); }

  .rang-2 { grid-template-columns: 1fr; }
  .cours-grille { grid-template-columns: 1fr; }
  .ecole-grille { grid-template-columns: 1fr; }
  .inscription-grille { grid-template-columns: 1fr; }
  .ecole-titre { max-width: none; }
  .chat { grid-template-columns: 1fr; }
  .chat.fil-ouvert .chat-col { display: none; }
  .chat:not(.fil-ouvert) .chat-fil { display: none; }
  .chat-fil-retour { display: block; }
}

/* Actions d'une ligne de dossier : colonnes régulières quel que soit le libellé */
.dossier-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.dossier-actions .btn { min-width: 124px; }
.dossier-actions .pastille { min-width: 92px; text-align: center; }

/* Choix des disciplines suivies (fiche élève) */
.champ-libelle { display: block; font-size: 0.82rem; font-weight: 500; color: var(--encre-2); margin-bottom: 0.4rem; }
.choix-disciplines { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; padding: 0.2rem 0; }
.choix-disciplines .appel-choix { white-space: normal; }

/* Cases d'affectation aux créneaux (fiche élève) */
.creneau-ligne { cursor: pointer; align-items: center; gap: 0.8rem; }
.creneau-ligne .creneau-case { width: 18px; height: 18px; accent-color: var(--encre); flex-shrink: 0; }

/* Séparateurs de groupes dans la liste de messagerie */
.chat-groupe {
  padding: 0.7rem 1rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--or);
}
.grp-contacts:first-child .chat-groupe { padding-top: 0.3rem; }

/* ============================================================
   Invitation à installer l'application (mobile)
   ============================================================ */
.pwa-invite {
  border: 1px solid var(--ligne);
  border-radius: 22px;
  padding: 1.8rem 1.5rem 1.4rem;
  width: min(400px, calc(100vw - 1.6rem));
  background: var(--surface);
  color: var(--encre);
  box-shadow: 0 24px 60px rgba(26, 25, 23, 0.22);
  text-align: center;
}
.pwa-invite::backdrop { background: rgba(26, 25, 23, 0.5); backdrop-filter: blur(3px); }
.pwa-fermer {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gris);
  cursor: pointer;
  padding: 0.2rem;
}
.pwa-entete { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.pwa-icone {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(26, 25, 23, 0.2);
}
.pwa-entete h3 { font-size: 1.2rem; font-weight: 500; margin: 0; }
.pwa-entete p {
  margin: 0 auto;
  max-width: 30ch;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--encre-2);
}
.pwa-onglets {
  display: flex;
  gap: 0.3rem;
  margin: 1.4rem 0 1.2rem;
  background: var(--voile);
  padding: 0.28rem;
  border-radius: 12px;
}
.pwa-onglet {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.55rem;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gris);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.pwa-onglet.actif { background: var(--surface); color: var(--encre); box-shadow: 0 1px 4px rgba(26, 25, 23, 0.1); }
/* Hauteur figée : la fenêtre ne change pas de taille en basculant iOS/Android. */
.pwa-pan { min-height: 118px; }
/* Étapes : numéro + texte alignés, texte à gauche pour la lisibilité,
   bloc centré dans la modale pour l'équilibre visuel. */
.pwa-etapes {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  max-width: 300px;
  text-align: left;
}
.pwa-etapes li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--encre-2);
}
.pwa-txt { padding-top: 0.02rem; }
.pwa-etapes strong { color: var(--encre); font-weight: 600; }
.pwa-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--encre);
  color: var(--blanc);
  font-size: 0.8rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.pwa-actions { display: flex; gap: 0.6rem; margin-top: 1.5rem; }
.pwa-actions .btn { flex: 1; }
.pwa-discret { border-color: var(--ligne); color: var(--gris); }
.pwa-discret:hover { background: var(--voile); color: var(--encre); border-color: var(--ligne); }
@keyframes pwa-entre { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }
.pwa-invite[open] { animation: pwa-entre 0.32s cubic-bezier(0.2, 0.85, 0.3, 1); }

/* ============================================================
   Tableau de bord (direction)
   ============================================================ */
.bord-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.5rem;
}
.bord-carte {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(26, 25, 23, 0.04);
  position: relative;
  overflow: hidden;
}
.bord-carte::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--or);
}
.bord-carte.accent-vert::before { background: #4a6b52; }
.bord-carte.accent-ambre::before { background: #b98a34; }
.bord-val { font-family: var(--titre, 'Fraunces', serif); font-size: 1.9rem; font-weight: 500; line-height: 1.1; }
.bord-lib { font-size: 0.9rem; font-weight: 600; margin-top: 0.2rem; }
.bord-sous { font-size: 0.8rem; color: var(--gris); margin-top: 0.25rem; }

/* ============================================================
   Liste Membres : pastilles compactes sur mobile
   ============================================================ */
.pastille .p-court { display: none; }
.pastille .p-long { display: inline; }
@media (max-width: 560px) {
  /* Sur mobile, on abrège les pastilles pour laisser voir le nom */
  .ligne-fin { gap: 0.3rem; flex-shrink: 1; min-width: 0; justify-content: flex-end; flex-wrap: wrap; }
  .ligne-fin .pastille { padding: 0.16rem 0.42rem; font-size: 0.7rem; }
  .pastille .p-long { display: none; }
  .pastille .p-court { display: inline; }
  /* garantir au nom une part minimale de la ligne */
  .ligne-corps { flex: 1 1 45%; }
}

/* Regroupement de champs (contacts d'urgence) */
.champ-groupe {
  background: var(--voile);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.champ-groupe .champ-libelle { margin-bottom: 0; }

/* Bouton attestation de paiement (compta) */
.ligne-clic-p { cursor: pointer; flex: 1; min-width: 0; }
.btn-attest {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--ligne);
  color: var(--encre-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
@media (hover: hover) {
  .btn-attest:hover { background: var(--voile); border-color: #d9d3c6; }
}

/* ============================================================
   Statistiques (tableau de bord)
   ============================================================ */
.stats-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}
.stat-carte {
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(26, 25, 23, 0.04);
}
.stat-titre { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.9rem; }
.stat-chiffre { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 500; line-height: 1; }
.stat-unite { font-family: 'Instrument Sans', sans-serif; font-size: 0.8rem; font-weight: 400; color: var(--gris); }
.stat-note { font-size: 0.78rem; color: var(--gris); margin-top: 0.6rem; }
.stat-note.ambre { color: #8a6524; }
.stat-note.vert { color: #4a6b52; }
.stat-barre-ligne {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
}
.stat-barre-lbl { flex: 0 0 33%; color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-barre-piste { flex: 1; height: 8px; background: var(--voile); border-radius: 999px; overflow: hidden; }
.stat-barre-remplie { display: block; height: 100%; border-radius: 999px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.3, 1); }
.stat-barre-val { flex: 0 0 auto; font-weight: 600; min-width: 1.4rem; text-align: right; }

/* Contacts d'urgence affichés au professeur */
.prof-urgence {
  font-size: 0.82rem;
  color: var(--encre-2);
  background: var(--voile);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.prof-urgence.vide-urg { color: var(--gris); font-style: italic; }

/* ============================================================
   Gala de fin d'année
   ============================================================ */
.bord-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.3rem 0 0.5rem; }
.bord-lien {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--ligne);
  background: var(--surface);
  color: var(--encre);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
@media (hover: hover) {
  .bord-lien:hover { background: var(--voile); border-color: #d9d3c6; transform: translateY(-1px); }
}
.gala-ordre {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--voile);
  display: grid; place-items: center;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--or-2);
}
.gala-eleves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.8rem;
  max-height: 210px;
  overflow-y: auto;
  padding: 0.6rem;
  background: var(--voile);
  border-radius: 10px;
}
.gala-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
}
.gala-check input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--encre); }
@media (max-width: 480px) { .gala-eleves { grid-template-columns: 1fr; } }

/* ============================================================
   Accueil (élève et professeur)
   ============================================================ */
.accueil-hero {
  background: linear-gradient(135deg, #faf4e8 0%, #f3ede0 100%);
  border: 1px solid #e8dfc9;
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.accueil-hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #c69746, #8a6524);
}
.accueil-hero-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--or-2);
  margin-bottom: 0.4rem;
}
.accueil-hero-titre {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--encre);
}
.accueil-hero-detail {
  font-size: 0.88rem;
  color: var(--encre-2);
  margin-top: 0.35rem;
}
.accueil-hero.vide-hero {
  background: var(--voile);
  border-color: var(--ligne);
}
.accueil-hero.vide-hero::before { background: #d9d3c6; }
.accueil-rappel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fdf6e8;
  border: 1px solid #f0e2c4;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
@media (hover: hover) {
  .accueil-rappel:hover { background: #fbf1de; transform: translateY(-1px); }
}
.accueil-rappel-detail { font-size: 0.82rem; color: var(--encre-2); margin-top: 0.2rem; }

/* ============================================================
   Types d'annonce : pastilles et filtres
   ============================================================ */
.badge-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: var(--fond, var(--voile));
  color: var(--bord, var(--encre-2));
  border: 1px solid color-mix(in srgb, var(--bord, var(--or)) 25%, transparent);
}
.filtres-type {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filtre-type {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.34rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--ligne);
  background: var(--surface);
  color: var(--encre-2);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
@media (hover: hover) {
  .filtre-type:hover { background: var(--voile); }
}
.filtre-type.actif {
  background: var(--fond, var(--encre));
  color: var(--bord, #fff);
  border-color: var(--bord, var(--encre));
  font-weight: 600;
}
/* « Toutes » n'a pas de teinte : on garde l'encre */
.filtre-type[data-filtre="tous"].actif {
  background: var(--encre);
  color: #fff;
  border-color: var(--encre);
}

/* ============================================================
   Fluidité : rafraîchissement sans à-coups
   ============================================================ */
/* Pendant un changement de vue, l'écran précédent reste affiché. On ne
   l'atténue qu'au bout d'un quart de seconde, pour ne pas faire clignoter
   les chargements rapides (données locales, quasi instantanées). */
#vue { transition: opacity 0.15s ease; }
#vue.vue-charge {
  opacity: 0.55;
  transition: opacity 0.15s ease 0.25s;
  pointer-events: none;
}

/* ============================================================
   Sauvegardes de la base
   ============================================================ */
.bk-etat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.bk-cron { margin-top: 1rem; }
.bk-cron summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--encre-2);
  padding: 0.3rem 0;
}
.bk-cron summary::marker { color: var(--or-2); }
.bk-code {
  display: block;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  background: var(--voile);
  border: 1px solid var(--ligne);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin: 0.5rem 0 0.7rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--encre);
  user-select: all;
}

/* ============================================================
   Recherche dans les membres
   ============================================================ */
.barre-rech {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
}
.rech-loupe {
  position: absolute;
  left: 0.85rem;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--gris);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
/* Champ de recherche : élément éditable (et non un <input>) pour que Safari
   ne propose jamais l'AutoFill des mots de passe / Touch ID dessus. On
   reproduit donc à la main l'apparence d'un champ de saisie. */
.rech-champ {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 2.4rem 0.6rem 2.5rem;
  border: 1px solid var(--ligne);
  border-radius: 10px;
  background: var(--surface);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 1rem;
  line-height: 1.3;
  box-sizing: border-box;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
  outline: none;
  cursor: text;
  /* Une seule ligne, qui défile si la recherche est longue. */
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.rech-champ::-webkit-scrollbar { display: none; }
.rech-champ:focus {
  border-color: var(--encre);
  box-shadow: 0 0 0 3px rgba(160, 118, 44, 0.16);
}
/* Texte d'invite : le champ éditable n'a pas de placeholder natif. */
.rech-champ.est-vide::before {
  content: attr(data-vide);
  color: var(--gris);
  pointer-events: none;
}
.rech-vider {
  position: absolute;
  right: 0.5rem;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--voile);
  color: var(--encre-2);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
@media (hover: hover) {
  .rech-vider:hover { background: #e6e0d3; }
}
.grp-membres[hidden] { display: none; }

/* Historique des recherches */
.rech-hist {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--ligne);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(26, 25, 23, 0.10);
}
.rech-hist[hidden] { display: none; }
.rech-hist-item {
  display: flex;
  align-items: center;
  border-radius: 8px;
}
@media (hover: hover) {
  .rech-hist-item:hover { background: var(--voile); }
}
.rech-hist-lib {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--encre);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rech-hist-lib svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--gris);
  stroke-width: 1.7;
  stroke-linecap: round;
}
.rech-hist-x {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-right: 0.3rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--gris);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
@media (hover: hover) {
  .rech-hist-x:hover { background: #e6e0d3; color: var(--encre); }
}

/* ============================================================
   Rappels automatiques
   ============================================================ */
.rap-actif { font-size: 0.95rem; }
.rap-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding-left: 1.6rem;
  border-left: 2px solid var(--ligne);
  transition: opacity 0.15s ease;
}
.rap-options.rap-off {
  opacity: 0.4;
  pointer-events: none;
}
.rap-options small { color: var(--gris); }
.rap-liste {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.rap-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.5rem 0.7rem;
  background: var(--voile);
  border-radius: 8px;
  font-size: 0.85rem;
}
.rap-qui { font-weight: 600; color: var(--encre); white-space: nowrap; }
.rap-pourquoi { color: var(--encre-2); text-align: right; font-size: 0.8rem; }

/* Pulsation du badge quand un message arrive : on attire l'œil une fois,
   sans clignotement permanent. */
@keyframes badge-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  70%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}
.badge-pop { animation: badge-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
