/* ATHARAN Fidélité : thème nuit (ébène, sable, ocre) */
@font-face { font-family: 'Marcellus'; src: url('/fonts/marcellus.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Jost'; src: url('/fonts/jost.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ebene: #1c1a17; --nuit: #131210; --sable: #ebe3d5; --ocre: #d39a2c;
  --panneau: #24211d; --trait: rgba(235, 227, 213, .14); --doux: rgba(235, 227, 213, .62);
  --vert: #7fb98a; --rouge: #e08872;
  --f-titre: 'Marcellus', Georgia, serif; --f-texte: 'Jost', 'Segoe UI', system-ui, sans-serif;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--nuit); color: var(--sable);
  font: 400 16px/1.5 var(--f-texte); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-titre); font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0; }
a { color: var(--ocre); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.doux { color: var(--doux); }
.petit { font-size: .86rem; }
.chiffres { font-variant-numeric: tabular-nums; }

/* Mise en page */
.cadre { width: min(1080px, 100% - 32px); margin-inline: auto; }
.etroit { width: min(440px, 100% - 32px); margin-inline: auto; }
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--trait);
}
.marque { display: flex; align-items: center; gap: 10px; color: var(--sable); text-decoration: none; font-family: var(--f-titre); font-size: 1.1rem; letter-spacing: .04em; }
.marque img { width: 26px; height: 28px; }
.marque span { color: var(--ocre); }
.pile { display: grid; gap: 16px; }
.rangee { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.entre { justify-content: space-between; }

.panneau { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 20px; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chiffre { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; }
.chiffre b { display: block; font: 400 2rem/1.1 var(--f-titre); color: var(--sable); font-variant-numeric: tabular-nums; }
.chiffre span { color: var(--doux); font-size: .88rem; }

/* Formulaires */
label { display: grid; gap: 6px; font-size: .9rem; color: var(--doux); }
input, select, textarea {
  font: inherit; color: var(--sable); background: var(--nuit); border: 1px solid var(--trait);
  border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 46px;
}
input[type=color] { padding: 4px; height: 46px; }
textarea { resize: vertical; min-height: 84px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ocre); outline-offset: 2px;
}
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--ocre); background: var(--ocre); color: #1c1a17;
  font: 600 1rem var(--f-texte); text-decoration: none; cursor: pointer; transition: transform .15s, opacity .15s;
}
.bouton:active { transform: scale(.97); }
.bouton[disabled] { opacity: .5; cursor: default; }
.bouton.creux { background: transparent; color: var(--sable); border-color: var(--trait); }
.bouton.mini { min-height: 36px; padding: 6px 14px; font-size: .88rem; }
.bouton.large { width: 100%; }
.bouton.danger { background: transparent; border-color: rgba(224, 136, 114, .5); color: var(--rouge); }
.champs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.alerte { border-radius: 10px; padding: 10px 14px; font-size: .92rem; background: rgba(224, 136, 114, .12); color: var(--rouge); border: 1px solid rgba(224, 136, 114, .3); }
.alerte.ok { background: rgba(127, 185, 138, .12); color: var(--vert); border-color: rgba(127, 185, 138, .3); }

/* Onglets */
.onglets { display: flex; gap: 4px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets button {
  flex: none; font: 500 .95rem var(--f-texte); color: var(--doux); background: none; border: 1px solid transparent;
  border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer;
}
.onglets button[aria-selected=true] { color: var(--sable); border-color: var(--trait); background: var(--panneau); }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-weight: 500; color: var(--doux); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--trait); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.defile { overflow-x: auto; }
.pastille { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--trait); color: var(--doux); white-space: nowrap; }
.pastille.ok { color: var(--vert); border-color: rgba(127, 185, 138, .35); }
.pastille.or { color: var(--ocre); border-color: rgba(211, 154, 44, .4); }
.pastille.non { color: var(--rouge); border-color: rgba(224, 136, 114, .35); }
.vide { text-align: center; color: var(--doux); padding: 28px 12px; }

/* La carte de fidélité */
.carte {
  --c-fond: #1c1a17; --c-texte: #ebe3d5; --c-accent: #d39a2c;
  background: var(--c-fond); color: var(--c-texte); border-radius: 18px; overflow: hidden;
  width: 100%; max-width: 380px; margin-inline: auto; box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);
  font-family: var(--f-texte);
}
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.carte-nom { display: flex; align-items: center; gap: 10px; min-width: 0; font: 400 1.2rem/1.1 var(--f-titre); }
.carte-nom img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; flex: none; }
.carte-nom span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-solde { text-align: right; flex: none; }
.carte-solde small, .carte-champ small { display: block; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; font-weight: 600; }
.carte-solde b { font: 400 1.5rem/1 var(--f-titre); font-variant-numeric: tabular-nums; }
.carte-bande { padding: 16px 18px; background: color-mix(in srgb, var(--c-texte) 7%, transparent); }
.tampons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tampons.six { grid-template-columns: repeat(6, 1fr); }
.tampon {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--c-texte) 30%, transparent);
  color: transparent; transition: background .4s, transform .4s, border-color .4s;
}
.tampon svg { width: 52%; height: 52%; }
.tampon.plein { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-fond); }
.tampon.nouveau { animation: tampon .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tampon { from { transform: scale(.3); } }
.jauge { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--c-texte) 16%, transparent); overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--c-accent); border-radius: 999px; transition: width .6s; }
.carte-champs { display: flex; justify-content: space-between; gap: 14px; padding: 14px 18px 4px; }
.carte-champ b { font-weight: 400; font-size: 1.12rem; }
.carte-champ:last-child { text-align: right; }
.carte-cadeau { margin: 10px 18px 0; padding: 10px 12px; border-radius: 10px; background: var(--c-accent); color: var(--c-fond); font-weight: 600; text-align: center; }
.carte-code { margin: 16px 18px 18px; background: #fff; border-radius: 12px; padding: 14px; text-align: center; color: #1c1a17; }
.carte-code .qr { width: 168px; height: 168px; margin: 0 auto 8px; }
.carte-code .qr svg { width: 100%; height: 100%; display: block; }
.carte-code small { font-size: .7rem; letter-spacing: .04em; opacity: .65; }
@media (prefers-reduced-motion: reduce) { .tampon.nouveau { animation: none; } .jauge i { transition: none; } }

/* Scanner */
.viseur { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #000; }
.viseur video { width: 100%; height: 100%; object-fit: cover; }
.viseur::after { content: ''; position: absolute; inset: 16%; border: 3px solid var(--ocre); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
.fiche-prenom { font: 400 2rem/1.1 var(--f-titre); }
.compteur { display: flex; align-items: center; justify-content: center; gap: 18px; }
.compteur button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--trait); background: var(--panneau); color: var(--sable); font-size: 1.5rem; cursor: pointer; }
.compteur b { font: 400 2.4rem/1 var(--f-titre); min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.succes { text-align: center; padding: 26px 16px; }
.succes .rond { width: 84px; height: 84px; border-radius: 50%; background: var(--vert); color: #10210f; display: grid; place-items: center; margin: 0 auto 14px; animation: tampon .5s cubic-bezier(.3, 1.6, .5, 1); }
.succes .rond svg { width: 44px; height: 44px; }

/* Accueil */
.hero { display: grid; gap: 34px; align-items: center; padding: 48px 0 40px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr .9fr; padding: 80px 0 64px; } }
.surtitre { color: var(--ocre); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.points { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); padding: 0; margin: 0; list-style: none; }
.points li { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 20px; }
.points h3 { margin-bottom: 6px; }
.pied { border-top: 1px solid var(--trait); padding: 22px 0 32px; margin-top: 56px; color: var(--doux); font-size: .88rem; }

/* Affiche à imprimer */
.affiche { background: #fff; color: #1c1a17; border-radius: var(--rayon); padding: 28px 22px; text-align: center; max-width: 380px; margin-inline: auto; }
.affiche h3 { font-size: 1.5rem; margin-bottom: 4px; }
.affiche .qr { width: 220px; height: 220px; margin: 16px auto; }
.affiche .qr svg { width: 100%; height: 100%; }
@media print {
  body * { visibility: hidden; }
  .affiche, .affiche * { visibility: visible; }
  .affiche { position: fixed; inset: 0; max-width: none; border-radius: 0; display: grid; place-content: center; }
  .affiche .qr { width: 110mm; height: 110mm; }
  .affiche h3 { font-size: 30pt; }
  .affiche p { font-size: 15pt; }
}

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--sable); color: #1c1a17; padding: 10px 18px; border-radius: 999px; font-weight: 500; z-index: 50;
  transition: opacity .25s, transform .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.vu { opacity: 1; transform: translate(-50%, 0); }

/* ----- Lisibilité : code du client, titres de rubrique, étapes ----- */
.mon-code { background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.mon-code h1 { font-size: 1.5rem; }
.mon-code .qr { width: min(220px, 62vw); aspect-ratio: 1; background: #fff; border-radius: 14px; padding: 14px; }
.mon-code .qr svg { width: 100%; height: 100%; display: block; }
.intro { color: var(--doux); max-width: 62ch; }
.etape { display: flex; align-items: center; gap: 10px; }
.etape i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: .9rem; background: var(--ocre); color: #1c1a17; }
.etape h2 { font-size: 1.25rem; }
.demarrage { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: d; }
.demarrage li { counter-increment: d; display: grid; grid-template-columns: 28px 1fr; gap: 4px 12px; align-items: start; }
.demarrage li::before { content: counter(d); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .9rem; border: 1px solid var(--trait); color: var(--ocre); }
.demarrage b { font-weight: 500; color: var(--sable); display: block; }
.demarrage span { color: var(--doux); grid-column: 2; }
.demarrage button { grid-column: 2; justify-self: start; }
@media (max-width: 720px) {
  /* Toutes les rubriques restent visibles sur un téléphone, sans défilement caché. */
  .onglets { flex-wrap: wrap; overflow: visible; }
  .onglets button { flex: 1 1 30%; text-align: center; border-color: var(--trait); }
}

/* ----- Disposition façon application : barre du bas, menu latéral ----- */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; align-items: stretch;
  background: color-mix(in srgb, var(--nuit) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--trait); padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
}
.barre > * {
  flex: 1 1 0; min-width: 0; min-height: 54px; display: grid; justify-items: center; align-content: center; gap: 3px;
  background: none; border: 0; color: var(--doux); font: 500 .72rem var(--f-texte); text-decoration: none; cursor: pointer; border-radius: 12px;
}
.barre svg { width: 24px; height: 24px; }
.barre [aria-selected=true] { color: var(--ocre); }
.barre .central { color: #1c1a17; }
.barre .central span.rond { width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; background: var(--ocre); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.barre .central b { color: var(--sable); font-weight: 500; }
.avec-barre { padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important; }

/* Carte du client : un écran par usage */
.ecran-code { min-height: calc(100dvh - 150px); align-content: center; }
.mon-code.grand { border: 0; background: none; padding: 0; }
.mon-code.grand .qr { width: min(290px, 78vw); padding: 18px; border-radius: 20px; }
.resume-cartes { display: grid; gap: 8px; width: 100%; }
.ligne {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; text-decoration: none; cursor: pointer;
  background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; min-height: 58px;
  color: var(--sable); font: inherit;
}
.ligne > svg:first-child { width: 24px; height: 24px; flex: none; color: var(--ocre); }
.ligne > span { flex: 1; min-width: 0; }
.ligne b { display: block; font-weight: 500; }
.ligne small { color: var(--doux); font-size: .86rem; }
.ligne > svg:last-child { flex: none; opacity: .55; }
.ligne .compte { flex: none; font: 400 1.25rem var(--f-titre); color: var(--ocre); font-variant-numeric: tabular-nums; }

/* Espace du gérant : menu à gauche sur ordinateur, barre en bas sur téléphone */
@media (min-width: 900px) {
  .espace { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .espace > .entete { grid-column: 1 / -1; }
  .espace > .onglets { flex-direction: column; position: sticky; top: 12px; padding: 20px 0; gap: 6px; overflow: visible; }
  .espace > .onglets button { display: flex; align-items: center; gap: 12px; text-align: left; border-radius: 12px; padding: 10px 14px; min-height: 46px; }
  .espace > .onglets svg { width: 20px; height: 20px; flex: none; }
  .espace > main { padding-top: 20px; }
  .espace .barre, .espace [data-vue=plus] { display: none !important; }
}
@media (max-width: 899px) {
  .espace > .onglets { display: none; }
  .espace > main { padding-top: 16px; }
  .espace .entete .bouton { display: none; }
}

/* ----- Page « Mes cartes » : un bloc par commerçant, à ses couleurs ----- */
.commerce { background: var(--c-fond); color: var(--c-texte); border-radius: 18px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--c-texte) 14%, transparent); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.commerce header { display: flex; align-items: center; gap: 12px; padding: 16px 18px 14px; }
.commerce header h2 { font-size: 1.3rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commerce .rond { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; overflow: hidden; font: 400 1.4rem var(--f-titre); color: var(--c-accent); background: color-mix(in srgb, var(--c-texte) 9%, transparent); }
.commerce .rond img { width: 100%; height: 100%; object-fit: contain; }
.avance { padding: 14px 18px; display: grid; gap: 8px; border-top: 1px solid color-mix(in srgb, var(--c-texte) 12%, transparent); }
.avance-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.avance-tete b { font-weight: 500; }
.avance-tete span { font: 400 1.15rem var(--f-titre); color: var(--c-accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.avance-jauge { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--c-texte) 14%, transparent); overflow: hidden; }
.avance-jauge i { display: block; height: 100%; border-radius: 99px; background: var(--c-accent); }
.avance .doux { color: color-mix(in srgb, var(--c-texte) 66%, transparent); }
.avance-cadeau { font-weight: 600; color: var(--c-accent); font-size: .92rem; }
.commerce-bouton { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px; background: var(--c-accent); color: var(--c-fond); font-weight: 600; text-decoration: none; }

/* ----- « Mes cartes » : de vraies cartes colorées, pleine largeur ----- */
.rond-action { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; cursor: pointer; background: var(--panneau); border: 1px solid var(--trait); color: var(--sable); }
.rond-action svg { width: 20px; height: 20px; }
.rond-action:active { transform: scale(.94); }
.cartes-bancaires { display: grid; gap: 18px; }
.cb {
  --c-fond: #1c1a17; --c-texte: #ebe3d5; --c-accent: #d39a2c;
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  aspect-ratio: 1.6; padding: 20px 22px; border-radius: 22px; overflow: hidden; text-decoration: none; color: var(--c-texte);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c-accent) 55%, transparent), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--c-accent) 22%, transparent), transparent 65%),
    linear-gradient(145deg, color-mix(in srgb, var(--c-fond) 82%, #fff), var(--c-fond) 55%, color-mix(in srgb, var(--c-fond) 80%, #000));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
  animation: cb-monte .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 80ms);
}
.cb.bis { background:
    radial-gradient(110% 90% at 0% 0%, color-mix(in srgb, var(--c-accent) 48%, transparent), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--c-accent) 20%, transparent), transparent 65%),
    linear-gradient(215deg, color-mix(in srgb, var(--c-fond) 82%, #fff), var(--c-fond) 55%, color-mix(in srgb, var(--c-fond) 80%, #000)); }
/* Reflet qui traverse la carte */
.cb::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .13) 48%, transparent 60%); transform: translateX(-70%); transition: transform .7s ease; }
.cb:hover::after, .cb:active::after { transform: translateX(70%); }
.cb:hover { transform: translateY(-3px); }
.cb:active { transform: scale(.975); }
.cb-tete { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cb-logo { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; overflow: hidden; font: 400 1.35rem var(--f-titre); color: var(--c-accent); background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); }
.cb-logo img { width: 100%; height: 100%; object-fit: contain; }
.cb-nom { flex: 1; min-width: 0; font: 400 1.15rem/1.1 var(--f-titre); letter-spacing: .12em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-type, .cb-cadeau { flex: none; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 99px; background: rgba(0, 0, 0, .3); }
.cb-pied .cb-cadeau { display: flex; align-items: center; gap: 6px; min-width: 0; opacity: 1; letter-spacing: .06em; font-size: .74rem; background: var(--c-accent); color: var(--c-fond); }
.cb-cadeau span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit; letter-spacing: inherit; opacity: 1; }
.cb-cadeau svg { width: 14px; height: 14px; flex: none; }
.cb-points { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: clamp(4px, 1.6vw, 9px); }
.cb-points i { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--c-texte) 38%, transparent); max-width: 30px; width: 100%; }
.cb-points i.plein { background: var(--c-accent); border-color: var(--c-accent); box-shadow: 0 0 12px color-mix(in srgb, var(--c-accent) 60%, transparent); }
.cb-jauge { height: 10px; border-radius: 99px; background: rgba(0, 0, 0, .32); overflow: hidden; }
.cb-jauge i { display: block; height: 100%; border-radius: 99px; background: var(--c-accent); box-shadow: 0 0 14px color-mix(in srgb, var(--c-accent) 70%, transparent); }
.cb-pied { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cb-pied span { font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; opacity: .82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-pied b { font: 400 2.3rem/.9 var(--f-titre); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-pied small { font-size: .45em; opacity: .7; }
.cb.fantome { animation: cb-pulse 1.2s ease-in-out infinite; box-shadow: none; background: var(--panneau); }
@keyframes cb-monte { from { opacity: 0; transform: translateY(26px) scale(.96); } }
@keyframes cb-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .cb { animation: none; transition: none; } .cb::after { display: none; } }

/* Tampon qui vient d'être ajouté */
.cb-points i.nouveau { animation: cb-tampon .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes cb-tampon { from { transform: scale(0); } }

/* ===== Adaptation aux écrans : petit téléphone, téléphone, tablette, ordinateur ===== */

/* Rien ne déborde, les longs mots se coupent, le texte ne grossit pas tout seul en paysage */
html { text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
img, svg, video { max-width: 100%; }
/* 16 px au minimum dans les champs : sinon l'iPhone zoome à chaque saisie */
input, select, textarea { font-size: max(16px, 1rem); }
/* Zones tactiles confortables */
@media (pointer: coarse) {
  .bouton.mini { min-height: 44px; padding: 8px 16px; }
  .compteur button { width: 56px; height: 56px; }
}

/* --- Téléphone et tablette : les tableaux deviennent des fiches, sans défilement de côté --- */
@media (max-width: 899px) {
  .panneau.defile { padding: 0; background: none; border: 0; overflow: visible; }
  .table, .table tbody { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr { display: grid; gap: 8px; background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; margin-bottom: 10px; }
  .table td { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 0; border: 0; text-align: right; }
  .table td[data-titre]::before { content: attr(data-titre); flex: none; text-align: left; color: var(--doux); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
  .table td:first-child { font-size: 1.08rem; }
  .table td:first-child::before { display: none; }
  .table td:first-child { justify-content: flex-start; text-align: left; }
  .table td:empty { display: none; }
  .table td .rangee { justify-content: flex-end; }
  .table td.vide { display: block; text-align: center; }
  .table td.vide::before { display: none; }
  .table td:has(> .bouton), .table td:has(> .rangee) { justify-content: stretch; }
  .table td:has(> .bouton)::before, .table td:has(> .rangee)::before { display: none; }
  .table td > .bouton { width: 100%; }
  .table td > .rangee { width: 100%; }
  .table td > .rangee .bouton { flex: 1; }

  .panneau { padding: 16px; }
  .champs { grid-template-columns: 1fr; }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .chiffre { padding: 14px; }
  .chiffre b { font-size: 1.7rem; }
  .hero { gap: 28px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* --- Petit téléphone (iPhone SE, 320 px) --- */
@media (max-width: 360px) {
  .cadre, .etroit { width: calc(100% - 24px); }
  h1 { font-size: 1.7rem; }
  .cb { padding: 16px 16px; border-radius: 18px; gap: 10px; }
  .cb-nom { font-size: 1rem; letter-spacing: .08em; }
  .cb-pied b { font-size: 1.9rem; }
  .cb-logo { width: 36px; height: 36px; }
  .barre > * { font-size: .66rem; }
  .mon-code.grand .qr { padding: 12px; }
  .entete { flex-wrap: wrap; }
}

/* --- Téléphone couché : le code reste entièrement visible --- */
@media (orientation: landscape) and (max-height: 500px) {
  .ecran-code { min-height: 0; grid-template-columns: auto 1fr; align-items: center; gap: 24px; }
  .mon-code.grand .qr { width: min(200px, 52vh); }
  .barre > * { min-height: 44px; }
  .viseur { max-height: 62vh; }
}

/* --- Tablette et ordinateur : les pages du client s'élargissent --- */
@media (min-width: 760px) {
  .etroit.large-ecran { width: min(920px, 100% - 48px); }
  .large-ecran .cartes-bancaires { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .large-ecran #vueForm { width: min(440px, 100%); margin-inline: auto; }
  /* La barre du bas devient une pastille flottante centrée */
  body > .barre { left: 50%; right: auto; bottom: 20px; transform: translateX(-50%); width: min(420px, 100% - 48px);
    border: 1px solid var(--trait); border-radius: 22px; padding: 6px 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
  /* Page du code : le code à gauche, les cartes à droite */
  .large-ecran .ecran-code { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px; min-height: calc(100dvh - 200px); }
  .large-ecran .ecran-code > #formNumero { grid-column: 1 / -1; }
  .large-ecran [data-ecran=infos] { width: min(520px, 100%); margin-inline: auto; }
}
@media (min-width: 1100px) {
  .large-ecran .cartes-bancaires:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .etroit.large-ecran:has(.cartes-bancaires > :nth-child(3)) { width: min(1180px, 100% - 64px); }
}

/* --- Tablette : l'espace du gérant respire, la barre du bas reste à portée de pouce --- */
@media (min-width: 600px) and (max-width: 899px) {
  .espace .grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .espace .barre { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: min(560px, 100% - 40px);
    border: 1px solid var(--trait); border-radius: 22px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
}
/* --- Scanner : le viseur ne dépasse jamais une taille confortable --- */
@media (min-width: 600px) {
  .viseur { max-width: 460px; margin-inline: auto; }
}

/* Tablette : les fiches se rangent sur deux colonnes */
@media (min-width: 600px) and (max-width: 899px) {
  .table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .table tr { margin-bottom: 0; }
  .table tr:has(td.vide) { grid-column: 1 / -1; }
  .champs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Petit ordinateur : le tableau des clients garde l'essentiel pour tenir dans la page */
@media (min-width: 900px) {
  [data-vue=clients] .table :is(th, td):nth-child(5),
  [data-vue=clients] .table :is(th, td):nth-child(6) { display: none; }
  .table th, .table td { padding-inline: 7px; }
}
@media (min-width: 900px) and (max-width: 1099px) {
  [data-vue=clients] .table :is(th, td):nth-child(8) { display: none; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  [data-vue=carte] .table td .rangee { flex-direction: column; align-items: stretch; gap: 6px; }
}

/* ----- Messages : logo du commerce, fil lisible, aperçu de notification ----- */
.logo-notif { width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center; overflow: hidden; font: 400 1.4rem var(--f-titre); background: var(--ebene); color: var(--ocre); border: 1px solid var(--trait); }
.logo-notif img { width: 100%; height: 100%; object-fit: contain; }
.message { position: relative; display: flex; gap: 12px; align-items: flex-start; background: var(--panneau); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 40px 14px 14px; animation: cb-monte .4s cubic-bezier(.2, .8, .2, 1) both; }
.message.neuf { border-color: color-mix(in srgb, var(--ocre) 55%, transparent); background: color-mix(in srgb, var(--ocre) 9%, var(--panneau)); }
.message.neuf::before { content: ''; position: absolute; left: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--ocre); box-shadow: 0 0 0 3px var(--nuit); }
.message-corps { min-width: 0; flex: 1; display: grid; gap: 3px; }
.message-tete { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--doux); }
.message-tete b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-tete span { flex: none; }
.message h3 { font: 600 1rem var(--f-texte); }
.message p { color: var(--doux); font-size: .95rem; }
.message-fermer { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border: 0; background: none; color: var(--doux); font-size: 1.4rem; line-height: 1; cursor: pointer; border-radius: 50%; }
.message-fermer:hover { color: var(--sable); background: rgba(255, 255, 255, .06); }
.avec-pastille { position: relative; }
.avec-pastille i { position: absolute; top: -30px; right: -14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--rouge); color: #1c1a17; font: 700 .7rem/18px var(--f-texte); font-style: normal; text-align: center; }
.reglages summary { cursor: pointer; font-weight: 500; }
.apercu-notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 20px; background: rgba(245, 245, 245, .92); color: #1b1b1b; box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.apercu-notif .logo-notif { border: 0; }
.apercu-tete { display: flex; justify-content: space-between; gap: 10px; }
.apercu-tete b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apercu-tete span { flex: none; font-size: .8rem; opacity: .55; }
.apercu-notif p { font-size: .93rem; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) { .message { animation: none; } }
