/* Livraison (#/livraison) : prototype Livraison.dc.html et LivraisonMobile.dc.html.
   Styles propres à cet écran (refonte du prototype v73) : un fichier par écran, chargé par index.html après
   shell.css. Téléphone : @media (max-width: 767px), comme la coque.
   Préfixe `liv-` : ce qui n'est qu'à Livraison (cartes, colonnes des tableaux, en-tête de bloc au téléphone). Les
   briques communes des écrans à blocs (préfixe `bl-`) sont dans css/blocs-lignes.css. */

/* ------------------------------------------------------------------ Livraison seulement (liv-) */
.liv-head { margin-bottom: 16px; }
.liv-cards { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.liv-card { min-width: 0; display: flex; }
.liv-card__btn { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: stretch; box-sizing: border-box;
  padding: 18px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 16px; color: var(--app-ink);
  font: inherit; line-height: 1.4; text-align: left; cursor: pointer; }
.liv-card__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.liv-card__logo { flex: none; display: block; width: 56px; height: 28px; object-fit: contain; object-position: left center; }
.liv-card__name { font-size: 18px; font-weight: 700; line-height: 1.3; }
.liv-card__kicker { display: block; margin: 14px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-muted); }
.liv-card__net { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; }
.liv-card__fees { display: block; margin-top: 4px; font-size: 14px; color: var(--app-muted); }
.liv-card__states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.liv-card__foot { display: block; margin-top: auto; padding-top: 10px; font-size: 14px; color: var(--app-muted); }
/* Plateforme sans ligne cette semaine : la raison sous la pastille, pas un bouton (27/10/2026) */
.liv-card__btn--absent { cursor: default; }
.liv-card__why { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--app-ink); }
.liv-card__link { align-self: flex-start; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--app-ink); }
.liv-blocks { margin-top: 24px; display: flex; flex-direction: column; gap: 32px; }
.liv-blocks .bl-block { scroll-margin-top: 16px; }
/* Colonnes du prototype ; la dernière (bouton « Pièces d'origine » et flèche) est plus large que « 2 pièces » de la v73. */
.liv-grid--uber .bl-row { grid-template-columns: 186fr 108fr 102fr 92fr 108fr 108fr 96fr 176fr 186fr; }
.liv-grid--deliveroo .bl-row { grid-template-columns: 226fr 124fr 116fr 108fr 124fr 176fr 186fr; }
/* Restaurants sans ligne de la plateforme cette semaine (fos-novice-11) : le nom, la raison en pastille et en clair. */
.liv-sans { margin-top: 12px; padding: 14px 20px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 16px; }
.liv-sans__t { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--app-muted); }
.liv-sans__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.liv-sans__item { display: grid; grid-template-columns: minmax(0, 200px) auto minmax(0, 1fr); align-items: center; gap: 4px 12px;
  font-size: 14px; }
.liv-sans__item > .badge { justify-self: start; }
.liv-sans__name { font-weight: 700; overflow-wrap: anywhere; }
.liv-sans__why { min-width: 0; color: var(--app-muted); overflow-wrap: anywhere; }
.liv-empty { margin-top: 24px; padding: 36px 24px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.liv-empty h2 { margin: 0; font-size: 20px; font-weight: 700; }
.liv-empty p { margin: 0; max-width: 56ch; font-size: 15px; color: var(--app-muted); }
.liv-empty__reset { min-height: 44px; padding: 0 18px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-surface);
  color: var(--app-ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }

/* CEL : commandes en ligne payées par carte (Sips, 06/11/2026), au rang d'Uber Eats et Deliveroo : carte, bloc et
   tableau à sept jours (préfixe liv-cel ; ses lignes ne sont pas des `.bl-row`, elles ne se déplient pas). */
.liv-card__sub { display: block; margin-top: 2px; font-size: 14px; color: var(--app-muted); }
.liv-cel__title { flex-wrap: wrap; gap: 4px 12px; }
.liv-cel__titlename { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-surface); font-size: 16px; font-weight: 800; letter-spacing: 0.04em; }
.liv-cel__sub { min-width: 0; font-size: 15px; font-weight: 600; color: var(--app-muted); }
.liv-cel__total { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.liv-cel__total-label { font-size: 13px; font-weight: 600; color: var(--app-muted); }
.liv-cel__total-value { font-size: 20px; font-weight: 800; white-space: nowrap; }
.liv-cel__intro { margin: 0 0 12px; max-width: 80ch; font-size: 14px; line-height: 1.45; color: var(--app-muted); }
.liv-cel__wrap { background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 16px; overflow-x: auto; }
/* Les sept jours gardent « 1 234,56 € » sur une ligne ; plus étroit que la grille, le tableau défile dans sa carte. */
.liv-cel__table { min-width: 1000px; font-size: 14px; }
.liv-cel__row { display: grid; grid-template-columns: minmax(0, 170fr) repeat(7, minmax(0, 92fr)) minmax(0, 124fr) minmax(0, 170fr);
  align-items: center; border-top: 1px solid var(--app-line); }
.liv-cel__row--head { align-items: end; border-top: 0; border-bottom: 1px solid var(--app-line); font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-muted); }
.liv-cel__days { display: contents; }
.liv-cel__c { min-width: 0; padding: 14px 10px; }
.liv-cel__c:first-child { padding-left: 16px; }
.liv-cel__name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-weight: 700; }
.liv-cel__resto { overflow-wrap: anywhere; }
.liv-cel__day { padding-left: 8px; padding-right: 8px; }
.liv-cel__amount, .liv-cel__weektotal { white-space: nowrap; }
/* Jour en vérification : son montant entouré de pointillés, comme la marque « en vérification » du restaurant (un
   contour, pas une bordure : la case ne s'élargit pas) */
.liv-cel__day--verif .liv-cel__amount { outline: 1px dashed currentColor; outline-offset: 3px; border-radius: 4px; }
.liv-cel__week { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.liv-cel__weektotal { font-weight: 700; }
.liv-cel__pay { font-size: 13px; color: var(--app-muted); white-space: nowrap; }
.liv-cel__act { padding: 6px 12px 6px 4px; display: flex; justify-content: flex-end; }
.liv-cel__dl { min-height: 44px; white-space: nowrap; }
.liv-cel__notes { padding: 0 16px 14px; }
.liv-cel__notelist { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.45;
  color: var(--app-warn-ink); overflow-wrap: anywhere; }
.liv-cel__back { margin: 0 0 12px; }
.liv-cel__back a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--app-ink); }

@media (max-width: 767px) {
  .liv-head { margin: 4px 0 16px; }
  .liv-cards { display: flex; gap: 10px; margin: 0 -16px; padding: 0 16px; overflow-x: auto; }
  .liv-card { flex: none; width: 264px; }
  .liv-card__btn { padding: 16px; }
  .liv-blocks { margin-top: 16px; gap: 16px; }
  /* En-tête de bloc : comme Titres (css/blocs-lignes.css), l'interrupteur sur la ligne du logo, à sa droite ;
     « Tout choisir » et « Total · écart » dessous (spec § 4.2, demande d'Amine : pas sur une ligne à lui seul). */
  /* Bloc bloqué par le choix d'une autre plateforme : « Une plateforme à la fois » sur sa propre ligne, à droite, sous le
     total (LivraisonMobile). */
  .liv-blocks .bl-head > .bl-tot { order: 1; }
  .liv-blocks .bl-lock { order: 2; flex-basis: 100%; }
  /* Ligne : le nom et le montant, puis la pastille d'état et « Pièces d'origine » (livraison.js le met dans la case de
     l'état au téléphone) ; le bouton passe dessous, à droite, quand les deux ne tiennent pas (« Facture manquante »). */
  .liv-blocks .bl-row { grid-template-areas: "check name name value chev" "check badge badge badge chev"; }
  .liv-blocks .bl-row > .bl-c--state { justify-self: stretch; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: flex-end; gap: 6px 8px; }
  .liv-blocks .bl-row > .bl-c--state > .badge { flex: none; white-space: nowrap; }
  .liv-sans { margin: 0; border: 0; border-top: 1px solid var(--bl-divider); border-radius: 0; padding: 14px 16px; }
  .liv-sans__item { grid-template-columns: minmax(0, 1fr) auto; }
  .liv-sans__why { grid-column: 1 / -1; font-size: 13px; }
  .liv-empty { margin-top: 16px; padding: 28px 16px; }
  .liv-empty h2 { font-size: 17px; }
  .liv-empty p { display: none; }
  /* CEL au téléphone : une carte par restaurant ; le nom et la semaine, puis les sept jours en petite grille (trois par
     ligne à 320 px), puis les paiements et le tableau Excel (44 px au doigt). */
  .liv-cel__titlename { font-size: 15px; }
  .liv-cel__sub { font-size: 13px; }
  .liv-cel .bl-head { padding-right: 12px; }
  .liv-cel__total { margin-left: auto; flex-direction: column; align-items: flex-end; gap: 0; }
  .liv-cel__total-label { font-size: 12px; }
  .liv-cel__total-value { font-size: 17px; }
  .liv-cel__intro { margin: 0; padding: 0 12px 12px; font-size: 13px; }
  .liv-cel__wrap { background: none; border: 0; border-radius: 0; overflow: visible; }
  .liv-cel__table { min-width: 0; }
  .liv-cel__row--head { display: none; }
  .liv-cel__row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name week" "days days" "act act";
    gap: 10px 12px; padding: 12px; border-top: 1px solid var(--bl-divider); }
  .liv-cel__row--empty { grid-template-areas: "name name"; }
  .liv-cel__row--empty .liv-cel__days, .liv-cel__row--empty .liv-cel__week, .liv-cel__row--empty .liv-cel__act { display: none; }
  .liv-cel__c, .liv-cel__c:first-child { padding: 0; }
  .liv-cel__name { grid-area: name; font-size: 15px; }
  .liv-cel__days { grid-area: days; display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
  .liv-cel__day { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px; border-radius: 10px;
    background: var(--bl-soft); text-align: left; }
  .liv-cel__daylabel { font-size: 12px; font-weight: 600; color: var(--app-muted); }
  .liv-cel__amount { font-size: 13px; font-weight: 600; }
  .liv-cel__week { grid-area: week; font-size: 15px; }
  .liv-cel__act { grid-area: act; padding: 0; }
  .liv-cel__act:empty { display: none; }
  .liv-cel__notes { padding: 0 12px 12px; }
}
