/* ============================================================
   Feuille de style
   Direction « sobre japonais » : papier washi, encre sumi, et une
   seule couleur d'accent, le vermillon (shu) des torii. Le vermillon
   ne sert qu'à ce qui compte : l'élément actif, le lien, le focus,
   la date d'un stage. Tout le reste reste calme.

   Titres : Shippori Mincho (mincho japonais, dessin proche du pinceau).
   Texte  : Zen Kaku Gothic New (linéale japonaise, lisible sur téléphone).

   Refonte d'octobre 2026 : le « zen » n'est pas le vide. On garde le calme
   d'ensemble, mais on ajoute de la matière (grain de papier, motif seigaiha,
   ombres douces), une hiérarchie plus marquée et du mouvement discret.
   Toutes les animations sont regroupées en fin de fichier, dans la section
   « Mouvement », et s'éteignent si le téléphone demande moins d'animations.
   ============================================================ */

/* Polices servies par l'application (licence SIL OFL, voir static/fonts) :
   pas de dépendance à Google Fonts, et aucune adresse IP de membre envoyée à un tiers.
   latin : français, anglais ; latin-ext : tchèque, roumain... (chargé seulement si besoin). */
@font-face { font-family: 'Shippori Mincho'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/shippori-mincho-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Shippori Mincho'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/shippori-mincho-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Shippori Mincho'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/shippori-mincho-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Shippori Mincho'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/shippori-mincho-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Zen Kaku Gothic New'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/zen-kaku-gothic-new-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Zen Kaku Gothic New'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/zen-kaku-gothic-new-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Zen Kaku Gothic New'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/zen-kaku-gothic-new-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Zen Kaku Gothic New'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/zen-kaku-gothic-new-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Zen Kaku Gothic New'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/zen-kaku-gothic-new-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Zen Kaku Gothic New'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/zen-kaku-gothic-new-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Couleur principale du projet : boutons, liens, élément actif */
  /* Shu : le vermillon des torii. Seul accent de l'application. */
  --accent:      #B33A2C;
  --accent-deep: #8E2C21;
  --accent-soft: #F4E3DE;

  /* Papier et encre : les « gris » sont légèrement chauds, comme un washi */
  --paper:    #F2EDE3;   /* fond des pages, un papier un peu plus crème */
  --surface:  #FFFDF8;   /* cartes et barres */
  --gray-50:  #F6F5F1;
  --gray-100: #EEEDE8;
  --gray-200: #DCD8CE;   /* traits fins */
  --gray-300: #C7C2B6;
  --gray-400: #9A958A;
  --gray-500: #5F5B54;   /* texte secondaire (assombri le 07/11 : plus lisible) */
  --gray-600: #57534C;
  --gray-700: #3D3A35;
  --gray-800: #2B2926;
  --gray-900: #1E1D1B;   /* sumi : l'encre */

  --green-50:  #EAF1E8;
  --green-600: #2F5437;   /* foncé le 10/11/2026 : le vert sauge (#3E6B47) se confondait avec le gris */
  --amber-50:  #FFFBEB;
  --amber-600: #D97706;
  --red-50:  #F7E6E3;
  --red-200: #E7B9B1;
  --red-500: #B33A2C;
  --red-600: #8E2C21;

  --font-sans:  'Zen Kaku Gothic New', system-ui, sans-serif;
  --font-serif: 'Shippori Mincho', 'Hiragino Mincho ProN', Georgia, serif;

  /* Angles adoucis, et une profondeur légère : les cartes sont posées
     sur le papier, elles ne sont plus dessinées dessus */
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(60,40,10,.05), 0 2px 8px rgba(60,40,10,.04);
  --shadow-md: 0 6px 20px rgba(60,40,10,.09);
  --shadow-lg: 0 12px 32px rgba(60,40,10,.14);

  /* Couleurs des niveaux de l'arbre (pavés de date de l'agenda).
     Des couleurs japonaises traditionnelles, assez sombres pour porter
     un texte blanc : le vermillon reste celui du club, ce qui nous
     concerne au plus près. */
  --lv-club:     var(--accent);  /* shu, vermillon */
  --lv-region:   #4F6129;        /* matcha */
  --lv-inter:    #8A6420;        /* kincha, or bruni */
  --lv-national: #2D4A6E;        /* ai, indigo */

  /* Mouvement : une seule courbe pour tout, qui part vite et se pose
     doucement. Des durées courtes : on accompagne le geste, on ne le
     fait pas attendre. */
  --ease-out:  cubic-bezier(.2,.7,.2,1);
  --ease-back: cubic-bezier(.2,1.5,.4,1);   /* petit rebond, pour les coches */

  --sidebar-width: 64px;
  --bottom-bar-height: 64px;
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px; line-height: 1.55;
  background-color: var(--paper);
  /* Grain de papier : un point tous les 5 px, presque invisible, qui
     suffit à ôter l'effet « écran blanc » */
  background-image: radial-gradient(rgba(120,100,70,.07) 1px, transparent 1px);
  background-size: 5px 5px;
  color: var(--gray-900);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-weight: 600; }

/* ── Icônes SVG (fichiers de app/static/icons/ui) ─────────────────────────── */
.icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }

/* ── Structure générale ───────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-900);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0;
  z-index: 100;
}
.sidebar-brand {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--gray-900); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  margin-bottom: 14px;
}
.sidebar-divider { width: 32px; height: 1px; background: rgba(255,255,255,.08); margin-bottom: 14px; }
.sidebar-spacer { flex: 1; }
.sidebar-bottom {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); width: 48px;
}
.sidebar-item {
  position: relative;
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  background: none; border: none; cursor: pointer;
  text-decoration: none;
  transition: background var(--t, .15s);
}
.sidebar-item .icon { filter: invert(1); opacity: .5; transition: opacity .15s; }
.sidebar-item:hover { background: rgba(255,255,255,.06); }
.sidebar-item:hover .icon { opacity: .85; }
.sidebar-item.active { background: rgba(255,255,255,.08); box-shadow: inset 3px 0 0 var(--accent); }
.brand-mark { width: 30px; height: 30px; display: block; }
.sidebar-item.active .icon { opacity: 1; }
.sidebar-tooltip {
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  background: var(--gray-800); color: white;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 5px 10px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
  box-shadow: var(--shadow-md); z-index: 200;
}
.sidebar-item:hover .sidebar-tooltip { opacity: 1; }

.main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-family: var(--font-serif); font-size: 21px; font-weight: 600; letter-spacing: .01em; }
.topbar-subtitle { font-size: 14px; color: var(--gray-500); }
/* La partie gauche (titre, sous-titre, choix du club) prend la place
   restante sans jamais la dépasser : min-width: 0 l'autorise à être plus
   étroite que son contenu, et ce qui est trop large (les pastilles des
   clubs) défile à l'intérieur. Sans cela, elle poussait la cloche hors de
   l'écran. La cloche, elle, ne rétrécit jamais. */
.topbar-main { flex: 1 1 auto; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }

.notif-bell {
  position: relative;
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.notif-bell:hover { background: var(--gray-50); }
.notif-bell .icon { opacity: .6; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 1.5px solid var(--surface);
}

.content { flex: 1; padding: 24px; }
.container { max-width: 640px; margin: 0 auto; }
.container-wide { max-width: 960px; margin: 0 auto; }

/* ── Barre du bas (mobile) ────────────────────────────────────────────────── */
.bottom-bar { display: none; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom)); }
  .content { padding: 18px 14px 24px; }
  .topbar { padding: 12px 16px; }
  .bottom-bar {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; inset: auto 0 0 0;
    height: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--gray-200);
    z-index: 100;
  }
}
.bottom-bar-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 14px;
  color: var(--gray-500); text-decoration: none;
  font-size: 12px; font-weight: 500;
}
.bottom-bar-item .icon { width: 22px; height: 22px; opacity: .45; }
/* Raccourcis choisis : un emoji à la place de l'icône dessinée */
.nav-emoji { display: inline-flex; align-items: center; justify-content: center; font-size: 19px; line-height: 1; filter: grayscale(1); }
/* ── Icônes au trait (filtre « glyph », app/templating.py) ──────────────────
   Le fichier SVG sert de pochoir rempli de la couleur du texte : l'icône suit
   le thème, l'état actif, le survol, sans une version par couleur. */
.glyph { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none;
         background-color: currentColor;
         -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
.glyph-calendar { --glyph: url("/static/icons/ui/calendar.svg"); }
.glyph-calendar-plus { --glyph: url("/static/icons/ui/calendar-plus.svg"); }
.glyph-book-open { --glyph: url("/static/icons/ui/book-open.svg"); }
.glyph-search { --glyph: url("/static/icons/ui/search.svg"); }
.glyph-banknote { --glyph: url("/static/icons/ui/banknote.svg"); }
.glyph-receipt { --glyph: url("/static/icons/ui/receipt.svg"); }
.glyph-megaphone { --glyph: url("/static/icons/ui/megaphone.svg"); }
.glyph-landmark { --glyph: url("/static/icons/ui/landmark.svg"); }
.glyph-settings { --glyph: url("/static/icons/ui/settings.svg"); }
.glyph-id-card { --glyph: url("/static/icons/ui/id-card.svg"); }
.glyph-clipboard-list { --glyph: url("/static/icons/ui/clipboard-list.svg"); }
.glyph-map-pin { --glyph: url("/static/icons/ui/map-pin.svg"); }
.glyph-users { --glyph: url("/static/icons/ui/users.svg"); }
.glyph-scroll-text { --glyph: url("/static/icons/ui/scroll-text.svg"); }
.glyph-key-round { --glyph: url("/static/icons/ui/key-round.svg"); }
.glyph-bell { --glyph: url("/static/icons/ui/bell.svg"); }
.glyph-clock { --glyph: url("/static/icons/ui/clock.svg"); }
.glyph-globe { --glyph: url("/static/icons/ui/globe.svg"); }
.glyph-home { --glyph: url("/static/icons/ui/home.svg"); }
.glyph-user { --glyph: url("/static/icons/ui/user.svg"); }
.glyph-graduation-cap { --glyph: url("/static/icons/ui/graduation-cap.svg"); }
.glyph-phone { --glyph: url("/static/icons/ui/phone.svg"); }
.glyph-puzzle { --glyph: url("/static/icons/ui/puzzle.svg"); }
.glyph-smartphone { --glyph: url("/static/icons/ui/smartphone.svg"); }
.glyph-check { --glyph: url("/static/icons/ui/check.svg"); }
.module-icon .glyph { width: 22px; height: 22px; color: var(--gray-700); }
.nav-emoji .glyph { width: 22px; height: 22px; }
.notif-prompt-icon .glyph, .empty-state-icon .glyph { width: 30px; height: 30px; }

.active > .nav-emoji { filter: none; }
/* Les libellés de raccourcis peuvent être longs (« Cotisations du club ») */
.bottom-bar-item { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; }
.bottom-bar-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-bar-item.active { color: var(--gray-900); font-weight: 700; }
.bottom-bar-item.active .icon { opacity: 1; }
.bottom-bar-item.active::before {
  content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 0; background: var(--accent);
}

/* ── Boutons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius); border: none;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-dark    { background: var(--gray-900); color: white; }
.btn-dark:hover { background: var(--gray-700); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-outline { background: var(--surface); color: var(--gray-800); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-danger  { background: var(--red-500); color: white; }
.btn-danger:hover { background: var(--red-600); }
.btn-ghost-danger { background: transparent; color: var(--red-500); border: 1px solid var(--red-200); }
.btn-ghost-danger:hover { background: var(--red-50); }
.btn-link { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.btn-sm   { padding: 7px 13px; font-size: 14px; }
.btn-lg   { padding: 12px 22px; font-size: 14px; }
.btn-full { width: 100%; }

/* ── Cartes ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid rgba(220,216,206,.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.3; }
.card-subtitle { font-size: 14px; color: var(--gray-500); margin-top: 2px; }
@media (max-width: 768px) { .card-body { padding: 16px; } .card-header { padding: 12px 16px; } }
.stack > * + * { margin-top: 16px; }

/* ── Formulaires ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-hint  { font-size: 14px; color: var(--gray-500); margin-top: 6px; line-height: 1.45; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  background: var(--surface); color: var(--gray-900);
  font-family: var(--font-sans);
  font-size: 16px;  /* 16px minimum : sinon iOS zoome sur le champ */
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-textarea { resize: vertical; min-height: 96px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gray-900); box-shadow: 0 0 0 3px rgba(179,58,44,.14);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--gray-400); }
/* Lecture seule (l'adresse d'une fiche reliée à un compte) : on voit qu'on ne peut pas taper */
.form-input[readonly] { background: var(--gray-50); color: var(--gray-500); cursor: default; }
.form-input-code { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 600; }

/* Champ de mot de passe avec le bouton œil (fragment _password_toggle.html) :
   le bouton se pose à droite, dans le champ, avec une zone de toucher de 44 px. */
.password-field { position: relative; }
.password-field .form-input { padding-right: 52px; }
.password-toggle {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 44px; height: 44px; border: none; border-radius: 10px; background: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.password-toggle[hidden] { display: none; }
.password-toggle:hover { color: var(--gray-800); }
.password-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* L'icône sert de pochoir rempli de la couleur du bouton : œil, puis œil barré quand c'est visible */
.password-toggle-glyph {
  width: 22px; height: 22px; background-color: currentColor;
  -webkit-mask: url("/static/icons/ui/eye.svg") center / contain no-repeat;
  mask: url("/static/icons/ui/eye.svg") center / contain no-repeat;
}
.password-toggle[aria-pressed="true"] .password-toggle-glyph {
  -webkit-mask-image: url("/static/icons/ui/eye-off.svg");
  mask-image: url("/static/icons/ui/eye-off.svg");
}
.form-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--gray-700); line-height: 1.5; cursor: pointer; }
.form-check input { margin-top: 4px; accent-color: var(--accent); }
/* Import du tableur des licenciés : une ligne par licencié, couleur selon le résultat */
.registry-import-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: inherit; text-decoration: none; }
.import-line { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--gray-100); }
.import-line:last-child { border-bottom: 0; }
.import-line-num { flex: none; min-width: 28px; font-size: 12px; color: var(--gray-500); padding-top: 2px; }
.import-created { background: var(--green-50); }
.import-error { background: var(--red-50); }

/* Un groupe de champs titré (passeport et brevet d'une discipline, sur la fiche) */
.form-fieldset { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0 0 16px; }
.form-fieldset > legend { padding: 0 6px; margin-bottom: 0; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-row > .form-input { flex: 1; min-width: 180px; }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; line-height: 1.5; }
.alert-error   { background: var(--red-50);   color: var(--accent-deep); border: 1px solid var(--red-200); }
.alert-success { background: var(--green-50); color: #2F5236; border: 1px solid #C9DAC6; }
.alert-info    { background: var(--gray-50);  color: var(--gray-700); border: 1px solid var(--gray-200); }
.alert-warning { background: var(--amber-50); color: #92400E; border: 1px solid #FDE68A; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 500; padding: 3px 9px; border-radius: 6px;
  white-space: nowrap;
}
.badge-accent  { background: var(--accent-soft); color: var(--accent-deep); }
.badge-neutral { background: var(--gray-50); color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge-success { background: var(--green-50);    color: var(--green-600); }
.badge-danger  { background: var(--red-50);      color: var(--red-600); }
.badge-warning { background: var(--amber-50);    color: #92400E; }

/* ── Listes de lignes (membres, notifications, utilisateurs...) ───────────── */
.row-list > .row { border-bottom: 1px solid var(--gray-200); }
.row-list > .row:last-child { border-bottom: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 500; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; }
.row-meta  { font-size: 14px; color: var(--gray-500); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Logo d'une structure : carré arrondi (les personnes sont rondes) */
.avatar.entity-logo { border-radius: 22%; font-size: 14px; font-weight: 600; letter-spacing: .02em; }
/* Fiche publique : coordonnées, une par ligne, l'adresse garde ses retours à la ligne */
.contact-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; margin: 0; }
.contact-list dt { font-size: 18px; line-height: 1.4; color: var(--gray-600); }
.contact-list dd { margin: 0; overflow-wrap: anywhere; }
.contact-list .address { white-space: pre-line; }
.welcome-avatar { display: flex; justify-content: center; margin-bottom: 16px; }
/* Champ fichier invisible mais accessible au clavier : c'est son <label>,
   stylé en bouton, que l'on voit. */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-input:focus-visible + .btn { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Titres de section ────────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 600; color: var(--gray-900);
  margin-bottom: 12px;
}
/* Un court trait de pinceau vermillon sous chaque titre de section.
   Il se trace à l'arrivée sur la page (voir « Mouvement »). */
.section-title::after {
  content: ""; display: block; width: 32px; height: 3px; margin-top: 6px;
  border-radius: 2px; background: var(--accent); transform-origin: left;
}

/* ── Onglets ──────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 22px; margin-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
/* Onglets qui débordent (calendrier sur téléphone) : un fondu à droite montre
   qu'ils défilent ; la marge laisse le dernier onglet lisible une fois au bout. */
.tabs-fade {
  padding-right: 40px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}
.tab {
  flex: 0 0 auto; white-space: nowrap;
  padding: 10px 0 9px; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; color: var(--gray-500);
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer;
}
.tab:hover { color: var(--gray-900); }
.tab.active { color: var(--gray-900); font-weight: 700; border-bottom-color: var(--accent); }

/* ── Choix du club (_club_switcher.html) : des pastilles, pas des onglets ─── */
.club-switcher {
  display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.club-switcher::-webkit-scrollbar { display: none; }
/* Trop de clubs pour la largeur : un fondu du côté où il en reste à voir
   (classes posées par app.js), pour qu'on comprenne que la rangée défile. */
.club-switcher.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.club-switcher.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.club-switcher.more-left.more-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.club-pill {
  flex: 0 0 auto; white-space: nowrap; min-height: 40px; box-sizing: border-box;
  /* Un nom très long (« Aïkibudo - Katori Shinto Ryu Luxembourg ») ne doit pas
     pousser les autres clubs hors de l'écran : coupé avec « … », nom complet
     dans l'attribut title et lu par les lecteurs d'écran. */
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  /* inline-block et non inline-flex : les « … » ne marchent pas dans un flex */
  display: inline-block; line-height: 38px; padding: 0 14px; border-radius: 20px;
  border: 1px solid var(--gray-300); background: var(--surface); color: var(--gray-700);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.club-pill:hover { border-color: var(--gray-900); color: var(--gray-900); }
.club-pill.active { background: var(--gray-900); border-color: var(--gray-900); color: var(--surface); font-weight: 700; }

/* ── Interrupteur (préférences) ───────────────────────────────────────────── */
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--gray-300); border-radius: 26px; transition: background .2s;
}
.switch-slider::before {
  content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-slider { background: var(--gray-900); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:disabled + .switch-slider { opacity: .5; cursor: not-allowed; }

/* ── État vide ────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 24px; color: var(--gray-500); }
.empty-state-icon  { font-size: 34px; margin-bottom: 10px; filter: grayscale(.4); }
.empty-state-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--gray-800); margin-bottom: 6px; }
.empty-state-text  { font-size: 14px; max-width: 34em; margin: 0 auto; }

/* ── Pages de connexion / inscription ─────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-box  { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo {
  width: 72px; height: 72px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo .brand-mark { width: 72px; height: 72px; }
/* Le petit ensō des pages sans compte : le même geste que l'écran de connexion,
   en plus court (keyframes login-draw et login-stamp, section « Connexion »). */
.auth-logo:has(.auth-enso) { width: 88px; height: 88px; }
.auth-enso { position: relative; width: 88px; height: 88px; }
.auth-enso svg { width: 100%; height: 100%; display: block; overflow: visible; }
.auth-enso-main, .auth-enso-dry { fill: none; stroke: var(--gray-900); stroke-linecap: round;
                                  stroke-dasharray: 440; stroke-dashoffset: 440; }
.auth-enso-main { stroke-width: 11; animation: login-draw .9s cubic-bezier(.65,.05,.3,1) .1s forwards; }
.auth-enso-dry  { stroke-width: 3; opacity: .35; animation: login-draw 1s cubic-bezier(.65,.05,.3,1) .16s forwards; }
.auth-seal { position: absolute; right: 0; bottom: 2px; width: 18px; height: auto;
             background: var(--surface); border-radius: 2px;
             opacity: 0; animation: login-stamp .36s var(--ease-back) .9s forwards; }
@media (prefers-reduced-motion: reduce) {
  .auth-enso-main, .auth-enso-dry { animation: none; stroke-dashoffset: 0; }
  .auth-seal { animation: none; opacity: 1; }
}
.auth-title    { font-family: var(--font-serif); font-size: 28px; font-weight: 600; }
.auth-subtitle { font-size: 14px; color: var(--gray-500); margin-top: 6px; line-height: 1.5; }
.auth-footer   { text-align: center; margin-top: 18px; font-size: 14px; color: var(--gray-500); }
.auth-footer a { font-weight: 600; text-decoration: none; }

/* Arbre des entités : chaque niveau décalé, un trait relie les enfants au parent */
.entity-tree { list-style: none; margin: 0; padding: 0; }
.entity-tree .entity-tree { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--gray-200); }
.entity-node { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; color: inherit; text-decoration: none; }
.entity-node:hover .entity-name { text-decoration: underline; }
.entity-node.is-pending { opacity: .65; }
.entity-name { font-weight: 600; }

/* Registre : tableau qui défile horizontalement sur petit écran */
.table-scroll { overflow-x: auto; }
.registry-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.registry-table th, .registry-table td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--gray-200); white-space: nowrap; vertical-align: top; }
.registry-table th { font-size: 14px; font-weight: 500; color: var(--gray-500); border-top: none; }
@media (max-width: 768px) {
  .registry-table { font-size: 14px; }
  .registry-table th, .registry-table td { padding: 9px 8px; }
  .registry-table th:first-child, .registry-table td:first-child { padding-left: 14px; }
}
/* Noms à l'encre : le vermillon partout alourdirait le tableau */
.registry-table td a { font-weight: 700; text-decoration: none; color: var(--gray-900); }
.registry-table td a:hover { color: var(--accent); text-decoration: underline; }

/* Fiche en lecture : intitulé à gauche, valeur à droite (une ligne chacun sur téléphone) */
.fact-list { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 10px 18px; margin: 0; }
.fact-list dt { font-size: 14px; color: var(--gray-500); padding-top: 1px; }
.fact-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .fact-list { grid-template-columns: 1fr; gap: 2px; }
  .fact-list dd { margin-bottom: 10px; }
}
/* Modification des grades : un passage par bloc, séparés par un trait */
.grade-edit { padding: 14px 0; border-bottom: 1px solid var(--gray-200); }
.grade-edit:last-child { border-bottom: none; }
.grade-edit .form-group { margin-bottom: 10px; }
.mb-8 { margin-bottom: 8px; }

/* Fiche membre : un bloc par club, séparés par un trait */
.link-form + .link-form { border-top: 1px solid var(--gray-100); padding-top: 16px; }

/* <summary> sans triangle : en bouton (« + Ajouter un grade ») ou en lien discret (« Modifier ») */
summary.btn, summary.summary-link { list-style: none; cursor: pointer; }
summary.btn::-webkit-details-marker, summary.summary-link::-webkit-details-marker { display: none; }
summary.btn { display: inline-flex; }
.summary-link { font-size: 13px; color: var(--gray-500); text-decoration: underline; }
details[open] > summary.summary-link { color: var(--gray-900); }

/* Sélecteur de langue : la langue active est grisée, les autres sont des liens */
.lang-switcher { display: inline-flex; gap: 12px; font-size: 14px; }
.lang-switcher .btn-link { color: var(--gray-500); font-weight: 500; }
.lang-switcher .btn-link.active { color: var(--gray-900); font-weight: 700; cursor: default; }

.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-option { position: relative; }
.icon-option input { position: absolute; opacity: 0; }
.icon-option span {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 20px; border-radius: 8px; border: 2px solid var(--gray-200); cursor: pointer;
}
.icon-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.icon-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Accueil : grille de modules ──────────────────────────────────────────── */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.module-card {
  display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: start;
  padding: 16px;
  background: var(--surface); border: 1px solid rgba(220,216,206,.7); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), border-color .2s;
}
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.module-icon {
  grid-row: span 2;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: var(--paper); border: 1px solid var(--gray-200);
}
.module-name { font-family: var(--font-serif); font-size: 17px; font-weight: 600; line-height: 1.3; }
.module-desc { font-size: 14px; color: var(--gray-500); line-height: 1.45; margin-top: 2px; }
@media (max-width: 768px) { .modules-grid { grid-template-columns: 1fr; gap: 8px; } }

/* Tuile « Vie du club » : une carte de module, plus une pastille à droite */
.club-life-card { grid-template-columns: 40px 1fr auto; align-items: center; margin-bottom: 20px; }
.club-life-card .module-name, .club-life-card .module-desc { grid-column: 2; }
.club-life-alert { color: var(--accent); font-weight: 700; }   /* ce qui attend la personne */
.count-badge {
  grid-column: 3; grid-row: 1 / span 3;
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
}

/* ── Cotisations : case « certificat remis » ──────────────────────────────── */
.certificate-toggle { margin: 0; }
.certificate-check { display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.certificate-check input { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; }

/* ── Cotisations : le dossier de la saison, en blocs ────────────────────────── */
.dossier-status { padding: 12px 16px; border-radius: var(--radius-lg); }
.dossier-complete { background: var(--green-50); color: var(--green-600); font-weight: 600; font-size: 15px; }
.dossier-incomplete { background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--accent-deep); }
.dossier-status-title { font-family: var(--font-serif); font-size: 19px; font-weight: 600; }
.dossier-missing { margin: 6px 0 0; padding-left: 20px; font-size: 15px; }
.dossier-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; }
.balance-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.balance-figure-label { font-size: 14px; color: var(--gray-500); }
.balance-figure { font-size: 17px; font-weight: 600; margin-top: 2px; }
.balance-figure-due { color: var(--accent-deep); }
.balance-bar { height: 6px; border-radius: 3px; background: var(--gray-200); overflow: hidden; }
.balance-bar span { display: block; height: 100%; border-radius: 3px; }
.balance-bar .balance-due     { background: var(--accent); }
.balance-bar .balance-settled { background: var(--green-600); }
.certificate-state { padding: 10px 14px; border-radius: var(--radius-lg); font-size: 15px; }
.certificate-given { background: var(--gray-50); color: var(--gray-700); }
.certificate-missing { background: var(--accent-soft); border: 1.5px dashed var(--accent); color: var(--accent-deep); }
.overview-card { padding: 16px 18px; border-width: 1.5px; }
.overview-complete { background: var(--green-50); border-color: var(--green-600); color: var(--green-600); }
.overview-todo { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
.overview-title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.3; }
.overview-text { font-size: 14px; margin-top: 4px; }
.overview-list { margin: 8px 0 0; padding-left: 20px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.overview-list a { color: inherit; }
.balance-detail summary { cursor: pointer; font-size: 14px; color: var(--gray-600); padding: 8px 0; }

/* ── Ma fiche : carte du pratiquant et frise des grades ─────────────────────── */
.member-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.member-card-head { display: flex; align-items: center; gap: 16px; }
.member-card-photo {
  flex: none; width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-deep);
  font-family: var(--font-serif); font-size: 26px; font-weight: 600;
}
.member-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-card-name { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.member-card-club { font-size: 14px; color: var(--gray-600); margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.member-card-grades { display: flex; flex-wrap: wrap; gap: 8px; }
.member-grade-chip { display: flex; flex-direction: column; padding: 8px 14px; border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--gray-200); }
.member-grade-discipline { font-size: 13px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; }
.member-grade-value { font-size: 17px; font-weight: 600; }
.grade-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.grade-timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--gray-200); }
.grade-timeline li { position: relative; padding: 0 0 14px 12px; }
.grade-timeline li:last-child { padding-bottom: 0; }
.grade-timeline li::before {
  content: ""; position: absolute; left: -26px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--gray-400, #A8A29A);
}
.grade-timeline li.grade-current::before { background: var(--accent); border-color: var(--accent); }
.grade-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grade-current .grade-name { color: var(--accent-deep); }
.grade-meta { font-size: 14px; color: var(--gray-500); margin-top: 2px; }

/* ── Registre des membres : synthèse, liste adaptative, panneau ──────────── */
.registry-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-tile {
  display: block; padding: 14px 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--gray-200); color: inherit; text-decoration: none;
}
.stat-link:hover { border-color: var(--gray-900); }
.stat-label { font-size: 14px; color: inherit; opacity: .75; }
.stat-value { font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.stat-of { font-size: 17px; opacity: .6; }
.stat-hint { font-size: 13px; opacity: .7; margin-top: 2px; }

/* Sous la liste : outils, comité et profs ; le formulaire d'ajout en pleine largeur */
.registry-tools { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .registry-tools { grid-template-columns: 1fr 2fr; } }
.registry-tools-wide { grid-column: 1 / -1; }
.registry-header-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
@media (min-width: 600px) { .registry-header-tools { flex-wrap: nowrap; } .registry-header-tools .btn { white-space: nowrap; } }
.registry-search { max-width: 260px; }
.registry-tabs { margin: 0; padding: 0 16px; }
.registry-actions { display: flex; flex-direction: column; gap: 8px; }
.staff-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.staff-item { font-size: 14px; color: inherit; text-decoration: none; display: flex; gap: 8px; }
.staff-item:hover { color: var(--accent); }
.registry-no-match { padding: 16px 20px; }

/* Une ligne par membre. Sur PC : des colonnes alignées sous un en-tête.
   Sur téléphone : une carte, la personne en haut, puis grades et fonctions. */
.member-list { display: flex; flex-direction: column; }
.member-row {
  display: grid; gap: 6px 12px; padding: 12px 20px; align-items: center;
  grid-template-columns: 1fr;
  grid-template-areas: "person" "grades" "roles";
  border-top: 1px solid var(--gray-200); color: inherit; text-decoration: none;
  position: relative;
}
.member-row[hidden] { display: none; }
.member-row:not(.member-row-head):hover { background: var(--gray-50); }
/* Le lien du nom couvre toute la ligne ; la colonne « Dossier » passe au-dessus
   pour que la case du certificat reste cliquable. */
.member-link { color: inherit; text-decoration: none; }
.member-link::after { content: ""; position: absolute; inset: 0; }
.member-cell-certificate { grid-area: certificate; position: relative; z-index: 1; align-items: center; gap: 8px; }
.member-cell-status { grid-area: status; align-items: center; justify-content: flex-end; }
.member-mobile-label { font-size: 14px; color: var(--gray-500); }
.with-status .member-row {
  grid-template-columns: auto 1fr;
  grid-template-areas: "person person" "grades grades" "roles roles" "certificate status";
}
.stat-alert { border-color: var(--red-600); }
.stat-alert .stat-value { color: var(--red-600); }
.member-row-head { display: none; }
.member-cell-person { grid-area: person; display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-cell-grades { grid-area: grades; }
.member-cell-roles { grid-area: roles; }
.member-cell { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.member-cell:empty { display: none; }
.member-licenses span::before { content: " · "; }
.member-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; font-size: 14px;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-name { display: block; font-weight: 600; }
.member-sub { display: block; font-size: 14px; color: var(--gray-500); }
@media (min-width: 900px) {
  .member-row {
    grid-template-columns: minmax(220px, 1.4fr) 1.2fr 1fr;
    grid-template-areas: "person grades roles";
    padding: 10px 20px;
  }
  .member-row-head {
    display: grid; font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--gray-500); border-top: none; padding-top: 12px; padding-bottom: 8px;
  }
  .member-row-head span:nth-child(1) { grid-area: person; }
  .member-row-head span:nth-child(2) { grid-area: grades; }
  .member-row-head span:nth-child(3) { grid-area: roles; }
  .member-row-head span:nth-child(4) { grid-area: certificate; }
  .member-row-head span:nth-child(5) { grid-area: status; }
  .with-status .member-row {
    grid-template-columns: minmax(200px, 1.5fr) 1.2fr 1.2fr .8fr 1.1fr;
    grid-template-areas: "person grades roles certificate status";
  }
  .member-cell-status { justify-content: flex-start; }
  .member-mobile-label { display: none; }
  .member-cell:empty { display: flex; }
}

/* ── Droits du bureau ─────────────────────────────────────────────────────── */
.rights-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .rights-grid { grid-template-columns: 1fr 1fr; } }
.right-list { display: flex; flex-direction: column; gap: 2px; }
.right-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; margin: 0; }
.right-row + .right-row { border-top: 1px solid var(--gray-100, #F1EFEA); }
.right-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.right-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.right-mark { width: 20px; flex: none; color: var(--green-600); font-weight: 700; text-align: center; }
.right-name { display: block; font-size: 15px; }
.right-desc { display: block; font-size: 13px; color: var(--gray-500); }
.right-row:not(.right-on) .right-name { color: var(--gray-500); }
.right-state { flex: none; font-size: 13px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.right-state-default { background: var(--gray-50); color: var(--gray-600); }
.right-state-added { background: var(--green-50); color: var(--green-600); }
.right-state-removed { background: var(--accent-soft); color: var(--accent-deep); }
.right-state-implied { background: var(--gray-50); color: var(--gray-500); font-style: italic; }
.request-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--gray-900); }

/* ── Pages publiques (mentions légales...) ────────────────────────────────── */
.prose { font-size: 15px; line-height: 1.7; color: var(--gray-700); }
.prose h1 { font-family: var(--font-serif); font-weight: 600; font-size: 30px; color: var(--gray-900); margin-bottom: 8px; }
.prose h2 { font-size: 18px; color: var(--gray-900); margin: 28px 0 8px; }
.prose p, .prose ul { margin-bottom: 12px; }
.prose ul { padding-left: 22px; }
.todo-marker { background: #FEF9C3; padding: 0 4px; border-radius: 4px; }

/* ── HTMX ─────────────────────────────────────────────────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-swapping { opacity: 0; transition: opacity .2s; }

/* ── Utilitaires ──────────────────────────────────────────────────────────── */
.text-muted { color: var(--gray-500); }
.text-small { font-size: 14px; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inline { display: inline; }
.hidden { display: none !important; }

/* ── Agenda : pavé de date à gauche d'un événement ────────────────────────── */
/* Le pavé prend la couleur du niveau qui organise : club, région,
   interrégion ou national (classes lv-<type> posées par events/_macros.html).
   Sans classe, il reste à l'encre. */
.date-block {
  --lv: var(--gray-900);
  width: 52px; flex-shrink: 0; align-self: flex-start; text-align: center;
  border-radius: 12px; background: var(--lv); color: #FFFDF8;
  padding: 8px 0 7px; line-height: 1.1;
}
.date-block-day { display: block; font-family: var(--font-serif); font-size: 23px; font-weight: 600; }
.date-block-month { display: block; font-size: 13px; font-weight: 500; opacity: .9; }
.lv-club { --lv: var(--lv-club); }
.lv-region, .lv-department { --lv: var(--lv-region); }
.lv-interregion { --lv: var(--lv-inter); }
.lv-country, .lv-federation { --lv: var(--lv-national); }
/* Le niveau en toutes lettres, dans la couleur du pavé */
.badge-level { background: color-mix(in srgb, var(--lv) 12%, var(--surface)); color: var(--lv); font-weight: 700; }
/* Stages auxquels la personne a répondu : liseré à gauche */
.row-mine { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; margin-left: -10px; border-radius: 4px; }

/* ── Bandeau « version de test » (TEST_MODE=true, voir _test_banner.html) ──
   Couleurs d'avertissement (ambre) plutôt que le vermillon : le vermillon
   est réservé à ce qui est actif ou cliquable. */
.test-banner {
  background: var(--amber-50);
  color: var(--gray-800);
  border-bottom: 1px solid var(--amber-600);
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
.test-banner a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }

/* ── Cotisations du club ──────────────────────────────────────────────────── */
/* Une ligne par membre. Sur téléphone : une carte (la personne, puis le
   paiement, le reste dû, le certificat et l'état du dossier, puis le bouton).
   Sur PC : des colonnes alignées sous un en-tête. */
.fee-list { display: flex; flex-direction: column; }
.fee-row {
  position: relative; display: grid; gap: 8px 12px; padding: 14px 20px; align-items: center;
  grid-template-columns: 1fr auto;
  grid-template-areas: "person person" "payment remaining" "certificate status" "action action";
  border-top: 1px solid var(--gray-200);
}
.fee-row[hidden] { display: none; }
.fee-row:not(.fee-row-head):hover { background: var(--gray-50); }
.fee-row-head { display: none; }
.fee-cell-person { grid-area: person; display: flex; align-items: center; gap: 12px; min-width: 0; }
.fee-cell-payment { grid-area: payment; display: flex; flex-direction: column; gap: 4px; }
.fee-cell-remaining { grid-area: remaining; text-align: right; }
.fee-cell-certificate { grid-area: certificate; display: flex; align-items: center; gap: 8px; }
.fee-cell-status { grid-area: status; display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: flex-end; }
.fee-mobile-label { font-size: 14px; color: var(--gray-500); }
.fee-cell-action { grid-area: action; }
.fee-cell-action .btn { width: 100%; justify-content: center; white-space: nowrap; }
/* La case, le bouton : au-dessus du lien étiré sur le nom */
.fee-cell-certificate, .fee-cell-action { position: relative; z-index: 1; }
.fee-cell-payment:empty, .fee-cell-remaining:empty, .fee-cell-action:empty { display: none; }
.fee-bar { width: 100%; max-width: 160px; }
.fee-due { color: var(--red-600); font-size: 17px; }
.stat-bar { margin: 6px 0 2px; }
@media (min-width: 900px) {
  .fee-row {
    grid-template-columns: minmax(190px, 1.5fr) 1.2fr .8fr .9fr 1.2fr 160px;
    grid-template-areas: "person payment remaining certificate status action";
    padding: 10px 20px;
  }
  .fee-row-head {
    display: grid; font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--gray-500); padding-top: 12px; padding-bottom: 8px; border-top: none;
  }
  .fee-cell-remaining { text-align: left; }
  .fee-cell-status { justify-content: flex-start; }
  .fee-mobile-label { display: none; }
  .fee-cell-payment:empty, .fee-cell-remaining:empty, .fee-cell-action:empty { display: flex; }
  .fee-due { font-size: 15px; }
}

/* Sous la liste : outils, encaissé par moyen de paiement, relance */
.fee-tools { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .fee-tools { grid-template-columns: repeat(3, 1fr); } }

/* La fenêtre « + Paiement » */
.quick-pay {
  width: min(480px, calc(100vw - 32px)); margin: auto; padding: 20px; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); background: var(--surface); color: inherit;
}
.quick-pay::backdrop { background: rgba(0, 0, 0, .35); }

/* Relances : choix des canaux, et suivi (qui a reçu quoi) */
.remind-channels { border: none; padding: 0; margin-left: 0; margin-right: 0; display: flex; flex-direction: column; gap: 6px; }
.remind-channel { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.remind-channel input { width: 20px; height: 20px; accent-color: var(--accent); }
/* Le nom, puis les pastilles dessous, puis l'explication s'il y en a une :
   les pastilles peuvent être nombreuses, le nom garde toute la largeur. */
.reminder-row { flex-direction: column; align-items: stretch; gap: 6px; }
.reminder-channels { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.reminder-issue { margin: 0; }

/* ── Pages publiques : en-tête (vitrine, nouveautés, mentions légales) ────── */
.public-page { background: var(--surface); }
.public-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
/* Le sceau est vertical (1 × 1,9) : on le règle en hauteur */
.public-brand-seal { height: 30px; width: auto; display: block; }
.public-brand-name { font-family: var(--font-serif); font-size: 19px; font-weight: 600; white-space: nowrap; }
.public-topbar-actions { display: contents; }
.public-topbar-actions .btn { white-space: nowrap; }
/* Téléphone : la barre ne tient pas nom + langues + bouton. Le bouton est
   de toute façon repris juste dessous (accroche de la vitrine). */
@media (max-width: 480px) { .public-topbar-actions { display: none; } }

/* ── Vitrine (route « / ») ────────────────────────────────────────────────── */
.landing { background: var(--paper); padding: 0 24px 48px; }
.landing > * { max-width: 960px; margin-left: auto; margin-right: auto; }

.landing-hero { text-align: center; padding: 48px 0 40px; border-bottom: 1px solid var(--gray-200); }
.landing-seal { height: 112px; width: auto; display: block; margin: 0 auto 14px; }
.landing-name { font-family: var(--font-serif); font-size: 15px; font-weight: 600; letter-spacing: .14em; color: var(--accent); margin-bottom: 14px; }
.landing-hero h1 { font-family: var(--font-serif); font-size: 36px; line-height: 1.2; max-width: 640px; margin: 0 auto; }
.landing-lead { color: var(--gray-500); font-size: 16px; max-width: 540px; margin: 14px auto 28px; }
.landing-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.landing-note { font-size: 14px; color: var(--gray-500); margin-top: 14px; }

.landing-section { padding-top: 48px; }
.landing-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.landing-section h2 { font-family: var(--font-serif); font-size: 26px; line-height: 1.25; }
.landing-section-lead { color: var(--gray-500); margin-top: 6px; max-width: 580px; }

.landing-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.landing-feature {
  background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.landing-feature h3 { font-family: var(--font-serif); font-size: 20px; line-height: 1.3; }
.landing-feature p { color: var(--gray-600); flex-grow: 1; }

.landing-install { margin-top: 24px; }
.landing-install-tabs { display: flex; border-bottom: 1px solid var(--gray-200); }
.landing-install-tabs[hidden] { display: none; }
.landing-install-tab {
  flex: 1; min-height: 48px; background: none; border: none; border-bottom: 3px solid transparent;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: var(--gray-500); cursor: pointer;
}
.landing-install-tab[aria-selected="true"] { color: var(--gray-900); font-weight: 700; border-bottom-color: var(--accent); }
.landing-install-panel { padding: 24px; }
.landing-install-panel[hidden] { display: none; }
/* Sans JavaScript, les deux modes d'emploi se suivent, chacun avec son titre */
.landing-install-panel + .landing-install-panel { border-top: 1px solid var(--gray-200); }
.landing-install-heading { font-family: var(--font-serif); font-size: 18px; margin-bottom: 8px; }
.is-tabbed .landing-install-heading { display: none; }
.is-tabbed .landing-install-panel + .landing-install-panel { border-top: none; }
.landing-steps { list-style: none; counter-reset: step; margin-bottom: 14px; }
.landing-steps li { counter-increment: step; display: flex; gap: 14px; padding: 8px 0; }
.landing-steps li::before {
  content: counter(step); flex: 0 0 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--gray-300); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 600; color: var(--accent);
}
.landing-callout { padding: 12px 14px; background: var(--accent-soft); color: var(--accent-deep); border-radius: var(--radius); font-size: 14px; }

.landing-footer {
  margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--gray-500);
}
.landing-footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.landing-footer-links a { color: var(--gray-600); }

@media (max-width: 768px) {
  .landing { padding: 0 16px 40px; }
  .landing-hero { padding: 32px 0 28px; }
  .landing-seal { height: 88px; }
  .landing-hero h1 { font-size: 28px; }
  .landing-actions .btn { flex: 1 1 100%; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-install-panel { padding: 18px 16px; }
}

/* ── Nouveautés (/news) ───────────────────────────────────────────────────── */
.news-list { list-style: none; padding: 0; margin-top: 24px; }
.prose .news-list { padding-left: 0; }
.news-item { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--gray-200); }
.news-date { font-size: 14px; color: var(--gray-500); padding-top: 3px; }
.prose .news-title { font-family: var(--font-serif); font-size: 18px; margin: 0 0 4px; }
.prose .news-text { margin: 0; }
@media (max-width: 768px) { .news-item { grid-template-columns: 1fr; gap: 2px; } }

/* ── Liens vers l'extérieur (macro _external_link.html) ───────────────────── */
.ext-link-icon { display: inline-block; margin-left: 3px; font-size: .85em; opacity: .7; text-decoration: none; }
.btn .ext-link-icon { opacity: 1; }
.pub-link { margin-top: 16px; }

/* ── Vie du club : annonces et sondages ───────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pub-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Les quatre onglets de Vie du club doivent tenir sur la largeur d'un téléphone.
   Mesuré avec la police de l'application : à 14 px, les libellés font 262 px ;
   avec des pastilles compactes (19 px chacune) et 4 px d'écart, 350 px au pire,
   pour 358 px disponibles sur un iPhone de 390 px. Plus étroit : 13 px, et au
   pire les onglets défilent (overflow-x de .tabs) plutôt que d'être coupés. */
.life-tabs { margin-bottom: 4px; gap: 4px; justify-content: space-between; }
.life-tabs .tab { display: inline-flex; align-items: center; }
@media (max-width: 379px) { .life-tabs .tab { font-size: 14px; } }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center; margin-left: 3px;
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px;
  background: var(--gray-200); color: var(--gray-700); font-size: 10px; font-weight: 700;
}
.tab-count-new { background: var(--accent); color: var(--surface); }   /* du nouveau dedans */
/* Le livret d'accueil, en haut de Vie du club tant qu'il n'est pas ouvert */
.welcome-banner {
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  background: var(--accent-soft); border: 1px solid var(--red-200); border-radius: var(--radius-lg);
}
.welcome-banner-head { display: flex; gap: 12px; align-items: flex-start; }
.welcome-banner-head p { margin: 0; }
.welcome-banner-icon {
  width: 40px; height: 40px; flex: none; border-radius: var(--radius);
  background: var(--accent); color: var(--surface); display: flex; align-items: center; justify-content: center;
}
.welcome-banner-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); }
.welcome-banner .btn { align-self: flex-start; }
.welcome-banner-hint { margin: 0; color: var(--gray-600); }
/* Un document dans une liste : la vignette de son type, puis le titre */
.doc-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.doc-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-card-main .pub-title { margin: 0; }
.doc-icon {
  width: 40px; height: 48px; border-radius: 6px; box-sizing: border-box; padding-bottom: 6px;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--gray-100); color: var(--gray-600); font-size: 10px; font-weight: 700;
}
.doc-icon-welcome { background: var(--accent-soft); color: var(--accent-deep); }
/* La page d'un document */
.doc-file {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; margin-top: 16px;
  padding: 14px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius);
}
.doc-file .doc-icon { width: 48px; height: 58px; font-size: 11px; padding-bottom: 8px; }
.doc-file-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.doc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.doc-actions .btn { min-height: 48px; justify-content: center; }
.doc-current-file { margin: 4px 0 8px; }
/* Le lecteur de document (viewer.html) : sous la barre du haut, à hauteur d'écran */
/* Document à consulter dans l'appli seulement : pas de menu « Enregistrer
   l'image » à l'appui long (iOS), pas de glisser-déposer, pas de sélection.
   Un frein, pas un verrou : une capture d'écran reste possible. */
.no-take-away { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.doc-viewer-page { display: flex; flex-direction: column; gap: 12px; }
.doc-viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-viewer-img {
  display: block; width: 100%; height: auto; box-sizing: border-box;
  border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--surface);
}
.pub-card { display: block; padding: 14px 16px; margin-bottom: 8px; text-decoration: none; color: inherit; transition: border-color .15s; }
.pub-card:hover { border-color: var(--gray-900); }
.pub-card-todo { border-color: var(--accent); }
.pub-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.pub-kind-accent { color: var(--accent); }
.pub-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.pub-title { font-weight: 700; font-size: 15px; line-height: 1.4; margin-top: 3px; }
.pub-excerpt { font-size: 14px; color: var(--gray-600); margin-top: 3px; }
.pub-meta { font-size: 13px; color: var(--gray-500); margin-top: 6px; }
.pub-event { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.pub-event-date { font-size: 14px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.pub-event .pub-title { margin: 0; }

.pub-detail-title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.3; }
.pub-body { margin-top: 14px; white-space: pre-line; line-height: 1.6; }
.pub-note { margin-top: 14px; padding: 10px 12px; font-size: 14px; color: var(--gray-600); background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); }
.pub-fieldset { border: none; padding: 0; margin: 0 0 16px; min-width: 0; }
.pub-vote { margin-top: 16px; }
.pub-option {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--gray-300); border-radius: var(--radius); cursor: pointer; font-size: 15px;
}
.pub-option input { width: 20px; height: 20px; accent-color: var(--gray-900); flex-shrink: 0; }
.pub-option:has(input:checked) { border-color: var(--gray-900); box-shadow: inset 0 0 0 1px var(--gray-900); }
.pub-results { margin-top: 20px; }
.pub-result { margin-bottom: 12px; }
.pub-result-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.pub-bar { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.pub-bar i { display: block; height: 100%; background: var(--accent); }
.pub-names { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.pub-share { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.pub-share .form-input { font-size: 16px; color: var(--gray-600); }

.pub-segmented { display: flex; border: 1px solid var(--gray-300); border-radius: var(--radius); overflow: hidden; }
.pub-segment { flex: 1; position: relative; cursor: pointer; }
.pub-segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pub-segment span { display: block; text-align: center; padding: 11px 6px; font-size: 14px; background: var(--surface); border-right: 1px solid var(--gray-300); }
.pub-segment:last-child span { border-right: none; }
.pub-segment input:checked + span { background: var(--gray-900); color: #fff; font-weight: 700; }
.pub-segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.pub-switches { display: flex; flex-direction: column; gap: 12px; }
[data-publication-form] [hidden] { display: none; }

/* ── Proposition d'activer les notifications (notifications/_prompt.html) ── */
.notif-prompt {
  width: min(400px, calc(100vw - 32px)); margin: auto; padding: 24px 20px 20px; text-align: center;
  border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: var(--surface); color: inherit;
}
.notif-prompt::backdrop { background: rgba(30, 29, 27, .45); }
.notif-prompt-icon {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 28px; background: var(--paper);
}
.notif-prompt-title { font-family: var(--font-serif); font-size: 21px; font-weight: 600; margin-bottom: 6px; }
.notif-prompt-text { color: var(--gray-600); margin-bottom: 18px; }
.notif-prompt [hidden] { display: none; }

/* ── Administration : qui reçoit les notifications ────────────────────────── */
.push-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.push-summary-value { font-family: var(--font-serif); font-size: 26px; font-weight: 600; line-height: 1.2; }
.push-devices { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

/* ── En-tête « héros » (accueil) ──────────────────────────────────────────────
   Une bande à l'encre, avec le motif seigaiha (les vagues concentriques des
   tissus japonais), dessiné en CSS : aucune image à charger. Une page s'en
   sert en remplissant le bloc topbar_class de base.html. */
.seigaiha {
  --wave: #2C2822;   /* les traits du motif */
  --ink:  var(--gray-900);
  background-color: var(--ink);
  background-image:
    radial-gradient(circle at 100% 150%, var(--ink) 24%, var(--wave) 24% 28%, var(--ink) 28% 36%, var(--wave) 36% 40%, transparent 40%),
    radial-gradient(circle at 0 150%, var(--ink) 24%, var(--wave) 24% 28%, var(--ink) 28% 36%, var(--wave) 36% 40%, transparent 40%),
    radial-gradient(circle at 50% 100%, var(--wave) 10%, var(--ink) 10% 23%, var(--wave) 23% 30%, var(--ink) 30% 43%, var(--wave) 43% 50%, var(--ink) 50% 63%, var(--wave) 63% 71%, transparent 71%),
    radial-gradient(circle at 100% 50%, var(--wave) 5%, var(--ink) 5% 15%, var(--wave) 15% 20%, var(--ink) 20% 29%, var(--wave) 29% 34%, var(--ink) 34% 44%, var(--wave) 44% 49%, transparent 49%),
    radial-gradient(circle at 0 50%, var(--wave) 5%, var(--ink) 5% 15%, var(--wave) 15% 20%, var(--ink) 20% 29%, var(--wave) 29% 34%, var(--ink) 34% 44%, var(--wave) 44% 49%, transparent 49%);
  background-size: 56px 28px;
}
.topbar-hero {
  position: relative;          /* elle défile avec la page, au lieu de rester collée en haut */
  padding: 26px 24px 30px; border-bottom: none; color: #FFFDF8;
  align-items: flex-start;
}
.topbar-hero .topbar-title { font-size: 30px; line-height: 1.2; color: #FFFDF8; }
.topbar-hero .topbar-subtitle { color: #CFC6B5; font-size: 14px; margin-top: 4px; }
.topbar-hero .notif-bell { border-color: rgba(255,253,248,.22); background: rgba(255,253,248,.06); }
.topbar-hero .notif-bell .icon { filter: invert(1); opacity: .85; }
.topbar-hero .notif-dot { border-color: var(--gray-900); }
.hero-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hero-seal { height: 54px; width: auto; display: block; }
.hero-brand-name { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #CFC6B5; }
@media (max-width: 768px) {
  .topbar-hero { padding: 22px 16px 26px; }
  .topbar-hero .topbar-title { font-size: 27px; }
}
/* La même bande à l'encre, en plus sobre, pour les pages membres (calendrier,
   Ma fiche, Ma cotisation) : elles ne paraissent plus plates à côté de
   l'accueil et de Vie du club (revue du 10/11/2026). */
.topbar-hero.topbar-ink { padding: 18px 24px 20px; }
.topbar-hero.topbar-ink .topbar-title { font-size: 24px; }
@media (max-width: 768px) {
  .topbar-hero.topbar-ink { padding: 16px 16px 18px; }
  .topbar-hero.topbar-ink .topbar-title { font-size: 22px; }
}

/* ── Ensō : la jauge de la cotisation ─────────────────────────────────────────
   Le cercle zen tracé d'un seul coup de pinceau. Il se remplit à mesure des
   paiements. pathLength="100" sur le cercle permet de raisonner en
   pourcentage : un trait de 100 « unités », dont on décale le début de
   (100 - pourcentage). Le filtre feTurbulence donne le bord irrégulier
   d'un pinceau. */
.enso { display: flex; flex-direction: column; align-items: center; padding: 4px 0 2px; }
.enso-ring { position: relative; width: 190px; height: 190px; }
.enso-ring svg { width: 100%; height: 100%; display: block; }
.enso-track { fill: none; stroke: var(--gray-200); stroke-width: 2; }
.enso-stroke {
  fill: none; stroke: var(--accent); stroke-width: 15; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: var(--off);
}
.enso-settled .enso-stroke { stroke: var(--green-600); }
.enso-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.enso-amount { font-family: var(--font-serif); font-size: 32px; font-weight: 600; line-height: 1.1; }
.enso-label { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ── Barre du bas : l'onglet actif se soulève ─────────────────────────────── */
.bottom-bar { background: rgba(255,253,248,.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.bottom-bar-item .icon { transition: transform .35s var(--ease-back), opacity .2s; }
.bottom-bar-item.active .icon { transform: translateY(-2px) scale(1.1); }
.bottom-bar-item.active { color: var(--accent); }
.bottom-bar-item.active::before { border-radius: 2px; }

/* ── Vie du club, version « vivante » (maquette validée le 29/10/2026) ────────
   Même vocabulaire que l'accueil : encre, vagues seigaiha, sceau vermillon,
   pinceau, ensō. Les animations sont dans la section « Mouvement ». */
/* Le choix du club sous le titre et la cloche (bloc topbar_bottom de
   base.html) : la barre passe à la ligne, la rangée prend toute la largeur,
   jusqu'aux bords de l'écran pour que les pastilles défilent d'un bord à
   l'autre au lieu d'être coupées net contre la marge. */
.topbar { flex-wrap: wrap; }
.topbar > .club-switcher { flex: 0 0 100%; margin: 4px 0 0; }
.topbar-hero > .club-switcher { margin: 6px -24px 0; padding: 0 24px; flex-basis: calc(100% + 48px); scroll-padding-inline: 24px; }
@media (max-width: 768px) {
  .topbar-hero > .club-switcher { margin: 4px -16px 0; padding: 0 16px; flex-basis: calc(100% + 32px); scroll-padding-inline: 16px; }
}
/* Safari ignore la marge de droite d'une rangée qui défile : une cale à la fin */
.topbar-hero > .club-switcher::after { content: ""; flex: 0 0 1px; }
.topbar-hero .club-pill { border-color: rgba(255,253,248,.3); background: rgba(255,253,248,.06); color: #EDE6D8; }
.topbar-hero .club-pill:hover { border-color: #FFFDF8; color: #FFFDF8; }
.topbar-hero .club-pill.active { background: #FFFDF8; border-color: #FFFDF8; color: var(--gray-900); }

.live-heading { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
.live-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.live-kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500);
}
.live-kicker.accent { color: var(--accent); }
.live-title { font-family: var(--font-serif); font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--gray-900); text-decoration: none; }
.live-excerpt { margin: 0; font-size: 14px; line-height: 1.5; color: var(--gray-600); }
.live-meta { font-size: 13px; color: var(--gray-500); }
.live-link { display: inline-block; margin-top: 6px; font-size: 14px; font-weight: 700; text-decoration: none; }
.live-list { display: flex; flex-direction: column; gap: 10px; }
.live-tabs-block { display: flex; flex-direction: column; gap: 12px; }

/* Une carte : posée sur le papier, ombre douce, s'enfonce au toucher */
.live-card {
  display: block; position: relative; background: var(--surface); color: inherit; text-decoration: none;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm), 0 6px 20px rgba(60,40,10,.05);
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
a.live-card:active, .live-announcement:active { transform: scale(.98); }
.live-card + .live-card { margin-top: 0; }
section > .live-card { margin-bottom: 10px; }

/* Sondage : à répondre (bordure vermillon, ensō de participation) ou répondu/clos (barres) */
.live-poll { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; }
.live-todo { border: 1px solid var(--accent); box-shadow: var(--shadow-md); }
.live-poll-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.live-cta { align-self: flex-start; margin-top: 4px; }
.live-enso { position: relative; flex: none; display: block; }
.live-enso svg { width: 100%; height: 100%; display: block; }
.live-enso-track { fill: none; stroke: var(--gray-100); stroke-width: 3; }
.live-enso-stroke { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: var(--off); }
.live-enso-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.live-enso-center strong { font-family: var(--font-serif); font-size: 18px; }
.live-enso-center small { font-size: 10px; color: var(--gray-500); }
.live-bars { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.live-bar-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.live-bar { display: block; height: 8px; border-radius: 4px; background: var(--gray-100); overflow: hidden; }
.live-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transform-origin: left; }

/* Le livret d'accueil : le sceau 迎 */
.live-welcome { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.live-welcome p { margin: 0; }
.live-seal {
  width: 46px; height: 46px; border-radius: 9px; background: var(--accent); color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 24px; font-weight: 600;
}

/* Annonce : un bandeau à l'encre, puis le texte. Le titre porte le lien de
   la carte (étiré sur toute la carte) ; le bouton du lien externe passe
   par-dessus (live-above), sinon on aurait un lien dans un lien. */
.live-announcement { overflow: hidden; }
.live-band { position: relative; height: 84px; }
.live-band-glyph { position: absolute; left: 16px; bottom: 10px; font-family: var(--font-serif); font-size: 32px; color: #FFFDF8; }
.live-band-tag {
  position: absolute; right: 14px; top: 12px; padding: 4px 8px; border-radius: 6px;
  background: var(--accent); color: var(--surface); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.live-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.live-stretch::after { content: ""; position: absolute; inset: 0; }
.live-above { position: relative; z-index: 1; margin-top: 4px; }

/* Événement : une grande vignette de date ; le prochain, à l'encre */
.live-event { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px; }
.live-date {
  height: 74px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.live-date strong { font-family: var(--font-serif); font-size: 28px; letter-spacing: 0; margin: 4px 0; }
.live-date-next { background: var(--gray-900); color: #CFC6B5; }
.live-date-next strong { color: #FFFDF8; }
.live-event-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* Documents : deux colonnes de vignettes (la vraie image quand c'en est une) */
.live-doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.live-doc { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.live-doc-thumb {
  position: relative; height: 110px; border-radius: 10px; overflow: hidden; margin-bottom: 4px;
  background: var(--gray-100); display: flex; align-items: center; justify-content: center;
}
.live-doc-thumb.welcome { background: var(--accent-soft); }
.live-doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-doc-glyph { font-family: var(--font-serif); font-size: 42px; color: var(--gray-600); }
.live-doc-thumb.welcome .live-doc-glyph { color: var(--accent); }
.live-doc-type {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 6px; border-radius: 5px;
  background: var(--surface); color: var(--gray-700); font-size: 10px; font-weight: 700;
}
.live-doc-title { font-weight: 700; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }

/* Compteurs des onglets : de petits sceaux carrés, légèrement penchés */
.life-tabs .tab-count { border-radius: 4px; transform: rotate(-4deg); }
.life-tabs .tab { position: relative; }
.life-tabs .tab.active { border-bottom-color: transparent; }
.life-tabs .tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 2px;
  background: var(--accent); transform-origin: left;
}

/* Retour arrière : la page se recharge (app.js) ; l'ancienne version
   s'estompe pendant ce temps, pour qu'on ne la prenne pas pour la bonne. */
.is-refreshing body { opacity: .4; transition: opacity .15s; pointer-events: none; }

/* ── Mode hors ligne ──────────────────────────────────────────────────────────
   Le bandeau (rempli par app.js) dit qu'on regarde une copie enregistrée, et
   de quand elle date ; la marque dit qu'un document est gardé sur ce téléphone. */
.offline-banner {
  max-width: 640px; margin: 0 auto 14px; padding: 10px 14px; box-sizing: border-box;
  border-radius: var(--radius); background: var(--gray-900); color: #FFFDF8;
  font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px;
}
.offline-banner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #E7B9B1; flex: none; }
.offline-banner[hidden] { display: none; }
/* La fine barre du téléchargement d'avance, en haut de l'écran */
.offline-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; background: transparent; pointer-events: none; }
.offline-progress[hidden] { display: none; }
.offline-progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s var(--ease-out); }
.offline-mark {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  font-size: 12px; font-weight: 700; color: var(--green-600);
}
.offline-mark::before { content: "✓"; }
.offline-mark[hidden] { display: none; }
.offline-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.offline-list a {
  display: block; padding: 12px 14px; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); text-decoration: none; color: var(--gray-900); font-weight: 500;
}

/* ============================================================================
   Mouvement
   Trois familles, toutes courtes (moins d'une seconde) et jouées une fois :
   1. l'arrivée sur une page : les blocs montent en cascade ;
   2. les signatures : le sceau se tamponne, le pinceau trace le titre et
      l'ensō, les vagues dérivent très lentement ;
   3. le retour au toucher : boutons et cartes s'enfoncent légèrement.
   ========================================================================= */

@keyframes rise   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes stamp  { from { opacity: 0; transform: scale(1.5) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes brush  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drift  { to { background-position: 560px 0; } }
@keyframes enso   { from { stroke-dashoffset: 100; } to { stroke-dashoffset: var(--off); } }
@keyframes pulse  {
  0%   { box-shadow: 0 0 0 0 rgba(179,58,44,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(179,58,44,0); }
  100% { box-shadow: 0 0 0 0 rgba(179,58,44,0); }
}

/* 1. Arrivée : chaque bloc de premier niveau de la page monte, l'un après
      l'autre (60 ms d'écart, plafonné au 8e pour ne jamais faire attendre). */
.content > .container > *, .content > .container-wide > * { animation: rise .5s var(--ease-out) both; }
.content > .container > *:nth-child(2), .content > .container-wide > *:nth-child(2) { animation-delay: .06s; }
.content > .container > *:nth-child(3), .content > .container-wide > *:nth-child(3) { animation-delay: .12s; }
.content > .container > *:nth-child(4), .content > .container-wide > *:nth-child(4) { animation-delay: .18s; }
.content > .container > *:nth-child(5), .content > .container-wide > *:nth-child(5) { animation-delay: .24s; }
.content > .container > *:nth-child(6), .content > .container-wide > *:nth-child(6) { animation-delay: .30s; }
.content > .container > *:nth-child(7), .content > .container-wide > *:nth-child(7) { animation-delay: .36s; }
.content > .container > *:nth-child(n+8), .content > .container-wide > *:nth-child(n+8) { animation-delay: .42s; }
/* Les cartes de modules de l'accueil, en cascade elles aussi */
.modules-grid > * { animation: rise .5s var(--ease-out) both; }
.modules-grid > *:nth-child(2) { animation-delay: .05s; }
.modules-grid > *:nth-child(3) { animation-delay: .10s; }
.modules-grid > *:nth-child(4) { animation-delay: .15s; }
.modules-grid > *:nth-child(5) { animation-delay: .20s; }
.modules-grid > *:nth-child(n+6) { animation-delay: .25s; }

/* 2. Signatures */
.topbar-hero.seigaiha { animation: drift 90s linear infinite; }
.hero-seal { animation: stamp .7s var(--ease-back) .1s both; }
.topbar-hero .topbar-title, .topbar-hero .topbar-subtitle { animation: rise .6s var(--ease-out) .2s both; }
.section-title::after { animation: brush .8s cubic-bezier(.3,.6,.2,1) .35s both; }
.enso-stroke { animation: enso 1.6s cubic-bezier(.3,.6,.2,1) .2s both; }
.notif-dot { animation: pulse 2.4s ease-out 1s 2; }

/* Vie du club : le pinceau sous l'onglet, l'ensō de participation, les barres
   des résultats, le sceau du livret, le point qui bat à « À répondre » ;
   les cartes de la liste montent en cascade. */
.life-tabs .tab.active::after { animation: brush .8s cubic-bezier(.3,.6,.2,1) .15s both; }
.live-enso-stroke { animation: enso 1.6s cubic-bezier(.3,.6,.2,1) .3s both; }
.live-bar > span { animation: brush .9s cubic-bezier(.3,.6,.2,1) .25s both; }
.live-seal { animation: stamp .7s var(--ease-back) .2s both; }
.live-pulse { animation: pulse 2.4s ease-out 1s infinite; }
.live-list > *, .live-doc-grid > * { animation: rise .5s var(--ease-out) both; }
.live-list > *:nth-child(2), .live-doc-grid > *:nth-child(2) { animation-delay: .06s; }
.live-list > *:nth-child(3), .live-doc-grid > *:nth-child(3) { animation-delay: .12s; }
.live-list > *:nth-child(4), .live-doc-grid > *:nth-child(4) { animation-delay: .18s; }
.live-list > *:nth-child(n+5), .live-doc-grid > *:nth-child(n+5) { animation-delay: .24s; }

/* 3. Retour au toucher */
.btn, .module-card, .pub-card, .stat-tile, .bottom-bar-item, .pub-option {
  -webkit-tap-highlight-color: transparent;
}
.btn { transition: background .15s, border-color .15s, opacity .15s, transform .15s var(--ease-out); }
.btn:active, .module-card:active, .pub-card:active, .stat-link:active, a.row:active { transform: scale(.98); }
a.row { transition: transform .15s var(--ease-out); }

/* Le téléphone demande moins d'animations (réglage d'accessibilité) :
   tout s'affiche directement, dans son état final. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── Accueil : la carte « Ma cotisation » tant que le dossier est incomplet ── */
.home-dossier {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
  padding: 16px 18px; color: inherit; text-decoration: none;
  box-shadow: var(--shadow-md);   /* un cran au-dessus des autres cartes : c'est ce qui attend la personne */
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.home-dossier:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.home-dossier:active { transform: scale(.98); }
.home-dossier-main { flex: 1; min-width: 0; }
.home-dossier-eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); }
.home-dossier-amount { font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.home-dossier-amount span { font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--gray-500); }
.home-dossier-sub { font-size: 14px; color: var(--gray-500); }
.home-dossier-todo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.home-dossier-todo:empty { display: none; }
.home-dossier-chevron { opacity: .45; }
/* Une échéance en retard : bord et fond rouges, la ligne de l'échéance en gras */
.home-dossier.is-late { border-left: 4px solid var(--red-600); background: var(--red-50); }
.home-dossier-sub.home-dossier-late { color: var(--red-600); font-weight: 600; font-size: 14px; }
/* L'ensō réduit : 76 px, le pourcentage au centre */
.enso-sm { padding: 0; flex: none; }
.enso-sm .enso-ring { width: 76px; height: 76px; }
.enso-sm .enso-stroke { stroke-width: 18; }
.enso-sm .enso-amount { font-size: 17px; }
.home-dossier + .home-dossier { margin-top: -8px; }

/* ── Ma cotisation : le total, puis un bloc par catégorie ─────────────────────
   (gabarits : fees/_macros.html, section « Ma cotisation ») */

/* Le centre de l'ensō quand tout est réglé : une coche qui se trace */
.enso-check {
  width: 46px; height: 46px; fill: none; stroke: var(--green-600); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.enso-check path { stroke-dasharray: 24; animation: draw-check .5s ease-out 1.6s both; }
.enso-label-strong { font-family: var(--font-serif); font-size: 19px; font-weight: 600; color: var(--gray-900); }
.enso-caption { font-size: 14px; color: var(--gray-500); margin-top: 2px; }

/* Les trois cases : dû, réglé, reste (ou trop réglé) */
.money-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.money-tile {
  background: var(--surface); border: 1px solid rgba(220,216,206,.7); border-radius: 14px;
  padding: 12px 8px; text-align: center; min-width: 0;
}
.money-tile-label { font-size: 13px; color: var(--gray-500); }
.money-tile-value { font-family: var(--font-serif); font-size: 19px; font-weight: 600; margin-top: 2px; white-space: nowrap; }
.money-tile-paid { color: var(--green-600); }
.money-tile-dark, .money-tile-over, .money-tile-settled { border: none; color: #FFFDF8; }
.money-tile-dark    { background: var(--gray-900); }
.money-tile-over    { background: var(--lv-national); }   /* indigo : ni une dette, ni une erreur */
.money-tile-settled { background: var(--green-600); }
.money-tile-dark .money-tile-label, .money-tile-over .money-tile-label, .money-tile-settled .money-tile-label { color: inherit; opacity: .85; }
.money-over-note { font-size: 14px; color: var(--lv-national); text-align: center; line-height: 1.5; }
@media (max-width: 380px) { .money-tile-value { font-size: 17px; } }

/* Les blocs */
.fee-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fee-block-row { display: flex; align-items: center; gap: 14px; }
.fee-block-main { flex: 1; min-width: 0; }
.fee-block-main p { margin-top: 4px; }
.fee-lines { margin-top: 8px; }
.fee-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 15px; }
.fee-line + .fee-line { border-top: 1px solid var(--gray-100); }
.fee-line-amount { font-family: var(--font-serif); font-weight: 600; white-space: nowrap; }

/* Cotisation : la barre se remplit, après l'ensō */
.fee-progress { height: 10px; border-radius: 5px; margin-top: 10px; }
.fee-progress span { border-radius: 5px; }
.balance-bar span { transform-origin: left; animation: fill 1s var(--ease-out) .9s both; }
.fee-progress-caption { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--gray-500); margin-top: 6px; }

/* Certificat : 証 en pointillés qui respire tant qu'il manque, sceau 済 une fois remis */
.cert-waiting, .cert-seal {
  flex: none; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); color: var(--accent);
}
.cert-waiting { border-radius: 50%; border: 2px dashed var(--accent); font-size: 22px; animation: breathe 2.6s ease-in-out 1.2s 3; }
.cert-seal { border-radius: 10px; border: 2.5px solid var(--accent); font-size: 26px; font-weight: 600; transform: rotate(-8deg); animation: seal .7s var(--ease-back) 1.1s both; }

/* Achats : une petite barre par achat, puis une coche ou un cercle en pointillés */
.item-pips { display: flex; gap: 6px; margin-top: 12px; }
.item-pip { flex: 1; height: 6px; border-radius: 3px; background: var(--gray-100); overflow: hidden; }
.item-pip i { display: block; width: 100%; height: 100%; background: var(--green-600); transform-origin: left; animation: fill .6s var(--ease-out) both; }
.item-line { justify-content: flex-start; }
.item-main { flex: 1; min-width: 0; }
.item-mark { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.item-mark-todo { border: 2px dashed var(--accent); }
.item-mark-done { background: var(--green-50); color: var(--green-600); animation: pop .4s var(--ease-back) both; }
.item-mark-done svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.item-mark-done path { stroke-dasharray: 24; animation: draw-check .45s ease-out both; }

/* Les paiements, repliés */
.fee-payments { padding: 4px 18px; }
.fee-payments summary {
  list-style: none; cursor: pointer; min-height: 48px;
  display: flex; align-items: center; justify-content: space-between; font-weight: 500;
}
.fee-payments summary::-webkit-details-marker { display: none; }
.fee-payments-chevron { opacity: .5; transition: transform .25s var(--ease-out); }
.fee-payments[open] .fee-payments-chevron { transform: rotate(90deg); }
.fee-payments .fee-line:first-of-type { border-top: 1px solid var(--gray-100); }

@keyframes fill       { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw-check { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes pop        { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes breathe    { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes seal       { from { opacity: 0; transform: scale(1.7) rotate(-14deg); } to { opacity: 1; transform: rotate(-8deg); } }

/* ── Mon profil : un menu de réglages groupés, puis une sous-page par section ──
   (gabarit : profile/index.html) */
.profile-card {
  display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 22px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow-md);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.profile-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.profile-card:active { transform: scale(.98); }
.profile-card-avatar { flex: none; }
.profile-card-name { display: block; font-family: var(--font-serif); font-size: 22px; font-weight: 600; line-height: 1.25; }
.profile-card-email { display: block; font-size: 14px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; }
.profile-card-since { display: block; font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.profile-card-edit { font-size: 14px; font-weight: 700; color: var(--accent); }

.settings-group { margin-bottom: 22px; }
.settings-group-title { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-500); padding: 0 6px 8px; }
.settings-list { overflow: hidden; }
.settings-row {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px;
  color: inherit; text-decoration: none; transition: background-color .2s;
}
.settings-row + .settings-row { border-top: 1px solid var(--gray-100); }
.settings-row:hover, .settings-row:active { background: var(--gray-50); }
.settings-row-plain { min-height: 52px; padding-left: 16px; }
.settings-icon {
  flex: none; width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
/* L'icône est un SVG au trait servi tel quel : on s'en sert comme d'un pochoir
   (mask) rempli de la couleur du texte, pour qu'elle prenne la teinte de la ligne. */
.settings-glyph {
  width: 20px; height: 20px; background-color: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
}
/* Une teinte douce par ligne, prise dans les couleurs des niveaux, et l'icône dans la teinte franche */
.settings-icon-indigo { background: color-mix(in srgb, var(--lv-national) 12%, var(--surface)); color: var(--lv-national); }
.settings-icon-matcha { background: color-mix(in srgb, var(--lv-region) 12%, var(--surface)); color: var(--lv-region); }
.settings-icon-shu    { background: var(--accent-soft); color: var(--accent-deep); }
.settings-icon-kincha { background: color-mix(in srgb, var(--lv-inter) 14%, var(--surface)); color: var(--lv-inter); }
.settings-icon-ink    { background: var(--gray-100); color: var(--gray-800); }
.settings-main { flex: 1; min-width: 0; }
.settings-title { display: block; font-weight: 500; }
.settings-value { display: block; font-size: 14px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-chevron { opacity: .45; }
.settings-end { display: flex; flex-direction: column; gap: 6px; }
.settings-delete { display: block; text-align: center; padding: 12px; font-size: 14px; color: var(--accent-deep); text-decoration: none; }
.settings-delete:hover { text-decoration: underline; }

/* La sous-page : un lien de retour, et l'arrivée par un léger glissé depuis la droite */
.back-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -6px 0 6px -6px; padding: 0 8px 0 2px;
  color: var(--gray-600); font-size: 14px; text-decoration: none; border-radius: 10px;
}
.back-link .icon { transform: rotate(180deg); opacity: .6; }
.back-link:hover { background: var(--gray-100); }
.profile-sub { animation: push-in .38s var(--ease-out) both; }
@keyframes push-in { from { opacity: .4; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* Barre de navigation : l'aperçu en direct */
.nav-preview { background: var(--gray-900); border-radius: var(--radius-lg); padding: 12px 10px 10px; }
.nav-preview-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #CFC6B5; padding: 0 6px 8px; }
.nav-preview-bar { display: flex; background: var(--surface); border-radius: 12px; min-height: 60px; }
.nav-preview-item {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px;
}
.nav-preview-item > span { font-size: 18px; line-height: 1; }
.nav-preview-item.is-new { animation: pop .38s var(--ease-back) both; }

/* Les interrupteurs basculent avec un petit rebond */
.switch-slider::before { transition: transform .25s var(--ease-back); }

/* ── Carte « En dessous » (entities/_carte.html, js/carte.js) ─────────────── */
/* Ordinateur : la carte et la liste côte à côte. Téléphone : l'une ou l'autre. */
.carte-grid { display: grid; gap: 16px; align-items: start; }
@media (max-width: 899px) {
  .carte-zone[data-pane="map"] .carte-pane-list,
  .carte-zone[data-pane="list"] .carte-pane-map { display: none; }
}
.carte-zone.carte-failed .carte-pane-map, .carte-zone.carte-failed .carte-switch { display: none; }
.carte-zone.carte-failed .carte-pane-list { display: block; }
.carte-zone.carte-failed .carte-grid { grid-template-columns: 1fr; }

.carte-switch { display: flex; width: max-content; margin: 0 0 12px; padding: 3px; gap: 3px;
                border: 1px solid var(--gray-200); border-radius: 999px; background: var(--surface); }
.carte-switch-btn { border: none; background: transparent; border-radius: 999px; padding: 7px 18px;
                    font: 500 14px var(--font-sans); color: var(--gray-500); cursor: pointer; }
.carte-switch-btn[aria-pressed="true"] { background: var(--gray-900); color: #fff; font-weight: 700; }
@media (min-width: 900px) {
  .carte-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .carte-switch { display: none; }
  .carte-pane-map { position: sticky; top: 80px; }
}

.carte-pane-map { margin: 0; padding: 10px; overflow: hidden; }
.carte { position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--radius);
         background: radial-gradient(circle at 30% 20%, #F7F3EA, #EFE9DC); overflow: hidden; }
.carte-svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s var(--ease-out); }
.carte.is-ready .carte-svg { opacity: 1; }

/* Les formes : le papier par défaut, la couleur de l'élément (--c) quand elles en sont un */
.carte-shape { fill: #E6E0D2; stroke: #FFFDF8; stroke-width: calc(var(--stroke, .1) * 1px);
               stroke-linejoin: round; transition: fill .2s, filter .2s; }
.carte-shape.is-item, .carte-shape.is-focus { fill: var(--c); cursor: pointer; }
.carte-shape.is-focus { fill: color-mix(in srgb, var(--c) 45%, #F2EDE3); cursor: default; }
.carte-shape.is-focus.has-clubs { fill: var(--c); cursor: pointer; }
.carte-shape.is-item.is-hot, .carte-shape.is-focus.is-hot { filter: brightness(.86) saturate(1.2); }
.carte-shape.is-picked { stroke: var(--gray-900); stroke-width: calc(var(--stroke, .1) * 2.5px); }

/* Les pastilles, en HTML par-dessus : nettes quel que soit le zoom */
.carte-marks { position: absolute; inset: 0; pointer-events: none; }
.carte-pin { position: absolute; left: 0; top: 0; pointer-events: auto;
             display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px;
             margin: -15px 0 0 -15px; border-radius: 999px; border: 2px solid #FFFDF8;
             background: color-mix(in srgb, var(--c, var(--gray-700)) 60%, var(--gray-900));
             color: #fff; font: 700 13px var(--font-sans); text-decoration: none; cursor: pointer;
             box-shadow: var(--shadow-sm); transition: box-shadow .2s, scale .2s var(--ease-back); }
.carte-pin.is-small { min-width: 24px; height: 24px; margin: -12px 0 0 -12px; padding: 0 6px; font-size: 13px;
                      background: var(--gray-900); }
/* Une petite forme (le Luxembourg) : la pastille se plante au-dessus, comme un fanion */
.carte-pin.is-flag { margin-top: -50px; }
.carte-pin.is-flag::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 18px;
                            margin-left: -1px; background: var(--gray-900); }
.carte-pin.is-hot { scale: 1.15; box-shadow: var(--shadow-md); }
.carte-pin.is-mine { outline: 2px solid var(--accent); outline-offset: 2px; }
.carte-pin:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.carte-seal { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px;
              background: var(--accent); color: #fff; font: 700 10px var(--font-serif); line-height: 1; }
.carte-pin .carte-seal { position: absolute; top: -8px; right: -9px; rotate: -8deg; border: 1.5px solid #FFFDF8; }

.carte-tip { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; white-space: nowrap;
             margin-top: -24px; translate: -50% -100%; padding: 6px 10px; border-radius: 8px;
             background: var(--gray-900); color: #fff; font-size: 14px; box-shadow: var(--shadow-md); }
.carte-tip[hidden] { display: none; }

.carte-caption { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 4px 2px; font-size: 14px; color: var(--gray-500); }
.carte-legend { display: inline-flex; align-items: center; gap: 6px; }
.carte-mine-dot { width: 12px; height: 12px; border-radius: 999px; outline: 2px solid var(--accent); outline-offset: 1px; background: var(--gray-700); }

/* La liste répond : un liseré de la couleur de l'élément, allumé au survol */
.carte-row { box-shadow: inset 3px 0 0 var(--c); transition: background .15s; }
.carte-row.is-hot { background: color-mix(in srgb, var(--c) 18%, transparent); }
.carte-row[hidden] { display: none; }
.carte-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px;
                font-size: 14px; color: var(--gray-700); }
.carte-filter[hidden] { display: none; }
.carte-filter .btn { white-space: nowrap; flex-shrink: 0; }

/* Identifiant d'une erreur 500, à recopier : chasse fixe, sélection facile */
.error-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: .08em; user-select: all; }

/* ── Onglet Documents : le meuble à tiroirs (tansu) ──────────────────────────
   Les dossiers sont des tiroirs empilés : façade claire, poignée kan (anneau
   vermillon), nombre de documents gravé à droite. Ouvrir un tiroir le fait
   glisser (::details-content, interpolate-size : là où le navigateur le
   permet, sinon il s'ouvre d'un coup). Les documents sont des lignes
   compactes, une feuille de papier à gauche. */
.doc-cabinet { display: flex; flex-direction: column; gap: 14px; }

.doc-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--gray-100); }
.doc-section-pill {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 10px;
  border-radius: 11px; color: var(--gray-600); font-weight: 600; text-decoration: none;
  transition: background .2s var(--ease-out), color .2s, box-shadow .2s;
}
.doc-section-pill.active { background: var(--surface); color: var(--gray-900); box-shadow: var(--shadow-sm); }
.doc-section-glyph { font-family: var(--font-serif); font-size: 18px; color: var(--gray-400); }
.doc-section-pill.active .doc-section-glyph { color: var(--accent); }
.doc-section-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--gray-200); font-size: 13px; text-align: center; }
.doc-section-pill.active .doc-section-n { background: var(--gray-900); color: var(--surface); }
.doc-section-hint { margin: -6px 0 0; font-size: 14px; color: var(--gray-500); text-align: center; }

/* Le livret d'accueil, mis en avant : un rouleau posé sur le meuble */
.doc-welcome {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--radius-lg); text-decoration: none; color: inherit;
  background: linear-gradient(100deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--red-200); transition: transform .15s var(--ease-out);
}
.doc-welcome:active { transform: scale(.98); }
.doc-welcome-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-welcome-kicker { font-size: 13px; font-weight: 700; color: var(--accent); }
.doc-welcome-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }

/* Le meuble : des tiroirs l'un sur l'autre, dans un même bâti */
.tansu {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 18px;
  background: var(--gray-800); box-shadow: var(--shadow-md);
}
.drawer { border-radius: 12px; background: var(--surface); overflow: hidden; interpolate-size: allow-keywords; }
.drawer-front {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  min-height: 58px; padding: 10px 14px; cursor: pointer; list-style: none;
  border-bottom: 1px solid transparent; transition: background .2s, border-color .25s;
}
.drawer-front::-webkit-details-marker { display: none; }
.drawer-front:hover { background: var(--gray-50); }
.drawer-front:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.drawer[open] > .drawer-front { border-bottom-color: var(--gray-200); background: var(--gray-50); }
/* La poignée : un étrier de tansu, posé sur sa platine ; quand on tire le
   tiroir, l'étrier se soulève et passe au vermillon. */
.drawer-pull {
  position: relative; width: 30px; height: 18px; border-radius: 5px; background: var(--gray-100);
  transition: background .25s;
}
.drawer-pull::after {
  content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 8px;
  border: 2.5px solid var(--gray-500); border-top: 0; border-radius: 0 0 7px 7px;
  transform-origin: top; transition: transform .35s var(--ease-back), border-color .25s;
}
.drawer[open] .drawer-pull { background: var(--accent-soft); }
.drawer[open] .drawer-pull::after { border-color: var(--accent); transform: scaleY(-1) translateY(-6px); }
.drawer-name { font-family: var(--font-serif); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.drawer-count {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--gray-100); color: var(--gray-700); font-family: var(--font-serif); font-weight: 700;
}
.drawer[open] .drawer-count { background: var(--gray-900); color: var(--surface); }
.drawer::details-content { block-size: 0; overflow: hidden; transition: block-size .35s var(--ease-out), content-visibility .35s allow-discrete; }
.drawer[open]::details-content { block-size: auto; }
.drawer-inside { display: flex; flex-direction: column; padding: 4px 6px 8px; }
.drawer[open] .drawer-inside > * { animation: rise .4s var(--ease-out) both; }
.drawer[open] .drawer-inside > *:nth-child(2) { animation-delay: .05s; }
.drawer[open] .drawer-inside > *:nth-child(3) { animation-delay: .10s; }
.drawer[open] .drawer-inside > *:nth-child(n+4) { animation-delay: .15s; }
.drawer-empty { margin: 0; padding: 12px 10px; font-size: 14px; color: var(--gray-500); }

/* Une ligne de document */
.doc-rows { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.doc-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; transition: background .15s, transform .15s var(--ease-out);
}
.doc-row:hover { background: var(--gray-50); }
.doc-row:active { transform: scale(.98); }
/* La feuille : un papier au coin plié, ou la vignette d'une image */
.doc-sheet {
  position: relative; width: 38px; height: 46px; border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--gray-200);
  font-family: var(--font-serif); font-size: 20px; color: var(--gray-700);
}
.doc-sheet::after { content: ""; position: absolute; top: 0; right: 0; border-width: 0 10px 10px 0; border-style: solid; border-color: var(--gray-200) var(--surface); }
.doc-sheet-image::after { display: none; }
.doc-sheet img { width: 100%; height: 100%; object-fit: cover; }
.doc-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-row-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.doc-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--gray-500); }
.doc-row-new { color: var(--accent); font-weight: 700; }
.doc-row-go { font-size: 22px; color: var(--gray-300); }
.doc-loose-title { margin: 6px 0 -4px; font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--gray-600); }

.doc-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; text-align: center; color: var(--gray-500); }
.doc-empty p { margin: 0; }
.doc-empty-glyph { font-family: var(--font-serif); font-size: 44px; color: var(--gray-300); }
.folder-row { border-top: 1px solid var(--gray-200); }
.folder-row-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  min-height: 52px; cursor: pointer; list-style: none;
}
.folder-row-head::-webkit-details-marker { display: none; }
.folder-row-name { font-family: var(--font-serif); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.folder-row-edit { font-size: 14px; font-weight: 700; color: var(--accent); }
.folder-row[open] .folder-row-edit { color: var(--gray-500); }
.folder-row-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 12px; }
.folder-rename { display: flex; gap: 8px; flex: 1 1 240px; }
.folder-rename .form-input { flex: 1; min-width: 0; }

/* Page des dossiers : ranger d'un coup */
.folder-row .drawer-pull { flex: none; }
.tidy-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.tidy-item {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 8px; border-radius: 10px; cursor: pointer; transition: background .15s;
}
.tidy-item:hover { background: var(--gray-50); }
.tidy-item:has(input:checked) { background: var(--accent-soft); }
.tidy-item input { width: 20px; height: 20px; accent-color: var(--accent); }
.tidy-item .doc-sheet { width: 30px; height: 36px; font-size: 16px; }

/* Glisser un document dans un tiroir (documents-drag.js, bureau seulement) */
.doc-item { position: relative; }
.doc-item:has(.doc-grip) .doc-row { padding-right: 52px; }
.doc-item:has(.doc-grip) .doc-row-go { display: none; }
.doc-grip {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent;
  color: var(--gray-400); font-size: 20px; line-height: 1; cursor: grab; touch-action: none;
  -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s;
}
.doc-grip:hover { background: var(--gray-100); color: var(--gray-700); }
.doc-grip:focus-visible { outline: 2px solid var(--accent); }
.doc-lifted { opacity: .3; }
.doc-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0;
  background: var(--surface); border-radius: 12px; box-shadow: 0 16px 40px rgba(30,20,5,.28);
}
.doc-ghost .doc-grip { cursor: grabbing; color: var(--accent); }
body.doc-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.dragging .drawer, .dragging .doc-loose { transition: transform .2s var(--ease-back), box-shadow .2s, outline-color .2s; }
.drawer.drop-over { outline: 3px solid var(--accent); outline-offset: -3px; transform: scale(1.02); }
.drawer.drop-over .drawer-pull { background: var(--accent-soft); }
.drawer.drop-over .drawer-pull::after { border-color: var(--accent); transform: scaleY(-1) translateY(-6px); }
.doc-loose.drop-over .doc-rows { outline: 3px dashed var(--accent); outline-offset: 2px; }
.doc-loose-empty { display: none; }
.dragging .doc-loose-empty { display: block; }
.doc-drop-hint { margin: 0; padding: 18px 12px; text-align: center; font-size: 14px; color: var(--gray-500); }
/* Le document qui vient d'arriver : un éclat vermillon qui s'éteint */
.just-dropped .doc-row { animation: just-dropped 1.6s var(--ease-out) .2s both; }
@keyframes just-dropped {
  0% { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
  100% { background: transparent; box-shadow: inset 3px 0 0 transparent; }
}

/* L'espace des documents du club : une jauge, comme un trait de pinceau */
.space-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.space-figure { font-family: var(--font-serif); font-weight: 600; color: var(--gray-700); }
.space-gauge { height: 10px; margin: 10px 0 8px; border-radius: 5px; background: var(--gray-100); overflow: hidden; }
.space-gauge > span {
  display: block; height: 100%; width: var(--fill); border-radius: 5px; background: var(--gray-800);
  transform-origin: left; animation: brush .9s cubic-bezier(.3,.6,.2,1) .15s both;
}
.space-high .space-gauge > span { background: var(--accent); }
.space-note { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--accent); }
.space-set { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-200); }
.space-set-row { display: flex; gap: 8px; }
.space-set-row .form-input { flex: 1; min-width: 0; }

/* ── Console d'administration : le reportage ────────────────────────────────
   Sobre et dense : des panneaux blancs posés sur le papier, des chiffres en
   Mincho, l'encre pour les séries, le vermillon pour ce qui compte (dernier
   point, tendance qui baisse, erreurs). Graphiques en SVG côté serveur
   (admin/_charts.html). */
.report { display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }
.report-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-top: 8px; }
.report-title { margin: 0; font-family: var(--font-serif); font-size: 26px; font-weight: 600; }
.report-sub { margin: 0; font-size: 14px; color: var(--gray-500); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 820px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none;
  border-top: 3px solid var(--gray-800); transition: transform .15s var(--ease-out), box-shadow .15s;
}
a.kpi:hover { box-shadow: var(--shadow-md); }
a.kpi:active { transform: scale(.98); }
.kpi-alert { border-top-color: var(--accent); }
.kpi-alert .kpi-value { color: var(--accent); }
.kpi-label { font-size: 14px; color: var(--gray-500); }
.kpi-value { font-family: var(--font-serif); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-delta.good { color: var(--green-600); }
.kpi-delta.bad { color: var(--accent); }
.kpi-delta.flat { color: var(--gray-400); }
.kpi-delta-hint { font-weight: 400; color: var(--gray-400); }

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }
.panel { min-width: 0; padding: 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-wide { grid-column: span 2; }
@media (max-width: 720px) { .panel-wide { grid-column: auto; } }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.panel-title { margin: 0; font-family: var(--font-serif); font-size: 17px; font-weight: 600; }
.panel-note { font-size: 13px; color: var(--gray-400); }
.panel-link { font-size: 14px; font-weight: 700; text-decoration: none; }
.panel-empty { margin: 0; font-size: 14px; color: var(--gray-500); }
.panel-ok { margin: 0; font-size: 14px; color: var(--green-600); }

/* Graphiques */
.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: 170px; overflow: visible; }
.chart-grid { stroke: var(--gray-100); stroke-width: 1; }
.chart-axis { font-family: var(--font-sans); font-size: 11px; fill: var(--gray-400); }
.chart-area { fill: var(--gray-800); opacity: .07; }
.chart-line { fill: none; stroke: var(--gray-800); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-dot { fill: var(--surface); stroke: var(--gray-800); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-dot-last { fill: var(--accent); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-bar { fill: var(--gray-700); }
.chart-bar-last { fill: var(--accent); }
.chart-bar, .chart-bar-last { transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--ease-out) both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; border-radius: 5px; background: var(--gray-100); overflow: hidden; }
.hbar-fill { display: block; height: 100%; width: var(--w); border-radius: 5px; background: var(--gray-700);
  transform-origin: left; animation: brush .8s cubic-bezier(.3,.6,.2,1) .1s both; }
.hbar-top { background: var(--accent); }
.hbar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.funnel-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; font-size: 14px; }
.funnel-bar { grid-column: 1 / -1; order: 3; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--gray-800) var(--w), var(--gray-100) var(--w)); }
.funnel-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-value small { font-weight: 400; color: var(--gray-400); }

/* Journaux */
.log-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--gray-100); font-size: 14px; list-style: none; }
.panel-head + .log-line, .panel-head + .log-entry > .log-line { border-top: 0; }
.log-line .log-main:only-child, .log-line > .log-main:first-child { grid-column: 1 / 3; }
summary.log-line { cursor: pointer; }
summary.log-line::-webkit-details-marker { display: none; }
.log-id { padding: 2px 6px; border-radius: 5px; background: var(--gray-900); color: var(--surface); font-size: 13px; letter-spacing: .04em; }
.log-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.log-path { color: var(--gray-500); }
.log-msg { color: var(--gray-600); font-size: 13px; }
.log-when { color: var(--gray-400); white-space: nowrap; font-size: 13px; }
.log-entry[open] > .log-line { background: var(--gray-50); }
.log-trace { margin: 0 0 10px; padding: 12px; max-height: 320px; overflow: auto; border-radius: 10px; background: var(--gray-900); color: #E8E2D6; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.log-search { display: flex; gap: 8px; max-width: 520px; }
.log-search .form-input { flex: 1; min-width: 0; }

/* Tableaux */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.report-table th { padding: 8px; text-align: left; font-weight: 600; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.report-table td { padding: 10px 8px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.report-table tbody tr:hover { background: var(--gray-50); }
.report-table .num { text-align: right; }
.report-table .nowrap { white-space: nowrap; }
.table-strong { font-weight: 700; color: var(--gray-900); text-decoration: none; }
.table-sub { font-size: 13px; color: var(--gray-400); }
.mini-track { display: block; height: 4px; margin-top: 4px; margin-left: auto; width: 64px; border-radius: 2px; background: var(--gray-100); overflow: hidden; }
.mini-track > span { display: block; height: 100%; width: var(--w); background: var(--gray-700); }

.facts { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.facts dt { color: var(--gray-500); }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* La console a la place d'un écran d'ordinateur : plus large que les pages du club */
.container-wide.container-console { max-width: 1240px; }
@media (max-width: 820px) { .kpi-delta-hint { display: none; } }

/* ── Connexion (/login) ───────────────────────────────────────────────────────
   Un écran d'ouverture d'application : l'ensō se trace au pinceau, le sceau
   結び se pose comme un tampon, puis le nom et les boutons arrivent en fondu.
   Page seule à utiliser ces classes (auth/login.html) : l'inscription et les
   codes gardent .auth-page. Sur ordinateur (900 px et plus), l'ensō passe
   en blanc sur un panneau à l'encre (motif seigaiha), le formulaire à droite.

   Deux présentations, choisies par passkeys.js (classe sur .login) :
   - par défaut : formulaire, biométrie en dessous (si l'appareil sait faire) ;
   - .login--bio-first : biométrie en grand, formulaire derrière un bouton ;
     .login--form-open quand on l'a ouvert. */

.login-body { background: var(--paper); }
.login {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

/* L'ensō, le nom, la phrase */
.login-hero {
  flex-grow: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 0 24px; text-align: center;
}
.login-enso { position: relative; width: 168px; height: 168px; margin-bottom: 14px; }
.login-enso-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.login-enso-main, .login-enso-dry { fill: none; stroke: var(--gray-900); stroke-linecap: round; }
.login-enso-main { stroke-width: 11; stroke-dasharray: 440; stroke-dashoffset: 440;
                   animation: login-draw 1.15s cubic-bezier(.65,.05,.3,1) .2s forwards; }
.login-enso-dry  { stroke-width: 3; opacity: .35; stroke-dasharray: 440; stroke-dashoffset: 440;
                   animation: login-draw 1.25s cubic-bezier(.65,.05,.3,1) .28s forwards; }
/* Fond crème derrière le sceau : ses caractères sont évidés (musubi.svg), le
   trait de l'ensō se verrait sinon au travers. */
.login-seal { position: absolute; right: 2px; bottom: 4px; width: 30px; height: auto;
              background: var(--surface); border-radius: 3px;
              opacity: 0; animation: login-stamp .42s var(--ease-back) 1.25s forwards; }
.login-name { margin: 0; font-family: var(--font-serif); font-size: 34px; font-weight: 600; letter-spacing: .5px; }
.login-tagline { margin: 0; font-size: 15px; color: var(--gray-600); }

/* Les actions */
.login-panel { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.login-panel-head { display: none; }          /* titre « Connexion » : sur ordinateur seulement */
.login-panel .alert { margin-bottom: 0; }

.login-btn {
  position: relative; width: 100%; min-height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-sans); font-size: 16px; font-weight: 500; cursor: pointer;
  transition: transform .12s var(--ease-out), background-color .15s;
}
.login-btn:active { transform: scale(.98); }
.login-btn-dark, .login-btn-bio { background: var(--gray-900); color: var(--surface); border: none; }
.login-btn-dark:hover, .login-btn-bio:hover { background: var(--gray-800); }
.login-btn-outline { background: transparent; color: var(--gray-900); border: 1px solid var(--gray-300); }
.login-btn-outline:hover { border-color: var(--gray-500); }
.login-btn-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.login-btn:focus-visible, .login-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chargement : le bouton se change en petit ensō qui tourne */
.login-spinner, .login-btn-loading { display: none; }
.login-spinner { width: 20px; height: 20px; border-radius: 50%;
                 border: 2.4px solid currentColor; border-right-color: transparent;
                 animation: login-spin .9s linear infinite; }
.login-btn.is-loading { pointer-events: none; }
.login-btn.is-loading .login-spinner,
.login-btn.is-loading .login-btn-loading { display: inline-block; }
.login-btn.is-loading .login-btn-label,
.login-btn.is-loading .login-btn-icon { display: none; }
.login.is-loading .login-enso { animation: login-breath 1.6s ease-in-out infinite; }

.login-bio { display: flex; flex-direction: column; gap: 10px; }
.login-hint { margin: 0; text-align: center; font-size: 14px; color: var(--gray-600); }
.login-error { margin: 0; text-align: center; font-size: 14px; color: var(--accent-deep); }
.login-error:empty { display: none; }
.login-divider { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 14px; color: var(--gray-600); }
.login-divider::before, .login-divider::after { content: ""; flex-grow: 1; height: 1px; background: var(--gray-200); }

.login-form { display: flex; flex-direction: column; }
.login-form .login-btn { margin-top: 6px; }
.login-links { display: flex; justify-content: flex-end; align-items: center; margin-top: 12px; font-size: 14px; }
.login-links a { text-decoration: none; padding: 6px 0; }
.login-back { display: none; margin-right: auto; padding: 6px 0; border: none; background: none;
              font-family: var(--font-sans); font-size: 14px; color: var(--gray-600); cursor: pointer; }

.login-foot { display: flex; flex-direction: column; align-items: center; gap: 10px;
              padding-top: 14px; font-size: 14px; color: var(--gray-600); text-align: center; }
.login-foot p { margin: 0; }
.login-foot a { font-weight: 600; text-decoration: none; }
.login-legal { font-size: 13px; }
.login-legal a { font-weight: 400; }

/* La biométrie en premier : bouton « mot de passe » à la place du formulaire */
.login-show-form { display: none; }
.login--bio-first:not(.login--form-open) .login-show-form { display: flex; }
.login--bio-first .login-hint { display: none; }          /* la clé est déjà activée */
.login--bio-first:not(.login--form-open) .login-form,
.login--bio-first:not(.login--form-open) .login-divider { display: none; }
/* Formulaire ouvert : il remplace la biométrie, avec un « Retour » */
.login--bio-first.login--form-open .login-bio { display: none; }
.login--bio-first.login--form-open .login-form { animation: login-sheet .35s var(--ease-out); }
.login--bio-first.login--form-open .login-back { display: inline-block; }
/* Formulaire d'abord : la biométrie passe dessous, en bouton secondaire */
.login:not(.login--bio-first) .login-bio { order: 2; }
.login:not(.login--bio-first) .login-form { order: 1; }
.login:not(.login--bio-first) .login-foot { order: 3; }
.login:not(.login--bio-first) .login-btn-bio { background: transparent; color: var(--gray-900); border: 1px solid var(--gray-300); }
.login:not(.login--bio-first) .login-divider { order: -1; margin: 6px 0 2px; }

/* L'arrivée en fondu */
.login-rise { opacity: 0; transform: translateY(12px); animation: login-rise .6s var(--ease-out) forwards; }
.login-d1 { animation-delay: 1.45s; }
.login-d2 { animation-delay: 1.6s; }
.login-d3 { animation-delay: 1.75s; }

@keyframes login-draw  { to { stroke-dashoffset: 0; } }
@keyframes login-stamp { 0% { opacity: 0; transform: scale(1.5) rotate(-8deg); }
                         70% { opacity: 1; transform: scale(.94) rotate(2deg); }
                         100% { opacity: 1; transform: none; } }
@keyframes login-rise  { to { opacity: 1; transform: none; } }
@keyframes login-spin  { to { transform: rotate(360deg); } }
@keyframes login-breath { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.96); opacity: .75; } }
@keyframes login-sheet { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Ordinateur : panneau à l'encre à gauche, formulaire à droite */
@media (min-width: 900px) {
  .login { flex-direction: row; padding: 0; }
  .login-hero {
    flex: 1 1 0; padding: 48px; color: var(--surface);
    --wave: #2C2822; --ink: var(--gray-900);
    background-color: var(--ink);
    background-image:
      radial-gradient(circle at 100% 150%, var(--ink) 24%, var(--wave) 24% 28%, var(--ink) 28% 36%, var(--wave) 36% 40%, transparent 40%),
      radial-gradient(circle at 0 150%, var(--ink) 24%, var(--wave) 24% 28%, var(--ink) 28% 36%, var(--wave) 36% 40%, transparent 40%),
      radial-gradient(circle at 50% 100%, var(--wave) 10%, var(--ink) 10% 23%, var(--wave) 23% 30%, var(--ink) 30% 43%, var(--wave) 43% 50%, var(--ink) 50% 63%, var(--wave) 63% 71%, transparent 71%),
      radial-gradient(circle at 100% 50%, var(--wave) 5%, var(--ink) 5% 15%, var(--wave) 15% 20%, var(--ink) 20% 29%, var(--wave) 29% 34%, var(--ink) 34% 44%, var(--wave) 44% 49%, transparent 49%),
      radial-gradient(circle at 0 50%, var(--wave) 5%, var(--ink) 5% 15%, var(--wave) 15% 20%, var(--ink) 20% 29%, var(--wave) 29% 34%, var(--ink) 34% 44%, var(--wave) 44% 49%, transparent 49%);
    background-size: 56px 28px;
  }
  .login-enso { width: 230px; height: 230px; }
  .login-enso-main, .login-enso-dry { stroke: var(--surface); }
  .login-enso-dry { opacity: .3; }
  .login-seal { width: 40px; border-radius: 4px; }
  .login-name { font-size: 44px; }
  .login-tagline { font-size: 17px; color: #CFC6B5; }
  .login-panel { width: 520px; max-width: none; flex-shrink: 0; margin: 0; justify-content: center;
                 padding: 48px 72px; box-sizing: border-box; overflow-y: auto; }
  .login-panel-head { display: block; margin-bottom: 4px; }
  .login-panel-title { margin: 0; font-family: var(--font-serif); font-size: 30px; font-weight: 600; }
  .login-panel-subtitle { margin: 6px 0 0; font-size: 15px; color: var(--gray-600); }
  .login-foot { align-items: flex-start; text-align: left; }
}

/* « Réduire les animations » : tout s'affiche d'emblée, rien ne bouge */
@media (prefers-reduced-motion: reduce) {
  .login-enso-main, .login-enso-dry { animation: none; stroke-dashoffset: 0; }
  .login-seal, .login-rise { animation: none; opacity: 1; transform: none; }
  .login-spinner { animation-duration: 2.4s; }
  .login.is-loading .login-enso, .login--form-open .login-form { animation: none; }
}

/* ── Échéancier et vue du professeur (fees/_macros.html, registre « Suivi ») ── */
.schedule-next { font-weight: 600; margin: 4px 0 8px; }
.schedule-next.is-late { color: var(--red-600); }
.schedule-line.schedule-paid .fee-line-amount { color: var(--green-600); }
.schedule-line.schedule-late .fee-line-amount { color: var(--red-600); font-weight: 700; }
/* L'état sous chaque échéance : ce qui est validé et ce qui est en retard ressortent */
.schedule-state { color: var(--gray-500); }
.schedule-state-paid { color: var(--green-600); font-weight: 700; }
.schedule-state-late { color: var(--red-600); font-weight: 700; }
.schedule-state .glyph, .badge .glyph { width: 1em; height: 1em; vertical-align: -0.12em; }
.fee-pill { white-space: nowrap; }
/* Onglet « Suivi » du registre : une ligne par membre, même sur téléphone :
   le nom, la pastille de cotisation, le certificat. */
.member-list.followup .member-row,
.member-list.followup .member-row-head {
  grid-template-columns: minmax(0, 1fr) auto 64px;
  grid-template-areas: "person fee certificate";
}
.member-list.followup .member-row-head { display: grid; }
.member-list.followup .member-row-head span:nth-child(2) { grid-area: fee; }
.member-list.followup .member-row-head span:nth-child(3) { grid-area: certificate; text-align: right; }
.member-cell-fee { grid-area: fee; }
.member-list.followup .member-cell-certificate { justify-content: flex-end; }
.item-cash { padding: 0 0 8px; }
.item-cash > summary { list-style: none; display: inline-flex; }
.item-cash > summary::-webkit-details-marker { display: none; }

/* ══ Animations de la maquette (revue du 10/11/2026) ═══════════════════════
   Côté membres seulement ; tout se coupe avec « réduire les animations »
   (fin de ce bloc). Le JavaScript est dans static/js/motion-nav.js. */

/* 2. Le message qui glisse en bas et s'efface seul (« Réponse enregistrée ») */
.toast-zone { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 150;
              display: flex; justify-content: center; pointer-events: none; }
@media (min-width: 769px) { .toast-zone { bottom: 28px; } }
.toast {
  max-width: 420px; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 14px; background: var(--gray-900); color: #FFFDF8;
  font-size: 15px; box-shadow: 0 8px 24px rgba(30, 29, 27, .28);
  animation: toast-life 2.8s ease both;
}
.toast::before { content: ""; width: 18px; height: 18px; flex: none; background: #E7B9B1;
                 -webkit-mask: url("/static/icons/ui/check.svg") center / contain no-repeat;
                 mask: url("/static/icons/ui/check.svg") center / contain no-repeat; }
@keyframes toast-life {
  0% { opacity: 0; transform: translateY(24px); } 12% { opacity: 1; transform: none; }
  86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(12px); }
}

/* 3. La feuille de confirmation qui monte du bas (à la place de la boîte grise
      du navigateur) : <dialog class="sheet">, ouverte par motion-nav.js. */
.sheet {
  margin: auto auto 0; width: 100%; max-width: 520px; padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  border: none; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--gray-900);
  box-shadow: 0 -8px 30px rgba(30, 29, 27, .25);
}
.sheet[open] { animation: sheet-up .32s cubic-bezier(.2, .9, .2, 1) both; }
.sheet::backdrop { background: rgba(30, 29, 27, .5); animation: fade-in .25s ease both; }
.sheet-grip { display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 999px; background: var(--gray-300); }
.sheet-text { margin: 0 0 18px; font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.35; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.sheet-actions .btn { min-height: 52px; font-size: 16px; }
@media (min-width: 769px) { .sheet { margin: auto; border-radius: 20px; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in  { from { opacity: 0; } }

/* 4. Le sceau « Inscrit » qui se tamponne sur la fiche d'un stage */
.event-response { position: relative; }
.event-stamp {
  position: absolute; top: 12px; right: 12px; width: 70px; height: 70px; border-radius: 50%;
  border: 3px solid var(--accent); color: var(--accent); background: rgba(255, 253, 248, .85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  transform: rotate(-8deg); pointer-events: none;
}
.event-stamp .glyph { width: 22px; height: 22px; }
.event-stamp.is-new { animation: stamp-in .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes stamp-in {
  0% { opacity: 0; transform: scale(1.9) rotate(-22deg); }
  60% { opacity: 1; transform: scale(.92) rotate(-8deg); }
  100% { opacity: 1; transform: rotate(-8deg); }
}
.event-response .row-actions { padding-right: 84px; }

/* 5. Calendrier : le repère « Aujourd'hui » et les mois qui restent collés */
.today-mark { display: flex; align-items: center; gap: 10px; margin: 4px 0 -4px; }
.today-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none;
             animation: pulse 2.4s ease-in-out infinite; }
.today-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark, #8E2C21); }
.today-line { flex: 1; height: 1px; background: #E7B9B1; }
.month-card > .card-header { position: sticky; top: 0; z-index: 2; background: var(--surface);
                             border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* 6. La cloche qui s'anime quand une notification attend */
.notif-bell:has(.notif-dot) .icon { animation: bell-ring 1s ease-in-out .8s 1; transform-origin: 50% 10%; }
@keyframes bell-ring {
  0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: toast-still 2.8s steps(1) both; }
  .sheet[open], .sheet::backdrop, .event-stamp.is-new, .today-dot, .notif-bell:has(.notif-dot) .icon { animation: none; }
}
@keyframes toast-still { 0% { opacity: 1; } 100% { opacity: 0; } }


/* ── Espace Apprendre (module learning) ─────────────────────────────────────
   Même direction que l'accueil : bande à l'encre, papier clair, un seul accent
   vermillon, cartes qui montent doucement à l'arrivée (coupé par « réduire
   les animations »). */

/* Sélecteurs en pastilles dans la bande à l'encre (discipline, grade) */
.learn-pills { margin: 14px -24px 0; padding: 0 24px; flex-basis: calc(100% + 48px); }
.learn-pills .club-pill { display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
  line-height: 1.15; padding: 6px 14px; text-decoration: none; }
.learn-pill-level { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; font-weight: 600; }
.learn-seg { display: flex; padding: 4px; border-radius: 14px; background: rgba(255,253,248,.08);
  border: 1px solid rgba(255,253,248,.18); margin-top: 14px; flex-basis: 100%; }
.learn-seg a { flex: 1; text-align: center; padding: 10px 8px; border-radius: 10px; color: #EDE6D8;
  font-weight: 500; font-size: 15px; text-decoration: none; transition: background .2s, color .2s; }
.learn-seg a.active { background: #FFFDF8; color: var(--gray-900); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

.learn-page { display: flex; flex-direction: column; gap: 18px; }
.learn-page > * { animation: rise .5s var(--ease-out) both; }
.learn-page > *:nth-child(2) { animation-delay: .05s; }
.learn-page > *:nth-child(3) { animation-delay: .10s; }
.learn-page > *:nth-child(4) { animation-delay: .15s; }
.learn-page > *:nth-child(n+5) { animation-delay: .2s; }
.learn-eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gray-500); font-weight: 600; }
.learn-crumb { font-size: 13px; color: var(--gray-500); }
.learn-crumb a { color: var(--gray-600); }

/* Rubriques de l'accueil d'Apprendre */
.learn-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .learn-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.learn-tile { display: flex; flex-direction: column; gap: 10px; min-height: 120px; padding: 16px;
  background: var(--surface); border: 1px solid rgba(220,216,206,.7); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); color: inherit; text-decoration: none;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
a.learn-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
a.learn-tile:active { transform: scale(.98); }
.learn-tile .glyph { width: 26px; height: 26px; color: var(--accent); }
.learn-tile-name { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.15; }
.learn-tile-desc { font-size: 13px; color: var(--gray-500); line-height: 1.35; }
.learn-tile.is-soon { background: transparent; border-style: dashed; box-shadow: none; }
.learn-tile.is-soon .glyph { color: var(--gray-400); }
.learn-tile.is-soon .learn-tile-name { color: var(--gray-500); }

/* Terme du jour */
.learn-daily { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; text-decoration: none; color: inherit; }
.learn-daily-term { font-family: var(--font-serif); font-size: 24px; font-weight: 600; }
.learn-daily-kanji { font-family: var(--font-serif); font-size: 16px; color: var(--gray-400); margin-left: 8px; }
.learn-official { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); }
.learn-official::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }

/* Programme : une carte par matière, des lignes aérées */
.learn-me { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.learn-me-main { flex: 1; min-width: 0; }
.learn-me-grade { font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
.learn-me-sub { font-size: 13px; color: var(--gray-500); }
.learn-me-ok { color: var(--green-600); font-weight: 600; font-size: 13px; }
.learn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.learn-head h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin: 0; }
.learn-count { font-size: 13px; color: var(--gray-500); white-space: nowrap; }
.learn-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--gray-500); }
.learn-legend > span { display: inline-flex; align-items: center; gap: 6px; }
/* Délai minimum avant le grade : une ligne bien visible, icône d'horloge */
.learn-delay { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--gray-200); }
.learn-delay .glyph { flex: none; width: 22px; height: 22px; color: var(--accent); }
.learn-delay > span { display: flex; flex-direction: column; gap: 2px; }
.learn-delay-title { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--gray-600); }
.learn-delay-value { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--gray-900); }

/* Un thème : une carte repliable, repliée au départ */
.learn-toc { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.learn-toc::-webkit-scrollbar { display: none; }
.learn-toc-link { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--gray-200); background: var(--surface); color: var(--gray-800); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; }
.learn-toc-link:active, .learn-toc-link:hover { border-color: var(--accent); color: var(--accent-deep); }
.learn-themes { display: flex; flex-direction: column; gap: 12px; }
.learn-theme { background: var(--surface); border: 1px solid var(--gray-200); border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(28,26,23,.05), 0 4px 14px rgba(28,26,23,.04); scroll-margin-top: 90px; }
.learn-theme-head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px;
  min-height: 72px; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.learn-theme-head::-webkit-details-marker { display: none; }
.learn-theme-num { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--gray-900); color: #FFFDF8;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 17px; font-weight: 700; }
.learn-theme[open] .learn-theme-num { background: var(--accent); }
.learn-theme-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.learn-theme-name { font-family: var(--font-serif); font-size: 19px; font-weight: 700; line-height: 1.15; color: var(--gray-900); }
.learn-theme-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; font-weight: 500; color: var(--gray-600); }
.learn-theme-done { color: var(--green-600); font-weight: 600; }
.learn-theme-done::before { content: "·"; color: var(--gray-400); margin-right: 8px; font-weight: 400; }
.learn-theme-chev { flex: none; transform: rotate(90deg); transition: transform .2s var(--ease-out); opacity: .55; }
.learn-theme[open] .learn-theme-chev { transform: rotate(-90deg); }
.learn-theme-bar { height: 4px; background: var(--gray-100); }
.learn-theme-bar span { display: block; height: 100%; background: var(--green-600); transition: width .4s var(--ease-out); }
.learn-theme-body { border-top: 1px solid var(--gray-100); }
.learn-theme[open] .learn-theme-body { animation: learn-open .25s var(--ease-out); }
@keyframes learn-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.learn-item { display: flex; align-items: center; gap: 10px; padding: 14px 8px 14px 16px; min-height: 64px;
  border-bottom: 1px solid var(--gray-100); scroll-margin-top: 90px; }
.learn-item:last-child { border-bottom: 0; }
.learn-item-main { flex: 1; min-width: 0; }
.learn-item-name { font-weight: 700; font-size: 17px; line-height: 1.25; color: var(--gray-900); }
.learn-item-name a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--gray-400); }
.learn-item-name a:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }
.learn-item-meaning { font-size: 14px; color: var(--gray-700); margin-top: 3px; line-height: 1.35; }
.learn-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.learn-tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 9px; border-radius: 12px; background: var(--gray-50); color: var(--gray-700); border: 1px solid var(--gray-200); }
.learn-tag-attack { background: #EEF0F5; color: #2F3E66; border-color: transparent; }
.learn-tag-danger { background: var(--red-50); color: var(--red-600); border-color: transparent; }
.learn-tag-warn { background: var(--amber-50); color: #92400E; border-color: transparent; }
.learn-tag-ink { background: var(--gray-900); color: #FFFDF8; border-color: transparent; }

/* Un kata : frise de cercles numérotés reliés par un trait */
.learn-frise { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: frise; }
.learn-frise-step { counter-increment: frise; position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: 4px; padding: 4px 0 16px 46px; min-height: 34px; }
.learn-frise-step::before { content: counter(frise); position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  border-radius: 50%; border: 2px solid var(--gray-900); background: var(--surface); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--gray-900); }
.learn-frise-step:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--gray-200); }
.learn-frise-name { font-weight: 700; font-size: 16px; line-height: 1.25; color: var(--gray-900); padding-top: 3px; }
.learn-frise-name a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--gray-400); }
.learn-frise-meaning { font-size: 13px; color: var(--gray-700); line-height: 1.35; }
.learn-frise-group { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--accent-deep);
  padding: 2px 0 10px 46px; }
.learn-note { margin: 6px 0 0; font-size: 13px; color: var(--gray-500); line-height: 1.45; }
.learn-previous > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--gray-50); border-radius: var(--radius-lg); }
.learn-previous > summary::-webkit-details-marker { display: none; }
.learn-previous > summary .icon { transition: transform .2s; opacity: .5; }
.learn-previous[open] > summary .icon { transform: rotate(90deg); }
.learn-previous-body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.learn-source { font-size: 12px; color: var(--gray-400); line-height: 1.5; }

/* Carnet : pas vu (cercle), à revoir (ambre), acquis (vert) */
.learn-progress { display: flex; flex: none; padding: 3px; border-radius: 999px; background: var(--gray-50);
  border: 1px solid var(--gray-100); }
.learn-dot { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.learn-dot span { width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; opacity: .35;
  transition: opacity .15s, transform .2s var(--ease-back); }
.learn-dot.is-on { background: var(--surface); box-shadow: var(--shadow-sm); }
.learn-dot.is-on span { opacity: 1; transform: scale(1.2); }
.learn-dot-none span { border: 2px solid var(--gray-400); }
.learn-dot-review span { background: #D99A2B; }
.learn-dot-acquired span { background: var(--green-600); }
.learn-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.learn-legend .learn-dot { width: auto; height: auto; cursor: default; background: none; box-shadow: none; }
.learn-legend .learn-dot span { width: 10px; height: 10px; opacity: 1; transform: none; }

/* Lexique */
.learn-search { position: relative; }
.learn-search input { width: 100%; box-sizing: border-box; height: 52px; padding: 0 16px 0 46px; font-size: 16px;
  border-radius: 14px; border: 1px solid var(--gray-200); background: var(--surface); box-shadow: var(--shadow-sm); }
.learn-search input:focus { outline: none; border-color: var(--gray-900); }
.learn-search .glyph { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gray-500); }
.learn-cats { margin-bottom: 0; }
.learn-letter { position: sticky; top: 0; z-index: 1; font-family: var(--font-serif); font-size: 16px; font-weight: 700;
  color: var(--accent-deep); padding: 10px 16px 6px; background: var(--surface); border-bottom: 1px solid var(--gray-100); }
.learn-term-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 56px;
  border-bottom: 1px solid var(--gray-100); color: inherit; text-decoration: none; transition: background .15s; }
.learn-term-row:last-child { border-bottom: 0; }
.learn-term-row:hover { background: var(--gray-50); }
.learn-term-row .icon { opacity: .35; flex: none; }
.learn-term-name { font-weight: 600; font-size: 15px; }
.learn-term-kanji { font-family: var(--font-serif); color: var(--gray-400); margin-left: 6px; font-weight: 500; }
.learn-term-tr { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* Fiche d'un terme */
.learn-sheet { text-align: center; padding: 28px 20px 24px; position: relative; overflow: hidden; }
.learn-sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); }
.learn-sheet-kanji { font-family: var(--font-serif); font-size: 56px; line-height: 1; color: var(--gray-900); margin-bottom: 10px; }
.learn-sheet-term { font-family: var(--font-serif); font-size: 32px; font-weight: 600; line-height: 1.1; margin: 0; }
.learn-sheet-tr { font-size: 16px; color: var(--gray-600); margin: 10px auto 0; max-width: 34ch; line-height: 1.45; }
.learn-sheet-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.learn-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.learn-part { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; text-align: center;
  text-decoration: none; color: inherit; transition: transform .2s var(--ease-out), box-shadow .2s; }
.learn-part:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.learn-part-name { font-weight: 700; font-size: 15px; }
.learn-part-tr { font-size: 12px; color: var(--gray-500); }
.learn-use { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  color: inherit; text-decoration: none; }
.learn-use:last-child { border-bottom: 0; }
.learn-use .icon { opacity: .35; flex: none; }
.learn-grade-chip { flex: none; min-width: 64px; text-align: center; padding: 8px 6px; border-radius: 10px;
  background: var(--gray-900); color: #FFFDF8; font-family: var(--font-serif); font-weight: 600; font-size: 14px; line-height: 1.1; }
.learn-use-main { flex: 1; min-width: 0; }
.learn-use-title { font-weight: 600; font-size: 14px; }
.learn-use-sub { font-size: 13px; color: var(--gray-500); }

/* Carte « Vers le prochain grade » (accueil et accueil d'Apprendre) : à l'encre */
.learn-home { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 16px 18px;
  background: var(--gray-900); border-color: var(--gray-900); color: #F6F2EA; text-decoration: none;
  box-shadow: var(--shadow-md); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.learn-page .learn-home { margin-bottom: 0; }
.learn-home:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #F6F2EA; }
.learn-home:active { transform: scale(.98); }
.learn-home-ring { flex: none; }
.learn-home-track { stroke: rgba(255, 255, 255, .15); }
.learn-home-fill { stroke: #D9573F; stroke-dasharray: 0 100; animation: learn-ring .9s var(--ease-out) .25s forwards; }
@keyframes learn-ring { to { stroke-dasharray: var(--p) 100; } }
.learn-home-eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #C9BFAE; }
.learn-home-grade { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.learn-home-grade span { font-family: var(--font-sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #C9BFAE; }
.learn-home-sub { font-size: 14px; color: #C9BFAE; }
.learn-home-chevron { filter: invert(1); }

/* Fiche d'un terme : écritures variantes, source, traduction manquante */
.learn-sheet-tr.is-missing { font-style: italic; color: var(--gray-400); }
.learn-sheet-variants { font-size: 14px; color: var(--gray-600); margin: 6px 0 0; }
.learn-sheet-source { font-size: 12px; color: var(--gray-500); margin: 10px 0 0; }

/* ── Quiz ── */
.quiz-anon { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px 16px; }
.quiz-anon p { margin: 0; font-size: 14px; color: var(--gray-700); }
.quiz-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; color: inherit; text-decoration: none; }
.quiz-card-head { display: flex; align-items: center; gap: 14px; }
.quiz-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.quiz-card-name { font-family: var(--font-serif); font-size: 19px; font-weight: 600; color: var(--gray-900); }
.quiz-card-desc { font-size: 13px; color: var(--gray-600); line-height: 1.4; }
.quiz-card-count { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--accent-deep); }
.quiz-card-icon .glyph { width: 40px; height: 40px; color: var(--accent); }

.quiz-ring { flex: none; }
.quiz-ring-track { stroke: var(--gray-100); }
.quiz-ring-fill { stroke: var(--accent); stroke-dasharray: 0 100; animation: learn-ring .9s var(--ease-out) .2s forwards; }
.quiz-ring-text { font-size: 13px; font-weight: 700; fill: var(--gray-800); font-family: var(--font-sans); }

.quiz-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--gray-100); gap: 2px; }
.quiz-bar span { display: block; min-width: 4px; }
.quiz-bar-acquired, .quiz-dot-acquired { background: var(--green-600); }
.quiz-bar-write, .quiz-dot-write { background: #D99A2B; }
.quiz-bar-recognize, .quiz-dot-recognize { background: #6B7FA8; }
.quiz-bar-unseen, .quiz-dot-unseen { background: var(--gray-200); }
.quiz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--gray-600); }
.quiz-legend span { display: inline-flex; align-items: center; gap: 5px; }
.quiz-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

.quiz-stage { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 3px 9px; border-radius: 99px;
  background: var(--gray-100); color: var(--gray-600); }
.quiz-stage-recognize { background: #E6EAF3; color: #3E4F75; }
.quiz-stage-write { background: var(--amber-50); color: #8A5A0B; }
.quiz-stage-acquired { background: var(--green-50); color: var(--green-600); }

.quiz-title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; margin: 0; line-height: 1.2; }
.quiz-hero { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.quiz-hero-img { height: 220px; width: auto; max-width: 100%; display: block; align-self: center; }
.quiz-wide { width: 100%; justify-content: center; }

/* Le jeu */
.quiz-zone { display: flex; flex-direction: column; gap: 14px; }
.quiz-progress { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gray-500); }
.quiz-progress-bar { height: 4px; border-radius: 99px; background: var(--gray-200); overflow: hidden; }
.quiz-progress-bar span { display: block; height: 100%; background: var(--accent); transition: width .4s var(--ease-out); }
.quiz-card-q { display: flex; flex-direction: column; gap: 14px; padding: 16px; animation: quiz-in .35s var(--ease-out); }
@keyframes quiz-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.quiz-prompt { margin: 0; font-family: var(--font-serif); font-size: 21px; line-height: 1.3; color: var(--gray-900); }

/* Le dessin garde ses proportions et tient dans l'écran avec la question et les réponses */
.quiz-figure { position: relative; align-self: center; height: min(48vh, 480px); aspect-ratio: 300 / 460; max-width: 100%; }
.quiz-figure-small { height: min(34vh, 320px); }     /* après la réponse : la place va au retour */
.quiz-figure-img { width: 100%; height: 100%; display: block; }
.quiz-point { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); padding: 0; }
.quiz-point-ask { background: var(--accent); animation: quiz-pulse 1.4s ease-in-out infinite; }
.quiz-point-pick { background: var(--gray-900); cursor: pointer; }
.quiz-point-pick:active, .quiz-point-pick:hover { background: var(--accent); transform: scale(1.15); }
.quiz-point-right { background: var(--green-600); }
.quiz-point-wrong { background: var(--red-600); }
@keyframes quiz-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179,58,44,.55), 0 1px 4px rgba(0,0,0,.35); }
  50% { box-shadow: 0 0 0 9px rgba(179,58,44,0), 0 1px 4px rgba(0,0,0,.35); } }

.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-choice { min-height: 52px; padding: 10px; border-radius: var(--radius); border: 1.5px solid var(--gray-200);
  background: var(--surface); font: 600 16px var(--font-sans); color: var(--gray-900); cursor: pointer; }
.quiz-choice:active, .quiz-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.quiz-write { display: flex; gap: 8px; }
.quiz-write input { flex: 1; min-width: 0; font-size: 18px; padding: 12px 14px; border-radius: var(--radius);
  border: 1.5px solid var(--gray-300); background: var(--surface); }
.quiz-write input:focus { outline: none; border-color: var(--accent); }

.quiz-feedback { border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.quiz-feedback.is-right { background: var(--green-50); }
.quiz-feedback.is-wrong { background: var(--red-50); }
.quiz-feedback-title { font-weight: 700; font-size: 15px; }
.quiz-feedback.is-right .quiz-feedback-title { color: var(--green-600); }
.quiz-feedback.is-wrong .quiz-feedback-title { color: var(--accent-deep); }
.quiz-answer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.quiz-answer-label { font-size: 13px; color: var(--gray-600); width: 100%; }
.quiz-answer-term { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--gray-900); }
.quiz-answer-tr { font-size: 14px; color: var(--gray-700); }
.quiz-change { font-size: 13px; font-weight: 700; padding-top: 2px; }
.quiz-change-write, .quiz-change-acquired { color: var(--green-600); }
.quiz-change-down_write, .quiz-change-down_recognize { color: #8A5A0B; }
.quiz-next { display: flex; flex-direction: column; gap: 8px; }
.quiz-copy-label { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.quiz-copy-error { font-size: 13px; color: var(--accent-deep); }

.quiz-result { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px; align-items: stretch; text-align: center; }
.quiz-score { font-family: var(--font-serif); font-size: 44px; font-weight: 600; line-height: 1; color: var(--gray-900); }
.quiz-mark { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 700; margin-right: 10px; }
.quiz-mark.is-right { background: var(--green-50); color: var(--green-600); }
.quiz-mark.is-wrong { background: var(--red-50); color: var(--red-600); }
.quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-actions .btn { flex: 1; justify-content: center; }

/* Éditeur de programme */
.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; }
.learn-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.learn-grid th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500);
  text-align: center; padding: 10px 6px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.learn-grid td { border-bottom: 1px solid var(--gray-100); padding: 8px 6px; vertical-align: middle; }
.learn-grid .learn-grid-name { text-align: left; min-width: 200px; }
.learn-grid-family td { background: var(--gray-50); font-family: var(--font-serif); font-weight: 600; font-size: 15px; }
.learn-grid-cell { text-align: center; }
.learn-cell-in, .learn-cell-ch { display: inline-block; min-width: 22px; font-size: 10px; font-weight: 600;
  padding: 4px 6px; border-radius: 6px; line-height: 1; }
.learn-cell-in { background: var(--gray-900); color: #FFFDF8; }
.learn-cell-ch { border: 1.5px solid var(--accent); color: var(--accent-deep); }
.learn-cell-cu { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gray-300, #C9BFAE); }
.learn-grid-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.learn-manage-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
