/* ============================================================================
   SNOWFALL SHOP — feuille de style

   PALETTE : monochrome. Noir, gris, blanc, point final. La couleur n'existe
   qu'a deux endroits, parce qu'elle y porte une information : les gemmes de
   palier, et les pastilles de statut (volontairement desaturees).

   VERRE : un fond de degrades gris tres diffus, et par-dessus des surfaces
   translucides avec une bordure fine et un liseré lumineux sur l'arete haute.
   Le reflet suit le pointeur — voir le bloc "reflet" plus bas.

   PERF : le flou (backdrop-filter) est reserve aux surfaces flottantes. Les
   cartes de la grille se contentent d'un fond translucide : sur un fond deja
   lisse le rendu est identique, et on evite de flouter 20 elements au scroll.
   ========================================================================== */

:root {
  color-scheme: dark;

  --base: #0B0B0C;
  --bg-blur: 5px;       /* flou applique a la photo de fond — monte-le pour l'adoucir */
  --bg-bright: 0.8;
  /* voile pose sur la photo : c'est lui qui garantit la lisibilite du texte */
  --scrim: linear-gradient(rgba(9, 9, 11, 0.74), rgba(9, 9, 11, 0.84));

  --mesh:
    radial-gradient(72% 52% at 14% -12%, rgba(255, 255, 255, 0.05), transparent 62%),
    radial-gradient(58% 44% at 92% 4%, rgba(255, 255, 255, 0.03), transparent 64%),
    radial-gradient(80% 56% at 48% 112%, rgba(255, 255, 255, 0.025), transparent 66%);

  /* Remplissages quasi nuls : la photo de fond doit se voir a travers.
     C'est la bordure qui dessine la forme, pas un aplat blanchatre. */
  --glass: rgba(255, 255, 255, 0.02);
  --glass-2: rgba(255, 255, 255, 0.045);
  --glass-brd: rgba(255, 255, 255, 0.15);
  --glass-brd-2: rgba(255, 255, 255, 0.34);
  --hi: rgba(255, 255, 255, 0.07);
  --sunk: rgba(0, 0, 0, 0.18);

  /* le fond est deja flou : les surfaces n'ont plus besoin de flouter beaucoup */
  --blur: 3px;    /* boutons, puces, cadres */
  --blur-l: 10px; /* barres et feuilles, qui passent devant du contenu qui defile */

  --text: #F2F2F3;
  --dim: rgba(242, 242, 243, 0.56);
  --faint: rgba(242, 242, 243, 0.32);

  /* bouton principal : inversion pure, aucun aplat de couleur */
  --solid: #F2F2F3;
  --ink: #0B0B0C;

  --danger: #DE6D63;
  --st-wait: #C4A96E;
  --st-live: #8FA8C6;
  --st-done: #83AE8D;

  --spec: rgba(255, 255, 255, 0.13);   /* reflet interieur */
  --spec-edge: rgba(255, 255, 255, 0.95); /* reflet sur l'arete */

  --shadow: 0 12px 36px rgba(0, 0, 0, 0.44);
  --shadow-s: 0 3px 12px rgba(0, 0, 0, 0.28);

  --r-s: 11px;
  --r: 16px;
  --r-l: 22px;
  --shine-r: 170px;

  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --tab-h: 60px;
  --max: 620px;
  --pad: max(15px, calc((100vw - var(--max)) / 2));
}

:root[data-theme="light"] {
  color-scheme: light;

  --base: #EDEEF1;
  --bg-bright: 1.35;
  --scrim: linear-gradient(rgba(239, 240, 244, 0.84), rgba(239, 240, 244, 0.92));

  --mesh:
    radial-gradient(72% 52% at 14% -12%, rgba(255, 255, 255, 0.5), transparent 62%),
    radial-gradient(80% 56% at 48% 112%, rgba(190, 192, 200, 0.22), transparent 66%);

  --glass: rgba(255, 255, 255, 0.3);
  --glass-2: rgba(255, 255, 255, 0.48);
  --glass-brd: rgba(12, 12, 18, 0.14);
  --glass-brd-2: rgba(12, 12, 18, 0.36);
  --hi: rgba(255, 255, 255, 0.7);
  --sunk: rgba(255, 255, 255, 0.26);

  --text: #131318;
  --dim: rgba(19, 19, 24, 0.6);
  --faint: rgba(19, 19, 24, 0.38);

  --solid: #17171B;
  --ink: #FAFAFB;

  --danger: #C0392C;
  --st-wait: #8A7233;
  --st-live: #4A6484;
  --st-done: #3E7A4E;

  /* en clair, "s'allumer" veut dire s'assombrir : une lumiere blanche sur du
     blanc ne se voit pas */
  --spec: rgba(18, 18, 26, 0.07);
  --spec-edge: rgba(18, 18, 26, 0.72);

  --shadow: 0 12px 32px rgba(20, 20, 40, 0.11);
  --shadow-s: 0 2px 10px rgba(20, 20, 40, 0.07);
}

/* mode livreur : meme monochrome, juste un poil plus froid et plus contraste */
body.admin { --scrim: linear-gradient(rgba(7, 8, 10, 0.84), rgba(7, 8, 10, 0.9)); --bg-bright: 0.6; }
[data-theme="light"] body.admin { --scrim: linear-gradient(rgba(233, 235, 239, 0.9), rgba(233, 235, 239, 0.95)); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; min-width: 0; }
html, body { overscroll-behavior-y: none; }
/* couleur de secours : visible si l'image de fond est absente ou pas encore chargee */
html { background: var(--base); transition: background 0.45s var(--ease); }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color 0.35s var(--ease);
}

/* La photo. Le noir et blanc et le flou sont faits ici : le fichier d'origine
   n'a pas besoin d'etre retouche. L'element deborde de 6% de chaque cote,
   sinon le flou laisse apparaitre des bords delaves. */
.glow {
  position: fixed;
  inset: -6%;
  z-index: -2;
  background-image: var(--bgimg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(1) contrast(1.1) brightness(var(--bg-bright)) blur(var(--bg-blur));
  transition: filter 0.45s var(--ease);
  will-change: filter, transform;
}

/* Le voile, puis le mesh par-dessus. Sans ce voile, le texte devient illisible
   des que la photo comporte une zone claire. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--scrim), var(--mesh);
  transition: background 0.45s var(--ease);
}

button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
input, textarea, select { font: inherit; }

/* ============================================================================
   LE REFLET
   Deux couches posees sur les elements interactifs :
     ::before -> une tache de lumiere diffuse, a l'interieur
     ::after  -> la meme tache, mais dessinee UNIQUEMENT sur la bordure
   Les deux se placent aux coordonnees --mx / --my, mises a jour par app.js au
   pointermove et au pointerdown. Le pointeur "allume" la surface (.lit), et un
   appui declenche un eclat qui se propage depuis le point touche (.tap).
   ========================================================================== */

.card, .hot, .cta, .chip, .vpick, .pay, .tier-card, .icon-btn, .tier-chip,
.stat, .mrow, .seg, .add, .order, .info-card, .line, .trow {
  position: relative;
}

/* --glow : 0 quand le pointeur est loin, 1 quand il touche l'element.
   Declare avec @property pour qu'il soit interpolable — sinon l'extinction
   serait brutale quand la souris quitte la zone. */
/* Deux intensites distinctes, sinon un bouton voisin s'allume autant que celui
   qu'on survole :
     --glow -> la tache interieure, reservee a l'element reellement survole
     --edge -> le liseré, qui lui reagit a l'approche, meme de l'exterieur
   inherits DOIT etre true : la valeur est posee sur l'element mais lue par ses
   pseudo-elements, et un ::before herite de son element d'origine. */
@property --glow {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
@property --edge {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

.card::before, .hot::before, .cta::before, .chip::before, .vpick::before,
.pay::before, .tier-card::before, .icon-btn::before, .tier-chip::before,
.stat::before, .mrow::before, .seg::before, .add::before, .order::before,
.info-card::before, .line::before, .trow::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(var(--shine-r) circle at var(--mx, 50%) var(--my, -20%), var(--spec), transparent 62%);
  opacity: var(--glow, 0);
  transition: opacity 0.3s var(--ease);
}

/* l'eclat au toucher, qui part du point touche */
.tap::before {
  transform-origin: var(--mx, 50%) var(--my, 50%);
  animation: flash 0.6s var(--ease);
}
@keyframes flash {
  from { opacity: 1; transform: scale(0.25); }
  to   { opacity: 0; transform: scale(1.9); }
}

/* le liseré qui s'allume sur l'arete — c'est lui qui fait "vitre" */
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .card::after, .hot::after, .cta::after, .chip::after, .vpick::after,
  .pay::after, .tier-card::after, .icon-btn::after, .tier-chip::after,
  .stat::after, .mrow::after, .seg::after, .add::after, .order::after,
  .info-card::after, .line::after, .trow::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    background: radial-gradient(calc(var(--shine-r) * 0.85) circle at var(--mx, 50%) var(--my, -20%), var(--spec-edge), transparent 58%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: var(--edge, 0);
    transition: opacity 0.3s var(--ease);
  }
}

/* petits elements : une tache plus serree, sinon tout blanchit d'un coup */
.add, .icon-btn, .seg, .chip { --shine-r: 70px; }
.stat, .mrow { --shine-r: 120px; }

/* Filet de securite : meme si @property ou les masques ne sont pas supportes,
   le survol reste perceptible. */
@media (hover: hover) and (pointer: fine) {
  .card:hover, .hot:hover, .cta:hover, .chip:hover, .vpick:hover, .pay:hover,
  .tier-card:hover, .icon-btn:hover, .tier-chip:hover, .stat:hover, .mrow:hover,
  .seg:hover, .add:hover, .order:hover, .info-card:hover, .line:hover, .trow:hover {
    border-color: var(--glass-brd-2);
  }
}

/* ------------------------------------------------------------- primitives -- */

/* les barres et la feuille passent devant du contenu qui defile : elles ont
   besoin d'un flou franc pour rester lisibles */
.topbar, .tabbar, .sheet, .toast {
  backdrop-filter: blur(var(--blur-l)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-l)) saturate(140%);
}

/* les controles, eux, restent presque nets : c'est ce qui donne l'effet vitre
   plutot que l'effet calque depoli */
.chip, .cta, .tier-chip, .icon-btn, .pill, .flame, .tag, .segments, .qty, .add {
  backdrop-filter: blur(var(--blur)) saturate(130%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(130%);
}

.card, .hot, .line, .totals, .tier-card, .stat, .order, .info-card,
.trow, .vpick, .mrow, .v-row, .pay, .wallet, .courier, .admin-banner, .mediaprev {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-s);
}

/* ---------------------------------------------------------------- topbar -- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(11px + env(safe-area-inset-top)) var(--pad) 11px;
  /* un peu plus dense que le reste : du contenu defile dessous */
  background: var(--glass-2);
  border-bottom: 1px solid var(--glass-brd);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }

.brand-mark {
  width: 6px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--text), var(--dim));
  flex-shrink: 0;
  transition: opacity 0.4s;
}
body.admin .brand-mark { opacity: 0.5; }

.brand-txt { min-width: 0; }

.brand-name {
  display: block;
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 800;
  letter-spacing: 0.17em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: inset 0 1px 0 var(--hi);
  color: var(--dim);
  transition: transform 0.2s var(--ease), color 0.22s;
}
.icon-btn:active { transform: scale(0.88); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.icon-btn .i-sun { display: none; }
[data-theme="light"] .icon-btn .i-sun { display: block; }
[data-theme="light"] .icon-btn .i-moon { display: none; }

.tier-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  max-width: 42%;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: inset 0 1px 0 var(--hi);
  transition: transform 0.2s var(--ease);
}
.tier-chip:active { transform: scale(0.95); }
.tier-chip .label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* les gemmes gardent leur couleur : c'est la seule hierarchie visuelle du
   systeme de paliers */
.gem {
  width: 19px;
  height: 21px;
  flex-shrink: 0;
  clip-path: polygon(50% 0%, 100% 26%, 100% 74%, 50% 100%, 0% 74%, 0% 26%);
  background: linear-gradient(160deg, var(--c2, #888), var(--c1, #444));
  position: relative;
}
.gem::after {
  content: '';
  position: absolute;
  inset: 2px;
  clip-path: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.42), transparent 55%);
}
.gem.lg { width: 44px; height: 49px; }

/* ------------------------------------------------------------------ vues -- */

main { position: relative; padding-bottom: calc(var(--tab-h) + 30px + env(safe-area-inset-bottom)); }

.view { display: none; padding: 18px var(--pad) 0; }
.view.active { display: block; animation: viewIn 0.32s var(--ease) both; }

/* --dir vaut +1 ou -1 selon le sens de navigation dans la barre d'onglets :
   la page entre du cote d'ou l'on vient, comme sur une appli native. */
@keyframes viewIn {
  from { opacity: 0; transform: translate3d(calc(var(--dir, 0) * 20px), 6px, 0); }
  to   { opacity: 1; transform: none; }
}

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 2px 12px; }
.sec-title { font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.sec-count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
button.sec-count { cursor: pointer; color: var(--dim); font-weight: 700; transition: color 0.2s, transform 0.14s var(--ease); }
button.sec-count:active { color: var(--text); transform: scale(0.94); }

.page-title { font-size: clamp(23px, 6.8vw, 29px); font-weight: 800; letter-spacing: -0.035em; margin: 2px 0 5px; }
.page-sub { color: var(--dim); font-size: 13.5px; margin: 0 0 20px; }

/* ------------------------------------------------------------- categories -- */

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px var(--pad) 16px; margin: 0 calc(-1 * var(--pad)); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  box-shadow: inset 0 1px 0 var(--hi);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
  transition: color 0.22s, background 0.22s, border-color 0.22s, transform 0.14s var(--ease);
}
.chip:active { transform: scale(0.94); }
.chip.on { color: var(--text); background: var(--glass-2); border-color: var(--glass-brd-2); }

/* ------------------------------------------------------- grilles & cartes -- */

.rail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; padding-bottom: 8px; }

.card, .hot {
  border-radius: var(--r-l);
  overflow: hidden;
  animation: rise 0.44s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms);
  transition: transform 0.22s var(--ease), box-shadow 0.25s;
}
.card:active, .hot:active { transform: scale(0.975); }
.card.out { opacity: 0.42; }

/* les tendances se distinguent par une bordure plus franche, pas par une couleur */
.hot { border-color: var(--glass-brd-2); }

@keyframes rise { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  font-size: clamp(30px, 9vw, 42px);
  overflow: hidden;
  /* degrade neutre : plus de teinte par categorie */
  background: linear-gradient(155deg, var(--glass-2), transparent 62%);
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .emo { filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4)); transition: transform 0.4s var(--ease); line-height: 1; }
.card:active .thumb .emo, .hot:active .thumb .emo { transform: scale(1.1); }

.flame, .tag {
  position: absolute;
  z-index: 3;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  background: rgba(14, 14, 16, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #F2F2F3;
}
.flame { top: 9px; left: 9px; border-radius: 999px; }
.tag { top: 9px; right: 9px; }

.body { padding: 11px 12px 13px; position: relative; z-index: 1; }

.name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.018em; margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.desc { font-size: 11px; color: var(--faint); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; min-height: 16px; }

.price-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.price { display: flex; flex-direction: column; line-height: 1.14; font-variant-numeric: tabular-nums; min-width: 0; }
.price .from { font-size: 8.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.price .now { font-size: clamp(13.5px, 4vw, 15.5px); font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
/* regle globale : le prix barre doit l'etre partout ou il apparait, pas
   seulement dans les cartes du catalogue */
.was { font-size: 10.5px; color: var(--faint); text-decoration: line-through; white-space: nowrap; }

.add {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--glass-2);
  border: 1px solid var(--glass-brd-2);
  box-shadow: inset 0 1px 0 var(--hi);
  transition: transform 0.16s var(--ease), opacity 0.22s;
}
.add svg { width: 15px; height: 15px; stroke: var(--text); }
.add:active { transform: scale(0.84); }
.add:disabled { background: var(--glass); border-color: var(--glass-brd); opacity: 0.5; }
.add:disabled svg { stroke: var(--faint); }

.sold { font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; color: var(--faint); text-transform: uppercase; white-space: nowrap; }

/* ------------------------------------------------------------------ panier -- */

.line { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: var(--r); margin-bottom: 9px; animation: rise 0.34s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.line .mini { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; overflow: hidden; background: linear-gradient(155deg, var(--glass-2), transparent 62%); }
.line .mini img, .line .mini video { width: 100%; height: 100%; object-fit: cover; }
.line .info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.line .info .n { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line .info .p { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }

.vtag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: var(--glass-2); border: 1px solid var(--glass-brd); font-size: 10px; font-weight: 700; color: var(--dim); vertical-align: 1px; }

.qty { display: flex; align-items: center; gap: 1px; flex-shrink: 0; background: var(--sunk); border: 1px solid var(--glass-brd); border-radius: 12px; padding: 3px; position: relative; z-index: 6; }
.qty button { width: 25px; height: 25px; border-radius: 9px; display: grid; place-items: center; color: var(--dim); font-size: 15px; font-weight: 700; transition: background 0.16s, color 0.16s, transform 0.13s var(--ease); }
.qty button:active { transform: scale(0.85); background: var(--glass-2); color: var(--text); }
.qty .v { min-width: 20px; text-align: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

.totals { margin-top: 16px; padding: 15px 16px; border-radius: var(--r); }
.tline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; font-size: 13.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.tline span:last-child { white-space: nowrap; }
.tline.save { color: var(--text); }
.tline.grand { margin-top: 8px; padding-top: 13px; border-top: 1px solid var(--glass-brd); color: var(--text); font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }

/* ------------------------------------------------------------------ boutons -- */

/* Aucun bouton n'est rempli. Le principal se distingue par une bordure plus
   franche et un texte pleine intensite ; le reste s'efface. */
.cta {
  display: block;
  width: 100%;
  margin-top: 11px;
  padding: 15px;
  border-radius: var(--r);
  background: var(--glass-2);
  border: 1px solid var(--glass-brd-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 var(--hi);
  transition: transform 0.18s var(--ease), background 0.25s, border-color 0.25s;
}
.cta:active { transform: scale(0.982); }

.cta.ghost { background: var(--glass); border-color: var(--glass-brd); color: var(--dim); font-weight: 700; }
.cta.cool { background: var(--glass); }
.cta.danger { background: none; border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); font-weight: 700; }
.cta:disabled { opacity: 0.35; }

/* ------------------------------------------------------------------ compte -- */

.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar { width: 56px; height: 56px; border-radius: 19px; display: grid; place-items: center; font-size: 20px; font-weight: 800; background: var(--glass-2); border: 1px solid var(--glass-brd); box-shadow: inset 0 1px 0 var(--hi); overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.who { min-width: 0; }
.who .n { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .u { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tier-card { display: block; width: 100%; text-align: left; padding: 17px; border-radius: var(--r-l); overflow: hidden; transition: transform 0.2s var(--ease); }
.tier-card:active { transform: scale(0.986); }

.tier-top { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.tier-meta { flex: 1; min-width: 0; }
.tier-name { display: block; font-size: clamp(18px, 5.2vw, 22px); font-weight: 800; letter-spacing: -0.03em; }
.tier-disc { display: block; font-size: 12px; color: var(--dim); margin-top: 1px; }
.tier-cta { font-size: 10.5px; font-weight: 800; letter-spacing: 0.09em; color: var(--faint); text-transform: uppercase; white-space: nowrap; }

.bar-wrap { position: relative; z-index: 1; margin-top: 16px; }
.bar { height: 7px; border-radius: 999px; background: var(--sunk); overflow: hidden; border: 1px solid var(--glass-brd); }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c1, #555), var(--c2, #999)); width: 0; transition: width 1.1s var(--ease); }
.bar-lbl { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 15px 0 17px; }
.stat { padding: 13px 8px; border-radius: var(--r); text-align: center; }
.stat .v { font-size: clamp(14px, 4.4vw, 18px); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .k { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }

/* ------------------------------------------------------------- commandes -- */

.order { border-radius: var(--r-l); padding: 15px; margin-bottom: 11px; animation: rise 0.36s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.order.hl { border-color: var(--glass-brd-2); }

.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; position: relative; z-index: 1; }
.order-id { font-size: 13px; font-weight: 800; letter-spacing: 0.02em; }
.order-date { font-size: 11px; color: var(--faint); margin-top: 1px; }

/* seules zones colorees avec les gemmes — et encore, tres desaturees */
.pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid;
  background: var(--glass);
}
.pill.wait  { color: var(--st-wait); border-color: color-mix(in srgb, var(--st-wait) 34%, transparent); }
.pill.taken { color: var(--st-live); border-color: color-mix(in srgb, var(--st-live) 34%, transparent); }
.pill.done  { color: var(--st-done); border-color: color-mix(in srgb, var(--st-done) 34%, transparent); }
.pill.paid  { color: var(--st-done); border-color: color-mix(in srgb, var(--st-done) 30%, transparent); }
.pill.due   { color: var(--st-wait); border-color: color-mix(in srgb, var(--st-wait) 30%, transparent); }

.order-items { border-top: 1px solid var(--glass-brd); border-bottom: 1px solid var(--glass-brd); padding: 10px 0; margin-bottom: 10px; position: relative; z-index: 1; }
.oi { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.oi .q { color: var(--faint); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.oi .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi .pr { color: var(--dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.kv { display: flex; gap: 10px; padding: 5px 0; font-size: 12.5px; position: relative; z-index: 1; }
.kv .k { color: var(--faint); flex-shrink: 0; width: 78px; }
.kv .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.order-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--glass-brd); position: relative; z-index: 1; }
.order-total { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.order .cta { margin-top: 12px; padding: 13px; font-size: 13.5px; z-index: 6; }

.courier { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding: 10px 12px; border-radius: var(--r-s); background: var(--sunk); font-size: 12px; color: var(--dim); position: relative; z-index: 1; }
.courier strong { color: var(--text); }

/* ---------------------------------------------------------------- segments -- */

.segments { display: flex; gap: 3px; padding: 3px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-brd); box-shadow: inset 0 1px 0 var(--hi); margin-bottom: 17px; }
.seg { flex: 1; padding: 9px 6px; border-radius: 11px; font-size: 12px; font-weight: 700; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.24s, color 0.24s, box-shadow 0.24s; }
.seg.on { background: var(--glass-2); color: var(--text); box-shadow: inset 0 1px 0 var(--hi), var(--shadow-s); }

/* -------------------------------------------------------------------- infos -- */

.info-card { border-radius: var(--r-l); padding: 17px; margin-bottom: 12px; animation: rise 0.4s var(--ease) both; animation-delay: calc(var(--i) * 50ms); }
.info-card > * { position: relative; z-index: 1; }
.info-card h3 { font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin: 0 0 11px; }
.info-card .lead2 { font-size: 13.5px; color: var(--dim); margin: 0 0 15px; }

.steps { position: relative; padding-left: 26px; }
.steps::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 10px; width: 1px; background: linear-gradient(180deg, var(--glass-brd-2), transparent); }
.step { position: relative; padding-bottom: 16px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: -22px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--glass); }
.step .st { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; letter-spacing: -0.015em; }
.step .sd { font-size: 12.5px; color: var(--dim); }

.pay-grid { display: grid; gap: 10px; }
.pay { display: block; width: 100%; text-align: left; padding: 14px; border-radius: var(--r); cursor: pointer; -webkit-user-select: none; user-select: none; transition: border-color 0.24s, background 0.24s, transform 0.16s var(--ease); }
.pay:active { transform: scale(0.986); }
.pay.on { border-color: var(--glass-brd-2); background: var(--glass-2); }
.pay > * { position: relative; z-index: 1; }
.pay-head { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.pay-ic { font-size: 15px; opacity: 0.85; }
.pay-name { font-size: 14px; font-weight: 800; flex: 1; letter-spacing: -0.015em; }
.pay-when { font-size: 9.5px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.pay-desc { font-size: 12px; color: var(--dim); line-height: 1.45; }

.wallet { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 11px; border-radius: var(--r-s); background: var(--sunk); position: relative; z-index: 6; }
.wallet .coin { font-size: 11px; font-weight: 800; letter-spacing: 0.05em; flex-shrink: 0; }
.wallet .addr { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet .cp { flex-shrink: 0; font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--text); padding: 5px 9px; border-radius: 8px; background: var(--glass-2); border: 1px solid var(--glass-brd); transition: transform 0.14s var(--ease); }
.wallet .cp:active { transform: scale(0.9); }

.faq { border-bottom: 1px solid var(--glass-brd); }
.faq:last-child { border-bottom: none; }
.faq summary { list-style: none; cursor: pointer; padding: 14px 0; font-size: 13.5px; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 19px; font-weight: 300; color: var(--faint); transition: transform 0.3s var(--ease); flex-shrink: 0; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 15px; font-size: 12.5px; color: var(--dim); line-height: 1.6; animation: fade 0.3s var(--ease) both; }

/* -------------------------------------------------------------------- popup -- */

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal .veil { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.52); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); animation: fade 0.25s var(--ease) both; }
[data-theme="light"] .modal .veil { background: rgba(28, 28, 36, 0.3); }

.sheet {
  position: relative;
  width: 100%;
  max-width: var(--max);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--glass-2);
  border: 1px solid var(--glass-brd);
  border-bottom: none;
  box-shadow: inset 0 1px 0 var(--hi), 0 -22px 60px rgba(0, 0, 0, 0.36);
  animation: slideUp 0.36s var(--ease) both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

.grabber { width: 38px; height: 4px; border-radius: 999px; background: var(--glass-brd-2); margin: 4px auto 16px; }
.sheet h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.035em; margin: 0 0 4px; }
.sheet .lead { color: var(--dim); font-size: 13px; margin: 0 0 17px; }

.trow { display: flex; gap: 12px; padding: 13px; border-radius: var(--r); margin-bottom: 8px; animation: rise 0.34s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.trow > * { position: relative; z-index: 1; }
.trow.locked { opacity: 0.38; }
.trow.now { border-color: var(--glass-brd-2); background: var(--glass-2); }
.trow .th { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.trow .tn { font-size: 14.5px; font-weight: 800; letter-spacing: -0.02em; }
.trow .tx { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.trow .badge-now { font-size: 8.5px; font-weight: 800; letter-spacing: 0.11em; padding: 2px 7px; border-radius: 6px; background: var(--solid); color: var(--ink); }
.trow .pct { font-size: 12.5px; font-weight: 800; margin: 5px 0; color: var(--text); }
.trow ul { margin: 0; padding-left: 15px; }
.trow li { font-size: 11.5px; color: var(--dim); margin-bottom: 2px; }

.vpick { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 15px; margin-bottom: 8px; border-radius: var(--r); text-align: left; animation: rise 0.32s var(--ease) both; animation-delay: calc(var(--i) * 45ms); transition: transform 0.16s var(--ease), border-color 0.24s, background 0.24s; }
.vpick:active { transform: scale(0.982); border-color: var(--glass-brd-2); background: var(--glass-2); }
.vpick.out { opacity: 0.38; }
.vpick:disabled { cursor: default; }
.vpick > * { position: relative; z-index: 1; }
.vp-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vp-label { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.vp-stock { font-size: 11px; color: var(--faint); }
.vp-right { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; flex-shrink: 0; }
.vp-price { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* prix d'origine barre + taux de remise, au-dessus du prix reellement paye */
.vp-old { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.vp-off {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--glass-brd-2);
  color: var(--dim);
  white-space: nowrap;
}

/* ------------------------------------------------------------ comptabilite -- */

.acct-hero { margin-bottom: 16px; }
.acct-sum { font-size: clamp(30px, 9vw, 38px); font-weight: 800; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.acct-sub { font-size: 12.5px; color: var(--dim); margin-top: 3px; }

/* graphe en barres : pas de librairie, juste une grille de colonnes */
.chart {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: clamp(2px, 1.4vw, 7px);
  align-items: end;
  height: 132px;
  padding-top: 8px;
}

.cbar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
  padding: 0;
  gap: 6px;
  transition: opacity 0.2s;
}
.cbar i {
  display: block;
  width: 100%;
  height: var(--h);
  min-height: 2px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, var(--glass-brd-2), var(--glass-brd));
  border: 1px solid var(--glass-brd);
  border-bottom: none;
  transform-origin: bottom;
  animation: growBar 0.55s var(--ease) both;
  animation-delay: calc(var(--i) * 18ms);
  transition: background 0.2s, border-color 0.2s;
}
@keyframes growBar { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }

.cbar.zero i { background: var(--glass); height: 2px; }
.cbar.on i, .cbar:hover i { background: linear-gradient(180deg, var(--text), var(--glass-brd-2)); border-color: transparent; }

.cbar .cx {
  font-size: 9px;
  font-weight: 700;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
  min-height: 11px;
}
.cbar.on .cx { color: var(--text); }

.acct-cap {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--r-s);
  background: var(--sunk);
  font-size: 12px;
  color: var(--dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* classement des livreurs */
.rank { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--glass-brd); animation: rise 0.3s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.rank:last-of-type { border-bottom: none; }
.rank-n { width: 20px; flex-shrink: 0; font-size: 12px; font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 1px; }
.rank-b { flex: 1; min-width: 0; }
.rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rank-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-v { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-bar { display: block; height: 4px; border-radius: 99px; background: var(--sunk); margin: 7px 0 5px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: linear-gradient(90deg, var(--glass-brd-2), var(--text)); animation: growW 0.7s var(--ease) both; }
@keyframes growW { from { width: 0; } }
.rank-s { font-size: 11px; color: var(--faint); }

/* -------------------------------------------------------------------- chat -- */

.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 13px; margin-bottom: 12px; border-bottom: 1px solid var(--glass-brd); }
.chat-with { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; }
.chat-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* hauteur fixe : la feuille ne doit pas grandir a chaque message */
.chat-log {
  height: 44dvh;
  min-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.msg {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  font-size: 13.5px;
  line-height: 1.4;
  animation: rise 0.28s var(--ease) both;
}
.msg .who { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
/* le role, pour que la boutique sache qui parle sans deviner */
.msg .who .role { font-weight: 600; color: var(--faint); }
.msg .txt { display: block; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg .at { display: block; font-size: 9.5px; color: var(--faint); margin-top: 4px; text-align: right; }

.msg.me { align-self: flex-end; background: var(--glass-2); border-color: var(--glass-brd-2); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.owner { border-style: dashed; }

.msg.sys {
  align-self: center;
  max-width: 100%;
  background: none;
  border: none;
  padding: 6px 0;
  font-size: 11px;
  color: var(--faint);
  text-align: center;
}

.chat-bar { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; }
.chat-bar textarea {
  flex: 1;
  min-height: 44px;
  max-height: 110px;
  padding: 12px 14px;
  border-radius: 22px;
  background: var(--sunk);
  border: 1px solid var(--glass-brd);
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  resize: none;
}
.chat-bar textarea:focus { outline: none; border-color: var(--glass-brd-2); }
.chat-bar textarea::placeholder { color: var(--faint); }

.chat-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--glass-2);
  border: 1px solid var(--glass-brd-2);
  box-shadow: inset 0 1px 0 var(--hi);
  color: var(--text);
  transition: transform 0.16s var(--ease);
}
.chat-send:active { transform: scale(0.88); }
.chat-send svg { width: 19px; height: 19px; }

.chat-closed { margin-top: 12px; padding: 12px; border-radius: var(--r); background: var(--sunk); font-size: 12.5px; color: var(--dim); text-align: center; }
.chat-note { margin: 11px 0 0; font-size: 10.5px; color: var(--faint); text-align: center; line-height: 1.45; }

/* ----------------------------------------------------------------- stock -- */

.tag.rupture { background: rgba(14, 14, 16, 0.72); border-color: var(--glass-brd-2); letter-spacing: 0.14em; }
[data-theme="light"] .tag.rupture { background: rgba(20, 20, 28, 0.82); color: #FAFAFB; }

.vtag.out { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }

/* une unite vendable par ligne */
.strow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-brd);
  animation: rise 0.28s var(--ease) both;
  animation-delay: calc(var(--i) * 22ms);
}
.strow:last-child { border-bottom: none; }
.strow.out .strow-n { color: var(--dim); }

/* les formats d'un meme article restent visuellement groupes */
.stgroup { border-left: 1px solid var(--glass-brd); padding-left: 12px; margin: 4px 0 4px 2px; }
.stgroup .strow:last-child { border-bottom: none; }

.strow-t { flex: 1; min-width: 0; }
.strow-n { display: block; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strow-s { display: block; font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stq { display: flex; align-items: center; gap: 2px; flex-shrink: 0; background: var(--sunk); border: 1px solid var(--glass-brd); border-radius: 12px; padding: 3px; }
.stq button { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--dim); font-size: 16px; font-weight: 700; transition: background 0.16s, color 0.16s, transform 0.13s var(--ease); }
.stq button:active { transform: scale(0.85); background: var(--glass-2); color: var(--text); }
.stq button:disabled { opacity: 0.25; }
.stq .v { min-width: 30px; text-align: center; font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }

.stinf {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--sunk);
  border: 1px solid var(--glass-brd);
  color: var(--faint);
  font-size: 15px;
  transition: transform 0.14s var(--ease), color 0.2s, border-color 0.2s;
}
.stinf:active { transform: scale(0.88); }
.stinf.on { color: var(--text); border-color: var(--glass-brd-2); }

/* ----------------------------------------------------------- fiche produit -- */

.card, .hot { cursor: pointer; }

/* pastille discrete signalant qu'une video attend dans la fiche */
.hasvid {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(14, 14, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  font-size: 8px;
  color: #F2F2F3;
  padding-left: 1px;
}
.hot .hasvid { top: auto; bottom: calc(100% - 152px); left: auto; right: 9px; }

.isheet-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 15px;
  border-radius: var(--r-l);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 54px;
  background: linear-gradient(155deg, var(--glass-2), transparent 62%);
  border: 1px solid var(--glass-brd);
  box-shadow: inset 0 1px 0 var(--hi);
}
.isheet-media img, .isheet-media video { width: 100%; height: 100%; object-fit: cover; }
.isheet-media video { background: #000; }

.isheet-head { margin-bottom: 10px; }
.isheet-cat { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.isheet-head h2 { margin: 0; }

.isheet-desc { font-size: 13.5px; color: var(--dim); line-height: 1.55; margin: 0 0 18px; }

.isheet-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--glass-brd);
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.isheet-line strong { color: var(--text); font-size: 15px; }

/* Selection d'un format. En monochrome, une bordure un peu plus claire ne
   suffit pas : on ajoute une pastille de choix, et la bordure passe a la
   couleur du texte — le contraste le plus fort disponible. */
.vp-tick {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--glass-brd-2);
  position: relative;
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease);
}
.vp-tick::after {
  content: '';
  position: absolute;
  left: 6.5px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.2);
  opacity: 0;
  transition: transform 0.24s var(--ease), opacity 0.18s;
}

.vpick.on {
  border-color: var(--text);
  background: var(--glass-2);
  box-shadow: inset 0 1px 0 var(--hi), 0 6px 20px -12px var(--text);
}
.vpick.on .vp-tick { background: var(--text); border-color: var(--text); }
.vpick.on .vp-tick::after { transform: rotate(45deg) scale(1); opacity: 1; }
.vpick.on .vp-label, .vpick.on .vp-price { color: var(--text); }
.vpick.on .vp-stock { color: var(--dim); }

.isheet-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0 4px;
  padding: 13px;
  border-radius: var(--r);
  background: var(--sunk);
  border: 1px solid var(--glass-brd);
}
.qty.big { padding: 4px; border-radius: 14px; }
.qty.big button { width: 34px; height: 34px; font-size: 18px; border-radius: 11px; }
.qty.big button:disabled { opacity: 0.3; }
.qty.big .v { min-width: 30px; font-size: 15px; }

.isheet-total { text-align: right; }
.isheet-total .k { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: var(--faint); }
.isheet-total .v { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ------------------------------------------------------ formulaire article -- */

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }

.field textarea,
.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 12px;
  border-radius: var(--r);
  background: var(--sunk);
  border: 1px solid var(--glass-brd);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.24s;
}
.field textarea { resize: vertical; min-height: 76px; }
.field textarea:focus, .field input:focus, .field select:focus { outline: none; border-color: var(--glass-brd-2); }
.field textarea::placeholder, .field input::placeholder { color: var(--faint); }
.field select { appearance: none; -webkit-appearance: none; }

.row2 { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }

.chk { display: flex; align-items: center; gap: 11px; padding: 13px; margin-bottom: 13px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--glass-brd); box-shadow: inset 0 1px 0 var(--hi); font-size: 13px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--text); flex-shrink: 0; }

.v-row { display: grid; gap: 6px; padding: 9px; margin-bottom: 8px; border-radius: var(--r); }
.v-sub { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 6px; }
.v-hint { font-size: 11px; color: var(--faint); margin: -3px 0 10px 2px; }
.v-row input { padding: 10px 11px; border-radius: var(--r-s); background: var(--sunk); border: 1px solid var(--glass-brd); color: var(--text); font-size: 13.5px; min-width: 0; }
.v-row input:focus { outline: none; border-color: var(--glass-brd-2); }
.v-row .v-label { font-weight: 700; }
.v-del { border-radius: var(--r-s); background: var(--sunk); border: 1px solid var(--glass-brd); color: var(--faint); font-size: 13px; transition: color 0.2s, transform 0.14s var(--ease); }
.v-del:active { transform: scale(0.9); color: var(--danger); }

.mediabox { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.mediaprev { width: 90px; height: 90px; flex-shrink: 0; border-radius: var(--r); display: grid; place-items: center; overflow: hidden; }
.mediaprev img, .mediaprev video { width: 100%; height: 100%; object-fit: cover; }
.mediabtns { flex: 1; min-width: 0; }
.mediabtns .cta { padding: 12px; font-size: 13px; }

.mrow { display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin-bottom: 8px; border-radius: var(--r); animation: rise 0.3s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.mrow-ic { font-size: 20px; flex-shrink: 0; position: relative; z-index: 1; }
.mrow-txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.mrow-n { display: block; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow-s { display: block; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow-b { width: 33px; height: 33px; flex-shrink: 0; border-radius: 11px; background: var(--sunk); border: 1px solid var(--glass-brd); font-size: 14px; position: relative; z-index: 6; transition: transform 0.14s var(--ease), border-color 0.2s; }
.mrow-b:active { transform: scale(0.88); border-color: var(--glass-brd-2); }

/* ---------------------------------------------------------------- tabbar -- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 0 max(4px, calc((100vw - var(--max)) / 2)) env(safe-area-inset-bottom);
  background: var(--glass-2);
  border-top: 1px solid var(--glass-brd);
  box-shadow: inset 0 1px 0 var(--hi);
}

.tab { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 2px; color: var(--faint); transition: color 0.24s; }
.tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--ease); flex-shrink: 0; }
.tab .t { font-size: 9px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab:active svg { transform: scale(0.84); }
.tab.on { color: var(--text); }
.tab.on svg { stroke: var(--text); transform: translateY(-1px); }

.tab.on::before {
  content: '';
  position: absolute;
  top: 0;
  width: 26px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--text);
  animation: grow 0.32s var(--ease) both;
}
@keyframes grow { from { width: 0; opacity: 0; } to { width: 26px; opacity: 1; } }

.dot-badge { position: absolute; top: 5px; left: 50%; margin-left: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--solid); color: var(--ink); font-size: 9.5px; font-weight: 800; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.dot-badge.pop { animation: pop 0.36s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 38% { transform: scale(1.42); } 100% { transform: scale(1); } }

/* ------------------------------------------------------------------- divers -- */

.admin-banner { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; padding: 12px 14px; border-radius: var(--r); font-size: 12.5px; color: var(--dim); animation: rise 0.35s var(--ease) both; }

.empty { text-align: center; padding: 56px 20px; color: var(--faint); }
.empty .ic { font-size: 32px; margin-bottom: 13px; opacity: 0.4; filter: grayscale(1); }
.empty .t { font-size: 14.5px; font-weight: 700; color: var(--dim); margin-bottom: 4px; }
.empty .s { font-size: 12.5px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px); z-index: 80; max-width: calc(100% - 32px); padding: 11px 17px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-brd); box-shadow: inset 0 1px 0 var(--hi), var(--shadow); font-size: 12.5px; font-weight: 600; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================================
   FINITIONS
   ========================================================================== */

/* --- la barre du haut se resserre des qu'on defile ------------------------ */

.topbar { border-bottom-color: transparent; transition: border-color 0.3s var(--ease), background 0.3s var(--ease); }
body.scrolled .topbar { border-bottom-color: var(--glass-brd); }

.brand-sub { max-height: 16px; overflow: hidden; transition: opacity 0.3s var(--ease), max-height 0.3s var(--ease); }
body.scrolled .brand-sub { opacity: 0; max-height: 0; }

/* --- apparition liee au defilement --------------------------------------- */

/* Animation pilotee par la position dans la fenetre, pas par une horloge :
   chaque carte se revele au moment ou elle entre a l'ecran. Ignoree par les
   navigateurs qui ne connaissent pas les timelines de scroll — l'animation
   d'entree classique reste alors en place. L'opacite de depart n'est jamais
   nulle, pour qu'un calcul de plage errone ne puisse pas masquer du contenu. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card, .hot, .order, .info-card {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 48%;
    }
    @keyframes reveal {
      from { opacity: 0.25; transform: translateY(14px) scale(0.985); }
      to   { opacity: 1; transform: none; }
    }
  }
}

/* --- eclat lent sur la gemme de palier ----------------------------------- */

.gem.lg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: inherit;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.5) 50%, transparent 62%);
  background-size: 300% 100%;
  animation: gemSheen 5s var(--ease) infinite;
  pointer-events: none;
}
@keyframes gemSheen {
  0%       { background-position: 210% 0; }
  55%, 100% { background-position: -110% 0; }
}

/* --- les visuels se fondent au chargement plutot que d'apparaitre net ---- */

.thumb img, .thumb video, .mini img, .mini video, .mediaprev img, .mediaprev video {
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.thumb img.on, .thumb video.on, .mini img.on, .mini video.on,
.mediaprev img.on, .mediaprev video.on { opacity: 1; }

/* --- details ------------------------------------------------------------- */

::selection { background: var(--glass-brd-2); color: var(--text); }

*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--glass-brd); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--glass-brd-2); }

/* anneau de focus uniquement au clavier, jamais a la souris ni au doigt */
:focus-visible { outline: 2px solid var(--glass-brd-2); outline-offset: 2px; border-radius: 4px; }

@media (min-width: 540px) {
  .grid, .rail { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 340px) {
  .grid, .rail { gap: 8px; }
  .tab .t { font-size: 8px; }
  .kv .k { width: 66px; }
  .tier-chip { max-width: 38%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
