/* ═══════════════════════════════════════════════════════════════════════════
   ui.css — Système visuel de FichTech, pensé d'abord pour le téléphone
   (grandes zones tactiles, tiroirs qui montent du bas, lignes à glisser).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Style « Inox » : barre sombre, bleu acier, gris froids, police Barlow */
    --police:      'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --encre:       #121a24;   /* barre du haut, menu latéral */
    --accent:      #2452b8;   /* boutons principaux, éléments actifs */
    --accent-fonce:#1b3f8f;
    --accent-fond: #e4ebf7;
    --brun:        var(--accent);        /* anciens noms, gardés pour les pages existantes */
    --brun-fonce:  var(--encre);
    --terre:       var(--accent);
    --terre-clair: var(--accent-fond);
    --fond:        #eef1f4;
    --carte:       #ffffff;
    --trait:       #dde3ea;
    --neutre:      #e4e9f0;   /* boutons secondaires, segments */
    --neutre-fonce:#d3dae3;
    --texte:       #121a24;
    --texte-doux:  #56616e;
    --vert:        #17663a;  --vert-fond:   #e3f3e8;
    --orange:      #9a4a06;  --orange-fond: #fdf0dc;
    --rouge:       #b42318;  --rouge-fond:  #fdecea;
    --bleu:        #2452b8;  --bleu-fond:   #e4ebf7;
    --rayon:       10px;
    --ombre:       0 1px 2px rgba(18,26,36,.05);
    --ombre-haute: 0 -6px 30px rgba(18,26,36,.18);
    --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: #f3f6f9; }
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; }
.nom-lien { color: inherit; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .nom-lien:hover { color: var(--bleu); text-decoration: underline; text-underline-offset: 3px; } }
.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(36,82,184,.35); 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(36,82,184,.18); }
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); }

/* Anciennes pages pas encore refaites : elles s'affichent dans la nouvelle coque */
body.ui .ancien { padding: 12px 12px calc(var(--barre-bas) + var(--sur-bas) + 24px); max-width: 1100px; margin: 0 auto; }
@media (min-width: 1024px) { body.ui .ancien { padding: 24px; } }

.annonce svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
@media (min-width: 900px) { .seulement-mobile { display: none !important; } }
.seulement-ordi { display: none !important; }
@media (min-width: 900px) { .seulement-ordi { display: inline-flex !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; }

/* Niveau d'une recette : base, plat, assiette */
.choix-niveau { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--neutre); }
.choix-niveau label { flex: 1; position: relative; }
.choix-niveau input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choix-niveau span { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 7px; font: 600 16px var(--police); color: var(--texte-doux); }
.choix-niveau input:checked + span { background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }
.choix-niveau input:focus-visible + span { outline: 2px solid var(--terre); }
.niveau { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-right: 4px; background: var(--neutre); color: var(--texte-doux); }
.niveau-base { background: var(--bleu-fond); color: var(--bleu); }
.niveau-assiette { background: var(--vert-fond); color: var(--vert); }
.segments .nb { font-size: 12px; opacity: .6; font-weight: 600; }

/* Quantité + unité (pastilles), comme le formulaire de prix */
.mesure { display: flex; gap: 8px; align-items: center; }
.mesure > .saisie { flex: 1; min-width: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mesure .suffixe { flex: none; width: 150px; box-sizing: border-box; padding-left: 12px; color: var(--texte-doux); font-weight: 600; font-size: 16px; }
.segment-unites { flex: none; display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--neutre); }
.mesure:not(.mesure-large) .segment-unites { width: 150px; box-sizing: border-box; }
.segment-unites label { position: relative; flex: 1; }
.segment-unites input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segment-unites span { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px;
    border-radius: 7px; font-weight: 600; font-size: 16px; color: var(--texte-doux); white-space: nowrap; }
.segment-unites input:checked + span { background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }
.segment-unites input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.mesure.mesure-large { flex-wrap: wrap; }
.mesure.mesure-large > .saisie { flex-basis: 100%; }
.mesure.mesure-large .segment-unites { flex-wrap: wrap; width: 100%; box-sizing: border-box; }
.mesure.alerte .segment-unites { box-shadow: 0 0 0 2px var(--orange); }

/* 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); }

/* Tiroir d'un ingrédient : le produit, modifiable */
.ligne-produit { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; background: var(--fond); border: 1px solid var(--trait); }
.ligne-produit .corps { flex: 1; min-width: 0; }
.ligne-produit .gras { font-size: 17px; }
.ligne-produit.change { border-color: var(--accent); background: var(--accent-fond); }

/* É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; }
