/* Interface Client — écran Agent (mobile). Toutes les classes sont préfixées « ag- » :
   ce fichier est aussi chargé par l'écran d'administration d'organisation. */

.ag-app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }
.ag-vue { padding-bottom: calc(118px + var(--bas)); }
.ag-corps { display: grid; gap: 18px; padding: 0 16px; }
.ag-mono { font-family: var(--f-code); font-weight: 500; letter-spacing: .02em; }
.ag-vide-plein { min-height: 70dvh; align-content: center; }
:root.ag-fige, :root.ag-fige body { overflow: hidden; }

/* ───────── en-tête marine (Accueil) ───────── */
.ag-entete {
  position: relative; overflow: hidden; color: #fff; margin-bottom: 18px;
  padding: calc(16px + var(--haut)) 20px 20px; border-radius: 0 0 32px 32px;
  background: radial-gradient(130% 90% at 100% 0%, var(--encre-2) 0%, var(--encre) 48%, var(--nuit) 100%);
  box-shadow: 0 18px 40px -22px rgba(7, 27, 61, .8);
}
.ag-entete::after {
  content: ""; position: absolute; right: -70px; top: -50px; width: 260px; height: 300px; pointer-events: none; opacity: .09;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M100 10c35 44 60 77 60 106a60 60 0 0 1-120 0c0-29 25-62 60-106Z'/%3E%3Cpath d='M100 40c24 30 41 53 41 73a41 41 0 0 1-82 0c0-20 17-43 41-73Z'/%3E%3Cpath d='M100 70c13 16 22 29 22 41a22 22 0 0 1-44 0c0-12 9-25 22-41Z'/%3E%3C/g%3E%3C/svg%3E");
}
.ag-entete > * { position: relative; z-index: 1; }
.ag-entete-vide { display: grid; gap: 18px; min-height: 290px; }
.ag-entete-vide .squelette { background: rgba(255, 255, 255, .1); animation: none; }
.ag-sq-ligne { height: 44px; width: 60%; }
.ag-sq-anneau { height: 140px; border-radius: 24px; }
.ag-entete-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ag-qui { min-width: 0; }
.ag-salut { margin: 0; font: 750 24px/1.1 var(--f-titre); font-variation-settings: "wdth" 85; letter-spacing: -.02em; }
.ag-org { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .7); font-size: 13.5px; font-weight: 600; }
.ag-org svg { width: 15px; height: 15px; flex: none; }
.ag-org span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-avatar {
  width: 46px; height: 46px; border-radius: 15px; border: 0; flex: none; display: grid; place-items: center;
  font: 800 16px var(--f-titre); color: #1B0F00; background: linear-gradient(135deg, var(--pompe), #FFB24A);
  box-shadow: 0 6px 16px -6px rgba(240, 138, 28, .8); transition: transform .2s var(--ressort);
}
.ag-avatar:active { transform: scale(.94); }
.ag-quota { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; margin-top: 22px; }
.ag-anneau { --t: 118px; }
.ag-anneau .centre b { font-size: 30px; line-height: 1; }
.ag-anneau .centre small { font-size: .5em; opacity: .7; margin-left: 1px; }
.ag-anneau .centre span { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .6); text-transform: uppercase; letter-spacing: .1em; }
.ag-quota-txt { min-width: 0; display: grid; gap: 6px; }
.ag-quota-txt .surtitre { color: #FFB24A; margin: 0; }
.ag-restant { font-size: clamp(34px, 11vw, 46px); color: #fff; }
.ag-sur { margin: 0; color: rgba(255, 255, 255, .62); font-size: 13px; font-weight: 600; }
.ag-quota-pied { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; }
.ag-quota-pied > div { padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); }
.ag-quota-pied dt { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .62); }
.ag-quota-pied dd { margin: 2px 0 0; font: 750 17px/1.2 var(--f-titre); font-variation-settings: "wdth" 85; }
.ag-quota-pied i { width: 8px; height: 8px; border-radius: 50%; }
.ag-puce-engage { background: var(--pompe); }
.ag-puce-consomme { background: #3FD68C; }

/* ───────── CTA & bon en cours ───────── */
.ag-cta {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; min-height: 96px;
  padding: 16px 18px; border: 0; border-radius: var(--r-l); text-align: left; color: #1B0F00;
  background: linear-gradient(135deg, #FFB24A 0%, var(--pompe) 55%, var(--pompe-2) 100%);
  box-shadow: 0 16px 32px -14px rgba(240, 138, 28, .85), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .2s var(--ressort);
}
.ag-cta:active { transform: scale(.98); }
.ag-cta > svg { width: 22px; height: 22px; }
.ag-cta-ic { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: rgba(27, 15, 0, .12); }
.ag-cta-txt b { display: block; font: 800 22px/1.1 var(--f-titre); font-variation-settings: "wdth" 85; letter-spacing: -.02em; }
.ag-cta-txt small { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; opacity: .75; line-height: 1.35; }
.ag-epuise { display: flex; gap: 12px; padding: 18px; align-items: flex-start; }
.ag-epuise > svg { width: 22px; height: 22px; color: var(--pompe); flex: none; margin-top: 1px; }
.ag-epuise b { display: block; }
.ag-epuise span { color: var(--texte-2); font-size: 14px; }

.ag-ticket-ombre { filter: drop-shadow(0 14px 24px rgba(7, 27, 61, .16)) drop-shadow(0 0 1px rgba(7, 27, 61, .28)); }
.ag-mini { display: grid; width: 100%; padding: 0; border: 0; text-align: left; box-shadow: none; transition: transform .2s var(--ressort); }
.ag-mini:active { transform: scale(.985); }
.ag-mini-haut { display: grid; gap: 12px; padding: 16px 18px 18px; }
.ag-mini-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ag-mini-montant { font-size: 34px; justify-self: start; }
.ag-mini-station { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ag-mini-station svg { width: 17px; height: 17px; color: var(--texte-3); flex: none; }
.ag-mini-pied { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-top: 2px dashed var(--brume); margin: 0 4px; }
.ag-mini-ouvrir { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--encre); }
:root[data-theme="dark"] .ag-mini-ouvrir { color: #FFB24A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ag-mini-ouvrir { color: #FFB24A; } }
.ag-mini-ouvrir svg { width: 18px; height: 18px; }

/* validité (jauge de carburant) */
.ag-validite { display: grid; gap: 8px; }
.ag-validite-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--texte-2); }
.ag-validite-ligne > span { display: inline-flex; align-items: center; gap: 6px; }
.ag-validite-ligne svg { width: 16px; height: 16px; }
.ag-validite-ligne b { font: 700 17px/1 var(--f-code); color: var(--texte); font-variant-numeric: tabular-nums; }
.ag-validite.basse .ag-validite-ligne b { color: var(--danger); animation: pulse 1s ease-in-out infinite; }
.ag-validite[data-s="presente"].basse .ag-validite-ligne b { font: 700 13.5px/1.2 var(--f-texte); color: var(--pompe-2); text-align: right; }
.ag-validite .jauge { height: 12px; }

/* ───────── sections & lignes ───────── */
.ag-section { display: grid; gap: 10px; }
.ag-section-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.ag-section-tete .btn svg { width: 16px; height: 16px; }
.ag-liste { overflow: hidden; }
.ag-ligne {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 14px; border: 0; background: none; text-align: left;
  border-bottom: 1px solid color-mix(in srgb, var(--brume) 60%, transparent); transition: background .15s;
}
.ag-ligne:last-child { border-bottom: 0; }
.ag-ligne:active { background: var(--surface-2); }
.ag-ligne-ic { --c: var(--st-genere); width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.ag-ligne-ic svg { width: 20px; height: 20px; }
.ag-ligne-ic[data-s="presente"] { --c: var(--st-presente); }
.ag-ligne-ic[data-s="valide"] { --c: var(--st-valide); }
.ag-ligne-ic[data-s="reglement_demande"] { --c: var(--st-reglement_demande); }
.ag-ligne-ic[data-s="regle"] { --c: var(--st-regle); }
.ag-ligne-ic[data-s="expire"] { --c: var(--st-expire); }
.ag-ligne-ic[data-s="annule"] { --c: var(--st-annule); }
.ag-ligne-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ag-ligne-txt b, .ag-ligne-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ligne-txt b { font-weight: 700; }
.ag-ligne-txt small { color: var(--texte-3); font-size: 12.5px; font-weight: 600; }
.ag-ligne-fin { display: grid; justify-items: end; gap: 4px; flex: none; }
.ag-ligne-fin b { font: 750 16px/1 var(--f-titre); font-variation-settings: "wdth" 85; }
.ag-ligne-fin .statut { font-size: 11px; padding: 2px 8px 2px 6px; }

/* ───────── titres de page ───────── */
.ag-titre-page { padding: calc(22px + var(--haut)) 20px 18px; display: grid; gap: 4px; }
.ag-titre-page .surtitre, .ag-titre-page .discret { margin: 0; }
.ag-titre-page .titre-l { font-size: 32px; }

/* ───────── stations ───────── */
.ag-sel-barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ag-segment { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.ag-segment button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 11px; background: none; color: var(--texte-2); font-weight: 700; font-size: 14px; transition: background .2s, color .2s; }
.ag-segment button svg { width: 17px; height: 17px; }
.ag-segment button[aria-selected="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre-1); }
.ag-tri { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--texte-3); }
.ag-tri svg { width: 15px; height: 15px; }
.ag-geo { display: flex; gap: 12px; padding: 16px; margin-bottom: 14px; border-radius: var(--r-m); background: color-mix(in srgb, var(--encre-2) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--encre-2) 18%, transparent); }
.ag-geo-ic { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--encre); color: #fff; }
.ag-geo-ic svg { width: 20px; height: 20px; }
.ag-geo b { display: block; }
.ag-geo p { margin: 2px 0 10px; color: var(--texte-2); font-size: 13.5px; line-height: 1.4; }
.ag-geo-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-geo-actions .btn { min-height: 40px; }
.ag-liste-stations { display: grid; gap: 10px; }
.ag-station {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 12px 14px; text-align: left;
  border-radius: 18px; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--brume) 70%, transparent);
  box-shadow: var(--ombre-1); transition: transform .18s var(--ressort), border-color .2s, box-shadow .2s;
}
.ag-station:active { transform: scale(.985); }
.ag-station[aria-pressed="true"] { border-color: var(--feuille); box-shadow: 0 0 0 4px color-mix(in srgb, var(--feuille) 16%, transparent); }
.ag-station-ic { width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--encre-2), var(--encre)); }
.ag-station-ic svg { width: 22px; height: 22px; }
.ag-station-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ag-station-txt b { font: 700 16px/1.2 var(--f-titre); letter-spacing: -.01em; }
.ag-station-txt small { color: var(--texte-3); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-station-fin { display: grid; justify-items: end; gap: 4px; flex: none; }
.ag-station-fin > b { font: 750 16px/1 var(--f-titre); font-variation-settings: "wdth" 85; }
.ag-habituelle { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 6px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--feuille-2); background: color-mix(in srgb, var(--feuille) 14%, transparent); }
.ag-habituelle svg { width: 12px; height: 12px; stroke-width: 3; }

/* carte (Leaflet, chargée à la demande) */
.ag-carte-cadre { position: relative; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--ombre-2); background: var(--surface-2); }
.ag-carte { height: max(340px, calc(100dvh - 360px)); touch-action: none; }
.ag-carte .leaflet-control-attribution { font-size: 10px; }
.ag-marqueur svg { width: 34px; height: 42px; filter: drop-shadow(0 4px 6px rgba(7, 27, 61, .35)); transition: transform .25s var(--ressort); transform-origin: 50% 100%; overflow: visible; }
.ag-marqueur path { fill: var(--encre); stroke: #fff; stroke-width: 2; }
.ag-marqueur circle { fill: #fff; }
.ag-marqueur.habituelle path { fill: var(--feuille); }
.ag-marqueur.actif svg { transform: scale(1.25); }
.ag-marqueur.actif path { fill: var(--pompe); }
.ag-moi { border-radius: 50%; background: #2F6FDB; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 111, 219, .25), 0 2px 6px rgba(0, 0, 0, .3); }
.ag-carte-fiche {
  position: absolute; z-index: 500; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--ombre-3); animation: apparait .35s var(--ressort);
}
.ag-carte-fiche-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ag-carte-fiche-txt small { color: var(--texte-3); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-carte-fiche .btn { min-height: 44px; }

/* fiche station */
.ag-fiche { display: grid; gap: 14px; }
.ag-fiche-ic { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--encre-2), var(--nuit)); box-shadow: var(--ombre-2); }
.ag-fiche .surtitre { margin: 0 0 4px; }
.ag-fiche-adresse { display: flex; gap: 8px; margin: 0; color: var(--texte-2); font-weight: 600; }
.ag-fiche-adresse svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.ag-fiche-faits { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-fiche-faits .badge { padding: 6px 12px; font-size: 13px; }
.ag-fiche-faits .badge svg { width: 14px; height: 14px; }

/* ───────── feuille plein écran : générer un bon ───────── */
.feuille.ag-plein { top: 0; max-height: none; height: 100dvh; border-radius: 0; padding: 0 16px calc(20px + var(--bas)); }
.feuille.ag-plein::before { display: none; }
@media (min-width: 760px) {
  .feuille.ag-plein { top: 50%; height: min(860px, 94dvh); border-radius: 28px; padding-bottom: 24px; }
}
.ag-gen-tete {
  position: sticky; top: 0; z-index: 600; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px;
  padding: calc(8px + var(--haut)) 0 10px; margin: 0 -4px; background: var(--surface);
}
.ag-gen-tete .btn-icone { width: 44px; min-height: 44px; }
.ag-etapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ag-etapes i { height: 5px; border-radius: 9px; background: var(--surface-2); overflow: hidden; position: relative; }
.ag-etapes i::after { content: ""; position: absolute; inset: 0; background: var(--pompe); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--doux); }
.ag-etapes i.fait::after { transform: scaleX(1); }
.ag-gen-corps { display: grid; gap: 16px; padding-top: 6px; }
.ag-pas { animation: ag-pas .38s var(--doux); }
@keyframes ag-pas { from { opacity: 0; transform: translateX(calc(var(--sens, 1) * 28px)); } }
.ag-gen-titre { display: grid; gap: 4px; }
.ag-gen-titre .surtitre, .ag-gen-titre .discret { margin: 0; }

.ag-rappel-station {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 14px; border: 0; border-radius: 16px;
  background: var(--surface-2); text-align: left;
}
.ag-rappel-station > svg { width: 20px; height: 20px; color: var(--texte-3); flex: none; }
.ag-rappel-station > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.ag-rappel-station small { color: var(--texte-3); font-size: 12.5px; font-weight: 600; }
.ag-lien { font-weight: 800; font-size: 13.5px; color: var(--encre-2); }
:root[data-theme="dark"] .ag-lien { color: #FFB24A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ag-lien { color: #FFB24A; } }

.ag-montant { display: grid; justify-items: center; gap: 10px; text-align: center; }
.ag-montant .surtitre { margin: 0; }
.ag-montant .compteur { font-size: clamp(46px, 15vw, 62px); padding: .16em .32em; border-radius: 16px; }
.ag-aide { margin: 0; min-height: 20px; font-size: 13.5px; font-weight: 700; color: var(--texte-2); transition: color .2s; }
.ag-aide.alerte { color: var(--danger); }

.ag-puces { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-puces.ag-defile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-snap-type: x proximity; }
.ag-puces.ag-defile::-webkit-scrollbar { display: none; }
.ag-puce {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; flex: 1 0 auto;
  border-radius: 14px; border: 1.5px solid var(--brume); background: var(--surface); color: var(--texte);
  font-weight: 700; font-size: 14px; white-space: nowrap; transition: transform .18s var(--ressort), background .2s, border-color .2s, color .2s;
}
.ag-puce:active { transform: scale(.96); }
.ag-puce:disabled { opacity: .4; text-decoration: line-through; }
.ag-puce[aria-pressed="true"], .ag-puce[aria-checked="true"], .ag-puce[aria-selected="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.ag-puce-vehicule { flex: 0 0 auto; justify-content: flex-start; text-align: left; min-height: 54px; scroll-snap-align: start; }
.ag-puce-vehicule svg { width: 20px; height: 20px; flex: none; }
.ag-puce-vehicule span { display: grid; line-height: 1.2; }
.ag-puce-vehicule b { font-family: var(--f-code); font-size: 13px; letter-spacing: .03em; }
.ag-puce-vehicule small { font-size: 11.5px; font-weight: 600; opacity: .7; }
.ag-rapides { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ag-rapides .ag-puce { padding: 0 4px; font-size: 13.5px; }
.ag-vehicules { display: grid; gap: 8px; }
.ag-vehicules .surtitre { margin: 0; }

.ag-pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ag-touche {
  min-height: 56px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--texte);
  font: 700 26px/1 var(--f-titre); font-variation-settings: "wdth" 85; transition: transform .12s var(--ressort), background .12s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.ag-touche:active { transform: scale(.94); background: var(--brume); }
.ag-touche-effacer { display: grid; place-items: center; color: var(--texte-2); }
.ag-touche-effacer svg { width: 24px; height: 24px; }

.ag-recap { box-shadow: none; }
.ag-recap-haut { display: grid; justify-items: start; gap: 8px; padding: 20px 20px 22px; }
.ag-recap-haut .surtitre { margin: 0; }
.ag-recap-haut .compteur { font-size: 44px; margin-top: 6px; }
.ag-recap .perforation, .ag-ticket .perforation { margin: 0 22px; }
.ag-recap .ag-details { padding: 18px 20px 20px; }
.ag-note { display: flex; gap: 10px; margin: 0; color: var(--texte-2); font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.ag-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--texte-3); }

.ag-details { display: grid; gap: 10px; margin: 0; }
.ag-details > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.ag-details dt { color: var(--texte-3); font-size: 13px; font-weight: 700; flex: none; }
.ag-details dd { margin: 0; font-weight: 700; text-align: right; min-width: 0; }

/* ───────── le bon : plein écran lumineux (blanc même en thème sombre, pour le scan) ───────── */
.ag-bon {
  --papier: #fff; --surface: #fff; --surface-2: #EEF2F8; --brume: #DCE3EE; --texte: #0E1B33; --texte-2: #4D5B75; --texte-3: #8592A8; --danger-fond: #FDECEC;
  color-scheme: light; position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; color: var(--texte); padding: calc(6px + var(--haut)) 18px calc(24px + var(--bas));
  display: flex; flex-direction: column; gap: 14px; animation: ag-ouvre .42s var(--ressort);
}
.ag-bon.sortie { animation: ag-ferme .26s var(--doux) forwards; }
@keyframes ag-ouvre { from { opacity: 0; transform: translateY(40px) scale(.98); } }
@keyframes ag-ferme { to { opacity: 0; transform: translateY(40px); } }
.ag-bon > * { width: 100%; max-width: 420px; margin-inline: auto; }
.ag-bon > .ag-succes { max-width: none; }
.ag-bon-tete { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.ag-bon-tete .btn-icone { width: 44px; min-height: 44px; }
.ag-bon-titre { display: grid; justify-items: center; gap: 4px; }
.ag-bon-titre .surtitre { line-height: 1; }
.ag-bandeau {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--pompe) 14%, #fff); color: var(--pompe-2); font-weight: 800; animation: apparait .4s var(--ressort);
}
.ag-bandeau i { width: 10px; height: 10px; border-radius: 50%; background: var(--pompe); box-shadow: 0 0 0 0 rgba(240, 138, 28, .6); animation: ag-onde 1.6s infinite; }
@keyframes ag-onde { 70% { box-shadow: 0 0 0 10px rgba(240, 138, 28, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 138, 28, 0); } }

.ag-ticket { box-shadow: none; background: #fff; }
.ag-ticket-haut { display: grid; justify-items: center; gap: 6px; padding: 22px 20px 14px; text-align: center; }
.ag-ticket-haut .surtitre { margin: 0; }
.ag-ticket-haut .compteur { font-size: 46px; margin-top: 8px; }
.ag-qr-zone { position: relative; display: grid; place-items: center; padding: 6px 20px 4px; }
.ag-qr { width: min(64vw, 240px); aspect-ratio: 1; display: grid; place-items: center; transition: filter .4s, opacity .4s; }
.ag-qr svg { width: 100%; height: 100%; }
.ag-qr .squelette { width: 100%; height: 100%; }
.ag-qr-echec { margin: 0; padding: 20px; text-align: center; color: var(--texte-2); font-weight: 700; }
.ag-code { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 16px 18px; }
.ag-code-txt { display: inline-flex; gap: .12em; font: 700 clamp(22px, 7vw, 28px)/1 var(--f-code); letter-spacing: .08em; color: var(--encre); }
.ag-code-pref, .ag-code-txt i { color: var(--texte-3); }
.ag-code-txt i { font-style: normal; font-weight: 500; }
.ag-code .btn-icone { width: 44px; min-height: 44px; }
.ag-ticket-bas { display: grid; gap: 16px; padding: 18px 20px 22px; }
.ag-fin { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--texte-2); }
.ag-fin svg { width: 20px; height: 20px; flex: none; }
.ag-bon[data-fin="servi"] .ag-fin { color: var(--feuille-2); }
.ag-bon-actions { display: grid; gap: 10px; margin-top: auto; }
.ag-consigne { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 0; color: var(--texte-3); font-size: 13px; font-weight: 600; text-align: center; }
.ag-consigne svg { width: 17px; height: 17px; flex: none; }

/* tampon : le ticket servi (ou mort) est frappé */
.ag-tampon {
  position: absolute; left: 50%; top: 50%; padding: 6px 18px; border: 5px solid currentColor; border-radius: 14px;
  font: 800 44px/1 var(--f-titre); font-variation-settings: "wdth" 75; letter-spacing: .06em; text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-14deg); opacity: 0; pointer-events: none; mix-blend-mode: multiply;
}
.ag-bon[data-fin] .ag-tampon:not(:empty) { opacity: .9; }
.ag-bon[data-fin="servi"] .ag-tampon { color: var(--feuille); }
.ag-bon[data-statut="expire"] .ag-tampon { color: var(--texte-3); }
.ag-bon[data-statut="annule"] .ag-tampon { color: var(--danger); }
.ag-bon.tamponne .ag-tampon { animation: ag-tampon .55s var(--ressort) both; }
@keyframes ag-tampon { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-24deg) scale(2.4); } 60% { opacity: .95; } 100% { opacity: .9; transform: translate(-50%, -50%) rotate(-14deg) scale(1); } }
.ag-bon[data-fin="servi"] .ag-qr { opacity: .18; filter: grayscale(1); }
.ag-bon[data-fin="mort"] .ag-qr { opacity: .2; filter: grayscale(1) blur(3px); }
.ag-bon[data-fin="mort"] .ag-ticket-ombre { filter: grayscale(1) drop-shadow(0 0 1px rgba(7, 27, 61, .25)); opacity: .82; }
.ag-bon[data-fin="mort"] .ag-code-txt { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--texte-3); }
.ag-bon[data-fin] .ag-code .btn-icone { display: none; }

/* succès : coche dessinée */
.ag-succes {
  position: fixed; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center;
  background: radial-gradient(120% 70% at 50% 40%, #E9FBF1 0%, #fff 70%); color: var(--texte); animation: fondu .25s ease;
}
.ag-succes.sortie { animation: fonduOut .38s ease forwards; }
.ag-succes p { margin: 0; }
.ag-succes .titre-xl { margin-top: 18px; color: var(--feuille-2); animation: apparait .5s .45s var(--doux) both; }
.ag-succes-montant { font: 800 30px/1 var(--f-titre); font-variation-settings: "wdth" 80; animation: apparait .5s .55s var(--doux) both; }
.ag-succes-station { color: var(--texte-2); font-weight: 600; animation: apparait .5s .62s var(--doux) both; }
.ag-succes-disque { position: relative; width: 132px; height: 132px; }
.ag-succes-disque::before, .ag-succes-disque::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--feuille); opacity: 0; animation: ag-onde-succes 1.2s .35s var(--doux); }
.ag-succes-disque::after { animation-delay: .55s; }
@keyframes ag-onde-succes { from { opacity: .6; transform: scale(.9); } to { opacity: 0; transform: scale(1.8); } }
.ag-succes-disque svg { width: 100%; height: 100%; overflow: visible; }
.ag-succes-cercle { fill: var(--feuille); stroke: var(--feuille); stroke-width: 4; stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; transform: rotate(-90deg); transform-origin: center; animation: ag-trait .5s var(--doux) forwards, ag-remplit .3s .45s ease forwards; }
.ag-succes-coche { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ag-trait .4s .55s var(--ressort) forwards; }
@keyframes ag-trait { to { stroke-dashoffset: 0; } }
@keyframes ag-remplit { to { fill-opacity: 1; } }

/* ───────── historique ───────── */
.ag-total { display: grid; gap: 6px; padding: 18px 20px; background: linear-gradient(140deg, var(--encre) 0%, var(--nuit) 100%); color: #fff; border: 0; }
.ag-total .surtitre { color: #FFB24A; }
.ag-total-cpt { font-size: 40px; }
.ag-total small { color: rgba(255, 255, 255, .65); font-weight: 600; font-size: 13px; }
.ag-filtres .ag-puce { flex: 0 0 auto; }
.ag-jour { display: grid; gap: 8px; }
.ag-jour h2 { margin: 6px 4px 0; }

.ag-detail { display: grid; gap: 14px; }
.ag-detail-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ag-detail-tete .surtitre { margin: 0 0 4px; }
.ag-detail > .compteur { font-size: 40px; justify-self: start; }
.ag-detail-code { margin: 0; font-size: 18px; color: var(--encre-2); }
:root[data-theme="dark"] .ag-detail-code { color: #FFB24A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ag-detail-code { color: #FFB24A; } }
.ag-detail h3 { margin: 6px 0 0; }
.ag-frise { list-style: none; margin: 0; padding: 0; display: grid; }
.ag-frise li { --c: var(--brume); position: relative; display: flex; gap: 14px; padding-bottom: 16px; animation: apparait .45s var(--doux) both; animation-delay: calc(var(--i) * 70ms); }
.ag-frise li:last-child { padding-bottom: 0; }
.ag-frise li::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: -2px; width: 2px; background: var(--brume); }
.ag-frise li:last-child::before { display: none; }
.ag-frise li.fait { --c: var(--st-genere); }
.ag-frise li.fait[data-s="presente"] { --c: var(--st-presente); }
.ag-frise li.fait[data-s="valide"] { --c: var(--st-valide); }
.ag-frise li.fait[data-s="reglement_demande"] { --c: var(--st-reglement_demande); }
.ag-frise li.fait[data-s="regle"] { --c: var(--st-regle); }
.ag-frise li.fait[data-s="expire"] { --c: var(--st-expire); }
.ag-frise li.fait[data-s="annule"] { --c: var(--st-annule); }
.ag-frise li.fait:not(:last-child)::before { background: var(--c); }
.ag-frise-point { width: 18px; height: 18px; flex: none; margin-top: 2px; border-radius: 50%; border: 3px solid var(--c); background: var(--surface); }
.ag-frise li.fait .ag-frise-point { background: var(--c); }
.ag-frise li.actuel .ag-frise-point { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); }
.ag-frise-txt { display: grid; gap: 1px; }
.ag-frise-txt small { color: var(--texte-3); font-size: 13px; font-weight: 600; }
.ag-frise li:not(.fait) b { color: var(--texte-3); }

/* ───────── profil ───────── */
.ag-profil-tete { display: grid; justify-items: center; gap: 6px; padding: calc(30px + var(--haut)) 20px 22px; text-align: center; }
.ag-profil-tete p { margin: 0; color: var(--texte-2); font-weight: 600; }
.ag-avatar-xl { width: 88px; height: 88px; border-radius: 28px; font-size: 32px; margin-bottom: 8px; }
.ag-profil-sq { padding-top: calc(30px + var(--haut)); }
.ag-reglages { margin: 0; overflow: hidden; }
.ag-reglage {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px;
  border: 0; background: none; text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--brume) 60%, transparent);
}
.ag-reglage:last-child { border-bottom: 0; }
.ag-reglage dt, .ag-bascule > span { display: flex; align-items: center; gap: 12px; color: var(--texte-2); font-weight: 700; font-size: 14px; }
.ag-bascule > span { flex: 1; color: var(--texte); }
.ag-reglage svg { width: 20px; height: 20px; flex: none; color: var(--texte-3); }
.ag-reglage dd { margin: 0; font-weight: 700; text-align: right; }
.ag-interrupteur { position: relative; width: 50px; height: 30px; flex: none; border-radius: 999px; background: var(--brume); transition: background .25s; }
.ag-interrupteur::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform .3s var(--ressort); }
.ag-bascule[aria-checked="true"] .ag-interrupteur { background: var(--feuille); }
.ag-bascule[aria-checked="true"] .ag-interrupteur::after { transform: translateX(20px); }
.ag-pied { text-align: center; margin: 0; }

/* ───────── tirer pour rafraîchir ───────── */
.ag-tirer {
  position: fixed; z-index: 45; left: 50%; top: calc(4px + var(--haut)); width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--encre-2); box-shadow: var(--ombre-2);
  transform: translate(-50%, -60px); opacity: 0; pointer-events: none; transition: transform .3s var(--doux), opacity .2s, color .2s;
}
.ag-tirer svg { width: 20px; height: 20px; }
.ag-tirer.pret { color: var(--pompe); }
.ag-tirer.charge svg { animation: tourne .8s linear infinite; }

/* ───────── barre d'onglets : cibles tactiles ───────── */
.ag-app .onglet { min-height: 52px; }
