/* MisterClean38 — interface mobile : blanc et bleu de la marque.
   Pensée pour un iPhone tenu d'une main : onglets en bas, gros boutons.
   Aucun style en ligne dans les gabarits : la politique de sécurité du
   contenu les interdit (style-src 'self'). */

:root {
  color-scheme: light;
  --bleu-logo: #60b8f4;          /* fond du logo */
  --bleu: #0a7bc4;               /* boutons, liens : lisible sur blanc */
  --bleu-fonce: #075f98;
  --marine: #0d2659;             /* titres, comme sur les devis */
  --bleu-pale: #eaf5fd;
  --bleu-ciel: #cfe8fa;
  --cyan: #52b6c2;
  --fond: #f3f7fb;
  --carte: #ffffff;
  --texte: #14213d;
  --doux: #6b7a90;
  --ligne: #e3eaf2;
  --vert: #1e9e6a;
  --vert-pale: #e3f6ee;
  --orange: #d9822b;
  --orange-pale: #fdf1e3;
  --rouge: #d64545;
  --rouge-pale: #fcebeb;
  --violet: #6f5cd6;
  --violet-pale: #efecfc;
  --rayon: 16px;
  --ombre: 0 1px 2px rgba(13, 38, 89, .06), 0 4px 16px rgba(13, 38, 89, .06);
  --barre-bas: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
a { color: var(--bleu); }
h1, h2, h3 { color: var(--marine); }
.ic { flex: none; display: block; }

/* --- Barre du haut ---------------------------------------------------------- */
.entete-app {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ligne);
}
/* Instance de test (APP_INSTANCE=test) : impossible à confondre avec la prod. */
.instance-test .entete-app { background: rgba(254, 226, 226, .95); border-bottom-color: #f87171; }
.etiquette-test { flex: none; padding: 2px 8px; border-radius: 999px; background: #b91c1c; color: #fff;
  font-size: .75rem; font-weight: 700; letter-spacing: .05em; }
.bandeau-test { padding: calc(env(safe-area-inset-top) + 6px) 16px 6px; background: #b91c1c; color: #fff;
  text-align: center; font-size: .85rem; font-weight: 600; }
.entete-app h1 { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 700; overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }
.entete-app .retour { display: flex; align-items: center; margin-left: -8px; padding: 6px; border-radius: 10px;
                      color: var(--bleu); text-decoration: none; font-weight: 600; }
.entete-app .action-haut { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
                           color: var(--bleu); background: var(--bleu-pale); text-decoration: none; }
/* Cloche des notifications, en haut à droite de chaque page (2026-09-24) */
.cloche-haut { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 40px;
               margin: 0 -6px 0 auto; border-radius: 12px; color: var(--marine); text-decoration: none; }
.cloche-haut[aria-current="page"] { color: var(--bleu); background: var(--bleu-pale); }
.cloche-haut .pastille { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px;
                         border-radius: 9px; background: var(--rouge); color: #fff; font-size: .68rem;
                         font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.cloche-haut .pastille[hidden] { display: none; }

main { max-width: 640px; margin: 0 auto;
       padding: 16px 16px calc(var(--barre-bas) + env(safe-area-inset-bottom) + 28px); }

/* --- Onglets en bas ---------------------------------------------------------- */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--barre-bas) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--ligne);
}
.onglets a { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--doux);
             text-decoration: none; font-size: .7rem; font-weight: 600; position: relative; }
.onglets a[aria-current="page"] { color: var(--bleu); }
.onglets a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 32px; height: 3px;
                                          border-radius: 0 0 3px 3px; background: var(--bleu); }
.onglets .pastille { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px;
                     padding: 0 5px; border-radius: 9px; background: var(--rouge); color: #fff;
                     font-size: .68rem; line-height: 18px; text-align: center; }

/* Bouton flottant (ajouter un prospect) */
.flottant {
  position: fixed; right: 18px; z-index: 25;
  bottom: calc(var(--barre-bas) + env(safe-area-inset-bottom) + 16px);
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  background: var(--bleu); color: #fff; box-shadow: 0 6px 20px rgba(10, 123, 196, .35); text-decoration: none;
}

/* --- Éléments communs ---------------------------------------------------------- */
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; }
.carte + .carte, .carte + .section, .section + .carte,
.carte + .liste, .liste + .carte { margin-top: 14px; }
.carte > p:first-child, .carte > .bloc-titre:first-child { margin-top: 0; }
.carte > p:last-child { margin-bottom: 0; }
.section { margin-top: 22px; }
.titre-section { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.titre-section h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.titre-section a { font-size: .9rem; font-weight: 600; text-decoration: none; }
.aide, .vide { color: var(--doux); }
.vide { text-align: center; padding: 28px 16px; }
.erreur { color: var(--rouge); font-weight: 600; }
.succes { color: var(--vert); font-weight: 600; }
.petit { font-size: .85rem; }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--ligne); border-radius: 12px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-ciel); }
/* Dates et heures : sur iPhone, le champ natif a sa propre largeur minimale et
   dépassait de la carte (relance spéciale, Cillien 2026-09-29). Sans apparence
   native, il suit la largeur du formulaire ; hauteur fixée, car vide il s'aplatit. */
input[type="date"], input[type="datetime-local"], input[type="time"] {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; min-height: 48px; text-align: left;
}
input::-webkit-date-and-time-value { text-align: left; }
label { display: grid; gap: 6px; font-weight: 600; color: var(--marine); font-size: .92rem; }
.pile { display: grid; gap: 14px; }
.pile > * { min-width: 0; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 12px 18px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 700;
  background: var(--bleu-pale); color: var(--bleu); text-decoration: none; list-style: none;
}
.bouton::-webkit-details-marker { display: none; }
.bouton.principal { background: var(--bleu); color: #fff; width: 100%; }
.bouton.principal:active { background: var(--bleu-fonce); }
.bouton.danger { background: var(--rouge); color: #fff; width: 100%; }
.bouton.rouge { background: var(--rouge); color: #fff; }
.bouton.petit-bouton { min-height: 36px; padding: 6px 0; font-size: .9rem; }
.bouton.discret { background: transparent; color: var(--bleu); }
.bouton.plein { width: 100%; }
.bouton[disabled], .htmx-request .bouton { opacity: .6; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--ligne); background: #fff; color: var(--texte); font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none; white-space: nowrap; list-style: none;
}
.puce::-webkit-details-marker { display: none; }
.puce[aria-pressed="true"], .puce.active { background: var(--bleu); border-color: var(--bleu); color: #fff; }
/* `position: relative` : les boutons radio cachés des puces (`.masque`, en
   absolu) restent dans la zone qui défile. Sans elle, ils se posaient jusqu'à
   ~900 px à droite et l'iPhone laissait dézoomer la page Prospects vers eux. */
.defile { position: relative; display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px;
          scrollbar-width: none; }
.defile::-webkit-scrollbar { display: none; }
.masque { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

/* Étapes : couleur par étape */
.etape { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .78rem;
         font-weight: 700; white-space: nowrap; background: var(--bleu-pale); color: var(--bleu); }
.etape-nouveau { background: var(--violet-pale); color: var(--violet); }
.etape-infos_demandees { background: var(--orange-pale); color: var(--orange); }
.etape-devis_envoye { background: var(--bleu-pale); color: var(--bleu); }
.etape-rdv_pris { background: #e0f4f6; color: #23848f; }
.etape-fait, .etape-avis_demande { background: var(--vert-pale); color: var(--vert); }
.etape-perdu { background: var(--rouge-pale); color: var(--rouge); }
.etape-archive { background: #eef1f5; color: var(--doux); }
.etape-reserve { background: #fff6dc; color: #8a6a00; }

.avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
          background: var(--bleu-ciel); color: var(--marine); font-weight: 800; font-size: .95rem; }
.avatar.grand { width: 64px; height: 64px; font-size: 1.3rem; }

/* --- Connexion ---------------------------------------------------------------- */
.page-connexion { min-height: 100vh; background: linear-gradient(180deg, var(--bleu-logo) 0%, #9dd3f8 38%, var(--fond) 72%); }
.page-connexion main { padding-top: calc(env(safe-area-inset-top) + 40px); }
.connexion-logo { display: block; width: 150px; height: 150px; margin: 0 auto 18px; border-radius: 34px;
                  box-shadow: 0 10px 30px rgba(13, 38, 89, .2); }
.connexion .carte { max-width: 380px; margin: 0 auto; padding: 22px; }
.liens-publics { margin: 16px 0 0; text-align: center; font-size: .85rem; color: var(--doux); }
.liens-publics a { color: var(--marine); }

/* Pages publiques : présentation, politique de confidentialité */
.page-publique main { padding-top: calc(env(safe-area-inset-top) + 24px); }
.texte-public { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 22px 20px;
                line-height: 1.55; }
.texte-public h1 { margin: 0 0 6px; font-size: 1.4rem; }
.texte-public h2 { margin: 22px 0 6px; font-size: 1.05rem; color: var(--marine); }
.texte-public ul { padding-left: 20px; }
.texte-public li + li { margin-top: 6px; }
.texte-public .connexion-logo { width: 96px; height: 96px; border-radius: 22px; }
.connexion h1 { margin: 0 0 4px; font-size: 1.35rem; text-align: center; }
.connexion .aide { text-align: center; margin: 0 0 18px; }

/* --- Accueil ---------------------------------------------------------------- */
.bonjour { margin: 2px 2px 14px; display: flex; align-items: center; gap: 12px; }
.bonjour .avatar { width: 52px; height: 52px; }
.photo-profil { object-fit: cover; padding: 0; }
/* Réglages : le cercle de la photo est le bouton (ajouter / changer). */
.avatar-modifiable { position: relative; flex: none; cursor: pointer; border-radius: 50%; }
.badge-photo { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px;
               border-radius: 50%; background: var(--bleu); color: #fff; border: 2px solid var(--carte); }
.lien-discret { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--bleu); font-size: .85rem;
                font-weight: 600; cursor: pointer; }
.bonjour h2 { margin: 0; font-size: 1.5rem; }
.bonjour p { margin: 2px 0 0; color: var(--doux); }
.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tuile { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 12px;
         text-decoration: none; color: var(--texte); display: grid; gap: 2px; }
.tuile .valeur { font-size: 1.6rem; font-weight: 800; color: var(--marine); line-height: 1.1; }
.tuile .libelle { font-size: .78rem; color: var(--doux); font-weight: 600; }
.tuile.accent { background: linear-gradient(135deg, var(--bleu) 0%, #2a9be0 100%); }
.tuile.accent .valeur, .tuile.accent .libelle { color: #fff; }

/* Listes (tâches, prospects, RDV) */
.liste { list-style: none; margin: 0; padding: 0; background: var(--carte); border-radius: var(--rayon);
         box-shadow: var(--ombre); overflow: hidden; }
.liste > li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--ligne); }
.liste > li:last-child { border-bottom: 0; }
.liste .lien-ligne { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit;
                     text-decoration: none; }
.liste .corps { flex: 1; min-width: 0; display: grid; gap: 2px; }
.liste .ligne1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.liste .nom { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .quand { margin-left: auto; flex: none; color: var(--doux); font-size: .78rem; }
.liste .detail { color: var(--doux); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Numéro sous le nom : Cillien se repère au numéro qui l'a appelé (2026-09-24). */
.liste .tel-petit { display: block; color: var(--doux); font-size: .8rem; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.liste .en-retard { color: var(--rouge); font-weight: 600; }
/* Page Notifications : non lues sur fond bleu pâle, texte complet (récap sur plusieurs lignes) */
.liste.notifs > li { align-items: flex-start; }
.liste.notifs > li.non-lue { background: var(--bleu-pale); }
.liste.notifs .lien-ligne { align-items: flex-start; }
.liste.notifs .nom { white-space: normal; }
.liste.notifs li.non-lue .nom::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px;
                                        border-radius: 50%; background: var(--bleu); vertical-align: middle; }
.liste.notifs .detail-notif { color: var(--doux); font-size: .88rem; white-space: pre-line; overflow-wrap: anywhere; }
.aide-bas { color: var(--doux); font-size: .8rem; text-align: center; margin: 18px 0 0; }
.pastille-icone { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
                  background: var(--bleu-pale); color: var(--bleu); }
.pastille-icone.rdv { background: #e0f4f6; color: #23848f; }
.pastille-icone.retard { background: var(--rouge-pale); color: var(--rouge); }
.pastille-icone.nouveau { background: var(--violet-pale); color: var(--violet); }
.appel-rond { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%;
              background: var(--vert-pale); color: var(--vert); text-decoration: none; }
.appel-rond.douteux { background: var(--rouge-pale); color: var(--rouge); }
.rond-rappel { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%;
               background: var(--violet-pale); color: var(--violet); text-decoration: none; }
.heure-rdv { flex: none; width: 52px; text-align: center; font-weight: 800; color: var(--marine); }
.heure-rdv small { display: block; font-weight: 600; color: var(--doux); font-size: .7rem; }

/* --- Prospects ------------------------------------------------------------------ */
.recherche { position: relative; margin-bottom: 10px; }
.recherche .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--doux); }
.recherche input { padding-left: 42px; background: #fff; border-radius: 14px; }

/* --- Fiche ------------------------------------------------------------------------ */
.profil { display: flex; align-items: center; gap: 14px; }
.profil h2 { margin: 0; font-size: 1.3rem; }
.profil .tel { margin: 2px 0 0; font-weight: 700; color: var(--texte); text-decoration: none; display: inline-block; }
.profil .tel.douteux { color: var(--rouge); }
.selecteur-etape { margin-top: 14px; }
.selecteur-etape label { font-size: .8rem; color: var(--doux); font-weight: 700; text-transform: uppercase;
                         letter-spacing: .04em; }
.selecteur-etape select { font-weight: 700; color: var(--marine); background-color: var(--bleu-pale);
                          border-color: var(--bleu-ciel); -webkit-appearance: none; appearance: none;
                          background-image: linear-gradient(45deg, transparent 50%, var(--bleu) 50%),
                                            linear-gradient(135deg, var(--bleu) 50%, transparent 50%);
                          background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
                          background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.infos { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.infos li { display: flex; align-items: center; gap: 10px; color: var(--texte); }
.infos .ic { color: var(--bleu); }
.infos .cle-info { color: var(--doux); font-size: .85rem; }
.infos .corps-info { flex: 1; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.action { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--rayon);
          background: var(--carte); box-shadow: var(--ombre); color: var(--bleu); text-decoration: none;
          font-size: .78rem; font-weight: 700; cursor: pointer; list-style: none; }
.action::-webkit-details-marker { display: none; }
.action .rond { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
                background: var(--bleu-pale); }
.action.appel .rond { background: var(--vert-pale); color: var(--vert); }
.action span:last-child { color: var(--texte); }
.action-menu { position: relative; }
/* Sur iPhone, le menu fermé restait affiché (seuls quelques pixels en haut à
   gauche disparaissaient) : Safari ne redessinait pas la zone du menu, qui
   dépasse de son parent. Masqué ici explicitement, et dessiné sur sa propre
   couche (translateZ) : à la fermeture, Safari retire la couche entière
   (Cillien, 2026-09-29). */
.action-menu > .menu { display: none; }
.action-menu[open] > .menu {
  position: absolute; z-index: 15; top: calc(100% + 8px); left: 0; min-width: 260px; display: grid; gap: 8px;
  padding: 10px; background: var(--carte); border-radius: var(--rayon);
  box-shadow: 0 12px 32px rgba(13, 38, 89, .18);
  transform: translateZ(0); -webkit-transform: translateZ(0);
}
.actions > .action-menu:nth-child(n+3) > .menu { left: auto; right: 0; }
.menu a { display: block; padding: 12px 14px; border-radius: 12px; background: var(--fond); text-decoration: none;
          color: var(--texte); font-weight: 600; }
.menu a.suggere { background: var(--bleu-pale); color: var(--bleu); }

.bloc-titre { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1rem; }
.bloc-titre .ic { color: var(--bleu); }

.devis-image { width: 100%; border-radius: 12px; border: 1px solid var(--ligne); display: block; margin-bottom: 8px; }
.boutons-devis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.boutons-devis .principal { grid-column: 1 / -1; }
table.montants { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.montants td { padding: 7px 0; border-bottom: 1px solid var(--ligne); }
table.montants td:last-child { text-align: right; white-space: nowrap; }
table.montants .total td { font-weight: 800; color: var(--marine); border-bottom: 0; font-size: 1.05rem; }

.fil { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.fil::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--ligne); }
.fil li { position: relative; padding: 0 0 14px 12px; }
.fil li::before { content: ""; position: absolute; left: -17px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
                  background: #fff; border: 2px solid var(--bleu-logo); }
.fil .ev-quand { display: block; color: var(--doux); font-size: .78rem; }
/* Seul le texte de la note garde ses retours à la ligne (pas les blancs du gabarit). */
.fil .texte-note { white-space: pre-wrap; }
/* Créneaux mis dans le texte du devis (2026-09-24) */
.creneaux-devis { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ligne); display: grid; gap: 8px; }
.creneaux-devis .aide, .creneaux-devis .erreur { margin: 0; }
/* Accueil : prochains RDV en trois sections (2026-09-24) */
.sous-titre-rdv { margin: 14px 2px 8px; font-size: .9rem; font-weight: 700; color: var(--doux); }
.sous-titre-rdv:first-of-type { margin-top: 0; }
.rien-rdv { margin: 0 2px 4px; }
/* Motif d'une relance programmée à la main (2026-09-24) */
.motif-relance { margin: 0 0 8px; font-size: .9rem; overflow-wrap: anywhere; }
.liste .motif-relance { margin: 0; color: var(--texte); font-size: .85rem; white-space: normal; }
#motif-relance { width: 100%; margin: 4px 0 10px; }
/* Notes modifiables (2026-09-24) */
.fil .modifier-note summary { display: inline-block; margin-top: 2px; color: var(--bleu); font-size: .8rem;
                              font-weight: 600; cursor: pointer; list-style: none; }
.fil .modifier-note summary::-webkit-details-marker { display: none; }
.fil .modifier-note[open] summary { color: var(--doux); }
.fil .modifier-note form { margin-top: 6px; }

details.repli > summary { cursor: pointer; list-style: none; display: flex; align-items: center;
                          justify-content: space-between; font-weight: 700; color: var(--marine); }
details.repli > summary::-webkit-details-marker { display: none; }
details.repli > summary::after { content: "›"; font-size: 1.4rem; color: var(--doux); transition: transform .2s; }
details.repli[open] > summary::after { transform: rotate(90deg); }
details.repli[open] > summary { margin-bottom: 14px; }
details.repli.danger > summary { color: var(--rouge); }

.creneaux-liste > li { gap: 10px; }
.rond-itineraire { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%;
                   background: var(--bleu-pale); color: var(--bleu); text-decoration: none; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.photos button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0;
                 background: rgba(13, 38, 89, .6); color: #fff; display: grid; place-items: center; }
.ajout-photos { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
                border: 2px dashed var(--bleu-ciel); border-radius: 12px; color: var(--bleu); font-weight: 700;
                cursor: pointer; }
.ajout-photos input { display: none; }
.revient { display: inline-flex; padding: 2px 8px; border-radius: 999px; background: var(--vert-pale); color: var(--vert);
           font-size: .72rem; font-weight: 800; white-space: nowrap; }
.carte-revient { border: 1px solid #bfe7d4; background: var(--vert-pale); }
.carte-revient .bloc-titre, .carte-revient .ic { color: var(--vert); }
.ligne-rdv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.alerte-carte { border: 1px solid #f4d2a8; background: var(--orange-pale); }
.alerte-carte .bloc-titre, .alerte-carte .ic { color: var(--orange); }
.reglage-nombre { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.reglage-nombre .aide { grid-column: 1 / -1; margin: 0; }
.reglage-nombre .saisie { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--doux); }
.reglage-nombre input { width: 72px; text-align: center; font-weight: 700; color: var(--marine); }

.modale { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
          background: rgba(13, 38, 89, .45); padding: 16px; padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
.modale .feuille { width: 100%; max-width: 480px; background: #fff; border-radius: 24px; padding: 24px 20px 16px;
                   display: grid; gap: 10px; text-align: center; box-shadow: 0 20px 50px rgba(13, 38, 89, .3); }
.modale h3 { margin: 4px 0 0; font-size: 1.25rem; }
.modale .aide { margin: 0 0 6px; }
.pastille-succes { justify-self: center; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%;
                   background: var(--vert-pale); color: var(--vert); }
.modale input[name=montant] { text-align: center; font-size: 1.2rem; font-weight: 700; }
.modale[hidden] { display: none; }
/* Fenêtre à formulaire (coordonnées) : texte à gauche, défile si l'écran est petit. */
.modale .feuille-formulaire { text-align: left; max-height: calc(100vh - 48px); overflow-y: auto; }
.modale .feuille-formulaire h3 { text-align: center; }
/* Bouton « Modifier » en haut à droite de la carte d'identité de la fiche. */
.carte-identite { position: relative; }
.bouton-coin { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 4px;
               padding: 6px 10px; border: 0; border-radius: 999px; background: var(--bleu-pale); color: var(--bleu);
               font-size: .78rem; font-weight: 700; cursor: pointer; }
.carte-identite .profil { padding-right: 84px; }

/* Nouveautés de l'app (app/nouveautes.py) */
.nouveautes-recap { display: grid; gap: 6px; text-align: center; }
.nouveautes-recap h2 { margin: 4px 0 0; }
.points-nouveautes { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; text-align: left; }
.points-nouveautes li { padding: 12px 14px; border-radius: 12px; background: var(--fond); line-height: 1.4; }

.toast {
  position: fixed; left: 16px; right: 16px; z-index: 40;
  bottom: calc(var(--barre-bas) + env(safe-area-inset-bottom) + 14px);
  max-width: 608px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 16px; border-radius: var(--rayon); background: var(--marine); color: #fff;
  box-shadow: 0 10px 30px rgba(13, 38, 89, .3);
}
.toast button { min-height: 38px; padding: 6px 14px; border-radius: 10px; border: 0; background: rgba(255,255,255,.15);
                color: #fff; font-weight: 700; }

/* --- Statistiques ------------------------------------------------------------------ */
.grille-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.barres { display: grid; gap: 10px; }
.barre { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: .9rem; }
.barre svg { grid-column: 1 / -1; width: 100%; height: 10px; display: block; }
.fond-barre { fill: var(--bleu-pale); }
.plein-barre { fill: var(--bleu); }
/* Leads par jour (stats.html) : Facebook / Instagram empilés, palette vérifiée
   (daltonisme, contraste) avec le script de la compétence dataviz. */
/* Axe : un trait continu sous toutes les colonnes (bas de .histo-zone, 130px). */
.histo { --fb: #1877f2; --ig: #dd2a7b; --autre: #a3aebd;
         display: flex; align-items: stretch; gap: 2px;
         background: linear-gradient(var(--ligne), var(--ligne)) 0 129px / 100% 1px no-repeat; }
.pastille-serie { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px;
                  vertical-align: -1px; }
.pastille-serie.fb { background: #1877f2; }
.pastille-serie.ig { background: #dd2a7b; }
.pastille-serie.autre { background: #a3aebd; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; font-size: .85rem; color: var(--texte); }
.histo-col { flex: 1 1 0; min-width: 0; display: grid; grid-template-rows: auto auto; cursor: pointer;
             border-radius: 6px; outline-offset: 2px; }
.histo:has(.choisi) .histo-col:not(.choisi) .seg { opacity: .45; }
.histo-zone { height: 130px; padding-top: 16px; box-sizing: border-box; display: flex; flex-direction: column;
              justify-content: flex-end; align-items: center; padding-bottom: 1px; }
.histo-pile { position: relative; flex-shrink: 0; width: 100%; max-width: 24px; display: flex;
              flex-direction: column-reverse; gap: 2px; }
/* Total au-dessus de la barre, hors du flux : il ne raccourcit pas la plus haute. */
.histo-val { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
             font-size: .7rem; font-weight: 700; color: var(--texte); line-height: 1;
             font-variant-numeric: tabular-nums; }
.histo-pile .seg { min-height: 2px; flex-basis: 0; }
.histo-pile .seg:last-child { border-radius: 4px 4px 0 0; }
.seg.fb { background: var(--fb); }
.seg.ig { background: var(--ig); }
.seg.autre { background: var(--autre); }
.histo-axe { display: grid; justify-items: center; padding-top: 4px; min-height: 14px; font-size: .65rem;
             color: var(--doux); line-height: 1.25; white-space: nowrap; }
/* Étiquette plus large que sa colonne (« 22/09 » sur 30 jours) : centrée sous
   la barre, débordant autant des deux côtés. */
.histo-axe span { width: 0; display: flex; justify-content: center; }
.histo.serre { gap: 1px; }
.histo-detail { margin: 8px 0 0; min-height: 1.2em; }
table.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tableau th { text-align: left; color: var(--doux); font-weight: 700; font-size: .78rem; padding: 0 0 8px; }
table.tableau td { padding: 8px 0; border-top: 1px solid var(--ligne); }
table.tableau td + td, table.tableau th + th { text-align: right; padding-left: 8px; }

/* --- Réglages ------------------------------------------------------------------ */
.reglage { display: flex; align-items: center; gap: 12px; }
.reglage .corps { flex: 1; display: grid; }
.etat { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.etat.ok { background: var(--vert-pale); color: var(--vert); }
.etat.non { background: var(--orange-pale); color: var(--orange); }
.modele-sms { white-space: pre-wrap; background: var(--fond); border-radius: 12px; padding: 12px; font-size: .9rem; margin: 6px 0 0; }

/* --- htmx -------------------------------------------------------------------------- */
.htmx-request { opacity: .6; transition: opacity .2s; }
.indicateur { display: none; }
.indicateur.htmx-request { display: flex; opacity: 1; align-items: center; gap: 8px; }
.marge { margin-top: 12px; }

/* Réglages → Notifications */
.rangee-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.rangee-boutons .bouton[hidden] { display: none; }
.case { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.case input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--bleu); }

/* Devis par formulaire (docs/SPEC-DEVIS-FORMULAIRE.md) : compact, une
   prestation ouverte à la fois, les autres repliées en une ligne. */
#formulaire-devis { margin-top: 12px; gap: 10px; }
#prestations { gap: 10px; }
fieldset.carte { border: 0; margin: 0; min-width: 0; }
.puce { position: relative; }
.puce:has(input:checked) { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.puces.petites { gap: 6px; margin: 10px 0 0; }
.puces.petites .puce { padding: 6px 12px; font-size: .85rem; }

/* Boutons collés (type d'option, places, déplacement, mode du devis). */
.segments { display: flex; gap: 3px; padding: 3px; margin: 10px 0 0; background: var(--fond); border-radius: 12px; }
.segments > label, .segments > a {
  position: relative; display: block; flex: 1 1 auto; min-width: 0; padding: 8px 6px; border-radius: 9px;
  text-align: center; font-size: .8rem; font-weight: 600; color: var(--texte); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.segments > label:has(input:checked), .segments > a.active {
  background: var(--carte); color: var(--bleu); box-shadow: 0 1px 3px rgba(13, 38, 89, .18);
}

.prestation-tete { display: flex; align-items: center; gap: 8px; }
.choix-type { flex: 1; font-weight: 700; padding: 10px 12px; }
.bouton-icone { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%;
                background: transparent; color: var(--doux); cursor: pointer; }
.ligne-champs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 10px 0 0; }
.ligne-champs .champ-large { flex: 1 1 160px; }
.champ-court { flex: 0 1 150px; }
.ligne-champs label, .montant-supplement { font-size: .85rem; }
.avec-unite { display: flex; align-items: center; gap: 6px; }
.avec-unite input { min-width: 0; padding: 9px 10px; }
.avec-unite select { width: auto; padding: 9px 8px; }
.avec-unite > span { color: var(--doux); font-weight: 600; }
.quantite { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.quantite > span { margin-right: 4px; font-size: .85rem; font-weight: 600; color: var(--marine); }
.quantite input { width: 48px; padding: 9px 4px; text-align: center; font-weight: 700; }
.quantite button { width: 36px; height: 36px; border: 1px solid var(--ligne); border-radius: 50%; background: var(--carte);
                   color: var(--bleu); font-size: 1.2rem; line-height: 1; cursor: pointer; }
/* Montant d'un supplément ou du déplacement : visible seulement quand il sert. */
.montant-supplement, .montant-deplacement { display: none; }
.prestation:has([data-sup="tres_sale"]:checked) [data-montant-sup="tres_sale"],
.prestation:has([data-sup="poils_animaux"]:checked) [data-montant-sup="poils_animaux"],
.prestation:has([data-sup="urine_vomissures"]:checked) [data-montant-sup="urine_vomissures"],
.deplacement:has(input[value="montant"]:checked) .montant-deplacement {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px;
}
.montant-supplement .avec-unite, .montant-deplacement .avec-unite { width: 130px; }
.repli-discret { margin-top: 10px; }
.repli-discret > summary { color: var(--bleu); font-size: .88rem; font-weight: 600; cursor: pointer; }
.repli-discret[open] > summary { margin-bottom: 2px; }
.ok-prestation { width: 100%; margin-top: 12px; }
.prestation .erreur { margin: 10px 0 0; }

/* Prestation repliée : une ligne. */
.prestation.repliee { padding: 10px 8px 10px 14px; }
.resume-prestation { display: flex; align-items: center; gap: 4px; }
.resume-prestation .texte { flex: 1; min-width: 0; }
.resume-prestation strong { display: block; }
.resume-prestation .aide { display: block; }

.ajout-prestation { width: 100%; background: transparent; border: 1.5px dashed var(--bleu-ciel); color: var(--bleu); }
.carte.lieu { display: grid; gap: 8px; }
.carte.lieu .bloc-titre { margin-bottom: 2px; }
.deplacement { margin-top: 4px; }
.deplacement .segments { margin-top: 4px; }
.liste-manques { margin: 0; padding-left: 20px; }
/* Pendant un recalcul, « Valider » attend : il validerait l'ancien calcul. */
#apercu.htmx-request .bouton { pointer-events: none; }
