/* ============================================================================
   fiche-membre.css — la fiche membre publique (/membre/{pseudo}/), refonte du 15/09/2026.
   Layer : modules. Injecté via extraCssFiles par app/modules/fiche-membre/module.php,
   APRÈS amitie.css (le bloc des boutons amis / message garde ses classes .fm-actions,
   .fm-friends-count, .fm-actions-note, .fm-message-wrap : amitie.css les pose, cette
   feuille les place dans le nouvel en-tête).

   Maquette B « onglets façon Facebook », choisie par Xavier le 15/09/2026 : un en-tête
   (avatar avec le voyant de présence, pseudo, place du badge, boutons, trois tuiles de
   résumé), quatre onglets en CSS pur (radios, comme le sélecteur Tiercé / Quarté / Quinté
   d'avant), des cartes. Téléphone (≤ 979 px, la définition « mobile » du site) façon
   Facebook : fond #f0f2f5, blocs blancs carrés bord à bord, 8 px de gris entre eux (la
   recette du Direct, direct.css). Tailles 14,5 / 13,5 / 17 (comme /direct/), champs à 16 px,
   cibles de 44 px, arrondi 6 px des tokens. Icônes en trait (style Lucide), jamais d'emoji.

   Hooks pour le designer (BEM, stables) :
     .fm-page > .fm-radio ×4 · .fm-carte (+ --tete)
     .fm-tete > .fm-avatar (.fm-presence-dot), .fm-identite (.fm-nom > .fm-pseudo, .fm-badge-slot,
       .fm-role · .fm-meta > .fm-meta__item · .fm-bio · .fm-edit-liens), .fm-actions (amitie.css)
     .fm-resume > .fm-tuile (__ico, __txt) · .fm-onglets > .fm-onglet (+ --profil…, __n)
     .fm-panneau (+ --profil, --concours, --pronos, --coms) · .fm-titre (__sub) · .fm-sur
     .fm-lbl / .fm-val / .fm-sub · .fm-lien · .fm-empty
     .fm-ligue > .fm-ecusson (+ --k0…--kN, --grand, --vert), __corps (__nom, __place, .fm-zone
       (+ --monte / --descend / --reste), __note), __cote > .fm-info
     .fm-apropos > __ligne
     .fm-cc (__corps, __place, __pts, __btn) · .fm-h3 (+ --nav, __sub) · .fm-h4
     .fm-trs > .fm-tr (+ --tierce / --quarte / --quinte ; __nom, __n, __barre, __pct, __12)
     .fm-bases > .fm-base · .fm-nav (__grp, __fl, __per) · .fm-sel-wrap > .fm-sel
     .fm-graphe (dessiné par fiche-membre.js) · .fm-legende (__i, .fm-leg) · .fm-m12 > __k
     .fm-historique
     .fm-tk (__date, __corps, __titre, __sub, __ligne, __lbl, __chips, __voir, __vide)
     .fm-ch (+ --win / --place / --in / --np / --rempl)
     .fm-res (+ --quinte / --quarte / --tierce / --none / --avenir / --annulee)
     .fm-pag (__txt, __fl, __n, __pts, __suiv)
     .fm-coms > .fm-com (__txt, __meta, __ou (+ --course / --direct / --sujet), __quand, __pouce, __voir)
     Onglet Amis (23/10/2026, soi et l'équipe seulement) : .fm-onglets--cinq · .fm-lien-amis
     .fm-amis (__entete, __nb, __cherche, __prive, __groupe (__point), __liste, __vide, __aucun, __plus-amis)
     .fm-ami (__photo, __init, __point, __txt, __nom, __pseudo, __role, __vu (+ --en-ligne), __msg (__msg-txt),
       __plus, __menu, __menu-item)
   Hooks JS (data-*, jamais des classes) : data-fm-page, data-fm-radio, data-fm-onglet,
     data-fm-panneau, data-fm-liste, data-fm-pagination, data-fm-graphe, data-fm-graphes (JSON),
     data-fm-nav (-avant, -apres, -periode, -fenetre), data-fm-amis (-recherche, -groupe, -vide,
     -aucun, -plus), data-fm-ami (+ data-pseudo), data-fm-ami-plus, data-fm-ami-menu, data-fm-vers-amis.
   ============================================================================ */

@layer modules {

  .fm-page {
    /* Tailles du site (comme /direct/) */
    --fm-texte: 14.5px;
    --fm-meta: 13.5px;
    --fm-petit: 12.5px;
    --fm-titre: 17px;
    /* Couleurs : les tokens, puis les valeurs locales que le site n'a pas en token */
    --fm-t: var(--color-text, #132033);
    --fm-m: var(--color-text-muted, #5f6d82);
    --fm-l: var(--color-border, #dce3ec);
    --fm-v: var(--color-success, #0d7a4a);
    --fm-vf: var(--color-success-soft, #ecfdf3);
    --fm-b: #0066cc; /* le bleu de la base placée : local, jamais --color-brand (vert dans le thème hippique — revue Codex 15/09/2026) */
    --fm-bf: #eaf3ff;
    --fm-r: var(--color-danger, #c62828);
    --fm-rf: var(--color-danger-soft, #fdecec);
    --fm-jf: var(--color-warning-soft, #fff7db);
    --fm-filet: #eef2f7;
    --fm-fond-doux: #f5f7fa;
    --fm-gris-bouton: #e4e6eb; /* le gris des boutons de Facebook */
    --fm-fond-mobile: #f0f2f5; /* le gris de fond de Facebook, tel quel */
    --fm-en-ligne: #31a24c; /* le vert « en ligne » de Facebook, celui du voyant de l'en-tête */
    --fm-en-ligne-texte: #2e7d32; /* le même vert, plus foncé pour un texte (contraste) */
    --fm-vert-clair: #9ccbb2; /* les barres sous la moyenne */
    --fm-or: #d9a400;
    --fm-or-fond: #fff7db;
    --fm-argent: #8e99a8;
    --fm-argent-fond: #eef1f5;
    --fm-bronze: #b8732e;
    --fm-bronze-fond: #f6e9dc;
    --fm-rayon: var(--radius-md, 6px);
    font-family: var(--font-family-sans, 'Arimo', Arial, sans-serif);
    color: var(--fm-t);
    font-size: var(--fm-texte);
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 12px);
  }

  .fm-page *,
  .fm-page *::before,
  .fm-page *::after {
    box-sizing: border-box;
  }

  /* Pas de règle « .fm-page a » : elle battrait la couleur de chaque lien nommé (.fm-lien,
     .fm-edit-link, .fm-owner-banner-cta…) — le bouton « Modifier mon profil » sortait vert sur
     vert (Xavier 15/09/2026). app.css pose déjà « a { color: inherit } » pour les liens nus. */

  .fm-page sup {
    font-size: 0.62em;
    vertical-align: super;
    line-height: 0;
  }

  .fm-ico {
    flex: none;
    vertical-align: -3px;
  }

  .fm-carte {
    background: var(--color-surface, #fff);
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    padding: 18px 20px;
  }

  .fm-carte--tete {
    padding: 20px 20px 0;
  }

  .fm-titre {
    margin: 0 0 12px;
    font-size: var(--fm-titre);
    font-weight: 800;
    line-height: 1.2;
    color: var(--fm-t);
  }

  .fm-titre__sub,
  .fm-h3__sub {
    font-size: var(--fm-meta);
    font-weight: 400;
    color: var(--fm-m);
    margin-left: 6px;
  }

  .fm-sur,
  .fm-lbl {
    margin: 0 0 2px;
    font-size: var(--fm-petit);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fm-m);
  }

  .fm-val {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
  }

  .fm-sub {
    margin: 2px 0 0;
    font-size: var(--fm-meta);
    color: var(--fm-m);
  }

  .fm-lien {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    margin-top: 6px;
    font-weight: 700;
    color: var(--fm-v);
    text-decoration: none;
  }

  .fm-lien:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .fm-empty {
    margin: 0;
    color: var(--fm-m);
    font-style: italic;
  }

  .fm-edit-link {
    padding: 15px 0; /* en ligne : une zone de clic de 44 px sans grandir la ligne */
    color: var(--fm-v);
    font-weight: 700;
    text-decoration: none;
  }

  .fm-edit-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* ── Bandeau du propriétaire ── */
  .fm-owner-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3, 12px);
    margin: 0 0 16px;
    padding: 10px 14px;
    background: var(--fm-vf);
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    color: var(--fm-v);
    font-size: var(--fm-meta);
  }

  .fm-owner-banner-cta {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--fm-rayon);
    background: var(--fm-v);
    color: var(--color-text-inverse, #fff);
    font-weight: 700;
    text-decoration: none;
  }

  /* ── En-tête : avatar, identité, boutons ── */
  .fm-tete {
    display: flex;
    gap: 18px;
    align-items: flex-start;
  }

  .fm-avatar {
    position: relative;
    flex: none;
    width: 96px;
    height: 96px;
  }

  .fm-avatar img,
  .fm-avatar__initiale {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-surface, #fff);
    box-shadow: 0 0 0 1px var(--fm-l);
    background: var(--fm-fond-doux);
    color: var(--fm-v);
    font-size: 36px;
    font-weight: 800;
  }

  /* Sans photo : lettre grise sur rond gris clair, comme le Direct, l'accueil,
     le concours et l'app (Xavier 28/10/2026) — avant, une lettre verte. La photo
     garde son fond d'avant (il se voit derrière une photo transparente). */
  .fm-avatar__initiale {
    background: var(--color-surface-soft, #f8fafc);
    color: var(--fm-m);
  }

  .fm-presence-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--color-surface, #fff);
    background: #9aa5b4;
  }

  .fm-presence-dot--on {
    background: #31a24c; /* le vert « en ligne » de Facebook */
  }

  .fm-identite {
    flex: 1 1 auto;
    min-width: 0;
  }

  .fm-nom {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 4px;
  }

  .fm-page .fm-pseudo {
    margin: 0;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
  }

  .fm-badge-slot:empty {
    display: none;
  }

  .fm-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--fm-rayon);
    background: var(--color-warning-soft, #fff1e6);
    color: #9a4a00;
    font-size: var(--fm-petit);
    font-weight: 700;
  }

  .fm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0 0 8px;
    font-size: var(--fm-meta);
    color: var(--fm-m);
  }

  .fm-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
  }

  .fm-presence-dot-inline {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9aa5b4;
    display: inline-block;
  }

  .fm-presence-on .fm-presence-dot-inline {
    background: #31a24c;
  }

  .fm-presence-sep {
    color: var(--fm-l);
  }

  .fm-presence-link {
    color: var(--fm-v);
    font-weight: 700;
    text-decoration: none;
  }

  .fm-presence-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .fm-bio {
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .fm-edit-liens {
    margin: 8px 0 0;
    font-size: var(--fm-meta);
  }

  /* Les boutons amis / message : la colonne de droite, 44 px de haut, pleine largeur */
  .fm-tete .fm-actions {
    flex: none;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    width: 220px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .fm-tete .fm-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: var(--fm-rayon);
    font-size: var(--fm-texte);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
  }

  /* Le bouton principal : le vert du site, posé ici pour ne dépendre d'aucun thème */
  .fm-tete .fm-actions .btn--primary:not([disabled]) {
    background: var(--fm-v);
    border-color: var(--fm-v);
    color: var(--color-text-inverse, #fff);
  }

  .fm-tete .fm-actions .btn--danger {
    background: var(--fm-gris-bouton);
    border-color: var(--fm-gris-bouton);
    color: var(--fm-r);
  }

  .fm-libelle-court {
    display: none;
  }

  .fm-tete .fm-actions .btn--ghost {
    background: var(--fm-gris-bouton);
    border-color: var(--fm-gris-bouton);
    color: var(--fm-t);
  }

  .fm-tete .fm-message-wrap {
    display: flex;
  }

  .fm-tete .fm-message-wrap .btn {
    width: 100%;
  }

  .fm-actions-duo {
    display: flex;
    gap: 8px;
  }

  /* « Écrire à la modération » (26/10/2026) : un formulaire (POST + CSRF) ; son bouton prend toute la largeur */
  .fm-tete .fm-moderation {
    display: flex;
    margin: 0;
  }

  .fm-actions-duo .btn {
    flex: 1 1 0;
  }

  .fm-tete .fm-actions-note {
    margin: -2px 0 0;
    font-size: var(--fm-petit);
    color: var(--fm-m);
    text-align: center;
    line-height: 1.3;
  }

  .fm-tete .fm-actions-note--haut {
    margin: 0 0 2px;
    font-weight: 700;
    color: var(--fm-t);
  }

  .fm-tete .fm-friends-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 2px 0 0;
    font-size: var(--fm-meta);
    color: var(--fm-m);
  }

  .fm-tete .fm-friends-count strong {
    margin: 0;
    color: var(--fm-t);
    font-weight: 800;
  }

  /* ── Les tuiles de résumé (un clic ouvre l'onglet) ── */
  .fm-resume {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 18px 0 0;
    padding: 16px 0 4px;
    border-top: 1px solid var(--fm-l);
  }

  .fm-tuile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 10px;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    background: #fbfcfd;
    color: var(--fm-t);
    cursor: pointer;
    user-select: none;
  }

  .fm-tuile:hover {
    background: #f3f6f9;
  }

  .fm-tuile__txt {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
  }

  .fm-tuile__txt b {
    font-size: var(--fm-texte);
    font-weight: 800;
  }

  .fm-tuile__txt small {
    font-size: var(--fm-petit);
    color: var(--fm-m);
  }

  .fm-tuile > .fm-ico:last-child {
    color: #9aa5b4;
  }

  .fm-tuile__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--fm-vf);
    color: var(--fm-v);
  }

  /* ── L'écusson de ligue (repris de /ligue/ : le numéro dans un rond) ── */
  .fm-ecusson {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid var(--fm-argent);
    background: var(--fm-argent-fond);
    color: var(--fm-t);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
  }

  .fm-ecusson--k1 { border-color: var(--fm-or); background: var(--fm-or-fond); }
  .fm-ecusson--k2 { border-color: var(--fm-argent); background: var(--fm-argent-fond); }
  .fm-ecusson--k3 { border-color: var(--fm-bronze); background: var(--fm-bronze-fond); }
  .fm-ecusson--k0 { border-style: dashed; border-color: #cfd6df; background: var(--color-surface, #fff); color: var(--fm-m); }

  .fm-ecusson--grand {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .fm-ecusson--vert {
    border-color: var(--fm-v);
    background: var(--fm-vf);
    color: var(--fm-v);
  }

  .fm-ecusson--vert sup {
    font-size: 0.5em;
  }

  .fm-ecusson--attente {
    border-style: dashed;
  }

  /* ── Les onglets (CSS pur : quatre radios en tête de .fm-page) ── */
  .fm-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .fm-onglets {
    display: flex;
    gap: 4px;
    margin: 12px -20px 0;
    padding: 0 12px;
    border-top: 1px solid var(--fm-l);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .fm-onglet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 14px;
    font-size: var(--fm-texte);
    font-weight: 700;
    color: var(--fm-m);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
  }

  .fm-onglet:hover {
    color: var(--fm-t);
  }

  .fm-onglet__n {
    font-size: var(--fm-petit);
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--fm-filet);
    color: var(--fm-m);
  }

  .fm-panneau {
    display: none;
    flex-direction: column;
    gap: var(--space-3, 12px);
  }

  #fm-t-profil:checked ~ .fm-carte--tete .fm-onglet--profil,
  #fm-t-concours:checked ~ .fm-carte--tete .fm-onglet--concours,
  #fm-t-pronos:checked ~ .fm-carte--tete .fm-onglet--pronos,
  #fm-t-coms:checked ~ .fm-carte--tete .fm-onglet--coms {
    color: var(--fm-v);
    border-bottom-color: var(--fm-v);
  }

  #fm-t-profil:checked ~ .fm-panneau--profil,
  #fm-t-concours:checked ~ .fm-panneau--concours,
  #fm-t-pronos:checked ~ .fm-panneau--pronos,
  #fm-t-coms:checked ~ .fm-panneau--coms {
    display: flex;
  }

  /* Le focus clavier sur la radio se voit sur SON onglet (avant le 23/10/2026, la radio qui avait la main entourait
     les quatre onglets à la fois) */
  #fm-t-profil:focus-visible ~ .fm-carte--tete .fm-onglet--profil,
  #fm-t-concours:focus-visible ~ .fm-carte--tete .fm-onglet--concours,
  #fm-t-pronos:focus-visible ~ .fm-carte--tete .fm-onglet--pronos,
  #fm-t-coms:focus-visible ~ .fm-carte--tete .fm-onglet--coms {
    outline: 2px solid var(--fm-b);
    outline-offset: -2px;
  }

  /* ── Carte Ligue ── */
  .fm-ligue {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .fm-ligue__corps {
    flex: 1 1 auto;
    min-width: 0;
  }

  .fm-ligue__nom {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
  }

  .fm-ligue__place {
    margin: 0 0 8px;
    font-size: var(--fm-texte);
    color: var(--fm-m);
  }

  .fm-ligue__place strong {
    font-size: var(--fm-titre);
    color: var(--fm-t);
  }

  .fm-ligue__note {
    margin: 8px 0 0;
    font-size: var(--fm-meta);
    color: var(--fm-m);
  }

  .fm-zone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 10px;
    border-radius: var(--fm-rayon);
    font-size: var(--fm-meta);
    font-weight: 700;
  }

  .fm-zone--reste { background: #f0f3f6; color: #3c4a5c; }
  .fm-zone--monte { background: var(--fm-vf); color: var(--fm-v); }
  .fm-zone--descend { background: var(--fm-rf); color: var(--fm-r); }

  .fm-ligue__cote {
    flex: 0 0 220px;
    padding: 4px 0 4px 20px;
    border-left: 1px solid var(--fm-l);
  }

  .fm-info + .fm-info {
    margin-top: 12px;
  }

  /* ── Carte À propos ── */
  .fm-apropos {
    margin: 0;
  }

  .fm-apropos__ligne {
    display: flex;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--fm-filet);
  }

  .fm-apropos__ligne:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .fm-apropos dt {
    flex: 0 0 150px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fm-m);
    font-size: var(--fm-meta);
  }

  .fm-apropos dd {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
  }

  /* ── La carte de la commune (OpenStreetMap, cadrée sur la commune entière) ── */
  .fm-carte-ville {
    margin-top: 12px;
  }

  .fm-page .fm-carte-ville__cadre {
    display: block;
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    background: #e9eef2; /* le gris des fonds de carte, le temps que les tuiles arrivent */
    text-decoration: none;
    touch-action: none; /* le doigt déplace la carte, pas la page (comme toutes les cartes) */
    user-select: none;
  }

  .fm-page .fm-carte-ville__cadre.is-mobile {
    cursor: grab;
  }

  .fm-page .fm-carte-ville__cadre.is-mobile:active {
    cursor: grabbing;
  }

  /* Les boutons connus de toutes les cartes : + et − en haut à droite, 44 px */
  .fm-carte-ville__zooms {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    border: 1px solid #b9c3cf;
    border-radius: var(--fm-rayon);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(19, 32, 51, 0.2);
  }

  .fm-carte-ville__zooms[hidden] {
    display: none;
  }

  .fm-carte-ville__zoom {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: #fff;
    color: var(--fm-t);
    font: 700 24px/1 var(--font-family-sans, 'Arimo', Arial, sans-serif);
    cursor: pointer;
  }

  .fm-carte-ville__zoom + .fm-carte-ville__zoom {
    border-top: 1px solid #d5dce5;
  }

  .fm-carte-ville__zoom:hover {
    background: var(--fm-fond-doux);
  }

  .fm-carte-ville__zoom[disabled] {
    color: #c3cbd6;
    cursor: default;
  }

  /* La grille de tuiles : son coin est décalé (marges négatives) pour que le centre de la commune
     tombe au milieu du cadre ; les tuiles hors du cadre sont coupées par overflow: hidden */
  .fm-carte-ville__grille {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
  }

  .fm-carte-ville__tuile {
    position: absolute;
    width: 256px;
    height: 256px;
    max-width: none;
    display: block;
  }

  .fm-carte-ville__marque {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -100%);
    line-height: 0;
    filter: drop-shadow(0 2px 2px rgba(19, 32, 51, 0.35));
  }

  .fm-carte-ville__nom {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: var(--fm-rayon);
    background: rgba(255, 255, 255, 0.92);
    color: var(--fm-t);
    font-size: var(--fm-meta);
    font-weight: 700;
  }

  .fm-carte-ville__credit {
    color: inherit;
    text-decoration: none;
  }

  .fm-carte-ville__credit:hover {
    text-decoration: underline;
  }

  .fm-carte-ville__sous {
    margin: 6px 0 0;
    font-size: var(--fm-petit);
    color: var(--fm-m);
  }

  /* ── Carte Concours ── */
  .fm-h3 {
    margin: 22px 0 10px;
    padding-top: 16px;
    border-top: 1px solid var(--fm-filet);
    font-size: 15px;
    font-weight: 800;
  }

  .fm-h4 {
    margin: 14px 0 6px;
    font-size: var(--fm-texte);
    font-weight: 700;
  }

  .fm-cc {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 4px 0 2px;
  }

  .fm-cc__corps {
    flex: 1 1 auto;
    min-width: 0;
  }

  .fm-cc__place {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
  }

  .fm-cc__pts {
    margin: 0;
    font-size: var(--fm-texte);
    color: var(--fm-m);
  }

  .fm-cc__pts strong {
    color: var(--fm-t);
  }

  .fm-page .fm-cc__btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--fm-rayon);
    background: var(--fm-gris-bouton);
    border-color: var(--fm-gris-bouton);
    color: var(--fm-t);
    font-size: var(--fm-texte);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }

  .fm-trs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .fm-tr {
    border: 1px solid var(--fm-l);
    border-top-width: 4px;
    border-radius: var(--fm-rayon);
    padding: 12px 14px;
  }

  .fm-tr--tierce { border-top-color: var(--fm-v); }
  .fm-tr--quarte { border-top-color: var(--fm-b); }
  .fm-tr--quinte { border-top-color: var(--fm-r); }

  .fm-tr__nom {
    font-size: var(--fm-meta);
    font-weight: 700;
    color: var(--fm-m);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .fm-tr__n {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0 6px;
  }

  .fm-tr__n small {
    font-size: var(--fm-texte);
    font-weight: 400;
    color: var(--fm-m);
  }

  .fm-tr__barre {
    height: 6px;
    border-radius: 3px;
    background: var(--fm-filet);
    overflow: hidden;
  }

  .fm-tr__barre i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--fm-v);
  }

  .fm-tr--quarte .fm-tr__barre i { background: var(--fm-b); }
  .fm-tr--quinte .fm-tr__barre i { background: var(--fm-r); }

  .fm-tr__pct {
    margin-top: 6px;
    font-size: var(--fm-texte);
    font-weight: 700;
  }

  .fm-tr__12 {
    margin-top: 2px;
    font-size: var(--fm-petit);
    color: var(--fm-m);
  }

  .fm-bases {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
  }

  .fm-base {
    flex: 1 1 200px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 9px 12px;
    border-radius: var(--fm-rayon);
    background: var(--fm-fond-doux);
    font-size: 14px;
    color: var(--fm-m);
  }

  .fm-base b {
    color: var(--fm-t);
  }

  .fm-base em {
    margin-left: auto;
    font-style: normal;
    font-weight: 800;
    color: var(--fm-t);
  }

  /* La navigation du graphique : flèches + période + liste (Xavier 15/09/2026) */
  .fm-h3--nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .fm-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .fm-nav__grp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .fm-nav__fl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    color: var(--fm-t);
    background: var(--color-surface, #fff);
    cursor: pointer;
    font: inherit;
  }

  .fm-nav__fl:hover {
    background: var(--fm-fond-doux);
  }

  .fm-nav__fl[disabled] {
    color: #c3cbd6;
    cursor: default;
    background: var(--color-surface, #fff);
  }

  .fm-nav__per {
    font-size: var(--fm-meta);
    font-weight: 400;
    color: var(--fm-m);
    min-width: 150px;
    text-align: center;
  }

  .fm-sel-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }

  .fm-sel-wrap .fm-ico {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: var(--fm-m);
  }

  .fm-sel {
    appearance: none;
    -webkit-appearance: none;
    height: 44px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    background: var(--color-surface, #fff);
    font: 700 var(--fm-texte) var(--font-family-sans, 'Arimo', Arial, sans-serif);
    color: var(--fm-t);
    cursor: pointer;
  }

  .fm-graphe {
    display: block;
    width: 100%;
    min-height: 60px;
  }

  .fm-graphe svg {
    display: block;
    width: 100%;
    height: auto;
    font-family: var(--font-family-sans, 'Arimo', Arial, sans-serif);
  }

  .fm-graphe__sans {
    margin: 0;
    padding: 12px;
    font-size: var(--fm-meta);
    color: var(--fm-m);
    background: var(--fm-fond-doux);
    border-radius: var(--fm-rayon);
  }

  .fm-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
    margin: 6px 0 0;
    font-size: var(--fm-petit);
    color: var(--fm-m);
  }

  .fm-legende--haut {
    margin: -4px 0 12px;
  }

  .fm-legende__i {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
  }

  .fm-legende__i .fm-ch {
    margin: 0;
  }

  .fm-legende__i[hidden] {
    display: none; /* l'attribut hidden doit battre le display:inline-flex du dessus */
  }

  .fm-leg {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 2px;
    vertical-align: -1px;
  }

  .fm-leg--fort { background: var(--fm-v); }
  .fm-leg--faible { background: var(--fm-vert-clair); }
  .fm-leg--moy { height: 0; width: 16px; border-top: 2px dashed var(--fm-or); border-radius: 0; }

  .fm-m12 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 0 6px;
  }

  .fm-m12__k {
    padding: 10px 12px;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .fm-m12__k b {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
  }

  .fm-m12__k span {
    font-size: var(--fm-petit);
    color: var(--fm-m);
  }

  .fm-historique {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--fm-filet);
    font-size: var(--fm-meta);
    color: var(--fm-m);
  }

  .fm-historique b {
    color: var(--fm-t);
  }

  /* ── Les tickets de pronostic ── */
  .fm-ch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--fm-rayon);
    border: 1px solid #cfd6df;
    background: var(--color-surface, #fff);
    font-size: var(--fm-meta);
    font-weight: 700;
    color: var(--fm-t);
    margin: 0 4px 4px 0;
    line-height: 1;
  }

  .fm-ch--in { border-color: var(--fm-v); background: var(--fm-vf); color: var(--fm-v); }
  .fm-ch--win { border-color: var(--fm-v); background: var(--fm-v); color: #fff; }
  .fm-ch--place { border-color: var(--fm-b); background: var(--fm-b); color: #fff; }
  .fm-ch--np { border-style: dashed; color: #9aa5b4; text-decoration: line-through; }
  .fm-ch--rempl { border-color: #e08a2e; color: #9a4a00; background: #fff4e8; width: auto; padding: 0 6px; }

  .fm-tk {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-top: 1px solid var(--fm-filet);
  }

  .fm-tk__date {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: var(--fm-rayon);
    background: var(--fm-fond-doux);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .fm-tk__date b {
    font-size: 18px;
    font-weight: 800;
  }

  .fm-tk__date span {
    font-size: var(--fm-petit);
    color: var(--fm-m);
    margin-top: 2px;
  }

  .fm-tk__corps {
    flex: 1 1 auto;
    min-width: 0;
  }

  .fm-tk__titre {
    font-size: var(--fm-texte);
    font-weight: 800;
    line-height: 1.25;
  }

  .fm-tk__sub {
    font-size: var(--fm-petit);
    color: var(--fm-m);
    margin: 1px 0 8px;
  }

  .fm-tk__ligne {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 2px;
  }

  .fm-tk__lbl {
    flex: none;
    width: 68px;
    font-size: var(--fm-petit);
    color: var(--fm-m);
    line-height: 28px;
  }

  .fm-tk__chips {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .fm-tk__voir {
    /* Enfant d'un conteneur flex : jamais en ligne. Un seul bloc insécable, texte + chevron, 44 px de
       haut pour le doigt, ramené à la hauteur des cases par des marges négatives (revue Codex) */
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    min-height: 44px;
    margin: -8px 0 -4px 4px;
    font-size: var(--fm-petit);
    color: var(--fm-v);
    font-weight: 700;
    text-decoration: none;
    line-height: 1.2;
  }

  .fm-tk__voir:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .fm-tk__vide {
    color: #9aa5b4;
    line-height: 28px;
  }

  .fm-res {
    flex: none;
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: var(--fm-rayon);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }

  .fm-res--quinte { background: var(--fm-rf); color: var(--fm-r); }
  .fm-res--quarte { background: var(--fm-bf); color: var(--fm-b); }
  .fm-res--tierce { background: var(--fm-vf); color: var(--fm-v); }
  .fm-res--avenir { background: var(--fm-jf); color: #8a6a00; }
  .fm-res--annulee { background: #f0f3f6; color: var(--fm-m); font-weight: 600; }
  .fm-res--none { background: none; color: #9aa5b4; font-weight: 400; font-size: 18px; padding: 0 8px; } /* un simple tiret (Xavier 15/09/2026) */

  /* ── Pagination ── */
  .fm-pag {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 14px;
  }

  .fm-pag__txt {
    margin-right: 8px;
    color: var(--fm-m);
  }

  .fm-pag__n,
  .fm-pag__fl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    font-weight: 700;
    text-decoration: none;
  }

  .fm-pag a:hover {
    background: var(--fm-fond-doux);
  }

  .fm-pag .is-current {
    background: var(--fm-v);
    border-color: var(--fm-v);
    color: #fff;
  }

  .fm-pag__pts {
    color: var(--fm-m);
    padding: 0 4px;
  }

  [data-fm-liste].is-chargement {
    opacity: 0.5;
    pointer-events: none;
  }

  /* ── Les commentaires : UNE carte bordée et cliquable par commentaire — d'où il vient et quand
        en tête, le texte sur une ligne dessous, le chevron à droite (Xavier 15/09/2026) ── */
  .fm-coms {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .fm-page .fm-com {
    display: block;
    position: relative;
    margin: 0;
    padding: 10px 190px 10px 12px;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    background: var(--color-surface, #fff);
    color: var(--fm-t);
    text-decoration: none;
  }

  .fm-page .fm-com:hover {
    background: var(--fm-fond-doux);
    border-color: #c9d2de;
  }

  .fm-page .fm-com:hover .fm-com__voir-txt {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .fm-com__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
    margin: 0 0 5px;
    font-size: var(--fm-petit);
    color: var(--fm-m);
  }

  .fm-com__txt {
    display: block;
    margin: 0;
    font-size: var(--fm-texte);
    line-height: 1.45;
    /* UNE seule ligne, « … » au bout : la suite est dans la conversation (Xavier 15/09/2026) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fm-com__ou {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--fm-rayon);
    background: #f0f3f6;
    color: var(--fm-t);
    font-weight: 700;
  }

  .fm-com__ou--course { background: var(--fm-vf); color: var(--fm-v); }
  .fm-com__ou--direct { background: var(--color-warning-soft, #fff1e6); color: #9a4a00; }
  .fm-com__ou--sujet { background: var(--fm-bf); color: #0a4f9c; }

  .fm-com__pouce {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

  .fm-com__voir {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--fm-v);
    font-size: var(--fm-petit);
    font-weight: 700;
    white-space: nowrap;
  }

  /* ═══ TÉLÉPHONE (≤ 979 px) : façon Facebook, blocs blancs bord à bord, 8 px de gris entre ═══ */
  @media (max-width: 979px) {
    .fm-page {
      gap: 8px;
    }

    .fm-carte {
      border: 0;
      border-radius: 0;
      padding: 14px 16px;
    }

    .fm-carte--tete {
      padding: 16px 16px 0;
    }

    /* L'en-tête façon Facebook : tout centré, l'avatar en grand */
    .fm-tete {
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 8px;
    }

    .fm-avatar,
    .fm-avatar img,
    .fm-avatar__initiale {
      width: 112px;
      height: 112px;
    }

    .fm-identite {
      width: 100%;
    }

    .fm-nom {
      justify-content: center;
      flex-direction: column;
      gap: 6px;
      margin: 0 0 6px;
    }

    .fm-page .fm-pseudo {
      font-size: 24px;
    }

    .fm-meta {
      justify-content: center;
      gap: 4px 12px;
    }

    .fm-meta__item {
      justify-content: center;
    }

    .fm-tete .fm-actions {
      width: 100%;
      flex-direction: row;
      flex-wrap: wrap;
      margin-top: 2px;
    }

    .fm-tete .fm-actions .btn,
    .fm-tete .fm-message-wrap,
    .fm-actions-duo {
      flex: 1 1 0;
      width: auto;
    }

    /* « Écrire à la modération » sur sa propre ligne, sous les deux autres */
    .fm-tete .fm-moderation {
      flex: 1 0 100%;
    }

    .fm-tete .fm-actions-note,
    .fm-tete .fm-friends-count {
      width: 100%;
      margin: 0;
    }

    /* « Envoyer un message » devient « Message » à côté de « Ajouter en ami » */
    .fm-libelle-long {
      display: none;
    }

    .fm-libelle-court {
      display: inline;
    }

    .fm-resume {
      grid-template-columns: 1fr;
      gap: 8px;
      margin-top: 14px;
      padding: 12px 0 4px;
    }

    .fm-tuile {
      min-height: 52px;
    }

    .fm-onglets {
      margin: 12px -16px 0;
      padding: 0 4px;
    }

    .fm-onglet {
      flex: 1 1 0;
      justify-content: center;
      padding: 0 6px;
      font-size: var(--fm-meta);
    }

    .fm-onglet__n {
      display: none;
    }

    /* Ligue : l'écusson et le texte côte à côte, les deux repères en dessous, sur deux colonnes */
    .fm-ligue {
      flex-wrap: wrap;
      gap: 12px 14px;
    }

    .fm-ecusson--grand {
      width: 56px;
      height: 56px;
      font-size: 24px;
    }

    .fm-ligue__corps {
      flex: 1 1 0;
      min-width: 0;
    }

    .fm-ligue__cote {
      flex: 1 1 100%;
      padding: 12px 0 0;
      border-left: 0;
      border-top: 1px solid var(--fm-l);
      display: flex;
      gap: 12px;
    }

    .fm-ligue__cote .fm-info {
      flex: 1 1 0;
      min-width: 0;
    }

    .fm-info + .fm-info {
      margin-top: 0;
    }

    .fm-ligue__cote .fm-val {
      font-size: 15px;
    }

    .fm-apropos dt {
      flex-basis: 120px;
    }

    .fm-page .fm-carte-ville__cadre {
      height: 220px;
    }

    /* Concours */
    .fm-cc {
      flex-wrap: wrap;
      gap: 12px;
    }

    .fm-page .fm-cc__btn {
      flex: 1 1 100%;
      justify-content: center;
    }

    .fm-cc__place {
      font-size: 20px;
    }

    .fm-trs {
      gap: 8px;
    }

    .fm-tr {
      padding: 10px;
    }

    .fm-tr__n {
      font-size: 24px;
    }

    .fm-tr__n small {
      font-size: var(--fm-petit);
    }

    .fm-m12 {
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .fm-m12__k b {
      font-size: 20px;
    }

    /* La navigation du graphique : le titre sur sa ligne, dessous flèches + période + liste */
    .fm-h3--nav {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }

    .fm-nav {
      justify-content: space-between;
      gap: 6px;
    }

    .fm-nav__per {
      min-width: 0;
      font-size: 13px;
    }

    .fm-sel {
      font-size: 16px; /* un champ sous 16 px fait zoomer Safari iOS */
      padding-right: 30px;
    }

    /* Tickets : la date à gauche, tout le reste prend la largeur, la pastille en haut à droite */
    .fm-tk {
      position: relative;
      gap: 10px;
    }

    .fm-tk__date {
      width: 44px;
      height: 44px;
    }

    .fm-tk__corps {
      flex: 1 1 0;
      min-width: 0;
    }

    .fm-tk__titre,
    .fm-tk__sub {
      padding-right: 92px;
    }

    .fm-tk .fm-res {
      position: absolute;
      top: 12px;
      right: 0;
      height: 26px;
      font-size: var(--fm-petit);
      padding: 0 8px;
    }

    .fm-tk .fm-res--none {
      font-size: 18px;
    }

    .fm-tk__lbl {
      width: 50px;
    }

    /* 8 cases + 7 espaces = 8 × 27 = 216 px : tiennent sur une ligne dès 360 px de large */
    .fm-ch {
      width: 25px;
      height: 25px;
      margin: 0 2px 3px 0;
      font-size: var(--fm-petit);
    }

    /* Téléphone : le chevron seul à droite, la carte entière reste le lien */
    .fm-page .fm-com {
      padding-right: 34px;
    }

    .fm-com__voir-txt {
      display: none;
    }

    .fm-com__voir {
      right: 10px;
    }
  }

  /* ── Onglet Amis (Xavier, 23/10/2026, « 1A ») : le membre lui-même et l'équipe seulement. La liste
        d'amis de Facebook : recherche, en ligne d'abord puis de A à Z, deux vraies colonnes sur ordinateur,
        une ligne par ami sur téléphone ; « Message » au gris des boutons de Facebook, ⋯ pour retirer. ── */
  #fm-t-amis:checked ~ .fm-carte--tete .fm-onglet--amis {
    color: var(--fm-v);
    border-bottom-color: var(--fm-v);
  }

  #fm-t-amis:checked ~ .fm-panneau--amis {
    display: flex;
  }

  #fm-t-amis:focus-visible ~ .fm-carte--tete .fm-onglet--amis {
    outline: 2px solid var(--fm-b);
    outline-offset: -2px;
  }

  /* « 148 amis » de l'en-tête et de « À propos » : un libellé de la radio, vert comme les liens de la fiche */
  .fm-tete .fm-lien-amis,
  .fm-tete .fm-lien-amis strong,
  .fm-apropos .fm-lien-amis {
    color: var(--fm-v);
    cursor: pointer;
  }

  .fm-apropos .fm-lien-amis {
    font-weight: 700;
  }

  .fm-lien-amis:hover {
    text-decoration: underline;
  }

  .fm-amis__icones {
    position: absolute;
    overflow: hidden;
  }

  .fm-amis__entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 6px;
  }

  .fm-amis__entete .fm-titre {
    margin: 0;
  }

  .fm-amis__nb {
    margin-left: 4px;
    font-size: var(--fm-texte);
    font-weight: 700;
    color: var(--fm-m);
  }

  .fm-amis__cherche {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 300px;
    max-width: 100%;
    height: 44px; /* 44 px : les cibles de la fiche */
    padding: 0 14px;
    border-radius: 22px;
    background: var(--fm-filet);
    color: var(--fm-m);
  }

  .fm-amis__cherche input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: var(--fm-texte);
    color: var(--fm-t);
  }

  .fm-amis__cherche:focus-within {
    box-shadow: 0 0 0 2px var(--fm-b);
  }

  .fm-amis__prive {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 4px;
    font-size: var(--fm-meta);
    color: var(--fm-m);
  }

  .fm-amis__prive .fm-ico {
    flex: 0 0 auto;
    margin-top: 2px;
  }

  .fm-amis__groupe {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0 6px;
    font-size: var(--fm-texte);
    font-weight: 800;
    color: var(--fm-t);
  }

  .fm-amis__groupe span {
    font-weight: 700;
    color: var(--fm-m);
  }

  .fm-amis__point {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--fm-en-ligne);
  }

  /* Deux vraies colonnes (jamais de multicolonne CSS) */
  .fm-amis__liste {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .fm-ami {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--fm-l);
    border-radius: var(--fm-rayon);
    background: var(--color-surface, #fff);
  }

  .fm-ami__photo {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
  }

  .fm-ami__photo img,
  .fm-ami__init {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--fm-fond-doux);
    box-shadow: 0 0 0 1px var(--fm-l);
    color: var(--fm-v);
    font-size: 20px;
    font-weight: 800;
  }

  /* Un ami sans photo : la même lettre grise sur rond gris clair (28/10/2026) ;
     la photo garde son fond d'avant. */
  .fm-ami__init {
    background: var(--color-surface-soft, #f8fafc);
    color: var(--fm-m);
  }

  .fm-ami__point {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-surface, #fff);
    border-radius: 50%;
    background: var(--fm-en-ligne);
  }

  .fm-ami__txt {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
  }

  .fm-ami__nom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    min-width: 0;
  }

  /* Un pseudo long passe à la ligne, jamais en « … » : à 1280 px la colonne de droite ne lui laisse que 120 px, et neuf
     « Eric_Vincenn… » qui se suivent ne se distinguent plus (audit du 24/10/2026) */
  .fm-page .fm-ami__pseudo {
    max-width: 100%;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--fm-t);
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  .fm-page .fm-ami__pseudo:hover {
    text-decoration: underline;
  }

  /* 44 px sous le doigt pour le pseudo et les raccourcis « N amis » : la zone grandit, la ligne ne bouge pas */
  .fm-page .fm-ami__pseudo,
  .fm-lien-amis {
    padding: 11px 0;
    margin: -11px 0;
  }

  .fm-tete .fm-lien-amis {
    padding: 12px 0;
    margin: -10px 0 -12px;
  }

  .fm-ami__role {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--fm-bf);
    color: var(--fm-b);
    font-size: var(--fm-petit);
    font-weight: 700;
  }

  .fm-ami__vu {
    font-size: var(--fm-meta);
    line-height: 1.3;
    color: var(--fm-m);
  }

  .fm-ami__vu--en-ligne {
    font-weight: 700;
    color: var(--fm-en-ligne-texte);
  }

  .fm-ami__msg {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--fm-rayon);
    background: var(--fm-gris-bouton);
    color: var(--fm-t);
    font: inherit;
    font-size: var(--fm-meta);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
  }

  .fm-ami__msg:disabled {
    cursor: wait;
  }

  .fm-ami__plus {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--fm-m);
    cursor: pointer;
  }

  .fm-ami__plus:hover,
  .fm-ami__plus[aria-expanded="true"] {
    background: var(--fm-filet);
  }

  .fm-ami__menu {
    position: absolute;
    top: calc(100% - 6px);
    right: 8px;
    z-index: 5;
    min-width: 260px;
    padding: 6px;
    border-radius: 8px;
    background: var(--color-surface, #fff);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06);
  }

  .fm-ami__menu[hidden] {
    display: none;
  }

  .fm-ami__menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--fm-r);
    font: inherit;
    font-size: var(--fm-texte);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  .fm-ami__menu-item:hover {
    background: var(--fm-filet);
  }

  .fm-amis__plus-amis {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 44px;
    margin: 12px 0 0;
    border: 0;
    border-radius: var(--fm-rayon);
    background: var(--fm-gris-bouton);
    color: var(--fm-t);
    font: inherit;
    font-size: var(--fm-texte);
    font-weight: 700;
    cursor: pointer;
  }

  .fm-amis__plus-amis small {
    font-size: var(--fm-meta);
    font-weight: 600;
    color: var(--fm-m);
  }

  .fm-amis__plus-amis[hidden],
  .fm-amis__groupe[hidden],
  .fm-amis__liste[hidden],
  .fm-ami[hidden],
  .fm-amis__aucun[hidden] {
    display: none;
  }

  /* Téléphone (≤ 979 px) : une ligne par ami sur toute la largeur, comme la liste d'amis de l'appli
     Facebook ; « Message » devient une bulle ronde de 44 px ; les cinq onglets tiennent à 360 px. */
  @media (max-width: 979px) {
    .fm-onglets--cinq {
      gap: 2px;
    }

    .fm-onglets--cinq .fm-onglet {
      flex: 1 1 auto;
      min-width: 44px;
      padding: 0 4px;
    }

    .fm-amis__entete {
      flex-direction: column;
      align-items: stretch;
    }

    .fm-amis__cherche {
      width: 100%;
    }

    .fm-amis__cherche input {
      font-size: 16px; /* 16 px : iOS ne zoome pas sur le champ */
    }

    .fm-amis__liste {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }

    .fm-ami {
      gap: 10px;
      padding: 8px 0;
      border: 0;
      border-radius: 0;
    }

    .fm-ami__photo,
    .fm-ami__photo img,
    .fm-ami__init {
      width: 52px;
      height: 52px;
      font-size: 20px;
    }

    .fm-ami__msg {
      width: 44px;
      height: 44px;
      padding: 0;
      overflow: hidden;
      border-radius: 50%;
      font-size: 0; /* « Patientez… » de messagerie.js pendant l'ouverture : la bulle reste ronde */
    }

    .fm-ami__msg-txt {
      display: none;
    }

    .fm-tete .fm-lien-amis {
      margin: -12px 0;
    }

    .fm-ami__msg:disabled::after {
      content: '…';
      font-size: 20px;
      line-height: 1;
    }

    .fm-ami__menu {
      right: 0;
      width: min(300px, 100%);
      min-width: 0;
    }
  }
}

/* Hors du layer : la largeur et la marge haute de .layout viennent d'app.css, qui bat tout
   @layer — on les neutralise depuis une règle sans layer, plus précise (même recette que
   points.css et direct.css). Le fond gris de Facebook derrière les blocs blancs. */
@media (max-width: 979px) {
  .layout.layout-fiche.container {
    width: 100%;
    margin-top: 0;
    background: #f0f2f5;
  }
}
