:root {
  --papier: #fafafa; --encre: #231f20; --encre-douce: #4a4446; --creme: #f4f1ed; --trait: #e2ddd8;
  --champ: #8a827d; --taupe: #8b7268; --taupe-texte: #765f55; --taupe-pale: #efe8e4; --alerte: #8a3b12;
  --titre: "Bodoni Moda", Georgia, serif; --texte: "Fira Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 15px/1.45 var(--texte); }
h1, h2, h3, h4 { font-family: var(--titre); font-weight: 500; margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--taupe); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.demo { background: var(--taupe-pale); text-align: center; font-size: 12px; padding: 5px 12px; }
.barre { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--trait); flex-wrap: wrap; position: sticky; top: 0; background: var(--papier); z-index: 5; }
.marque { font-family: var(--titre); font-size: 22px; }
.marque small { display: block; font: 11px var(--texte); letter-spacing: .08em; text-transform: uppercase; color: var(--taupe-texte); }
.espace { flex: 1; }
.modes { display: inline-flex; border: 1px solid var(--champ); border-radius: 999px; overflow: hidden; }
.modes button { border: 0; background: none; padding: 7px 18px; }
.modes button[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.lien { background: none; border: 0; text-decoration: underline; padding: 6px; color: var(--encre-douce); }
.btn { border: 0; border-radius: 999px; background: var(--encre); color: var(--papier); padding: 10px 20px; font-weight: 500; }
.btn[disabled] { background: var(--creme); color: var(--encre-douce); cursor: not-allowed; }
.btn.sec { background: none; color: var(--encre); border: 1px solid var(--champ); }
.btn.petit { padding: 5px 12px; font-size: 13px; }
.btn.danger { background: none; border: 1px solid var(--alerte); color: var(--alerte); }
.client { max-width: 480px; margin: 0 auto; padding: 0 16px 90px; }
.boutique { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 100px); }
.lateral { background: var(--encre); color: var(--papier); padding: 18px 14px; }
.lateral .rapide { width: 100%; margin-bottom: 18px; background: var(--papier); color: var(--encre); }
.lateral nav button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--papier); padding: 9px 10px; border-radius: 8px; }
.lateral nav button[aria-current="page"] { background: var(--encre-douce); font-weight: 600; }
.principal { padding: 20px 24px 80px; min-width: 0; }
.surtitre { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--taupe-texte); margin: 18px 0 0; }
.sous { color: var(--encre-douce); font-size: 13px; }
.puces { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; }
.puce { border: 1px solid var(--champ); background: none; border-radius: 999px; padding: 5px 14px; white-space: nowrap; }
.puce[aria-pressed="true"] { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.recherche, .champ { width: 100%; border: 1px solid var(--champ); border-radius: 12px; padding: 10px 12px; background: var(--papier); }
.carte { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--trait); background: none; padding: 13px 0; }
.carte:hover .nom { text-decoration: underline; text-decoration-color: var(--taupe); text-underline-offset: 4px; }
.carte.indispo { color: var(--encre-douce); cursor: not-allowed; }
.ligne { display: flex; align-items: baseline; gap: 10px; }
.nom { font-family: var(--titre); font-size: 19px; }
.prix { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 14px; }
.compo { font-size: 13px; color: var(--encre-douce); margin: 3px 0 0; }
.etiq { display: inline-block; font-size: 11px; border: 1px solid var(--trait); border-radius: 4px; padding: 1px 6px; margin: 5px 4px 0 0; color: var(--encre-douce); }
.etiq.fort { border-color: var(--taupe); color: var(--taupe-texte); }
.etiq.ind { background: var(--creme); color: var(--encre); font-weight: 600; border-color: var(--creme); }
.choix { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.choix label { border: 1px solid var(--champ); border-radius: 12px; padding: 8px 12px; cursor: pointer; display: block; }
.choix input { position: absolute; opacity: 0; }
.choix label:has(input:checked) { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.choix label:has(input:focus-visible) { outline: 2px solid var(--taupe); outline-offset: 2px; }
.groupe { border: 0; padding: 0; margin: 18px 0 0; }
.groupe legend, .etiquette { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; display: block; }
.qte { display: flex; align-items: center; gap: 12px; }
.qte button:not(.lien) { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--champ); background: none; font-size: 18px; }
.qte button:not(.lien)[disabled] { color: var(--champ); cursor: not-allowed; }
.pied { position: sticky; bottom: 0; background: var(--papier); border-top: 1px solid var(--trait); padding: 12px 0; display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.total { font-variant-numeric: tabular-nums; }
.total strong { display: block; font-size: 20px; }
.bloc { background: var(--creme); border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 14px; }
.bloc.alerte { background: #f6e9e1; color: var(--alerte); }
.erreur { color: var(--alerte); font-size: 13px; margin: 4px 0 0; }
.statut { display: inline-block; border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 600; }
.statut.a_confirmer { background: var(--taupe-pale); color: var(--taupe-texte); }
.statut.confirmee { background: var(--encre); color: var(--papier); }
.statut.refusee, .statut.annulee { background: var(--creme); color: var(--encre-douce); text-decoration: line-through; }
.statut.retiree { background: var(--creme); color: var(--encre-douce); }
.lignes { list-style: none; padding: 0; margin: 8px 0; border-top: 1px solid var(--trait); }
.lignes li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--trait); align-items: baseline; }
.lignes .droite { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--encre-douce); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--champ); }
td { padding: 9px 8px; border-bottom: 1px solid var(--trait); vertical-align: top; }
tr.retard td { background: #f6e9e1; }
td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.compteurs { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.compteur { border: 1px solid var(--trait); background: none; border-radius: 12px; padding: 10px 18px; text-align: left; }
.compteur[aria-pressed="true"] { border-color: var(--encre); background: var(--creme); }
.compteur strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.jour { display: flex; align-items: baseline; gap: 12px; margin: 24px 0 6px; }
.grille2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.panneau { border: 1px solid var(--trait); border-radius: 12px; padding: 14px; margin: 12px 0; }
.journal { position: absolute; right: 24px; top: 48px; width: 340px; max-height: 60vh; overflow: auto; background: var(--papier); border: 1px solid var(--champ); border-radius: 12px; padding: 12px; z-index: 6; box-shadow: 0 2px 8px #0002; }
.journal li { padding: 5px 0; font-size: 13px; list-style: none; border-bottom: 1px solid var(--trait); display: flex; gap: 8px; align-items: center; }
#toast { position: fixed; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; pointer-events: none; z-index: 20; padding: 0 14px; }
.toast { pointer-events: auto; background: var(--encre); color: var(--papier); padding: 11px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; max-width: 480px; }
.toast button { background: none; border: 0; color: var(--papier); text-decoration: underline; font-weight: 600; }
.vide { color: var(--encre-douce); padding: 20px 0; }
.jeton { font-family: monospace; font-size: 12px; word-break: break-all; color: var(--encre-douce); }
@media (max-width: 780px) {
  .boutique { grid-template-columns: 1fr; }
  .lateral { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
  .lateral .rapide { width: auto; margin: 0; white-space: nowrap; }
  .lateral nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .lateral nav button { white-space: nowrap; width: auto; }
  /* Tableau des commandes : une carte par commande, plutôt qu'un défilement horizontal. */
  table.cartes-mobile, .cartes-mobile tbody, .cartes-mobile tr, .cartes-mobile td { display: block; }
  .cartes-mobile thead { display: none; }
  .cartes-mobile tr { border: 1px solid var(--trait); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
  .cartes-mobile td { border: 0; padding: 4px 0; display: flex; gap: 12px; }
  .cartes-mobile td::before { content: attr(data-l); flex: 0 0 74px; font-size: 12px; color: var(--encre-douce); }
  .cartes-mobile tr.retard { background: #f6e9e1; }
  .cartes-mobile tr.retard td { background: none; }
  .principal { padding: 14px 12px 80px; overflow-x: auto; }
}
@media print {
  .demo, .barre, .lateral, #toast, .no-print, .journal { display: none !important; }
  .boutique { display: block; }
  .principal { padding: 0; }
  body { background: #fff; }
}
/* Écran d'accueil (C30) : 3 s, passable ; sans animation si l'utilisateur demande moins de mouvement. */
.accueil { position: fixed; inset: 0; z-index: 50; background: var(--papier); display: grid; place-items: center; cursor: pointer; }
.accueil img { width: min(72vw, 332px); height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .accueil { animation: fondu 3s ease-in forwards; }
  .accueil img { animation: entree 900ms ease-out both; }
}
@keyframes fondu { 0%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes entree { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* Mention des fonctions optionnelles (décidées par Patachou) */
.opt { display: inline-block; font: 600 10.5px/1.5 var(--texte); letter-spacing: .04em; text-transform: uppercase; color: var(--taupe-texte); background: var(--taupe-pale); border: 1px solid var(--taupe); border-radius: 999px; padding: 0 7px; vertical-align: middle; white-space: nowrap; }
.lateral nav .opt { background: none; color: var(--papier); border-color: #8b7268; }
.demo .opt { vertical-align: baseline; }
.statut.prete { background: var(--encre-douce); color: var(--papier); }
.mini { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; float: left; margin: 2px 12px 4px 0; }
.carte .mini { float: left; }
.grande { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin: 8px 0 0; }
.creneaux { display: grid; gap: 6px; }
.creneau { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--champ); border-radius: 12px; padding: 7px 12px; cursor: pointer; }
.creneau input { position: absolute; opacity: 0; }
.creneau:has(input:checked) { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.creneau:has(input:focus-visible) { outline: 2px solid var(--taupe); outline-offset: 2px; }
.creneau.complet { opacity: 1; background: var(--creme); color: var(--encre-douce); cursor: not-allowed; border-style: dashed; }
.barre-aff { height: 8px; border-radius: 4px; background: #d9d4cf; overflow: hidden; }
.barre-aff i { display: block; height: 100%; background: currentColor; opacity: .75; }
.aff-lib { font-size: 12px; white-space: nowrap; }
