/* Thème « Côte d'Ivoire » : orange, blanc, vert du drapeau, or et motifs kenté. */
:root {
  --orange: #ee8d3f; /* orange adouci (prix, boutons) */
  --orange-deep: #d9772b;
  --green: #009e60;
  --green-deep: #007a4a;
  --gold: #e8b13a;
  --red: #e5484d;
  /* Thème clair « ivoire wax » : fond crème, papier peint d'éléphants alignés en diagonales, avec losanges et points. */
  --bg: #f7f6f0;
  --surface: #ffffff;
  --surface-2: #edf1ea;
  --text: #14211a;
  --muted: #5f7268;
  --border: rgba(20, 33, 26, 0.09);
  --shadow: 0 6px 18px rgba(20, 60, 40, 0.08);
  --wallpaper:
    radial-gradient(120% 70% at 100% 0%, rgba(247, 127, 0, 0.07), transparent 60%),
    radial-gradient(120% 80% at 0% 100%, rgba(0, 158, 96, 0.08), transparent 60%),
    url('bg-light.png?v=diag');
  --wallpaper-tile: 300px; /* éléphants alignés en diagonales, 10 par motif */
  --radius: 18px;
  --nav-h: 72px;
  /* Fond « carte wallet » : base vert nuit, lueur orange en haut à gauche, verte en bas à droite. */
  --gradient:
    radial-gradient(90% 130% at 0% 0%, rgba(247, 127, 0, 0.45), transparent 62%),
    radial-gradient(85% 120% at 100% 100%, rgba(0, 158, 96, 0.5), transparent 62%),
    linear-gradient(160deg, #11261c, #07110c);
  --glow-border: 1px solid rgba(255, 255, 255, 0.09);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  /* Zones protégées : encoche, barre système et, en plein écran, boutons de Telegram (voir common.js). */
  --app-top: var(--tg-top, 0px);
  --app-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-bottom, 0px));
  --app-left: max(env(safe-area-inset-left, 0px), var(--tg-left, 0px));
  --app-right: max(env(safe-area-inset-right, 0px), var(--tg-right, 0px));
  color-scheme: light;
}

:root[data-theme='dark'] {
  --orange: #f5a15e; /* orange adouci (prix, boutons) */
  --orange-deep: #ec8d45;
  --green: #19b477;
  --green-deep: #0f9a62;
  --gold: #f0c251;
  /* Thème sombre « terre de nuit » : brun très profond, éléphants vert vif alignés en diagonales. */
  --bg: #140e0a;
  --surface: #1f1712;
  --surface-2: #2c2119;
  --text: #f8eedf;
  --muted: #b09a83;
  --border: rgba(255, 236, 214, 0.08);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  --wallpaper:
    radial-gradient(110% 60% at 50% -10%, rgba(247, 127, 0, 0.12), transparent 65%),
    radial-gradient(90% 60% at 100% 100%, rgba(25, 180, 119, 0.08), transparent 60%),
    url('bg-dark.png?v=diag');
  --wallpaper-tile: 300px; /* même disposition en diagonales que le thème clair */
  color-scheme: dark;
}

/* Papier peint : couche fixe derrière tout le contenu (fonctionne aussi sur iOS, contrairement à background-attachment: fixed). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--wallpaper);
  background-size: auto, auto, var(--wallpaper-tile) var(--wallpaper-tile);
  background-repeat: no-repeat, no-repeat, repeat;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + 16px + var(--app-bottom));
}
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.02em; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Logo : tête d'éléphant ---------- */
.brand-mark {
  --size: 48px;
  flex-shrink: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 30%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
}
.brand-mark img { width: 84%; height: 84%; object-fit: contain; display: block; }
.brand-mark .logo-dark { display: none; }
:root[data-theme='dark'] .brand-mark .logo-light, .brand-mark.on-dark .logo-light { display: none; }
:root[data-theme='dark'] .brand-mark .logo-dark, .brand-mark.on-dark .logo-dark { display: block; }
.brand-mark.on-dark { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); }
.brand-mark.sm { --size: 40px; }
.brand-mark.lg { --size: 70px; }

/* ---------- Barre du haut ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: var(--app-top) var(--app-right) 0 var(--app-left);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.appbar-inner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 760px; margin: 0 auto; }
.brand-btn { border: 0; background: none; padding: 0; cursor: pointer; display: flex; }
.search-pill, .balance-pill {
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.search-pill { flex: 1; min-width: 0; padding: 0 14px; color: var(--muted); font-size: 14px; }
.search-pill .ico { width: 18px; height: 18px; color: var(--orange); }
.balance-pill { padding: 0 12px 0 5px; flex-shrink: 0; font-size: 13px; color: var(--green); }
.pill-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--orange) 15%, transparent);
  color: var(--orange);
}
.pill-icon .ico { width: 17px; height: 17px; }

/* ---------- Mise en page ---------- */
main { padding: 0; }
.page { padding: 16px; max-width: 760px; margin: 0 auto; }
.page-title { margin: 6px 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.01em; }
.page-subtitle { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.page-title + :not(.page-subtitle) { margin-top: 14px; }
.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.section-title small { font-family: var(--font-body); color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-label .ico { width: 16px; height: 16px; }
.section-label .link { margin-left: auto; letter-spacing: 0; text-transform: none; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.link { border: 0; background: none; color: var(--orange); font-size: 13px; font-weight: 700; cursor: pointer; padding: 0 0 0 6px; }

/* ---------- Animations ---------- */
/* Jetons de mouvement : mêmes durées et courbes partout dans l'app. */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* départ vif, arrivée douce */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* léger rebond */
  --dur-1: 140ms; /* appui */
  --dur-2: 240ms; /* survol, couleurs */
  --dur-3: 420ms; /* ouverture d'un panneau */
  --dur-4: 620ms; /* entrée d'un élément */
}
/* Entrée : l'élément monte, grossit un peu et passe du flou au net. */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(4px); } }
@keyframes enterRight { from { opacity: 0; transform: translateX(28px); filter: blur(3px); } }
@keyframes enterLeft { from { opacity: 0; transform: translateX(-28px); filter: blur(3px); } }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.24); } 65% { transform: scale(0.94); } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes digit-in { from { opacity: 0; transform: translateY(55%) scale(0.7); filter: blur(6px); } }
.enter-right { animation: enterRight var(--dur-3) var(--ease-out); }
.enter-left { animation: enterLeft var(--dur-3) var(--ease-out); }
.card, .row, .tile, .order-card, .method { animation: rise var(--dur-4) var(--ease-out) both; }
/* Re-dessin après un ajout au panier / favori : pas de cascade rejouée, seul le bouton touché « pope ». */
main.is-static :is(.card, .row, .tile, .order-card, .method, .spotlight, .empty, .chip),
main.is-static :is(.card, .row, .tile, .order-card, .method, .spotlight) * { animation: none; }
main.is-static .just, .just { animation: pop var(--dur-3) var(--ease-spring); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Accueil ---------- */
.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  border-radius: 22px;
  color: #fff;
  background:
    var(--gradient);
  border: var(--glow-border);
  color: #f4fbf6;
  box-shadow: var(--shadow);
}
.hero-text { flex: 1; min-width: 0; }
.eyebrow { font-size: 13px; font-weight: 700; opacity: 0.92; }
.hero-card h1 { margin: 4px 0 6px; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.hero-card p { margin: 0; font-size: 13px; opacity: 0.9; }
.hero-card .brand-mark { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); }

/* ---------- Catégories ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 16px -16px 0;
  padding: 2px 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), border-color var(--dur-2), transform var(--dur-2) var(--ease-spring);
}
.chip:active { transform: scale(0.94); transition-duration: var(--dur-1); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; animation: pop var(--dur-3) var(--ease-spring); }

/* ---------- Recherche ---------- */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 14px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--orange); }
.search > .ico { width: 18px; height: 18px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { border: 0; background: none; color: var(--muted); padding: 6px; cursor: pointer; display: flex; }
.search .clear .ico { width: 18px; height: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.tile:active { transform: scale(0.98); }
.tile-emoji { font-size: 26px; margin-bottom: 4px; }
.tile small { color: var(--muted); }

/* ---------- Grille d'articles ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s;
}
.card:active { transform: scale(0.97); transition-duration: var(--dur-1); }
.thumb { position: relative; width: 100%; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); opacity: 0.45; }
.thumb .placeholder .ico { width: 34%; height: 34%; stroke-width: 1.4; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .cat { font-size: 12px; color: var(--muted); font-weight: 500; }
.card h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.25; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }

.price { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; min-width: 0; }
.card-foot .price { flex: 1; column-gap: 4px; }
.price b { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--orange); white-space: nowrap; }
.price s { color: var(--muted); font-size: 13px; white-space: nowrap; }

.add {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2) var(--ease-out), box-shadow var(--dur-2);
}
.add .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.add:active { transform: scale(0.86); transition-duration: var(--dur-1); }
.add.in { background: var(--green); }
.add.just .ico { animation: icon-in var(--dur-3) var(--ease-spring); }
@keyframes icon-in { from { transform: rotate(-90deg) scale(0.4); opacity: 0; } }
.owned { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }
.owned .ico { width: 14px; height: 14px; stroke-width: 3; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.badge.promo { background: var(--red); }
.badge.hot { background: var(--orange); }
.badge.limited { background: #0c1a13; color: var(--gold); }

/* ---------- Best sellers : carte vedette + bandeau numéroté ---------- */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes border-spin { to { --spin: 360deg; } }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes drift { 0%, 100% { transform: scale(1.04) translate(0, 0); } 50% { transform: scale(1.1) translate(-2%, -2%); } }

.best { margin-top: 24px; }
.best-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.best-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); animation: live-pulse 1.8s var(--ease-out) infinite; }
.best-title { margin: 4px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; line-height: 1; }
.best-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--orange), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.best-count {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--orange) 25%, transparent);
}

/* Chiffres du classement : apparition une par une. */
.digits { display: inline-flex; overflow: hidden; padding: 0.04em 0.02em; }
.digits i { display: inline-block; font-style: normal; animation: digit-in var(--dur-4) var(--ease-spring) both; animation-delay: calc(var(--d) * 80ms + 180ms); }

/* Carte vedette du n°1 */
.spotlight {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border-radius: 24px;
  color: #f4fbf6;
  background: var(--gradient);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  isolation: isolate;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-2);
  animation: rise var(--dur-4) var(--ease-out) both;
}
/* Bordure lumineuse qui tourne autour de la carte. */
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--spin), rgba(255, 255, 255, 0.08) 0 55%, var(--gold) 70%, var(--orange) 80%, rgba(255, 255, 255, 0.08) 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-spin 5s linear infinite;
  pointer-events: none;
}
/* Reflet qui suit la souris. */
.spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 70%) var(--my, 0%), rgba(255, 255, 255, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-2);
}
.spotlight:active { transform: perspective(900px) scale(0.98); transition-duration: var(--dur-1); }
/* Image du n°1 sur toute la largeur de la carte. */
.spot-media .thumb { border-radius: 18px; background: rgba(255, 255, 255, 0.06); aspect-ratio: 16 / 9; }
.spot-media .thumb img { animation: drift 9s var(--ease-in-out) infinite; }
.spot-media .fav { right: 6px; bottom: 6px; width: 30px; height: 30px; }
.spot-media .badge { top: 8px; left: 8px; font-size: 10px; }
.spot-info {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  padding: 2px 6px 4px;
}
.spot-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.spot-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 52px;
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin-left: -0.04em;
}
.spot-rank .digits i {
  background: linear-gradient(180deg, #fff 10%, var(--gold) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.spot-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.spot-kicker .ico { width: 13px; height: 13px; fill: currentColor; stroke-width: 0; }
.spot-info .cat { font-size: 12px; color: rgba(244, 251, 246, 0.68); font-weight: 500; }
.spot-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spot-info .card-foot { grid-column: 1 / -1; margin-top: 0; }
.spot-info .price b { color: #f5a15e; font-size: 17px; }
.spot-info .price .from, .spot-info .price s { color: rgba(244, 251, 246, 0.6); }
.spot-info .owned { color: #7ee2b0; }
@media (min-width: 600px) {
  .spotlight { padding: 12px; }
  .spot-rank { font-size: 68px; }
  .spot-info h3 { font-size: 21px; }
  .spot-info .price b { font-size: 22px; }
  .best-title { font-size: 30px; }
}
/* Grand écran : image large à gauche, infos à droite. */
@media (min-width: 900px) {
  .spotlight { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
  .spot-info { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 14px; padding: 12px 12px 12px 0; }
  .spot-rank { font-size: 84px; }
}

/* Bandeau des suivants (n°2 et plus) */
.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 12px -16px 0;
  padding: 2px 16px 6px;
  scroll-padding: 0 16px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail .card { flex: 0 0 160px; scroll-snap-align: start; }
.card.ranked .thumb::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.rank-num {
  position: absolute;
  left: 8px;
  bottom: 2px;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
/* Carrousel : 2 cartes visibles sur téléphone, 3 sur tablette, 4 sur ordinateur. */
.carousel { position: relative; }
.carousel .rail .card { flex-basis: calc((100% - 12px) / 2); }
@media (min-width: 600px) { .carousel .rail .card { flex-basis: calc((100% - 24px) / 3); } }
@media (min-width: 900px) { .carousel .rail .card { flex-basis: calc((100% - 36px) / 4); } }
.carousel-arrow {
  position: absolute;
  top: 34%;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--dur-2) var(--ease-spring), opacity var(--dur-2);
}
.carousel-arrow.prev { left: -10px; }
.carousel-arrow.prev .ico { transform: rotate(180deg); }
.carousel-arrow.next { right: -10px; }
.carousel-arrow:active { transform: scale(0.9); }
@media (hover: hover) { .carousel-arrow { display: grid; } .carousel-arrow:hover { transform: scale(1.08); } }
.carousel.static .carousel-arrow { display: none; }
.carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.carousel-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  cursor: pointer;
  transition: width var(--dur-3) var(--ease-out), background var(--dur-2);
}
.carousel-dots button.active { width: 20px; background: var(--orange); }

/* ---------- Favoris, partage, tri ---------- */
.fav {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.15s, background 0.2s, color 0.2s;
}
.fav .ico { width: 18px; height: 18px; }
.fav:active { transform: scale(0.85); }
.fav.on { background: #fff; color: var(--red); }
.fav.on .ico { fill: currentColor; }
.hero-actions { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; gap: 8px; }
.hero-actions .fav { position: static; width: 42px; height: 42px; }
.hero-actions .fav .ico { width: 20px; height: 20px; }

.section-title:has(.sort) { align-items: center; }
.title-main { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.section-title .count-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.sort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
}
.sort .ico { width: 14px; height: 14px; color: var(--orange); flex-shrink: 0; }
.sort select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  outline: none;
}
.soldout { font-size: 12px; font-weight: 700; color: var(--red); white-space: nowrap; }

/* Vignette qui s'envole vers le panier */
.fly-dot {
  position: fixed;
  z-index: 80;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--orange) center / cover no-repeat;
  border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Chargement de l'accueil */
.card-skeleton {
  aspect-ratio: 0.74;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

/* ---------- Recharge en crypto ---------- */
.coin {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  background: #8a8f98;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.coin.ltc { background: linear-gradient(145deg, #4b77be, #2c4f8c); }
.coin.sol { background: linear-gradient(145deg, #9945ff, #14c48a); }
.coin.usdt { background: linear-gradient(145deg, #2fb38f, #1a8a6c); }
.coin.paypal { background: linear-gradient(145deg, #179bd7, #253b80); font-style: italic; font-weight: 800; }
.chev { color: var(--muted); display: grid; place-items: center; }
.chev .ico { width: 18px; height: 18px; }
.tag.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
b.muted { color: var(--muted); }
.hint.center { text-align: center; }

.deposit-page { z-index: 55; padding-bottom: calc(40px + var(--app-bottom)); }
.deposit-content { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; }
.deposit-head { display: flex; align-items: center; gap: 14px; }
.deposit-head .coin { width: 56px; height: 56px; font-size: 28px; }
.deposit-head h2 { margin: 0 0 6px; font-size: 21px; }
.deposit-head .cat-pill { margin: 0; }
.qr-card {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-radius: 24px;
  background: #fff; /* fond blanc obligatoire pour que le QR reste lisible en thème sombre */
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  animation: rise 0.4s both;
}
.qr-card img { display: block; width: 220px; height: 220px; }
.qr-card small { color: #4f6158; font-size: 12px; font-weight: 600; max-width: 220px; text-align: center; }
.address-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.address-card small { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.address-card code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.info-box.warn .ico { color: var(--orange); }
.intent-form { display: flex; flex-direction: column; gap: 12px; }
.intent-form .section-label { margin: 6px 0 0; }
.intent-form .hint { margin: 0; }
.pay-amount {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 16px;
  border-radius: 22px;
  text-align: center;
  color: #f4fbf6;
  background: var(--gradient);
  border: var(--glow-border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  animation: rise 0.4s both;
}
.pay-amount small { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.pay-amount b { font-family: var(--font-mono, ui-monospace, monospace); font-size: 26px; letter-spacing: 0.01em; word-break: break-all; }
.pay-amount span { font-size: 14px; opacity: 0.9; }
.pay-amount .btn { margin-top: 8px; background: rgba(255, 255, 255, 0.14); color: #f4fbf6; border-color: rgba(255, 255, 255, 0.25); }
.pay-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--orange) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent);
}
.pay-status.detected {
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 35%, transparent);
}
.pay-status div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-status strong { font-size: 14px; }
.pay-status small { font-size: 12px; color: var(--muted); }
.spinner {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--orange) 25%, transparent);
  border-top-color: var(--orange);
  animation: spin 0.9s linear infinite;
}
.pay-status.detected .spinner { border-color: color-mix(in srgb, var(--green) 25%, transparent); border-top-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
.center-link { align-self: center; padding: 6px; }
.manual-fallback {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed var(--border);
}
.manual-fallback summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.manual-fallback[open] summary { margin-bottom: 12px; }
.declare-form { display: flex; flex-direction: column; gap: 12px; }
.declare-form .hint { margin: 0; }

/* ---------- Écran de succès ---------- */
.success {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  overflow: hidden;
}
.success.open { opacity: 1; visibility: visible; }
.success-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  text-align: center;
  padding: 30px 22px 22px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.success.open .success-card { transform: none; }
.success-check {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--green) 16%, transparent);
}
.success.open .success-check { animation: pop 0.5s 0.15s both; }
.success-check .ico { width: 38px; height: 38px; stroke-width: 3; }
.success h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.success p { margin: 0 0 20px; color: var(--muted); line-height: 1.45; }
.success-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.success-actions .btn { width: 100%; }
.success-actions .link { margin-top: 6px; padding: 6px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
}
.success.open .confetti i { animation: confetti-fall linear both; }
@keyframes confetti-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0.9; transform: translate(var(--drift), 105vh) rotate(var(--spin)); }
}
.rank {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  color: #f4fbf6;
  background: var(--gradient);
  border: var(--glow-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ---------- États vides & chargement ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 44px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  animation: rise 0.4s both;
}
.empty-icon {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: var(--orange);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
  box-shadow: 0 0 32px color-mix(in srgb, var(--orange) 25%, transparent);
}
.empty-icon .ico { width: 32px; height: 32px; }
.empty strong { color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.empty span { max-width: 300px; line-height: 1.45; }
.empty .btn { margin-top: 10px; }
.skeleton {
  height: 132px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.muted-box {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
}

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
}
.row.clickable { cursor: pointer; }
.row.clickable:active { transform: scale(0.99); }
.row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .info small { color: var(--muted); }
.row .info[role='button'] { cursor: pointer; }
.row-price { color: var(--orange); font-family: var(--font-mono); font-size: 14px; margin-top: 2px; }
.row img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.row .emoji { font-size: 22px; width: 36px; text-align: center; flex-shrink: 0; }
.thumb-sm {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
}
.thumb-sm .ico { width: 24px; height: 24px; }
.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.tx-icon .ico { width: 19px; height: 19px; }
.tx-icon.in { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.tx-icon.out, .tx-icon.support { background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange); }
.plus { color: var(--green); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }

/* ---------- Boutons ---------- */
.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s, opacity 0.15s, filter 0.15s;
}
.btn .ico { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.green { background: var(--green); }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: none; color: var(--muted); padding: 8px 6px; }
.btn.danger { background: none; color: var(--red); padding: 8px 6px; }
.btn.small { padding: 8px 11px; font-size: 13px; border-radius: 11px; gap: 5px; }
.btn.small .ico { width: 15px; height: 15px; }
.btn.block { width: 100%; padding: 16px; font-size: 16px; border-radius: 18px; }
.btn.gradient {
  background: var(--gradient);
  border: var(--glow-border);
  color: #f4fbf6;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn.danger { color: var(--red); }
.icon-btn .ico { width: 19px; height: 19px; }

/* ---------- Panier ---------- */
.discount-form { display: flex; gap: 8px; margin-top: 14px; }
.discount-form input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-transform: uppercase;
  outline: 0;
}
.discount-form input::placeholder { text-transform: none; color: var(--muted); }
.discount-form input:focus { border-color: var(--orange); }
.discount-form .btn { border-radius: 16px; padding: 0 18px; }
.discount-applied {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 6px 6px 6px 14px;
  border-radius: 16px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--green) 50%, transparent);
  animation: rise 0.3s both;
}
.discount-applied span { flex: 1; color: var(--text); }
.discount-applied small { color: var(--muted); font-weight: 500; }
.discount-applied.unused { opacity: 0.75; }
.promo-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; vertical-align: 1px;
  font-family: var(--font-body); font-size: 11px; font-weight: 700; color: #fff; background: var(--green);
}
.methods { display: flex; flex-direction: column; gap: 10px; }
.method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.method:disabled { opacity: 0.5; cursor: default; }
.method.selected { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 7%, var(--surface)); }
.method-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
}
.method.selected .method-icon { color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); }
.method-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.method-text small { color: var(--muted); font-size: 13px; }
.radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  flex-shrink: 0;
  transition: 0.15s;
}
.method.selected .radio { border-color: var(--orange); background: var(--orange); box-shadow: inset 0 0 0 4px var(--surface); }
.info-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--orange) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--orange) 20%, transparent);
  font-size: 14px;
  line-height: 1.45;
}
.info-box .ico { color: var(--orange); margin-top: 1px; }
.info-box p { margin: 0; }
.checkout-bar {
  position: sticky;
  bottom: calc(var(--nav-h) + 10px + var(--app-bottom));
  z-index: 5;
  margin-top: 16px;
  padding: 14px 16px 16px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.summary-line.discount { color: var(--green); }
.summary-line.total { color: var(--text); font-size: 17px; font-weight: 700; margin: 2px 0 8px; }
.summary-line.total .mono { font-size: 19px; }

/* ---------- Commandes ---------- */
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; }
.order-head > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.order-head small { color: var(--muted); font-size: 13px; }
.status { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status.paid { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.status.refunded { color: var(--muted); background: var(--surface-2); }
.order-items { border-top: 1px solid var(--border); }
.order-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.order-item + .order-item { border-top: 1px solid var(--border); }
.order-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.order-item .info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.order-item .info small { color: var(--muted); }
.order-item .thumb-sm { width: 44px; height: 44px; border-radius: 12px; }
.order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: var(--surface-2);
  font-size: 14px;
  color: var(--muted);
}
.order-foot span { display: inline-flex; align-items: center; gap: 6px; }
.order-foot .ico { width: 15px; height: 15px; }
.order-foot b { color: var(--text); font-size: 15px; }

/* ---------- Wallet ---------- */
.wallet-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 22px;
  margin-bottom: 14px;
  border-radius: 24px;
  color: #f4fbf6;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    var(--gradient);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  animation: rise 0.4s both;
}
.wc-head { display: flex; align-items: center; gap: 12px; }
.wc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wc-title strong {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wc-title span { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.wc-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gold);
}
.wc-icon .ico { width: 18px; height: 18px; }
.wc-label { display: block; margin-top: 24px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.wc-amount { display: block; margin-top: 4px; font-size: 38px; letter-spacing: -0.03em; }
.support-row { margin-top: 24px; }

/* ---------- Feuille du bas (recharge) ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 18px calc(20px + var(--app-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  transform: translateY(110%);
  transition: transform var(--dur-3) var(--ease-out);
}
.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--surface-2); margin: 0 auto 14px; }
.sheet h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.sheet form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.amounts { display: flex; gap: 8px; flex-wrap: wrap; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.field input {
  height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: 0;
}
label.field input:focus { border-color: var(--orange); }

/* ---------- Barre de navigation du bas ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 8px 8px calc(10px + var(--app-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.nav-item {
  flex: 1;
  min-width: 0;
  max-width: 120px;
  border: 0;
  background: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px 6px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.nav-item .ico { width: 23px; height: 23px; }
.nav-item.active {
  color: #f4fbf6;
  background: var(--gradient);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 6px 16px rgba(0, 0, 0, 0.25);
}
.nav-item.active .ico { animation: pop var(--dur-3) var(--ease-spring); }
.icon-wrap { position: relative; display: inline-flex; }
.count {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--bg);
  box-sizing: content-box;
}
.count.bump { animation: pop var(--dur-3) var(--ease-spring); }

/* ---------- Fiche article (plein écran) ---------- */
.detail {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  /* La barre d'achat est collée en bas mais reste dans le flux : la fin de la fiche n'est jamais cachée derrière,
     quelle que soit sa hauteur (quantité, deux boutons…). */
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
#detail-body { flex-shrink: 0; width: 100%; }
.detail.open { transform: none; }
.detail .thumb { aspect-ratio: 1; max-height: 62vh; max-width: 760px; margin: 0 auto; }
.detail .thumb .badge { top: 16px; left: 16px; font-size: 12px; }
.detail .content { max-width: 760px; margin: 0 auto; padding: 18px 16px; }
.detail .cat-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.detail h2 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.2; }
.detail .price b { font-size: 22px; }
.detail .price s { font-size: 16px; }
.detail .desc { white-space: pre-line; line-height: 1.55; opacity: 0.88; margin: 16px 0 0; }
.detail .perks {
  margin-top: 20px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
}
.detail .perks div { display: flex; gap: 10px; align-items: center; }
.detail .perks .ico { color: var(--orange); width: 18px; height: 18px; }
.detail .close {
  position: fixed;
  top: calc(14px + var(--app-top));
  right: calc(14px + var(--app-right));
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.detail .buy-bar {
  position: sticky;
  bottom: 0;
  z-index: 1;
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px 16px calc(12px + var(--app-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.detail .buy-bar .btn { max-width: 728px; margin: 0 auto; display: flex; }
/* Dans Telegram, on utilise les boutons natifs (MainButton / BackButton). */
.in-telegram .detail .close { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-h) + 24px + var(--app-bottom));
  margin: 0 auto;
  max-width: 420px;
  background: #0c1a13;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  text-align: center;
  font-weight: 500;
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  filter: blur(4px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring), filter var(--dur-2) var(--ease-out);
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.toast.show { opacity: 1; transform: none; filter: none; }

/* ---------- Administration ---------- */
.admin-body { padding-bottom: 24px; }
.admin-body main { padding: 16px; max-width: 760px; margin: 0 auto; }
.admin-header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    var(--gradient);
  border: var(--glow-border);
  color: #f4fbf6;
}
.admin-header .inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(20px + var(--app-top)) calc(16px + var(--app-right)) 18px calc(16px + var(--app-left));
  max-width: 760px;
  margin: 0 auto;
}
.admin-header h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.admin-header p { margin: 4px 0 0; font-size: 14px; opacity: 0.92; }

.tabs { display: flex; gap: 6px; padding: 12px 16px 0; max-width: 760px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tab {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { background: var(--green); border-color: var(--green); color: #fff; }
form.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
form.panel h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
form.panel label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
form.panel label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; font-weight: 500; }
form.panel input[type='text'], form.panel input[type='number'], form.panel textarea, form.panel select {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 12px;
  outline: 0;
  width: 100%;
}
form.panel input:focus, form.panel textarea:focus, form.panel select:focus { border-color: var(--orange); }
form.panel textarea { resize: vertical; min-height: 90px; }
form.panel input[type='file'] { color: var(--text); font-size: 13px; font-weight: 400; }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--green); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--orange); }
.stat span { color: var(--muted); font-size: 13px; }
.admin-body .row { gap: 8px; }
.list-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
#address-fields { display: flex; flex-direction: column; gap: 10px; }
#address-fields input { font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; }
.review-row .info strong { white-space: normal; }
.review-row .link { padding: 0; align-self: flex-start; text-decoration: none; margin: 2px 0 4px; }
.review-actions { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.review-actions input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
/* Paiements non attribués : choix du client à créditer */
.unmatched-row .info { width: 100%; }
.payer-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 4px; font-size: 12px; color: var(--muted); }
.chip-btn {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 100%;
  padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 700; text-align: left; cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.chip-btn small { font-weight: 500; font-size: 11px; color: var(--muted); white-space: normal; }
.chip-btn.active { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
.assign-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.assign-actions select {
  width: 100%; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit;
}
.assign-actions .review-actions { margin-top: 0; }
.unmatched-dismiss { align-self: flex-start; margin-top: 2px; }
.list-title-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.list-title-actions .hint { font-family: var(--font-body); font-weight: 500; font-size: 13px; }
.list-title-actions .btn { font-family: var(--font-body); }
#lines-input { font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; line-height: 1.5; white-space: pre; }
#lines-field { display: flex; flex-direction: column; gap: 6px; }
#lines-field .hint { margin: 0; }
.delivered { margin-top: 6px; }
.delivered summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--orange); }
.delivered-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.delivered-line:last-child { border-bottom: 0; }
.delivered-line code { font-size: 12px; word-break: break-all; white-space: pre-wrap; }
.admin-body .row .info strong { white-space: nowrap; }

/* ---------- Fiche article : infos et animation d'ouverture ---------- */
.detail { transition: transform var(--dur-3) var(--ease-out); }
.detail-hero { padding: 16px 16px 0; max-width: 760px; margin: 0 auto; }
.detail-hero .thumb {
  border-radius: 24px;
  border: 1px solid var(--border);
  max-height: 46vh;
  aspect-ratio: 16 / 11;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.detail-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 4px; }
.detail-head h2 { margin: 0; }
.detail-head .cat-pill { margin: 0; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.info-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.info-tile small, .desc-card small, .avail-card small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-tile strong { font-size: 15px; }
.tile-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 14%, transparent);
}
.tile-ico .ico { width: 17px; height: 17px; }
.desc-card, .avail-card {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.desc-card p { margin: 6px 0 0; white-space: pre-line; line-height: 1.55; font-size: 14px; }
.avail-card { display: flex; justify-content: space-between; align-items: flex-end; }
.avail-card > div { display: flex; flex-direction: column; gap: 4px; }
.avail-card .right { align-items: flex-end; }
.avail-card strong { font-size: 17px; }
.avail-card .ok { color: var(--green); }
.avail-card .ko { color: var(--red); }
.avail-card .mono { font-size: 22px; }
.detail .buy-bar { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.detail .buy-bar .btn { max-width: 728px; width: 100%; }
.btn.outline { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* Ouverture : l'image grossit doucement, puis les blocs apparaissent en cascade. */
@keyframes zoomIn { from { opacity: 0; transform: scale(0.92); filter: blur(8px); } }
.detail.open .detail-hero .thumb { animation: zoomIn var(--dur-4) 0.08s var(--ease-out) both; }
.detail.open .content > * { animation: rise var(--dur-4) var(--ease-out) both; }
.detail.open .content > :nth-child(2) { animation-delay: 0.12s; }
.detail.open .content > :nth-child(3) { animation-delay: 0.16s; }
.detail.open .content > :nth-child(4) { animation-delay: 0.2s; }
.detail.open .content > :nth-child(5) { animation-delay: 0.24s; }
.detail.open .content > :nth-child(6) { animation-delay: 0.28s; }
.detail.open .info-tile { animation: rise var(--dur-4) var(--ease-out) both; }
.detail.open .info-tile:nth-child(2) { animation-delay: 0.24s; }
.detail.open .info-tile:nth-child(3) { animation-delay: 0.28s; }
.detail.open .info-tile:nth-child(4) { animation-delay: 0.32s; }
.detail.open .buy-bar { animation: rise var(--dur-4) 0.3s var(--ease-out) both; }
/* Admin : groupe des infos de la fiche article. */
.info-fields { border: 1px dashed var(--border); border-radius: 14px; padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.info-fields legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.info-fields legend .hint { display: inline; font-weight: 500; margin: 0; }

/* ---------- Fiche article : galerie d'images ---------- */
.gallery-track {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; scroll-snap-stop: always; }
.gallery-dots {
  position: absolute;
  left: 14px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
}
.gallery-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}
.gallery-dots button.active { width: 18px; background: #fff; }

/* ---------- Fiche article : choix de la variante ---------- */
.detail.no-anim .detail-hero .thumb, .detail.no-anim .content > *, .detail.no-anim .info-tile, .detail.no-anim .buy-bar { animation: none; }
.price .from { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.variant-picker { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.variant-picker > small { color: var(--muted); font-weight: 600; }
.variant-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.variant-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.variant-opt:active { transform: scale(0.97); }
.variant-opt strong { font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.variant-opt .mono { font-size: 13px; color: var(--orange); font-weight: 700; }
.variant-opt .mono s { color: var(--muted); font-weight: 400; }
.variant-opt small { font-size: 11px; color: var(--muted); }
.variant-opt.active { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); }
.variant-opt.out strong, .variant-opt.out .mono { opacity: 0.5; }
.variant-opt.out small { color: var(--red); }
.variant-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--orange) 14%, transparent);
  color: var(--orange);
  font-weight: 700;
  font-size: 11px;
}

/* ---------- Admin : images, variantes, liste de fichiers ---------- */
.form-block { border: 1px dashed var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.block-head .hint { margin: 0; }
form.panel label.file-btn { flex-direction: row; align-self: flex-start; color: inherit; font-size: 13px; cursor: pointer; }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.image-list .hint { grid-column: 1 / -1; margin: 0; }
.image-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.image-item img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.image-main {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.image-tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
.image-tools button, .mini {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.image-tools button:disabled, .mini:disabled { opacity: 0.35; cursor: default; }
.mini { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.mini.danger, .image-tools button[data-img-remove] { color: var(--red); }
#units { display: flex; flex-direction: column; gap: 10px; }
.unit-card { display: flex; flex-direction: column; gap: 10px; }
.unit-card.variant { padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 55%, transparent); border: 1px solid var(--border); }
.unit-head { display: flex; align-items: center; gap: 8px; }
.unit-head strong { flex: 1; }
.unit-head small { color: var(--muted); }
.file-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.file-pick .file-name { min-width: 0; overflow-wrap: anywhere; }
.file-pick small { color: var(--muted); }
.warn { color: var(--red); font-size: 13px; }
.queue { display: flex; flex-direction: column; gap: 6px; }
.queue-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.queue-head small { color: var(--muted); font-weight: 500; }
.queue-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.queue-row.next { outline: 1.5px solid color-mix(in srgb, var(--green) 60%, transparent); }
.queue-n { width: 22px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--muted); flex-shrink: 0; }
.queue-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; overflow-wrap: anywhere; }
.queue-name small { color: var(--muted); font-size: 11px; }
.queue .hint { margin: 0; }
.variant-line { display: block; }

/* ---------- Survol : élévation + lumière (souris uniquement, pas sur mobile) ---------- */
@keyframes sheen { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(220%) skewX(-20deg); } }

.card, .btn, .tile, .chip, .method, .row.clickable, .info-tile, .nav-item, .search-pill, .balance-pill {
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-2), border-color var(--dur-2), filter var(--dur-2), background var(--dur-2), color var(--dur-2);
}
.card { isolation: isolate; }
.card .thumb img { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
/* Reflet lumineux qui traverse la carte / le bouton. */
.card::after, .btn.gradient::after, .btn:not(.ghost):not(.danger):not(.secondary):not(.outline)::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 45%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-120%) skewX(-20deg);
  z-index: 2;
}
/* Lumière qui tourne autour de chaque carte article (même effet que la carte best seller). */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--spin), transparent 0 55%, rgba(255, 255, 255, 0.55) 70%, #fff 80%, transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-spin 5s linear infinite;
  pointer-events: none;
}
.btn { position: relative; overflow: hidden; }

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--orange) 45%, transparent);
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.18),
      0 0 0 1px color-mix(in srgb, var(--orange) 25%, transparent),
      -10px -6px 28px color-mix(in srgb, var(--orange) 22%, transparent),
      10px 10px 28px color-mix(in srgb, var(--green) 20%, transparent);
  }
  .card:hover .thumb img { transform: scale(1.06); }
  .card:hover::after { animation: sheen 0.9s ease; }
  .card:hover .add { transform: scale(1.08); box-shadow: 0 0 18px color-mix(in srgb, var(--orange) 55%, transparent); }
  .spotlight:hover { box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3), 0 0 40px color-mix(in srgb, var(--orange) 18%, transparent); }
  .spotlight:hover::after { opacity: 1; }
  .spotlight:hover .add { transform: scale(1.08); box-shadow: 0 0 18px color-mix(in srgb, var(--orange) 55%, transparent); }

  .btn:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.08); }
  .btn:not(:disabled):hover::after { animation: sheen 0.8s ease; }
  .btn.gradient:not(:disabled):hover {
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.28),
      -8px -4px 24px color-mix(in srgb, var(--orange) 35%, transparent),
      8px 6px 24px color-mix(in srgb, var(--green) 30%, transparent);
  }
  .btn.outline:not(:disabled):hover, .btn.secondary:not(:disabled):hover {
    border-color: color-mix(in srgb, var(--orange) 50%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--orange) 20%, transparent);
  }
  .add:hover { transform: scale(1.12); box-shadow: 0 0 20px color-mix(in srgb, var(--orange) 60%, transparent); }

  .chip:hover:not(.active), .tile:hover, .method:not(:disabled):hover, .row.clickable:hover, .info-tile:hover,
  .search-pill:hover, .balance-pill:hover {
    border-color: color-mix(in srgb, var(--orange) 45%, transparent);
    box-shadow: 0 0 20px color-mix(in srgb, var(--orange) 16%, transparent);
  }
  .tile:hover, .info-tile:hover { transform: translateY(-3px); }
  .chip:hover { transform: translateY(-1px); }
  .nav-item:not(.active):hover { color: var(--text); background: color-mix(in srgb, var(--orange) 8%, transparent); }
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
  .icon-btn.danger:hover { color: var(--red); box-shadow: 0 0 14px color-mix(in srgb, var(--red) 25%, transparent); }
}

/* ==========================================================================
   Plein écran & responsive
   ========================================================================== */

/* Pages superposées (fiche article, recharge, succès) : elles démarrent sous l'encoche / les boutons Telegram. */
.detail { padding-top: var(--app-top); padding-left: var(--app-left); padding-right: var(--app-right); }
.success { padding-top: calc(24px + var(--app-top)); }
.page { padding-left: calc(16px + var(--app-left)); padding-right: calc(16px + var(--app-right)); }
.bottom-nav { padding-left: calc(8px + var(--app-left)); padding-right: calc(8px + var(--app-right)); }
.toast { bottom: calc(var(--nav-h) + 24px + var(--app-bottom)); }

/* Plein écran : Telegram dessine ses boutons (Fermer / Menu) par-dessus le haut de l'écran,
   la barre du haut prend donc une couleur pleine pour rester lisible sous eux. */
.is-fullscreen .appbar { background: var(--bg); }

/* Petits téléphones */
@media (max-width: 360px) {
  .page { padding-left: calc(12px + var(--app-left)); padding-right: calc(12px + var(--app-right)); }
  .grid { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card .body { padding: 8px 10px 10px; }
  .card h3 { font-size: 14px; }
  .nav-item { font-size: 11px; }
  .page-title { font-size: 23px; }
}

/* Téléphone à l'horizontale : barre de navigation plus basse pour garder de la place. */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --nav-h: 58px; }
  .nav-item { flex-direction: row; gap: 6px; padding: 8px 10px; }
  .detail-hero .thumb { max-height: 70vh; }
}

/* Tablette & ordinateur (Telegram Desktop, Telegram Web en grand) */
@media (min-width: 900px) {
  .appbar-inner { max-width: 1120px; padding-top: 12px; padding-bottom: 12px; }
  .page { max-width: 1120px; padding-top: 22px; }
  /* Pages de lecture : on garde une largeur confortable. */
  #cart .page, #orders .page, #wallet .page { max-width: 760px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .rail { margin: 0; padding: 2px 0 8px; }
  .rail .card { flex-basis: 200px; }
  .chips { margin: 18px 0 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .hero-card { padding: 28px 30px; }
  .hero-card h1 { font-size: 34px; }

  /* Navigation : pastille flottante centrée au lieu d'une barre pleine largeur. */
  .bottom-nav {
    left: 50%;
    right: auto;
    bottom: calc(16px + var(--app-bottom));
    transform: translateX(-50%);
    width: min(560px, calc(100% - 32px));
    padding: 6px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  }
  body { padding-bottom: calc(var(--nav-h) + 40px + var(--app-bottom)); }

  /* Fiche article : visuel à gauche, infos à droite. */
  #detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 8px 32px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 24px 0;
    align-items: start;
  }
  #detail-body .detail-hero { position: sticky; top: calc(24px + var(--app-top)); padding: 0; max-width: none; margin: 0; width: 100%; }
  #detail-body .detail-hero .thumb { aspect-ratio: 1; max-height: calc(100vh - 220px); }
  #detail-body .content { padding: 4px 0 0; max-width: none; margin: 0; width: 100%; }
  #detail-body { padding-bottom: 24px; }
  .detail .buy-bar { flex-direction: row; justify-content: center; }
  .detail .buy-bar .btn { max-width: 340px; margin: 0; }

  /* Page de recharge, écran de succès, feuille du bas : colonne centrée. */
  #deposit-body { max-width: 620px; margin: 0 auto; }
  .sheet { border-radius: 26px; bottom: calc(16px + var(--app-bottom)); max-width: 520px; }

  /* Administration */
  .admin-body main, .tabs, .admin-header .inner { max-width: 960px; }
}

@media (min-width: 1400px) {
  .appbar-inner, .page, #detail-body { max-width: 1280px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (min-width: 900px) {
  /* La navigation flotte 16 px plus haut : le récapitulatif du panier et les messages suivent. */
  .checkout-bar { bottom: calc(var(--nav-h) + 30px + var(--app-bottom)); }
  .toast { bottom: calc(var(--nav-h) + 40px + var(--app-bottom)); }
}
/* ---------- Quantités (articles livrés par liste) ---------- */
.add { position: relative; }
.qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  border: 2px solid var(--surface);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.qty-stepper {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.qty-stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.qty-stepper button:active:not(:disabled) { transform: scale(0.9); }
.qty-stepper button:disabled { opacity: 0.35; cursor: default; }
.qty-stepper span { min-width: 30px; text-align: center; font-size: 15px; }
.cart-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
}
.cart-row .info { grid-column: 2; }
.cart-row .icon-btn { grid-column: 3; grid-row: 1; }
.cart-row:has(.qty-stepper) .thumb-sm { grid-row: 1 / span 2; align-self: start; }
.cart-row .qty-stepper { grid-column: 2 / 4; grid-row: 2; justify-self: end; }
.unit-price { display: block; font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--muted); }
.qty-row {
  width: 100%;
  max-width: 728px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-weight: 700;
}
.qty-row small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }

@media (min-width: 900px) {
  .detail .buy-bar { flex-wrap: wrap; }
  .detail .buy-bar .qty-row { max-width: 688px; }
}
/* ---------- Bouton musique (barre du haut) ---------- */
.music-toggle {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--green);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s, color 0.2s, background 0.2s;
}
.music-toggle .ico { width: 20px; height: 20px; }
.music-toggle:active { transform: scale(0.9); }
.music-toggle.off { color: var(--muted); }
/* Petite animation des ondes quand la musique joue. */
.music-toggle:not(.off) .ico path:nth-child(2) { animation: sound-wave 1.6s ease-in-out infinite; transform-origin: 12px 12px; }
@keyframes sound-wave { 50% { opacity: 0.45; } }
/* ---------- Recharge PayPal.me : référence à mettre en note ---------- */
.ref-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px dashed color-mix(in srgb, var(--orange) 55%, transparent);
  text-align: center;
}
.ref-card small { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ref-card code { font-size: 28px; letter-spacing: 0.06em; color: var(--orange); user-select: all; -webkit-user-select: all; }
.info-box.alert {
  background: color-mix(in srgb, var(--orange) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--orange) 45%, transparent);
}
.info-box.alert .ico { color: var(--orange); }
.pay-steps { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.4; }
.pay-steps li::marker { color: var(--orange); font-weight: 700; }
/* ---------- Liquid glass : lignes du panier et récapitulatif du total ---------- */
:root {
  --glass-tint: rgba(255, 255, 255, 0.42);
  --glass-tint-2: rgba(255, 255, 255, 0.16);
  --glass-edge: rgba(255, 255, 255, 0.65);
  --glass-shine: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 10px 30px rgba(20, 60, 40, 0.14);
}
:root[data-theme='dark'] {
  --glass-tint: rgba(60, 44, 32, 0.38);
  --glass-tint-2: rgba(30, 22, 16, 0.22);
  --glass-edge: rgba(255, 236, 214, 0.16);
  --glass-shine: rgba(255, 236, 214, 0.14);
  --glass-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}
.cart-row,
.checkout-bar {
  position: relative;
  isolation: isolate; /* le reflet (::before) passe sous le contenu */
  overflow: hidden;
  background: linear-gradient(135deg, var(--glass-tint), var(--glass-tint-2));
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    var(--glass-shadow);
}
/* Reflet de lumière en haut à gauche, comme sur une plaque de verre bombée. */
.cart-row::before,
.checkout-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(120% 80% at 0% 0%, var(--glass-shine), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%);
  opacity: 0.6;
}
/* Le récapitulatif reste lisible même s'il flotte au-dessus des articles. */
.checkout-bar { -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%); }
/* Boutons − / + et corbeille légèrement vitrés eux aussi. */
.cart-row .qty-stepper { background: rgba(255, 255, 255, 0.08); border-color: var(--glass-edge); }
/* Sans backdrop-filter (vieux navigateurs) : fond plein pour garder un bon contraste. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cart-row, .checkout-bar { background: var(--surface); }
}
/* ---------- Panier : blocs empilés avec un espacement régulier, sans chevauchement ---------- */
/* Le récapitulatif n'est plus « collant » : en restant accroché en bas de l'écran, il passait par-dessus
   le moyen de paiement et le message d'information. Il suit maintenant le contenu, après tous les blocs. */
#cart-body { display: flex; flex-direction: column; gap: 14px; }
#cart-body > * { margin-top: 0; margin-bottom: 0; }
#cart-body > .list { display: flex; flex-direction: column; gap: 10px; }
#cart-body > .section-label { margin: 6px 0 -6px; }
#cart-body .checkout-bar { position: relative; bottom: auto; margin-top: 4px; }
/* ==========================================================================
   Admin : gestion (tableau de bord, clients, messages, alertes de stock)
   ========================================================================== */
:root { --chart-bar: #007a4a; } /* contraste et lisibilité validés sur fond clair */
:root[data-theme='dark'] { --chart-bar: #14a06a; } /* idem sur fond sombre */

.tabs .tab { flex: 0 0 auto; position: relative; }
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: 1px;
}
.admin-body main > section { display: flex; flex-direction: column; gap: 14px; }
.admin-body main > section.hidden { display: none; }
div.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
div.panel h3, div.panel h4 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 600; }
div.panel h3 { font-size: 17px; }
div.panel h4 { font-size: 14px; }

/* En-tête + choix de la période */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dash-head h3 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button {
  border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

/* Codes promo : choix des articles concernés */
.discount-scope { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.discount-scope .scope-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.product-picker { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.picker-head { display: flex; align-items: center; gap: 10px; }
.picker-head input { flex: 1; min-width: 0; }
.picker-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.edit-note { margin: -4px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.picker-count { font-size: 12px; font-weight: 700; color: var(--orange-deep); white-space: nowrap; }
.picker-list {
  max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  padding: 4px; border-radius: 12px; background: var(--surface-2); overscroll-behavior: contain;
}
form.panel label.picker-item {
  flex-direction: row; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px;
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent;
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
form.panel label.picker-item:hover { background: var(--surface); }
form.panel label.picker-item.checked { background: var(--surface); border-color: var(--orange); }
.picker-item input { flex: none; }
.picker-item img, .picker-item .emoji { width: 34px; height: 34px; flex: none; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--surface); font-size: 18px; }
.picker-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-list .empty { padding: 14px; }
form.panel input:disabled { opacity: 0.6; }
@media (max-width: 520px) {
  .discount-row { flex-wrap: wrap; }
  .discount-row .info { flex: 1 1 calc(100% - 60px); }
  .discount-row .btn.small { margin-left: auto; }
  .discount-row .btn.small ~ .btn.small { margin-left: 0; }
}

/* Indicateurs clés */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.kpi span { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi b { font-size: 20px; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-sub.up { color: var(--green); }
.kpi-sub.down { color: var(--red); }
.kpis.small { margin-top: 4px; }
.kpis.small .kpi { background: var(--surface-2); padding: 10px 12px; }
.kpis.small .kpi b { font-size: 16px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis.small { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Graphique : chiffre d'affaires par jour (une série, barres fines, grille discrète) */
.bar-chart { display: flex; gap: 8px; height: 200px; }
.chart-empty { margin: auto; text-align: center; max-width: 280px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 20px; text-align: right; }
.chart-y span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.chart-plot { position: relative; flex: 1; min-width: 0; }
.chart-grid { position: absolute; inset: 0 0 20px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { display: block; border-top: 1px dashed var(--border); }
.chart-grid i:last-child { border-top-style: solid; border-color: color-mix(in srgb, var(--muted) 40%, transparent); }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.bar-hit {
  position: relative; flex: 1; min-width: 0; border: 0; padding: 0 0 20px; background: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.bar { display: block; width: 100%; max-width: 22px; background: var(--chart-bar); border-radius: 4px 4px 0 0; transition: filter 0.15s; }
.bar-hit:hover .bar, .bar-hit:focus-visible .bar { filter: brightness(1.2); }
.bar-label {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--muted); white-space: nowrap;
}
.chart-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); z-index: 2;
  padding: 6px 10px; border-radius: 10px; white-space: nowrap; pointer-events: none;
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600;
}
.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.data-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 6px 4px; border-bottom: 1px dashed var(--border); }
.data-table td:last-child, .data-table th:last-child { text-align: right; }

/* Classements (articles les plus vendus, recharges, historique client) */
.dash-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.rank-row:last-child { border-bottom: 0; }
.rank-n {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-size: 12px; font-weight: 800;
}
.rank-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row small { color: var(--muted); white-space: nowrap; }
.rank-row b.neg, b.neg { color: var(--red); }

/* Alertes de stock */
.alert-panel {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--orange) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--orange) 45%, transparent);
}
.alert-panel.hidden { display: none; }
.stock-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.stock-line .low { color: var(--orange); }
.stock-line .ko { color: var(--red); }

/* Exports */
.export-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Clients */
.field-search input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
}
#customer-detail { display: flex; flex-direction: column; gap: 14px; }
#customer-detail.hidden { display: none; }
#customer-detail > .btn.ghost { align-self: flex-start; }
.btn.danger-fill { background: var(--red); color: #fff; }
.ban-panel { border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }
.ban-panel.is-banned { background: color-mix(in srgb, var(--red) 8%, var(--surface)); }
.ban-panel label { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* Écran affiché à un client bloqué par un admin. */
.banned-screen {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  padding: calc(24px + var(--app-top)) 24px calc(24px + var(--app-bottom));
  background: var(--bg); color: var(--text); text-align: center;
}
.banned-screen .card-ban { max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.banned-screen .ban-icon { font-size: 56px; line-height: 1; }
.banned-screen h1 { font-family: var(--font-display); font-size: 20px; margin: 0; }
.banned-screen p { color: var(--muted); line-height: 1.5; margin: 0; }
.admin-body .row b.mono { white-space: nowrap; }

/* Aperçu d'un message groupé, façon bulle Telegram */
.bubble-preview { display: flex; flex-direction: column; gap: 6px; }
.bubble-preview small { color: var(--muted); font-size: 12px; font-weight: 700; }
.bubble {
  align-self: flex-start; max-width: 90%; padding: 10px 12px; border-radius: 16px 16px 16px 4px;
  background: var(--surface-2); white-space: pre-wrap; line-height: 1.45; font-size: 14px;
}
.bubble-button {
  align-self: flex-start; max-width: 90%; padding: 8px 14px; border-radius: 10px; text-align: center;
  background: color-mix(in srgb, var(--green) 18%, var(--surface)); color: var(--text); font-weight: 600; font-size: 13px;
}
#broadcast-form textarea { resize: vertical; }
/* Les panneaux du tableau de bord ne débordent jamais : les noms longs sont tronqués, les montants restent visibles. */
.dash-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-grid > .panel, .kpis > .kpi { min-width: 0; }
.rank-row b { flex-shrink: 0; }
.rank-row small { flex-shrink: 0; }
@media (max-width: 420px) {
  /* Sur téléphone, le détail (« 41 vendu(s) ») passe sous le nom. */
  .rank-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'n name amount' 'n sub amount'; column-gap: 10px; row-gap: 1px; }
  .rank-row .rank-n { grid-area: n; }
  .rank-row .rank-name { grid-area: name; }
  .rank-row small { grid-area: sub; }
  .rank-row b { grid-area: amount; }
  .rank-row:not(:has(.rank-n)) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name amount' 'sub amount'; }
}
/* ---------- Admin : réglages (interrupteur) ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.setting-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-text strong { font-size: 15px; }
.setting-text small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.switch { position: relative; flex-shrink: 0; width: 52px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track {
  position: absolute; inset: 0; border-radius: 15px; background: var(--surface-2);
  border: 1px solid var(--border); transition: background 0.2s;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: var(--green); border-color: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--orange); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: 0.6; }
/* ---------- Admin : changer la musique ---------- */
#music-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
#music-form .hint { margin: 0; }
#music-form label:not(.dropzone) { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
#music-form input[type='text'] {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface-2);
  border: 1px solid transparent; border-radius: 12px; padding: 11px 12px; outline: 0; width: 100%;
}
#music-form input[type='text']:focus { border-color: var(--orange); }
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 16px; border-radius: 16px; text-align: center; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-icon { font-size: 28px; }
.dropzone strong { font-size: 15px; word-break: break-all; }
.dropzone small { color: var(--muted); font-size: 12px; }
.dropzone.dragging, .dropzone:hover { border-color: var(--orange); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
.music-current { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.music-line { display: flex; gap: 10px; align-items: center; }
.music-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); font-size: 20px;
}
.music-line div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.music-line small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.music-current audio { width: 100%; height: 40px; }
/* ---------- Admin : message de bienvenue ---------- */
form.panel h3 .hint { font-family: var(--font-body); font-weight: 500; font-size: 13px; }
form.panel h4.sub-title { margin: 6px 0 -4px; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
:is(#welcome-form, #announce-form, #restock-form) p.hint { margin: -4px 0 0; line-height: 1.5; }
:is(#welcome-form, #announce-form, #restock-form) p.hint .link { padding: 0; margin-left: 4px; }
:is(#welcome-form, #announce-form, #restock-form) code { font-size: 12px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); }
:is(#welcome-form, #announce-form, #restock-form) :is(.tip, .format-note) { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
:is(#welcome-form, #announce-form, #restock-form) .tip { background: var(--surface-2); }
:is(#welcome-form, #announce-form, #restock-form) .format-note { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
:is(#welcome-form, #announce-form, #restock-form) .format-note.hidden { display: none; }

/* ---------- Admin : fenêtre d'annonce d'un article ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: calc(16px + var(--app-top)) 16px calc(16px + var(--app-bottom));
  background: rgba(10, 16, 12, 0.55); overflow-y: auto; overscroll-behavior: contain;
}
.modal.hidden { display: none; }
body.modal-open { overflow: hidden; }
form.panel.modal-card { width: 100%; max-width: 560px; margin: auto 0; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
.audience-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
form.panel label.radio-card {
  flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); color: var(--text); font-weight: 500;
}
form.panel label.radio-card:has(input:checked) { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 8%, var(--surface)); }
.radio-card input { margin-top: 3px; flex: none; }
.radio-card span, .pick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.radio-card small, .pick-text small { color: var(--muted); font-size: 12px; font-weight: 400; }
.announce-picker { display: flex; flex-direction: column; gap: 8px; }
.announce-picker.hidden { display: none; }
.picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.picker-tools input[type='search'] {
  flex: 1 1 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid transparent;
  border-radius: 12px; padding: 10px 12px; outline: 0;
}
.picker-tools input[type='search']:focus { border-color: var(--orange); }
.picker-tools .link { padding: 0; font-size: 13px; }
#announce-form .actions { flex-wrap: wrap; }
@media (max-width: 560px) {
  .audience-choice { grid-template-columns: 1fr; }
}

/* ---------- Admin : guide d'utilisation d'un article ---------- */
#product-form .guide-hint { margin: -6px 0 0; line-height: 1.5; }
#product-form .guide-hint code { font-size: 12px; padding: 1px 5px; border-radius: 6px; background: var(--surface-2); }

/* ---------- Admin : annonce automatique de restock ---------- */
.restock-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#restock-status { margin: -6px 0 0; font-weight: 600; }
#restock-status.on { color: var(--green); }
#restock-form select { cursor: pointer; }
.welcome-preview { display: block; max-width: 100%; max-height: 260px; border-radius: 14px; background: var(--surface-2); }
.welcome-buttons { display: flex; flex-direction: column; gap: 10px; }
.welcome-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.welcome-btn input[type='text'] { grid-column: 1 / -1; }
.welcome-btn input[type='text']:disabled { opacity: 0.5; }
.music-current .link { padding: 0; }