:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel2: #1e222b;
  --border: #2a2f3a;
  --text: #e7e9ee;
  --muted: #8b90a0;
  --accent: #6ea8fe;
  --ok: #34d399;
  --err: #ef4444;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 0.9em; }
.error { color: var(--err); min-height: 1.2em; }

input, select, textarea {
  background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 11px; border-radius: 8px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

button {
  padding: 9px 16px; border-radius: 9px; font: inherit; cursor: pointer;
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
}
button.primary { background: var(--accent); color: #0b1020; border: 0; font-weight: 600; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.ghost:hover { border-color: var(--accent); color: var(--text); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }

/* ---- Login ---- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login form { width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; }
.login h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.login .logo-img { width: 34px; height: 34px; }

/* ---- Choix de l'établissement (bulles) ---- */
.choix { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.choix-box { width: min(760px, 100%); text-align: center; }
.choix h1 { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.choix .logo-img { width: 34px; height: 34px; }
.choix form { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }

.bulles { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 26px; }
.bulle {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 150px; padding: 16px 10px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px;
}
.bulle:hover { border-color: var(--accent); }
.bulle.actif { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.bulle-rond {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--panel2); border: 1px solid var(--border);
  font-size: 1.4em; font-weight: 700; letter-spacing: 0.02em; color: var(--accent);
}
.bulle.actif .bulle-rond { background: var(--accent); color: #0b1020; border-color: var(--accent); }
/* Le nombre de commandes en attente : c'est lui qui dit où aller en premier. */
.bulle-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; padding: 0 5px;
  border-radius: 999px; background: var(--n-appel); color: #fff;
  font-size: 0.62em; line-height: 20px; font-weight: 700;
}
.bulle-nom { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulle-sous { color: var(--muted); font-size: 0.78em; }
.bulle-plus .bulle-rond { color: var(--muted); border-style: dashed; }

/* ---- Page client : ajustement de la commande depuis le lien SMS ---- */
/* Pensée pour un pouce sur un téléphone : cibles larges, une colonne. */
.cl-ligne {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel2);
}
.cl-icone { flex: none; width: 1.6em; text-align: center; font-size: 1.2em; line-height: 1; }
.cl-nom { flex: 1; min-width: 0; }
.cl-prix { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cl-qte { display: flex; align-items: center; gap: 6px; }
.cl-qte button { width: 34px; height: 34px; padding: 0; font-size: 1.1em; line-height: 1; }
.cl-qte b { min-width: 1.2em; text-align: center; }

/* Un article de la carte : toute la ligne est cliquable pour l'ajouter. */
.cl-choix {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; margin-bottom: 5px; border-radius: 10px;
}
.cl-choix .cl-nom { font-weight: 400; }
.cl-choix .cl-ajout { flex: none; min-width: 2em; text-align: right; color: var(--accent); font-weight: 700; }
.cl-choix.pris { border-color: var(--accent); }

.cl-mode { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.cl-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 1.15em; font-weight: 700;
}
.cl-alerte {
  margin: 10px 0 0; padding: 9px 11px; border-radius: 9px;
  background: #f9731614; border: 1px solid #f9731655; color: var(--n-relance); font-size: 0.9em;
}

/* Pied de page légal de la page client : présent, mais discret. */
.cl-legal { margin: 16px auto 0; max-width: 480px; color: var(--muted); font-size: 0.8em; }
.cl-legal summary { cursor: pointer; padding: 6px 0; }
.cl-legal p { margin: 6px 0; line-height: 1.5; }

/* ---- Journal d'activité ---- */
.act-filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.act-filtres input { flex: 1 1 240px; }
.act-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
#activite-body td { font-size: 0.9em; }
.act-badge-info { color: var(--muted); }
.act-badge-warn { color: var(--n-attente); border-color: #f1c40f55; background: #f1c40f14; }
.act-badge-error { color: var(--n-appel); border-color: #ef444455; background: #ef444414; }
/* Une erreur doit sauter aux yeux dans une longue liste. */
tr.act-error { background: #ef44440a; }

/* ---- Topbar ---- */
header.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-img { width: 36px; height: 36px; border-radius: 50%; }
.brand h1 { font-size: 1.1em; margin: 0; }
/* Logo et titre : retour aux commandes. */
.accueil { cursor: pointer; }
.brand h1.accueil:hover { color: var(--accent); }
img.logo-img.accueil:hover { filter: brightness(1.15); }
.resto-nom {
  display: block; margin-top: 1px; padding: 0; border: 0; background: none;
  color: var(--muted); font-size: 0.8em; cursor: pointer; text-align: left;
  border-bottom: 1px dotted var(--border);
}
.resto-nom:hover { color: var(--accent); border-bottom-color: var(--accent); }
.col-resto { white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

nav.tabs { display: flex; gap: 8px; padding: 14px 22px 0; }
nav.tabs button { border-radius: 20px; padding: 7px 16px; }
nav.tabs button.active { background: var(--accent); color: #0b1020; border-color: var(--accent); font-weight: 600; }

main { padding: 18px 22px 40px; max-width: 1100px; margin: 0 auto; }

/* ---- Table commandes ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.02em; }

.badge { padding: 2px 10px; border-radius: 999px; font-size: 0.8em; border: 1px solid var(--border); white-space: nowrap; }

/* ---- Escalade des commandes : la couleur dit ce qu'il reste à faire ---- */
:root { --n-valide: #34d399; --n-attente: #f1c40f; --n-relance: #f97316; --n-appel: #ef4444; }

.badge-valide  { color: var(--n-valide);  border-color: #34d39955; background: #34d39914; }
.badge-attente { color: var(--n-attente); border-color: #f1c40f55; background: #f1c40f14; }
.badge-relance { color: var(--n-relance); border-color: #f9731655; background: #f9731614; }
.badge-appel   { color: #fff; border-color: var(--n-appel); background: var(--n-appel); font-weight: 600; }
.badge-annule  { color: var(--muted); }

/* Liseré coloré en tête de ligne : lisible d'un coup d'œil à distance. */
tr[data-niveau] td:first-child { border-left: 4px solid transparent; }
tr[data-niveau='valide']  td:first-child { border-left-color: var(--n-valide); }
tr[data-niveau='attente'] td:first-child { border-left-color: var(--n-attente); }
tr[data-niveau='relance'] td:first-child { border-left-color: var(--n-relance); }
tr[data-niveau='appel']   td:first-child { border-left-color: var(--n-appel); }
tr[data-niveau='appel'] { background: #ef444410; }

/* Bouton d'appel : halo rouge pulsant, impossible à manquer. */
.btn-appel {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--n-appel); color: #fff; border: 0; font-weight: 600;
  border-radius: 9px; padding: 8px 14px; text-decoration: none;
  animation: halo-appel 1.2s ease-in-out infinite;
}
.btn-appel:hover { filter: brightness(1.1); }
@keyframes halo-appel {
  0%, 100% { box-shadow: 0 0 0 0 #ef444488; }
  50%      { box-shadow: 0 0 0 10px #ef444400; }
}
/* Respecte les préférences d'accessibilité : pas de clignotement imposé. */
@media (prefers-reduced-motion: reduce) {
  .btn-appel { animation: none; box-shadow: 0 0 0 3px #ef444455; }
}

.legende { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; font-size: 0.85em; color: var(--muted); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; font-style: normal; }

/* ---- Admin : sidebar + contenu ---- */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: start; }
.admin-menu { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 18px; }
.adm-item { text-align: left; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 9px; padding: 9px 12px; }
.adm-item:hover { color: var(--text); }
.adm-item.active { background: var(--panel2); color: var(--text); border-color: var(--border); }
.admin-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.adm-sec { display: flex; flex-direction: column; gap: 16px; }

.api-card h3 { margin: 0 0 4px; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 10px; }
.cfg-f { display: flex; flex-direction: column; gap: 5px; }
.cfg-f label { font-size: 0.85em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cfg-f input, .cfg-f select { width: 100%; }
.set-flag { display: inline-block; }
.set-flag.on::after { content: '✓ configurée'; color: var(--ok); font-size: 0.85em; }
.set-flag.off::after { content: '— non configurée'; color: var(--muted); font-size: 0.85em; }
.provider-models { display: none; }
.provider-models.active { display: block; }
.api-actions { display: flex; align-items: center; gap: 12px; }
.cfg-status { font-size: 0.9em; }

/* ---- Utilisateurs ---- */
.utable td, .utable th { padding: 8px 10px; }
/* Attribution des numéros Twilio, colonne Restaurants de la vue Utilisateurs. */
.adm-resto { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.adm-resto-nom { min-width: 120px; }
.adm-num { width: 190px; font-size: 0.9em; padding: 6px 9px; }
/* Le champ désactivé doit se lire comme une donnée, pas comme une saisie. */
input:disabled { opacity: 0.75; cursor: not-allowed; }
#user-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ---- Menu du restaurant ---- */
#menu-wrap { display: flex; flex-direction: column; gap: 16px; }
#article-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
#article-form input { flex: 1 1 140px; min-width: 110px; }

.btn-like {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 9px 16px; border-radius: 9px; background: var(--panel2);
  border: 1px solid var(--border); color: var(--text); font-size: 0.95em;
}
.btn-like:hover { border-color: var(--accent); }
.scan-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.chk { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.9em; }
.scan-apercu { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.scan-apercu img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.scan-img, .scan-pdf { position: relative; }
.scan-apercu button[data-rm] {
  position: absolute; top: -6px; right: -6px; padding: 0; width: 20px; height: 20px;
  border-radius: 50%; line-height: 1; font-size: 0.7em; background: var(--panel);
}
.scan-pdf {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 74px; height: 74px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel2); font-size: 1.5em;
}
.scan-pdf .sp-nom {
  font-size: 0.42em; color: var(--muted); max-width: 68px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; padding: 0 3px;
}

.menu-cat { margin-top: 18px; }
.menu-cat h4 { margin: 0 0 6px; color: var(--accent); font-size: 0.95em; }
.menu-ligne {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel2); margin-bottom: 6px;
}
/* Largeur fixe : les icônes restent alignées d'une ligne à l'autre, quelle que
   soit la largeur du glyphe (et celle du pictogramme neutre par défaut). */
.menu-ligne .ml-icone { flex: none; width: 1.6em; text-align: center; font-size: 1.15em; line-height: 1; }
/* Vignette découpée dans la photo de la carte : même gabarit que l'emoji
   qu'elle remplace, pour que les lignes restent alignées. */
.menu-ligne .ml-vignette { flex: none; padding: 0; border: 0; background: none; line-height: 0; border-radius: 8px; }
.menu-ligne .ml-vignette img {
  width: 40px; height: 40px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); display: block;
}
.menu-ligne .ml-vignette:hover img { border-color: var(--err); opacity: 0.75; }
.menu-ligne .ml-nom { flex: 1; min-width: 0; }
.menu-ligne .ml-prix { font-variant-numeric: tabular-nums; font-weight: 600; }
.menu-ligne.indispo { opacity: 0.5; }

/* ---- Lignes et totaux dans le tableau des commandes ---- */
.cmd-lignes { margin: 0; padding-left: 16px; }
.cmd-lignes li { margin-bottom: 2px; }
/* Le prix ne doit jamais se couper avant son symbole. */
.cmd-lignes li .muted { white-space: nowrap; }
.cmd-brut { color: var(--muted); font-style: italic; }
.cmd-alerte { color: var(--n-relance); font-size: 0.85em; margin-top: 4px; }
/* Adresse de livraison, sous la commande : c'est ce que le livreur doit lire. */
/* Lien vers la cartographie : le livreur clique au lieu de recopier. */
.cmd-adresse {
  display: inline-block; text-decoration: none;
  margin-top: 5px; padding: 4px 8px; border-radius: 7px;
  background: #6ea8fe14; border: 1px solid #6ea8fe33; color: var(--accent); font-size: 0.88em;
}
.cmd-adresse:hover { border-color: var(--accent); text-decoration: underline; }
.cl-adresse { display: flex; flex-direction: column; gap: 5px; margin: 12px 0 4px; }
.cl-adresse textarea { width: 100%; resize: vertical; }
.cmd-total { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.mode-sel { padding: 5px 8px; font-size: 0.9em; }
/* La cellule reste une cellule de tableau — un display:flex posé dessus la
   sortirait du tableau et couperait le filet horizontal de la ligne. Ce sont
   les boutons, dans un conteneur interne, qui s'organisent en flex. */
/* Compte à rebours de préparation : chiffres à chasse fixe pour qu'il ne
   tremble pas à chaque seconde, et couleur qui suit l'urgence. */
.minuteur {
  display: inline-block; margin-top: 4px; font-size: 0.82em; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--n-valide);
}
.minuteur.bientot { color: var(--n-attente); }
.minuteur.retard { color: var(--n-appel); }

/* Archiver : action courante, elle doit se voir — contrairement à supprimer,
   qui reste en retrait. */
.lien-client { border-color: var(--accent); color: var(--accent); }
.lien-client:hover { background: #6ea8fe14; }
.archiver { border-color: var(--border); }
.archiver:hover { border-color: var(--accent); color: var(--accent); }

.td-actions { white-space: nowrap; }
/* Les actions se replient sur plusieurs lignes plutôt que d'étirer la colonne :
   la place gagnée revient au détail de la commande, qui est ce qu'on lit. */
.td-actions .actions {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  /* Largeur MINIMALE : c'est elle qui force la colonne à s'élargir assez pour
     tenir deux boutons par ligne. Un max-width ne ferait que subir la largeur
     que le tableau veut bien accorder. */
  min-width: 236px; max-width: 262px; margin-left: auto; justify-content: flex-end;
}
/* Le détail de la commande a besoin d'une largeur minimale, sinon chaque
   article se casse en un mot par ligne. */
.td-commande { min-width: 250px; }
/* Même gabarit que le badge de statut voisin : ce sont des actions de ligne,
   pas des boutons de formulaire. */
.td-actions .actions > button,
.td-actions .actions > .btn-appel {
  padding: 3px 12px; font-size: 0.82em; border-radius: 999px; line-height: 1.7;
}
.tel { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--border); white-space: nowrap; }

/* ---- Modale ---- */
.modal {
  position: fixed; inset: 0; background: #000000aa; display: flex;
  align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-card { position: relative; width: min(460px, 100%); display: flex; flex-direction: column; gap: 12px; }
/* Fermeture explicite : c'est le seul moyen de sortir à la souris, puisqu'un
   clic à côté ne ferme plus. */
.modal-fermer {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: transparent; border: 1px solid var(--border);
  color: var(--err); font-size: 0.95em; line-height: 1;
}
.modal-fermer:hover { background: var(--err); border-color: var(--err); color: #fff; }
.modal-card h3 { margin: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.mode-banner {
  text-align: center; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 9px; border-radius: 9px; font-size: 0.9em;
}
.mode-banner.LIVRAISON  { background: #6ea8fe22; color: var(--accent); border: 1px solid #6ea8fe55; }
.mode-banner.A_EMPORTER { background: #34d39922; color: var(--n-valide); border: 1px solid #34d39955; }
.mode-banner.SUR_PLACE  { background: #f1c40f22; color: var(--n-attente); border: 1px solid #f1c40f55; }
.accept-recap { background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-size: 0.92em; }
.accept-recap .ar-total { display: flex; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 7px; padding-top: 7px; font-weight: 700; }
.accept-recap .ar-l { display: flex; justify-content: space-between; gap: 10px; }

/* =========================================================================
   MOBILE — c'est l'usage principal : le restaurateur suit ses commandes
   depuis son téléphone, souvent d'une main et en cuisine. Les tableaux, qui
   ne tiennent pas sur 400 px de large, deviennent des cartes empilées : une
   commande = un bloc, avec le nom de chaque champ en étiquette.
   ========================================================================= */
@media (max-width: 760px) {
  main { padding: 12px 12px 48px; }

  /* -- Barre du haut : le nom du restaurant compte plus que le titre -- */
  header.topbar { padding: 10px 12px; gap: 10px; }
  .logo-img { width: 30px; height: 30px; }
  .brand h1 { font-size: 1em; }
  .topbar-right { gap: 8px; flex-shrink: 0; }
  /* L'email prend toute la place sur un petit écran, sans rien apprendre. */
  #whoami { display: none; }

  /* Onglets : défilement horizontal plutôt qu'un empilement sur trois lignes. */
  nav.tabs {
    padding: 10px 12px 0; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs button { white-space: nowrap; flex: none; }

  .legende { gap: 8px 14px; font-size: 0.8em; }

  /* -- Tableaux en cartes -- */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }

  tr {
    background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
    padding: 12px 14px; margin-bottom: 12px;
  }
  td { border: 0; padding: 5px 0; display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
  td::before {
    content: attr(data-l); flex: none; color: var(--muted);
    font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.04em;
  }
  td:not([data-l]) { justify-content: flex-start; }
  td:not([data-l])::before { content: none; }
  /* Une cellule vide ne doit pas laisser une ligne fantôme dans la carte. */
  td:empty { display: none; }

  /* Le détail de la commande a besoin de toute la largeur, sous son étiquette. */
  .td-commande { flex-direction: column; align-items: stretch; gap: 3px; }
  .cmd-lignes { padding-left: 18px; }

  /* La couleur d'urgence passe du filet de cellule au bord de la carte. */
  tr[data-niveau] td:first-child { border-left: 0; }
  tr[data-niveau] { border-left-width: 4px; }
  tr[data-niveau='valide']  { border-left-color: var(--n-valide); }
  tr[data-niveau='attente'] { border-left-color: var(--n-attente); }
  tr[data-niveau='relance'] { border-left-color: var(--n-relance); }
  tr[data-niveau='appel']   { border-left-color: var(--n-appel); }

  /* Actions : pleine largeur et hautes, on les vise au pouce. */
  .td-actions { display: block; white-space: normal; }
  .td-actions .actions {
    flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--border);
    min-width: 0; max-width: none; margin-left: 0; justify-content: flex-start;
  }
  .td-actions .actions > button,
  .td-actions .actions > .btn-appel {
    flex: 1 1 46%; min-height: 44px; text-align: center;
    font-size: 0.95em; padding: 9px 12px; border-radius: 10px;
  }
  .td-actions .btn-appel { display: flex; align-items: center; justify-content: center; }
  .mode-sel { min-height: 38px; }

  /* -- Formulaires et cartes -- */
  .card { padding: 16px; }
  .cfg-grid { grid-template-columns: 1fr; }
  #article-form input, #user-form input, #user-form select { flex: 1 1 100%; }
  #article-form button, #user-form button { width: 100%; min-height: 44px; }
  .api-actions { flex-wrap: wrap; }
  .api-actions button { flex: 1 1 100%; min-height: 44px; }
  .adm-num { width: 100%; }
  .adm-resto { gap: 6px; }

  /* Carte du restaurant : le nom d'abord, prix et actions sur la ligne suivante. */
  .menu-ligne { flex-wrap: wrap; }
  .menu-ligne .ml-nom { flex: 1 1 60%; }
  .menu-ligne button { min-height: 38px; }

  /* Choix de l'établissement : deux bulles par ligne. */
  .bulles { gap: 12px; }
  .bulle { width: calc(50% - 6px); }

  /* Popup d'acceptation : elle occupe l'écran, boutons pleine largeur. */
  .modal { padding: 12px; align-items: flex-end; }
  .modal-card { width: 100%; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; min-height: 44px; }
}

/* Très petits écrans : on descend à une bulle par ligne. */
@media (max-width: 380px) {
  .bulle { width: 100%; }
  .td-actions .actions > * { flex: 1 1 100%; }
}
