/* Alkane — PWA feed vidéo. Mobile-first, aucune dépendance.
   Design system (sprint 11) : tout passe par les jetons ci-dessous — couleurs (thèmes clair/sombre), échelle
   typographique, espacements, arrondis, hauteurs. Aucune valeur de couleur ou de taille en dur dans les composants,
   aucun style injecté par JavaScript (les valeurs dynamiques passent par des propriétés personnalisées). */
:root {
  color-scheme: dark;
  /* couleurs — thème sombre (défaut) */
  --bg: #0b0b0f;
  --bg-2: #15151c;
  --bg-3: #1f1f29;
  --fg: #f4f4f6;
  --fg-2: #b8b8c6;
  --fg-3: #7d7d90;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ccff00;
  --accent-ink: #0b0b0f;
  --accent-soft: rgba(204, 255, 0, 0.15);
  --danger: #ff5c7a;
  --danger-soft: rgba(255, 92, 122, 0.15);
  --ok: #52e3a4;
  --bar-bg: rgba(11, 11, 15, 0.92);          /* barres fixes (haut, bas, recherche) */
  --ghost-bg: rgba(255, 255, 255, 0.08);      /* bouton secondaire, survol d'icône */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --overlay-fg: #ffffff;                       /* texte posé sur la vidéo (toujours clair) */
  --overlay-fg-2: rgba(255, 255, 255, 0.78);
  --overlay-chip: rgba(255, 255, 255, 0.16);
  /* typographie — échelle mobile (Instagram / TikTok : 10 · 12 · 13 · 15 · 17 · 20 · 22) */
  --fs-2xs: 10px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 22px;
  --fs-3xl: 26px;   /* montant d'une feuille, chiffres mis en avant */
  --fs-4xl: 30px;   /* prix du tiroir, code de remise, code SMS */
  --fs-hero: 90px;  /* cœur du double-tap */
  --fs-title: 14px; /* titre de carte, texte de liste, formulaire compact */
  --fs-price: 17px;
  --lh-tight: 1.2;
  --lh: 1.4;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* espacements, arrondis, tailles */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --radius: 14px;
  --radius-sm: 10px;
  --r-btn: 10px;    /* boutons : arrondi discret (brand guidelines mobile) */
  --r-field: 10px;  /* champs, segments, listes */
  --r-sheet: 18px;  /* feuilles coulissantes */
  --r-pill: 999px;
  --btn-h: 42px;
  --btn-h-sm: 34px;
  --cta-h: 40px;
  --avatar: 32px;
  --avatar-lg: 86px;
  --avatar-md: 56px;        /* en-tête de profil (sprint 14) */
  --rail-icon: 28px;
  --rail-right: 8px;        /* rail et pile d'action : même colonne à droite */
  --cta-stack-w: 116px;     /* largeur de la pile prix + bouton */
  --cta-stack-h: 86px;      /* hauteur de la pile (prix 2 lignes + bouton) : le rail commence au-dessus */
  --topbar-h: 56px;
  --bottomnav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --col: 520px;
  --z-bar: 30; --z-drawer: 40; --z-sheet: 60; --z-toast: 70;
}
/* thème clair : préférence système, ou choix explicite (`data-theme`, mémorisé par pwa.js) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { color-scheme: light;
    --bg: #ffffff; --bg-2: #f6f6f8; --bg-3: #ebebf0; --fg: #111114; --fg-2: #55556a; --fg-3: #8a8a9c;
    --line: rgba(0, 0, 0, 0.1); --accent: #9ccc00; --accent-ink: #0b0b0f; --accent-soft: rgba(156, 204, 0, 0.18);
    --danger: #e0244f; --danger-soft: rgba(224, 36, 79, 0.12); --ok: #1f9d6a;
    --bar-bg: rgba(255, 255, 255, 0.92); --ghost-bg: rgba(0, 0, 0, 0.06); --shadow: 0 10px 30px rgba(0, 0, 0, 0.14); }
}
:root[data-theme="light"] { color-scheme: light;
  --bg: #ffffff; --bg-2: #f6f6f8; --bg-3: #ebebf0; --fg: #111114; --fg-2: #55556a; --fg-3: #8a8a9c;
  --line: rgba(0, 0, 0, 0.1); --accent: #9ccc00; --accent-ink: #0b0b0f; --accent-soft: rgba(156, 204, 0, 0.18);
  --danger: #e0244f; --danger-soft: rgba(224, 36, 79, 0.12); --ok: #1f9d6a;
  --bar-bg: rgba(255, 255, 255, 0.92); --ghost-bg: rgba(0, 0, 0, 0.06); --shadow: 0 10px 30px rgba(0, 0, 0, 0.14); }
/* le feed plein écran reste sombre quel que soit le thème (vidéo immersive, comme TikTok) */
.feed-body { color-scheme: dark;
  --bg: #0b0b0f; --bg-2: #15151c; --bg-3: #1f1f29; --fg: #f4f4f6; --fg-2: #b8b8c6; --fg-3: #7d7d90; --line: rgba(255, 255, 255, 0.1);
  --accent: #ccff00; --accent-ink: #0b0b0f; --accent-soft: rgba(204, 255, 0, 0.15); --bar-bg: rgba(11, 11, 15, 0.92);
  --ghost-bg: rgba(255, 255, 255, 0.08); --shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { line-height: var(--lh-tight); letter-spacing: -0.01em; }
p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }
/* conteneurs à pas constant (grid + gap) : les paragraphes n'y portent pas de marge propre */
.panel > p, .sheet-body > p, .drawer-body > p, .form > p, .profile-empty p, .empty-state p, .feed-empty-card p, .offer-form > p, .install-text p { margin: 0; }
.is-hidden, [hidden] { display: none !important; }
.muted { color: var(--fg-2); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
/* utilitaires (à la place des styles en ligne) */
.u-mt-0 { margin-top: 0 !important; }
.u-mt-2 { margin-top: var(--sp-2) !important; }
.u-mt-3 { margin-top: var(--sp-3) !important; }
.u-mb-3 { margin-bottom: var(--sp-3) !important; }
.u-m-0 { margin: 0 !important; }
.u-right { text-align: right; }
.u-center { text-align: center; }
.u-inline { display: inline; }
.u-top-20 { margin-top: 20vh; }
.panel > h2:first-child, .panel > h1:first-child { margin-top: 0; }

/* ---- barres ---- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-bar); height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 12px 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  background: linear-gradient(to bottom, var(--bar-bg), transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
/* pages de contenu : barre pleine (le dégradé n'a de sens que sur la vidéo) */
body:not(.feed-body) .topbar { background: var(--bar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: var(--fw-bold); letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; display: block; flex: none; color: var(--accent); stroke-width: 55; }   /* signature Alkane : caméra ↔ bouton lecture (feed/_brand_mark.html, trait = accent) ; 55 = épaisseur du SVG legacy, la règle générique `svg` ne doit pas l'écraser */
.brand-name { font-size: var(--fs-lg); }
.topbar-tabs { display: flex; justify-content: safe center; gap: 18px; font-weight: var(--fw-semibold); font-size: var(--fs-md); color: var(--fg-2);
  min-width: 0; padding: 0 12px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
  mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent); -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent); }
.topbar-tabs::-webkit-scrollbar { display: none; }
.topbar-tabs a { padding: 6px 2px; border-bottom: 2px solid transparent; flex: none; scroll-snap-align: center; }
.topbar-tabs a.is-active { color: var(--fg); border-color: var(--accent); }
@media (max-width: 420px) { .topbar-tabs { gap: 12px; font-size: var(--fs-sm); } .topbar .brand-name { display: none; } }
/* barre de page simple (titre centré, retour à gauche) et barre Explorer (champ de recherche pleine largeur) */
.topbar-page, .topbar-explore { background: var(--bar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-page { grid-template-columns: 40px 1fr 40px; }
.topbar-title { margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-explore { grid-template-columns: 1fr auto; }
.explore-search { position: relative; display: flex; align-items: center; min-width: 0; }
.explore-search svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--fg-3); pointer-events: none; }
.explore-search input { width: 100%; min-height: 38px; border-radius: var(--r-field); border: 1px solid transparent; background: var(--bg-3); color: var(--fg); padding: 0 38px 0 38px; font: inherit; font-size: var(--fs-md); }
.explore-search input:focus { outline: none; border-color: var(--line); background: var(--bg-2); }
.explore-search input::-webkit-search-cancel-button { display: none; }
.explore-clear { position: absolute; right: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-2); }
.explore-clear svg { position: static; width: 16px; height: 16px; color: inherit; }
.explore-clear:hover { background: var(--ghost-bg); }
.topbar-actions { display: flex; gap: 4px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: var(--r-btn); display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--ghost-bg); }
.badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-2xs); font-weight: 800; display: grid; place-items: center; }

.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-bar); height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--bar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--fs-2xs); font-weight: var(--fw-medium); color: var(--fg-3); padding: 6px 0; }
.bottomnav .nav-icon { position: relative; display: block; }
.bottomnav .nav-icon .badge { top: -6px; right: -12px; }
.bottomnav a.is-active { color: var(--fg); }
.bottomnav .sell-btn { background: var(--accent); color: var(--accent-ink); border-radius: 12px; width: 52px; height: 40px; margin: 0 auto; justify-content: center; }
.bottomnav .sell-btn svg { stroke-width: 2.6; }
.bottomnav .nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; background: var(--bg-3); }
.bottomnav a.is-active .nav-avatar { border-color: var(--fg); }

/* ---- feed ---- */
.feed-body { overflow: hidden; }
.feed-main { height: 100dvh; }
.feed {
  height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none;
  background: #000; margin: 0 auto; max-width: var(--col);
}
.feed::-webkit-scrollbar { display: none; }
.card {
  position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; outline: none; color: var(--overlay-fg);
  --poster: none; --progress: 0%;
}
.card-media, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-media { background: var(--poster) center / cover no-repeat; }
.card-media video { object-fit: cover; }
.card-progress { position: absolute; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + var(--safe-bottom)); height: 2px; background: rgba(255, 255, 255, 0.18); }
.card-progress span { display: block; height: 100%; width: var(--progress); background: var(--accent); transition: width 0.25s linear; }
.card-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.45) 30%, rgba(0, 0, 0, 0) 58%); }
/* rail droit : avatar vendeur, favori, question, partager, infos, son — libellés 12 px (TikTok) */
.card-rail { position: absolute; right: var(--rail-right); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + var(--cta-stack-h) + 18px); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.rail-btn { width: 52px; background: transparent; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; color: var(--overlay-fg); }
.rail-btn svg { width: var(--rail-icon); height: var(--rail-icon); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)); }
.rail-btn.is-on svg { fill: var(--accent); stroke: var(--accent); }
.rail-count { font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.rail-avatar { position: relative; width: 48px; height: 48px; margin-bottom: 4px; }
.rail-avatar img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--overlay-fg); background: var(--bg-3); }
.rail-avatar .rail-follow { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 0; display: grid; place-items: center; cursor: pointer; font-size: var(--fs-md); line-height: 1; font-weight: 800; padding: 0; }
.rail-avatar.is-following .rail-follow { display: none; }
.rail-btn[data-action="mute"] .ico-on, .card.is-muted .rail-btn[data-action="mute"] .ico-off { display: none; }
.card.is-muted .rail-btn[data-action="mute"] .ico-on { display: block; }
/* bloc bas gauche : vendeur, titre, tags — 15 / 14 / 13 px */
.card-info { position: absolute; left: 14px; right: calc(var(--cta-stack-w) + 24px); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 14px); display: flex; flex-direction: column; gap: 6px; }
.card-seller { display: flex; align-items: center; gap: 6px; font-weight: var(--fw-semibold); font-size: var(--fs-md); }
.card-seller img { width: var(--avatar); height: var(--avatar); border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.7); background: var(--bg-3); }
.card-seller .rating { font-weight: var(--fw-regular); color: var(--overlay-fg-2); font-size: var(--fs-sm); }
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); vertical-align: -3px; flex: none; }
.verified svg { width: 11px; height: 11px; stroke-width: 3; }
.card-title { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-regular); line-height: 1.3; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { margin: 0; font-size: var(--fs-sm); color: var(--overlay-fg-2); }
.card-tags span { margin-right: 8px; }
/* pile d'action (sprint 14) : prix au-dessus du bouton acheter / enchérir, alignée à droite sous le rail ; le bloc vendeur /
   titre / tags occupe tout le bas à gauche (TikTok Shop, Whatnot) */
.card-cta { position: absolute; right: var(--rail-right); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 14px); width: var(--cta-stack-w); display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.price-pill { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; font-size: var(--fs-price); font-weight: var(--fw-bold); letter-spacing: -0.01em; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.price-pill small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--overlay-fg-2); margin: 0; }
.price-pill:empty { display: none; }
.btn-cta { min-height: var(--cta-h); padding: 0 12px; border-radius: var(--r-btn); background: var(--accent); color: var(--accent-ink); border: 0; font-weight: var(--fw-bold); font-size: var(--fs-md); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); transition: transform 0.08s; white-space: nowrap; }
.btn-cta svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn-cta:active { transform: scale(0.97); }
.btn-cta:disabled, .btn-cta.is-off { background: var(--overlay-chip); color: var(--overlay-fg); box-shadow: none; cursor: default; }
.btn-cta:empty { display: none; }
.card.kind-clip .rail-bag, .card.kind-clip .card-cta { display: none; }
.card.kind-live .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; box-shadow: 0 0 0 4px var(--danger-soft); }
.card .heart-burst { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.5); font-size: var(--fs-hero); opacity: 0; pointer-events: none; animation: burst 0.7s ease-out forwards; }
@keyframes burst { 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1.3); } }
.feed-empty { height: 100dvh; display: grid; place-items: center; scroll-snap-align: start; padding: 24px; }
.feed-empty-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; display: grid; gap: 14px; max-width: 320px; }

/* ---- boutons / formulaires ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 16px; border-radius: var(--r-btn); border: 1px solid transparent; font-weight: var(--fw-semibold); font-size: var(--fs-md); cursor: pointer; transition: transform 0.08s, background 0.15s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { background: var(--ghost-bg); color: var(--fg); border-color: var(--line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: var(--btn-h-sm); padding: 0 12px; font-size: var(--fs-sm); border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--fg-2); font-weight: var(--fw-medium); min-height: var(--btn-h-sm); padding: 0 8px; }
.btn-link:hover { color: var(--fg); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
/* groupes de boutons : une ligne qui se partage l'espace (deux actions secondaires), ou une colonne */
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--sp-2); }
.actions-stack { display: grid; gap: var(--sp-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-field); border: 1px solid var(--line); background: var(--bg-3); color: var(--fg); font: inherit; font-size: var(--fs-md);
}
.input::placeholder { color: var(--fg-3); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(135deg, var(--fg-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
textarea.input { min-height: 90px; resize: vertical; }
/* un formulaire = une grille à pas constant ; un champ = libellé 13/600 + contrôle, sans marge propre dans un .form */
.form { display: grid; gap: var(--sp-4); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.form .field, .form .field-row, .sheet-body .field, .panel .field { margin-bottom: 0; }
.field label, .field-label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--fg-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-inline { display: flex; gap: 8px; }
/* ligne cochable : zone de touche 44 px, libellé 14 px, case à gauche */
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-title); cursor: pointer; }
.check-row.is-top { align-items: flex-start; padding-top: 10px; }
.check-row.is-top input { margin-top: 2px; }
.check-stack { display: grid; }
.check-stack .check-row { min-height: 40px; }
.form-note, .sheet-note, .auth-note { font-size: var(--fs-sm); color: var(--fg-3); line-height: var(--lh); margin: 0; }
.form-note:empty { display: none; }
.form-note.is-error { color: var(--danger); }
.form-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--sp-2); position: sticky; bottom: calc(var(--bottomnav-h) + var(--safe-bottom)); padding: var(--sp-3) 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.panel .form-actions { margin: 0 calc(-1 * var(--sp-4)); padding: var(--sp-3) var(--sp-4); background: linear-gradient(to top, var(--bg-2) 70%, transparent); border-radius: 0 0 var(--radius) var(--radius); }
.pill { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); background: var(--bg-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--fg-2); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.seg { display: flex; background: var(--bg-3); border-radius: var(--r-field); padding: 4px; gap: 4px; }
.seg label { flex: 1; text-align: center; padding: 10px; border-radius: 7px; font-weight: 700; cursor: pointer; color: var(--fg-2); }
.seg input { display: none; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); }

/* ---- pages ---- */
.page { max-width: var(--col); margin: 0 auto; padding: calc(var(--topbar-h) + var(--safe-top) + 12px) 16px calc(var(--bottomnav-h) + var(--safe-bottom) + 24px); min-height: 100dvh; }
.page h1 { font-size: var(--fs-2xl); margin: 8px 0 14px; }
.page h2 { font-size: var(--fs-lg); margin: var(--sp-6) 0 var(--sp-3); }
.page h2:first-child, .page h1 + h2 { margin-top: var(--sp-2); }
.page h2 + p, .page h2 + .muted { margin-top: calc(-1 * var(--sp-1)); }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-4); margin-bottom: var(--sp-3); display: grid; gap: var(--sp-3); }
.panel > * { margin: 0; }
.panel > h2 { font-size: var(--fs-lg); }
.panel > h2 + p { margin-top: calc(-1 * var(--sp-2)); }
.flash-stack { display: grid; gap: 8px; margin-bottom: 12px; }
.flash { padding: 12px 14px; border-radius: var(--r-field); background: var(--bg-3); border-left: 4px solid var(--accent); }
.flash-error { border-color: var(--danger); }
.flash-success { border-color: var(--ok); }

/* boutique / profil (sprint 14 : avatar 56 en ligne avec nom + pseudo, bio courte, trois indicateurs, actions pleine largeur) */
.profile-head { display: grid; gap: 10px; padding-top: 4px; margin-bottom: 14px; }
.profile-top { display: flex; align-items: center; gap: 14px; }
.profile-avatar { width: var(--avatar-md); height: var(--avatar-md); border-radius: 50%; object-fit: cover; background: var(--bg-3); border: 2px solid var(--line); flex: none; }
.profile-id { display: grid; gap: 2px; min-width: 0; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.profile-stats li { display: grid; text-align: center; line-height: var(--lh-tight); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-field); padding: 8px 4px; }
.profile-stats a { display: grid; color: inherit; }
.profile-stats strong { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.profile-stats span { font-size: var(--fs-xs); color: var(--fg-2); }
.profile-coach p { margin: 0; }
.coach-tips { margin: 6px 0 0; padding: 12px 14px 12px 28px; text-align: left; font-size: var(--fs-sm); color: var(--fg-2); line-height: var(--lh); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 6px; }
.grid-item .grid-stats { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: #fff; }
.grid-item .grid-stats span { display: inline-flex; align-items: center; gap: 3px; background: rgba(0, 0, 0, 0.5); border-radius: 6px; padding: 2px 6px; }
.grid-item .grid-stats svg, .grid-item .grid-timer svg { width: 12px; height: 12px; stroke-width: 2.4; }
.grid-item .grid-timer { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-2xs); background: rgba(0, 0, 0, 0.7); color: #fff; border-radius: 6px; padding: 2px 6px; font-weight: var(--fw-bold); }
.grid-item .grid-timer.is-soon { background: var(--danger); }
.grid-cell { position: relative; }
.grid-cell .grid-fans { position: absolute; left: 6px; bottom: 34px; border: 0; border-radius: var(--r-pill); padding: 4px 9px; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-2xs); font-weight: var(--fw-bold); cursor: pointer; }
.person-link input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.page .profile-name, .profile-name { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 6px; line-height: var(--lh-tight); }
.profile-handle { margin: 0; font-size: var(--fs-sm); color: var(--fg-2); }
.profile-meta { font-size: var(--fs-sm); }
.profile-bio { margin: 0; font-size: var(--fs-sm); line-height: var(--lh); white-space: pre-line; color: var(--fg-2); }
.profile-tagline { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); line-height: var(--lh); color: var(--fg); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pill-lang { background: var(--bg-3); color: var(--fg); border: 1px solid var(--line); }
.profile-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: var(--fs-sm); }
.profile-links a { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; color: var(--fg-2); font-weight: var(--fw-semibold); }
.profile-links svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 4px; }
.profile-actions .btn { min-height: 36px; font-size: var(--fs-sm); padding: 0 10px; }
.btn-icon { width: 40px; padding: 0 !important; }
.profile-tabs { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -16px 8px; }
.profile-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 0 8px; color: var(--fg-3); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); cursor: pointer; }
.profile-tabs button.is-active { color: var(--fg); border-color: var(--fg); }
.profile-tabs svg { width: 22px; height: 22px; }
.profile-grid .grid { margin: 0 -16px; gap: 2px; }
.profile-empty, .empty-state { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-6) var(--sp-4); color: var(--fg-2); text-align: center; font-size: var(--fs-md); }
.profile-empty svg, .empty-state svg { width: 44px; height: 44px; color: var(--fg-3); }
.empty-state strong { color: var(--fg); }
.empty-state .btn { min-width: 200px; }

/* ---- Explorer (grille Instagram : pastilles, boutiques à suivre, mosaïque) ---- */
.explore { padding-top: calc(var(--topbar-h) + var(--safe-top) + 8px); }
.section-title { margin: 14px 0 8px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.04em; }
.page .section-title { font-size: var(--fs-sm); margin: 14px 0 8px; }
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 32px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-pill); background: var(--bg-3); color: var(--fg-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); border: 1px solid transparent; }
.chip:hover { background: var(--ghost-bg); }
.chip.is-active { background: var(--fg); color: var(--bg); }
/* cases à cocher en pastilles (transporteurs proposés) */
.carrier-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 6px 0 10px 26px; align-items: center; }
.carrier-list[hidden] { display: none; }
.chip-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-check { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--bg-3); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; border: 1px solid transparent; }
.chip-check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }
.chip-check input { margin: 0; accent-color: var(--accent); }
.field-hint { flex-basis: 100%; font-size: var(--fs-xs); color: var(--fg-3); }
.carrier-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 8px 0 2px; }
.carrier-pick[hidden] { display: none; }
.shop-row { display: flex; gap: var(--sp-2); overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.shop-row::-webkit-scrollbar { display: none; }
.shop-card { flex: none; width: 140px; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--sp-2); padding: 14px 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); scroll-snap-align: start; }
.shop-card-link { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; min-width: 0; width: 100%; text-align: center; }
.shop-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg-3); border: 2px solid var(--line); }
.shop-name { display: flex; justify-content: center; align-items: center; gap: 4px; width: 100%; min-width: 0; overflow: hidden; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.shop-handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-meta { font-size: var(--fs-xs); color: var(--fg-3); }
.shop-tags { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--accent); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-tagline { font-size: var(--fs-2xs); line-height: var(--lh-tight); color: var(--fg-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-card .btn { width: 100%; }
.explore-grid .grid { margin: 0 -16px; gap: 2px; }
.explore-grid .grid-item { border-radius: 0; aspect-ratio: 3 / 4; }

/* ---- boîte « Conversations » (sprint 16) : onglets défilants, compteurs, fil des notifications ---- */
.inbox { padding-top: calc(var(--topbar-h) + var(--safe-top) + 4px); }
.inbox-tabs { position: sticky; top: calc(var(--topbar-h) + var(--safe-top)); z-index: 2; display: flex; gap: var(--sp-1); margin: 0 -16px var(--sp-3); padding: 6px 16px; background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.inbox-tabs button { scroll-snap-align: start; }
.inbox-tabs::-webkit-scrollbar { display: none; }
.inbox-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--fg-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer; }
.inbox-tabs button.is-active { background: var(--fg); color: var(--bg); }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-2xs); font-weight: var(--fw-bold); }
.inbox-tabs button.is-active .tab-count { background: var(--accent); }
.inbox-pane { display: grid; gap: var(--sp-3); }
.inbox-pane > h2:first-child { margin-top: 0; }
.pane-head { display: flex; justify-content: space-between; align-items: center; min-height: 34px; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; }
.notif a { display: grid; grid-template-columns: 10px 1fr auto; align-items: start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; }
.notif.is-unread .notif-dot { background: var(--accent); }
.notif-text { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-title); line-height: var(--lh); }
.notif-text strong { font-weight: var(--fw-medium); }
.notif.is-unread .notif-text strong { font-weight: var(--fw-bold); }
.notif-text span { color: var(--fg-2); font-size: var(--fs-sm); }
.notif time { font-size: var(--fs-xs); color: var(--fg-3); white-space: nowrap; margin-top: 2px; }
/* mobile uniquement : en paysage sur un téléphone, l'interface se masque derrière une invitation à tourner l'appareil */
.rotate-guard { display: none; position: fixed; inset: 0; z-index: 200; place-content: center; justify-items: center; gap: var(--sp-3); text-align: center; background: var(--bg); color: var(--fg); padding: var(--sp-6); }
.rotate-guard p { margin: 0; }
.rotate-guard .brand-mark { width: 56px; height: 56px; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) { .rotate-guard { display: grid; } }

/* ---- listes abonnés / abonnements ---- */
.people-tabs { grid-template-columns: 1fr 1fr; margin-top: -4px; }
.people-tabs a { border-bottom: 2px solid transparent; padding: 10px 0 8px; color: var(--fg-3); text-align: center; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.people-tabs a.is-active { color: var(--fg); border-color: var(--fg); }
.people-list { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.person-link { display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0; }
.person-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bg-3); flex: none; }
.person-text { display: grid; gap: 2px; min-width: 0; line-height: var(--lh-tight); }
.person-text strong { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-md); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-bio { font-size: var(--fs-xs); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .btn { flex: none; min-width: 88px; }
.shop-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.shop-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); background: var(--bg-3); }
.shop-head h1 { margin: 0; font-size: var(--fs-2xl); }
.shop-stats { display: flex; gap: 16px; color: var(--fg-2); font-size: var(--fs-sm); }
.shop-stats strong { color: var(--fg); font-size: var(--fs-lg); display: block; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid-item { position: relative; aspect-ratio: 9 / 14; border-radius: 4px; overflow: hidden; background: var(--bg-3); }
.grid-item img, .grid-item video { width: 100%; height: 100%; object-fit: cover; }
.grid-item .grid-price { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.7); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.grid-item .grid-mode { position: absolute; right: 6px; top: 6px; font-size: var(--fs-2xs); background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 2px 6px; font-weight: var(--fw-bold); }
.grid-item.is-sold::after { content: "Vendu"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); color: #fff; font-weight: var(--fw-bold); font-size: var(--fs-sm); }

/* tiroir d'achat (sticky en haut) */
.drawer { position: fixed; inset: 0; z-index: 40; visibility: hidden; }
.drawer[aria-hidden="false"] { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 0.2s; }
.drawer[aria-hidden="false"] .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -105%); width: min(100%, var(--col));
  background: var(--bg-2); border-radius: 0 0 var(--radius) var(--radius); border: 1px solid var(--line); border-top: 0;
  padding: calc(var(--safe-top) + 8px) 16px 18px; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); max-height: 88dvh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.drawer[aria-hidden="false"] .drawer-panel { transform: translate(-50%, 0); }
.drawer-handle { display: grid; place-items: center; padding: 4px 0 10px; cursor: pointer; }
.drawer-handle span { width: 44px; height: 5px; border-radius: 3px; background: var(--fg-3); }
.drawer-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; margin-bottom: 12px; }
.drawer-thumb { width: 56px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--bg-3); }
.drawer-head h2 { margin: 0; font-size: var(--fs-md); line-height: 1.25; }
.drawer-head p { margin: 2px 0 0; font-size: var(--fs-sm); }
.drawer-body { display: grid; gap: 12px; }
.drawer-price { display: flex; align-items: baseline; justify-content: space-between; }
.drawer-price strong { font-size: var(--fs-4xl); letter-spacing: -0.03em; }
.drawer-price span { color: var(--fg-2); font-size: var(--fs-sm); }
.drawer-actions { display: grid; gap: var(--sp-2); }
.drawer-actions .actions .btn { padding: 0 10px; font-size: var(--fs-title); }
.drawer-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.drawer-note { font-size: var(--fs-xs); color: var(--fg-3); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); }
.offer-form { display: none; gap: 10px; }
.offer-form.is-open { display: grid; }

/* panier */
.bag-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bag-line img { width: 64px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--bg-3); }
.bag-line h3 { margin: 0 0 4px; font-size: var(--fs-md); }
.bag-total { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); font-size: var(--fs-lg); font-weight: 800; padding: 16px 0; }
.bag-total > span:last-child { white-space: nowrap; }
.bag-total.is-discount { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--fg-2); padding: 8px 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 32px; height: 32px; border: 0; background: var(--bg-3); color: var(--fg); font-weight: 800; cursor: pointer; }
.qty span { width: 32px; text-align: center; font-weight: 700; }

/* vente */
.sell-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sell-head h1 { margin: 0; font-size: var(--fs-2xl); }
.sell-head .muted { font-size: var(--fs-sm); }
/* capture : cadre vertical 9:16 fixe (TikTok), aperçu recadré — jamais de paysage */
.camera-stage { position: relative; width: min(100%, calc(62dvh * 9 / 16)); aspect-ratio: 9 / 16; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
.camera-stage video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.camera-torch { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.camera-torch[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.camera-timer { position: absolute; top: 12px; left: 12px; background: rgba(0, 0, 0, 0.6); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.camera-timer.is-rec::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.camera-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 14px; }
.rec-btn { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: var(--danger); cursor: pointer; margin: 0 auto; transition: border-radius 0.2s, transform 0.1s; }
.rec-btn.is-rec { border-radius: 16px; transform: scale(0.85); }
.upload-progress { --progress: 0%; height: 8px; border-radius: 4px; background: var(--bg-3); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: var(--progress); background: var(--accent); transition: width 0.2s; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--bg-3); }
.steps span.is-done { background: var(--accent); }
.id-card { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; }
.id-card img { width: 72px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--bg-3); }
.id-alts { display: inline; }
.id-alt { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: var(--fs-xs); font-weight: 700; margin-top: 4px; }
.draft-list { display: grid; gap: 8px; }
.draft-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--bg-3); border-radius: var(--r-field); }

/* profil persona */
.interest-bars { display: grid; gap: 8px; }
.interest-bar { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.interest-bar i { display: block; height: 10px; border-radius: 5px; background: var(--bg-3); overflow: hidden; }
.interest-bar i b { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); }
.list { display: grid; gap: var(--sp-2); padding: 0; margin: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; background: var(--bg-3); border-radius: var(--r-field); font-size: var(--fs-title); line-height: var(--lh); }
.list li > span:first-child { min-width: 0; }
.list li > span:last-child:not(:first-child):not(.offer-actions) { flex: none; white-space: nowrap; text-align: right; }
/* négociation : texte puis rangée d'actions (accepter / refuser / contre-proposer) sur toute la largeur */
.list li.offer-item { display: grid; gap: var(--sp-2); align-items: start; }
.offer-item .offer-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-start; align-items: center; }
.offer-item .counter-form { display: flex; gap: var(--sp-2); flex: 1 1 100%; }
.offer-item .counter-form .input { flex: 1; min-height: var(--btn-h-sm); padding: 6px 12px; }
.list .offer-actions, .list .ship-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.offer-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--bg-3); border-radius: 12px; padding: 10px 12px; font-size: var(--fs-title); }
.offer-actions { display: flex; gap: 6px; }
.owner-panel { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + var(--safe-bottom)); width: min(100%, var(--col)); z-index: 20; background: rgba(21, 21, 28, 0.96); border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 10px; max-height: 40dvh; overflow-y: auto; }
.owner-panel h2 { margin: 0; font-size: var(--fs-md); }

/* toasts / install */
.toast-stack { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 12px); z-index: 50; display: grid; gap: 8px; width: min(92%, 420px); pointer-events: none; }
.toast { background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 600; box-shadow: var(--shadow); animation: toast-in 0.25s ease-out; }
.toast-error { border-color: var(--danger); }
.toast-ok { border-color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.install-sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 10px); width: min(94%, 460px); z-index: 45; }
.install-card { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; background: var(--bg-2); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
.install-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: var(--fs-3xl); }
.install-text { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--fg-2); }
.install-text strong { color: var(--fg); font-size: var(--fs-md); }
.install-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }

/* auth */
.auth-card { max-width: 420px; margin: 0 auto; }
.auth-switch { text-align: center; font-size: var(--fs-title); color: var(--fg-2); margin-top: 12px; }
.auth-switch a { color: var(--accent); font-weight: 700; }

@media (min-width: 720px) {
  body.feed-body { background: radial-gradient(circle at 50% 0%, #1b1b26, #07070a 60%); }
  .feed { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .topbar, .bottomnav, .drawer-panel { max-width: var(--col); left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
  .drawer-panel { transform: translate(-50%, -105%); }
  .drawer[aria-hidden="false"] .drawer-panel { transform: translate(-50%, 0); }
  .card-info { right: 84px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- agents & MCP (/me/) ---- */
.token-form { margin-top: var(--sp-1); }
.token-scopes { color: var(--fg-2); }
.list li code, .panel code { font-size: var(--fs-xs); background: var(--bg-3); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.flash { overflow-wrap: anywhere; }   /* jetons longs (alk_…) : coupure possible, mais jamais au milieu d'un mot ordinaire */

/* ---- consentement traceurs ---- */
.consent-sheet { position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 8px); z-index: 60; padding: 0 12px; }
.consent-sheet[hidden] { display: none !important; }
.consent-card { max-width: var(--col); margin: 0 auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 10px 40px rgba(0,0,0,.45); font-size: var(--fs-title); }
.consent-card p { margin: 0 0 10px; color: var(--fg-2); }
.consent-card p strong { color: var(--fg); }
.consent-actions { display: flex; gap: 8px; }
.consent-actions .btn { flex: 1; }

/* ---- accès sans mot de passe (join) ---- */
.auth-providers { display: grid; gap: 10px; margin: 16px 0; }
.btn-provider { min-height: 46px; background: var(--bg-2); border: 1px solid var(--line); color: var(--fg); font-weight: 700; justify-content: flex-start; gap: 12px; padding: 0 16px; }
.btn-provider svg { width: 22px; height: 22px; flex: none; }
.btn-provider.is-active { border-color: var(--accent); }
.auth-note { font-size: var(--fs-sm); color: var(--fg-2); margin: 6px 0 12px; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; font: inherit; cursor: pointer; }
.linklike:disabled { color: var(--fg-3); cursor: default; }
.otp-input { text-align: center; font-size: var(--fs-3xl); letter-spacing: 0.45em; font-weight: 800; }
.auth-more { margin-top: 8px; }
.auth-more summary { cursor: pointer; color: var(--fg-2); font-size: var(--fs-title); padding: 10px 0; list-style: none; text-align: center; }
.auth-more summary::-webkit-details-marker { display: none; }
.auth-more summary::before { content: "+ "; color: var(--accent); font-weight: 800; }
.auth-more[open] summary::before { content: "− "; }
.auth-more[open] summary { margin-bottom: 8px; }

/* ---- mobile : barres et icônes plus compactes (les tailles de texte viennent des jetons) ---- */
@media (max-width: 480px) {
  :root { --topbar-h: 52px; --bottomnav-h: 58px; --rail-icon: 27px; }
  svg { width: 22px; height: 22px; }
  .icon-btn { width: 38px; height: 38px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: var(--fs-md); }
  .topbar-tabs { gap: 14px; }
  .bottomnav a { padding: 5px 0; }
  .bottomnav .sell-btn { width: 48px; height: 36px; }
  .drawer-price strong { font-size: var(--fs-3xl); }
}

/* ---- feuille de paiement (bottom sheet) ---- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.25s; }
.sheet-backdrop.is-open { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92vh; overflow-y: auto; background: var(--bg-2); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 8px 16px calc(16px + var(--safe-bottom)); transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5); }
.sheet.is-open { transform: translateY(0); }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--fg-3); margin: 4px auto 12px; }
.sheet-head { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: var(--fs-lg); }
.sheet-head p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--fg-2); }
.sheet-amount { font-size: var(--fs-xl); letter-spacing: -0.02em; }
.sheet-body { display: grid; gap: var(--sp-4); }
.sheet-body .people-list { margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4); max-height: 38vh; overflow-y: auto; }
.sheet-body .person { padding: 8px 0; }
.sheet-body .person:last-child { border-bottom: 0; }
.sheet-actions { display: grid; gap: var(--sp-2); position: sticky; bottom: calc(-1 * (16px + var(--safe-bottom))); margin: 0 calc(-1 * var(--sp-4)) calc(-1 * (16px + var(--safe-bottom))); padding: var(--sp-3) var(--sp-4) calc(16px + var(--safe-bottom)); background: var(--bg-2); border-top: 1px solid var(--line); }
body.sheet-open { overflow: hidden; }
.field-label { font-size: var(--fs-sm); font-weight: 700; color: var(--fg-2); margin: 0 0 6px; }
.card-list { display: grid; gap: 8px; }
.card-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-3); border-radius: 12px; font-size: var(--fs-title); }
.card-row input { accent-color: var(--accent); }
.card-brand { text-transform: capitalize; font-weight: 700; }
.card-num { flex: 1; letter-spacing: 0.08em; }
.card-exp { color: var(--fg-3); font-size: var(--fs-xs); }
.card-row .linklike { font-size: var(--fs-sm); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); color: var(--fg-2); margin-top: 10px; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; margin-top: 1px; }
.sheet-done { text-align: center; padding: 20px 0; }
.done-mark { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: var(--fs-4xl); font-weight: 900; }

/* ---- vérification vendeur ---- */
.verify-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.verify-steps li { display: flex; gap: 12px; align-items: flex-start; }
.verify-steps li > div { display: grid; gap: 6px; }
.verify-steps li > div .btn { justify-self: start; background: var(--bg-3); border: 1px solid var(--line); color: var(--fg); }
.verify-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-3); color: var(--fg-2); display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); }
.verify-steps li.is-done .verify-mark { background: var(--accent); color: var(--accent-ink); }
.verify-panel #sms-form { margin-top: 8px; }

/* ---- ventes / achats (expéditions) ---- */
.ship-list { display: grid; gap: 10px; }
.ship-card { margin-bottom: 0; }
.ship-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.ship-form { display: grid; gap: 8px; margin-top: 8px; }
.ship-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-title); }
.ship-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* --- remise en main propre / vente sur place --- */
.handover-code { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 16px; margin: 8px 0; border-radius: 14px; background: var(--bg-3); border: 1px dashed var(--accent); }
.handover-code strong { font-size: var(--fs-4xl); letter-spacing: 0.18em; font-variant-numeric: tabular-nums; color: var(--accent); }
.handover-code span { font-size: var(--fs-xs); color: var(--fg-2); }
.handover-inline { flex-direction: row; gap: 10px; padding: 6px 12px; margin: 4px 0; width: 100%; justify-content: center; }
.handover-inline strong { font-size: var(--fs-2xl); }
.input-code { font-size: var(--fs-3xl); letter-spacing: 0.2em; text-align: center; font-variant-numeric: tabular-nums; }
.direct-entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-top: 14px; }
.direct-entry .muted { font-size: var(--fs-sm); }
.direct-arrow { font-size: var(--fs-3xl); color: var(--fg-3); }
.qr-panel { text-align: center; }
.qr-img { display: block; width: min(240px, 70vw); height: auto; margin: 0 auto 12px; background: #fff; padding: 10px; border-radius: 14px; }
.pay-here { text-align: center; padding-top: 20px; }
.pay-here h1 { font-size: var(--fs-2xl); margin: 6px 0; }
.pay-here-poster { width: min(220px, 60vw); border-radius: 14px; margin: 0 auto 10px; display: block; }
.pay-here-price { font-size: var(--fs-4xl); font-weight: 900; letter-spacing: -0.02em; margin: 4px 0 16px; }
.btn-lg { padding: 16px; font-size: var(--fs-lg); }
#checkout-delivery .seg[hidden] { display: none; }

/* --- infos dans le tiroir, récapitulatif de la feuille --- */
.drawer-info { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.drawer-info summary { cursor: pointer; font-weight: 700; padding: 8px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.drawer-info summary::after { content: "+"; font-size: var(--fs-xl); color: var(--fg-3); }
.drawer-info[open] summary::after { content: "–"; }
.drawer-info summary::-webkit-details-marker { display: none; }
.info-list { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; margin: 4px 0 8px; font-size: var(--fs-title); }
.info-list dt { color: var(--fg-2); }
.info-list dd { margin: 0; }
.checkout-summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; padding: 10px 12px; background: var(--bg-3); border-radius: 12px; font-size: var(--fs-title); }
.checkout-summary dt { color: var(--fg-2); }
.checkout-summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.checkout-summary .total { font-weight: 800; color: var(--fg); border-top: 1px solid var(--line); padding-top: 6px; }

/* --- questions au vendeur, messages, avis, stand --- */
.ask-form { display: none; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ask-form.is-open { display: grid; }
.ask-form textarea { resize: vertical; min-height: 72px; }
.conv-list { display: grid; gap: 10px; }
.conv { margin-bottom: 0; }
.conv summary { list-style: none; cursor: pointer; display: grid; gap: 4px; }
.conv summary::-webkit-details-marker { display: none; }
.conv-head { font-size: var(--fs-title); }
.conv-last { font-size: var(--fs-sm); }
.conv-messages { display: grid; gap: 8px; margin: 12px 0; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--bg-3); font-size: var(--fs-title); }
.msg p { margin: 0; white-space: pre-wrap; }
.msg time { display: block; font-size: var(--fs-2xs); color: var(--fg-3); margin-top: 2px; }
.msg-mine { margin-left: auto; background: var(--accent-soft); border-radius: 14px 14px 4px 14px; }
.conv-reply { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.stand-list { display: grid; gap: 10px; }
.stand-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: inherit; margin-bottom: 0; }
.stand-item img, .stand-thumb { width: 56px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--bg-3); display: grid; place-items: center; font-size: var(--fs-3xl); }
.stand-text { display: grid; gap: 2px; font-size: var(--fs-title); }
.stand-price { text-align: right; font-weight: 800; font-size: var(--fs-lg); display: grid; }
.stand-price small { font-size: var(--fs-2xs); font-weight: 600; color: var(--accent); }
.direct-stand { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.qr-small { width: 120px; margin: 0; padding: 6px; }

/* --- identité mobile --- */
.auth-mobile #sms-phone { font-size: var(--fs-2xl); letter-spacing: 0.04em; padding: 14px; }
.auth-mobile .otp-input { font-size: var(--fs-4xl); letter-spacing: 0.35em; text-align: center; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--fg-3); font-size: var(--fs-sm); margin: 14px 0 8px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sms-turnstile { margin: 10px 0; min-height: 65px; }
.counter-form { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; }
.counter-form .input { width: 120px; min-height: 36px; padding: 0 10px; }
.negotiation { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.negotiation .offer-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nearby-form { display: flex; gap: 8px; }
.nearby-form .input { flex: 1; min-height: 44px; }
.nearby-head .pill.is-active { background: var(--accent); color: var(--accent-ink); }
.auth-switch form.inline { display: inline; }
.stand-item.is-multi { cursor: pointer; }
.stand-item.is-multi .stand-check { display: inline-block; width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin-right: 8px; }
.stand-item.is-picked { outline: 2px solid var(--accent); }
.stand-cashier { position: sticky; top: 56px; z-index: 5; }

/* ---- apparence : choix du thème (réglages de /me/) ---- */
.theme-seg { display: flex; gap: 6px; }
.theme-seg button { flex: 1; min-height: 36px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--bg-3); color: var(--fg-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer; }
.theme-seg button.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---- Roue Alkane (sprint 18) : tambour vertical façon sélecteur iOS, un ticket QR = un tour ---- */
.wheel-page { --picker-h: 300px; --picker-item-h: 92px; --picker-radius: 190px; --picker-perspective: 900px; display: grid; gap: var(--sp-4); }
.wheel-head { display: grid; gap: 4px; text-align: center; }
.wheel-kicker { margin: 0; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.wheel-title { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.wheel-sub, .wheel-scope { margin: 0; font-size: var(--fs-sm); }
.wheel-scope { color: var(--fg-2); }
.picker { position: relative; height: var(--picker-h); perspective: var(--picker-perspective); perspective-origin: 50% 50%; touch-action: pan-x; user-select: none; -webkit-user-select: none; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.picker-frame { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.picker-fade { position: absolute; left: 0; right: 0; height: 34%; }
.picker-fade-top { top: 0; background: linear-gradient(to bottom, var(--bg-2), transparent); }
.picker-fade-bottom { bottom: 0; background: linear-gradient(to top, var(--bg-2), transparent); }
.picker-highlight { position: absolute; left: 8px; right: 8px; top: 50%; height: calc(var(--picker-item-h) + 8px); transform: translateY(-50%); border: 2px solid var(--accent); border-radius: var(--radius); box-shadow: 0 0 24px var(--accent-soft), inset 0 0 24px var(--accent-soft); }
.picker-drum { position: absolute; left: 0; right: 0; top: 50%; height: 0; transform-style: preserve-3d; cursor: grab; }
.picker-drum:active { cursor: grabbing; }
.picker-item { --y: 0px; --z: 0px; --rx: 0deg; position: absolute; left: 50%; top: 0; width: calc(100% - 32px); height: var(--picker-item-h); margin-top: calc(var(--picker-item-h) / -2); transform: translate3d(-50%, var(--y), var(--z)) rotateX(var(--rx)); backface-visibility: hidden; transition: opacity 0.2s ease; opacity: 0.45; }
.picker-item.is-near { opacity: 0.8; }
.picker-item.is-selected { opacity: 1; }
.picker-item.is-back { opacity: 0; }
.prize-card { display: grid; align-content: center; justify-items: center; gap: 2px; height: 100%; border-radius: var(--radius-sm); background: var(--bg-3); border: 1px solid var(--line); transition: transform 0.2s ease, background 0.2s ease; }
.picker-item.is-selected .prize-card { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: scale(1.02); }
.prize-amount { font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: -0.02em; }
.prize-cond { font-size: var(--fs-sm); font-weight: var(--fw-semibold); opacity: 0.85; }
.wheel-actions { display: grid; gap: var(--sp-3); }
.prize-result { justify-items: center; text-align: center; }
.prize-result.is-won { animation: prize-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.prize-result .prize-amount { color: var(--accent); }
.voucher-code { margin: 0; font-size: var(--fs-sm); color: var(--fg-2); }
.voucher-code strong { color: var(--fg); letter-spacing: 0.06em; }
@keyframes prize-pop { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.vouchers { display: grid; gap: var(--sp-2); }
.voucher { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.voucher-amount { display: grid; place-items: center; min-width: 64px; min-height: 48px; padding: 0 var(--sp-2); border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.voucher.is-off .voucher-amount { background: var(--bg-3); color: var(--fg-3); }
.voucher-text { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-sm); }
.voucher-text strong { font-size: var(--fs-title); }
.voucher-text .muted { font-size: var(--fs-xs); }

/* Roue Alkane — lot 2 : cartes « Pas de chance », tours offerts */
.picker-item.is-lose .prize-card { background: var(--ghost-bg); border-color: var(--line); }
.picker-item.is-lose .prize-amount { color: var(--fg-2); }
.picker-item.is-lose.is-selected .prize-card { background: var(--bg-2); border-color: var(--fg-3); box-shadow: none; }
.picker-item.is-lose.is-selected .prize-amount, .picker-item.is-lose.is-selected .prize-cond { color: var(--fg); }
.voucher-spin { text-decoration: none; color: inherit; }
.voucher-amount-spin { background: var(--accent-soft); color: var(--accent); font-size: var(--fs-3xl); }
