/* © 2026 NAVYRO SAS. Tous droits réservés. Logiciel propriétaire : voir le fichier LICENCE. */
/* Smartphone et tablette (demande d'Alain du 06/10/2026 : « l'application doit être responsive et utilisable par un smartphone »).
   Chargée après crm.css. Téléphone : jusqu'à 760 px ; tablette : 761 à 1050 px. Rien ne change au-dessus de 1050 px.
   Principes : une barre d'application collée en haut (menu ☰), un menu en plein écran, des rangées de pastilles qu'on fait défiler du doigt,
   des tableaux présentés en cartes (web/js/mobile.js), des fenêtres de saisie en plein écran, des cibles tactiles d'au moins 42 px et des
   champs à 16 px (sinon iOS zoome à la saisie). */

:root { --barre-mobile: 56px; }
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: rgba(44, 111, 175, .15); }
img, svg, video, canvas { max-width: 100%; }

/* ---- tout écran tactile : cibles plus grandes, pas de survol ---- */
@media (pointer: coarse) {
  .btn, .onglet, .sommaire-lien, .parcours-etape, .nav a, .filtre-pastille, .fermer, .oeil-bouton, .lien-btn { min-height: 44px; }
  .btn, .onglet, .sommaire-lien, .filtre-pastille, .fermer, .oeil-bouton { min-width: 44px; }   /* 44 px au toucher (09/10/2026) */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .btn.small { min-height: 44px; padding: 7px 12px; font-size: 13px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea, .select, .search, .filtre-pastille { min-height: 44px; font-size: 16px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .table tr.cliquable:hover td { background: transparent; }
  /* numéros de téléphone : un lien tel: bien visible et facile à toucher */
  a[href^="tel:"] { color: var(--brand2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 6px 0; }
}

/* ---- tablette ---- */
@media (min-width: 761px) and (max-width: 1050px) {
  .main { padding: 18px 18px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ---- téléphone ---- */
@media (max-width: 760px) {
  /* coque : barre d'application en haut, contenu dessous */
  .app { display: block; min-height: 0; }
  .sidebar { position: sticky; top: 0; z-index: 40; height: var(--barre-mobile); min-height: var(--barre-mobile); overflow: hidden; padding: 0 12px;
    padding-top: env(safe-area-inset-top); display: flex; flex-direction: column; justify-content: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
  .sidebar-tete { align-items: center; }
  .sidebar .tag { display: none; }
  .brand { font-size: 17px; margin: 0; }
  .menu-mobile { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; font-size: 22px; }
  /* menu ouvert : plein écran */
  .sidebar.menu-ouvert { z-index: 80; position: fixed; inset: 0; height: 100dvh; min-height: 0; overflow-y: auto; justify-content: flex-start; padding: env(safe-area-inset-top) 12px 0; }
  .sidebar.menu-ouvert .sidebar-tete { min-height: var(--barre-mobile); flex: 0 0 auto; }
  .sidebar.menu-ouvert .nav { padding-top: 6px; }
  .sidebar.menu-ouvert .nav a { padding: 12px 14px; font-size: 15px; line-height: 1.3; }
  .sidebar.menu-ouvert .nav .nav-sous { padding: 10px 14px 10px 36px; font-size: 14px; }
  .sidebar.menu-ouvert .nav-section { padding: 12px 8px; margin: 6px 4px 0; font-size: 12px; }
  .sidebar.menu-ouvert .sidebar-pied { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  body.menu-ouvert { overflow: hidden; }

  .main { padding: 12px 12px max(28px, env(safe-area-inset-bottom)); overflow-x: hidden; }

  /* en-tête de page */
  .topbar { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 12px; }
  .title h1 { font-size: 22px; line-height: 1.2; }
  .title p { font-size: 13px; }
  .topbar-date { display: none; }
  .actions { width: 100%; gap: 8px; }
  .actions-tete { width: 100%; align-items: stretch; }
  .actions-tete .aide-bouton { margin-left: auto; }
  .actions .btn.primary { flex: 1 1 auto; }
  .actions select, .actions .select { flex: 1 1 100%; }

  /* rangées de pastilles et d'onglets : une ligne qu'on fait défiler */
  .sommaire { top: var(--barre-mobile); flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 12px; padding: 8px 12px; gap: 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .sommaire::-webkit-scrollbar, .onglets::-webkit-scrollbar, .parcours-etapes::-webkit-scrollbar { display: none; }
  .sommaire-lien { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; font-size: 13px; }
  .sommaire.sommaire-groupes { overflow-x: visible; }   /* familles d'onglets : chaque rangée défile à part (29/10/2026) */
  .sommaire-familles, .sommaire-sous { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .onglets { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 12px; padding: 2px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .onglet { flex: 0 0 auto; white-space: nowrap; padding: 9px 14px; font-size: 13px; }
  .parcours-etapes { flex-wrap: nowrap; overflow-x: auto; margin: 6px -12px 4px; padding: 2px 12px; scrollbar-width: none; }
  .parcours-etape { flex: 0 0 auto; white-space: nowrap; }
  .parcours-tout { flex: 0 0 auto; margin-left: 12px; white-space: nowrap; }
  .agenda-barre { gap: 8px; }
  .agenda-barre select { flex: 1 1 100%; min-height: 44px; font-size: 16px; }

  /* cartes et grilles */
  .card { padding: 14px; border-radius: 14px; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid4 .metric { padding: 12px; }
  .metric .value { font-size: 22px; margin-top: 4px; }
  .metric .value.moyen { font-size: 17px; }
  .metric .label { font-size: 12px; }
  .layout2, .layout-moitie, .champs, .champs.cols3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .section-title { flex-wrap: wrap; }
  .section-title .outils-ligne, .section-title > span:last-child { flex-wrap: wrap; }
  .filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filtres .search { grid-column: 1 / -1; }
  .filtres .btn { width: 100%; text-align: center; }
  .pagination { flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
  .item { padding: 14px; }
  .warning { font-size: 13px; }

  /* tableaux : cartes (classe posée par web/js/mobile.js) ; les autres défilent horizontalement */
  .table-wrap { -webkit-overflow-scrolling: touch; margin: 0 -2px; }
  .table-cartes, .table-cartes thead, .table-cartes tbody, .table-cartes tfoot, .table-cartes tr, .table-cartes th, .table-cartes td { display: block; width: auto; }
  .table-cartes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-cartes tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin: 0 0 10px; }
  .table-cartes tr.cliquable:active { background: #f7fbff; }
  .table-cartes td, .table-cartes th { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border: 0; padding: 6px 0;
    text-align: right; overflow-wrap: anywhere; white-space: normal; }
  .table-cartes td::before, .table-cartes th::before { content: attr(data-label); flex: 0 0 38%; max-width: 42%; text-align: left; color: var(--muted);
    font-weight: 600; font-size: 12px; padding-top: 1px; }
  .table-cartes td[data-label=""]::before, .table-cartes td:not([data-label])::before { content: none; }
  .table-cartes td[data-label=""] { justify-content: flex-end; flex-wrap: wrap; }
  .table-cartes td.num { text-align: right; }
  .table-cartes td:first-child { font-weight: 700; }
  .table-cartes td.plein { display: block; text-align: left; }
  .table-cartes td.plein::before { content: none; }
  /* ligne de titre de section (cellule unique ou fusionnée) : un intertitre, pas une carte */
  .table-cartes tr:has(> td.plein:only-child), .table-cartes tr:has(> th.plein:only-child) { background: transparent; border: 0; padding: 4px 2px 0; margin-bottom: 4px; }
  .table-cartes tr:has(> td.plein:only-child) > td, .table-cartes tr:has(> th.plein:only-child) > th { color: var(--muted); font-weight: 700; font-size: 12px;
    text-transform: uppercase; letter-spacing: .04em; padding: 6px 0 2px; }
  /* cellule longue (désignation, adresse, note) : étiquette au-dessus, texte à gauche sur toute la largeur */
  .table-cartes td.longue { display: block; text-align: left; }
  .table-cartes td.longue::before { display: block; max-width: none; margin-bottom: 2px; }
  .table-cartes td:empty { display: none; }
  .table-cartes .btn, .table-cartes .actions { margin-top: 2px; }
  .table-cartes td.note { white-space: pre-wrap; text-align: left; }

  /* fenêtres de saisie : plein écran, boutons collés en bas */
  .fenetre, .mailing-fenetre { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .fenetre form { height: 100%; max-height: 100dvh; }
  .fenetre-tete { padding: max(14px, env(safe-area-inset-top)) 14px 8px; }
  .fenetre-tete .fermer { width: 44px; height: 44px; font-size: 26px; }
  .fenetre-corps { flex: 1 1 auto; padding: 6px 14px 14px; }
  /* la zone s'étire sur tout l'écran : ses champs restent en haut, sans vide réparti entre eux (14/10/2026, un seul champ au milieu) */
  .fenetre-corps.form-grid { align-content: start; }
  .fenetre-pied { position: sticky; bottom: 0; background: #fff; gap: 10px; padding: 10px 14px max(12px, env(safe-area-inset-bottom)); }
  .fenetre-pied { flex-wrap: wrap; row-gap: 8px; }
  .fenetre-pied .btn { flex: 1 1 110px; white-space: normal; }
  .fenetre-pied .bascule-bulles-fenetre { flex: 0 0 auto; }
  .aide-volet { width: 100vw; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }

  /* proposition : étapes et navigation */
  .parcours-nav { position: sticky; bottom: 0; z-index: 5; margin: 14px -12px 0; padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background: rgba(245, 247, 251, .96); border-top: 1px solid var(--line); }
  .parcours-nav .btn { flex: 1 1 0; }
  .circuit { padding: 10px 12px; }
  .circuit-boutons { width: 100%; }
  .circuit-boutons .btn { flex: 1 1 auto; }

  /* connexion */
  .gate { padding: 14px; align-items: flex-start; overflow-y: auto; }
  .gate-panel { padding: 24px 20px; border-radius: 20px; margin-top: 6vh; }
  .gate-brand { font-size: 26px; }

  /* téléaction : la session d'appel occupe tout l'écran */
  .teleaction-guide { padding: 0; align-items: stretch; }
  .teleaction-guide-page { border-radius: 0; min-height: 100%; width: 100%; padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
  .teleaction-guide-choix .btn { min-width: 0; flex: 1 1 100%; }
  .teleaction-popup { padding: 0; align-items: stretch; }
  .teleaction-popup > * { width: 100%; max-width: 100%; border-radius: 0; }

  /* téléaction : pas de colonnes côte à côte */
  .teleaction-etape-rdv, .teleaction-deux { grid-template-columns: 1fr; }
  .teleaction-tuiles, .teleaction-compteurs-bas { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* agenda : la semaine défile horizontalement dans sa carte */
  .agenda-carte { -webkit-overflow-scrolling: touch; }
  .agenda-semaine { grid-template-columns: 38px repeat(var(--jours), minmax(110px, 1fr)); }

  /* graphiques et aperçus */
  .chart { overflow-x: auto; }
  .mailing-apercu { height: 320px; }
}

/* ---- petits téléphones ---- */
@media (max-width: 380px) {
  .grid4 { grid-template-columns: minmax(0, 1fr); }
  .title h1 { font-size: 20px; }
}

/* Audit d'affichage du 14/10/2026 : cibles de 44 px au toucher, y compris celles qu'une règle plus récente rabaissait */
@media (pointer: coarse) {
  .bascule-vue button, .lien-chiffre, .btn.small, .btn.icone, .pm-pastille, .nc-seg, .cond-opt, .cond-m, .cond-pli-tete,
  .choix-boutons button, .surf-ligne .btn, .lien-manque { min-height: 44px !important; }
  .bascule-vue button, .btn.icone, .cond-opt { min-width: 44px; }
  .lien-chiffre { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; }
}

/* ===================================================================================================================================
   Adaptation à tous les écrans (Alain, 18/11/2026, demande 77 de NAVYRO-Suivi, planches « Adaptation-ecrans-<écran>-avant-apres-v1 »
   validées) : écrans ajoutés depuis l'audit du 09/10/2026 (challenges, mise en service, procédure de contrôle) à 375, 768 et 1024 px.
   Jamais de défilement sur le côté ; sous 640 px un tableau devient une pile de cartes ; cibles tactiles ≥ 44 px ; textes ≥ 12 px ;
   champs à 16 px sur téléphone ; rien ne disparaît. Rien ne change au-dessus de 1050 px (1280 × 800 et 1650 × 900 identiques).
   Tablette en portrait (761 à 900 px) : le menu passe derrière le bouton ☰, comme sur téléphone, pour tous les écrans.
   Couleurs des fonds : celles du thème (--panel, --bg, --line), justes en style noir comme en style clair.
   =================================================================================================================================== */
/* ============ 1. Tablette en portrait (761 à 900 px) : le menu passe derrière le bouton ☰ comme sur téléphone ============ */
@media (min-width: 761px) and (max-width: 900px) {
  .app { display: block; min-height: 0; }
  .sidebar { position: sticky; top: 0; z-index: 40; height: 56px; min-height: 56px; overflow: hidden; padding: 0 18px;
    display: flex; flex-direction: column; justify-content: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
  .sidebar-tete { align-items: center; }
  .sidebar .tag { display: none; }
  .brand { font-size: 18px; margin: 0; }
  .menu-mobile { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; font-size: 22px; }
  .sidebar .nav, .sidebar .sidebar-logo, .sidebar .sidebar-copyright, .sidebar .sidebar-pied, .sidebar .sidebar-reglages { display: none; }
  .sidebar.menu-ouvert { z-index: 80; position: fixed; inset: 0; height: 100dvh; overflow-y: auto; justify-content: flex-start; padding: 0 18px; }
  .sidebar.menu-ouvert .nav, .sidebar.menu-ouvert .sidebar-pied { display: flex; flex-direction: column; }
  .sidebar.menu-ouvert .sidebar-reglages { display: block; }
  body.menu-ouvert { overflow: hidden; }
}

/* ============ 2. Tablette (761 à 1050 px) ============ */
@media (min-width: 761px) and (max-width: 1050px) {
  /* familles et sous-familles : sur plusieurs lignes, jamais écrasées ni superposées */
  /* (crm.css « #page:has(.chm-ss) > .onglets-famille { flex-wrap: nowrap !important } » les gardait sur une ligne, hors écran) */
  html body #page.main > .onglets.onglets { flex-wrap: wrap !important; row-gap: 6px !important; overflow: visible !important; }
  html body #page.main > .onglets.onglets > .onglet { flex: 0 0 auto !important; white-space: nowrap !important; font-size: 12px !important; }
  .chm-ss { flex-wrap: wrap; }
  .chq .chq-ss-bande .chq-bande { flex: 1 1 100% !important; }

  /* Créer un challenge : une colonne (on remplit, puis on s'informe dessous) */
  .chq .chq-gd { grid-template-columns: minmax(0, 1fr) !important; }
  .chq .chq-per .chp-ligne, .chq .chq-per .chm-rac, .chq .chq-pourqui .chm-rac { flex-wrap: wrap !important; }
  .chq .chm-carte .section-title { flex-wrap: wrap; row-gap: 4px; }
  .chq .chq-manques { white-space: normal; }
  .chq .chq-ss-bande .chq-bande { min-width: 0; }

  /* Budget des challenges : le tableau tient dans la largeur (textes sur deux lignes au besoin) */
  .chb-t { width: 100%; table-layout: auto; }
  .chb-t th, .chb-t td { white-space: normal !important; overflow-wrap: anywhere; }
  .chb-t td:first-child, .chb-t td:nth-child(3) { overflow-wrap: normal !important; word-break: normal !important; }
  .chb-t td.num, .chb-t th.num { white-space: nowrap !important; }

  /* Paramètres › Challenge : deux colonnes, les tableaux tiennent dans leur carte */
  .chp-grille { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .chp-grille > * { min-width: 0; }
  .chp-t { width: 100%; }
  .chp-t th, .chp-t td { white-space: normal !important; overflow-wrap: anywhere; }

  /* Mise en service : « Reprendre au réglage » revient à la ligne au lieu de sortir de l'écran */
  .gm-go { white-space: normal; max-width: 100%; text-align: center; }

  /* Procédure de contrôle : barre « Période » et barre des courriels sur deux lignes */
  .section-title:has(.tq-periode) { flex-wrap: wrap !important; row-gap: 6px; }
  .section-title .tq-periode { flex-wrap: wrap !important; margin-left: 0; }
  .ctl-carte .section-title:has(.ctl-mois) { flex-wrap: wrap !important; row-gap: 6px; }
  .ctl-carte .section-title:has(.ctl-mois) .lp-espace { display: none; }
  .ctl-carte .section-title:has(.ctl-mois) .search { flex: 1 1 200px !important; width: auto !important; }
  .ctl-decision { white-space: normal !important; }
  .ctl-gauche .table th, .ctl-gauche .table td { white-space: normal; }
  .ctl-carte .table td:last-child, .ctl-carte .table th:last-child { white-space: normal !important; word-break: keep-all !important;
    overflow-wrap: normal !important; min-width: 5.5em; overflow: visible !important; }
}

/* ============ 3. Tout écran tactile : cibles de 44 px et textes de 12 px au moins ============ */
@media (pointer: coarse) and (max-width: 1050px) {
  .chq .chm-themes button, .chq .chm-rac button, .chq .chm-sugg button, .chq .ctl-segment button, .chq .chm-sugg .btn,
  .chq .chq-msg-b .btn, .chq .chq-reg .btn, .chq .chq-photo-b .btn, .chq .chm-reg .btn, .chm-ss a, .cha-annee button,
  .ctl-segment button, .ctl-mois .onglet, .tq-periode .tq-b, .gm-l, .gm-go, .chp-pmin {
    min-height: 44px !important; }
  .cha-annee button, .ctl-segment button, .chq .ctl-segment button { min-width: 44px !important; }
  .chm-ss a { display: inline-flex; align-items: center; }
  .chq .chm-carte .section-title .muted, .chq .chq-bande span, .chq .chq-col-t, .chq .chq-pod span, .chq .chq-prec-o,
  .chq .chc-l small, .ctl-frise, .ctl-frise > div span, .ctl-frise > div i, .ctl-mois .onglet, .chp-tx, .chp-real h4,
  #page:has(.chm-ss) > .onglets-famille .onglet, .chq .chq-gd table, .gm-pied, .pill { font-size: 12px !important; }
  .chq .chm-t td, .chq .chm-t th { font-size: max(12px, calc(13px * var(--k))) !important; }
  .chp-t select, .chp-t input { min-height: 44px; font-size: 16px; }
  /* Mise en service : libellés et descriptions entiers (plus de « … ») et à 12 px au moins */
  .gm-l *, .gm-l b, .gm-l small { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
  .gm-l small, .gm-l .s, .gm-n, .gm-fam h4 { font-size: 12px !important; }
}

/* ============ 4. Téléphone (≤ 760 px) ============ */
@media (max-width: 760px) {
  /* bandeau du budget et sous-familles : sur plusieurs lignes, dans la largeur */
  .chm-ss { flex-wrap: wrap; }
  .chq .chq-ss-bande .chq-bande { min-width: 0 !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 6px; }
  .chq .chq-ss-bande .chq-bande > :last-child { grid-column: 1 / -1; }

  /* Créer un challenge : une seule colonne (crm.css « .chq .chq-gd { 1.45fr 1fr !important } » l'emportait sur mobile.css) */
  .chq .chq-gd { grid-template-columns: minmax(0, 1fr) !important; }
  .chq .chq-gd > * { min-width: 0; }
  .chq .chq-info table { width: 100%; }
  .chq .chq-info .chm-t td, .chq .chq-info .chm-t th { white-space: normal !important; }
  /* boutons qui reviennent à la ligne, rien de coupé à droite */
  .chq .chq-pourqui .chm-rac, .chq .chq-per .chm-rac, .chq .chq-per .chp-ligne { flex-wrap: wrap !important; margin-left: 0 !important; }
  .chq .chm-carte .section-title { flex-wrap: wrap; row-gap: 4px; }
  .chq .chm-carte .section-title h3 { white-space: normal; }
  .chq .chq-manques { white-space: normal; }
  .chq .chc-l { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .chq .chq-th { flex-wrap: wrap; }
  .chq .chq-actions, .chq .chq-reg { flex-wrap: wrap !important; white-space: normal !important; row-gap: 8px; }
  .chq .chq-actions .btn { max-width: 100%; white-space: normal !important; }
  .chq .chq-actions .chq-bombe, .chq .chq-actions .chq-lancer { flex: 1 1 100%; }

  /* Budget : la phrase sous l'enveloppe revient à la ligne */
  .chb-t td.plein, .chb-t td.plein span { white-space: normal !important; }

  /* Paramètres › Challenge : grilles en cartes (script), lignes « libellé · valeur » qui reviennent à la ligne */
  .chp-grille .chp-ligne { flex-wrap: wrap; row-gap: 4px; }
  .chp-grille .table-cartes td { white-space: normal !important; padding: 6px 0 !important; }
  .chp-grille .table-cartes td select, .chp-grille .table-cartes td input { width: auto !important; max-width: 60%; }
  .chp-grille .table-cartes tr { background: var(--panel); }
  .chp-tx { display: inline !important; margin-left: 6px; }
  .chp-themes td, .chp-themes td * { overflow-wrap: normal !important; word-break: normal !important; }
  /* Mise en service */
  .gm-go { white-space: normal; width: 100%; text-align: center; }
  .gm-pied { flex-wrap: wrap; }
  .gm-pied > * { min-width: 0; max-width: 100%; }

  /* Procédure de contrôle : période sur plusieurs lignes ; frise du plan d'actions RH sur 3 rangées de 4 étapes */
  .section-title:has(.tq-periode) { flex-wrap: wrap !important; }
  .section-title .tq-periode { flex-wrap: wrap !important; margin-left: 0; }
  .section-title .tq-periode input[type=date] { width: 150px !important; height: 44px !important; font-size: 16px !important; }
  .ctl-frise { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 10px; overflow: visible !important; }
  .ctl-frise > div { min-width: 0 !important; }
  .ctl-frise > div:nth-child(4n)::after { display: none; }
  .ctl-carte .section-title:has(.ctl-mois) { flex-wrap: wrap !important; row-gap: 8px; }
  .ctl-carte .section-title:has(.ctl-mois) .ctl-mois { flex-wrap: wrap !important; row-gap: 6px; }
  .ctl-carte .section-title:has(.ctl-mois) .lp-espace { display: none; }
  .ctl-carte .section-title:has(.ctl-mois) .select, .ctl-carte .section-title:has(.ctl-mois) .search {
    flex: 1 1 100% !important; width: 100% !important; height: 44px !important; min-height: 44px !important; font-size: 16px !important; }

  /* Fenêtre des brouillons : la liste en cartes (le script de la maquette pose les étiquettes, comme web/js/mobile.js) */
  .chbr-fen { padding: 16px 14px; max-height: calc(100dvh - 32px); overflow-y: auto; }
  .chbr-liste { overflow: visible; }
  .chbr-liste .table-cartes tr { background: var(--panel); }
  .chbr-liste .table-cartes td.actions { justify-content: flex-end; gap: 8px; }
  .chbr-b { flex-wrap: wrap; row-gap: 8px; position: sticky; bottom: -16px; z-index: 2; background: var(--bg); margin: 8px -14px -16px;
    padding: 10px 14px 14px; border-top: 1px solid var(--line); }

  /* Agenda des challenges : la frise tient dans l'écran ; une ligne par challenge (nom, montant), sa barre dessous à sa place dans l'année */
  .cha-carte { overflow-x: visible !important; }
  .cha-mois, .cha-corps { min-width: 0 !important; }
  .cha-mois { grid-template-columns: minmax(0, 1fr) !important; }
  .cha-mois > div:first-child { display: none; }
  .cha-grille-m > span { font-size: 0 !important; text-align: center; }
  .cha-grille-m > span::first-letter { font-size: 12px; text-transform: uppercase; }
  .cha-type { display: block !important; }
  .cha-lib { display: flex !important; gap: 8px; align-items: baseline; padding: 6px 0 2px; }
  .cha-pistes { display: block; }
  .cha-piste { height: auto !important; position: static !important; display: flex; flex-direction: column; gap: 4px; padding: 2px 0 6px; }
  .cha-b { position: relative !important; left: 0 !important; width: 100% !important; display: flex !important; justify-content: space-between;
    align-items: center; gap: 8px; min-height: 44px; padding: 4px 0 14px !important; background: transparent !important; border: 0 !important;
    box-shadow: none !important; color: inherit !important; overflow: visible !important; }
  .cha-b { flex-direction: row !important; text-align: left !important; }
  .cha-b > span { flex: 1 1 auto; text-align: left !important; font-size: 13px !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
  .cha-b > small { font-size: 12px !important; white-space: nowrap; }
  .cha-b::after { content: ""; position: absolute; bottom: 3px; height: 8px; border-radius: 4px; left: calc(var(--g, 0) * 1%); width: calc(var(--l, 0) * 1%); }
  .cha-b.ec::after { background: #10b981; } .cha-b.av::after { background: #3b82f6; } .cha-b.te::after { background: #64748b; }
  .cha-b::before { content: ""; position: absolute; bottom: 6px; left: 0; right: 0; height: 2px; background: var(--line); }
  .cha-corps { position: relative; }
}
