/* ═══════════════════════════════════════════════════════════════════════════
   ui.css — Système visuel repris de FichTech, pensé d'abord pour le téléphone
   (grandes zones tactiles, tiroirs qui montent du bas, lignes à glisser).
   Le contenu des pages utilise aussi Tailwind ; ce fichier gère la coque et les listes.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Couleurs de la marque Escales & Co (ivoire, marine, or) ; mise en page « agenda » compacte */
    --police:      'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --police-titre:'Cormorant Garamond', Georgia, serif;
    --encre:       #14284b;   /* barre du haut, menu latéral */
    --accent:      #14284b;   /* boutons principaux, éléments actifs */
    --accent-fonce:#0d1c38;
    --accent-fond: #e9edf5;
    --or:          #b8894f;
    --or-fond:     #f6ecdd;
    --brun:        var(--accent);
    --brun-fonce:  var(--encre);
    --terre:       var(--accent);
    --terre-clair: var(--accent-fond);
    --fond:        #f6f2ea;   /* ivoire */
    --carte:       #fffdf9;
    --trait:       #ebe4d7;
    --neutre:      #efe9df;   /* boutons secondaires, segments */
    --neutre-fonce:#e2d9ca;
    --texte:       #1b2540;
    --texte-doux:  #6d7180;
    --vert:        #2f7a57;  --vert-fond:   #e4f1ea;
    --orange:      #a65d24;  --orange-fond: #f9ead9;
    --rouge:       #b42318;  --rouge-fond:  #fbe9e6;
    --bleu:        #14284b;  --bleu-fond:   #e9edf5;
    /* Repères de type (trait de couleur à gauche des lignes) */
    --t-arrivee:   #3f8f6b;
    --t-depart:    #c9773b;
    --t-menage:    #14284b;
    --t-alerte:    #b42318;
    --rayon:       12px;
    --ombre:       none;
    --ombre-haute: 0 -6px 30px rgba(20,40,75,.16);
    --barre-bas:   64px;
    --haut:        56px;
    --sur-bas:     env(safe-area-inset-bottom, 0px);
}

* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body.ui {
    margin: 0;
    font-family: var(--police);
    background: var(--fond);
    color: var(--texte);
    font-size: 17px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    overscroll-behavior-y: contain;
}
body.ui.sheet-open { overflow: hidden; }

/* ─── Barre du haut ──────────────────────────────────────────────────────── */
.app-bar {
    position: sticky; top: 0; z-index: 30;
    height: var(--haut);
    display: flex; align-items: center; gap: 4px;
    padding: 0 6px 0 4px;
    background: var(--encre); color: #fff;
    box-shadow: none;
}
.app-bar h1 {
    flex: 1; min-width: 0; margin: 0 6px;
    font-size: 20px; font-weight: 600; letter-spacing: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-bar .icone { color: #fff; }
.app-bar .sous-titre { display: block; font-size: 12px; font-weight: 500; opacity: .75; }

.icone {
    width: 44px; height: 44px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: transparent; border-radius: 50%;
    color: var(--texte); cursor: pointer; text-decoration: none;
}
.icone:active { background: rgba(127,127,127,.18); }
.icone svg { width: 24px; height: 24px; }

/* ─── Mise en page ───────────────────────────────────────────────────────── */
.page {
    max-width: 760px; margin: 0 auto;
    padding: 12px 12px calc(var(--barre-bas) + var(--sur-bas) + 88px);
}
.page.large { max-width: 1100px; }
.colonnes { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
    .colonnes.deux { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* ─── Barre d'onglets (téléphone) / menu latéral (ordinateur) ────────────── */
.tab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--barre-bas) + var(--sur-bas));
    padding-bottom: var(--sur-bas);
    display: flex; background: var(--carte);
    border-top: 1px solid var(--trait);
}
.tab-bar a, .tab-bar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border: 0; background: none; cursor: pointer;
    font: 600 12px/1 var(--police); color: var(--texte-doux); text-decoration: none;
}
.tab-bar svg { width: 25px; height: 25px; }
.tab-bar .actif { color: var(--accent); }
.tab-bar .actif svg { stroke-width: 2.4; }

.side-nav { display: none; }
@media (min-width: 1024px) {
    .tab-bar { display: none; }
    .page { padding-bottom: 96px; }
    body.ui.avec-nav { padding-left: 232px; }
    .side-nav {
        display: flex; flex-direction: column; gap: 2px;
        position: fixed; top: 0; bottom: 0; left: 0; width: 232px; z-index: 35;
        padding: 14px 10px; background: var(--brun-fonce); color: #fff; overflow-y: auto;
    }
    .side-nav .marque { font-weight: 700; font-size: 21px; letter-spacing: .01em; padding: 6px 12px 16px; color: #fff; text-decoration: none; }
    .side-nav a {
        display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
        color: rgba(255,255,255,.78); text-decoration: none; font-weight: 550; font-size: 15px;
    }
    .side-nav a svg { width: 21px; height: 21px; }
    .side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
    .side-nav a.actif { background: rgba(255,255,255,.14); color: #fff; }
    .side-nav .bas { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }
    .side-nav .qui { font-size: 13px; color: rgba(255,255,255,.6); padding: 4px 12px 8px; }
    .app-bar .seulement-mobile { display: none; }
}

/* ─── Cartes et listes ───────────────────────────────────────────────────── */
.carte {
    background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
    border: 1px solid var(--trait); overflow: hidden;
}
.carte + .carte, .carte + .titre-section, .liste + .titre-section { margin-top: 12px; }
.carte.pad { padding: 14px 16px; }
.titre-section {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin: 18px 4px 8px; font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: var(--texte-doux);
}
.titre-section:first-child { margin-top: 4px; }
.titre-section .lien { text-transform: none; letter-spacing: 0; font-size: 14px; }

.ligne {
    position: relative; display: flex; align-items: center; gap: 12px;
    min-height: 60px; padding: 10px 16px; background: var(--carte);
    color: inherit; text-decoration: none;
}
.ligne + .ligne, .swipe + .swipe, .swipe + .ligne, .ligne + .swipe { border-top: 1px solid var(--trait); }
a.ligne:active, button.ligne:active, .ligne.cliquable:active { background: var(--neutre); }
button.ligne { width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .titre { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .titre.multi { white-space: normal; }
.ligne .sous { font-size: 14px; color: var(--texte-doux); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .fin { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ligne .valeur { font-weight: 650; font-variant-numeric: tabular-nums; }
.ligne .poignee { color: #b7c0cb; cursor: grab; touch-action: none; margin-left: -6px; padding: 8px 4px; }
.ligne .chevron { color: #b7c0cb; width: 18px; height: 18px; flex-shrink: 0; }
.vide { padding: 28px 16px; text-align: center; color: var(--texte-doux); font-size: 15px; }

/* ─── Lignes à glisser ───────────────────────────────────────────────────── */
.swipe { position: relative; overflow: hidden; background: var(--carte); }
.swipe .swipe-actions {
    position: absolute; top: 0; bottom: 0; display: flex; align-items: stretch;
}
.swipe:not(.glisse):not([data-ouvert="g"]):not([data-ouvert="d"]) .swipe-actions { visibility: hidden; }
.swipe .swipe-actions.droite { right: 0; }
.swipe .plus-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; width: 34px; height: 34px;
    border: 1px solid var(--trait); border-radius: 8px; background: var(--carte); color: var(--texte-doux); cursor: pointer;
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.swipe .plus-actions svg { width: 18px; height: 18px; }
.swipe:hover .plus-actions, .swipe .plus-actions:focus-visible { opacity: 1; }
.swipe[data-ouvert="g"] .plus-actions { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .swipe > .ligne { padding-right: 52px; } }
.swipe .swipe-actions.gauche { left: 0; }
.swipe .swipe-actions button {
    border: 0; min-width: 84px; padding: 0 14px; color: #fff; font: 650 14px var(--police);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.swipe .swipe-actions button svg { width: 22px; height: 22px; }
.swipe .a-supprimer { background: var(--rouge); }
.swipe .a-modifier  { background: var(--bleu); }
.swipe .a-autre     { background: #56616e; }
.swipe .a-ok        { background: var(--vert); }
.swipe > .ligne { transition: transform .22s cubic-bezier(.2,.8,.2,1); will-change: transform; touch-action: pan-y; }
.swipe.glisse > .ligne { transition: none; }

/* ─── Pastilles, badges ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 650;
    background: var(--neutre); color: var(--texte-doux); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge.vert   { background: var(--vert-fond);   color: var(--vert); }
.badge.orange { background: var(--orange-fond); color: var(--orange); }
.badge.rouge  { background: var(--rouge-fond);  color: var(--rouge); }
.badge.bleu   { background: var(--bleu-fond);   color: var(--bleu); }
.badge.petit  { font-size: 11px; padding: 2px 7px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.defile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 12px; margin: 0 -12px; }
/* Ordinateur (souris) : les filtres passent à la ligne au lieu de défiler de côté */
@media (hover: hover) and (pointer: fine), (min-width: 900px) {
    .chips.defile { flex-wrap: wrap; overflow: visible; padding: 2px 0; margin: 0; }
}
.chips.defile::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 0 14px; border-radius: 8px;
    border: 1px solid var(--trait); background: var(--carte); color: var(--texte);
    font: 600 15px var(--police); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.chip.actif { background: var(--encre); border-color: var(--encre); color: #fff; }
.chip .nb { font-size: 12px; opacity: .7; }

/* ─── Boutons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 20px; border-radius: 8px; border: 0; cursor: pointer;
    font: 650 16px var(--police); text-decoration: none;
    background: var(--neutre); color: var(--texte);
}
.btn:active { transform: scale(.98); }
.btn.primaire { background: var(--accent); color: #fff; }
.btn.primaire:hover { background: var(--accent-fonce); }
.btn.danger   { background: var(--rouge-fond); color: var(--rouge); }
.btn.contour  { background: transparent; border: 1.5px solid var(--trait); }
.btn.plein    { width: 100%; }
.btn.petit    { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 7px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.boutons { display: flex; gap: 10px; }
.boutons > .btn { flex: 1; }
.lien { color: var(--brun); font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; font-size: 15px; padding: 0; }

.fab {
    position: fixed; z-index: 38;
    right: 16px; bottom: calc(var(--barre-bas) + var(--sur-bas) + 16px);
    height: 56px; min-width: 56px; padding: 0 22px; border-radius: 12px; border: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent); color: #fff; font: 600 17px var(--police);
    box-shadow: 0 6px 18px rgba(20,40,75,.28); text-decoration: none;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.96); }
@media (min-width: 1024px) { .fab { bottom: 28px; right: 32px; } }

/* ─── Champs ─────────────────────────────────────────────────────────────── */
.champ { display: block; margin-bottom: 14px; }
.champ > span, .etiquette { display: block; font-size: 13px; font-weight: 650; color: var(--texte-doux); margin-bottom: 6px; }
.saisie {
    width: 100%; box-sizing: border-box; min-height: 50px; padding: 12px 14px;
    border: 1px solid var(--neutre-fonce); border-radius: 8px; background: #fff;
    font: 500 16px var(--police); color: var(--texte); -webkit-appearance: none; appearance: none;
}
.saisie:focus { outline: none; border-color: var(--terre); box-shadow: 0 0 0 3px rgba(184,137,79,.22); }
textarea.saisie { min-height: 96px; resize: vertical; line-height: 1.45; }
select.saisie { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%238c8480' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.saisie.grande { font-size: 28px; font-weight: 700; text-align: center; min-height: 64px; font-variant-numeric: tabular-nums; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.recherche { position: relative; }
.recherche svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--texte-doux); pointer-events: none; }
.recherche .saisie { padding-left: 44px; border-radius: 8px; background: var(--carte); border-color: var(--trait); box-shadow: var(--ombre); }

/* Pavé quantité : − valeur + */
.quantite { display: flex; align-items: center; gap: 10px; }
.quantite .saisie { flex: 1; }
.quantite .pas {
    width: 56px; height: 56px; flex-shrink: 0; border-radius: 8px; border: 0; cursor: pointer;
    background: var(--neutre); color: var(--texte); font: 700 26px/1 var(--police);
}
.quantite .pas:active { background: var(--neutre-fonce); }

/* Contrôle segmenté (onglets dans la page) */
.segments {
    display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--neutre); margin-bottom: 12px;
}
.segments button, .segments a {
    flex: 1; min-height: 40px; border: 0; border-radius: 7px; background: none; cursor: pointer;
    font: 650 15px var(--police); color: var(--texte-doux); text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.segments .actif { background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }
.segments svg { width: 18px; height: 18px; flex: none; }

/* ─── Tiroirs (bottom sheets) ────────────────────────────────────────────── */
.voile {
    position: fixed; inset: 0; z-index: 60; background: rgba(18,26,36,.45);
    opacity: 0; pointer-events: none; transition: opacity .22s;
}
.voile.ouvert { opacity: 1; pointer-events: auto; }
.tiroir {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
    max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
    background: var(--carte); border-radius: 16px 16px 0 0; box-shadow: var(--ombre-haute);
    transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
    padding-bottom: var(--sur-bas);
}
.tiroir.ouvert { transform: translateY(0); }
.tiroir.glisse { transition: none; }
.tiroir .tiroir-tete { padding: 8px 16px 6px; flex-shrink: 0; touch-action: none; }
.tiroir .tiroir-tete::before {
    content: ''; display: block; width: 40px; height: 5px; border-radius: 3px;
    background: var(--neutre-fonce); margin: 0 auto 10px;
}
.tiroir .tiroir-tete h2 { margin: 0; font-size: 19px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tiroir .tiroir-corps { padding: 8px 16px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tiroir .tiroir-pied { padding: 10px 16px 14px; border-top: 1px solid var(--trait); flex-shrink: 0; }
@media (min-width: 700px) {
    .tiroir { left: 50%; right: auto; width: 560px; margin-left: -280px; bottom: auto; top: 50%;
              border-radius: 14px; transform: translateY(-40%) scale(.97); opacity: 0; pointer-events: none;
              transition: transform .2s, opacity .2s; max-height: 86vh; }
    .tiroir.ouvert { transform: translateY(-50%); opacity: 1; pointer-events: auto; }
    .tiroir .tiroir-tete::before { display: none; }
}

/* Menu d'actions dans un tiroir */
.actions-liste .ligne { min-height: 54px; }
.actions-liste .ligne svg { width: 22px; height: 22px; color: var(--texte-doux); flex-shrink: 0; }
.actions-liste .ligne.danger, .actions-liste .ligne.danger svg { color: var(--rouge); }

/* Résultats de recherche dans un tiroir */
.resultats { margin: 8px -16px 0; }
.resultats .ligne { min-height: 54px; padding-left: 16px; }
.resultats .ligne.choisi { background: var(--terre-clair); }
.resultats .ligne > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }

/* ─── Messages ───────────────────────────────────────────────────────────── */
.annonce {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px;
    font-size: 14px; line-height: 1.4; margin-bottom: 12px;
}
.annonce.info    { background: var(--bleu-fond);   color: var(--bleu); }
.annonce.succes  { background: var(--vert-fond);   color: var(--vert); }
.annonce.alerte  { background: var(--orange-fond); color: var(--orange); }
.annonce.erreur  { background: var(--rouge-fond);  color: var(--rouge); }

.toasts {
    position: fixed; left: 12px; right: 12px; z-index: 80;
    bottom: calc(var(--barre-bas) + var(--sur-bas) + 12px);
    display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
    pointer-events: auto; max-width: 520px; width: 100%; box-sizing: border-box;
    display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 8px;
    background: var(--encre); color: #fff; font-size: 15px; font-weight: 550; box-shadow: 0 8px 24px rgba(0,0,0,.25);
    animation: toast-entree .22s ease-out;
}
.toast.erreur { background: var(--rouge); }
.toast span { flex: 1; }
.toast button { border: 0; background: none; color: #9db4e4; font: 700 15px var(--police); cursor: pointer; padding: 4px; }
@keyframes toast-entree { from { transform: translateY(12px); opacity: 0; } }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }

/* ─── Petits éléments ────────────────────────────────────────────────────── */
.stat-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .stat-grille { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); border: 1px solid var(--trait); padding: 14px; }
.stat .etiquette { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .nombre { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .detail { font-size: 13px; color: var(--texte-doux); margin-top: 2px; }

.doux { color: var(--texte-doux); }
.petit { font-size: 13px; }
.gras { font-weight: 650; }
.centre { text-align: center; }
.cache { display: none !important; }
.espace { height: 12px; }
.num-etape {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--terre-clair); color: var(--brun); font-weight: 750; font-size: 14px;
}
.sortable-ghost { opacity: .35; }
.sortable-chosen .ligne { box-shadow: 0 8px 24px rgba(0,0,0,.15); }

.annonce svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
@media (min-width: 900px) { .seulement-mobile { display: none !important; } }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.chip svg { width: 18px; height: 18px; }

/* Enregistrement en cours : boutons d'action bloqués (pas de double envoi) */
body.occupe .tiroir-pied .btn, body.occupe .fab, body.occupe [data-ok], body.occupe .swipe-actions button {
    opacity: .5; pointer-events: none;
}
body.occupe { cursor: progress; }

body.occupe .boutons .btn.primaire { opacity: .5; pointer-events: none; }

/* Mot de passe : un seul bouton « afficher » (Edge en ajoute un à lui) */
input::-ms-reveal, input::-ms-clear { display: none; }
/* Code d'invitation saisi */
.code-saisie { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: 20px; }

/* Écran Réglages */
.compte { display: flex; align-items: center; gap: 14px; }
.compte .corps { min-width: 0; }
.compte .titre { font-size: 20px; font-weight: 700; }
.compte .sous { font-size: 14px; color: var(--texte-doux); }
.avatar { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; background: var(--encre); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; letter-spacing: .03em; }
.pastille-icone { width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px; background: var(--neutre); color: var(--encre); display: flex; align-items: center; justify-content: center; }
.pastille-icone svg { width: 20px; height: 20px; }
.pastille-icone.accent { background: var(--accent); color: #fff; }
.pastille-icone.danger { background: var(--rouge-fond); color: var(--rouge); }

/* Équipe */
.avatar.petit-avatar { width: 40px; height: 40px; font-size: 15px; background: var(--neutre); color: var(--encre); }
.avatar.attente { background: var(--orange-fond); color: var(--orange); }
.avatar.eteint { opacity: .45; }
.code-invitation { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 8px; background: var(--fond); border: 1px dashed var(--neutre-fonce); }
.code-invitation span { font-size: 26px; font-weight: 700; letter-spacing: .14em; }

/* Photos du plat (fiche recette) */
.galerie { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 0 12px; }
.galerie::-webkit-scrollbar { display: none; }
.galerie .photo { flex: 0 0 auto; width: min(78%, 360px); aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: var(--rayon); overflow: hidden; background: var(--neutre); cursor: zoom-in; scroll-snap-align: start; }
.galerie.une .photo { width: 100%; max-width: none; aspect-ratio: 16 / 9; }
.galerie .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-ajout { flex: 0 0 auto; width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--neutre-fonce); border-radius: var(--rayon); color: var(--texte-doux); font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; padding: 8px; }
.photo-ajout.seule { width: 100%; flex-direction: row; min-height: 64px; }
.photo-ajout svg { width: 22px; height: 22px; }
.carrousel-zone { position: relative; margin-bottom: 12px; }
.carrousel-zone .galerie { margin-bottom: 0; }
.galerie.une .photo-ajout { position: absolute; right: 10px; bottom: 10px; width: auto; min-height: 0; flex-direction: row; padding: 8px 12px; background: rgba(18,26,36,.72); border: 0; color: #fff; }
.fleche-photo { display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: rgba(18,26,36,.72); color: #fff; cursor: pointer; align-items: center; justify-content: center; }
.fleche-photo svg { width: 22px; height: 22px; }
.fleche-photo.gauche { left: 10px; } .fleche-photo.droite { right: 10px; }
@media (hover: hover) and (pointer: fine) { .carrousel-zone .fleche-photo { display: flex; } }
.compteur-photos { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(18,26,36,.72); color: #fff; font-size: 14px; font-weight: 600; pointer-events: none; }
/* Vignette dans les listes */
.vignette { width: 48px; height: 48px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--neutre); color: var(--texte-doux); display: flex; align-items: center; justify-content: center; }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette svg { width: 22px; height: 22px; opacity: .7; }

/* Joindre un fournisseur : appeler, e-mail, WhatsApp */
.actions-contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.actions-contact .btn { flex-direction: column; gap: 4px; min-height: 64px; padding: 8px 4px; background: var(--carte); border: 1px solid var(--trait); color: var(--accent); font-size: 15px; }
.actions-contact .btn svg { width: 22px; height: 22px; }
.actions-contact .btn.whatsapp { background: var(--accent); border-color: var(--accent); color: #fff; }
.actions-contact .btn.vide-contact { color: var(--texte-doux); background: transparent; border-style: dashed; }


/* ─── Propre à cette application ─────────────────────────────────────────── */
/* Contenu des pages (Tailwind) dans la coque */
.page h1.titre-page { display: none; }   /* le titre est dans la barre du haut */
.app-bar .cloche { position: relative; }
.app-bar .cloche .pastille { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: #dc2626; color: #fff; font: 700 11px/18px var(--police); text-align: center; }
.app-bar .marque-mobile { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.app-bar .marque-mobile img { width: 30px; height: 30px; border-radius: 7px; }
@media (min-width: 1024px) { .app-bar .marque-mobile { display: none; } }
.side-nav .marque { display: flex; align-items: center; gap: 10px; }
.side-nav .marque img { width: 30px; height: 30px; border-radius: 7px; }
.side-nav .groupe { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); }
/* Formulaires : messages des champs mis en forme automatiquement */
.aide-champ { margin-top: 4px; font-size: 13px; color: var(--texte-doux); }
.adresse-ok { color: var(--vert); }
.adresse-ko { color: var(--orange); }
.suggestions-adresse { position: absolute; z-index: 45; left: 0; right: 0; margin-top: 4px; border-radius: 8px; border: 1px solid var(--trait);
    background: var(--carte); box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 300px; overflow: auto; list-style: none; padding: 0; }
.suggestions-adresse li { padding: 12px 14px; cursor: pointer; font-size: 15px; }
.suggestions-adresse li + li { border-top: 1px solid var(--trait); }
.suggestions-adresse li.choisie, .suggestions-adresse li:hover { background: var(--accent-fond); }
.suggestions-adresse .ville { display: block; font-size: 13px; color: var(--texte-doux); }

/* Icônes dans les liens et les boutons-liens (sinon elles prennent toute la largeur) */
.lien svg { width: 18px; height: 18px; vertical-align: -3px; display: inline-block; }
.titre-section svg { width: 16px; height: 16px; vertical-align: -2px; }


/* ═══ Listes « agenda » (piste B) ═══════════════════════════════════════════
   Pas de cadre global ni de pavés d'icônes : chaque ligne est une bande claire et compacte,
   un fin trait de couleur à gauche dit le type (arrivée, départ, ménage, alerte). */
.carte:has(> .ligne, > .swipe, > a.ligne) {
    background: transparent; border: 0; box-shadow: none; overflow: visible;
    display: flex; flex-direction: column; gap: 4px;
}
.carte:has(> .ligne, > .swipe) > .ligne, .carte:has(> .ligne, > .swipe) > .swipe { border-radius: var(--rayon); }
.carte:has(> .ligne, > .swipe) > .ligne + .ligne, .carte:has(> .ligne, > .swipe) > .swipe + .swipe,
.carte:has(> .ligne, > .swipe) > .swipe + .ligne, .carte:has(> .ligne, > .swipe) > .ligne + .swipe { border-top: 0; }
.carte:has(> .ligne, > .swipe) > .vide { background: var(--carte); border-radius: var(--rayon); }
.ligne { min-height: 52px; padding: 8px 14px; gap: 10px; }
.ligne .titre { font-size: 15px; font-weight: 650; }
.ligne .sous { font-size: 13px; }
.ligne .valeur { font-size: 15px; }
.ligne .heure { flex-shrink: 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--texte); }
.ligne .etat { font-size: 12px; font-weight: 600; color: var(--or); white-space: nowrap; }
.ligne .etat.alerte { color: var(--rouge); }
.ligne .etat.ok { color: var(--vert); }
/* Les icônes de liste deviennent discrètes (plus de pavé coloré) */
.pastille-icone { width: 22px; height: 22px; border-radius: 0; background: none; color: var(--texte-doux); }
.pastille-icone svg { width: 20px; height: 20px; }
.pastille-icone.accent { background: none; color: var(--or); }
.pastille-icone.danger { background: none; color: var(--rouge); }
/* Trait de type */
.repere { align-self: stretch; width: 3px; flex-shrink: 0; border-radius: 2px; background: var(--trait); margin: 2px 0; }
.repere.arrivee { background: var(--t-arrivee); }
.repere.depart  { background: var(--t-depart); }
.repere.menage  { background: var(--t-menage); }
.repere.alerte  { background: var(--t-alerte); }
.repere.or      { background: var(--or); }
/* En-tête de jour : date à gauche, résumé à droite */
.jour-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 18px 4px 6px; }
.jour-tete b { font-size: 14px; font-weight: 750; }
.jour-tete .resume { font-size: 12.5px; color: var(--texte-doux); text-align: right; }
.jour-tete.aujourdhui b { color: var(--or); }
.jour-tete .lien { font-size: 13px; }
/* Titres de section : sobres */
.titre-section { font-size: 12px; letter-spacing: .08em; }
.stat { box-shadow: none; }
.stat .nombre { font-size: 22px; }
.chip { border-radius: 999px; min-height: 36px; font-size: 14px; }
.chip.actif { background: var(--encre); border-color: var(--encre); }
.btn { border-radius: 10px; }
.badge { border-radius: 999px; font-weight: 650; }
.segments { border-radius: 999px; }
.segments button, .segments a { border-radius: 999px; }
.fab { border-radius: 999px; }
.tab-bar .actif { color: var(--encre); }
.tab-bar .actif svg { color: var(--or); }

/* ═══ Édition directe : l'information est le champ ══════════════════════════ */
.fiche-infos { display: flex; flex-direction: column; gap: 4px; }
.info { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: baseline;
        padding: 12px 14px; background: var(--carte); border-radius: var(--rayon); cursor: text; position: relative; }
.info:hover { background: #fffaf2; }
.info:focus-within, .info.edition { box-shadow: inset 0 0 0 1.5px var(--or); }
.info .nom-info { font-size: 13px; color: var(--texte-doux); }
.info .val-info { min-width: 0; overflow-wrap: anywhere; white-space: pre-line; font-size: 15px; }
.info .val-info.info-vide { color: var(--texte-doux); font-style: italic; }
.info input, .info textarea, .info select { width: 100%; box-sizing: border-box; font: 500 16px var(--police); color: var(--texte);
        border: 0; background: transparent; padding: 0; outline: none; }
.info textarea { min-height: 72px; resize: vertical; }
.info .erreur-info { grid-column: 2; font-size: 12.5px; color: var(--rouge); }
.info.ok::after { content: "✓ enregistré"; position: absolute; right: 12px; bottom: 3px; font-size: 11px; color: var(--vert); }
.info.lecture { cursor: default; }
@media (max-width: 420px) { .info { grid-template-columns: 96px minmax(0, 1fr); padding: 11px 12px; } }
.ligne .corps > .titre, .ligne .corps > .sous, .compte .corps > span { display: block; }
.compte .corps { flex: 1; }
.compte > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--texte-doux); }
.compte .avatar { flex-shrink: 0; }
.info .aide-format, .info .erreur-info { grid-column: 2; margin: 0; font-size: 12.5px; }

/* Carte « Aujourd'hui » de l'accueil : un seul lien vers le planning */
a.aujourdhui { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px;
               background: var(--neutre); color: inherit; text-decoration: none; }
a.aujourdhui:active { background: var(--neutre-fonce); }
a.aujourdhui .resume svg { width: 14px; height: 14px; vertical-align: -2px; }
/* Une carte entière qui mène quelque part */
a.carte-lien { display: block; color: inherit; text-decoration: none; }
a.carte-lien:active { opacity: .85; }
.carte-lien h1 svg { width: 18px; height: 18px; }
/* Une colonne de grille ne doit jamais élargir la page (texte long sur une ligne) */
.grid > * { min-width: 0; }
a.aujourdhui .resume { white-space: nowrap; }
