:root {
  /* ═══ Jetons de THEME ═══ Valeurs par defaut = theme SOMBRE historique.
     Surchargees plus bas par html[data-theme="clair" | "sepia" | ...]. Le picker
     (Reglages > Mon profil) pose data-theme sur <html>. L'ACCENT est un axe a
     part (surcharge par utilisateur, cf base.html). Ces definitions utilisent des
     formats compacts (#1F1D1D majuscule, rgba(255,255,255,.08) sans espaces) pour
     ne PAS etre attrapees par les remplacements globaux du corps de la feuille.
     Doc : docs/architecture/user_theme.md. */
  --bg: #141313;
  --panel: #1F1D1D;               /* surface carte/panneau par defaut */
  --surface-2: #262121;           /* surfaces surelevees : menu, popovers, panneaux FAB */
  --surface-inset: #171313;       /* creux : champs, puits, listes internes */
  --topbar-bg: rgba(20,19,19,.9); /* barre du haut (translucide) */
  --overlay: rgba(0,0,0,.38);     /* voile des modales / menu */
  --text: #F4ECE7;
  --text-strong: #FFFFFF;
  --muted: #B6AAA3;
  --muted-2: #8A8079;             /* texte tertiaire, encore plus discret */
  --line: rgba(255,255,255,.08);  /* filet de bordure */
  --line-2: rgba(255,255,255,.14);/* bordure plus marquee */
  --hover: rgba(255,255,255,.06); /* fond de survol subtil */
  --hover-2: rgba(255,255,255,.04);/* fond sureleve tres subtil */
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
  --on-accent: #171110;           /* texte pose SUR une couleur d'accent (constant) */
  --native-scheme: dark;          /* color-scheme des widgets natifs (icone du picker date/heure) */
  /* Alias historiques utilises par certains templates (settings_home...) : pointent
     sur les jetons de theme -> se mettent a jour tout seuls a chaque changement de
     theme (la substitution var() se resout a l'usage, avec le --line/--muted du theme). */
  --border: var(--line);
  --text-muted: var(--muted);
  --inset: var(--surface-inset);
  /* ═══ Accent (axe INDEPENDANT du theme, surcharge par utilisateur) ═══ */
  --accent: #df8f78;
  --accent-strong: #f2b36a;
  --accent-soft: rgba(223, 143, 120, 0.16);
  /* ═══ Invariants ═══ */
  --ink-blue: #8aa8bf;
  /* Couleur de MARQUE du mot-symbole EvoMarket (le « Evo » bicolore, 31/07) :
     le cyan des couches du logo. Volontairement INDEPENDANTE de --accent (qui est
     choisi par chaque utilisateur) : une marque ne change pas de couleur selon
     l'utilisateur. Surchargee plus bas sur les themes CLAIRS (clair, sepia,
     aurore), ou ce cyan baverait sur le blanc -> cyan plus profond. */
  --brand-mark: #22D3EE;
  /* Rouge/vert semantiques « vifs » (decision Philippe vague 3, 15/07) :
     UNIQUES couleurs succes/danger de l'app — plus de --red/--green locaux
     par page. Les fonds teintes doivent rester doux (color-mix / alpha). */
  --success: #3dbd7d;
  --warning: #ffd27f;
  --danger: #ff5b52;
  /* Liseré de la bulle Prix du picking (report #404 choix C, puis report #410 :
     Achille trouvait le lime « presque fluo » moche -> vert emeraude). Sert a
     CERCLER une valeur qui doit sauter aux yeux. Jeton de SIGNAL, pas une couleur
     de texte. Surcharge plus bas sur les themes CLAIRS (clair, sepia, aurore) ou
     un vert trop clair baverait sur le blanc -> emeraude plus profond. */
  --price-ring: #2fbf71;
  /* Liseré de la bulle NET du picking, onglet Caisse (demande Philippe 20/07) :
     BLEU pour ne pas confondre avec le vert du Prix. Meme logique que
     --price-ring : jeton de SIGNAL, surcharge sur les themes clairs. */
  --net-ring: #4396e6;
  /* Pastille quantite x2/x3 du picking (demande Philippe 20/07) : JAUNE FLUO
     qui claque, dans l'encart de la carte (remplace l'ancien filigrane geant
     noye derriere les boutons). --qty-fluo-ink = texte pose dessus (constant :
     le fond reste jaune sur tous les themes). Surcharge themes clairs. */
  --qty-fluo: #ffe135;
  --qty-fluo-ink: #241b03;
  --ink-teal: #5cc3ba;   /* 6e couleur de menu : partagee par TOUS les autres onglets (demande Philippe 2026-07-08) */
  --radius: 22px;
  /* Echelle de rayons officielle (vague 3) : 4 tailles, a utiliser pour tout
     nouveau composant au lieu de valeurs en dur. */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --mobile-overlay-stack-height: 0px;
}

/* ── Theme CLAIR ── fond clair, texte sombre, bordures noires translucides ── */
html[data-theme="clair"] {
  --bg: #eae4dd;
  --panel: #ffffff;
  --surface-2: #ffffff;
  --surface-inset: #f1ebe4;
  --topbar-bg: rgba(249,246,242,.9);
  --overlay: rgba(30,22,18,.28);
  --text: #2b2420;
  --text-strong: #17110f;
  --muted: #6f645d;
  --muted-2: #948a82;
  --line: rgba(0,0,0,.10);
  --line-2: rgba(0,0,0,.16);
  --hover: rgba(0,0,0,.05);
  --hover-2: rgba(0,0,0,.035);
  --shadow: 0 18px 40px rgba(60, 45, 30, 0.16);
  --native-scheme: light;
  --brand-mark: #0d8ea6;
  --price-ring: #1f9d57;
  --net-ring: #1e6fc4;
  --qty-fluo: #f5c400;
}

/* ── Theme SEPIA doux ── papier chaud ── */
html[data-theme="sepia"] {
  --bg: #e9dfcc;
  --panel: #fbf5ea;
  --surface-2: #fbf5ea;
  --surface-inset: #f1e8d6;
  --topbar-bg: rgba(251,245,234,.9);
  --overlay: rgba(50,38,20,.30);
  --text: #3a3025;
  --text-strong: #241d14;
  --muted: #7c6f5b;
  --muted-2: #9a8d78;
  --line: rgba(80,60,30,.14);
  --line-2: rgba(80,60,30,.22);
  --hover: rgba(80,60,30,.06);
  --hover-2: rgba(80,60,30,.04);
  --shadow: 0 18px 40px rgba(90, 70, 40, 0.16);
  --native-scheme: light;
  --brand-mark: #0d8ea6;
  --price-ring: #1c8f50;
  --net-ring: #1a66b5;
  --qty-fluo: #f5c400;
}

/* ── Theme NUIT BLEUE ── sombre bleute ── */
html[data-theme="nuit-bleue"] {
  --bg: #101623;
  --panel: #1a2233;
  --surface-2: #212c40;
  --surface-inset: #131b2b;
  --topbar-bg: rgba(16,22,35,.9);
  --overlay: rgba(0,0,0,.45);
  --text: #e9eef8;
  --text-strong: #ffffff;
  --muted: #9aa8c0;
  --muted-2: #74839c;
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.15);
  --hover: rgba(255,255,255,.06);
  --hover-2: rgba(255,255,255,.04);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* ── Theme GRIS ARDOISE ── sombre neutre ── */
html[data-theme="ardoise"] {
  --bg: #16181c;
  --panel: #212429;
  --surface-2: #282c32;
  --surface-inset: #191c20;
  --topbar-bg: rgba(22,24,28,.9);
  --overlay: rgba(0,0,0,.42);
  --text: #eceef1;
  --text-strong: #ffffff;
  --muted: #a1a7b0;
  --muted-2: #7b818b;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --hover: rgba(255,255,255,.06);
  --hover-2: rgba(255,255,255,.04);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.32);
}

/* ── Theme NUIT VIOLETTE ── sombre violet ── */
html[data-theme="nuit-violette"] {
  --bg: #17131f;
  --panel: #221b2e;
  --surface-2: #2b2340;
  --surface-inset: #1a1526;
  --topbar-bg: rgba(23,19,31,.9);
  --overlay: rgba(0,0,0,.45);
  --text: #ece7f5;
  --text-strong: #ffffff;
  --muted: #a99ec0;
  --muted-2: #7f7599;
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.15);
  --hover: rgba(255,255,255,.06);
  --hover-2: rgba(255,255,255,.04);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* ── Theme FORET ── sombre vert ── */
html[data-theme="foret"] {
  --bg: #121a15;
  --panel: #1a251d;
  --surface-2: #223028;
  --surface-inset: #14201a;
  --topbar-bg: rgba(18,26,21,.9);
  --overlay: rgba(0,0,0,.42);
  --text: #e7f0e9;
  --text-strong: #ffffff;
  --muted: #9db3a5;
  --muted-2: #71877a;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --hover: rgba(255,255,255,.06);
  --hover-2: rgba(255,255,255,.04);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.34);
}

/* ── Theme AURORE ── clair rose poudre ── */
html[data-theme="aurore"] {
  --bg: #f3e7e6;
  --panel: #ffffff;
  --surface-2: #ffffff;
  --surface-inset: #f7ecec;
  --topbar-bg: rgba(250,244,244,.9);
  --overlay: rgba(40,20,26,.26);
  --text: #2e2226;
  --text-strong: #1c1013;
  --muted: #77626a;
  --muted-2: #9c8890;
  --line: rgba(60,0,20,.10);
  --line-2: rgba(60,0,20,.16);
  --hover: rgba(60,0,20,.05);
  --hover-2: rgba(60,0,20,.035);
  --shadow: 0 18px 40px rgba(80, 40, 55, 0.16);
  --native-scheme: light;
  --brand-mark: #0d8ea6;
  --price-ring: #1f9d57;
  --net-ring: #1e6fc4;
  --qty-fluo: #f5c400;
}

/* ── Theme CONTRASTE ── noir profond, contraste eleve (accessibilite) ── */
html[data-theme="contraste"] {
  --bg: #000000;
  --panel: #0d0d0d;
  --surface-2: #161616;
  --surface-inset: #0a0a0a;
  --topbar-bg: rgba(0,0,0,.92);
  --overlay: rgba(0,0,0,.6);
  --text: #ffffff;
  --text-strong: #ffffff;
  --muted: #c8c8c8;
  --muted-2: #9a9a9a;
  --line: rgba(255,255,255,.18);
  --line-2: rgba(255,255,255,.30);
  --hover: rgba(255,255,255,.10);
  --hover-2: rgba(255,255,255,.06);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Champs date/heure : l'icone native du picker (webkit) suit le theme via
   --native-scheme, sinon elle reste sombre -> invisible sur champ sombre. */
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
  color-scheme: var(--native-scheme);
}

* {
  box-sizing: border-box;
}

/* ── event ripple ── */
.event-ripple {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0.45;
  animation: ripple-expand 1.4s ease-out forwards;
}
@keyframes ripple-expand {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 0.45; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
  overscroll-behavior-y: auto;
  /* decalage-menu-0708 : reserve EN PERMANENCE la gouttiere de l'ascenseur vertical.
     Sinon, ouvrir le menu en grand ecran verrouille le scroll (body.menu-open-mobile
     -> overflow:hidden), l'ascenseur (~15px) disparait, la page s'elargit d'autant et
     le contenu pleine largeur (l'accueil .hm surtout) se recadre vers la DROITE ; comme
     overflow-x est masque, le bord droit est rogne = infos perdues. Avec la gouttiere
     reservee, verrouiller le scroll ne change plus la largeur -> zero decalage, partout. */
  scrollbar-gutter: stable;
  /* Note: scroll-padding-bottom retire volontairement. Sur iOS, il provoquait
     un re-scroll du caret a chaque touche dans un textarea jusqu'a ce que le
     champ soit tout en haut. Android/PC non affectes. */
}

html.menu-open-mobile,
body.menu-open-mobile {
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: auto;
  -webkit-text-size-adjust: 100%;
  /* Degrade anime = jetons du theme (pas de hex sombre fige) : subtil scintillement
     dans la famille du fond, sombre en theme sombre ET clair en theme clair.
     Avant : #1a1412/#201714 en dur -> bande sombre au centre de la page en clair. */
  background:
    linear-gradient(160deg, var(--bg) 0%, var(--surface-inset) 30%, var(--surface-2) 50%, var(--surface-inset) 70%, var(--bg) 100%);
  background-size: 300% 300%;
  background-attachment: fixed;
  animation: bg-shift 16s ease-in-out infinite;
  color: var(--text);
  /* Police unique EMBARQUEE (decision Philippe vague 3, 15/07) : Inter
     self-host (fonte variable, @font-face plus bas) -> rendu identique sur
     tous les appareils. Avant : Bahnschrift, qui n'existe que sur Windows
     (Mac/mobile retombaient sur une autre police sans qu'on l'ait choisi). */
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* Inter — self-host, fonte variable 100→900 (latin + latin-ext pour les
   accents). Fichiers commites dans static/fonts/, zero dependance CDN. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0;
}

@keyframes bg-shift {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

@media (max-width: 768px) {
  body { animation-duration: 8s; }
}

body.menu-open-mobile {
  overflow: hidden;
}

body.menu-open-mobile .app-shell {
  overflow: hidden;
}

body.mobile-side-drawer-open {
  overflow: hidden;
}

body.mobile-side-drawer-open .app-shell {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Liste deroulante NATIVE : fond opaque sombre + texte clair PARTOUT. L'app est en
   theme sombre ; sans ca, le popup d'options d'un <select> sort en blanc-sur-blanc
   (defaut navigateur), illisible. Regle globale -> vaut pour tous les menus
   deroulants de l'app (un style plus specifique reste prioritaire si besoin). */
select option,
select optgroup {
  background-color: var(--panel, var(--panel));
  color: var(--text, var(--text));
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 28px;
}

@supports (min-height: 100dvh) {
  body,
  .app-shell {
    min-height: 100dvh;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-inline {
  min-width: 0;
}

/* ── Entête « identité » de la topbar sur TOUTES les pages (entete-identite-0712) ──
   Demande Philippe 2026-07-12 : chaque page (hors accueil et landing) remplace le
   logo « Achflow » par le même entête que l'accueil — bouton MAISON + grosse pastille
   avatar « Mon activité » + prénom + date/heure vivante. Rendu côté serveur dans
   base.html (bloc `_show_identity` → classe `.topbar.has-identity`), popover + horloge
   pilotés par static/topbar-identity.js.
   ⚠️ TOUT est scopé `.topbar.has-identity` : l'ACCUEIL fait son propre hoist JS depuis
   home.html (SANS cette classe, avec son <style> inline et la palette `.hm` --c-*) →
   il n'est PAS touché par ces règles. Ici on est HORS de la palette `.hm`, donc on
   n'emploie QUE des jetons globaux (--panel / --text / --muted / --line / --accent). */
.topbar.has-identity .brand-inline { display: none !important; } /* logo + « Achflow » retirés */
.topbar.has-identity .hm-topbar-home {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 13px; flex: 0 0 auto; text-decoration: none;
  border: 1px solid var(--line); background: var(--hover-2); color: var(--muted);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.topbar.has-identity .hm-topbar-home i { font-size: 27px; line-height: 1; }
.topbar.has-identity .hm-topbar-home:hover {
  color: var(--accent); background: var(--accent-soft, var(--hover-2)); border-color: var(--accent);
}
/* logo-topbar-0716 (demande Philippe 2026-07-16) : LOGO de la boutique centré dans la
   barre du haut de toutes les pages, cliquable -> /accueil. Pendant de .hmg-wall-logo
   (l'accueil, home.html) : même geste, mêmes proportions, mais avec les jetons GLOBAUX
   (on est hors de la palette `.hm`). Le centrage est ABSOLU -> le logo ne pousse ni la
   hauteur ni les deux colonnes de la barre (.topbar est sticky = déjà positionné).
   ⚠️ Un élément absolu passe AU-DESSUS des boutons : d'où le max-width serré, et le
   repli en flux normal sous 1024px (barre trop étroite = chevauchement garanti). */
.topbar.has-identity .topbar-shop {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; max-width: min(30%, 260px);
  padding: 2px 8px; border-radius: 10px; text-decoration: none; color: var(--text);
  transition: background .12s ease;
}
.topbar.has-identity .topbar-shop:hover { background: var(--hover-2); }
.topbar.has-identity .topbar-shop img {
  height: 40px; max-height: 40px; width: auto; max-width: 100%; object-fit: contain; display: block;
}
/* Repli sans logo sur la fiche boutique : le NOM écrit (même règle que l'accueil). */
.topbar.has-identity .topbar-shop-name {
  font-size: 17px; font-weight: 800; letter-spacing: .02em; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Écran étroit (petit portable, tablette, téléphone) : le logo QUITTE le centrage absolu
   et redevient un élément du flux, plus compact -> il pousse au lieu de recouvrir, et la
   cloche / l'assistant / les toggles restent atteignables. Il reste visible (branding) et
   cliquable, comme sur l'accueil en mobile. */
@media (max-width: 1024px) {
  .topbar.has-identity .topbar-shop {
    position: static; transform: none; max-width: 150px; flex: 0 1 auto; min-width: 0;
  }
  .topbar.has-identity .topbar-shop img { height: 30px; max-height: 30px; }
  .topbar.has-identity .topbar-shop-name { font-size: 15px; }
}
.topbar.has-identity .hm-me { position: relative; flex: 0 0 auto; display: flex; margin: 0; }
.topbar.has-identity .hm-me-btn {
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; line-height: 0;
}
.topbar.has-identity .hm-me-av {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; overflow: hidden; font-size: 17px; font-weight: 700; color: #fff;
  background: var(--accent); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line-2), 0 2px 8px rgba(0, 0, 0, .22);
  transition: transform .14s ease, box-shadow .14s ease;
}
.topbar.has-identity .hm-me-btn:hover .hm-me-av,
.topbar.has-identity .hm-me-btn[aria-expanded="true"] .hm-me-av {
  transform: translateY(-1px); box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(0, 0, 0, .28);
}
.topbar.has-identity .hm-hello-txt {
  display: inline-flex; align-items: baseline; gap: 9px; margin: 0; min-width: 0;
}
.topbar.has-identity .hm-hello-name { font-size: 18px; font-weight: 800; color: var(--text); white-space: nowrap; }
.topbar.has-identity .hm-hello-date { font-size: 15.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
/* Popover « Mon activité » : position:absolute sous la pastille (jamais un <dialog> /
   top-layer, qui masquerait les modales ; absolute reste correct malgré le
   backdrop-filter de .topbar car ancré sur .hm-me en position:relative). */
:is(.topbar.has-identity, .menu-header) .hm-me-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 120; width: 304px;
  max-width: calc(100vw - 24px); background: var(--panel); color: var(--text);
  border: .5px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .34); overflow: hidden; text-align: left;
}
:is(.topbar.has-identity, .menu-header) .hm-me-pop[hidden] { display: none; }
:is(.topbar.has-identity, .menu-header) .hm-me-pop-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 8px 11px 14px; border-bottom: .5px solid var(--line-2);
}
:is(.topbar.has-identity, .menu-header) .hm-me-pop-hd strong { font-size: 14px; }
:is(.topbar.has-identity, .menu-header) .hm-me-pop-x {
  width: 30px; height: 30px; border: 0; background: none; color: var(--muted); font-size: 22px;
  line-height: 1; cursor: pointer; border-radius: 50%;
}
:is(.topbar.has-identity, .menu-header) .hm-me-pop-x:hover { background: var(--hover-2); color: var(--text); }
.topbar.has-identity .hm-me-body { padding: 12px; }
:is(.topbar.has-identity, .menu-header) .hm-me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
:is(.topbar.has-identity, .menu-header) .hm-me-stat {
  background: var(--hover-2); border: .5px solid var(--line); border-radius: 11px;
  padding: 9px 8px; text-align: center;
}
:is(.topbar.has-identity, .menu-header) .hm-me-stat > i { font-size: 15px; color: var(--accent); display: block; margin-bottom: 2px; }
:is(.topbar.has-identity, .menu-header) .hm-me-stat strong { display: block; font-size: 19px; font-weight: 700; line-height: 1.1; color: var(--text); }
:is(.topbar.has-identity, .menu-header) .hm-me-stat span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.2; }
:is(.topbar.has-identity, .menu-header) .hm-me-stat em { display: block; font-size: 10.5px; font-style: normal; font-weight: 600; color: var(--accent); margin-top: 2px; }
:is(.topbar.has-identity, .menu-header) .hm-me-stat em:empty { display: none; }
:is(.topbar.has-identity, .menu-header) .hm-me-link {
  display: block; text-align: center; margin-top: 11px; font-size: 12.5px; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
:is(.topbar.has-identity, .menu-header) .hm-me-link:hover { text-decoration: underline; }
/* menu-avatar-compte (2026-07-15, demande Philippe) : le popover de l'avatar est
   devenu un MENU compte (en-tête + bascule boutique + Changer de compte + Mon activité
   + Se déconnecter). Réutilise .hm-me-pop (conteneur) ; ces règles habillent le reste.
   Jetons GLOBAUX ici (pages hors accueil) ; l'accueil a les mêmes styles en --c-* dans
   home.html. Mêmes classes, un seul markup partagé : _account_menu.html. */
:is(.topbar.has-identity, .menu-header) .hm-acct-pop { overflow-y: auto; max-height: min(560px, calc(100vh - 84px)); }
:is(.topbar.has-identity, .menu-header) .hm-acct-hd {
  display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px;
  border-bottom: .5px solid var(--line-2);
}
:is(.topbar.has-identity, .menu-header) .hm-acct-hd-av {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid;
  place-items: center; font-size: .9rem; font-weight: 700; color: #fff;
  background: var(--accent); overflow: hidden;
}
:is(.topbar.has-identity, .menu-header) .hm-acct-hd-id { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
:is(.topbar.has-identity, .menu-header) .hm-acct-hd-id strong { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.topbar.has-identity, .menu-header) .hm-acct-hd-id span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.topbar.has-identity, .menu-header) .hm-acct-seg {
  display: flex; gap: 6px; padding: 10px 12px; border-bottom: .5px solid var(--line-2);
}
:is(.topbar.has-identity, .menu-header) .hm-acct-seg-btn {
  flex: 1 1 0; min-width: 0; padding: 9px 6px; border: .5px solid var(--line-2);
  background: var(--hover-2); color: var(--muted); border-radius: 10px; font-size: 12.5px;
  font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: background .12s, color .12s, border-color .12s;
}
:is(.topbar.has-identity, .menu-header) .hm-acct-seg-btn:hover { color: var(--text); background: var(--hover); }
:is(.topbar.has-identity, .menu-header) .hm-acct-seg-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
:is(.topbar.has-identity, .menu-header) .hm-acct-menu { padding: 6px; }
:is(.topbar.has-identity, .menu-header) .hm-acct-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px;
  border: 0; background: none; color: var(--text); font-size: 13.5px; font-family: inherit;
  text-align: left; cursor: pointer; border-radius: 10px; list-style: none;
}
:is(.topbar.has-identity, .menu-header) .hm-acct-row::-webkit-details-marker { display: none; }
:is(.topbar.has-identity, .menu-header) .hm-acct-row:hover { background: var(--hover-2); }
:is(.topbar.has-identity, .menu-header) .hm-acct-row-ic { font-size: 18px; color: var(--muted); flex: 0 0 auto; }
:is(.topbar.has-identity, .menu-header) .hm-acct-row > span { flex: 1 1 auto; }
:is(.topbar.has-identity, .menu-header) .hm-acct-chev { font-size: 15px; color: var(--muted-2); flex: 0 0 auto; transition: transform .15s; }
:is(.topbar.has-identity, .menu-header) .hm-acct-exp[open] > .hm-acct-row .hm-acct-chev { transform: rotate(180deg); }
:is(.topbar.has-identity, .menu-header) .hm-acct-exp-body { padding: 4px 6px 8px; }
:is(.topbar.has-identity, .menu-header) .hm-acct-out { padding: 6px; border-top: .5px solid var(--line-2); }
:is(.topbar.has-identity, .menu-header) .hm-acct-danger { color: var(--danger); }
:is(.topbar.has-identity, .menu-header) .hm-acct-danger .hm-acct-row-ic { color: var(--danger); }
:is(.topbar.has-identity, .menu-header) .hm-acct-danger:hover { background: var(--accent-soft); }
/* ticket 414 : le MÊME menu compte, ouvert DANS le volet ☰ (photo du menu). Tous
   les styles ci-dessus sont partagés avec la topbar via :is(...). Ici on ne (re)fait
   que l'ANCRAGE propre au volet : popover ancré sur .menu-header (déjà position:relative),
   pleine largeur du volet au lieu des 304px de la topbar, au-dessus des liens du menu. */
.menu-panel .menu-header .hm-me-pop {
  left: 0; right: 0; width: auto; max-width: none;
}
/* ticket 414 (retour Achille) : le segment « changer de magasin » réutilisé dans le
   popover de la pastille dédiée — on enlève le liseré/padding du .hm-acct-seg (pensé
   pour l'en-tête du menu compte) et on autorise le retour à la ligne si >2 magasins. */
.menu-header-pop-panel .menu-shop-seg { padding: 0; border: 0; flex-wrap: wrap; }
.menu-header-pop-panel .menu-shop-seg .hm-acct-seg-btn { flex: 1 1 46%; }
/* Petit écran : garder maison + avatar, masquer prénom/date pour ne pas déborder
   (la cloche de notifs et les toggles doivent rester atteignables). */
@media (max-width: 640px) {
  .topbar.has-identity .hm-hello-txt { display: none; }
}

/* Pastille « En ligne » du bandeau du haut : coéquipiers actifs (<10 min) avec
   avatar + prénom, juste à droite du logo, sur TOUTES les pages (avant : accueil
   uniquement). Markup dans base.html (#topbar-online), remplie par
   static/presence-header.js (GET /presence/online, lecture seule). */
.topbar-online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  min-width: 0;
}

.topbar-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success, #35b57d);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success, #35b57d) 20%, transparent);
  flex: 0 0 auto;
}

.topbar-online-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--success, #35b57d);
  white-space: nowrap;
}

.topbar-online-people {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.topbar-online-p {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.topbar-online-p:hover .topbar-online-name {
  text-decoration: underline;
}

.topbar-online-av {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  flex: 0 0 auto;
}

.topbar-online-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-online-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-online-more {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.topbar-online-more:hover,
.topbar-online-more:focus-visible {
  color: var(--text);
}

/* Popover du « +N » : liste les coéquipiers en ligne NON affichés en puce, chacun
   cliquable pour lui écrire (survol PC / clic mobile). Hoisté sur <body> par
   presence-header.js (la topbar a un backdrop-filter qui piégerait un position:fixed).
   Jetons de thème uniquement (hors palette .hm). */
.topbar-online-pop {
  position: fixed;
  z-index: 3000;
  min-width: 200px;
  max-width: 280px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.topbar-online-pop[hidden] { display: none; }
.topbar-online-pop-hd {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  padding: 4px 8px 6px;
}
.topbar-online-poprow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.topbar-online-poprow:hover,
.topbar-online-poprow:focus-visible {
  background: var(--hover-2);
}
.topbar-online-popname {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-online-pop-all {
  display: block;
  margin-top: 4px;
  padding: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  text-align: center;
}
.topbar-online-pop-all:hover { text-decoration: underline; }

/* Écrans étroits : on garde l'essentiel — le libellé saute d'abord, puis les
   prénoms (avatars seuls) pour ne pas écraser le logo ni le bouton menu. */
@media (max-width: 900px) {
  .topbar-online-lbl {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar-online {
    padding: 4px 9px;
    gap: 6px;
    /* #226 : la pastille garde sa taille (compacte) au lieu de se faire ecraser
       par le logo -> plus de collision avatars <-> « Achflow » sur mobile. */
    flex: 0 0 auto;
  }

  .topbar-online-name {
    display: none;
  }

  /* #226 : sur mobile, avatars EMPILES (overlap + lisere couleur du fond de la
     pastille) au lieu d'une file espacee -> largeur divisee par ~2, la pastille
     reste petite et propre a cote du logo (bug « En ligne bugge » sur tel). */
  .topbar-online-people {
    gap: 0;
    overflow: visible;
  }

  .topbar-online-p {
    margin-left: -9px;
  }

  .topbar-online-p:first-child {
    margin-left: 0;
  }

  .topbar-online-av {
    box-shadow: 0 0 0 2px var(--hover-2);
  }

  .topbar-online-more {
    margin-left: 6px;
  }
}

/* #226 : sur petit ecran, quand des coequipiers sont EN LIGNE, la pastille prenait
   de la place et le mot « Achflow » se tronquait moche a cote du logo. On garde
   alors le logo ICONE seul (branding suffisant sur mobile) -> la pastille respire,
   plus de troncature. S'il n'y a PERSONNE en ligne (pastille [hidden]), le nom
   reste affiche. (:has bien supporte sur navigateurs recents ; a defaut, repli sur
   l'ancien rendu tronque, pas pire.) */
@media (max-width: 440px) {
  /* classe posee sur <html> par presence-header.js quand des coequipiers sont
     en ligne (cf. #226). Sur petit ecran (<=440px : ou « Achflow » se tronquait
     a cote de la pastille) on garde alors le logo ICONE seul ; au-dessus il y a
     la place pour le nom. */
  html.has-online .topbar .brand-inline .brand-title {
    display: none;
  }
}

.app-menu {
  position: relative;
  --menu-panel-shift: 0px;
  --menu-overlay-opacity: 1;
}

.app-menu summary {
  list-style: none;
}

.app-menu summary::-webkit-details-marker {
  display: none;
}

.menu-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  gap: 4px;
  border-radius: 14px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

/* admin-topbar-0708 : petit bouton « Admin Achflow » (roue crantée) dans la topbar,
   sorti du menu de gauche (demande Philippe). Un poil plus petit que les boutons
   grand/plein écran (34px vs 40px) pour rester discret. C'est LUI qui porte le
   margin-left:auto : il ouvre le groupe d'actions de droite et le pousse à droite,
   les boutons écran se collent ensuite avec un petit écart fixe (cf. règles + bas).
   Visible aussi sur mobile (les boutons écran, eux, sont masqués <1120) pour que
   les admins gardent l'accès partout. La roue pivote gentiment au survol. */
.topbar-admin-toggle {
  display: inline-flex;
  margin-left: auto;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  color: var(--muted, var(--text));
  font-size: 17px;
  text-decoration: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.topbar-admin-toggle .ti {
  transition: transform .3s ease;
}

.topbar-admin-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft, var(--hover, var(--hover-2)));
  border-color: var(--accent);
}

.topbar-admin-toggle:hover .ti {
  transform: rotate(60deg);
}

.topbar-admin-toggle.is-active {
  color: var(--accent);
  background: var(--accent-soft, var(--hover-2));
  border-color: var(--accent);
}

/* Quand le bouton admin est présent, il tient le margin-left:auto : les boutons
   écran qui le suivent passent à un simple écart fixe (sinon deux marges auto
   se partageraient l'espace et écarteraient le groupe). */
.topbar-admin-toggle ~ .plein-ecran-toggle {
  margin-left: 8px;
}

/* plein-ecran-0708 : bouton « plein écran » navigateur (API Fullscreen). Depuis
   menu-dock-0715 c'est le SEUL bouton d'écran de la topbar (le « grand écran » est
   passé sur la poignée du menu, cf. .menu-dock-toggle plus bas). Masqué par défaut :
   base.js (initPleinEcran) pose .is-avail seulement si l'API existe (ex : absente sur
   iPhone → jamais affiché). L'icône bascule arrows-maximize/arrows-minimize selon la
   classe html.plein-ecran, synchronisée par base.js sur fullscreenchange. margin-left:auto
   par défaut (colle le bouton à droite quand il est seul) ; ramené à 8px quand une cloche
   ou l'admin le précède (combinateurs ci-dessus / plus bas). */
.plein-ecran-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  color: var(--text);
  font-size: 19px;
  cursor: pointer;
}

/* #226 : le groupe de boutons d'affichage (grand ecran + plein ecran) est
   DESKTOP-ONLY. Sur mobile/tablette (<1120px) le menu de gauche est un tiroir
   et il n'y a pas de bandeau fixe a masquer -> ces boutons n'ont aucun interet
   (demande Achille). Le grand ecran est deja gate >=1120px ; on aligne le plein
   ecran : sa reveal .is-avail passe dans le bloc >=1120px plus bas. */
.plein-ecran-toggle:hover {
  background: var(--hover, var(--hover-2));
}

.plein-ecran-toggle .ti-arrows-minimize {
  display: none;
}

html.plein-ecran .plein-ecran-toggle .ti-arrows-maximize {
  display: none;
}

html.plein-ecran .plein-ecran-toggle .ti-arrows-minimize {
  display: inline;
}

@media (min-width: 1120px) {
  /* #226 : revele le plein ecran UNIQUEMENT sur desktop. En dessous de 1120px le menu
     est un tiroir hamburger : ni plein ecran ni poignee de repli (« sur iPhone on ne
     touche pas »). Le margin-left:auto de base est conserve (bouton seul colle a droite). */
  .plein-ecran-toggle.is-avail {
    display: inline-flex;
  }
}

/* menu-dock-0715 (demande Philippe) : poignee de repli/depli du volet de gauche, collee
   au bord du menu (facon VS Code). REMPLACE l'ancien bouton « grand ecran » de la topbar
   -> il ne reste qu'UN seul bouton d'ecran en haut (plein ecran). Bascule html.grand-ecran
   (menu masque) + memorise le choix par personne (base.html, memes cles que l'ancien
   bouton). Desktop uniquement : sous 1120px la classe grand-ecran n'a aucun effet et le
   menu reste un tiroir hamburger -> la poignee est masquee.
     - menu VISIBLE (html:not(.grand-ecran)) : poignee au bord DROIT du volet, chevron
       « ‹ » (replier). Posee en fixed a left:var(--menu-w-eff), centree verticalement.
     - menu MASQUE (html.grand-ecran) : poignee au bord GAUCHE de l'ecran, chevron « › »
       (deplier). Le hamburger desktop est alors masque (la poignee le remplace). */
.menu-dock-toggle {
  display: none;
}

@media (min-width: 1120px) {
  .app-shell:not(.app-shell-landing) .menu-dock-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 54px;
    padding: 0;
    z-index: 62;
    border: 1px solid var(--line);
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, width 140ms ease;
  }
  .app-shell:not(.app-shell-landing) .menu-dock-toggle:hover {
    width: 26px;
    background: var(--hover, var(--hover-2));
    color: var(--text);
  }
  .app-shell:not(.app-shell-landing) .menu-dock-toggle:focus-visible {
    outline: none;
    color: var(--text);
    box-shadow: 0 0 0 2px var(--accent);
  }
  /* menu visible : au bord droit du volet (suit --menu-w-eff en direct). */
  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .menu-dock-toggle {
    left: var(--menu-w-eff);
  }
  /* menu masque : au bord gauche de l'ecran. */
  html.grand-ecran .app-shell:not(.app-shell-landing) .menu-dock-toggle {
    left: 0;
  }
  /* une seule icone visible selon l'etat. */
  .menu-dock-toggle .ti-chevron-right {
    display: none;
  }
  html.grand-ecran .menu-dock-toggle .ti-chevron-left {
    display: none;
  }
  html.grand-ecran .menu-dock-toggle .ti-chevron-right {
    display: inline;
  }
  /* menu masque desktop : le hamburger cede la place a la poignee « › ». */
  html.grand-ecran .app-shell:not(.app-shell-landing) .menu-button {
    display: none !important;
  }
}

/* ── Centre de notifications GLOBAL dans la topbar (#211) ─────────────────────
   Une notif = un ÉVÉNEMENT individuel (message client non répondu, tâche à faire,
   besoin d'un humain, annonce échouée EAN…) : elle arrive en TOAST en bas à droite
   puis RESTE dans le menu (cloche) tant qu'elle n'est pas réglée. Bouton, compteur
   et liste pilotés par notifications-center.js (GET /api/notifications, poll ~60s).
   Le BOUTON est le 1er élément du groupe d'actions de droite : il porte le
   margin-left:auto (les toggles admin/écran qui le suivent passent à un écart fixe,
   cf. règles `~`). Le PANNEAU et les TOASTS sont montés HORS de la topbar
   (backdrop-filter) et s'ancrent en fixed. Jetons GLOBAUX (tous thèmes). */
.topbar-notif-btn {
  position: relative;
  display: inline-flex;
  margin-left: auto;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  color: var(--muted, var(--text));
  font-size: 20px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.topbar-notif-btn:hover,
.topbar-notif-btn.is-open {
  color: var(--accent);
  background: var(--accent-soft, var(--hover-2));
  border-color: var(--accent);
}
/* Il y a quelque chose a traiter : la cloche s'allume (accent). */
.topbar-notif-btn.is-hot {
  color: var(--accent-strong, var(--accent));
  border-color: var(--accent);
}
/* Pastille compteur, coin haut-droit du bouton. */
.topbar-notif-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--danger);
  color: #2a1414;
  font-size: 11px; font-weight: 800; line-height: 1;
  border: 2px solid var(--bg);
}
.topbar-notif-count[hidden] { display: none; }

/* Cloche presente (1er du groupe) => les toggles qui la suivent perdent leur
   margin-left:auto (sinon plusieurs marges auto se partageraient l'espace) et
   passent a un ecart fixe. Absente (pas de boutique) => comportement d'origine. */
.topbar-notif-btn ~ .topbar-admin-toggle,
.topbar-notif-btn ~ .plein-ecran-toggle {
  margin-left: 8px;
}

/* « Assistant virtuel » (.ach-help-fab) : le LANCEUR est rendu dans la topbar AVANT
   le groupe d'actions de droite (base.html). Sans marge, il restait colle au cluster
   de gauche sur TOUTES les pages sauf l'accueil (qui portait sa propre regle). On lui
   donne le margin-left:auto GLOBALEMENT (demande Philippe) : etant le 1er element a
   marge auto en DOM, il absorbe l'espace libre -> le lanceur passe a DROITE, juste a
   gauche de la cloche, comme sur l'accueil. Le margin-left:auto de la cloche devient
   sole ressort ; si la bulle est masquee (module aide off), la cloche le reprend. */
.topbar .ach-help-fab { margin-left: auto; }
/* ...et on NEUTRALISE le margin-left:auto de la cloche UNIQUEMENT quand le lanceur
   la precede (sinon DEUX marges auto se PARTAGENT l'espace -> le robot flotte AU
   MILIEU de la barre au lieu d'aller a droite). La bulle exige current_membership,
   exactement comme la cloche -> quand le lanceur est la, la cloche l'est aussi, donc
   ce reset s'applique toujours ; bulle masquee -> la cloche garde son auto (repli). */
.topbar .ach-help-fab ~ .topbar-notif-btn { margin-left: 0; }

/* Panneau deroulant, ancre sous la topbar en haut a droite. position:fixed :
   monte hors de la topbar (backdrop-filter) => s'ancre au viewport, pas piege. */
.topbar-notif-pop {
  position: fixed;
  top: 60px; right: 12px;
  z-index: 1400;
  width: 320px; max-width: calc(100vw - 24px);
  /* Plafond global + UN SEUL scroll (les deux sections défilent ensemble) : sans ça le
     popover pouvait descendre jusqu'en bas de l'écran (retour Achille 2026-07-16). */
  max-height: calc(100vh - 76px); overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.34);
  padding: 8px;
  animation: topbarNotifIn .13s ease;
}
.topbar-notif-pop[hidden] { display: none; }
@keyframes topbarNotifIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.topbar-notif-hd {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 8px 4px;
}
/* Filtres par type : petits boutons pilule en haut du panneau (Tous / 💬 / 👥 / ✅ / ⚠️ / 📦),
   remplis par le JS avec le compte par type ; celui actif prend l'accent. */
.topbar-notif-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 2px 6px 8px;
}
.topbar-notif-filter {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.topbar-notif-filter:hover { color: var(--text); border-color: var(--accent); }
.topbar-notif-filter.is-active {
  color: var(--accent);
  background: var(--accent-soft, var(--hover-2));
  border-color: var(--accent);
}
.topbar-notif-filter .tnf-emo { font-size: 12px; line-height: 1; }
.topbar-notif-filter .tnf-n {
  min-width: 17px; padding: 1px 5px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 800; text-align: center;
}
.topbar-notif-filter.is-active .tnf-n { border-color: var(--accent); }
/* Liste scrollable si beaucoup de notifs. */
.topbar-notif-list {
  max-height: min(60vh, 460px);
  overflow-y: auto;
}
.topbar-notif-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 9px 9px 8px; border-radius: 10px;
  text-decoration: none; color: var(--text);
  /* Repère couleur de TYPE (demande Achille, renforcé « trop discret ») : liseré
     4px + FOND teinté — bleu = message délégué, vert d'eau = équipe, violet =
     tâche, ambre = humain, rouge = annonce échouée. */
  border-left: 4px solid transparent;
  margin-bottom: 3px;
}
.topbar-notif-row:hover { filter: brightness(1.12); }
.topbar-notif-row.is-t-message { border-left-color: var(--ink-blue, var(--accent));
  background: color-mix(in srgb, var(--ink-blue, #7aa7ff) 9%, transparent); }
.topbar-notif-row.is-t-team    { border-left-color: var(--ink-teal, var(--success));
  background: color-mix(in srgb, var(--ink-teal, #5cc3ba) 9%, transparent); }
.topbar-notif-row.is-t-task    { border-left-color: var(--ink-violet, var(--accent));
  background: color-mix(in srgb, var(--ink-violet, #baa6e6) 9%, transparent); }
.topbar-notif-row.is-t-reminder { border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent); }
.topbar-notif-row.is-t-review  { border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 9%, transparent); }
.topbar-notif-row.is-t-ean     { border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent); }
/* Chip contextuelle sur la ligne (ex. « Délégué pour toi » sur un message client). */
.topbar-notif-tag {
  display: inline-block; vertical-align: 1px;
  margin-left: 4px; padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-blue, #7aa7ff) 22%, transparent);
  color: var(--ink-blue, var(--accent));
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  white-space: nowrap;
}
/* Avatar de la personne (photo ou initiale colorée façon page Équipe) ; en
   l'absence de personne (review / annonce EAN), icône typée sur fond accent doux. */
.topbar-notif-av {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 14px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent);
  margin-top: 1px;
}
.topbar-notif-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar-notif-av.is-icon { border-radius: 9px; }
.topbar-notif-av.is-icon i { font-size: 17px; }
.topbar-notif-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.topbar-notif-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Extrait du contenu (message / tâche / article) : 2 lignes max, comme la bulle équipe. */
.topbar-notif-sub {
  font-size: 12.5px; color: var(--muted); line-height: 1.3;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.topbar-notif-when {
  flex: 0 0 auto; font-size: 11.5px; color: var(--muted);
  white-space: nowrap; margin-top: 2px;
}
.topbar-notif-empty {
  padding: 16px 10px 18px; text-align: center;
  color: var(--muted); font-size: 13.5px;
}
.topbar-notif-empty[hidden] { display: none; }

/* ══ Cloche UNIFIÉE (#377) — classes nc-* PARTAGÉES par la cloche topbar ET la cloche
   du mur de l'accueil (moteur notifications-center.js). Jetons GLOBAUX uniquement
   (--panel/--text/--muted/--line/--accent/--danger…) → lisibles sous les 8 thèmes ET
   à l'intérieur de la palette .hm de l'accueil. Layout sectionné : « À regarder »
   (compteurs) puis « Notifications » (événements + filtres). ══ */
.nc-sect[hidden] { display: none; }
.nc-sect + .nc-sect { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.nc-hd {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 8px 4px;
}
/* Ligne COMPTEUR agrégé (« À regarder ») : icône + libellé + pastille de nombre. */
.nc-look-row {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 9px; border-radius: 10px; margin-bottom: 2px;
  text-decoration: none; color: var(--text);
}
.nc-look-row:hover { background: var(--hover-2); }
.nc-look-ic {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.nc-look-ic i { font-size: 17px; }
.nc-look-lbl { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; }
.nc-look-n {
  flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger); font-size: 12px; font-weight: 800;
}
/* Bouton « + N autres à regarder » / « Voir moins » : replie la section « À regarder »
   au-delà de 4 lignes (le moteur gère l'affichage/masquage). */
.nc-look-more {
  display: block; width: 100%; padding: 8px; margin-top: 2px;
  background: none; border: none; border-radius: 8px;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  text-align: center; cursor: pointer; font-family: inherit;
}
.nc-look-more:hover { background: var(--hover-2); color: var(--text); }
/* Filtres par type (« Notifications ») : pilules remplies par le JS. */
.nc-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 6px 8px; }
.nc-filter {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--hover-2); color: var(--muted);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.nc-filter:hover { color: var(--text); border-color: var(--accent); }
.nc-filter.is-active { color: var(--accent); background: var(--accent-soft, var(--hover-2)); border-color: var(--accent); }
.nc-filter-emo { font-size: 12px; line-height: 1; }
.nc-filter-n {
  min-width: 17px; padding: 1px 5px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 800; text-align: center;
}
.nc-filter.is-active .nc-filter-n { border-color: var(--accent); }
/* Liste des ÉVÉNEMENTS : sans scroll propre — le popover scrolle globalement (un seul
   niveau de défilement, jamais de scroll imbriqué). */
.nc-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 9px 9px 8px; border-radius: 10px; margin-bottom: 3px;
  text-decoration: none; color: var(--text);
  border-left: 4px solid transparent;
}
.nc-row:hover { filter: brightness(1.12); }
.nc-row.is-t-message { border-left-color: var(--ink-blue, var(--accent));
  background: color-mix(in srgb, var(--ink-blue) 9%, transparent); }
.nc-row.is-t-team { border-left-color: var(--ink-teal, var(--success));
  background: color-mix(in srgb, var(--ink-teal) 9%, transparent); }
.nc-row.is-t-task { border-left-color: var(--ink-violet, var(--accent));
  background: color-mix(in srgb, var(--ink-violet) 9%, transparent); }
.nc-row.is-t-reminder { border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent); }
.nc-row.is-t-review { border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 9%, transparent); }
.nc-row.is-t-ean { border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent); }
.nc-av {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 14px; font-weight: 800; background: var(--accent-soft); color: var(--accent);
  margin-top: 1px;
}
.nc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nc-av.is-icon { border-radius: 9px; }
.nc-av.is-icon i { font-size: 17px; }
.nc-row.is-t-message .nc-av.is-icon { color: var(--ink-blue, var(--accent)); }
.nc-row.is-t-team .nc-av.is-icon { color: var(--ink-teal, var(--success)); }
.nc-row.is-t-task .nc-av.is-icon { color: var(--ink-violet, var(--accent)); }
.nc-row.is-t-review .nc-av.is-icon, .nc-row.is-t-ean .nc-av.is-icon { color: var(--danger); }
.nc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nc-title { font-size: 13.5px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-tag {
  display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 1px 7px;
  border-radius: 999px; background: color-mix(in srgb, var(--ink-blue) 22%, transparent);
  color: var(--ink-blue, var(--accent)); font-size: 10.5px; font-weight: 800; letter-spacing: .02em; white-space: nowrap;
}
.nc-sub {
  font-size: 12.5px; color: var(--muted); line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.nc-when { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; margin-top: 2px; }

/* Couleur d'icone par type quand il n'y a PAS de personne (avatar .is-icon). */
.topbar-notif-row.is-t-message .topbar-notif-av.is-icon,
.notif-toast.is-t-message .notif-toast-av.is-icon { color: var(--ink-blue, var(--accent)); }
.topbar-notif-row.is-t-team .topbar-notif-av.is-icon,
.notif-toast.is-t-team .notif-toast-av.is-icon { color: var(--ink-teal, var(--success)); }
.topbar-notif-row.is-t-task .topbar-notif-av.is-icon,
.notif-toast.is-t-task .notif-toast-av.is-icon { color: var(--ink-violet, var(--accent)); }
.topbar-notif-row.is-t-review .topbar-notif-av.is-icon,
.notif-toast.is-t-review .notif-toast-av.is-icon,
.topbar-notif-row.is-t-ean .topbar-notif-av.is-icon,
.notif-toast.is-t-ean .notif-toast-av.is-icon { color: var(--danger); }

/* ── Toasts « nouvelle notif » du centre ──
   Rendus DANS la pile partagée #tm-toast-stack (team-bubble.js / task-bubble.js,
   bas-droite) : une seule colonne de bulles, pas de chevauchement. La pile a
   pointer-events:none → chaque toast ré-active les siens. Fond teinté par type
   (couleurs volontairement APPUYÉES, retour Achille « trop discret »). */
.notif-toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 12px 12px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.32);
  text-decoration: none; color: var(--text);
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
}
.notif-toast.is-in { opacity: 1; transform: translateY(0); }
.notif-toast.is-out { opacity: 0; transform: translateY(12px); }
.notif-toast.is-t-message { border-left-color: var(--ink-blue, var(--accent));
  background: color-mix(in srgb, var(--ink-blue, #7aa7ff) 10%, var(--panel)); }
.notif-toast.is-t-team { border-left-color: var(--ink-teal, var(--success));
  background: color-mix(in srgb, var(--ink-teal, #5cc3ba) 10%, var(--panel)); }
.notif-toast.is-t-task { border-left-color: var(--ink-violet, var(--accent));
  background: color-mix(in srgb, var(--ink-violet, #baa6e6) 10%, var(--panel)); }
.notif-toast.is-t-review { border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, var(--panel)); }
.notif-toast.is-t-ean { border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--panel)); }
/* Avatar du toast : même logique que la liste (photo / initiale / icône typée). */
.notif-toast-av {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 14px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent);
}
.notif-toast-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notif-toast-av.is-icon { border-radius: 9px; }
.notif-toast-av.is-icon i { font-size: 17px; }
.notif-toast-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-toast-title { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.notif-toast-sub { font-size: 12.5px; color: var(--muted); line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-toast-x {
  flex: 0 0 auto; border: 0; background: transparent; color: var(--muted);
  font-size: 19px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.notif-toast-x:hover { color: var(--text); }

.menu-overlay {
  display: none;
}

.mobile-side-drawer-overlay {
  display: none;
}

.menu-edge-swipe-zone {
  display: none;
}

/* Poignee de largeur du volet : masquee partout par defaut ; SEUL le volet fixe
   desktop (min-width:1120, hors grand-ecran) la reaffiche (cf. plus bas). */
.menu-resize-handle {
  display: none;
}

.menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(300px, calc(100vw - 40px));
  height: 100vh;
  z-index: 60;
  padding: calc(22px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(calc(-100% + var(--menu-panel-shift)));
  transition: transform 180ms ease;
  will-change: transform;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.app-menu[open] .menu-overlay {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.38);
  opacity: var(--menu-overlay-opacity);
  transition: opacity 180ms ease;
}

.app-menu[open] .menu-panel {
  transform: translateX(var(--menu-panel-shift));
}

.app-menu.is-menu-swiping .menu-overlay,
.app-menu.is-menu-swiping .menu-panel {
  transition: none;
}

.menu-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  container: menu-header / inline-size;
  /* 18px -> 12px (2026-07-03) : resserre l'espace sous les pastilles compte,
     pour que la barre boutiques (.menu-company-seg) colle au header. */
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* Pastille avatar du compte connecte, posee a droite du nom de societe dans le
   header du menu. Le cercle reutilise .menu-account-avatar (taille/photo/initiale). */
.menu-header-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  line-height: 0;
  border-radius: 50%;
  text-decoration: none;
  transition: box-shadow 0.15s ease;
  /* #414 : c'est désormais un <button> (ouvre le menu compte) — on neutralise
     le style natif du bouton pour garder la pastille ronde à l'identique. */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-header-avatar:hover { box-shadow: 0 0 0 2px var(--accent-strong); }

/* pastilles-header-0703 : grappe compte en haut du menu (avatar -> profil,
   « switch » = deroule les comptes connectes du poste, « sortie » = deconnexion).
   Remplace le bloc multi-comptes du pied de menu : plus besoin de scroller pour
   se connecter / deconnecter. Les popovers (.menu-header-pop-panel) s'ancrent
   sur .menu-header (position:relative) et prennent toute sa largeur ; les
   <details> ne sont PAS positionnes pour ca. */
.menu-header-pills {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-header-pop > summary { list-style: none; }
.menu-header-pop > summary::-webkit-details-marker { display: none; }
.menu-header-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hover);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.menu-header-pill:hover { color: var(--text); box-shadow: 0 0 0 2px var(--accent-strong); }
.menu-header-pop[open] > .menu-header-pill { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-strong); }
.menu-header-pop-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.menu-header-pop-hint { margin: 2px 4px 0; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-links {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  white-space: nowrap;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  transition: transform 120ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.menu-link:hover {
  background: var(--hover);
  color: var(--text);
}

.menu-link.is-active {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border-color: transparent;
  color: var(--accent);
  font-weight: 500;
}
.menu-link:hover .menu-link-icon { color: var(--text); }
.menu-link.is-active .menu-link-icon { color: var(--accent); }

/* ── Menu MONOCHROME (demande Philippe 2026-07-11) : TOUS les onglets sont des
   lignes sobres — AUCUNE couleur de repere (Achat/Vente/Depot/Stock), AUCUN encadre
   Accueil. Le survol eclaircit legerement ; SEULE l'entree ACTIVE passe en accent
   (orange) : texte + icone + fond teinte discret (cf. .menu-link.is-active plus haut).
   Les classes .menu-caisse-* ne sont plus que des marqueurs (aucun style). ── */

/* Accueil : EXCEPTION — toujours sobre, ECRITURE BLANCHE + AUCUN fond, meme sur la
   page active (ne passe jamais en orange). Demande Philippe 2026-07-11. */
.menu-link.menu-caisse-accueil { color: var(--text); }
.menu-link.menu-caisse-accueil .menu-link-icon { color: var(--text); }
.menu-link.menu-caisse-accueil.is-active { color: var(--text); background: transparent; }
.menu-link.menu-caisse-accueil.is-active .menu-link-icon { color: var(--text); }

/* ══ Menu en POLES repliables + zone « Acces rapide » (epingles) ══
   Refonte 2026-07-11 (menu_poles.md) : le volet regroupe les onglets en 6 poles
   <details> ; en haut, une zone « Acces rapide » ou l'utilisateur epingle ses
   favoris (etoile) et les reordonne (poignee a points). base.js = initMenuPoles. */

/* Zone « Acces rapide » (teintee accent, cachee tant que vide). */
.menu-quick {
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 12px;
  padding: 8px 8px 9px;
}
.menu-quick-head { display: flex; align-items: center; gap: 7px; padding: 0 4px 8px; }
.menu-quick-star { color: var(--accent-strong); font-size: 15px; }
.menu-quick-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent-strong);
}
.menu-quick-pub {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
  transition: background 140ms ease, color 140ms ease;
}
.menu-quick-pub:hover { color: var(--text); background: var(--hover); }
.menu-quick-list { display: grid; gap: 6px; }
/* lisible-acces-rapide-0711 (demande Philippe) : dans l'Acces rapide chaque
   epingle porte EN PLUS une poignee + une etoile, qui grignotent la largeur ;
   un libelle long (« Messages clients ») s'ecrasait alors jusqu'a « M… » et
   devenait illisible. Ici on laisse le libelle des CLONES passer sur 2 lignes
   (pas d'ellipse) : le texte reste toujours entier, quelle que soit la largeur
   du volet. Les entrees des poles gardent, elles, l'ellipse sur une ligne. */
.menu-quick-list .menu-clone { align-items: center; }
/* lisible-acces-rapide-scroll-0711 (retour Achille) : le clone a une pastille
   (« Messages clients » → 9) donc heritait du padding-right:48px de
   `.menu-link:has(.menu-link-note)` (prevu pour l'etoile EN ABSOLU des poles) +
   un gap de 12px. Resultat : ~34px pour le libelle sur 292px de volet → « Messages »
   se cassait lettre par lettre (Mes/sag/es/clie/nts). Ici l'etoile est DANS le flux :
   on recupere ce padding et on resserre le gap → le libelle a ~85px, « Messages
   clients » tient proprement sur 2 lignes (coupe entre les MOTS, plus au milieu). */
.menu-quick-list .menu-clone.menu-link {
  gap: 8px;
  padding-right: 10px;
}
/* Dans l'Acces rapide, l'entree est deja epinglee : le retrait se fait par
   l'ETOILE (menu-star is-on, « Retirer de l'acces rapide »). Le bouton coche/＋
   (menu-link-quickadd), clone depuis le menu, faisait double emploi ET, en absolu
   a droite, se superposait a l'etoile (retour Achille « la coche fusionne avec
   l'etoile »). On le masque sur les clones : plus de chevauchement, place rendue. */
.menu-quick-list .menu-clone .menu-link-quickadd { display: none; }
.menu-quick-list .menu-clone > span:not([class]) {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Poignee a points (⠿) des clones de l'Acces rapide : prise pour reordonner. */
.menu-grip {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; margin: -2px 2px -2px -2px; color: var(--muted);
  opacity: 0.55; cursor: grab; font-size: 16px; touch-action: none;
}
.menu-grip:active { cursor: grabbing; }
.menu-clone--dragging { opacity: 0.5; }

/* ── Ornements du menu dans le FLUX (demande Philippe : tout aligne, rien qui se
   chevauche ni ne se decale). Le libelle prend la place restante ; la pastille (nb),
   l'emoji « test » puis l'etoile suivent, alignes a droite. Fini l'absolu fragile. ── */
/* menu-libelle-2lignes-0711 (retour Achille : « si c'est un groupe de mots, c'est
   separable »). Le libelle peut passer sur 2 lignes, coupe UNIQUEMENT entre les
   mots (word-break: keep-all -> jamais en plein milieu d'un mot). En usage normal
   il tient sur 1 ligne (aucun changement) ; une ligne chargee s'etale sur 2. */
.menu-links .menu-link > span:not([class]) {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.menu-links .menu-link-note,
.menu-links .menu-link-emoji { position: static; transform: none; top: auto; right: auto; flex: 0 0 auto; }

/* Etoile epingler / detacher : element de flux (a droite), n'agrandit pas la ligne. */
.menu-star {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin: -4px -2px -4px 0; border-radius: 7px;
  color: var(--muted); opacity: 0.34; cursor: pointer; font-size: 15px;
  transition: opacity 120ms ease, color 120ms ease, background 120ms ease, transform 120ms ease;
}
.menu-link:hover .menu-star { opacity: 0.75; }
.menu-star:hover { opacity: 1; color: var(--accent-strong); background: var(--hover); transform: scale(1.12); }
.menu-star.is-on { opacity: 1; color: var(--accent-strong); }

/* Poles repliables (<details>) : en-tete cliquable + corps indente. */
.menu-pole { border-radius: 11px; min-width: 0; }
.menu-pole-hd {
  list-style: none; display: flex; align-items: center; gap: 10px;
  position: relative;
  /* Right padding = petite lane reservee a droite de la fleche : TOUTES les
     fleches restent alignees, et l'icone « tout replier » (Comptoir) se pose en
     absolu dans cette lane, a droite de la fleche. */
  padding: 9px 30px 9px 11px; border-radius: 10px; cursor: pointer; user-select: none;
  color: var(--text); font-weight: 600; font-size: 0.92rem;
}
.menu-pole-hd::-webkit-details-marker { display: none; }
.menu-pole-hd:hover { background: var(--hover); }
.menu-pole-ic { width: 22px; display: inline-flex; justify-content: center; color: var(--accent); font-size: 18px; flex: 0 0 auto; }
.menu-pole-tt { flex: 1 1 auto; min-width: 0; }
.menu-pole-chev { color: var(--muted); font-size: 15px; transition: transform 160ms ease; flex: 0 0 auto; }
.menu-pole[open] > .menu-pole-hd { color: var(--accent-strong); }
.menu-pole[open] > .menu-pole-hd .menu-pole-chev { transform: rotate(180deg); color: var(--accent-strong); }
.menu-pole-body { display: grid; gap: 8px; padding: 6px 0 4px 2px; }

/* Bouton discret « tout replier / tout deplier » (demande Philippe) : pose EN
   ABSOLU dans la lane de droite de l'en-tete Comptoir, a droite de la fleche (qui,
   elle, reste alignee avec celles des autres poles). Meme taille que la fleche. */
.menu-fold-all {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); opacity: 0.55; cursor: pointer;
  font-size: 15px; transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}
.menu-fold-all:hover { opacity: 1; color: var(--accent-strong); background: var(--hover); }

.menu-link-disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.menu-link-disabled:hover {
  transform: none;
  background: var(--hover-2);
}

/* Colonne de droite du menu : tout est CENTRE sur un meme axe vertical = le
   milieu des boutons ＋ (right 13px + 24px de large -> axe a 25px du bord).
   Pastilles de compteur, 🚧 et icone reorganiser se centrent dessus via
   position:absolute + translate(50%) (le 50% ramene le centre de l'element
   sur la ligne right:25px, quelle que soit sa largeur : "5" ou "99+"). */
.menu-link-note {
  position: absolute;
  top: 50%;
  right: 25px;
  transform: translate(50%, -50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(223, 143, 120, 0.14);
  border: 1px solid rgba(223, 143, 120, 0.28);
  color: var(--accent-strong);
  font-size: 0.78rem;
  line-height: 1;
}
/* La pastille ne reserve plus de place dans le flux : on garde le texte du
   lien a distance pour qu'il ne passe pas dessous (ex. « Besoin d'un humain »). */
.menu-link:has(.menu-link-note) { padding-right: 48px; }
/* Repere « en test / en construction » (menu-repere-point-0711, retour Achille :
   « trouver un autre moyen qu'un emoji qui prend de la place »). Au lieu d'un
   emoji large a droite (qui grignotait le libelle), un petit POINT de couleur
   posé sur le coin haut-droit de l'icone du lien -> zero place prise sur le texte.
   Le glyphe emoji est masque (font-size:0) ; l'info reste au survol (title). */
.menu-link-emoji {
  position: absolute;
  left: 27px;
  top: 9px;
  right: auto;
  transform: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  background: var(--muted);
  box-shadow: 0 0 0 2px var(--surface-2);
  pointer-events: none;
}
.menu-link-emoji[title="En test"] { background: #6ea8fe; }
.menu-link-emoji[title="En construction"] { background: #f0a35e; }

/* ＋ d'ajout rapide (Notre Stock), posé en absolu dans le wrapper
   .menu-link-quickwrap. C'est LUI la reference de l'axe (centre a 25px). */
.menu-link-quickadd {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-strong);
  background: rgba(223, 143, 120, 0.16);
  border: 1px solid rgba(223, 143, 120, 0.32);
  text-decoration: none;
}

/* En mobile .menu-link passe a padding 14px 16px : l'axe glisse a 28px. */
@media (max-width: 759px) {
  .menu-link-quickadd { right: 16px; }
  .menu-link-note,
  .menu-link-emoji { right: 28px; }
}

.stock-total-value {
  color: var(--accent-strong);
  font-weight: 700;
}

.menu-link-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 20px;
  font-size: 19px;
}

.menu-link-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.onboarding-shell {
  display: grid;
  gap: 24px;
}

.onboarding-shell-compact {
  max-width: 860px;
}

.onboarding-grid {
  align-items: stretch;
}

.onboarding-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.onboarding-actions-shell {
  max-width: 760px;
}

.onboarding-choice-panel {
  display: grid;
  justify-items: center;
  padding: 28px;
}

.onboarding-choice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.onboarding-ghost-dashboard {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  background:
    linear-gradient(180deg, var(--hover-2), var(--hover-2)),
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.14), transparent 42%);
}

.onboarding-ghost-topbar {
  display: flex;
  gap: 10px;
  padding: 18px 18px 0;
}

.onboarding-ghost-topbar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--line-2);
}

.onboarding-ghost-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  filter: grayscale(1);
  opacity: 0.38;
}

.onboarding-ghost-sidebar,
.onboarding-ghost-card {
  border-radius: 18px;
  background: var(--hover);
  border: 1px solid var(--hover-2);
}

.onboarding-ghost-sidebar {
  min-height: 280px;
}

.onboarding-ghost-content {
  display: grid;
  gap: 16px;
}

.onboarding-ghost-card-large {
  min-height: 92px;
}

.onboarding-ghost-card-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.onboarding-ghost-card-table {
  min-height: 180px;
}

.onboarding-ghost-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  padding: 28px;
  background: linear-gradient(180deg, transparent, var(--overlay));
  backdrop-filter: blur(2px);
}

.onboarding-ghost-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.onboarding-join-shell[hidden] {
  display: none !important;
}

.onboarding-join-panel[hidden] {
  display: none !important;
}

.organization-setup-shell {
  display: grid;
  gap: 24px;
}

.organization-setup-preview {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, var(--hover-2), var(--hover-2)),
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.12), transparent 42%),
    var(--panel);
  min-height: 980px;
}

.organization-setup-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay);
  pointer-events: none;
}

.organization-setup-preview-dim {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(1px);
}

.organization-setup-preview-header,
.organization-setup-add-preview {
  position: relative;
  z-index: 1;
  filter: grayscale(1);
  opacity: 0.36;
  pointer-events: none;
}

.organization-setup-preview-header {
  padding: 28px 28px 0;
  margin-bottom: 0;
}

.organization-setup-add-preview {
  padding: 0 28px 28px;
}

.organization-setup-add-panel,
.organization-setup-recent-panel {
  min-height: 100%;
}

.organization-setup-photo-preview {
  min-height: 92px;
  border-radius: 18px;
  border: 1px dashed var(--line-2);
  background: var(--hover-2);
}

.organization-setup-recent-card {
  opacity: 0.95;
}

.organization-setup-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  padding: 32px;
}

.organization-setup-card {
  width: min(940px, 100%);
  margin: 0 auto;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.onboarding-org-head {
  margin-bottom: 18px;
}

.onboarding-org-plan-grid {
  margin-top: 10px;
}

/* boutique-seg-0703 : switch de boutique en SEGMENTS tout en haut du menu (entre
   le header et la liste des liens, au-dessus d'Accueil). Un bouton par societe
   cote a cote, la boutique active en surbrillance ; cliquer l'autre bascule
   direct. Remplace le select du pied de menu (menu-footer supprime). */
.menu-company-seg {
  display: flex;
  gap: 6px;
  /* Colle au header et a Accueil : 10px de part et d'autre, comme le gap entre
     les liens du menu (voir aussi l'override du mode sidebar desktop, qui doit
     compenser le gap:18px de la grille .menu-panel). */
  margin: 10px 0 0;
  padding: 4px;
  border-radius: 12px;
  background: var(--hover);
  border: 1px solid var(--line);
}
.menu-company-seg + .menu-links { margin-top: 10px; }
.menu-company-seg-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 6px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.menu-company-seg-btn:hover { color: var(--text); background: var(--hover); }
.menu-company-seg-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  font-weight: 600;
  cursor: default;
}

.menu-user-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.landing-user-pill {
  padding: 10px 14px;
}

.menu-logout {
  width: 100%;
}

/* menu-user-* : carte profil reutilisee par la pastille landing (landing-user-pill). */
.menu-user-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; font-size: 0.86rem; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); }
.menu-user-meta { display: grid; gap: 1px; min-width: 0; }
.menu-user-meta strong { font-size: 0.92rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-user-meta .muted { font-size: 0.78rem; }

/* multi-comptes-0629 : rangees de comptes connectes sur ce poste (compte actif
   coche, autres = boutons de bascule, + « Ajouter un compte »). Utilisees depuis
   2026-07-03 dans les popovers des pastilles du menu-header (pastilles-header-0703),
   plus dans le pied de menu. */
.menu-account-switch { margin: 0; display: block; }
.menu-account {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 14px;
  background: var(--hover-2); border: 1px solid var(--line);
  color: var(--text); font: inherit; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.menu-account-switch .menu-account:hover { background: var(--line); border-color: var(--line-2); }
.menu-account.is-active { background: var(--accent-soft); border-color: var(--accent-strong); cursor: default; }
.menu-account-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; font-size: 0.86rem; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); }
.menu-account.is-active .menu-account-avatar { background: var(--line-2); }
.menu-account-meta { display: grid; gap: 1px; min-width: 0; flex: 1 1 auto; }
.menu-account-meta strong { font-size: 0.92rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-account-meta .muted { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-account-check { color: var(--accent-strong); flex: 0 0 auto; display: grid; place-items: center; }
.menu-account-switch-icon { color: var(--muted); flex: 0 0 auto; display: grid; place-items: center; opacity: 0.7; }
.menu-account-add {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 14px;
  border: 1px dashed var(--line-2); color: var(--muted);
  text-decoration: none; font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.menu-account-add:hover { background: var(--hover); color: var(--text); border-color: var(--muted-2); }
.menu-account-add-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); }
.menu-logout-all { width: 100%; margin-top: 6px; color: var(--muted); }


.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-mark-mini {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
}

.landing-topbar-actions {
  margin-left: auto;
  display: none;
  gap: 10px;
  align-items: center;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
}

/* logo-fidele-0724 : dans le volet ☰, « Achflow » reprend exactement le
   mot-symbole de la référence validée. Le fichier SVG sert de masque plutôt que
   d'image colorée : la géométrie reste fixe, tandis que var(--text) garantit le
   contraste sur les thèmes sombres comme clairs. Le bloc reprend exactement
   l'encombrement historique du menu : symbole visuel de 36 px + mot-symbole de
   62 px, sur la même rangée que les pastilles de compte. Le mot-symbole ne se
   compresse jamais : quand le volet devient trop étroit, il disparaît avant
   d'être illisible et laisse le A intact. */
.menu-header .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.menu-brand-copy {
  /* Retour Philippe 28/07 (essai Boutix) : la boite 62px datait de l'ancien
     mot-symbole et collait le nom au logo, laissant tout le vide avant
     l'avatar. Le nom prend l'espace libre et se CENTRE entre logo et
     pastilles compte. (Sous 232px le bloc disparait, regle plus bas.) */
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* wordmark-evomarket-0731 : le logo est DANS cette colonne, au-dessus du nom
     (variante C). Le gap separe les trois etages logo / nom / sous-titre. */
  gap: 4px;
}

.menu-brand-title {
  display: flex;
  align-items: center;
  min-width: 0;
  line-height: 1;
}

/* Le mot-symbole est du TEXTE stylé (le masque SVG `achflow-wordmark.svg` écrit
   l'ancien nom en toutes lettres, ne pas le réutiliser). Thémable via var(--text).
   wordmark-evomarket-0731 : plus de capitales forcées ni d'interlettrage large —
   ce réglage venait d'« ACHFLOW » (7 lettres) et faisait déborder « EVOMARKET »
   (9 lettres) sur toute la largeur du volet. Casse normale + graisse plus douce. */
.brand-wordmark-text {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
  /* seuil-volet-0731 : dans le tiroir etroit il ne reste que ~12px de marge
     entre le bloc marque et les 4 pastilles de compte. Si une pastille
     s'ajoutait, le nom (nowrap) deborderait sur elles : on le tronque. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Premiere partie du nom (« Evo ») : reprend le cyan du logo. Jeton de MARQUE,
   pas l'accent utilisateur — cf. --brand-mark en haut de la feuille. */
.brand-wordmark-head {
  color: var(--brand-mark);
}

.brand-wordmark {
  display: block;
  /* La boîte reste strictement à 62 px. Seul son dessin est légèrement zoomé
     vers la droite pour utiliser l'air disponible, sans modifier le layout. */
  width: 62px;
  aspect-ratio: 679 / 132;
  flex: 0 0 62px;
  background: var(--text);
  -webkit-mask: url("achflow-wordmark.svg") center / contain no-repeat;
  mask: url("achflow-wordmark.svg") center / contain no-repeat;
  transform: scale(1.1);
  transform-origin: left center;
}

/* seuil-volet-0731 : le seuil de 282px etait CALE TROP HAUT et masquait le bloc
   logo + nom bien plus souvent qu'il ne fallait. Deux largeurs de volet coexistent :
     - tiroir mobile/tablette (<1120px) : .menu-panel = min(300px, 100vw-40px),
       moins 2x14px de padding -> en-tete de 272px AU MAXIMUM, donc TOUJOURS sous
       282px : le bloc ne s'affichait jamais (mesure du 31/07 : en-tete a 261px) ;
     - volet fixe desktop (>=1120px) : --menu-w-eff, 315px par defaut mais
       REDIMENSIONNABLE de 240 a 560px -> en-tete de 287px par defaut, soit 5px
       seulement au-dessus du seuil : le nom disparaissait des qu'on resserrait
       un peu le volet.
   Depuis la variante C (wordmark-evomarket-0731) le bloc est une colonne etroite
   (logo AU-DESSUS du nom, ~76px) au lieu d'une rangee logo + nom en capitales
   espacees. Il tient donc largement : le seuil descend a 232px, ce qui le garde
   visible dans les deux volets et ne le masque plus que sur un tres petit
   telephone (< ~290px de large), la ou les pastilles de compte priment. */
@container menu-header (max-width: 232px) {
  .menu-brand-copy {
    display: none;
  }
}

.brand-subtitle,
.muted {
  color: var(--muted);
}

.page-shell {
  width: min(1120px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.page-messages .page-shell {
  width: min(1560px, calc(100vw - 28px));
}

.page-landing .topbar {
  background: rgba(16, 15, 15, 0.72);
}

.app-shell-landing {
  padding-bottom: 0;
}

.auth-shell {
  width: min(560px, 100%);
  margin: 36px auto 0;
}

.auth-shell-wide {
  width: min(1080px, 100%);
}

.auth-panel h1 {
  margin-top: 0;
}

.auth-choice-grid {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.auth-choice-card {
  padding: 18px;
  border-radius: 24px;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.auth-choice-card-active {
  border-color: rgba(223, 143, 120, 0.45);
  box-shadow: 0 18px 34px rgba(0,0,0,0.24);
}

.auth-choice-card-owner {
  background: linear-gradient(180deg, var(--accent-soft), var(--panel));
}

.auth-choice-card h2 {
  margin: 14px 0 8px;
}

.auth-form-single {
  grid-template-columns: 1fr;
}

.auth-heading {
  margin-bottom: 18px;
}

.plan-grid {
  display: grid;
  gap: 14px;
  margin: 22px 0 8px;
}

.plan-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.plan-card:hover {
  transform: translateY(-2px);
}

.plan-card.is-selected {
  border-color: rgba(216, 179, 95, 0.82);
  background: linear-gradient(180deg, var(--accent-soft), var(--panel));
  box-shadow:
    0 0 0 1px rgba(216, 179, 95, 0.28),
    0 18px 36px rgba(0, 0, 0, 0.22);
}

.plan-card-owner {
  background: linear-gradient(180deg, var(--accent-soft), var(--panel));
}

.plan-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.plan-top h2 {
  margin: 12px 0 0;
}

.plan-price {
  font-weight: 800;
  color: var(--accent-strong);
  white-space: nowrap;
}

.plan-limit {
  margin: 10px 0 14px;
}

.plan-features,
.checkout-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.checkout-panel {
  position: relative;
  overflow: hidden;
}

.checkout-panel::after {
  content: "";
  position: absolute;
  inset: auto -8% -38% 20%;
  height: 220px;
  background: radial-gradient(circle, rgba(242,179,106,0.18), transparent 60%);
  pointer-events: none;
}

.checkout-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  margin: 20px 0;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.checkout-payment-box {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(140deg, var(--accent-soft), var(--panel));
  border: 1px solid var(--line);
}

.checkout-card-visual {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(242,179,106,0.92), rgba(223,143,120,0.9));
  color: #231411;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.google-signin-block {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin-top: 8px;
}

.auth-native-google-button {
  width: min(100%, 320px);
  justify-content: center;
}

.auth-plan-panel,
.auth-register-panel {
  padding: 28px;
}

.auth-plan-head,
.auth-register-head {
  display: grid;
  gap: 12px;
}

.auth-plan-head h1,
.auth-register-head h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 0.94;
  max-width: 12ch;
}

.auth-plan-grid {
  margin-top: 24px;
}

.auth-plan-card {
  display: grid;
  gap: 16px;
  min-height: 100%;
  padding: 22px;
}

.auth-plan-card-classic {
  background: linear-gradient(180deg, var(--accent-soft), var(--panel));
  border-color: rgba(223, 143, 120, 0.22);
}

.auth-plan-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.auth-plan-card-top h2 {
  margin: 12px 0 0;
}

.auth-plan-price {
  font-weight: 900;
  color: var(--accent-strong);
  white-space: nowrap;
  font-size: 1.05rem;
}

.auth-plan-lead {
  margin: 0;
  line-height: 1.55;
}

.auth-plan-inline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-plan-inline-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
}

.auth-plan-card-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-strong);
  font-weight: 800;
}

.auth-plan-foot {
  margin-top: 26px;
}

.auth-register-summary,
.auth-register-methods,
.auth-company-prep {
  margin-top: 22px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--hover-2);
}

.auth-back-link {
  color: var(--muted);
  text-decoration: none;
}

.auth-back-link:hover {
  color: var(--text);
}

.auth-register-summary {
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-register-summary-box {
  display: grid;
  gap: 12px;
  width: min(680px, 100%);
  padding: 18px 20px 20px;
  background:
    linear-gradient(180deg, rgba(84, 56, 45, 0.96), rgba(43, 32, 30, 0.98));
  border: 1px solid rgba(223, 143, 120, 0.4);
  border-left: 5px solid var(--accent);
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 var(--hover),
    0 18px 34px rgba(0, 0, 0, 0.2);
}

.auth-register-summary-label {
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-register-summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 1.16rem;
}

.auth-register-summary-main strong {
  font-size: 1.22rem;
}

.auth-register-summary-main span:last-child {
  color: var(--accent-strong);
  font-weight: 900;
  font-size: 1.05rem;
}

.auth-register-summary-sub {
  color: var(--muted);
  font-weight: 700;
}

.auth-register-summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-company-prep {
  display: grid;
  gap: 8px;
}

.auth-company-prep-standalone {
  margin-top: 18px;
}

.auth-register-methods {
  display: grid;
  gap: 18px;
}

.auth-register-methods-top {
  display: grid;
  gap: 8px;
}

.auth-register-methods-top h2 {
  margin: 0;
}

.auth-social-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.auth-social-panel-box {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-inset);
  border: 1px solid var(--hover);
}

.auth-social-note {
  margin: 0;
  text-align: center;
}

.auth-separator-tight {
  margin: 2px 0;
}

.auth-register-form {
  margin-top: 4px;
}

.auth-register-actions {
  justify-content: flex-start;
}

.auth-register-login-line {
  margin-top: 2px;
}

.auth-switch-line a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.auth-switch-line-center {
  text-align: center;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-header p,
.back-link {
  margin: 6px 0 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-link::before {
  content: "\2190";
  color: var(--text);
  font-weight: 800;
  line-height: 1;
}

.back-link-strong {
  margin: 0 0 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
}

.back-link-strong:hover {
  background: var(--line);
}

.notice-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.notice-banner > span {
  flex: 1 1 auto;
  min-width: 0;
}

.notice-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 120ms ease, transform 120ms ease;
}

.notice-action-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.notice-action-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  /* 9998 = au-dessus du FAB .assistant-fab (z-index 9997). Sans ca, sur
     mobile (<= 500px) le modal glisse en bas et son bouton d'action passe
     sous le FAB Agent IA, impossible a cliquer. Bug observe sur l'echec
     enrichissement de la page /add. */
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 20px;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(7, 6, 6, 0.68);
  backdrop-filter: blur(10px);
}

.confirm-modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 26px;
  /* Tickets 495 / 496 : cette carte etait peinte en dur en sombre (degrade
     rgba(28,24,24) -> rgba(18,15,15)). Sur les themes CLAIRS (clair, sepia,
     aurore) elle restait donc noire alors que le texte, lui, heritait de
     var(--text) fonce -> confirmation illisible sur « Supprimer », « Generer
     prix », « Publier »... Desormais 100% jetons : la carte suit les 9 themes
     et l'accent perso. Le halo garde l'esprit d'origine, en accent. */
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 14%, transparent), transparent 28%),
    var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--text) 24%, transparent);
  color: var(--text);
}

.confirm-modal-copy {
  display: grid;
  gap: 10px;
}

.confirm-modal-copy strong {
  font-size: 1.12rem;
  color: var(--text);
}

.confirm-modal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.confirm-modal-open {
  overflow: hidden;
}

/* Modale annulation de vente : 2 gros choix empiles (picking) */
.cancel-choice-actions {
  display: grid;
  gap: 12px;
}

.cancel-choice-option {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(223, 143, 120, 0.26);
  background: var(--hover-2);
  color: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease;
}

.cancel-choice-option:hover {
  background: var(--hover);
}

.cancel-choice-option:active {
  transform: scale(0.99);
}

.cancel-choice-restock {
  border-color: rgba(120, 200, 150, 0.45);
}

.cancel-choice-restock:hover {
  background: rgba(120, 200, 150, 0.12);
}

.cancel-choice-remove {
  border-color: rgba(223, 120, 110, 0.45);
}

.cancel-choice-remove:hover {
  background: rgba(223, 120, 110, 0.12);
}

.cancel-choice-label {
  font-weight: 600;
  font-size: 0.98rem;
}

.cancel-choice-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Petites icones d'action dans le header de la card picking (coin haut-droit) :
   bulle "messagerie de l'article" (.picking-msg-btn) + crayon "Preciser"
   (.picking-hold-btn) + croix "Annuler la vente" (.picking-cancel-x, #397 :
   elle vit ICI a cote des autres icones, cartes en etat bordereau uniquement,
   retiree de Caisse). Discretes : juste une icone qui s'allume au survol. */
.picking-cancel-x-form { display: inline-flex; margin: 0; }
.picking-msg-btn,
.picking-hold-btn,
.picking-cancel-x,
.picking-ignore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 8px;
  opacity: 0.6;
  transition: opacity 120ms ease, color 120ms ease, background 120ms ease;
}
.picking-msg-btn { text-decoration: none; }
/* Form englobant l'icone "Retirer (faux positif)" dans le header de la card :
   inline-flex, aucune marge, pour s'aligner avec message/preciser (#73). */
.picking-ignore-form { display: inline-flex; margin: 0; }

.picking-msg-btn:hover {
  opacity: 1;
  color: var(--ink-blue, #8aa8bf);
  background: rgba(138, 168, 191, 0.14);
}

.picking-hold-btn:hover {
  opacity: 1;
  color: var(--warning, #f2b36a);
  background: rgba(242, 179, 106, 0.14);
}

/* Croix "Annuler la vente" : meme gabarit que les autres icones header,
   s'allume en rouge au survol (action destructive). #397. */
.picking-cancel-x:hover {
  opacity: 1;
  color: var(--danger, #e08a7a);
  background: rgba(223, 120, 110, 0.12);
}

/* Icone "Retirer" (faux positif LBC) : meme gabarit que les autres icones
   header, s'allume en rouge au survol (action de retrait). #73. */
.picking-ignore-btn:hover {
  opacity: 1;
  color: #e08a7a;
  background: rgba(223, 120, 110, 0.14);
}

/* Modale annulation d'un lot : liste des articles a remettre en vente */
.cancel-lot-quick {
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
}

.cancel-lot-quick button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.cancel-lot-quick button:hover {
  color: inherit;
}

.cancel-lot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
}

.cancel-lot-row {
  border: 1px solid rgba(223, 143, 120, 0.18);
  border-radius: 12px;
  background: var(--hover-2);
}

.cancel-lot-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.cancel-lot-check {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #78c896;
}

.cancel-lot-check:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cancel-lot-img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
}

.cancel-lot-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.cancel-lot-title {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cancel-lot-sku {
  font-size: 0.78rem;
  color: var(--muted);
}

.cancel-lot-note {
  font-size: 0.74rem;
  color: #e0a07a;
}

.stock-image-source-modal[hidden] {
  display: none !important;
}

.stock-image-source-modal {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: grid;
  place-items: center;
  padding: 24px;
}

.stock-image-source-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(8, 6, 6, 0.68);
  backdrop-filter: blur(14px);
}

.stock-image-source-card {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 28px));
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(44, 40, 40, 0.98), rgba(25, 22, 22, 0.98));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.48),
    0 0 0 1px var(--hover-2);
  display: grid;
  gap: 16px;
}

.stock-image-source-copy {
  display: grid;
  gap: 6px;
}

.stock-image-source-copy strong {
  font-size: 1.08rem;
}

.stock-image-source-copy p {
  margin: 0;
  color: var(--muted);
}

.stock-image-source-actions {
  display: grid;
  gap: 10px;
}

.stock-image-source-modal-open {
  overflow: hidden;
}

.toolbar,
.jobs-toolbar,
.inline-form,
.form-actions,
.review-actions,
.marketplace-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar,
.panel,
.form-panel,
.detail-photo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar,
.panel,
.form-panel {
  padding: 16px;
  margin-bottom: 18px;
}

.toolbar-image-search {
  align-items: end;
}

.toolbar-image-field {
  min-width: min(320px, 100%);
  flex: 1 1 320px;
}

.page-header-compact {
  margin-bottom: 14px;
}

.asset-viewer-panel {
  min-height: calc(100vh - 220px);
  display: grid;
  align-items: stretch;
}

.asset-viewer-frame {
  width: 100%;
  min-height: calc(100vh - 280px);
  border: 0;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
}

.asset-viewer-image-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 320px);
  padding: 12px;
}

.asset-viewer-image {
  max-width: min(100%, 520px);
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: var(--surface-2);
}

.stock-toolbar {
  align-items: stretch;
}

/* La barre /stock s'empile verticalement : rangee du haut (recherche + boutons),
   puis panneau de filtres EN DESSOUS, puis filtres actifs / reset. En block, un
   enfant pleine largeur ne peut jamais se retrouver a cote d'un autre. */
.stock-toolbar {
  display: block;
}

.stock-toolbar > * + * {
  margin-top: 12px;
}

.stock-appear-surface {
  animation: stockSurfaceReveal 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stock-appear-list .stock-appear-card {
  animation: stockCardReveal 440ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stock-appear-list .stock-appear-card:nth-child(1) { animation-delay: 30ms; }
.stock-appear-list .stock-appear-card:nth-child(2) { animation-delay: 55ms; }
.stock-appear-list .stock-appear-card:nth-child(3) { animation-delay: 80ms; }
.stock-appear-list .stock-appear-card:nth-child(4) { animation-delay: 105ms; }
.stock-appear-list .stock-appear-card:nth-child(5) { animation-delay: 130ms; }
.stock-appear-list .stock-appear-card:nth-child(6) { animation-delay: 155ms; }
.stock-appear-list .stock-appear-card:nth-child(7) { animation-delay: 180ms; }
.stock-appear-list .stock-appear-card:nth-child(8) { animation-delay: 205ms; }
.stock-appear-list .stock-appear-card:nth-child(9) { animation-delay: 230ms; }
.stock-appear-list .stock-appear-card:nth-child(10) { animation-delay: 255ms; }
.stock-appear-list .stock-appear-card:nth-child(11) { animation-delay: 280ms; }
.stock-appear-list .stock-appear-card:nth-child(12) { animation-delay: 305ms; }

.app-shell:not(.app-shell-landing) .page-shell > *:not(.stock-appear-surface):not(.stock-appear-list) {
  animation: stockSurfaceReveal 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(1):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 25ms; }
.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(2):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 55ms; }
.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(3):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 85ms; }
.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(4):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 115ms; }
.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(5):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 145ms; }
.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(6):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 175ms; }
.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(7):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 205ms; }
.app-shell:not(.app-shell-landing) .page-shell > *:nth-child(8):not(.stock-appear-surface):not(.stock-appear-list) { animation-delay: 235ms; }

.detail-grid > *,
.settings-grid > *,
.settings-home-grid > *,
.messages-layout-v3 > *,
.pricing-item-list > *,
.review-list > * {
  animation: stockCardReveal 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.detail-grid > :nth-child(1),
.settings-grid > :nth-child(1),
.settings-home-grid > :nth-child(1),
.messages-layout-v3 > :nth-child(1),
.pricing-item-list > :nth-child(1),
.review-list > :nth-child(1) { animation-delay: 30ms; }

.detail-grid > :nth-child(2),
.settings-grid > :nth-child(2),
.settings-home-grid > :nth-child(2),
.messages-layout-v3 > :nth-child(2),
.pricing-item-list > :nth-child(2),
.review-list > :nth-child(2) { animation-delay: 60ms; }

.detail-grid > :nth-child(3),
.settings-grid > :nth-child(3),
.settings-home-grid > :nth-child(3),
.messages-layout-v3 > :nth-child(3),
.pricing-item-list > :nth-child(3),
.review-list > :nth-child(3) { animation-delay: 90ms; }

.detail-grid > :nth-child(4),
.settings-grid > :nth-child(4),
.settings-home-grid > :nth-child(4),
.messages-layout-v3 > :nth-child(4),
.pricing-item-list > :nth-child(4),
.review-list > :nth-child(4) { animation-delay: 120ms; }

.detail-grid > :nth-child(5),
.settings-grid > :nth-child(5),
.settings-home-grid > :nth-child(5),
.messages-layout-v3 > :nth-child(5),
.pricing-item-list > :nth-child(5),
.review-list > :nth-child(5) { animation-delay: 150ms; }

.detail-grid > :nth-child(6),
.settings-grid > :nth-child(6),
.settings-home-grid > :nth-child(6),
.messages-layout-v3 > :nth-child(6),
.pricing-item-list > :nth-child(6),
.review-list > :nth-child(6) { animation-delay: 180ms; }

@keyframes stockSurfaceReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stockCardReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.988);
    filter: saturate(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell:not(.app-shell-landing) .page-shell > *,
  .detail-grid > *,
  .settings-grid > *,
  .settings-home-grid > *,
  .messages-layout-v3 > *,
  .pricing-item-list > *,
  .review-list > *,
  .stock-appear-surface,
  .stock-appear-list .stock-appear-card {
    animation: none;
  }
}

.stock-toolbar > .input,
.stock-toolbar > .button {
  flex: 1 1 170px;
}

.stock-toolbar > .button {
  flex: 0 0 auto;
}

/* Rangee du haut de la barre /stock : champ de recherche (~1/5) + Rechercher +
   Filtres avances + (a droite) Gerer les categories, le tout sur une seule ligne. */
.stock-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  /* Hauteur commune a TOUS les controles de la rangee (champ, prix, boutons)
     pour qu'ils s'alignent au pixel — fin du "mal integre" (#400). */
  --stock-ctrl-h: 46px;
}

/* Aligne champ de recherche, filtres prix et boutons sur la meme hauteur. */
.stock-toolbar-top .stock-search-input,
.stock-toolbar-top .stock-top-price-input,
.stock-toolbar-top .stock-top-btn,
.stock-toolbar-top .stock-manage-cats {
  min-height: var(--stock-ctrl-h);
}

/* le champ ou on tape le produit : compact (~1/5 + un tiers) de la barre */
.stock-toolbar-top .stock-search-shell {
  flex: 0 1 27%;
  min-width: 290px;
}

/* Titre "Notre Stock" pose directement dans la rangee, a gauche de la recherche
   (economie de la hauteur de l'ancien bandeau titre). */
.stock-toolbar-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  margin-right: 4px;
}

.stock-toolbar-title h1 {
  margin: 0;
  font-size: clamp(1.3rem, 1.6vw, 1.9rem);
  line-height: 1.1;
  white-space: nowrap;
}

.stock-title-consign {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Filtres prix rapides poses sur la barre, entre Rechercher et Filtres avances. */
.stock-top-price {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* Selecteur scope (.stock-toolbar-top ...) pour passer devant .input{width:100%}
   declare plus bas a specificite egale — sinon les champs prix s'etirent (bug
   visible en format menu hamburger 760-1119px : rangee en escalier). */
.stock-toolbar-top .stock-top-price-input {
  /* 88px coupait le placeholder ("Prix mi") : la largeur doit laisser lire
     "Prix min" / "Prix max" / "Prix exact" en entier, padding .input compris. */
  width: 102px;
}

.stock-toolbar-top .stock-top-price-exact {
  width: 118px;
}

/* Tous les boutons de la rangee du haut partagent la meme silhouette pilule
   que le bouton primaire "Rechercher" (fini le melange pilule / rectangle).
   Selecteur scope (.stock-toolbar-top ...) pour passer devant le .button de base
   (radius 16px) declare plus bas dans le fichier a specificite egale. */
.stock-toolbar-top .stock-top-btn,
.stock-toolbar-top .stock-manage-cats {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
}

/* "Gerer les categories" reste dans le flux, aligne a GAUCHE avec les autres
   boutons. (#400) L'ancien margin-left:auto le collait a droite : des que la
   rangee debordait — en mode grand ecran (menu ☰ + contenu pleine largeur, le
   DEFAUT sur PC >=1120px) comme en tablette — il etait jete SEUL sur une 2e ligne,
   plaque a droite, avec un gros vide. Aligne a gauche, il se replie proprement. */
.stock-filters-toggle {
  gap: 6px;
}

.stock-filters-caret {
  transition: transform 200ms ease;
}

.stock-filters-toggle[aria-expanded="true"] .stock-filters-caret {
  transform: rotate(180deg);
}

/* Panneau des filtres avances, ouvert par le bouton (JS, classe .is-open) */
.stock-filters-panel {
  flex: 1 1 100%;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--hover-2);
  overflow: hidden;
  display: none;
}

.stock-filters-panel.is-open {
  display: block;
}

.stock-filters-panel .stock-filters-body {
  padding-top: 0.6rem;
}

.stock-filters-panel .stock-filters-row:first-child {
  border-top: none;
  padding-top: 4px;
}

.stock-filters-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 1.1rem 1.1rem;
}

.stock-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.stock-filter-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.stock-filter-block--select .select {
  padding: 8px 28px 8px 12px;
  font-size: 0.85rem;
  min-height: 36px;
  height: 36px;
  width: auto;
  border-radius: 10px;
}

.stock-filter-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stock-filter-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stock-filter-pill {
  position: relative;
  display: inline-flex;
}

.stock-filter-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stock-filter-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--hover-2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.stock-filter-pill span:hover {
  border-color: var(--muted-2);
  background: var(--hover);
  color: var(--text);
}

.stock-filter-pill input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

/* --- Review filter pills --- */
.review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}

.review-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-filter-title {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.review-filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--hover-2);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.review-filter-pill:hover {
  border-color: var(--muted-2);
  background: var(--hover);
  color: var(--text);
}

.review-filter-pill.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 12px var(--accent-soft);
}

/* --- Review status pill colors --- */
.review-status-pill[data-status="open"] {
  border-color: rgba(255, 180, 50, 0.25);
  color: #ffb432;
}
.review-status-pill[data-status="open"].is-active {
  border-color: rgba(255, 180, 50, 0.5);
  background: rgba(255, 180, 50, 0.12);
  color: #ffb432;
  box-shadow: inset 0 0 0 1.5px rgba(255, 180, 50, 0.25), 0 0 14px rgba(255, 180, 50, 0.18);
}

.review-status-pill[data-status="resolved"] {
  border-color: rgba(125, 214, 170, 0.25);
  color: #7dd6aa;
}
.review-status-pill[data-status="resolved"].is-active {
  border-color: rgba(125, 214, 170, 0.5);
  background: rgba(125, 214, 170, 0.12);
  color: #7dd6aa;
  box-shadow: inset 0 0 0 1.5px rgba(125, 214, 170, 0.25), 0 0 14px rgba(125, 214, 170, 0.18);
}

.review-status-pill[data-status="ignored"] {
  border-color: var(--line);
  color: var(--muted);
  font-style: italic;
}
.review-status-pill[data-status="ignored"].is-active {
  border-color: var(--muted-2);
  background: var(--hover);
  color: var(--muted);
  font-style: italic;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 14px var(--line);
}

/* --- Marketplace pill colors --- */
.stock-mp-pill[data-mp="amazon"] span {
  border-color: rgba(255, 153, 0, 0.25);
  color: #ff9900;
}
.stock-mp-pill[data-mp="amazon"]:hover span,
.stock-mp-pill[data-mp="amazon"] input:checked + span {
  border-color: rgba(255, 153, 0, 0.5);
  background: rgba(255, 153, 0, 0.12);
  color: #ff9900;
}

.stock-mp-pill[data-mp="rakuten"] span {
  border-color: rgba(191, 0, 48, 0.25);
  color: #e8365d;
}
.stock-mp-pill[data-mp="rakuten"]:hover span,
.stock-mp-pill[data-mp="rakuten"] input:checked + span {
  border-color: rgba(191, 0, 48, 0.5);
  background: rgba(191, 0, 48, 0.12);
  color: #e8365d;
}

.stock-mp-pill[data-mp="ebay"] span {
  border-color: rgba(72, 133, 237, 0.25);
  color: #4885ed;
}
.stock-mp-pill[data-mp="ebay"]:hover span,
.stock-mp-pill[data-mp="ebay"] input:checked + span {
  border-color: rgba(72, 133, 237, 0.5);
  background: rgba(72, 133, 237, 0.12);
  color: #4885ed;
}

.stock-mp-pill[data-mp="lbc"] span {
  border-color: rgba(236, 111, 45, 0.25);
  color: #ec6f2d;
}
.stock-mp-pill[data-mp="lbc"]:hover span,
.stock-mp-pill[data-mp="lbc"] input:checked + span {
  border-color: rgba(236, 111, 45, 0.5);
  background: rgba(236, 111, 45, 0.12);
  color: #ec6f2d;
}

/* --- Condition pill colors (best→worst: green→orange) --- */
.stock-condition-pill[data-condition="neuf"] span {
  border-color: rgba(125, 214, 170, 0.25);
  color: #7dd6aa;
}
.stock-condition-pill[data-condition="neuf"]:hover span,
.stock-condition-pill[data-condition="neuf"] input:checked + span {
  border-color: rgba(125, 214, 170, 0.5);
  background: rgba(125, 214, 170, 0.12);
  color: #7dd6aa;
}

.stock-condition-pill[data-condition="comme neuf"] span {
  border-color: rgba(160, 210, 160, 0.25);
  color: #a0d2a0;
}
.stock-condition-pill[data-condition="comme neuf"]:hover span,
.stock-condition-pill[data-condition="comme neuf"] input:checked + span {
  border-color: rgba(160, 210, 160, 0.5);
  background: rgba(160, 210, 160, 0.12);
  color: #a0d2a0;
}

.stock-condition-pill[data-condition="tres bon etat"] span {
  border-color: rgba(138, 168, 191, 0.25);
  color: var(--ink-blue);
}
.stock-condition-pill[data-condition="tres bon etat"]:hover span,
.stock-condition-pill[data-condition="tres bon etat"] input:checked + span {
  border-color: rgba(138, 168, 191, 0.5);
  background: rgba(138, 168, 191, 0.12);
  color: var(--ink-blue);
}

.stock-condition-pill[data-condition="bon etat"] span {
  border-color: rgba(255, 210, 127, 0.25);
  color: #ffd27f;
}
.stock-condition-pill[data-condition="bon etat"]:hover span,
.stock-condition-pill[data-condition="bon etat"] input:checked + span {
  border-color: rgba(255, 210, 127, 0.5);
  background: rgba(255, 210, 127, 0.12);
  color: #ffd27f;
}

.stock-condition-pill[data-condition="etat correct"] span {
  border-color: rgba(223, 143, 120, 0.25);
  color: var(--accent);
}
.stock-condition-pill[data-condition="etat correct"]:hover span,
.stock-condition-pill[data-condition="etat correct"] input:checked + span {
  border-color: rgba(223, 143, 120, 0.5);
  background: rgba(223, 143, 120, 0.12);
  color: var(--accent);
}

.stock-condition-pill[data-condition="__missing__"] span {
  border-color: var(--line);
  color: var(--muted);
  font-style: italic;
}
.stock-condition-pill[data-condition="__missing__"]:hover span,
.stock-condition-pill[data-condition="__missing__"] input:checked + span {
  border-color: var(--muted-2);
  background: var(--hover);
  color: var(--muted);
}

.stock-filter-range {
  display: flex;
  gap: 8px;
}

.stock-filter-range .input {
  width: 110px;
  padding: 10px 14px;
  font-size: 0.88rem;
}

.stock-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 100%;
}

.stock-toolbar-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
  align-items: center;
}

.stock-sort-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px; font-size: 0.82rem;
}
.stock-sort-label { color: var(--muted); }
.stock-sort-btn {
  padding: 3px 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none;
  border: 1px solid transparent; transition: all 0.15s;
}
.stock-sort-btn:hover { color: var(--text); border-color: var(--border); }
.stock-sort-btn--active {
  color: var(--text); border-color: var(--accent);
  background: var(--hover); font-weight: 600;
}

.stock-selection-toolbar {
  position: fixed;
  top: calc(74px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 10009;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  width: auto;
  max-width: 1280px;
  margin: 0 auto;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.stock-selection-toolbar[hidden] {
  display: none !important;
}

.stock-selection-summary {
  display: grid;
  gap: 6px;
}

.stock-selection-summary strong,
.stock-selection-summary p {
  margin: 0;
}

.stock-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.stock-selection-actions form {
  margin: 0;
}

.stock-search-shell {
  flex: 1 1 420px;
  min-width: 260px;
  position: relative;
}

.stock-search-actions {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.stock-toolbar-help {
  flex: 1 1 100%;
  margin-top: -4px;
}

/* Selecteur scope (.stock-toolbar-top ...) pour passer devant .input{padding:14px 16px}
   declare plus bas a specificite egale — sinon le padding-right retombe a 16px et le
   texte du champ passe SOUS les 2 icones (scanner / image). (#400) */
.stock-toolbar-top .stock-search-input {
  width: 100%;
  padding-right: 6.8rem;
}

.stock-image-button {
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hover);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.stock-image-button:hover {
  transform: scale(1.04);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.stock-image-button svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.stock-appear-card {
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stock-appear-card.is-selected {
  border-color: rgba(223, 143, 120, 0.42);
  background: var(--accent-soft);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.2);
}

.stock-appear-card.is-selected .item-card-title {
  color: #ffd9ca;
}

.stock-image-button.is-loading {
  pointer-events: none;
}

.stock-image-button.is-loading svg {
  opacity: 0.2;
}

.stock-image-button.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spinnerTurn 0.8s linear infinite;
}

.stock-search-icon-button {
  position: relative;
}

.stock-image-loading[hidden] {
  display: none;
}

.stock-image-loading {
  position: sticky;
  top: 14px;
  z-index: 18;
  margin: -2px 0 14px;
  animation: stockSurfaceReveal 180ms ease both;
}

.stock-image-loading-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(223, 143, 120, 0.2);
  background: var(--surface-2);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.16);
}

.stock-image-loading-card strong {
  display: block;
  margin-bottom: 3px;
}

.stock-image-loading-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stock-image-loading-spinner {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  flex: 0 0 auto;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spinnerTurn 0.8s linear infinite;
}

.stock-image-hint {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.image-search-summary {
  display: grid;
  gap: 16px;
}

.image-search-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.image-search-head h2 {
  margin: 0 0 6px;
}

.image-search-preview {
  width: min(220px, 100%);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
}

.image-search-preview img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.field {
  display: grid;
  gap: 8px;
}

.field[hidden] {
  display: none !important;
}

.landing-hero {
  display: grid;
  gap: 24px;
  align-items: stretch;
  padding-top: 18px;
  perspective: 1200px;
}

.landing-copy h1 {
  margin: 16px 0 12px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
  max-width: 12ch;
}

.landing-lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.landing-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 28px;
}

.landing-proof,
.feature-grid,
.landing-columns {
  display: grid;
  gap: 14px;
}

.page-landing .page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(242,179,106,0.10), transparent 18%),
    radial-gradient(circle at 82% 24%, rgba(138,168,191,0.10), transparent 20%),
    radial-gradient(circle at 52% 74%, rgba(223,143,120,0.08), transparent 22%);
  animation: backgroundDrift 16s ease-in-out infinite;
}

.reveal-card {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition:
    opacity 520ms ease,
    transform 620ms cubic-bezier(.2,.8,.2,1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.proof-item,
.feature-card,
.landing-panel,
.hero-panel {
  background: linear-gradient(180deg, rgba(37, 32, 31, 0.94), rgba(18, 17, 17, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.proof-item,
.feature-card {
  padding: 16px;
}

.proof-item strong,
.feature-card strong {
  display: block;
  margin-bottom: 8px;
}

.proof-item span,
.feature-card p {
  color: var(--muted);
  margin: 0;
}

.landing-visual {
  display: grid;
  gap: 14px;
}

.hero-panel {
  padding: 18px;
}

.hero-panel-primary {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}

.hero-panel-primary::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% 25%;
  height: 220px;
  background: radial-gradient(circle, rgba(242,179,106,0.18), transparent 62%);
  pointer-events: none;
  animation: heroPulse 7s ease-in-out infinite;
}

.hero-panel-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, var(--hover) 24%, transparent 48%);
  transform: translateX(-120%);
  animation: scanSweep 8.5s ease-in-out infinite;
  pointer-events: none;
}

.hero-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.hero-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  overflow: hidden;
}

.hero-logo-art {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 26px rgba(223, 143, 120, 0.22));
}

.hero-rail {
  display: grid;
  gap: 14px;
  position: relative;
}

.hero-rail::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(242,179,106,0.65), rgba(138,168,191,0.2));
  opacity: 0.6;
}

.hero-rail-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: start;
}

.hero-rail-step p {
  margin: 6px 0 0;
  color: var(--muted);
}

.rail-index {
  width: 52px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.feature-card-accent {
  background:
    linear-gradient(180deg, rgba(64, 43, 35, 0.96), rgba(25, 20, 19, 0.98));
}

@keyframes backgroundDrift {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -1.5%, 0) scale(1.02);
  }
}

@keyframes heroPulse {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate3d(-2%, -4%, 0) scale(1.08);
    opacity: 1;
  }
}

@keyframes scanSweep {
  0%, 100% {
    transform: translateX(-120%);
    opacity: 0;
  }
  15% {
    opacity: 0.15;
  }
  55% {
    transform: translateX(120%);
    opacity: 0.22;
  }
  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

.landing-section {
  margin-top: 44px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  max-width: 18ch;
  margin: 14px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  line-height: 1.02;
}

.landing-columns-narrow .landing-panel h3 {
  margin-top: 0;
}

.landing-hero-v2 {
  position: relative;
  display: grid;
  gap: 30px;
  align-items: center;
  min-height: calc(100vh - 124px);
  padding: 24px 0 18px;
}

.landing-hero-v2::before,
.landing-hero-v2::after {
  content: "";
  position: absolute;
  pointer-events: none;
  filter: blur(26px);
}

.landing-hero-v2::before {
  top: 4%;
  left: -4%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(223,143,120,0.22), transparent 68%);
  animation: floatBlob 12s ease-in-out infinite;
}

.landing-hero-v2::after {
  right: 2%;
  bottom: 8%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(138,168,191,0.18), transparent 70%);
  animation: floatBlob 15s ease-in-out infinite reverse;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  margin: 16px 0 14px;
  font-size: clamp(3rem, 6vw, 6.2rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  max-width: 11ch;
}

.hero-lead {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink-blue);
  box-shadow: 0 0 0 0 rgba(138,168,191,0.3);
}

.signal-dot-live {
  background: var(--success);
  animation: pulseDot 2.4s ease-out infinite;
}

.signal-dot-alert {
  background: var(--accent-strong);
  animation: pulseDotWarm 2.7s ease-out infinite;
}

.hero-stage {
  position: relative;
  min-height: 620px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(29, 25, 24, 0.96), rgba(15, 14, 14, 0.98)),
    radial-gradient(circle at top, var(--hover-2), transparent 45%);
  box-shadow: 0 30px 70px rgba(0,0,0,0.34);
}

.hero-grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hover) 1px, transparent 1px),
    linear-gradient(90deg, var(--hover) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,1), rgba(0,0,0,0.1));
  opacity: 0.22;
}

.stage-panel {
  position: absolute;
  z-index: 2;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(47, 39, 37, 0.94), rgba(21, 18, 18, 0.96));
  border: 1px solid var(--line);
  box-shadow: 0 22px 40px rgba(0,0,0,0.26);
  backdrop-filter: blur(10px);
}

.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-item-card {
  top: 44px;
  left: 30px;
  width: 230px;
  padding: 16px;
  animation: panelFloat 6.5s ease-in-out infinite;
}

.hero-item-top {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.hero-item-top p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hero-item-thumb {
  width: 62px;
  height: 74px;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(242,179,106,0.95), rgba(223,143,120,0.78)),
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.hero-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-item-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-hub {
  top: 160px;
  left: 286px;
  width: 206px;
  padding: 18px;
  text-align: center;
  animation: panelFloat 7.8s ease-in-out infinite 0.8s;
}

.hero-hub-logo {
  width: 76px;
  height: 76px;
  margin: 18px auto 14px;
}

.hero-hub-stack {
  display: grid;
  gap: 10px;
}

.hub-stack-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stack-chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.stack-chip-accent {
  color: var(--accent-strong);
  border-color: rgba(242,179,106,0.22);
}

.hero-jobs {
  right: 26px;
  top: 64px;
  width: 244px;
  padding: 16px;
  animation: panelFloat 8.4s ease-in-out infinite 1.2s;
}

.job-pulse-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 14px;
}

.job-pulse-row p {
  margin: 6px 0 0;
  color: var(--muted);
}

.job-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--ink-blue);
  box-shadow: 0 0 0 0 rgba(138,168,191,0.25);
}

.job-dot-live {
  background: var(--success);
  animation: pulseDot 2.4s ease-out infinite;
}

.job-dot-alert {
  background: var(--accent-strong);
  animation: pulseDotWarm 2.7s ease-out infinite;
}

.pricing-overview,
.pricing-layout {
  display: grid;
  gap: 18px;
}

.pricing-page-stack {
  display: grid;
  gap: 18px;
}

.mobile-split-shell {
  min-width: 0;
}

.mobile-split-track {
  min-width: 0;
}

.mobile-split-main-stack {
  display: grid;
  gap: 18px;
}

.pricing-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.pricing-hub-card {
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 100%;
}

.pricing-hub-card-primary {
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(40, 36, 36, 0.94), rgba(24, 22, 22, 0.96));
}

.pricing-hub-step {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(223, 143, 120, 0.14);
  border: 1px solid rgba(223, 143, 120, 0.28);
  color: var(--accent-strong);
  font-weight: 800;
}

.pricing-hub-copy h2 {
  margin: 8px 0 8px;
}

.pricing-hub-copy p,
.pricing-hub-note p {
  margin: 0;
}

.pricing-hub-meta,
.pricing-hub-actions,
.pricing-strip-actions,
.pricing-empty-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pricing-hub-note {
  display: grid;
  gap: 8px;
}

.pricing-hub-note strong {
  font-size: 1rem;
}

.pricing-strip-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.pricing-strip-card strong {
  display: block;
  margin-bottom: 6px;
}

.pricing-strip-card p {
  margin: 0;
}

.pricing-threshold-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.pricing-threshold-form .field {
  min-width: 180px;
}

.pricing-empty-focus {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(223, 143, 120, 0.24);
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.08), transparent 34%),
    var(--hover-2);
}

.pricing-empty-focus strong {
  font-size: 1.08rem;
}

.pricing-list-card,
.pricing-jobs-panel {
  display: grid;
  gap: 14px;
}

.pricing-control-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.pricing-home-grid,
.pricing-home-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.pricing-home-card,
.pricing-home-summary-card {
  display: grid;
  gap: 16px;
}

.pricing-home-card-primary {
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(40, 36, 36, 0.94), rgba(24, 22, 22, 0.96));
}

.pricing-home-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.pricing-home-card-head h2 {
  margin: 10px 0 6px;
}

.pricing-home-stats,
.pricing-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pricing-home-flow-list {
  display: grid;
  gap: 12px;
}

.pricing-home-flow-step {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
}

.pricing-home-flow-step p,
.pricing-home-flow-step strong {
  margin: 0;
}

.pricing-home-flow-step p {
  margin-top: 6px;
}

.pricing-control-card {
  display: grid;
  gap: 16px;
}

.pricing-control-card-primary {
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(40, 36, 36, 0.94), rgba(24, 22, 22, 0.96));
}

.pricing-control-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.pricing-control-head h2 {
  margin: 10px 0 6px;
}

.pricing-control-stats,
.pricing-marketplaces-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pricing-section {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.pricing-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.pricing-section-head h2 {
  margin: 0 0 6px;
}

.pricing-workspace-shell {
  position: relative;
  display: grid;
  gap: 18px;
}

.pricing-workspace-shell-locked .toolbar,
.pricing-workspace-shell-locked .pricing-bulk-toolbar,
.pricing-workspace-shell-locked .pricing-items-panel {
  opacity: 0.28;
  filter: grayscale(0.1);
  pointer-events: none;
}

.pricing-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 20px;
}

.pricing-lock-card {
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
  text-align: center;
  padding: 24px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid rgba(223, 143, 120, 0.28);
  box-shadow: var(--shadow);
}

.pricing-lock-card strong {
  font-size: 1.18rem;
}

.pricing-bulk-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.pricing-bulk-actions,
.pricing-selection-submit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pricing-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.pricing-summary-head h2,
.pricing-jobs-panel h2 {
  margin-top: 0;
}

.pricing-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pricing-rule-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pricing-warning {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(242, 179, 106, 0.12);
  border: 1px solid rgba(242, 179, 106, 0.24);
  color: var(--text);
}

  .pricing-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    align-items: start;
  }

  .pricing-layout.mobile-split-shell > .mobile-split-track {
    display: contents;
  }

  .pricing-origin-mobile-split.mobile-split-shell > .mobile-split-track {
    display: contents;
  }

.pricing-item-list {
  display: grid;
  gap: 14px;
}

.pricing-item-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
}

.pricing-item-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.pricing-item-media {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.pricing-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pricing-item-copy {
  min-width: 0;
}

.pricing-item-copy strong {
  display: block;
  font-size: 1rem;
}

.pricing-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pricing-item-check {
  display: grid;
  place-items: center;
}

.pricing-item-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.pricing-item-side {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.pricing-item-list-compact {
  gap: 12px;
}

.pricing-item-row-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.pricing-item-side-compact {
  min-width: 96px;
}

.pricing-repricing-panel {
  display: grid;
  gap: 14px;
}

.pricing-repricing-list {
  display: grid;
  gap: 14px;
}

.pricing-repricing-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
  padding: 16px;
  border-radius: 20px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
}

.pricing-repricing-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
}

.pricing-repricing-controls {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.pricing-control-deck-single {
  grid-template-columns: 1fr;
}

.pricing-inline-note {
  margin-top: 10px;
  color: var(--warning);
  font-size: 0.92rem;
}

.pricing-repricing-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hover);
}

.pricing-repricing-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-repricing-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, 120px) auto;
  gap: 10px;
  align-items: center;
}

.pricing-settings-intro {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.pricing-repricing-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.pricing-repricing-details[open] summary {
  color: var(--text);
}

@media (max-width: 980px) {
  .stock-selection-toolbar {
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
  }

  .stock-selection-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .stock-selection-actions {
    justify-content: flex-start;
  }

  .pricing-hub-grid,
  .pricing-home-grid,
  .pricing-home-summary-grid,
  .pricing-control-deck {
    grid-template-columns: 1fr;
  }

  .pricing-strip-card {
    flex-direction: column;
    align-items: start;
  }

  .pricing-section-head {
    align-items: start;
    flex-direction: column;
  }

  .pricing-bulk-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pricing-bulk-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .pricing-layout {
    grid-template-columns: 1fr;
  }

  .pricing-item-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .pricing-item-side {
    grid-column: 1 / -1;
    justify-items: stretch;
  }

  .pricing-item-check {
    place-items: start;
    padding-top: 6px;
  }

  .pricing-item-main {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
  }

  .pricing-item-copy strong {
    overflow-wrap: anywhere;
  }

  .pricing-item-side .button {
    width: 100%;
  }

  .pricing-repricing-row {
    grid-template-columns: 1fr;
  }

  .pricing-repricing-main {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .pricing-home-card-head {
    flex-direction: column;
    align-items: start;
  }

  .pricing-repricing-form {
    grid-template-columns: 1fr;
  }
}

.marketplace-orbit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.orbit-badge {
  position: absolute;
  padding: 12px 14px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.22);
}

.orbit-amazon { top: 70px; right: 84px; animation: orbitBob 7.2s ease-in-out infinite; }
.orbit-rakuten { top: 220px; right: 94px; animation: orbitBob 7.8s ease-in-out infinite 0.6s; }
.orbit-ebay { top: 360px; right: 84px; animation: orbitBob 8.1s ease-in-out infinite 1s; }
.orbit-lbc { top: 300px; left: 70px; animation: orbitBob 7.4s ease-in-out infinite 0.4s; }

.hero-flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.flow-line {
  fill: none;
  stroke: rgba(242,179,106,0.72);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 12 14;
  animation: flowDash 14s linear infinite;
}

.flow-line-secondary {
  stroke: rgba(138,168,191,0.6);
  animation-duration: 18s;
}

.landing-flow-section .section-heading h2,
.integrations-section .section-heading h2,
.product-stage-section .section-heading h2,
.audience-section .section-heading h2,
.contrast-section .section-heading h2 {
  max-width: 20ch;
}

.pipeline-board {
  position: relative;
  display: grid;
  gap: 14px;
}

.pipeline-board::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: linear-gradient(180deg, rgba(242,179,106,0.55), rgba(138,168,191,0.18));
}

.pipeline-node {
  position: relative;
  padding: 22px 22px 22px 74px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(41, 35, 34, 0.96), rgba(18, 16, 16, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.pipeline-node h3 {
  margin: 2px 0 8px;
}

.pipeline-node p {
  margin: 0;
  color: var(--muted);
}

.pipeline-index {
  position: absolute;
  left: 18px;
  top: 22px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 900;
}

.pipeline-node-alert {
  background: linear-gradient(180deg, rgba(66, 46, 37, 0.96), rgba(24, 17, 16, 0.98));
}

.integrations-stage {
  position: relative;
  display: grid;
  gap: 16px;
}

.integration-core,
.integration-card {
  position: relative;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(40,36,36,0.95), rgba(18,17,17,0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.integration-core {
  text-align: center;
  overflow: hidden;
}

.integration-core::after {
  content: "";
  position: absolute;
  inset: auto -10% -36% 20%;
  height: 200px;
  background: radial-gradient(circle, rgba(223,143,120,0.18), transparent 62%);
  pointer-events: none;
}

.integration-core-logo {
  width: 84px;
  height: 84px;
  display: block;
  margin: 0 auto 14px;
}

.integration-core p,
.integration-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.integration-wordmark {
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.integration-card-amazon { transform: translateX(0); }
.integration-card-rakuten { transform: translateX(0); }
.integration-card-ebay { transform: translateX(0); }
.integration-card-lbc { transform: translateX(0); }

.product-stage {
  display: grid;
  gap: 18px;
}

.product-screen {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(34,31,31,0.95), rgba(14,14,14,0.98));
  border: 1px solid var(--line);
  box-shadow: 0 28px 50px rgba(0,0,0,0.3);
  padding: 18px;
}

.screen-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
}

.screen-top strong {
  margin-left: 10px;
  color: var(--text);
}

.window-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-2);
}

.stock-list-mini,
.jobs-stack-mini,
.flow-bars {
  display: grid;
  gap: 12px;
}

.stock-row-mini,
.job-mini {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
}

.stock-row-mini p,
.job-mini p {
  margin: 4px 0 0;
  color: var(--muted);
}

.stock-thumb-mini {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(242,179,106,0.95), rgba(223,143,120,0.78));
}

.stock-thumb-mini-orange {
  background: linear-gradient(145deg, rgba(223,143,120,0.95), rgba(167,93,66,0.78));
}

.stock-thumb-mini-blue {
  background: linear-gradient(145deg, rgba(138,168,191,0.88), rgba(102,127,145,0.75));
}

.job-mini {
  grid-template-columns: 16px 1fr;
}

.job-mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ink-blue);
}

.job-mini-live .job-mini-dot {
  background: var(--success);
}

.job-mini-alert .job-mini-dot {
  background: var(--accent-strong);
}

.flow-bar {
  display: grid;
  gap: 8px;
}

.flow-bar span {
  color: var(--text);
  font-weight: 700;
}

.flow-meter {
  height: 12px;
  border-radius: 999px;
  background: var(--hover);
  overflow: hidden;
  border: 1px solid var(--hover);
}

.flow-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(242,179,106,0.95), rgba(223,143,120,0.88));
  animation: meterPulse 4.5s ease-in-out infinite;
}

.flow-meter-alert i {
  background: linear-gradient(90deg, rgba(223,143,120,0.95), rgba(138,168,191,0.78));
}

.audience-grid,
.contrast-grid {
  display: grid;
  gap: 16px;
}

.audience-card,
.contrast-side,
.contrast-core {
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(39,34,34,0.96), rgba(17,16,16,0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.audience-card p,
.contrast-side p,
.contrast-core p {
  color: var(--muted);
  margin-bottom: 0;
}

.contrast-core {
  text-align: center;
}

.contrast-logo {
  width: 82px;
  height: 82px;
  display: block;
  margin: 0 auto 14px;
}

.contrast-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.contrast-side-good {
  background: linear-gradient(180deg, rgba(64,43,35,0.96), rgba(19,17,17,0.98));
}

.landing-cta-section {
  padding-bottom: 30px;
}

.cta-shell {
  display: grid;
  gap: 18px;
  align-items: center;
  padding: 28px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(56, 40, 36, 0.96), rgba(18, 17, 17, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 34px 58px rgba(0,0,0,0.32);
}

.cta-shell h2 {
  margin: 14px 0 10px;
  max-width: 16ch;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
}

.landing-hero-v3 {
  position: relative;
  display: grid;
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 124px);
  padding: 28px 0 22px;
}

.landing-hero-v3::before,
.landing-hero-v3::after {
  content: "";
  position: absolute;
  pointer-events: none;
  filter: blur(22px);
}

.landing-hero-v3::before {
  top: 8%;
  left: -2%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(223, 143, 120, 0.22), transparent 66%);
  animation: floatBlob 14s ease-in-out infinite;
}

.landing-hero-v3::after {
  right: 0;
  bottom: 6%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(138, 168, 191, 0.18), transparent 66%);
  animation: floatBlob 16s ease-in-out infinite reverse;
}

.hero-copy-v3 {
  position: relative;
  z-index: 2;
}

.hero-copy-v3 h1 {
  margin: 18px 0 14px;
  max-width: 10.5ch;
  font-size: clamp(3.2rem, 6vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.hero-stage-v3 {
  min-height: 680px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, var(--hover), transparent 28%),
    linear-gradient(180deg, rgba(29, 25, 24, 0.96), rgba(10, 10, 10, 0.98));
}

.hero-stage-v3::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 26px;
  border: 1px solid var(--hover-2);
  pointer-events: none;
}

.hero-flow-svg-v3 {
  opacity: 0.96;
}

.hero-item-card-v3 {
  width: 236px;
  top: 52px;
  left: 28px;
}

.hero-hub-v3 {
  width: 230px;
  top: 176px;
  left: 252px;
}

.hero-jobs-v3 {
  width: 256px;
  top: 66px;
  right: 26px;
}

.hero-sync-card {
  left: 80px;
  bottom: 44px;
  width: 262px;
  padding: 18px;
  animation: panelFloat 7.2s ease-in-out infinite 0.4s;
}

.hero-sync-card p {
  margin: 8px 0 0;
}

.hero-sync-bars {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.hero-sync-bars span {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(242, 179, 106, 0.95), rgba(223, 143, 120, 0.75));
  animation: meterPulse 4.2s ease-in-out infinite;
}

.hero-sync-bars span:nth-child(2) {
  animation-delay: 0.35s;
}

.hero-sync-bars span:nth-child(3) {
  animation-delay: 0.7s;
}

.hero-command-strip {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 10px;
  overflow: hidden;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
}

.hero-command-strip span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--hover-2);
  color: var(--muted);
  white-space: nowrap;
  animation: marqueeShift 13s linear infinite;
}

.marketplace-orbit-v3 .orbit-badge {
  padding: 14px 16px;
}

.landing-flow-system {
  margin-top: 72px;
}

.pipeline-ribbon {
  position: relative;
  display: grid;
  gap: 16px;
}

.pipeline-ribbon-line {
  position: absolute;
  top: 42px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, rgba(223, 143, 120, 0.25), rgba(242, 179, 106, 0.8), rgba(138, 168, 191, 0.24));
  opacity: 0.75;
}

.pipeline-ribbon-node {
  position: relative;
  padding: 30px 22px 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(40, 35, 34, 0.95), rgba(14, 13, 13, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.assistant-sidebar,
.assistant-chat-panel,
.assistant-sidecards .panel {
  display: grid;
  gap: 14px;
}

.assistant-main {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.assistant-thread-list,
.assistant-message-list,
.assistant-approval-list,
.assistant-sidecards {
  display: grid;
  gap: 12px;
}

.assistant-thread-card,
.assistant-message,
.assistant-approval-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
}

.assistant-thread-card.is-active {
  border-color: rgba(223, 143, 120, 0.55);
  box-shadow: 0 0 0 1px rgba(223, 143, 120, 0.2) inset;
}

.assistant-thread-card span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.assistant-message-user {
  margin-left: 56px;
}

.assistant-message-assistant {
  margin-right: 56px;
}

.assistant-message-role {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.assistant-message-body {
  white-space: pre-wrap;
}

.assistant-prompt-form,
.assistant-approval-actions {
  display: grid;
  gap: 12px;
}

.assistant-approval-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assistant-tool-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.assistant-compact-page {
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  background: var(--panel);
  overflow: hidden;
}

.assistant-compact-shell {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.assistant-compact-notice {
  margin: 0;
  flex: 0 0 auto;
}

.assistant-compact-section-label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.assistant-compact-message-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
  gap: 8px;
}

.assistant-compact-approvals {
  flex: 0 0 auto;
  max-height: 110px;
  overflow: auto;
  padding-right: 4px;
  gap: 8px;
}

.assistant-compact-approvals .assistant-approval-top strong {
  font-size: 0.82rem;
}

.assistant-compact-approvals .assistant-approval-actions {
  gap: 8px;
}

.assistant-compact-approvals .button {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
}

.assistant-message-thinking {
  border-style: dashed;
  border-color: var(--line-2);
}

.assistant-thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.assistant-thinking-label {
  color: var(--text);
}

.assistant-thinking-text {
  min-width: 26px;
  color: rgba(223, 143, 120, 0.92);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.assistant-thinking-text::before {
  content: ".";
  animation: assistant-thinking-ellipsis-text 1.1s steps(1, end) infinite;
}

@keyframes assistant-thinking-ellipsis-text {
  0%, 24% {
    content: ".";
  }
  25%, 49% {
    content: "..";
  }
  50%, 74% {
    content: "...";
  }
  75%, 100% {
    content: "..";
  }
}

.assistant-compact-form {
  margin-top: 0;
  flex: 0 0 auto;
}

.assistant-compact-message-list .assistant-message,
.assistant-compact-approvals .assistant-approval-card {
  gap: 6px;
  padding: 10px 12px;
  border-radius: 16px;
}

.assistant-compact-message-list .assistant-message-user {
  margin-left: 28px;
  margin-right: 0;
  border-color: rgba(223, 143, 120, 0.2);
  background: rgba(74, 45, 39, 0.62);
}

.assistant-compact-message-list .assistant-message-assistant {
  margin-right: 22px;
  margin-left: 0;
}

.assistant-compact-message-list .assistant-message-role {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.assistant-compact-message-list .assistant-message-body,
.assistant-compact-approvals p {
  font-size: 0.9rem;
  line-height: 1.4;
}

.assistant-compact-composer {
  display: grid;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: var(--surface-inset);
  overflow: hidden;
}

.assistant-compact-textarea {
  min-height: 94px;
  max-height: 126px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px 14px 10px;
  resize: none;
  line-height: 1.42;
}

.assistant-compact-textarea:focus {
  outline: none;
}

.assistant-compact-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.assistant-compact-icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, background 140ms ease, box-shadow 140ms ease;
}

.assistant-compact-icon-button:hover {
  transform: translateY(-1px);
}

.assistant-compact-icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-compact-icon-button-ghost {
  background: var(--hover);
  color: var(--text);
}

.assistant-compact-icon-button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.assistant-compact-form.is-busy .assistant-compact-composer {
  border-color: rgba(223, 143, 120, 0.24);
  box-shadow: 0 0 0 1px rgba(223, 143, 120, 0.08) inset;
}

.assistant-compact-form.is-busy .assistant-compact-icon-button {
  opacity: 0.72;
}

.assistant-fab {
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  --assistant-fab-bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9997;
  display: grid;
  justify-items: end;
  gap: 12px;
  pointer-events: none;
}

.assistant-fab-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition:
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 200ms ease,
    filter 180ms ease,
    opacity 180ms ease;
  pointer-events: auto;
}

.assistant-fab-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.assistant-fab-icon svg {
  width: 18px;
  height: 18px;
}

.assistant-fab-panel {
  position: fixed;
  right: 18px;
  bottom: calc(var(--assistant-fab-bottom) + 64px);
  width: min(340px, calc(100vw - 28px));
  height: min(420px, calc(100dvh - 118px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  transform-origin: bottom right;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  filter: saturate(0.92) blur(1px);
  pointer-events: none;
  transition:
    width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    height 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    filter 180ms ease,
    box-shadow 220ms ease;
}

.assistant-fab-panel[hidden] {
  display: none !important;
}

.assistant-fab.is-open .assistant-fab-toggle {
  transform: translateY(2px) scale(0.985);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  filter: saturate(0.92);
}

.assistant-fab.is-open .assistant-fab-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  filter: saturate(1) blur(0);
  pointer-events: auto;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.46);
}

.assistant-fab-panel.is-expanded {
  width: min(520px, calc(100vw - 28px));
  height: min(680px, calc(100dvh - 72px));
}

.assistant-fab-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 3;
}

.assistant-fab-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 8;
}

.assistant-fab-handle {
  flex: 1 1 auto;
  min-width: 0;
  touch-action: auto;
  user-select: none;
}

.assistant-fab-handle .muted {
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1.25;
}

.assistant-fab-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
}

.assistant-fab-size {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.assistant-fab-open-full {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
}

.assistant-fab-open-full svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-fab-close,
.assistant-fab-panel-top .button {
  cursor: pointer;
  pointer-events: auto;
}

.assistant-fab-close,
.assistant-fab-open-full,
.assistant-fab-size {
  position: relative;
  z-index: 9;
}

.assistant-fab-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  position: relative;
  z-index: 1;
  display: block;
  opacity: 0.72;
  transition: opacity 220ms ease 60ms;
}

.assistant-fab.is-open .assistant-fab-frame {
  opacity: 1;
}

@media (max-width: 1180px) {
  .assistant-layout,
  .assistant-main {
    grid-template-columns: 1fr;
  }

  .assistant-message-user,
  .assistant-message-assistant {
    margin-left: 0;
    margin-right: 0;
  }

  .assistant-fab {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    --assistant-fab-bottom: max(12px, env(safe-area-inset-bottom));
    left: auto;
    justify-items: end;
  }

  .assistant-fab-toggle {
    justify-content: center;
  }

  .assistant-fab-panel {
    right: 12px;
    width: min(334px, calc(100vw - 20px));
    height: min(430px, calc(100dvh - 110px));
  }

  .assistant-fab-panel.is-expanded {
    width: min(388px, calc(100vw - 20px));
    height: min(560px, calc(100dvh - 70px));
  }

  .assistant-fab-panel-top {
    padding: 12px 14px;
  }

  .assistant-fab-handle .muted {
    font-size: 0.72rem;
    line-height: 1.2;
  }
}

.pipeline-ribbon-node:hover,
.pipeline-ribbon-node.is-active {
  transform: translateY(-4px);
  border-color: rgba(242, 179, 106, 0.26);
  box-shadow: 0 30px 46px rgba(0, 0, 0, 0.34);
}

.pipeline-ribbon-node h3 {
  margin: 16px 0 10px;
}

.pipeline-ribbon-node p {
  margin: 0;
  color: var(--muted);
}

.pipeline-ribbon-index {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--hover);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pipeline-ribbon-node-alert {
  background: linear-gradient(180deg, rgba(66, 45, 37, 0.96), rgba(20, 15, 15, 0.98));
}

.integrations-showcase-shell {
  display: grid;
  gap: 18px;
}

.integration-wall {
  position: relative;
  min-height: 420px;
  padding: 24px;
  overflow: hidden;
}

.integration-wall-grid {
  position: absolute;
  inset: 0;
}

.integration-badge {
  position: absolute;
  padding: 14px 16px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--line);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22);
  font-weight: 700;
  backdrop-filter: blur(8px);
  animation: orbitBob 8s ease-in-out infinite;
}

.integration-badge-amazon { top: 18%; left: 9%; }
.integration-badge-rakuten { top: 16%; right: 8%; animation-delay: 0.5s; }
.integration-badge-ebay { bottom: 18%; right: 10%; animation-delay: 1s; }
.integration-badge-lbc { bottom: 16%; left: 8%; animation-delay: 1.5s; }

.integration-hub-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: grid;
  place-items: center;
  gap: 10px;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  background:
    radial-gradient(circle at top, var(--line), transparent 46%),
    linear-gradient(180deg, rgba(53, 41, 38, 0.97), rgba(18, 17, 17, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 26px 46px rgba(0, 0, 0, 0.32);
  text-align: center;
  padding: 24px;
}

.integration-hub-center img {
  width: 74px;
  height: 74px;
}

.integration-hub-center span {
  color: var(--muted);
  font-size: 0.92rem;
}

.integration-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.integration-lines path {
  fill: none;
  stroke: rgba(242, 179, 106, 0.75);
  stroke-width: 2.4;
  stroke-dasharray: 10 14;
  animation: flowDash 15s linear infinite;
}

.integration-story-grid {
  display: grid;
  gap: 14px;
}

.integration-story-card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(39, 34, 34, 0.96), rgba(17, 16, 16, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.integration-story-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.product-command-grid {
  display: grid;
  gap: 18px;
}

.product-command-card {
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(34, 31, 31, 0.95), rgba(14, 14, 14, 0.98));
  border: 1px solid var(--line);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.3);
}

.product-command-map {
  position: relative;
  overflow: hidden;
}

.product-command-map::after {
  content: "";
  position: absolute;
  inset: auto -18% -36% 30%;
  height: 220px;
  background: radial-gradient(circle, rgba(223, 143, 120, 0.18), transparent 62%);
  pointer-events: none;
}

@keyframes marqueeShift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-18px); }
}

@keyframes panelFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -8px, 0); }
}

@keyframes orbitBob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

@keyframes flowDash {
  to { stroke-dashoffset: -340; }
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(125,214,170,0.4); }
  100% { box-shadow: 0 0 0 12px rgba(125,214,170,0); }
}

@keyframes pulseDotWarm {
  0% { box-shadow: 0 0 0 0 rgba(242,179,106,0.4); }
  100% { box-shadow: 0 0 0 12px rgba(242,179,106,0); }
}

@keyframes meterPulse {
  0%, 100% { opacity: 0.95; filter: saturate(1); }
  50% { opacity: 1; filter: saturate(1.2); }
}

@keyframes floatBlob {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.08); }
}

/* ============================================================
   LANDING V4 — Concrete reseller flow
   ============================================================ */

.landing-hero-v4 {
  position: relative;
  display: grid;
  gap: 36px;
  align-items: center;
  min-height: calc(100vh - 124px);
  padding: 28px 0 22px;
}

.landing-hero-v4::before,
.landing-hero-v4::after {
  content: "";
  position: absolute;
  pointer-events: none;
  filter: blur(28px);
}

.landing-hero-v4::before {
  top: 6%;
  left: -3%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(223, 143, 120, 0.2), transparent 66%);
  animation: floatBlob 14s ease-in-out infinite;
}

.landing-hero-v4::after {
  right: -1%;
  bottom: 8%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(138, 168, 191, 0.16), transparent 66%);
  animation: floatBlob 17s ease-in-out infinite reverse;
}

.hero-copy-v4 {
  position: relative;
  z-index: 2;
}

.hero-copy-v4 h1 {
  margin: 18px 0 16px;
  max-width: 16ch;
  font-size: clamp(2.8rem, 5.5vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

/* --- Hero demo panel --- */
.hero-demo-v4 {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 30%, var(--hover-2), transparent 40%),
    linear-gradient(180deg, rgba(26, 23, 22, 0.97), rgba(12, 11, 11, 0.99));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.36);
  padding: 28px 24px;
  display: grid;
  gap: 20px;
}

.hero-demo-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hover-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--hover-2) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.05));
  opacity: 0.3;
}

/* Object card */
.hero-object-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(50, 42, 39, 0.95), rgba(30, 26, 25, 0.97));
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

.hero-object-thumb {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
}

.hero-object-thumb svg {
  width: 48px;
  height: 48px;
}

.hero-object-info {
  display: grid;
  gap: 3px;
}

.hero-object-info strong {
  font-size: 1.08rem;
}

.hero-object-ean,
.hero-object-state {
  font-size: 0.82rem;
  color: var(--muted);
}

.hero-object-state {
  color: var(--success);
}

.hero-object-price {
  text-align: right;
  display: grid;
  gap: 2px;
}

.hero-object-price strong {
  font-size: 1.3rem;
  color: var(--accent-strong);
}

.hero-object-price-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hero-object-confidence {
  font-size: 0.78rem;
  color: var(--success);
}

/* Channel row */
.hero-channels-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.hero-channel {
  display: grid;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
  text-align: center;
  transition: all 400ms ease;
}

.hero-channel-active {
  border-color: rgba(125, 214, 170, 0.25);
}

.hero-channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  margin: 0 auto;
  box-shadow: 0 0 0 0 rgba(125, 214, 170, 0.3);
  animation: pulseDot 2.4s ease-out infinite;
}

.hero-channel-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.hero-channel-price {
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 0.92rem;
}

.hero-channel-status {
  font-size: 0.76rem;
  color: var(--success);
}

.hero-channel-sold .hero-channel-dot {
  background: var(--accent-strong);
  animation: pulseDotWarm 2.4s ease-out infinite;
}

.hero-channel-sold .hero-channel-status {
  color: var(--accent-strong);
}

.hero-channel-removed {
  opacity: 0.35;
  border-color: var(--hover-2);
}

.hero-channel-removed .hero-channel-dot {
  background: var(--muted);
  animation: none;
}

.hero-channel-removed .hero-channel-status {
  color: var(--muted);
}

/* Sale event */
.hero-sale-event {
  position: relative;
  z-index: 1;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(66, 46, 37, 0.6), rgba(30, 22, 20, 0.8));
  border: 1px solid rgba(242, 179, 106, 0.2);
  display: grid;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.hero-sale-event.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-sale-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  font-weight: 700;
}

.hero-sale-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-sale-action {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--hover);
  border: 1px solid var(--hover);
  color: var(--muted);
}

.hero-sale-action-done {
  color: var(--accent-strong);
  border-color: rgba(242, 179, 106, 0.3);
  background: rgba(242, 179, 106, 0.08);
}

.hero-sale-action-remove {
  color: #e87373;
  border-color: rgba(232, 115, 115, 0.22);
  background: rgba(232, 115, 115, 0.06);
}

.hero-sale-action-sync {
  color: var(--ink-blue);
  border-color: rgba(138, 168, 191, 0.25);
  background: rgba(138, 168, 191, 0.06);
}

/* Timeline strip */
.hero-timeline-strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
  overflow-x: auto;
}

.hero-timeline-step {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--hover-2);
  border: 1px solid var(--hover);
  white-space: nowrap;
  transition: all 300ms ease;
}

.hero-timeline-step.is-done {
  color: var(--success);
  border-color: rgba(125, 214, 170, 0.2);
  background: rgba(125, 214, 170, 0.06);
}

.hero-timeline-step.is-active {
  color: var(--accent-strong);
  border-color: rgba(242, 179, 106, 0.35);
  background: rgba(242, 179, 106, 0.1);
  box-shadow: 0 0 0 0 rgba(242, 179, 106, 0.3);
  animation: pulseDotWarm 2.5s ease-out infinite;
}

/* ===== JOURNEY SECTION ===== */
.landing-journey {
  margin-top: 80px;
}

.journey-track {
  position: relative;
  display: grid;
  gap: 0;
}

.journey-line {
  position: absolute;
  left: 27px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(242, 179, 106, 0.6), rgba(138, 168, 191, 0.2), rgba(125, 214, 170, 0.4));
}

.journey-step {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 24px 0;
}

.journey-step-marker {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.journey-step-num {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(50, 42, 39, 0.95), rgba(26, 22, 21, 0.98));
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.journey-step-marker-success .journey-step-num {
  border-color: rgba(125, 214, 170, 0.3);
  color: var(--success);
}

.journey-step-body h3 {
  margin: 4px 0 10px;
  font-size: 1.2rem;
}

.journey-step-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 56ch;
}

.journey-step-example {
  margin-top: 16px;
}

.journey-example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journey-tag {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--hover-2);
  border: 1px solid var(--hover);
  color: var(--text);
}

.journey-tag-state {
  color: var(--success);
  border-color: rgba(125, 214, 170, 0.22);
}

/* Pricing demo in journey */
.journey-pricing-demo {
  max-width: 340px;
}

.journey-pricing-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--hover);
  overflow: hidden;
}

.journey-pricing-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 1.2s ease;
}

.journey-pricing-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.journey-pricing-value {
  color: var(--accent-strong);
  font-weight: 700;
}

/* Channel pills in journey */
.journey-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journey-channel-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.journey-channel-amazon { color: #ff9900; border-color: rgba(255, 153, 0, 0.25); }
.journey-channel-rakuten { color: #bf0000; border-color: rgba(191, 0, 0, 0.2); }
.journey-channel-ebay { color: #e53238; border-color: rgba(229, 50, 56, 0.2); }
.journey-channel-lbc { color: #f56b2a; border-color: rgba(245, 107, 42, 0.2); }

/* Repricing demo */
.journey-reprice-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.journey-reprice-day {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--hover-2);
  border: 1px solid var(--hover);
}

.journey-reprice-arrow {
  color: var(--muted);
  font-size: 0.9rem;
}

.journey-reprice-floor {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e87373;
  background: rgba(232, 115, 115, 0.06);
  border: 1px solid rgba(232, 115, 115, 0.2);
}

/* Sync demo */
.journey-sync-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journey-sync-pill {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--hover-2);
  border: 1px solid var(--hover);
}

.journey-sync-sold {
  color: var(--accent-strong);
  border-color: rgba(242, 179, 106, 0.3);
  background: rgba(242, 179, 106, 0.06);
}

.journey-sync-removed {
  color: #e87373;
  border-color: rgba(232, 115, 115, 0.18);
  background: rgba(232, 115, 115, 0.04);
}

/* ===== IA SECTION ===== */
.ia-grid {
  display: grid;
  gap: 16px;
}

.ia-card {
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(38, 33, 32, 0.96), rgba(16, 15, 15, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.ia-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(242, 179, 106, 0.08);
  border: 1px solid rgba(242, 179, 106, 0.18);
  color: var(--accent-strong);
}

.ia-card strong {
  font-size: 1.05rem;
}

.ia-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* ===== CHANNELS SECTION ===== */
.channels-grid {
  display: grid;
  gap: 16px;
}

.channel-card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(36, 32, 31, 0.96), rgba(15, 14, 14, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.channel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.channel-badge {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.channel-badge-amazon {
  color: #ff9900;
  background: rgba(255, 153, 0, 0.08);
  border: 1px solid rgba(255, 153, 0, 0.22);
}

.channel-badge-rakuten {
  color: #bf0000;
  background: rgba(191, 0, 0, 0.06);
  border: 1px solid rgba(191, 0, 0, 0.18);
}

.channel-badge-ebay {
  color: #e53238;
  background: rgba(229, 50, 56, 0.06);
  border: 1px solid rgba(229, 50, 56, 0.18);
}

.channel-badge-lbc {
  color: #f56b2a;
  background: rgba(245, 107, 42, 0.06);
  border: 1px solid rgba(245, 107, 42, 0.18);
}

.channel-card-type {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--hover-2);
  border: 1px solid var(--hover);
  color: var(--muted);
}

.channel-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* ===== EXCEPTIONS SECTION ===== */
.exceptions-grid {
  display: grid;
  gap: 16px;
}

.exception-card {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(40, 34, 33, 0.96), rgba(16, 14, 14, 0.98));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
}

.exception-card strong {
  grid-column: 2;
  margin-top: -2px;
}

.exception-card p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.exception-card-icon {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.1rem;
}

.exception-card-icon-warn {
  color: var(--accent-strong);
  background: rgba(242, 179, 106, 0.08);
  border: 1px solid rgba(242, 179, 106, 0.2);
}

.exception-card-icon-info {
  color: var(--ink-blue);
  background: rgba(138, 168, 191, 0.08);
  border: 1px solid rgba(138, 168, 191, 0.2);
}

/* ===== HERO DEMO ANIMATION ===== */
@keyframes saleSlideIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== V4 RESPONSIVE ===== */
@media (min-width: 760px) {
  .landing-hero-v4 {
    grid-template-columns: minmax(0, 1.05fr) minmax(480px, 0.95fr);
    gap: 36px;
  }

  .ia-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .channels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .exceptions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 759px) {
  .hero-channels-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-object-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-object-thumb {
    margin: 0 auto;
  }

  .hero-object-price {
    text-align: center;
  }

  .journey-step {
    grid-template-columns: 44px 1fr;
    gap: 14px;
  }

  .journey-step-num {
    width: 44px;
    height: 44px;
    font-size: 0.82rem;
  }

  .journey-line {
    left: 21px;
  }

  .journey-reprice-demo {
    gap: 6px;
  }

  .journey-reprice-arrow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero-v4::before,
  .landing-hero-v4::after,
  .hero-channel-dot,
  .hero-timeline-step.is-active {
    animation: none !important;
  }
}

@keyframes spinnerTurn {
  to { transform: rotate(360deg); }
}

@keyframes statusPulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(223, 143, 120, 0);
  }
  50% {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 0 10px rgba(223, 143, 120, 0.08);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(223, 143, 120, 0);
  }
}

@keyframes tagPulse {
  0% {
    transform: scale(0.98);
    background: var(--hover-2);
  }
  50% {
    transform: scale(1.03);
    background: rgba(242, 179, 106, 0.14);
  }
  100% {
    transform: scale(1);
    background: var(--hover-2);
  }
}

@keyframes photoReveal {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes freshCardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(223, 143, 120, 0.22);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(223, 143, 120, 0);
  }
}

@keyframes processingPulseSoft {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(242, 179, 106, 0.14);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(242, 179, 106, 0);
    transform: translateY(-1px);
  }
}

@keyframes doneCardGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(125, 214, 170, 0.28);
    border-color: rgba(125, 214, 170, 0.52);
    background: rgba(125, 214, 170, 0.18);
  }
  55% {
    box-shadow: 0 0 0 18px rgba(125, 214, 170, 0);
    border-color: rgba(125, 214, 170, 0.3);
    background: rgba(125, 214, 170, 0.12);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(125, 214, 170, 0);
    border-color: var(--line);
    background: var(--surface-inset);
  }
}

@keyframes failedCardGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(226, 101, 101, 0.28);
    border-color: rgba(226, 101, 101, 0.55);
    background: rgba(226, 101, 101, 0.16);
  }
  55% {
    box-shadow: 0 0 0 18px rgba(226, 101, 101, 0);
    border-color: rgba(226, 101, 101, 0.34);
    background: rgba(226, 101, 101, 0.1);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(226, 101, 101, 0);
    border-color: var(--line);
    background: var(--surface-inset);
  }
}

.input,
.select,
.textarea,
.input-file {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--surface-inset);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
}

.textarea {
  resize: vertical;
}

.button,
.action-button,
.mini-button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button,
.mini-button {
  padding: 12px 16px;
}

.button:hover,
.action-button:hover,
.mini-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.button:active,
.action-button:active,
.mini-button:active {
  transform: translateY(0) scale(0.985);
}

/* BOUTON PRIMAIRE OFFICIEL (decision Philippe vague 3, 15/07) : pilule
   degradee accent -> accent-strong, texte fort — le style des FAB
   « Signaler »/« Créer », desormais canonique pour l'action principale
   d'un formulaire/d'une page. Les variantes (.btn-save des Reglages...)
   doivent converger dessus. */
.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-weight: 800;
  border-radius: var(--r-pill);
}

.action-button,
.mini-button {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 18px;
  text-align: center;
}

.button-ghost,
.action-button-secondary,
.mini-button-ghost {
  background: var(--hover);
  color: var(--text);
  border: 1px solid var(--line);
}

.card-list {
  display: grid;
  gap: 14px;
}

.item-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.item-card-media img,
.media-card img,
.detail-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

.item-card-media {
  width: 84px;
  height: 84px;
}

.item-card-media .media-fallback {
  width: 84px;
  height: 84px;
  min-height: 84px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.2;
  text-align: center;
  padding: 8px;
}

.item-card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.item-card-subtitle {
  color: var(--muted);
  margin-top: 4px;
}

.item-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ============================================================
   Refonte /stock — cartes items (#278) + recherche/filtres (#223).
   Tout est scope a la page Stock via .stock-card / .stock-toolbar
   pour ne rien changer aux cartes .item-card partagees (lots, rotation).
   ============================================================ */

/* --- Carte item : plus aeree, prix mis en avant, survol vivant --- */
.stock-card {
  /* 3 colonnes : photo | contenu | prix+emplacement (centres verticalement).
     C'est la PHOTO (--stock-photo) qui donne la hauteur du bandeau ; la largeur
     est calee pour que tout le contenu rentre sur cette hauteur, puis centree. */
  --stock-photo: 116px;
  grid-template-columns: var(--stock-photo) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 20px;
  width: min(920px, 100%);
  margin-inline: auto;
  transition: border-color 160ms ease, box-shadow 200ms ease,
    transform 160ms ease, background 160ms ease;
}

.stock-card:hover {
  border-color: var(--line-2);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}

.stock-card .item-card-media,
.stock-card .item-card-media .media-fallback {
  width: var(--stock-photo);
  height: var(--stock-photo);
  min-height: var(--stock-photo);
}

.stock-card .item-card-media img,
.stock-card .item-card-media .media-fallback {
  border-radius: 16px;
}

.stock-card .item-card-media img {
  box-shadow: inset 0 0 0 1px var(--line);
}

.stock-card .item-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  /* La photo donne la hauteur minimale. Si un titre ou la ligne d'infos se
     replie (notamment menu fixe + grille 2 colonnes), la carte grandit au lieu
     de couper silencieusement ses dernières informations (report 492). */
  min-height: var(--stock-photo);
}

.stock-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stock-card-headings {
  min-width: 0;
}

.stock-card .item-card-title {
  font-size: 1.02rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.stock-card .item-card-subtitle {
  font-size: 0.82rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Prix des cartes /stock ET de la fiche article : etiquette de prix
   (coin coupe + oeillet, identite IPAY CASH) peinte aux JETONS du theme
   (#389, generalise a la demande d'Achille) : contour + oeillet =
   var(--accent) (suit l'accent de chaque utilisateur), surface =
   var(--panel) -> s'integre aux 8 themes. Fini le jaune fluo code en dur
   et l'inclinaison. Deux couches clippees a la meme forme : le fond
   (couche du dessous = contour accent) laisse voir 3px de lisere autour
   de la surface panneau (::before). --- */
.stock-card-price {
  --tag-cut: 22px;               /* taille du coin coupe */
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px 10px 32px;  /* marge gauche = place de l'oeillet */
  font-size: clamp(2rem, 5.5vw, 2.7rem);
  line-height: 1;
  font-weight: 900;
  color: var(--text-strong);
  background: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  clip-path: polygon(var(--tag-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--tag-cut));
  isolation: isolate;            /* stacking context : garde la couche panneau (z-index -1) derriere le prix, jamais derriere la carte */
}

/* Surface panneau, en retrait de 3px -> le lisere accent apparait tout autour.
   z-index:-1 = SOUS le texte du prix (un pseudo absolu se peint sinon PAR-DESSUS
   le contenu -> le prix devenait invisible). Reste au-dessus du fond accent. */
.stock-card-price::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  background: var(--panel);
  clip-path: polygon(calc(var(--tag-cut) - 4px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--tag-cut) - 4px));
}

/* Oeillet (le trou de la ficelle) niche dans le coin coupe */
.stock-card-price::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
}

.stock-card-price--empty {
  background: var(--line-2);
  color: var(--muted-2);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 14px 8px 26px;
}

.stock-card-price--empty::before {
  background: var(--surface-inset);
}

.stock-card-price--empty::after {
  background: var(--line-2);
  opacity: 0.6;
}

.stock-card .item-card-meta {
  margin-top: 0;
  gap: 6px;
}

/* Colonne de droite : emplacement (a gauche) + prix (a droite), centres --- */
.stock-card-pricebox {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Ligne du bas : badges a gauche, gros repere d'emplacement a droite --- */
.stock-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stock-card-bottom .item-card-meta {
  flex: 1 1 auto;
  min-width: 0;
}

/* Gros repere d'emplacement (ou est range le produit), taille ~etiquette de prix */
.stock-card-location {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 13px;
  background: var(--surface-inset);
  border: 2px solid var(--line-2);
  color: var(--text-strong);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stock-card-location svg {
  flex: 0 0 auto;
  width: 1.05em;
  height: 1.05em;
  color: var(--accent);
}

@media (max-width: 720px) {
  .stock-card-location {
    font-size: clamp(1.4rem, 7vw, 2rem);
    padding: 6px 12px;
    gap: 7px;
  }
}

/* ============================================================
   #389 — /stock LISTE : tailles de l'etiquette de prix (2026-07-16).
   Les COULEURS de l'etiquette (contour/oeillet accent + surface
   panneau) vivent desormais dans la classe de base .stock-card-price
   ci-dessus (recette generalisee a la fiche article ; idem
   .picking-caisse-price-tag cote picking). Ici : uniquement la
   geometrie propre a la liste (etiquette un peu plus petite que sur
   la fiche) + le badge emplacement leg. reduit.
   ============================================================ */
.stock-appear-list .stock-card-price {
  --tag-cut: 18px;
  padding: 8px 16px 8px 28px;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

/* Surface panneau en retrait de 2px -> lisere accent plus fin que sur
   la fiche (etiquette plus petite). */
.stock-appear-list .stock-card-price::before {
  inset: 2px;
  clip-path: polygon(calc(var(--tag-cut) - 3px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--tag-cut) - 3px));
}

.stock-appear-list .stock-card-price::after {
  left: 7px;
  top: 7px;
  width: 9px;
  height: 9px;
}

.stock-appear-list .stock-card-price--empty {
  padding: 7px 13px 7px 24px;
}

/* Emplacement : le gros badge d'origine, juste un poil reduit. */
.stock-appear-list .stock-card-location {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  padding: 6px 13px;
}

/* (Les tailles mobiles des etiquettes vivent dans le bloc mobile commun
   des cartes /stock, plus bas — #394/#402.) */

/* --- Pastille de statut coloree (remplace le badge gris en anglais) --- */
.stock-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 11px 4px 9px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--line-2);
  background: var(--hover);
  color: var(--muted);
}

.stock-status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.stock-status-chip[data-status="active"] {
  color: var(--success);
  border-color: rgba(125, 214, 170, 0.4);
  background: rgba(125, 214, 170, 0.12);
}

/* Rupture (sold_out) = rouge doux (audit UX vague 1). */
.stock-status-chip[data-status="sold_out"] {
  color: var(--danger);
  border-color: rgba(255, 141, 141, 0.4);
  background: rgba(255, 141, 141, 0.12);
}

.stock-status-chip[data-status="missing"] {
  color: var(--danger);
  border-color: rgba(255, 141, 141, 0.4);
  background: rgba(255, 141, 141, 0.12);
}

.stock-status-chip[data-status="archived"] {
  color: var(--muted-2);
  font-style: italic;
}

/* --- Badges marketplace : petit point colore par canal --- */
.stock-mp-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin-right: 2px;
  background: var(--muted);
  display: inline-block;
  flex: 0 0 auto;
}

.stock-mp-badge[data-mp="amazon"]::before { background: #ff9900; }
.stock-mp-badge[data-mp="rakuten"]::before { background: #e8365d; }
.stock-mp-badge[data-mp="ebay"]::before { background: #4885ed; }
.stock-mp-badge[data-mp="lbc"]::before { background: #ec6f2d; }
.stock-mp-badge[data-mp="vinted"]::before { background: #09b1ba; }

/* --- Age en stock : discret, ne concurrence pas le reste --- */
.stock-card .stock-age-badge {
  color: var(--muted-2);
  background: transparent;
  padding-left: 2px;
  padding-right: 2px;
}

/* --- Ligne d'infos fine et attenuee (audit UX vague 1) : Achat / Qte / etat /
   anciennete en texte discret separe par des points, plus de pastilles. --- */
.stock-card-infoline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  min-width: 0;
}
.stock-card .stock-info-item {
  font-size: 0.78rem;
  color: var(--muted-2);
  background: transparent;
  border: 0;
  padding: 0;
  white-space: nowrap;
}
.stock-card .stock-info-quantity {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
}
.stock-card .stock-info-quantity strong {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.stock-card-infoline .stock-info-item + .stock-info-quantity::before {
  content: none;
}
/* Separateur en point entre chaque info (sauf la premiere). */
.stock-card-infoline .stock-info-item + .stock-info-item::before {
  content: "\00b7";
  margin-right: 4px;
  color: var(--line-2);
}

/* --- Copier lien d'annonce = petite icone (audit UX vague 1) --- */
.item-card .stock-copy-link--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  justify-content: center;
  color: var(--muted);
}
.item-card .stock-copy-link--icon svg { width: 15px; height: 15px; }
.item-card .stock-copy-link--icon[data-mp="vinted"] { color: #09b1ba; }
.item-card .stock-copy-link--icon[data-mp="lbc"] { color: #ec6f2d; }
.item-card .stock-copy-link--icon.is-copied {
  color: #2ea043;
  border-color: rgba(46, 160, 67, 0.55);
}

/* --- Zoom photo au survol : remplace par l'apercu flottant au ratio
       d'origine (#320), monte en JS + style dans stock.html (le style vit
       dans le template pour etre insensible au cache navigateur d'app.css,
       et pour neutraliser l'ancien scale carre chez les caches pas a jour). --- */

@media (max-width: 759px) {
  /* #394/#402 — mobile "compacte" (choix Achille 2026-07-16) : avant, la
     colonne prix+emplacement empilee a droite ecrasait le titre ("on voit
     a peine le titre"). Desormais le TITRE garde toute la largeur a cote
     de la photo, et les etiquettes deviennent MINI (meme style accent) sur
     leur propre rangee sous le contenu. Grille 2 colonnes x 2 rangees :
     photo (span 2 rangees) | corps, puis etiquettes.
     .stock-appear-list ... : specificite (0,2,0) pour battre la regle
     globale mobile `.item-card` situee plus bas dans le fichier. */
  .stock-appear-list .stock-card {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
    gap: 5px 10px;
    padding: 12px;
  }

  .stock-card .item-card-media,
  .stock-card .item-card-media .media-fallback {
    width: 76px;
    height: 76px;
    min-height: 76px;
  }

  .stock-appear-list .stock-card .item-card-media {
    grid-row: 1 / span 3;
  }

  /* Le corps est dissous (display: contents) : titre / etiquettes / infos
     deviennent des rangees DIRECTES de la grille de la carte -> on peut
     placer les etiquettes ENTRE le titre et les infos, a la place du
     sous-titre SKU/ref (demande Achille : redondant sur mobile, le badge
     emplacement en montre deja la tete ; le SKU complet reste au survol/
     title du badge). */
  .stock-appear-list .stock-card .item-card-body {
    display: contents;
  }

  .stock-appear-list .stock-card-headings {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .stock-appear-list .stock-card .item-card-subtitle {
    display: none;
  }

  .stock-appear-list .stock-card .item-card-meta {
    grid-column: 2;
    grid-row: 3;
  }

  /* Etiquettes en ligne juste sous le titre (rangee 2). */
  .stock-appear-list .stock-card-pricebox {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
  }
  .stock-appear-list .location-summary { position: static; }
  .stock-appear-list .location-summary-popover {
    left: 0;
    right: 0;
    width: auto;
    transform-origin: top left;
  }

  /* Prix mini : meme etiquette accent, format timbre. */
  .stock-appear-list .stock-card-price {
    --tag-cut: 11px;
    font-size: 1.05rem;
    padding: 4px 9px 4px 17px;
  }

  .stock-appear-list .stock-card-price::after {
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
  }

  .stock-appear-list .stock-card-price--empty {
    font-size: 0.85rem;
    padding: 4px 9px 4px 16px;
  }

  /* Emplacement mini. */
  .stock-appear-list .stock-card-location {
    font-size: 0.9rem;
    padding: 3px 9px;
    border-width: 1.5px;
    border-radius: 9px;
    gap: 5px;
  }
}

/* --- Grand ecran (>=1500px) : /stock exploite toute la largeur. Sous ce seuil
   on garde la colonne centree par defaut (page-shell 1120px). Au-dela, deux
   changements : (1) le conteneur s'elargit comme /messages -> min(1560px, ...),
   et (2) la liste passe en 2 colonnes de cartes. Resultat : deux fois plus
   d'articles a l'ecran, fini la moitie de droite vide sur un 1568+/1920/2560.
   Les cartes perdent leur plafond 920px pour remplir chaque colonne. Scope
   `.page-stock` (body class posee par la route /stock) : n'impacte aucune autre
   page qui utilise .card-list (lots, rotation...). --- */
@media (min-width: 1500px) {
  .page-stock .page-shell {
    width: min(1560px, calc(100vw - 28px));
  }
  .page-stock .stock-appear-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .page-stock .stock-appear-list .stock-card {
    width: 100%;
    margin-inline: 0;
  }
}

/* --- Recherche /stock : barre plus grande, plus douce (#223) --- */
.stock-search-input {
  min-height: 52px;
  font-size: 1rem;
  border-radius: 14px;
  background: var(--surface-inset);
}

.stock-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

/* --- Chips de filtres actifs : plus lisibles --- */
.stock-active-filters .badge {
  border: 1px solid var(--line-2);
  background: var(--hover);
  color: var(--text);
  font-size: 0.8rem;
  padding: 5px 11px;
}

.detail-hero {
  display: grid;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  min-width: 0;
}

.detail-photo-card {
  min-height: 300px;
  padding: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.detail-gallery {
  position: relative;
}

.detail-gallery-slide {
  display: none;
  margin: 0;
}

.detail-gallery-slide.is-active {
  display: block;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
  z-index: 2;
}

.gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.75);
}

.gallery-arrow-prev {
  left: 8px;
}

.gallery-arrow-next {
  right: 8px;
}

.detail-photo {
  aspect-ratio: 1 / 1;
  max-height: 440px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

.detail-gallery-caption {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.detail-photo-empty,
.media-fallback {
  display: grid;
  place-items: center;
  min-height: 180px;
  border-radius: 18px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
}

.item-ai-runtime {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.item-ai-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.item-ai-input-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
}

.item-ai-input-image,
.item-ai-input-empty {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
}

.item-ai-input-image {
  object-fit: cover;
}

.item-ai-input-empty,
.item-ai-input-value {
  display: grid;
  place-items: center;
  min-height: 96px;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .item-ai-inputs-grid {
    grid-template-columns: 1fr;
  }
}

.action-rail {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.action-button {
  width: 100%;
  padding: 16px 18px;
}

.detail-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  min-width: 0;
}

.add-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.page-add .page-shell {
  padding-bottom: calc(128px + env(safe-area-inset-bottom));
}

.page-add .page-shell > .add-layout {
  animation: none !important;
  transform: none !important;
}

.add-form-panel {
  min-height: 100%;
}

@media (min-width: 760px) {
  .add-form-panel {
    padding: clamp(14px, 2vw, 34px) clamp(16px, 2vw, 36px);
    font-size: clamp(0.85rem, 0.6vw + 0.45rem, 1.12rem);
  }

  .add-form-panel .input,
  .add-form-panel .select,
  .add-form-panel .textarea {
    padding: clamp(8px, 1vw, 18px) clamp(10px, 1.1vw, 20px);
    font-size: clamp(0.84rem, 0.55vw + 0.45rem, 1.08rem);
  }

  .add-form-panel .field > span,
  .add-form-panel .field-head-inline > span {
    font-size: clamp(0.82rem, 0.5vw + 0.45rem, 1.05rem);
  }

  .add-form-panel .form-grid {
    gap: clamp(10px, 1.2vw, 24px);
  }

  .add-form-panel .field {
    gap: clamp(4px, 0.5vw, 8px);
  }

  .add-form-panel h2 {
    font-size: clamp(1rem, 0.7vw + 0.55rem, 1.35rem);
  }

  .add-preset-strip {
    margin-bottom: clamp(2px, 0.4vw, 10px);
  }

  .add-form-panel .mini-button,
  .add-form-panel .field-inline-button {
    font-size: clamp(0.78rem, 0.4vw + 0.45rem, 0.95rem);
    padding: clamp(4px, 0.5vw, 10px) clamp(8px, 0.8vw, 16px);
  }
}

.add-form-actions {
  margin-top: 8px;
}

.add-form-actions-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.add-form-actions #create_item_button {
  width: 100%;
}

body.add-submit-dock-ready .add-form-actions:not(.is-dock-anchor-visible) #create_item_button,
body.add-submit-dock-ready .add-form-actions:not(.is-dock-anchor-visible) .add-form-actions-copy {
  display: none;
}

body.add-submit-dock-ready .add-form-actions {
  min-height: 88px;
}

body.add-submit-dock-ready .add-form-actions:not(.is-dock-anchor-visible) {
  opacity: 0.001;
}

body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 12px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid rgba(223, 143, 120, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  opacity: 1;
  transform: translateY(0);
}

body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible > * {
  flex: initial;
}

body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible .add-form-actions-copy {
  flex: 1 1 auto;
}

.add-submit-help.is-ready {
  color: #4a9e6e;
}

body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible .add-submit-help,
body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible .add-submit-note {
  display: block;
  margin: 0;
}

body.add-submit-dock-ready .add-form-actions .add-submit-note-turbo {
  display: none !important;
}

body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible #create_item_button {
  width: auto;
  min-width: 188px;
  flex: 0 0 auto;
  justify-content: center;
}

.add-submit-dock {
  position: fixed;
  left: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 10010;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 12px;
  margin-top: 0;
  padding: 12px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid rgba(223, 143, 120, 0.18);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  transform: translateY(0) scale(1);
  transition: box-shadow 120ms ease;
  will-change: opacity, transform;
}

.add-submit-dock.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.add-submit-dock.is-locked {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.add-submit-dock[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

.add-submit-dock-button {
  width: auto;
  min-width: 188px;
  flex: 0 0 auto;
  justify-content: center;
}

.add-submit-dock-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.add-submit-dock-copy[hidden] {
  display: none;
}

.add-submit-dock-copy[hidden] + .add-submit-dock-button {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.add-submit-dock-help,
.add-submit-dock-note {
  margin: 0;
}

.add-submit-dock-help {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.25;
}

.add-submit-dock-note {
  color: var(--warning);
  font-size: 0.76rem;
  line-height: 1.25;
}

.add-recent-head h2 {
  margin-top: 0;
}

.add-recent-list {
  display: grid;
  gap: 12px;
}

.add-recent-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.add-recent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(223, 143, 120, 0.24);
}

.add-recent-card.is-fresh {
  border-color: rgba(223, 143, 120, 0.44);
  background: rgba(223, 143, 120, 0.08);
  animation: freshCardPulse 1.2s ease;
}

.add-recent-card.is-pending .badge-status,
.add-recent-card.is-running .badge-status {
  animation: processingPulseSoft 1.6s ease-in-out infinite;
}

.add-recent-card.just-done {
  animation: doneCardGlow 1.1s ease;
}

.add-recent-card.just-failed {
  animation: failedCardGlow 1.1s ease;
}


.add-recent-media {
  width: 78px;
  height: 78px;
}

.add-recent-media img,
.add-recent-media .media-fallback {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

.add-recent-body {
  min-width: 0;
}

.add-recent-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.add-recent-top strong {
  display: block;
}

.add-recent-body p {
  margin: 8px 0 0;
  color: var(--muted);
}

.add-copy-source-banner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(223, 143, 120, 0.24);
  background: rgba(223, 143, 120, 0.08);
}

.add-copy-source-banner p {
  margin: 6px 0 0;
}

.add-ean-match-panel {
  margin: 20px 0 0;
  padding: 18px;
}

.add-ean-match-head h2 {
  margin: 0 0 8px;
}

.add-ean-match-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.add-ean-match-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
}

.add-ean-match-media {
  width: 92px;
  height: 92px;
}

.add-ean-match-media img,
.add-ean-match-media .media-fallback {
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

.add-ean-match-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.add-ean-match-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.add-ean-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-ean-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.add-ean-match-actions form {
  margin: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.add-ean-loc {
  max-width: 160px;
}

/* Popup « article déjà en stock » : carte cliquable + modale quantité/emplacement. */
.add-ean-match-card.is-clickable { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.add-ean-match-card.is-clickable:hover,
.add-ean-match-card.is-clickable:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
  outline: none;
}
.add-ean-match-cta { margin-top: 8px; font-size: .82rem; font-weight: 600; color: var(--accent); }

.ean-inc-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  max-width: 460px;
  width: calc(100% - 28px);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--bg) 72%, transparent);
}
.ean-inc-dialog::backdrop { background: color-mix(in srgb, var(--bg) 62%, transparent); }
.ean-inc { display: flex; flex-direction: column; }
.ean-inc-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; }
.ean-inc-head > div { flex: 1; }
.ean-inc-eyebrow { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.ean-inc-title { font-size: 1.05rem; margin: 4px 0 0; font-weight: 700; }
.ean-inc-x {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.ean-inc-x:hover { color: var(--text); }
.ean-inc-fiche {
  display: flex; gap: 12px; padding: 12px 18px;
  background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ean-inc-ph {
  width: 60px; height: 60px; flex: 0 0 auto; border-radius: 10px; overflow: hidden;
  background: var(--panel); display: flex; align-items: center; justify-content: center;
}
.ean-inc-ph img { width: 100%; height: 100%; object-fit: cover; }
.ean-inc-info { min-width: 0; }
.ean-inc-ti { font-weight: 650; line-height: 1.25; }
.ean-inc-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.ean-inc-sell { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.ean-inc-sell b { color: var(--text); font-weight: 600; }
.ean-inc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 18px 4px; }
.ean-inc-fields .field { display: flex; flex-direction: column; gap: 5px; }
.ean-inc-fields .field > span { font-size: .76rem; color: var(--muted); font-weight: 600; }
.ean-inc-hint { font-size: .7rem; }
.ean-inc-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px 18px; }
.no-spin { -moz-appearance: textfield; appearance: textfield; }
.no-spin::-webkit-outer-spin-button,
.no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 420px) { .ean-inc-fields { grid-template-columns: 1fr; } }

.field-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-inline-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.field-inline-button {
  min-height: 40px;
  padding: 8px 14px;
}

.sku-inline-preview {
  display: inline-flex;
  align-items: center;
  max-width: 52%;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sku-inline-preview.is-updated {
  animation: tagPulse 420ms ease;
}

.field-help {
  color: var(--muted);
  font-size: 0.84rem;
}

.field-help.is-error {
  color: #e58d81;
}

.field-help code {
  color: var(--accent-strong);
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix .input {
  padding-right: 42px;
}

.input-with-inline-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.quantity-inline-button {
  min-width: 40px;
  padding-inline: 0;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
}

.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.publishability-panel {
  margin: 20px 0 24px;
  padding: 18px;
  border-radius: 26px;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.publishability-head h2 {
  margin: 0 0 8px;
}

.publishability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.publishability-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--hover-2);
  flex-wrap: wrap;
}

.publishability-compact-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}

.publishability-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.publishability-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: default;
}

.publishability-chip.is-eligible {
  background: rgba(125, 214, 170, 0.12);
  color: var(--success);
  border: 1px solid rgba(125, 214, 170, 0.25);
}

.publishability-chip.is-blocked {
  background: rgba(255, 141, 141, 0.10);
  color: var(--danger);
  border: 1px solid rgba(255, 141, 141, 0.2);
}

.publish-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.publish-card:hover {
  transform: translateY(-2px);
}

.publish-card.is-updated {
  animation: statusPulse 520ms ease;
}

.publish-card.is-eligible {
  border-color: rgba(125, 214, 170, 0.28);
  background: rgba(125, 214, 170, 0.07);
}

.publish-card.is-blocked {
  border-color: rgba(255, 141, 141, 0.2);
}

.publish-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.publish-card-text {
  margin: 10px 0 0;
  color: var(--muted);
}

.edit-layout {
  display: grid;
  gap: 18px;
}

.add-preset-panel,
.settings-add-preset-card,
.settings-add-preset-list-card,
.settings-add-preset-detail-card {
  display: grid;
  gap: 14px;
}

.add-preset-head,
.settings-add-presets-head,
.settings-add-preset-card-head,
.settings-add-preset-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.add-preset-head h2,
.settings-add-presets-head h2 {
  margin: 0 0 6px;
}

.add-preset-list,
.settings-add-presets-stack {
  display: grid;
  gap: 12px;
}

.settings-add-presets-list {
  display: grid;
  gap: 14px;
}

.add-preset-list {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  align-items: start;
}

.add-preset-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--hover-2);
}

.add-preset-strip-title {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
}

.add-preset-list-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-preset-list-compact .button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.92rem;
}

.page-header:has(.add-settings-button) {
  flex-direction: row !important;
  align-items: center !important;
}

.add-settings-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.8rem;
  opacity: 0.7;
  flex: 0 0 auto !important;
  width: auto !important;
}

.add-settings-button:hover {
  opacity: 1;
}

.add-preset-strip .add-preset-active-copy {
  flex-basis: 100%;
  font-size: 0.84rem;
  margin-top: -2px;
}

.add-preset-list .button.is-active {
  background: rgba(223, 143, 120, 0.14);
  border-color: rgba(223, 143, 120, 0.34);
  color: var(--accent-strong);
}

.add-preset-active-copy {
  font-size: 0.95rem;
}

.settings-add-preset-card {
  border: 1px solid var(--line);
  background: var(--hover-2);
}

.settings-add-preset-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.settings-add-preset-list-card,
.settings-add-preset-detail-card {
  border: 1px solid var(--line);
  background: var(--hover-2);
}

.settings-add-preset-list-link {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.settings-add-preset-list-link:hover {
  border-color: rgba(223, 143, 120, 0.28);
  background: rgba(223, 143, 120, 0.06);
  transform: translateY(-1px);
}

.assistant-agent-profile-card {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.assistant-agent-profile-main {
  flex: 1 1 auto;
  min-width: 0;
}

.assistant-agent-profile-activate-form {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  padding-right: 0;
}

.assistant-agent-profile-activate-button {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .assistant-agent-profile-card {
    display: grid !important;
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-content: stretch;
  }

  .assistant-agent-profile-activate-form {
    justify-content: flex-start;
    padding: 0 16px 14px;
  }
}

.settings-add-preset-list-chevron {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent-strong);
  opacity: 0.82;
}

.settings-add-preset-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-add-preset-card-actions,
.settings-add-preset-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-field-sorter {
  display: grid;
  gap: 12px;
}

.preset-field-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.preset-field-row:hover {
  border-color: rgba(223, 143, 120, 0.22);
  background: rgba(223, 143, 120, 0.04);
}

.preset-field-sorter.is-sorting .preset-field-row:hover {
  border-color: var(--line);
  background: var(--hover-2);
}

.preset-field-row.is-dragging {
  opacity: 0.72;
  transform: scale(0.99);
  border-color: rgba(223, 143, 120, 0.42);
  background: rgba(223, 143, 120, 0.1);
  box-shadow: 0 18px 34px rgba(223, 143, 120, 0.16);
}

.preset-field-drag-handle {
  width: 38px;
  height: 38px;
  border: 0;
  padding: 0;
  border-radius: 12px;
  background: var(--hover-2);
  color: var(--muted);
  cursor: grab;
  font-size: 1.1rem;
  line-height: 1;
}

.preset-field-drag-handle:focus,
.preset-field-edit-button:focus {
  outline: none;
}

.preset-field-drag-handle:focus-visible,
.preset-field-edit-button:focus-visible {
  border-color: rgba(223, 143, 120, 0.34);
  box-shadow: 0 0 0 2px rgba(223, 143, 120, 0.18);
}

.preset-field-drag-handle:active {
  cursor: grabbing;
}

.preset-field-row-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.preset-field-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preset-field-row-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.preset-field-row-title strong {
  font-size: 1rem;
}

.preset-field-row-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-field-edit-button {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.preset-field-modal[hidden] {
  display: none !important;
}

.preset-field-modal [hidden] {
  display: none !important;
}

.preset-field-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
}

.preset-field-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.preset-field-modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 28px));
  max-height: min(84vh, 760px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(44, 40, 40, 0.98), rgba(25, 22, 22, 0.98));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.48),
    0 0 0 1px var(--hover-2);
}

.preset-field-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.preset-field-modal-head strong {
  display: block;
  font-size: 1.08rem;
  margin-bottom: 4px;
}

.add-copy-source-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.add-copy-source-media-card {
  display: grid;
  gap: 8px;
  width: 82px;
}

.add-copy-source-media-card img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}

@media (max-width: 759px) {
  .stock-image-source-modal {
    align-items: end;
    padding: 10px;
  }

  .stock-image-source-card {
    width: min(100vw - 12px, 520px);
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 18px 18px;
  }

  .settings-add-preset-create {
    grid-template-columns: 1fr;
  }

  .add-preset-strip {
    padding: 0;
    border: 0;
    background: transparent;
    gap: 8px;
  }

  .add-preset-strip-title,
  .add-preset-strip .add-preset-active-copy {
    display: none;
  }

  .add-settings-button {
    margin-left: 0;
  }

  .add-preset-list-compact {
    gap: 8px;
  }

  .add-preset-list-compact .button {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
  }

  .preset-field-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    padding: 12px 13px;
  }

  .preset-field-drag-handle {
    width: 34px;
    height: 34px;
  }

  .preset-field-row-top {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .preset-field-edit-button {
    width: 100%;
    justify-content: center;
  }

  .preset-field-modal {
    align-items: end;
    padding: 10px;
  }

  .preset-field-modal-card {
    width: min(100vw - 12px, 560px);
    max-height: min(88vh, 760px);
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 18px 18px;
  }

  .preset-field-modal-head {
    flex-direction: column;
    margin-bottom: 14px;
  }
}

.field.field-locked .input[disabled] {
  color: var(--accent-strong);
  border-color: rgba(242, 179, 106, 0.28);
}

.add-photo-grid {
  align-items: start;
}

@media (max-width: 759px) {
  .add-photo-grid {
    grid-template-columns: 1fr !important;
  }

  .add-form-panel .textarea {
    resize: none;
  }
}

.add-photo-field {
  gap: 10px;
}

.add-photo-field[hidden] {
  display: none;
}

.add-photo-field .field-head-inline {
  align-items: center;
}

.input-file-camera {
  display: none;
}

.add-photo-preview {
  display: none;
}

.add-photo-preview.is-visible {
  display: block;
}

.add-photo-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
  animation: photoReveal 260ms ease;
}

.add-photo-card[hidden] {
  display: none;
}

.add-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.add-photo-meta {
  display: grid;
  gap: 4px;
  padding: 12px 14px 14px;
}

.add-photo-meta strong {
  font-size: 0.95rem;
}

.add-photo-meta span {
  color: var(--muted);
  font-size: 0.86rem;
  word-break: break-word;
}

.add-photo-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.add-photo-remove:hover {
  background: rgba(223, 143, 120, 0.92);
  color: #281515;
}

.add-photo-edit {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transition: background 140ms ease, color 140ms ease;
}

.add-photo-edit:hover {
  background: rgba(120, 168, 223, 0.92);
  color: #0e1a2a;
}

.add-photo-rotate {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.add-photo-rotate:hover {
  background: rgba(120, 168, 223, 0.92);
  color: #0e1a2a;
}

.add-photo-rotate[disabled] {
  opacity: 0.55;
  cursor: default;
}

.add-photo-rotate.is-rotating svg {
  animation: photoRotateSpin 520ms ease;
}

@keyframes photoRotateSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(90deg); }
}

.item-edit-photos-help {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.item-edit-photos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.item-edit-photo-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 170px;
}

.item-edit-photo-head {
  font-size: 0.88rem;
  color: var(--muted);
}

.item-edit-photo-slot .add-photo-card img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--hover-2);
}

.item-edit-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  background: var(--surface-inset);
  color: var(--muted);
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
  font-family: inherit;
}

.item-edit-photo-empty:hover,
.item-edit-photo-empty:focus-visible {
  border-color: rgba(120, 168, 223, 0.6);
  color: var(--text);
  background: var(--hover);
  outline: none;
}

.item-edit-photo-empty[hidden] {
  display: none;
}

.item-edit-photo-deleted {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(120, 30, 30, 0.28);
  border: 1px solid rgba(223, 90, 90, 0.4);
  color: var(--text);
  font-size: 0.82rem;
}

.item-edit-photo-deleted[hidden] {
  display: none;
}

.item-edit-photo-input {
  font-size: 0.78rem;
  padding: 8px 10px;
}

.item-edit-photo-slot .add-photo-preview .add-photo-card img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.scanner-sheet {
  position: fixed;
  inset: 0;
  z-index: 180;
}

.scanner-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.scanner-sheet-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 24px));
  transform: translate(-50%, -50%);
  padding: 18px;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.scanner-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.scanner-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scanner-sheet-head h2 {
  margin: 0 0 6px;
}

.scanner-sheet-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--hover);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

.scanner-video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #090808;
  border: 1px solid var(--line);
  min-height: 360px;
}

.scanner-sheet-apple .scanner-video-shell {
  min-height: min(72vh, 560px);
}

.scanner-sheet-native .scanner-video-shell {
  min-height: min(72vh, 560px);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.scanner-sheet-native .scanner-sheet-panel {
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
  left: 0;
  top: 0;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.scanner-sheet-native .scanner-sheet-head {
  margin-bottom: 10px;
}

.scanner-sheet-native .scanner-sheet-head > div,
.scanner-sheet-native .scanner-sheet-close,
.scanner-sheet-native .scanner-status {
  background: rgba(20, 19, 19, 0.58);
  backdrop-filter: blur(10px);
}

.scanner-sheet-native .scanner-sheet-head > div {
  padding: 12px 14px;
  border-radius: 18px;
  max-width: min(520px, calc(100vw - 96px));
}

.scanner-sheet-native .scanner-sheet-close {
  border: 1px solid var(--line);
}

.scanner-sheet-native .scanner-status {
  margin: 10px auto 0;
  padding: 10px 14px;
  border-radius: 16px;
  width: fit-content;
  max-width: min(680px, calc(100vw - 36px));
  text-align: center;
}

.scanner-reader {
  position: relative;
  width: 100%;
  min-height: 360px;
  height: 100%;
  overflow: hidden;
  border-radius: 22px;
}

.scanner-reader > div {
  border: 0 !important;
  padding: 0 !important;
}

.scanner-reader video,
.scanner-reader canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 22px;
  z-index: 1;
}

.scanner-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(82%, 360px);
  height: 140px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(242, 179, 106, 0.95);
  border-radius: 22px;
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(20, 19, 19, 0.42) inset,
    0 0 28px rgba(242, 179, 106, 0.2);
  pointer-events: none;
  z-index: 2;
}

.scanner-reader__dashboard_section_swaplink,
.scanner-reader__dashboard_section_csr span {
  display: none !important;
}

.scanner-status {
  margin: 14px 4px 0;
}

.scanner-status.is-error {
  color: var(--warning);
}

body.barcode-scanner-active .app-shell {
  visibility: hidden;
}

body.barcode-scanner-active .scanner-sheet,
body.barcode-scanner-active .scanner-sheet * {
  visibility: visible;
}

body.barcode-scanner-active .scanner-sheet-backdrop {
  background: transparent;
  backdrop-filter: none;
}

body.barcode-scanner-active,
body.barcode-scanner-active .page-shell,
body.barcode-scanner-active .topbar {
  background: transparent !important;
}

.button.is-loading,
.action-button.is-loading,
.mini-button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.92;
}

.button.is-loading::after,
.action-button.is-loading::after,
.mini-button.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 10px;
  display: inline-block;
  vertical-align: middle;
  border-radius: 999px;
  border: 2px solid rgba(40, 21, 21, 0.28);
  border-top-color: #281515;
  animation: spinnerTurn 0.8s linear infinite;
}

.button.is-disabled,
.action-button.is-disabled,
.mini-button.is-disabled,
.button:disabled,
.action-button:disabled,
.mini-button:disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

.add-submit-help {
  color: var(--muted);
  font-size: 0.92rem;
}

.add-submit-help.is-hidden {
  display: none;
}

.add-submit-help.is-ready {
  color: var(--success);
}

.add-submit-note {
  display: none;
  margin-top: -0.15rem;
  color: var(--warning);
  font-size: 0.8rem;
  line-height: 1.35;
}

.add-submit-note.is-visible {
  display: block;
}

.settings-grid {
  display: grid;
  gap: 18px;
}

.settings-home-header {
  margin-bottom: 12px;
}

.settings-home-grid {
  display: grid;
  gap: 18px;
}

.settings-home-card {
  display: grid;
  gap: 18px;
}

.settings-home-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.settings-home-card-head h2 {
  margin: 0;
}

.settings-home-card-account,
.settings-home-card-danger {
  grid-column: 1 / -1;
}

.settings-account-stack {
  display: grid;
  gap: 16px;
}

.settings-identity-box,
.settings-action-card,
.settings-link-tile,
.settings-plan-pill {
  border-radius: 22px;
  border: 1px solid var(--line);
}

.settings-identity-box,
.settings-action-card {
  padding: 18px;
  background: var(--hover-2);
}

.settings-identity-box {
  display: grid;
  gap: 14px;
}

.settings-identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.settings-identity-label {
  color: var(--muted);
}

.settings-action-card {
  display: grid;
  gap: 14px;
}

.settings-action-card h3 {
  margin: 0;
}

.settings-action-copy {
  display: grid;
  gap: 6px;
}

.settings-inline-form {
  display: grid;
  gap: 12px;
}

.settings-inline-form-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.settings-inline-form-compact .form-actions {
  justify-content: flex-start;
}

.settings-helper-copy {
  margin: -4px 0 0;
}

.settings-code-field {
  max-width: 220px;
}

.settings-link-list-home {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-link-tile {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--hover-2);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.settings-link-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(223, 143, 120, 0.24);
  background: rgba(223, 143, 120, 0.06);
}

.settings-plan-grid-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.settings-plan-pill {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: var(--hover-2);
}

.settings-plan-pill span {
  color: var(--accent-strong);
  font-weight: 800;
}

.settings-home-card-danger {
  border-color: rgba(255, 141, 141, 0.16);
}

.settings-danger-title {
  color: #ffb1b1;
}

.settings-action-card-danger {
  background: rgba(255, 141, 141, 0.05);
  border-color: rgba(255, 141, 141, 0.14);
}

.integrations-overview {
  display: grid;
  gap: 18px;
}

.integrations-overview-head,
.integration-card-head,
.integration-status-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.integrations-overview-head,
.integration-card-head {
  flex-wrap: wrap;
}

.integration-status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.integration-status-card,
.integration-card {
  border-radius: 22px;
}

.integration-status-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
}

.integration-status-card strong,
.integration-card-head h2 {
  margin: 0;
}

.integration-card-head > div,
.integration-status-top > strong {
  min-width: 0;
}

.integrations-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.integrations-grid .field-full,
.integrations-grid .auth-form-single {
  grid-column: 1 / -1;
}

.integrations-grid .textarea {
  min-height: 136px;
}

.integration-badge.is-configured {
  background: rgba(130, 237, 189, 0.18);
  color: #8df0ba;
}

.integration-badge.is-inherited {
  background: rgba(129, 183, 255, 0.18);
  color: #9fc4ff;
}

.integration-badge.is-partial {
  background: rgba(255, 196, 105, 0.18);
  color: #ffc66a;
}

.integration-badge.is-empty {
  background: var(--line);
  color: var(--muted);
}

.integration-status-card .integration-badge,
.integration-card .integration-badge {
  position: static;
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  animation: none;
  backdrop-filter: blur(8px);
}

.integration-guide {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.integration-guide strong {
  margin: 0;
}

.integration-guide-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  display: grid;
  gap: 6px;
}

.integration-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.integration-details summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--accent);
}

.integration-details summary::-webkit-details-marker {
  display: none;
}

.integration-details[open] summary {
  margin-bottom: 14px;
}

.settings-panel h2 {
  margin-top: 0;
}

.settings-link-list {
  display: grid;
  gap: 10px;
}

.settings-plan-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.settings-panel-wide {
  grid-column: 1 / -1;
}

.import-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.import-preview-table-wrap {
  margin-top: 14px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.import-preview-table th,
.import-preview-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hover);
  text-align: left;
  vertical-align: top;
}

.import-preview-table th {
  background: var(--hover-2);
  color: var(--muted);
  font-size: 0.88rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.messages-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
  overflow: hidden;
}

.messages-sidebar,
.messages-main {
  display: grid;
  gap: 16px;
  min-width: 0;
  position: relative;
  z-index: 0;
}

.messages-thread-list {
  display: grid;
  gap: 10px;
}

.messages-thread-load-more-sentinel {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 10px 12px 2px;
}

.message-thread-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.message-thread-card.is-active {
  border-color: rgba(229, 148, 120, 0.55);
  box-shadow: 0 0 0 1px rgba(229, 148, 120, 0.18) inset;
}

.message-bubble-top,
.message-thread-meta,
.message-ai-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.message-thread-top,
.messages-thread-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.message-thread-top > .status-pill,
.messages-thread-header > .status-pill {
  justify-self: end;
}

.message-thread-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.messages-conversation {
  display: grid;
  gap: 12px;
}

.message-bubble {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--hover);
}

.message-bubble.is-outbound {
  background: rgba(229, 148, 120, 0.14);
  border-color: rgba(229, 148, 120, 0.22);
}

.message-bubble.is-system {
  background: rgba(138, 168, 191, 0.14);
  border-color: rgba(138, 168, 191, 0.28);
}

.message-bubble p,
.message-draft-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.message-bubble-subject {
  color: var(--accent);
  font-weight: 700;
}

.message-draft-panel {
  display: grid;
  gap: 12px;
}

.message-ai-actions {
  flex-wrap: wrap;
}

.message-draft-body {
  max-width: 520px;
}

.message-draft-row {
  align-items: start;
}

.message-draft-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.badge-warning {
  color: #ffd3a6;
  background: rgba(229, 148, 120, 0.14);
  border-color: rgba(229, 148, 120, 0.24);
}

@media (max-width: 1080px) {
  .messages-layout {
    grid-template-columns: 1fr;
  }
}

.messages-page-header {
  align-items: start;
}

.messages-focus-panel,
.messages-conversation-panel,
.message-summary-card,
.message-draft-card {
  background: var(--panel);
  overflow: hidden;
  min-width: 0;
}

.message-overview-top,
.message-draft-card-top,
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--hover-2);
}

.tone-muted {
  color: var(--muted);
}

.tone-success {
  color: #b6ffd8;
  background: rgba(125, 214, 170, 0.14);
  border-color: rgba(125, 214, 170, 0.24);
}

.tone-warning {
  color: #ffe1a2;
  background: rgba(242, 179, 106, 0.14);
  border-color: rgba(242, 179, 106, 0.24);
}

.tone-danger {
  color: #ffc3c3;
  background: rgba(255, 141, 141, 0.14);
  border-color: rgba(255, 141, 141, 0.24);
}

.tone-info {
  color: #c8dbef;
  background: rgba(138, 168, 191, 0.14);
  border-color: rgba(138, 168, 191, 0.24);
}

.messages-thread-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.message-thread-title-wrap,
.messages-thread-brand > div {
  min-width: 0;
}

.marketplace-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  flex: 0 0 auto;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.marketplace-logo-large {
  width: 50px;
  height: 50px;
  border-radius: 16px;
}

.message-thread-channel,
.message-summary-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message-thread-title-wrap strong,
.messages-thread-brand h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-thread-card {
  gap: 12px;
  padding: 16px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.message-thread-card:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 179, 106, 0.18);
}

.message-thread-snippet,
.message-thread-counterparty {
  margin: 0;
}

.message-thread-counterparty {
  color: var(--text);
  font-weight: 600;
}

.messages-content-grid {
  display: grid;
  gap: 16px;
}

.messages-content-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-top: 18px;
  align-items: start;
}

.messages-conversation-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.messages-actions-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.message-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.message-drafts-list {
  display: grid;
  gap: 12px;
}

.message-draft-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--hover);
}

.message-draft-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-inline-group,
.settings-check-grid {
  display: grid;
  gap: 10px;
}

.settings-check-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.empty-state.compact {
  padding: 18px 14px;
}

@media (max-width: 1080px) {
  .messages-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1480px) {
  .messages-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1240px) {
  .messages-layout {
    grid-template-columns: 1fr;
  }

  .messages-main {
    order: 1;
  }

  .messages-sidebar {
    order: 2;
  }
}

@media (max-width: 1500px) {
  .page-messages .page-shell {
    width: min(1180px, calc(100vw - 24px));
  }

  .messages-layout {
    grid-template-columns: 1fr;
  }

  .messages-main {
    order: 1;
  }

  .messages-sidebar {
    order: 2;
  }
}

.messages-sync-menu {
  position: relative;
}

.messages-sync-menu summary {
  list-style: none;
}

.messages-sync-menu summary::-webkit-details-marker {
  display: none;
}

.messages-sync-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10;
  min-width: 180px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

.message-thread-title-wrap {
  min-width: 0;
}

.messages-thread-summary {
  margin: 8px 0 0;
  color: var(--muted);
}

.messages-layout-v2 {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  overflow: visible;
  height: calc(100dvh - 190px);
  min-height: 720px;
}

.messages-sidebar-shell,
.messages-main-shell,
.messages-sidepanel {
  min-width: 0;
}

.messages-sidebar-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 190px);
}

.messages-sidebar-top,
.messages-person-top,
.message-thread-card-topline,
.messages-focus-stats {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.messages-filters-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.messages-filters-bar .field {
  margin: 0;
}

.messages-filters-bar .field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.message-thread-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.message-thread-card-media {
  position: relative;
  width: 58px;
  min-width: 58px;
}

.message-thread-avatar,
.messages-person-avatar {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff5ea;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 208, 141, 0.26), transparent 38%),
    linear-gradient(160deg, rgba(223, 143, 120, 0.95), rgba(143, 82, 43, 0.88));
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.25);
}

.message-thread-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 1.2rem;
}

.message-thread-marketplace-logo {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 24px;
  height: 24px;
  border-radius: 9px;
  border: 2px solid rgba(12, 10, 10, 0.9);
  box-shadow: none;
}

.message-thread-card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.message-thread-card-topline > .status-pill {
  flex: 0 0 auto;
}

.messages-focus-hero {
  display: grid;
  gap: 14px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(37, 31, 31, 0.95), rgba(20, 17, 17, 0.94));
}

.messages-focus-stats {
  justify-content: flex-start;
}

.messages-conversation-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  min-height: 0;
}

.messages-conversation-head {
  padding: 18px 20px 0;
}

.messages-conversation-stream {
  display: grid;
  gap: 16px;
  padding: 18px 20px 22px;
  overflow-y: auto;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(21, 18, 18, 0.86), rgba(13, 11, 11, 0.92)),
    repeating-linear-gradient(
      180deg,
      transparent,
      transparent 31px,
      var(--hover-2) 31px,
      var(--hover-2) 32px
    );
}

.messages-conversation-stream-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.messages-history-load {
  padding: 16px 20px 0;
}

.message-row {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.message-row.is-outbound {
  justify-items: end;
}

.message-row.is-system {
  justify-items: center;
}

.message-row-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.message-row.is-outbound .message-row-meta {
  justify-content: flex-end;
}

.message-row.is-system .message-row-meta {
  justify-content: center;
}

.message-row.is-system .message-row-meta strong {
  color: #c8dbef;
}

.message-bubble {
  width: min(100%, 720px);
  border-radius: 22px;
}

.message-row.is-system .message-bubble {
  width: min(100%, 640px);
}

.messages-compose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.messages-sidepanel {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 190px);
  overflow-y: auto;
}

.messages-main-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 0;
  max-height: calc(100dvh - 190px);
}

.messages-thread-list {
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
}

.messages-person-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.messages-person-avatar {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  font-size: 1.5rem;
  flex: 0 0 auto;
}

.messages-person-top h3 {
  margin: 0;
}

.messages-person-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.messages-mini-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--hover);
  background: var(--hover-2);
}

.messages-mini-stat span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message-spotlight-panel {
  overflow: hidden;
}

.message-item-spotlight {
  display: grid;
  gap: 14px;
}

.message-item-spotlight-image {
  width: 100%;
  min-height: 180px;
  max-height: 260px;
  border-radius: 20px;
  object-fit: cover;
}

.message-item-spotlight-copy {
  display: grid;
  gap: 8px;
}

.message-item-spotlight-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1280px) {
  .messages-layout-v2 {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  .messages-sidebar-shell,
  .messages-sidepanel {
    position: static;
    max-height: none;
    overflow: visible;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .messages-main-shell {
    max-height: none;
  }

  .messages-thread-list,
  .messages-conversation-stream {
    overflow: visible;
  }
}

@media (max-width: 1080px) {
  .messages-layout-v2 {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .messages-sidebar-shell,
  .messages-sidepanel {
    position: static;
  }

  .messages-sidepanel {
    grid-template-columns: 1fr;
  }

  .messages-main-shell {
    max-height: none;
  }
}

@media (max-width: 860px) {
  .messages-filters-bar,
  .messages-compose-grid,
  .messages-person-stats {
    grid-template-columns: 1fr;
  }

  .message-thread-card {
    grid-template-columns: 1fr;
  }

  .message-thread-card-media {
    width: auto;
    min-width: 0;
  }

  .message-thread-marketplace-logo {
    right: auto;
    left: 42px;
  }
}

.message-item-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.message-item-card-link {
  display: block;
  border-radius: 22px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.message-item-card-link:hover {
  transform: translateY(-1px);
}

.message-item-card-link .message-item-card {
  border: 1px solid rgba(223, 143, 120, 0.16);
  padding: 8px;
  border-radius: 22px;
}

.page-messages .page-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100dvh - 96px);
  min-height: calc(100dvh - 96px);
  max-height: calc(100dvh - 96px);
  align-content: stretch;
  overflow: hidden;
}

.messages-layout-v3 {
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  overflow: hidden;
}

.messages-layout-v3 .messages-sidebar-shell,
.messages-layout-v3 .messages-stage-shell,
.messages-layout-v3 .messages-main-shell,
.messages-layout-v3 .messages-sidepanel,
.messages-layout-v3 .messages-chat-panel {
  min-height: 0;
  min-width: 0;
}

.messages-layout-v3 .messages-sidebar-shell {
  position: static;
  max-height: none;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.messages-sidebar-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.messages-sidebar-top-actions .button {
  white-space: nowrap;
}

.messages-page-top-strip {
  margin-bottom: 18px;
}

.messages-layout-v3 .messages-stage-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 18px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.messages-layout-v3.is-list-mode .messages-stage-shell {
  grid-template-columns: 1fr;
}

.messages-layout-v3.is-list-mode .messages-sidepanel {
  display: none;
}

.messages-layout-v3 .messages-main-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: hidden;
}

.messages-layout-v3 .messages-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
}

.messages-chat-mobile-bar {
  display: none;
  padding: 14px 16px 0;
}

.messages-mobile-back {
  display: none;
  flex: 0 0 auto;
}

.messages-layout-v3 .messages-conversation-stream {
  overflow-y: auto;
  min-height: 0;
  padding: 24px;
}

.messages-layout-v3 .messages-thread-list {
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
}

.messages-thread-list .message-thread-card {
  min-height: 118px;
}

.messages-layout-v3 .messages-sidepanel {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 18px;
  min-height: 0;
  height: 100%;
  position: static;
  top: auto;
  max-height: none;
  overflow-y: auto;
  padding-right: 4px;
}

.messages-compose-panel {
  padding: 18px;
  border-top: 1px solid var(--hover);
  background: var(--panel);
}

.messages-compose-shell {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.11), transparent 38%),
    rgba(24, 20, 20, 0.96);
}

.messages-compose-field {
  display: block;
}

.messages-compose-textarea {
  min-height: 260px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
  box-shadow: inset 0 1px 0 var(--hover-2);
  resize: vertical;
}

.messages-compose-textarea.is-readonly {
  opacity: 0.78;
}

.messages-compose-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.messages-compose-status {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.messages-compose-status-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.messages-compose-status-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.messages-compose-status-note {
  font-size: 0.85rem;
}

.messages-compose-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.messages-compose-ai-trigger {
  min-width: 56px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.messages-empty-panel {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
}

@media (max-width: 1280px) {
  .page-messages .page-shell {
    min-height: calc(100dvh - 96px);
    overflow: hidden;
  }

  .messages-layout-v3 {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  }

  .messages-layout-v3 .messages-stage-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  }
}

@media (max-width: 1080px) {
  .page-messages .page-shell {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .messages-layout-v3 {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .messages-layout-v3.has-thread .messages-sidebar-shell {
    display: none;
  }

  .messages-layout-v3.is-list-mode .messages-stage-shell {
    display: none;
  }

  .messages-layout-v3 .messages-stage-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .messages-layout-v3 .messages-sidepanel,
  .messages-layout-v3 .messages-thread-list,
  .messages-layout-v3 .messages-conversation-stream {
    overflow: visible;
    padding-right: 0;
  }

  .messages-mobile-back {
    display: inline-flex;
  }

  .messages-compose-footer,
  .messages-compose-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .messages-layout-v3 .messages-sidebar-shell {
    padding: 16px;
  }

  .messages-sidebar-top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .messages-chat-mobile-bar {
    display: block;
  }

  .messages-layout-v3 .messages-conversation-stream {
    padding: 16px;
  }

  .messages-compose-panel {
    padding: 14px 16px 16px;
  }

  .messages-compose-textarea {
    min-height: 220px;
  }

  .messages-compose-footer,
  .messages-compose-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .messages-compose-actions {
    width: 100%;
  }

  .messages-compose-actions .button {
    width: 100%;
    justify-content: center;
  }
}

.message-item-card-image,
.message-item-card-placeholder {
  width: 92px;
  height: 92px;
  border-radius: 18px;
}

.message-item-card-image {
  object-fit: cover;
  border: 1px solid var(--line);
}

.message-item-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  background: var(--hover-2);
  border: 1px dashed var(--line-2);
  padding: 10px;
}

.message-item-card-body {
  display: grid;
  gap: 6px;
}

.mobile-install-widget {
  position: fixed;
  right: 18px;
  bottom: 104px;
  z-index: 9998;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(223, 143, 120, 0.3);
  background: var(--surface-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.mobile-install-widget[hidden] {
  display: none;
}

.mobile-install-widget-top,
.mobile-install-widget-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-install-widget-copy,
.mobile-install-widget-note {
  margin: 0;
}

.mobile-install-widget-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.mobile-install-widget-actions .button {
  flex: 1 1 150px;
  justify-content: center;
}

.mobile-install-ios-help[hidden] {
  display: none;
}

.mobile-install-widget-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
}

.mobile-install-widget:not([hidden]) ~ .assistant-fab {
  bottom: 210px;
  --assistant-fab-bottom: 210px;
}

.ios-install-modal {
  position: fixed;
  inset: 0;
  z-index: 1201;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ios-install-modal[hidden] {
  display: none;
}

.ios-install-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(7, 6, 6, 0.7);
  backdrop-filter: blur(10px);
}

.ios-install-modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(28, 24, 24, 0.98), rgba(18, 15, 15, 0.98));
  border: 1px solid rgba(223, 143, 120, 0.24);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

.ios-install-modal-copy {
  display: grid;
  gap: 10px;
}

.ios-install-modal-copy strong {
  font-size: 1.12rem;
}

.ios-install-modal-copy p,
.ios-install-tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ios-install-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  line-height: 1.5;
}

.ios-install-modal-actions {
  display: flex;
  justify-content: flex-end;
}

.ios-install-modal-open {
  overflow: hidden;
}

.settings-copy-stack {
  display: grid;
  gap: 10px;
}

.settings-mini-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.settings-import-inline-status {
  margin-top: 14px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.import-image-match-list {
  display: grid;
  gap: 10px;
}

.import-image-match-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  min-width: 0;
}

.info-grid dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.info-grid dd {
  margin: 6px 0 0;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 759px) {
  .detail-hero,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-photo-card {
    padding: 12px;
  }

  .detail-gallery-slide {
    min-width: 100%;
  }

  .onboarding-choice-actions {
    flex-direction: column;
    width: 100%;
  }

  .onboarding-choice-actions .button {
    width: 100%;
    justify-content: center;
  }

  .organization-setup-preview {
    min-height: 1280px;
  }

  .organization-setup-overlay {
    padding: 18px;
  }

  .onboarding-ghost-actions {
    flex-direction: column;
  }
}

.info-grid-ref dd {
  color: #d8b35f;
  text-shadow: 0 0 18px rgba(216, 179, 95, 0.18);
}

.rich-block + .rich-block {
  margin-top: 16px;
}

.marketplace-grid,
.media-grid,
.review-list {
  display: grid;
  gap: 12px;
}

.marketplace-card,
.media-card,
.candidate-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-inset);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.human-task-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

@media (max-width: 720px) {
  .stock-toolbar-actions {
    width: 100%;
  }

  .stock-toolbar-actions .button {
    flex: 1 1 0;
    justify-content: center;
  }

  .pricing-threshold-form {
    width: 100%;
  }

  .pricing-threshold-form .field,
  .pricing-threshold-form .button {
    width: 100%;
  }
}

.marketplace-card-top,
.review-top,
.job-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.human-task-card {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.human-task-top h2 {
  margin: 4px 0 0;
  word-break: break-word;
}

.human-task-channel {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.human-task-summary {
  margin: 8px 0 0;
}

.human-task-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.human-task-copy p {
  margin: 0;
  overflow-wrap: anywhere;
}

.human-task-item-link {
  display: block;
  min-width: 0;
}

.human-task-item-row-link {
  display: grid;
  text-decoration: none;
  color: inherit;
  padding: 10px 0;
}

.human-task-item-row-link + .human-task-item-row-link {
  border-top: 1px solid var(--line);
}

.human-task-item-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
}

.candidate-card-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.candidate-card-copy {
  min-width: 0;
}

.candidate-card-copy strong {
  display: block;
}

.candidate-card-thumb {
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  background: var(--hover-2);
}

.stock-card-thumb {
  width: 88px;
  height: 88px;
  min-width: 88px;
  min-height: 88px;
  border-radius: 18px;
  object-fit: cover;
  display: block;
  background: var(--hover-2);
}

.human-task-item-row .media-fallback {
  width: 88px;
  height: 88px;
  border-radius: 18px;
}

.candidate-card-thumb.media-fallback {
  border-radius: 16px;
}

.pricing-review-estimate {
  display: grid;
  gap: 6px;
}

.pricing-review-price-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pricing-review-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.pricing-review-reason {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pricing-review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.pricing-modify-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pricing-price-input {
  width: 140px !important;
  text-align: center;
}

.pricing-reason-input {
  flex: 1;
  min-width: 180px;
}

/* Analyze listing review block */
.analyze-review-diagnostic {
  background: var(--surface-subtle, var(--hover-2));
  border: 1px solid var(--border-subtle, var(--line));
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 0.88rem;
}
.analyze-review-diagnostic ul {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 4px;
}
.analyze-review-diagnostic code {
  background: var(--hover);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.analyze-review-diff {
  margin: 8px 0;
}
.analyze-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 6px;
}
.analyze-diff-table th {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle, var(--line));
  font-weight: 600;
  vertical-align: top;
  width: 110px;
}
.analyze-diff-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle, var(--line));
  vertical-align: top;
  line-height: 1.4;
}
.analyze-diff-before {
  color: var(--muted, #999);
  background: rgba(255, 90, 90, 0.06);
}
.analyze-diff-after {
  background: rgba(90, 220, 140, 0.07);
  font-weight: 500;
}

.marketplace-error,
.job-error {
  color: #ffd1d1;
  font-size: 0.9rem;
  margin: 10px 0 0;
}

.membership-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* Bloc analyze conversationnel (kind=question) -- l'agent pose une question
   a l'humain qui repond via texte + image optionnelle. */
.analyze-question-block {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--border-subtle, var(--line));
  border-radius: 8px;
  background: var(--surface-subtle, var(--hover-2));
  display: grid;
  gap: 10px;
}
.analyze-question-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.analyze-question-text {
  font-size: 1.02rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
}
/* Le "Pourquoi" est l'info la plus importante du bloc question :
   c'est ce qui justifie pourquoi l'humain doit s'arreter et repondre.
   Mis en avant avec la couleur d'accent du projet (cuivre clair). */
.analyze-question-reason {
  margin: 4px 0 8px 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1.4;
}
.analyze-question-reason-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  margin-right: 6px;
  opacity: 0.9;
}
.analyze-question-history {
  margin: 4px 0;
}
.analyze-question-history summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted, rgba(255,255,255,0.65));
}
.analyze-question-history ol {
  margin: 8px 0 0 0;
  padding-left: 20px;
  font-size: 0.88rem;
}
.analyze-question-history li {
  margin-bottom: 4px;
}
.analyze-question-form {
  display: grid;
  gap: 8px;
}
/* Hint visuel quand l'IA recommande explicitement de joindre une image
   (label.highlight). Fond legerement teinte sans agresser. */
.analyze-question-form .analyze-review-label.highlight {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed rgba(59, 130, 246, 0.32);
}
.analyze-review-image-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}
/* Fieldset reset pour le picker images (legend + flex layout des boutons). */
.analyze-review-image-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.analyze-review-image-fieldset > legend {
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}
.analyze-review-image-pickers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.analyze-review-image-picker {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--hover-2);
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 120ms ease, border-color 120ms ease;
}
.analyze-review-image-picker:hover {
  background: var(--hover);
  border-color: var(--accent, #df8f78);
}
.analyze-review-image-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.analyze-review-image-count {
  font-size: 0.78rem;
  color: var(--success, #4caf50);
}
.analyze-review-image-count[hidden] { display: none; }
/* Carte review "media manquant" : infos item (ref/ean/qte/etat/prix) + ajout photos direct. */
.media-review-block { display: grid; gap: 12px; }
.media-review-upload-form { display: grid; gap: 8px; }
.media-review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
/* Carte media manquant : fieldset + apercus des photos ajoutees. */
.media-review-fieldset { display: grid; gap: 6px; }
.media-review-legend { font-size: 0.85rem; color: var(--text); }
.media-review-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.media-review-thumb { position: relative; width: 64px; height: 64px; }
.media-review-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.media-review-thumb-rm {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%; padding: 0;
  border: none; cursor: pointer; line-height: 18px;
  background: rgba(0, 0, 0, 0.78); color: #fff; font-size: 14px;
}
/* Picker images dans le form ai-question (messages.html / messages_ai_questions.html).
   2 boutons cote a cote : galerie + camera. */
.msg-ai-question-image-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.msg-ai-question-image-group .msg-ai-question-image {
  flex: 1 1 120px;
}
.msg-ai-question-image-group.has-file .msg-ai-question-image-btn {
  border-style: solid;
  border-color: var(--success, #4caf50);
  color: var(--success, #4caf50);
  background: rgba(76, 175, 80, 0.08);
}

.job-list {
  display: grid;
  gap: 12px;
}

.jobs-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.jobs-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.jobs-filters-panel {
  margin-bottom: 16px;
}

.job-running-panel {
  margin-bottom: 16px;
}

.job-running-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.job-running-header h2 {
  margin: 0;
}

.job-running-header p {
  margin: 0;
  color: var(--muted);
}

.job-running-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.job-running-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--hover-2);
}

.job-running-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.job-running-body {
  display: grid;
  gap: 10px;
}

.job-running-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.job-running-item:hover {
  text-decoration: none;
}

.jobs-filters {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.jobs-filter-field {
  display: grid;
  gap: 6px;
}

.jobs-filter-field span {
  color: var(--muted);
  font-size: 0.84rem;
}

.jobs-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.job-row-done-flash {
  animation: jobRowDoneFlash 2.1s ease-out;
}

.job-card:last-child {
  border-bottom: 0;
}

.job-card-main {
  min-width: 0;
}

.job-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.job-card-title-wrap {
  min-width: 0;
}

.job-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.job-card-body {
  margin-top: 14px;
}

.job-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.job-card-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.job-card-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.job-card-link {
  color: var(--text);
  text-decoration: none;
}

.job-card-link:hover {
  text-decoration: underline;
}

.job-card-summary {
  margin-top: 12px;
  display: grid;
  gap: 4px;
}

.job-card-debug {
  margin-top: 12px;
  border-top: 1px solid var(--hover);
  padding-top: 12px;
}

.job-card-debug summary {
  cursor: pointer;
  color: var(--muted);
}

.job-card-debug-block {
  margin-top: 10px;
}

.job-card-debug pre {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-inset);
  border: 1px solid var(--hover);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.job-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
}

.job-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.job-item-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-primary, #4f6ef7);
  font-size: 0.85rem;
  max-width: 260px;
  overflow: hidden;
}

.job-item-link:hover {
  text-decoration: underline;
}

.job-item-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.job-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-row-right {
  flex: 0 1 46%;
  min-width: 0;
  text-align: right;
}

.job-row > div:first-child {
  flex: 1 1 54%;
  min-width: 0;
}

.job-row strong,
.job-row .muted,
.job-error,
.job-card strong,
.job-card .muted,
.job-card span,
.job-card code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1080px) {
  .jobs-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jobs-filter-actions {
    grid-column: 1 / -1;
  }

  .job-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .jobs-filters {
    grid-template-columns: 1fr;
  }

  .job-running-list {
    grid-template-columns: 1fr;
  }

  .job-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .job-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-card-right {
    flex-wrap: wrap;
  }

  .job-item-link {
    max-width: 180px;
  }

  .job-card-grid {
    grid-template-columns: 1fr;
  }

  .job-card-actions {
    justify-content: flex-start;
  }

  .job-row {
    flex-direction: column;
    gap: 10px;
  }

  .job-row-right,
  .job-row > div:first-child {
    flex: 1 1 auto;
    width: 100%;
  }

  .job-row-right {
    text-align: left;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.badge-muted {
  background: var(--hover);
  color: var(--muted);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.badge-score {
  color: #fff;
  font-weight: 800;
  padding: 8px 14px;
  font-size: 0.92rem;
}

.badge-status {
  color: #191515;
  font-weight: 700;
}

.badge-status.badge-running {
  background: linear-gradient(135deg, #ffd47f, #f2b36a);
  color: #3a2500;
  box-shadow: 0 0 0 0 rgba(242, 179, 106, 0.22);
  animation: pulseDotWarm 2.7s ease-out infinite;
}

.badge-status-live {
  position: relative;
}

.job-status-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 18px;
}

.job-status-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.28;
  animation: jobStatusDotWave 1.1s ease-in-out infinite;
}

.job-status-live-dot:nth-child(2) {
  animation-delay: 0.14s;
}

.job-status-live-dot:nth-child(3) {
  animation-delay: 0.28s;
}

.badge-not-listed,
.badge-pending,
.badge-running {
  background: var(--warning);
}

.badge-listed,
.badge-done,
.badge-resolved {
  background: var(--success);
}

.badge-sold {
  background: #a8cfff;
  color: #10243f;
}

.badge-awaiting_review {
  background: #f0ad4e;
  color: #1a1a1a;
}

.badge-failed,
.badge-ignored,
.badge-not-eligible,
.badge-cancelled {
  background: var(--danger);
}

.badge-neutral,
.badge-running,
.badge-pending-approval,
.badge-executed,
.badge-rejected {
  background: var(--line-2);
  color: var(--text);
}

.badge-unknown,
.badge-open {
  background: #d0b6ff;
}

@keyframes jobStatusDotWave {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.28;
  }

  40% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

@keyframes jobRowDoneFlash {
  0% {
    background: rgba(137, 232, 173, 0.22);
    box-shadow: 0 0 0 0 rgba(137, 232, 173, 0.22);
  }

  45% {
    background: rgba(137, 232, 173, 0.14);
    box-shadow: 0 0 0 8px rgba(137, 232, 173, 0.05);
  }

  100% {
    background: transparent;
    box-shadow: 0 0 0 0 rgba(137, 232, 173, 0);
  }
}

/* Validation d'un lot DEPUIS SA FICHE (avant : uniquement sur /reviews,
   donc aucun bouton ici malgre la pastille « A valider »). */
.lot-validate-form,
.lot-validate-price {
  display: flex;
  gap: 8px;
  width: 100%;
}
.lot-validate-price {
  align-items: center;
  flex-wrap: wrap;
}
.lot-validate-price-field {
  position: relative;
  flex: 1 1 120px;
  display: inline-flex;
  align-items: center;
}
.lot-validate-price-field .input {
  width: 100%;
  padding-right: 28px;
}
.lot-validate-price-unit {
  position: absolute;
  right: 10px;
  color: var(--muted);
  pointer-events: none;
}
.lot-validate-price .action-button {
  width: auto;
  flex: 0 0 auto;
  padding: 12px 16px;
}
.lot-validate-hint {
  margin: 2px 0 6px;
  font-size: 0.85em;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 620px) {
  .lot-validate-price { flex-direction: column; align-items: stretch; }
  .lot-validate-price .action-button { width: 100%; }
}

.action-button-danger {
  background: rgba(255, 141, 141, 0.12);
  color: var(--text);
  border: 1px solid rgba(255, 141, 141, 0.28);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

.checkbox-field {
  align-content: center;
  grid-auto-flow: column;
  justify-content: start;
}

.checkbox-field .field-help {
  grid-column: 1 / -1;
}

.field-disabled {
  opacity: 0.62;
}

.upload-section h2,
.panel h2 {
  margin-top: 0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.pagination-label {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-select {
  background: var(--hover);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  cursor: pointer;
  min-width: 56px;
  text-align: center;
  color-scheme: dark;
}

.pagination-select option {
  background: var(--panel, var(--panel));
  color: var(--text);
}

.pagination-select:hover {
  background: var(--line);
  border-color: var(--muted-2);
}

.pagination-select:focus-visible {
  outline: 2px solid var(--accent, #c9a96a);
  outline-offset: 2px;
}

.pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
}

.pagination-nav.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.empty-state {
  padding: 28px 18px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--line-2);
  color: var(--muted);
}

.payload-view pre {
  margin: 10px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: 16px;
  background: rgba(9, 8, 8, 0.8);
  color: #e7dfdb;
}

@media (min-width: 760px) {
  .page-shell {
    width: min(1180px, calc(100vw - 56px));
    padding-top: 26px;
  }

  .auth-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .auth-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-topbar-actions {
    display: flex;
  }

  .landing-hero-v2 {
    grid-template-columns: minmax(0, 1.04fr) minmax(520px, 0.96fr);
    gap: 34px;
  }

  .landing-hero-v3 {
    grid-template-columns: minmax(0, 1.02fr) minmax(560px, 0.98fr);
  }

  .landing-proof,
  .feature-grid,
  .landing-columns,
  .audience-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-ribbon {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
  }

  .integrations-showcase-shell {
    grid-template-columns: 1.16fr 0.84fr;
    align-items: stretch;
  }

  .integration-story-grid {
    align-self: stretch;
  }

  .product-command-grid {
    grid-template-columns: 1.15fr 0.92fr 0.92fr;
    align-items: start;
  }

  .integrations-stage {
    grid-template-columns: 1.1fr 1fr 1fr;
    align-items: stretch;
  }

  .integration-core {
    grid-row: span 2;
    min-height: 100%;
  }

  .product-stage {
    grid-template-columns: 1.1fr 0.9fr 0.9fr;
    align-items: start;
  }

  .product-screen-stock {
    min-height: 100%;
  }

  .contrast-grid {
    grid-template-columns: 0.9fr 1.1fr 0.9fr;
    align-items: stretch;
  }

  .cta-shell {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .detail-hero {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .detail-gallery-slide {
    min-width: min(100%, 720px);
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .add-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  }

  .add-layout.mobile-split-shell > .mobile-split-track {
    display: contents;
  }

  .add-recent-panel {
    overflow-y: auto;
  }

  .settings-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .settings-home-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .settings-account-stack {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .marketplace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 760px) and (max-width: 1119px) {
  .stock-selection-toolbar {
    top: calc(78px + env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

@media (min-width: 1120px) {
  /* grand-ecran-0707 : mode « grand écran » (bouton en haut à droite de la barre,
     persisté en localStorage -> classe sur <html>). Le bandeau de gauche fixe ne
     s'applique QUE hors grand écran : en grand écran le menu retombe sur son
     comportement overlay (hamburger, comme mobile) et le contenu prend toute la
     largeur. Demande Philippe 2026-07-07, pensé pour la caisse (Achat / Vente /
     Dépôt-vente) mais global. */
  .app-shell:not(.app-shell-landing) {
    padding-bottom: 28px;
    /* largeur-menu-0711 (demande Philippe) : la largeur du volet gauche fixe est
       reglable a la souris (poignee sur le bord droit) et persistee par compte
       (base.js initMenuResize pose --menu-w sur <html>). Tout le calage du
       contenu (topbar, page-shell) derive de --menu-w-eff pour rester colle au
       volet quelle que soit sa largeur. Clamp de securite 240–560px. */
    --menu-w-eff: clamp(240px, var(--menu-w, 315px), 560px);
  }

  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .app-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--menu-w-eff);
    /* zoom-grandecran-0720 : 100vh IGNORE html{zoom:var(--af-autozoom)} (>=2040px)
       => le volet devenait plus HAUT que l'ecran, son bas (Parametres) hors champ.
       On divise par le zoom pour raisonner dans le repere zoome (no-op /1 en dessous). */
    height: calc(100vh / var(--af-autozoom, 1));
    z-index: 60;
    background: var(--surface-2);
    border-right: 1px solid var(--line);
  }

  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .app-menu > .menu-panel {
    display: flex;
    flex-direction: column;
    /* zoom-grandecran-0720 : idem, la surface scrollable du volet doit coller a la
       hauteur visible reelle (sinon overflow-y ne rattrape jamais le bas). */
    height: calc(100vh / var(--af-autozoom, 1));
    box-sizing: border-box;
    background: transparent;
    border-right: none;
    /* menu-marges-serrees-0711 (retour Achille : « t'as encore pas mal de px » a
       gauche et a droite) : sur le volet fixe desktop on resserre les marges
       laterales (8px au lieu de 18) pour que le contenu occupe mieux la largeur. */
    padding-left: 8px;
    padding-right: 8px;
  }

  /* Poignee de redimensionnement du volet (bord droit). Cree par base.js
     (initMenuResize), n'existe QUE sur le volet fixe desktop. Une bande fine
     invisible, curseur col-resize, qui s'eclaire a l'accostage/au glisser.
     handle-hors-scrollbar-0711 : positionnee en FIXED, calee pile sur le bord
     droit du volet (left:var(--menu-w-eff)) et large de 10px => bande dans le
     vide de 40px entre le menu et le contenu, JAMAIS sur la barre de defilement
     du menu. Avant, en position:absolute right:-4px/width:9px, elle depassait de
     4px A L'INTERIEUR du volet, pile sur la barre de defilement : vouloir
     scroller = attraper la poignee = redimensionner par accident (retour Achille).
     Le FIXED (au lieu d'un absolute qui deborde de .app-menu et se retrouve
     recouvert par .app-shell -> non cliquable) garantit qu'elle reste attrapable
     dans le vide ; elle suit le bord en direct pendant le glisser (--menu-w-eff). */
  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .app-menu > .menu-resize-handle {
    display: block;
    position: fixed;
    top: 0;
    left: var(--menu-w-eff);
    right: auto;
    width: 10px;
    /* zoom-grandecran-0720 : la poignee de resize suit la hauteur du volet zoome. */
    height: calc(100vh / var(--af-autozoom, 1));
    z-index: 61;
    cursor: col-resize;
    touch-action: none;
    background: transparent;
  }
  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .app-menu > .menu-resize-handle::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 140ms ease;
  }
  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .app-menu > .menu-resize-handle:hover::before,
  html.is-menu-resizing .app-shell:not(.app-shell-landing) .app-menu > .menu-resize-handle::before {
    opacity: 0.85;
  }
  /* Pendant le glisser : plus de transition de largeur, pas de selection de
     texte, curseur col-resize partout. */
  html.is-menu-resizing,
  html.is-menu-resizing * { cursor: col-resize !important; user-select: none !important; }

  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .topbar {
    padding: 22px 28px 18px calc(var(--menu-w-eff) + 40px);
  }

  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .page-shell {
    /* zoom-grandecran-0720 : 100vw IGNORE html{zoom:var(--af-autozoom)} (>=2040px).
       La page-shell etait mise en page a la largeur PLEINE (ex. 2560) puis agrandie
       => trop large ; son contenu (cape a 1280px et centre) derivait a DROITE en
       laissant un gros vide a gauche. On divise le vw par le zoom (no-op /1 sinon).
       Meme parade que le fix messagerie (commit 1ded1fd2a, ui_pitfalls piege 4bis). */
    width: calc(100vw / var(--af-autozoom, 1) - var(--menu-w-eff) - 68px);
    max-width: none;
    margin: 0 28px 0 calc(var(--menu-w-eff) + 40px);
    padding: 24px 28px 36px;
    display: grid;
    justify-items: center;
  }

  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .page-shell > * {
    width: min(1280px, 100%);
    justify-self: center;
  }

  .page-messages .page-shell > * {
    width: min(1560px, 100%);
  }

  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .menu-button,
  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .menu-overlay {
    display: none !important;
  }

  /* boutique-seg-0703 : la grille .menu-panel impose gap:18px entre header /
     barre boutiques / liens ; -8px ramene ces deux espaces a 10px (= le gap
     entre les liens du menu), comme en mode overlay. */
  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .menu-company-seg { margin-top: -8px; }
  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .menu-company-seg + .menu-links { margin-top: -8px; }

  html:not(.grand-ecran) .app-shell:not(.app-shell-landing) .menu-panel {
    position: static;
    width: 100%;
    height: 100%;
    display: grid;
    align-content: start;
    gap: 18px;
    padding: 20px 18px 24px;
    box-shadow: none;
    background: transparent;
    border-right: none;
    border-radius: 0;
    transform: none !important;
    transition: none;
    overflow-y: auto;
  }

  html:not(.grand-ecran) .stock-selection-toolbar {
    top: 18px;
    left: calc(332px + 28px);
    right: 28px;
    max-width: none;
  }

  /* grand-ecran-0707 : positionnement du menu en grand écran (l'overlay reste
     ancré en haut à gauche pour les rares ouvertures programmatiques). */
  html.grand-ecran .app-shell:not(.app-shell-landing) .app-menu {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top));
    left: 16px;
    z-index: 80;
  }

  /* menu-dock-0715 : en grand écran DESKTOP le hamburger ☰ est masqué (la poignée
     .menu-dock-toggle au bord gauche le remplace) → plus besoin de réserver 78px à
     gauche de la topbar, on repasse à la marge normale (28px), sinon un trou vide
     restait là où était le ☰. Sous 1120px (bloc @media max-width:1119px plus bas) le
     hamburger reste, lui, bien visible avec ses 78px. */
  html.grand-ecran .app-shell:not(.app-shell-landing) .topbar {
    padding-left: 28px;
    padding-right: 28px;
  }

  html.grand-ecran .app-shell:not(.app-shell-landing) .page-shell {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 24px 28px 36px;
  }

  /* report #243 : en grand ecran, le contenu ETROIT (bloc a max-width propre :
     changelog 760px, entetes, formulaires, cartes) se collait au bord GAUCHE, tout
     l'espace vide a droite. On recentre chaque enfant direct du page-shell :
     margin-inline:auto centre un bloc plus etroit que le page-shell et laisse
     INTACTS les blocs pleine largeur (ex. caisse .cc { max-width:100% } -> marges
     auto = 0 -> reste plein ecran, cf. comptoir-fluid Philippe). Le mode normal
     (hors grand ecran) centrait deja via grid + justify-items ; ici on retablit le
     meme confort visuel sans caper la largeur. */
  html.grand-ecran .app-shell:not(.app-shell-landing) .page-shell > * {
    margin-inline: auto;
  }

  html.grand-ecran .stock-selection-toolbar {
    top: 18px;
    left: 28px;
    right: 28px;
    max-width: none;
  }
}

@media (max-width: 1119px) {
  .app-shell:not(.app-shell-landing) .app-menu {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top));
    left: 16px;
    z-index: 80;
  }

  .app-shell:not(.app-shell-landing) .topbar {
    padding-left: 78px;
  }

  .app-shell:not(.app-shell-landing) .menu-button {
    position: static !important;
  }

  .menu-edge-swipe-zone {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 28px;
    z-index: 79;
    touch-action: pan-y;
    background: transparent;
  }

  body.menu-open-mobile .menu-edge-swipe-zone {
    display: none;
  }

  .pricing-layout.mobile-split-shell,
  .add-layout.mobile-split-shell,
  .pricing-origin-mobile-split.mobile-split-shell {
    display: block;
    overflow: hidden;
  }

  /* /add : `overflow: clip` (full, pas `hidden`) = clippe sur les 2 axes SANS
   * creer de scroll container. C'est la difference clef avec `hidden`: `clip`
   * n'expose pas d'interfaces de scroll → `scrollIntoView` ne scrolle pas le
   * shell mais le document → pas de pull-to-refresh declenche. De plus, `clip`
   * empeche le debordement vertical de la pane-side absolue (qui est aussi
   * longue que les "derniers ajouts") de propager vers le document → la page
   * reste a la hauteur de pane-main (form + EAN panel si affiche). */
  .add-layout.mobile-split-shell {
    overflow: clip;
  }

  /* /add : pane-side en position absolute pour qu'elle ne contribue pas a la
   * hauteur du track (flex container). Sinon track.height = max(pane-main,
   * pane-side), le document devient aussi long que pane-side et on peut scroll
   * sous pane-main jusqu'au bas des "derniers ajouts" alors qu'on est sur le
   * formulaire. Le JS (syncActivePaneHeight) garde le role de resize du shell
   * quand side open → shell.height = pane-side.height. Le transform
   * translateX(-100%) du track reste valide : pane-side a left:100% du track
   * se retrouve a left:0 du viewport apres la translation. */
  .add-layout.mobile-split-shell > .mobile-split-track {
    position: relative;
  }
  .add-layout.mobile-split-shell .mobile-split-pane-side {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
  }

  .pricing-layout.mobile-split-shell > .mobile-split-track,
  .add-layout.mobile-split-shell > .mobile-split-track,
  .pricing-origin-mobile-split.mobile-split-shell > .mobile-split-track {
    display: flex;
  }

  .mobile-split-track {
    display: flex;
    width: 100%;
    min-width: 100%;
    align-items: start;
    transition: transform 220ms ease;
    will-change: transform;
  }

  .mobile-split-shell.is-side-open .mobile-split-track {
    transform: translateX(-100%);
  }

  .mobile-split-shell.is-swiping .mobile-split-track {
    transition: none;
  }

  .mobile-split-pane {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
  }

  .mobile-split-pane-main {
    padding-right: 10px;
  }

  .mobile-split-pane-side {
    padding-left: 10px;
  }

  .mobile-side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, calc(100vw - 18px));
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 96;
    margin: 0;
    border-radius: 26px 0 0 26px;
    border-right: 0;
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateX(calc(100% - var(--mobile-drawer-shift, 0px)));
    transition: transform 180ms ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  }

  .mobile-side-drawer.is-open {
    transform: translateX(var(--mobile-drawer-shift, 0px));
  }

  .mobile-side-drawer.is-swiping {
    transition: none;
  }

  .mobile-side-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .mobile-side-drawer-overlay.is-visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 759px) {
  .settings-inline-form-compact {
    grid-template-columns: 1fr;
  }

  .hero-stage-v3 {
    min-height: 780px;
  }

  .hero-item-card-v3,
  .hero-hub-v3,
  .hero-jobs-v3,
  .hero-sync-card {
    transform: scale(0.92);
    transform-origin: top left;
  }

  .hero-item-card-v3 {
    left: 12px;
    top: 28px;
  }

  .hero-hub-v3 {
    left: 140px;
    top: 236px;
  }

  .hero-jobs-v3 {
    right: 12px;
    top: 74px;
  }

  .hero-sync-card {
    left: 18px;
    bottom: 62px;
  }

  .hero-command-strip {
    overflow-x: auto;
  }

  .integration-wall {
    min-height: 360px;
  }

.publishability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .publish-card {
    padding: 14px;
  }
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   PICKING LIST  v2
   ═══════════════════════════════════════════════════════════════════ */

.picking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 16px;
}
.picking-header-left { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.picking-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}
.picking-count {
  font-size: 2rem; font-weight: 800;
  color: var(--accent); letter-spacing: -0.02em;
}
.picking-updated { font-size: 0.8rem; }
.picking-refresh-pending {
  font-size: 0.8rem;
  margin-left: 8px;
  color: rgba(201, 169, 106, 0.95);
  background: rgba(201, 169, 106, 0.12);
  border: 1px solid rgba(201, 169, 106, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
}

.picking-ebay-force-scan {
  display: inline-block;
  margin-left: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.picking-ebay-force-scan:hover:not(:disabled) {
  color: rgba(201, 169, 106, 0.95);
  border-color: rgba(201, 169, 106, 0.45);
  background: rgba(201, 169, 106, 0.06);
}
.picking-ebay-force-scan:disabled {
  opacity: 0.55;
  cursor: wait;
}

.picking-lbc-label-pending {
  border-style: dashed;
  color: var(--muted);
}

.picking-lbc-label-pending:hover {
  color: rgba(201, 169, 106, 0.95);
  border-color: rgba(201, 169, 106, 0.45);
}
/* Petit texte d'explication sous le bouton "Bordereau en preparation" (#385) :
   rassure que le delai vient de Leboncoin et que la liste se rafraichit seule. */
.picking-lbc-label-hint {
  display: block;
  font-size: 0.68rem; line-height: 1.25;
  color: var(--muted);
  text-align: center;
  margin-top: -2px;
}

/* Styles de l'encart "bordereaux Packlink unmatched" RETIRES (#77, 2026-06-30) :
   l'encart .picking-ebay-related-label* a ete supprime de picking.html. */
.picking-refresh-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--hover-2);
  color: var(--text); display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  transition: transform 200ms ease, background 160ms ease;
}
.picking-refresh-btn:hover { background: var(--line); }
.picking-refresh-btn:active { transform: scale(0.88) rotate(-30deg); }
.picking-refresh-btn.is-loading { animation: pickingSpin 1s linear infinite; pointer-events: none; opacity: .5; }
@keyframes pickingSpin { to { transform: rotate(-360deg); } }

.picking-sync-gate {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
  border-color: rgba(242,179,106,0.32); background: rgba(242,179,106,0.08);
}
.picking-sync-gate-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Filters bar ── */
.picking-filters {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; padding: 0 0 16px;
}
.picking-tabs {
  display: flex; background: transparent;
  border-radius: 12px; padding: 0; gap: 8px;
}
.picking-tab {
  padding: 11px 20px; border-radius: 10px;
  font-size: 1.3rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  transition: all 160ms ease;
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2); background: var(--panel);
}
.picking-tab:hover { color: var(--text); background: var(--hover-2); border-color: var(--muted-2); }
.picking-tab.is-active { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
.picking-tab-badge {
  font-size: 0.9rem; font-weight: 700;
  background: rgba(223,143,120,0.2); color: var(--accent);
  padding: 2px 9px; border-radius: 100px;
  min-width: 24px; text-align: center;
}
.picking-channels {
  display: flex; gap: 6px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.picking-channels::-webkit-scrollbar { display: none; }
.picking-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  color: var(--muted); font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; text-decoration: none;
  transition: all 180ms ease; cursor: pointer;
}
.picking-pill:hover { background: var(--hover); color: var(--text); }
.picking-pill.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.picking-pill-count {
  font-size: 0.72rem; font-weight: 700;
  background: var(--line);
  padding: 0 6px; border-radius: 100px;
}
.picking-pill.is-active .picking-pill-count { background: rgba(27,21,22,0.15); }
.picking-pill-dot { width: 6px; height: 6px; border-radius: 50%; }
.picking-pill-dot--warn { background: #f2b36a; }
.picking-pill-dot--error { background: #ff8d8d; }
.picking-pill--amazon.is-active { background: #ff9900; border-color: #ff9900; }
.picking-pill--rakuten.is-active { background: #bf0000; border-color: #bf0000; color: #fff; }
.picking-pill--ebay.is-active { background: #e53238; border-color: #e53238; color: #fff; }
.picking-pill--lbc.is-active { background: #f56b2a; border-color: #f56b2a; color: #fff; }
.picking-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.picking-sort-label {
  font-size: 1.3rem; font-weight: 600; color: var(--muted);
  white-space: nowrap;
}
.picking-select {
  padding: 11px 18px; border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text); font-size: 1.3rem; font-weight: 600; cursor: pointer;
}

/* ── Card grid ── */
.picking-grid { display: grid; gap: 12px; }

/* ── Card ── */
.picking-card {
  /* Carte en 2 colonnes : GAUCHE = grande photo carree, DROITE = tout le reste
     (tag+logo, titre, prix, boutons). L'alerte butoir d'expedition (.picking-ship-alert)
     s'etale sur les 2 colonnes en haut via grid-column: 1 / -1. */
  display: grid;
  /* Refonte 2026-07-15 : MEME gabarit de photo que la Picking list sur tous les
     onglets (avant : 168px hors Picking, 132px sur Picking). */
  grid-template-columns: minmax(110px, 132px) minmax(0, 1fr);
  align-items: start;
  column-gap: 16px; row-gap: 8px;
  padding: 12px 18px; border-radius: 16px;
  border: 1px solid var(--hover);
  background: var(--panel);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  animation: pickFadeIn 350ms ease backwards;
}
.picking-card:hover {
  border-color: var(--line-2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
/* Bandeau d'alerte butoir : pleine largeur au-dessus de photo + contenu */
.picking-card > .picking-ship-alert { grid-column: 1 / -1; }

/* Colonne GAUCHE : grande photo produit en carre, occupe toute la zone */
.picking-card-photo {
  grid-column: 1;
  align-self: start;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--hover-2);
}
.picking-card-photo > a.picking-photo-link { display: block; width: 100%; height: 100%; }
.picking-card-photo > .picking-thumb,
.picking-card-photo > a.picking-photo-link > .picking-thumb {
  width: 100%; height: 100%;
  border-radius: 0;
  object-fit: cover;
  display: block;
}
.picking-card-photo > .picking-thumb--empty {
  width: 100%; height: 100%;
  border-radius: 0;
  display: grid; place-items: center;
}
.picking-card-photo > .picking-thumb--empty svg { width: 38%; height: 38%; }
/* Bundle (commande multi-articles) : pile de vignettes centree dans le carre */
.picking-card-photo > .picking-card-thumbs {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 10px; box-sizing: border-box;
}

/* Colonne DROITE : le bandeau d'infos, empile verticalement */
.picking-card-body {
  grid-column: 2;
  min-width: 0;
  display: flex; flex-direction: column; gap: 12px;
}
@keyframes pickFadeIn { from { opacity: 0; transform: translateY(8px); } }
.picking-card:nth-child(1) { animation-delay: 0ms; }
.picking-card:nth-child(2) { animation-delay: 30ms; }
.picking-card:nth-child(3) { animation-delay: 60ms; }
.picking-card:nth-child(4) { animation-delay: 90ms; }
.picking-card:nth-child(5) { animation-delay: 120ms; }
.picking-card:nth-child(n+6) { animation-delay: 150ms; }

/* Flash visuel sur la card cible quand on land via `#entry-xxx` (typiquement
   apres "Confirmer la vente" → redirect Bordereau avec scroll auto). Ring vert
   + glow qui pulse 2 fois sur ~2s puis la class est retiree par le JS dans
   picking.html. */
.picking-card--just-landed {
  animation: pickJustLanded 2400ms ease-out;
  border-color: rgba(120,220,160,0.7) !important;
  box-shadow: 0 0 0 3px rgba(120,220,160,0.35), 0 8px 32px rgba(120,220,160,0.25);
}
@keyframes pickJustLanded {
  0%   { box-shadow: 0 0 0 0 rgba(120,220,160,0.0); }
  20%  { box-shadow: 0 0 0 4px rgba(120,220,160,0.55), 0 10px 36px rgba(120,220,160,0.4); }
  50%  { box-shadow: 0 0 0 2px rgba(120,220,160,0.3), 0 8px 28px rgba(120,220,160,0.2); }
  80%  { box-shadow: 0 0 0 4px rgba(120,220,160,0.45), 0 10px 32px rgba(120,220,160,0.3); }
  100% { box-shadow: 0 0 0 0 rgba(120,220,160,0.0); }
}

/* Not-found state: signale aux autres pickers qu'un item a deja ete cherche sans succes */
.picking-card--not-found {
  border-color: rgba(224,95,95,0.35);
  background: linear-gradient(90deg, rgba(224,95,95,0.07) 0%, var(--panel) 40%);
  box-shadow: inset 3px 0 0 0 var(--danger, #e05f5f);
}
.picking-card--not-found:hover {
  border-color: rgba(224,95,95,0.55);
  box-shadow: inset 3px 0 0 0 var(--danger, #e05f5f), 0 4px 20px rgba(0,0,0,0.12);
}

/* Note "Preciser" : la carte porte une note d'info. Coloration LEGERE (rework
   2026-06-19, plus l'orange intrusif d'avant) : un voile bleu-gris discret + un
   mince liseré gauche. La note elle-meme s'affiche dans .picking-note. */
.picking-card--hold {
  border-color: rgba(138,168,191,0.28);
  background: rgba(138,168,191,0.05);
  box-shadow: inset 2px 0 0 0 rgba(138,168,191,0.55);
}
.picking-card--hold:hover {
  border-color: rgba(138,168,191,0.4);
  box-shadow: inset 2px 0 0 0 rgba(138,168,191,0.55), 0 4px 20px rgba(0,0,0,0.12);
}
/* Cas ou une card est a la fois --not-found ET --hold (user a marque
   "Pas trouve" apres avoir laisse une note). Priorite visuelle au
   --not-found (rouge) car c'est l'info la plus importante ; la bordure
   droite reste orange pour signaler qu'il y a aussi une note. */
.picking-card--not-found.picking-card--hold {
  border-color: rgba(224,95,95,0.35);
  background: linear-gradient(90deg, rgba(224,95,95,0.07) 0%, var(--panel) 40%);
  box-shadow: inset 3px 0 0 0 var(--danger, #e05f5f),
              inset -2px 0 0 0 rgba(138,168,191,0.5);
}
.picking-card--not-found.picking-card--hold:hover {
  box-shadow: inset 3px 0 0 0 var(--danger, #e05f5f),
              inset -2px 0 0 0 rgba(138,168,191,0.5),
              0 4px 20px rgba(0,0,0,0.12);
}

/* Bloc note "Preciser" : info libre sur la vente, texte COMPLET (passe a la
   ligne, pas de troncature), sous le bloc produit, sur tous les onglets.
   Discret/neutre — la coloration de carte reste tres legere (.picking-card--hold). */
.picking-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 9px;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(138,168,191,0.08);
  color: var(--text, var(--text));
  font-size: 0.8rem;
  line-height: 1.45;
}
.picking-note svg {
  flex: none;
  margin-top: 2px;
  color: var(--ink-blue, #8aa8bf);
  opacity: 0.85;
}
.picking-note-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Card top row */
.picking-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.picking-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

/* Channel tag — agrandi + logo de la marketplace pour reconnaitre le canal
   d'un coup d'oeil (Amazon, Rakuten, eBay, Leboncoin, Vinted). */
.picking-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 1rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 6px 12px; border-radius: 9px;
  line-height: 1;
}
.picking-tag-logo {
  width: 24px; height: 24px; flex: none;
  object-fit: contain; display: block;
}
.picking-tag-label { display: inline-block; }
.picking-tag--amazon { background: rgba(255,153,0,0.15); color: #ff9900; }
.picking-tag--rakuten { background: rgba(191,0,0,0.15); color: #ff4d4d; }
.picking-tag--ebay { background: rgba(229,50,56,0.15); color: #e53238; }
.picking-tag--lbc { background: rgba(245,107,42,0.15); color: #f56b2a; }

/* Separateur de plateforme (onglet Caisse) : trait marque + nom + logo, injecte
   a chaque changement de marketplace pour signaler "on change de plateforme".
   Colore par canal (meme teintes que les tags ; eBay en bleu) ; le nom (logo +
   libelle) est CENTRE, avec un trait de chaque cote (::before + ::after). */
.picking-channel-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 2px 4px;
  font-size: 2rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted);
}
.picking-grid > .picking-channel-sep:first-child { margin-top: 2px; }
.picking-channel-sep-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.picking-channel-sep-label { flex: none; }
.picking-channel-sep::before,
.picking-channel-sep::after {
  content: ""; flex: 1 1 auto; height: 30px; border-radius: 15px;
  background: currentColor; opacity: 1;
  box-shadow: 0 0 10px currentColor, 0 0 22px currentColor;
}
/* Teintes FLUO (neon) par canal — le halo (box-shadow ci-dessus) reprend
   currentColor pour l'effet fluorescent. */
.picking-channel-sep--amazon { color: #ffb000; }
.picking-channel-sep--rakuten { color: #ff2d55; }
.picking-channel-sep--ebay { color: #1fa2ff; }
.picking-channel-sep--lbc { color: #ff6a1a; }
.picking-channel-sep--vinted { color: #05e0d0; }

/* Badges */
.picking-badge {
  font-size: 0.68rem; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; white-space: nowrap;
}
.picking-badge--done { background: rgba(125,214,170,0.15); color: var(--success); }
.picking-badge--status { background: rgba(138,168,191,0.15); color: var(--ink-blue); }
.picking-badge--warn { background: rgba(242,179,106,0.15); color: var(--warning); }
/* Quantite > 1 (demande Philippe 20/07) : la pastille FLUO dans l'encart
   remplace l'ancien filigrane geant (::before) qui se noyait derriere les
   boutons Bordereau / Saisi en caisse. Grosse, jaune fluo avec halo, elle
   reste DANS la carte. La checklist ajoute en plus la question
   « Avez-vous bien emballé les N articles ? » (fragment pack-checklist). */
.picking-badge--qty {
  background: var(--qty-fluo);
  color: var(--qty-fluo-ink);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
  padding: 4px 16px;
  border-radius: 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 0 12px color-mix(in srgb, var(--qty-fluo) 65%, transparent);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
}
.picking-qty-txt {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .picking-badge--qty { font-size: 1.25rem; padding: 3px 12px; }
  .picking-qty-txt { font-size: 0.75rem; }
}

.picking-badge--notfound {
  background: rgba(224,95,95,0.18);
  color: var(--danger, #e05f5f);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border: 1px solid rgba(224,95,95,0.35);
}
/* Badge "En attente" (note libre saisie via bouton "Preciser"). Calque
   sur picking-badge--notfound mais en orange. Cliquable : ouvre le
   prompt JS pour modifier la note (ou la retirer en validant vide). */
.picking-badge--hold {
  background: rgba(244,185,66,0.15);
  color: var(--warning, #f2b36a);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border: 1px solid rgba(244,185,66,0.4);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}
.picking-badge--hold:hover {
  background: rgba(244,185,66,0.25);
  border-color: rgba(244,185,66,0.6);
}

/* Product row — la photo est desormais la colonne gauche (.picking-card-photo).
   .picking-thumb sert d'image produit, dimensionnee par .picking-card-photo. */
.picking-thumb {
  border-radius: 12px;
  object-fit: cover;
  background: var(--hover-2);
}
.picking-thumb--empty {
  display: grid; place-items: center;
  color: var(--line-2);
}
.picking-card-thumbs { display: flex; flex-shrink: 0; }
.picking-mini-thumb {
  width: 40px; height: 40px; border-radius: 10px;
  object-fit: cover; border: 2px solid var(--panel);
  margin-left: -8px; position: relative;
}
.picking-mini-thumb:first-child { margin-left: 0; }
.picking-mini-thumb--empty,
.picking-mini-thumb--more {
  background: var(--hover);
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
}
.picking-card-text { min-width: 0; }
.picking-card-title {
  font-size: 0.95rem; font-weight: 600; margin: 0; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.picking-card-title-link { color: inherit; text-decoration: none; }
.picking-card-title-link:hover .picking-card-title { text-decoration: underline; }
.picking-card-sku { font-size: 0.78rem; color: var(--muted); }
.picking-card-ean {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: all;
}
.picking-card-ean:hover { color: var(--text, inherit); text-decoration: underline; }
/* 3 derniers chiffres de l'EAN en gras + couleur pleine (demande Philippe
   2026-07-14) : aide a distinguer / verifier l'EAN d'un coup d'oeil. */
.picking-ean-tail { font-weight: 800; color: var(--text); }

/* ── Picking list : agencement de la carte en 2 zones (onglet Picking) ──
   GAUCHE (.picking-pk-info) : infos empilees — marketplace (haut), description
   un peu plus grande (milieu), emplacement + EAN (bas). DROITE
   (.picking-card-actions--pk) : les actions (Trouve, Prix, Stock, Introuvable),
   centrees verticalement. On joue sur la LARGEUR. */
/* La carte Picking s'etire pour que le corps fasse la hauteur de la photo :
   on peut alors aligner les infos (description + emplacement) sur le BAS de
   l'image. */
.picking-card--picking {
  align-items: stretch;
  /* Bandeaux Picking list reduits (tout rentre : infos + actions se rapprochent)
     et centres sur la page, comme la liste /stock. Photo un peu plus petite ->
     bandeau moins haut. */
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  grid-template-columns: minmax(110px, 132px) minmax(0, 1fr);
}
.picking-card--picking .picking-card-body {
  /* Disposition validee (Philippe) : colonne INFOS collee a la photo, qui fait
     TOUTE la hauteur de la photo -> marketplace EN HAUT, description + emplacement
     EN BAS (alignes sur le bas de la photo). Les ACTIONS sont groupees a droite,
     centrees. L'ecart du milieu s'ajuste tout seul (space-between). */
  display: flex;
  /* row EXPLICITE : la regle generique .picking-card-body est en column,
     sans ca le rail d'action tombe SOUS les infos au lieu d'etre a droite. */
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.picking-pk-info {
  display: flex; flex-direction: column;
  gap: 8px; min-width: 0;
  flex: 0 1 auto;
  /* borne : une description longue se replie au lieu de pousser les boutons */
  max-width: 58%;
}
/* Marketplace reste EN HAUT ; description + emplacement pousses EN BAS (au niveau
   du bas de la photo) via margin-top:auto sur .picking-card-text. */
.picking-card--picking .picking-pk-info > .picking-card-text { margin-top: auto; }
/* Description un peu plus grande, au-dessus de l'emplacement — generalisee a
   TOUS les onglets (refonte 2026-07-15, avant : Picking list seule). */
.picking-card .picking-card-title {
  font-size: 1.1rem; line-height: 1.3;
  -webkit-line-clamp: 2;
}
/* Rail d'action VERTICAL a droite (Option A audit) : colonne compacte centree
   verticalement, Trouve au-dessus / Introuvable dessous, meme largeur. */
.picking-card--picking .picking-card-actions--pk { align-self: center; flex: 0 0 auto; }

/* Emplacement (gros) + EAN (plus petit) sur une ligne, en bas de la colonne info */
.picking-locrow {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 4px 12px; margin-top: 2px;
}
/* Emplacement = badge encadre avec epingle, MEME visuel que les cartes /stock
   et le duo de la fiche article (.stock-card-location). Clic = copie la ref
   complete (data-copy). Variante --sm pour les sous-lignes multi-vente. */
.picking-loc {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 14px; border-radius: 11px;
  background: var(--surface-inset);
  border: 2px solid var(--line-2);
  color: var(--text-strong);
  font-size: 1.4rem; font-weight: 900; line-height: 1;
  letter-spacing: 0.5px; font-variant-numeric: tabular-nums;
  text-transform: uppercase; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.picking-loc svg { flex: 0 0 auto; width: 1.05em; height: 1.05em; color: var(--accent); }
/* .copy-on-click (defini plus bas) pose un border-bottom 1px pointille qui
   ecraserait le bas du cadre 2px du badge -> on le neutralise ici. */
.picking-loc.copy-on-click { border-bottom: 2px solid var(--line-2); }
.picking-loc--sm.copy-on-click { border-bottom: 1.5px solid var(--line-2); }
.picking-loc--sm {
  font-size: 0.88rem; font-weight: 800;
  padding: 2px 8px; border-radius: 8px; border-width: 1.5px; gap: 5px;
}
.picking-ean-big {
  font-size: 1rem; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  color: var(--muted); cursor: pointer; user-select: all;
}
.picking-ean-big:hover { color: var(--text, inherit); text-decoration: underline; }

/* Résumé partagé des emplacements réels : fiche, /stock et picking. */
.location-summary {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  text-transform: none;
}
.stock-card:has(.location-summary:hover),
.stock-card:has(.location-summary.is-open),
.stock-card:focus-within,
.picking-card:has(.location-summary:hover),
.picking-card:has(.location-summary.is-open),
.picking-card:focus-within {
  position: relative;
  z-index: 90;
}
.location-summary-trigger {
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
[data-location-popover-trigger] {
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}
[data-location-popover-trigger]:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
[data-location-popover-trigger]:focus-visible,
.location-summary-popover-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 3px;
}
/* #499/#515 : le multi-emplacement reste explicite sur tous les ecrans.
   Meme structure que /stock, reduite seulement dans les contextes etroits. */
.location-summary--expanded {
  display: flex;
  vertical-align: middle;
}
.stock-loc-multi {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  border: 2px solid var(--accent);
  border-radius: 13px;
  background: var(--surface-inset);
  overflow: hidden;
  text-align: left;
}
[data-location-popover-trigger].stock-loc-multi { cursor: pointer; }
.stock-loc-multi-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .2px;
  white-space: nowrap;
}
.stock-loc-multi-head svg {
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
}
.stock-loc-multi-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  padding: 5px 11px 6px;
}
.stock-loc-multi-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
}
.stock-loc-multi-code {
  color: var(--text-strong);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stock-loc-multi-qty {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stock-loc-multi-row.is-unassigned .stock-loc-multi-code {
  color: var(--muted);
  font-size: 1rem;
}
.stock-loc-multi-more {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 3px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.location-summary--picking .stock-loc-multi-code {
  font-size: clamp(1rem, 2vw, 1.25rem);
}
.location-summary--picking-sm .stock-loc-multi {
  border-width: 1.5px;
  border-radius: 9px;
}
.location-summary--picking-sm .stock-loc-multi-head {
  gap: 4px;
  padding: 2px 7px;
  font-size: .68rem;
}
.location-summary--picking-sm .stock-loc-multi-list {
  padding: 3px 7px 4px;
}
.location-summary--picking-sm .stock-loc-multi-code {
  font-size: .86rem;
  letter-spacing: .2px;
}
.location-summary--picking-sm .stock-loc-multi-qty,
.location-summary--picking-sm .stock-loc-multi-more {
  font-size: .66rem;
}
.location-summary--flat::after { content: none; }
.location-summary-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(310px, calc(100vw - 32px));
  max-height: min(var(--loc-pop-max, 100vh), calc(100vh - 32px));
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px) scale(.97);
  transform-origin: top;
  transition: opacity .18s ease,
    transform .22s cubic-bezier(.2,.8,.2,1), visibility .18s;
}
.location-summary--stock .location-summary-popover {
  right: 0;
  transform-origin: top right;
}
.location-summary--picking .location-summary-popover,
.location-summary--picking-sm .location-summary-popover {
  left: 0;
  transform-origin: top left;
}
.location-summary::after {
  content: "";
  position: absolute;
  z-index: 79;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
  pointer-events: none;
}
.location-summary.is-open::after { pointer-events: auto; }
.location-summary.is-open .location-summary-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.location-summary.is-up .location-summary-popover {
  top: auto;
  bottom: calc(100% + 9px);
  transform: translateY(7px) scale(.97);
  transform-origin: bottom;
}
.location-summary.is-up::after {
  top: auto;
  bottom: 100%;
}
.location-summary.is-up.is-open .location-summary-popover {
  transform: translateY(0) scale(1);
}
@media (min-width: 721px) and (hover: hover) and (pointer: fine) {
  .location-summary:hover::after { pointer-events: auto; }
  .location-summary:hover:not(.is-dismissed) .location-summary-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .location-summary.is-up:hover:not(.is-dismissed) .location-summary-popover {
    transform: translateY(0) scale(1);
  }
}
.location-summary-popover-head,
.location-summary-popover-list,
.location-summary-popover-row {
  display: flex;
}
.location-summary-popover-head {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: .78rem;
  color: var(--muted);
}
.location-summary-popover-head strong {
  color: var(--text);
  font-size: .88rem;
}
.location-summary-popover-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.location-summary-popover-close {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}
.location-summary-popover-close:hover {
  color: var(--text);
  background: var(--hover);
}
.location-summary-popover-list {
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: min(320px, 48vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 3px;
}
.location-summary-popover-row {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--bg);
  font-size: .86rem;
}
.location-summary-popover-row > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.location-summary-popover-row i { color: var(--accent); }
.location-summary-popover-row.is-unassigned {
  color: var(--muted);
  font-style: italic;
}
.location-summary-popover-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  color: var(--accent);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}
.location-summary-popover-link:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
@media (max-width: 720px) {
  .location-summary--stock .stock-loc-multi {
    flex: 1 1 100%;
  }
  .location-summary--stock .stock-loc-multi-head {
    padding: 2px 9px;
    font-size: .72rem;
  }
  .location-summary--stock .stock-loc-multi-list {
    gap: 0;
    padding: 4px 9px 5px;
  }
  .location-summary--stock .stock-loc-multi-code {
    font-size: clamp(1rem, 4.2vw, 1.3rem);
  }
  .location-summary--stock .stock-loc-multi-qty {
    font-size: .7rem;
  }
  .location-summary-popover {
    width: min(310px, calc(100vw - 24px));
  }
  .location-summary-popover-close {
    width: 32px;
    height: 32px;
    color: var(--text);
    background: var(--hover);
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-location-popover-trigger],
  .location-summary-popover { transition: none; }
}

/* Prix + Stock sortis du rail : petites pastilles sous l'emplacement / EAN,
   dans la colonne infos (Option A audit). */
.picking-pk-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 5px; margin-top: 4px;
}
.picking-pk-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--hover-2); border: 1px solid var(--line);
  line-height: 1.2;
}
.picking-pk-chip-lbl {
  font-size: 0.62rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.picking-pk-chip-val { font-size: 0.8rem; font-weight: 700; }
/* #404 : le MONTANT est la valeur qu'on cherche du regard dans la liste -> sa
   bulle est cerclee (choix C de Philippe 16/07) pendant que Vendu/Net/Stock
   gardent le filet neutre. #410 : couleur passee du lime « presque fluo » (juge
   moche par Achille) au VERT EMERAUDE (jeton --price-ring). Le padding est reduit
   de 1px pour compenser le liseré de 2px : la bulle Prix garde EXACTEMENT la meme
   hauteur que ses voisines. Fond dilue (10%) via color-mix : suit --price-ring,
   donc chaque theme reste dans sa gamme. */
.picking-pk-chip--price {
  padding: 1px 7px;
  border: 2px solid var(--price-ring);
  background: color-mix(in srgb, var(--price-ring) 10%, transparent);
}
/* Onglet CAISSE (demande Philippe 20/07) : le NET est le montant que l'equipe
   tape en caisse -> sa bulle est 2x plus grosse que la bulle Prix (0.8rem ->
   1.6rem) et cerclee BLEU (--net-ring) pour ne jamais confondre les deux. */
.picking-pk-chip--net {
  padding: 3px 12px;
  border: 2px solid var(--net-ring);
  background: color-mix(in srgb, var(--net-ring) 10%, transparent);
}
.picking-pk-chip--net .picking-pk-chip-lbl { font-size: 0.8rem; }
.picking-pk-chip--net .picking-pk-chip-val { font-size: 1.6rem; }

/* ── Checklist d'emballage (demande Philippe 20/07, anti-oublis stagiaires) ──
   Fragment AJAX injecte dans .pk-packlist (cf picking_pack_checklist_fragment
   .html). Encart discret dans la colonne infos ; la ligne quantite (x2/x3) est
   teintee fluo, une reponse « Non » teinte sa ligne en rouge. */
.pk-packlist {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--hover-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pk-packlist-head {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pk-packlist-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 2px 4px;
  border-radius: 8px;
}
.pk-packlist-q { font-size: 0.85rem; flex: 1 1 180px; }
.pk-packlist-row--qty {
  background: color-mix(in srgb, var(--qty-fluo) 14%, transparent);
}
.pk-packlist-row--qty .pk-packlist-q { font-weight: 700; }
.pk-packlist-row--alert {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.pk-packlist-row--alert .pk-packlist-q { color: var(--danger); font-weight: 700; }
.pk-packlist-btns { display: inline-flex; gap: 4px; flex: none; }
.pk-packlist-btn {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
}
.pk-packlist-btn:hover { border-color: var(--line-2); color: var(--text); }
.pk-packlist-btn.is-on { color: var(--text-strong); font-weight: 700; }
.pk-packlist-btn.is-on.is-oui {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}
.pk-packlist-btn.is-on.is-non {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}
.pk-packlist-btn.is-on.is-pas_besoin {
  border-color: var(--line-2);
  background: var(--hover);
}
@media (max-width: 640px) {
  .pk-packlist { padding: 7px 8px; }
  .pk-packlist-q { font-size: 0.8rem; }
  .pk-packlist-btn { padding: 3px 12px; }
}

/* Picking list : RAIL D'ACTION VERTICAL a droite. Style "pastille icone"
   (choix Philippe 14/07, style D du comparateur) : bouton sobre sur surface
   du theme (marche en clair ET sombre), smiley dans une pastille coloree a
   gauche — VERT = trouve, ROUGE = introuvable. */
.picking-card-actions--pk {
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: center;
  gap: 6px;
  width: 210px; max-width: 100%;
}
.picking-card-actions--pk > form { margin: 0; width: 100%; }
/* Smiley des boutons Trouve / Introuvable (hors rail : gros, petite marge). */
.pk-emoji {
  font-size: 1.8em;
  line-height: 1;
  vertical-align: middle;
  margin-right: 0.28em;
  position: relative;
  top: -0.05em;
}
.picking-card-actions--pk .btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex; align-items: center; justify-content: flex-start;
  /* gap/padding resserres : « Article introuvable » debordait de 4px du rail
     de 190px depuis le passage a Inter (plus large que Bahnschrift). */
  gap: 8px;
  font-size: 0.92rem; font-weight: 700;
  padding: 6px 12px; border-radius: 10px;
  /* #393/#397 : un libelle long ("Acheter bordereau (Amazon)"...) passe a la
     ligne au lieu de deborder du rail (avant : nowrap -> texte hors carte,
     pire sur mobile). overflow-wrap: anywhere effondre le min-width:auto de
     l'item texte flex (sinon il refuse de se replier et deborde). min-height
     laisse le bouton grandir proprement. */
  white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.25;
}
.picking-card-actions--pk .btn--primary,
.picking-card-actions--pk .btn--ghost {
  background: var(--hover-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.picking-card-actions--pk .btn--primary:hover,
.picking-card-actions--pk .btn--ghost:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--line-2);
}
/* La pastille : carre arrondi colore, smiley centre dedans. */
.picking-card-actions--pk .btn .pk-emoji {
  width: 22px; height: 22px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  font-size: 0.95rem;
  margin-right: 0; top: 0;
}
.picking-card-actions--pk .btn--primary .pk-emoji { background: #2a9d63; }
.picking-card-actions--pk .btn--ghost .pk-emoji { background: #c94840; }

/* Numbers row */
.picking-card-numbers { display: flex; gap: 4px; flex-wrap: wrap; }
.picking-num {
  flex: 1; min-width: 64px; padding: 8px 10px;
  border-radius: 10px; background: var(--hover-2);
  text-align: center;
}
.picking-num-val { display: block; font-size: 0.88rem; font-weight: 700; line-height: 1.2; }
.picking-num-val--green { color: var(--success); }
.picking-num-val--red { color: var(--danger); }
.picking-num-lbl {
  display: block; font-size: 0.65rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 1px;
}

/* ── Refonte carte picking unifiee (reports 372/373/374, 2026-07-15) ──
   Le rendu Picking list (emplacement en gros, infos a GAUCHE / actions a DROITE,
   pleine largeur) devient le socle de TOUS les onglets. Bordereau et Historique
   quittent le rendu vertical + bloc de chiffres Date/Prix/Net/Stock. Caisse garde
   ses chiffres a droite (.picking-caisse-nums, design Philippe) : sa ligne meta
   est masquee cote template pour ne pas doublonner. */
.picking-card-body {
  flex-direction: row; flex-wrap: wrap;
  align-items: stretch; justify-content: space-between;
  gap: 8px 16px;
}
.picking-pk-info {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0; flex: 1 1 320px; max-width: 100%;
}
/* Description + emplacement alignes sur le bas de la photo quand la carte s'etire.
   UNIQUEMENT sur l'onglet Picking (report #391) : ailleurs (Confirmer/Bordereau,
   Caisse), le rail d'action peut etre haut (ex. LBC avec code magasin) -> la carte
   s'etire, et ce margin-top:auto creait une grosse bande VIDE au milieu de la
   colonne info (entre le tag marketplace et la description). Hors Picking, les
   infos s'empilent naturellement en haut, sans trou. */
.picking-card--picking .picking-card-body > .picking-pk-info > .picking-card-text { margin-top: auto; }
/* Largeur d'AVANT restauree (retour Achille 15/07 soir) : cartes bornees a
   960px et centrees comme la Picking list pre-refonte — appliquee a TOUS les
   onglets (uniformite). */
.picking-card { width: 100%; max-width: 960px; margin-inline: auto; }
.picking-card--picking .picking-pk-info { max-width: 100%; }
/* SKU complet : plus jamais affiche sur les cartes (retour Achille 15/07) —
   seul l'emplacement est montre, le clic sur le badge copie la ref complete.
   Les meta (date/prix/net/stock) sont des bulles .picking-pk-chip communes. */
/* Mobile (report 356) : la carte repasse en colonne et la barre d'action descend
   SOUS les infos -> l'EAN n'est plus recouvert par un bouton. */
@media (max-width: 640px) {
  .picking-card-body { flex-direction: column; align-items: stretch; }
  .picking-pk-info { flex-basis: auto; max-width: 100%; }
  .picking-card-actions--pk { width: 100%; }
}

/* Warning (unmatched) */
.picking-card-warn {
  padding: 8px 12px; border-radius: 10px;
  background: rgba(242,179,106,0.08); border: 1px solid rgba(242,179,106,0.18);
  font-size: 0.82rem; color: var(--warning);
}

/* Bundle */
.picking-bundle { border-radius: 10px; overflow: hidden; }
.picking-bundle summary {
  padding: 8px 14px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; background: var(--hover-2);
  border-radius: 10px; list-style: none;
  transition: background 160ms ease;
}
.picking-bundle summary::-webkit-details-marker { display: none; }
.picking-bundle summary::before { content: "\25B8 "; }
.picking-bundle[open] summary::before { content: "\25BE "; }
.picking-bundle summary:hover { background: var(--hover); }
.picking-bundle-list { display: grid; gap: 6px; padding: 10px 0 4px; }
.picking-bundle-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 8px; font-size: 0.85rem;
}
.picking-bundle-row:hover { background: var(--hover-2); }
.picking-bundle-img {
  width: 40px; height: 40px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
}
.picking-bundle-img--empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--hover-2); color: var(--muted-2);
  font-size: 1.1rem;
}
/* Rakuten bundle: per-item rows with the cancel ✕ on the right */
.picking-bundle--rakuten summary {
  background: rgba(191,18,29,0.10);
  color: var(--rakuten, #ff5c4d);
}
.picking-bundle--rakuten summary:hover { background: rgba(191,18,29,0.16); }
.picking-bundle-row--rakuten {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
}
.picking-bundle-row--rakuten[data-item-state="history"] {
  opacity: 0.55;
}
.picking-bundle-row--with-lookalikes {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
}
.picking-bundle-row--rakuten.picking-bundle-row--with-lookalikes {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}
/* Ligne de lot Rakuten/eBay marquee "Introuvable" (retour Achille 16/07) : dans
   le DOM, la recherche de liaison en stock arrive AVANT les boutons -> l'auto-
   placement grid poussait les boutons Trouve/Annuler en 3e rangee, dans la
   colonne image de 40px (boutons ecrases sous la liaison). On les force en
   rangee 1, colonne de droite — meme rendu que les lignes multi-exemplaires
   LBC (dont l'ordre DOM est deja le bon). */
.picking-bundle-row--rakuten.picking-bundle-row--with-lookalikes > .picking-bundle-row-actions {
  grid-row: 1;
  grid-column: 3;
}
/* Report #477 : dans un lot Rakuten, le champ code magasin ne doit jamais
   devenir une quatrième colonne qui écrase le titre. Il prend sa propre ligne
   sous le produit, de la colonne texte jusqu'au bord droit. */
.picking-bundle-row--rakuten > .picking-store-barcode-form {
  grid-column: 2 / -1;
  width: 100%;
  min-width: 0;
  margin: 4px 0 0;
}
.picking-bundle-row--rakuten > .picking-store-barcode-form .picking-barcode-shell {
  flex: 1 1 auto;
  min-width: 0;
}
.picking-bundle-row--rakuten > .picking-store-barcode-form .picking-barcode-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.picking-lookalikes--bundle {
  grid-column: 2 / -1;
  margin: 0 0 2px;
}
.picking-bundle-row-text {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.picking-bundle-row-text strong { font-size: 0.85rem; }
.picking-bundle-row-text .muted { font-size: 0.72rem; }
.picking-bundle-row-text .picking-badge { align-self: flex-start; margin-top: 2px; }
/* Ligne emplacement (petite carte) + EAN dans une sous-ligne de lot. align-self
   flex-start = le badge --sm ne s'etire pas sur la largeur de la colonne (le
   bug "boite moche" du 16/07 venait du flex column qui etire en stretch). */
.picking-bundle-locrow {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 3px 8px; align-self: flex-start; margin-top: 1px;
}
.picking-bundle-locrow .picking-card-ean { margin-left: 0; }
.picking-bundle-row-price {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #f0c040);
  align-self: flex-start;
  margin-top: 2px;
}
.picking-bundle-row-actions {
  display: flex; flex-direction: row; align-items: center; gap: 4px;
  flex-wrap: nowrap;
}
.picking-bundle-row-form { margin: 0; }
.picking-bundle-cancel-form { margin: 0; }

/* Ticket 526 — croix « annuler cet article seul » sur une ligne de lot en
   Confirmer / Bordereau. Meme icone discrete que celle du header de carte
   (.picking-cancel-x) ; on la remonte juste un peu en visibilite, seule action
   de la ligne a cette etape, et on la sort du gabarit `.btn` du cluster. */
.picking-bundle-cancel-x { display: inline-flex; margin: 0; }
.picking-bundle-row-actions .picking-cancel-x { opacity: 0.75; padding: 6px 8px; }
.picking-bundle-row-actions .picking-cancel-x:hover { opacity: 1; }

/* Ticket 525 — retour du bouton « Ajouter » d'un code magasin enregistre sans
   passer par la confirmation de la vente. Jetons uniquement : lisible sur les
   8 themes. */
.picking-sbc-save.is-saved {
  color: var(--on-accent);
  background: var(--success);
  border-color: var(--success);
}

/* ── Layout LOT (refonte 2026-07-15, retour Achille) ──
   Carte a plusieurs lignes (bundle OU meme article xN) sur l'onglet Picking :
   boutons GENERAUX (toute la commande) EN BAS pleine largeur, boutons par
   article/exemplaire A DROITE de chaque ligne. La classe `.picking-card--lot`
   sort les boutons generaux du corps -> ils passent en 3e rangee de la grille
   carte, sur toute la largeur (photo comprise). */
.picking-card--lot .picking-card-actions--bottom {
  grid-column: 1 / -1;
  width: auto; max-width: none; align-self: stretch;
  flex-direction: row; flex-wrap: wrap;
  align-items: center; justify-content: flex-start;
  gap: 8px;
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.picking-card--lot .picking-card-actions--bottom > form { width: auto; margin: 0; }
.picking-card--lot .picking-card-actions--bottom .btn {
  width: auto; min-height: 44px; flex: 0 0 auto;
}
.picking-card--lot .picking-card-actions--bottom > .picking-bundle-confirm {
  width: 100%;
  flex: 1 1 100%;
}
.picking-card--lot .picking-card-actions--bottom > .picking-bundle-confirm > .btn {
  width: 100%;
}
/* Ligne "meme article xN" : img | texte | boutons Trouve/Introuvable a droite
   (meme disposition que les lignes de lot Rakuten/eBay). */
.picking-bundle-row--multiqty,
.picking-bundle-row--unit {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
}
.picking-bundle-row--multiqty .picking-bundle-row-actions,
.picking-bundle-row--unit .picking-bundle-row-actions { justify-self: end; }

/* Boutons par article/exemplaire au MEME style que la Picking list (retour
   Achille 16/07) : surface neutre + pastille icone coloree (vert Trouve / rouge
   Introuvable), au lieu des petits boutons pleins. */
.picking-bundle-row-actions .btn {
  background: var(--hover-2); color: var(--text); border: 1px solid var(--line-2);
  box-shadow: none;
  min-height: 38px; padding: 5px 11px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.picking-bundle-row-actions .btn:hover { background: var(--hover); }
.picking-bundle-row-actions .btn .pk-emoji {
  width: 20px; height: 20px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.picking-bundle-row-actions .btn--primary .pk-emoji { background: var(--success); }
.picking-bundle-row-actions .btn--ghost .pk-emoji { background: var(--danger); }
.picking-bundle-row-actions .btn--danger {
  background: transparent; color: var(--danger); border-color: var(--danger);
}
/* Multi-quantite / lot : le bouton de l'ETAT COURANT d'un exemplaire/article
   est mis en avant (fond teinte de sa couleur + liseré) pour qu'on voie d'un
   coup d'oeil ce qui est deja marque. */
.picking-bundle-row-actions .btn--primary.is-unit-on {
  background: color-mix(in srgb, var(--success) 26%, var(--hover-2));
  box-shadow: inset 0 0 0 1.5px var(--success);
}
.picking-bundle-row-actions .btn--ghost.is-unit-on {
  background: color-mix(in srgb, var(--danger) 26%, var(--hover-2));
  box-shadow: inset 0 0 0 1.5px var(--danger);
}

/* Rakuten bundle confirm: one barcode input per item type (grouped by sku),
   shown as a vertical stack of mini-rows so the picker scans one code per
   product, regardless of how many units of the same item are in the order. */
.picking-rk-bundle-confirm {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}
.picking-rk-barcode-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.picking-rk-barcode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.picking-rk-barcode-thumb {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hover-2);
}
.picking-rk-barcode-thumb--empty {
  display: grid; place-items: center;
  color: var(--muted-2);
  font-size: 0.85rem;
}
.picking-rk-barcode-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.picking-rk-barcode-text strong { font-size: 0.85rem; line-height: 1.25; }
.picking-rk-barcode-text .muted { font-size: 0.7rem; }
.picking-rk-barcode-qty {
  display: inline-block;
  background: var(--warning, #f4b942);
  color: #1a1306;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 0.85rem;
  margin-right: 4px;
}
.picking-rk-barcode-shell { flex-shrink: 0; }
/* Ticket 525 — le bouton « Ajouter » d'une ligne de lot etait comprime par le
   flex (le titre prend `flex: 1`) : 32px de large, mot illisible et cible
   tactile inutilisable. Il garde sa largeur naturelle. */
.picking-rk-barcode-row .picking-sbc-save {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 38px;
}

/* ── Buttons ── */
/* Refonte 2026-07-15 : rail d'action VERTICAL a droite sur TOUS les onglets
   (avant : rangee horizontale en bas de carte, seul Picking list avait le
   rail). Meme gabarit que .picking-card-actions--pk : colonne centree,
   boutons pleine largeur empiles. */
.picking-card-actions {
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: center;
  gap: 6px;
  width: 210px; max-width: 100%;
  align-self: center; flex: 0 0 auto;
}
.picking-card-actions form { margin: 0; width: 100%; }
/* Contenu cale a GAUCHE (pas centre) : l'icone de tete est toujours au meme x
   -> les pastilles Trouve/Introuvable s'alignent parfaitement d'un bouton a
   l'autre (sinon, en centre, un libelle plus court decale son icone). */
.picking-card-actions .btn { width: 100%; justify-content: flex-start; box-sizing: border-box; }
/* (Croix ✕ du rail supprimee — #397 : elle vit desormais dans le HEADER de la
   carte a cote des icones messagerie/crayon, onglet Bordereau uniquement.) */
/* ── Onglet Caisse : barre boutons + chiffres (demande Philippe 2026-07-14) ──
   Boutons Bordereau / Saisi en caisse plus GROS a gauche ; les chiffres (Date,
   Prix, Stock, Code magasin) compacts (moins larges) et plus hauts, pousses a
   DROITE (.picking-caisse-nums, rendu dans la barre d'action cote template). */
.picking-card-actions--caisse .btn {
  padding: 7px 12px; font-size: 0.88rem; font-weight: 700;
  min-height: 38px; display: inline-flex; align-items: center;
}
.picking-caisse-nums { margin-left: auto; display: flex; gap: 4px; align-items: center; flex: 0 0 auto; }
.picking-caisse-nums .picking-num {
  flex: 0 0 auto; width: 62px; min-width: 62px; min-height: 56px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.picking-caisse-nums .picking-num--code { width: auto; min-width: 74px; padding: 6px 10px; }
/* Onglet Caisse : case Date ELARGIE (place pour la date + l'heure sur une seule
   ligne) et poussee a gauche (demande Philippe 2026-07-14). */
.picking-caisse-nums .picking-num--datetime {
  width: auto; min-width: 118px; padding: 6px 12px;
  margin-right: 2px;            /* un chouia d'air avant l'etiquette de prix */
}
/* Date + heure cote a cote, alignees sur la ligne de base. */
.picking-caisse-datetime {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
/* La date = deux fois plus grosse que l'heure. */
.picking-caisse-date { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.picking-caisse-time { font-size: 0.75rem; font-weight: 600; color: var(--muted); line-height: 1; }

/* Onglet Caisse : le prix devient une VRAIE etiquette de prix facon logo IPAY
   CASH, exactement comme sur /stock (.stock-card-price) — repere visuel fort
   pour la personne en caisse. Meme recette AUX JETONS DU THEME (#389,
   generalisation : fini le jaune fluo code en dur) : rectangle a coin
   haut-gauche coupe en biais, oeillet dans le coin, contour accent (couche du
   dessous) laissant voir 3px de lisere autour de la surface panneau (::before,
   z-index -1 -> derriere le texte). Dimensionnee pour la barre d'action de
   l'onglet Caisse. */
.picking-caisse-price-tag {
  --tag-cut: 16px;               /* taille du coin coupe */
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 0 8px 0 4px;           /* de l'air autour */
  padding: 6px 15px 6px 24px;    /* marge gauche = place de l'oeillet */
  font-size: clamp(1.35rem, 3.2vw, 1.8rem);
  line-height: 1;
  font-weight: 900;
  color: var(--text-strong);
  background: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  clip-path: polygon(var(--tag-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--tag-cut));
  isolation: isolate;            /* garde la couche panneau (z-index -1) derriere le prix */
}
/* Surface panneau, en retrait de 3px -> le lisere accent apparait tout autour. */
.picking-caisse-price-tag::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  background: var(--panel);
  clip-path: polygon(calc(var(--tag-cut) - 4px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--tag-cut) - 4px));
}
/* Oeillet (le trou de la ficelle) niche dans le coin coupe */
.picking-caisse-price-tag::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.picking-stage-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.picking-confirm-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.picking-barcode-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.picking-barcode-input {
  width: 200px; max-width: 220px;
  padding: 6px 38px 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface-inset);
  color: var(--text);
  font-size: 0.82rem;
}
.picking-barcode-input:focus {
  outline: none;
  border-color: rgba(125,214,170,0.45);
  box-shadow: 0 0 0 2px rgba(125,214,170,0.15);
}
.picking-barcode-input::placeholder { color: var(--muted-2); }
.picking-scan-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--hover);
  color: var(--muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.picking-scan-btn:hover {
  background: rgba(125,214,170,0.18);
  color: rgba(125,214,170,0.95);
}
.picking-scan-btn:focus-visible {
  outline: 2px solid rgba(125,214,170,0.55);
  outline-offset: 1px;
}

.picking-store-barcode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(125,214,170,0.10);
  border: 1px dashed rgba(125,214,170,0.35);
  font-size: 0.82rem;
}
.picking-store-barcode-label {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
.picking-store-barcode-value {
  color: rgba(125,214,170,0.95);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  user-select: all;
}

/* Clic sur le chip copie le code magasin dans le presse-papier (handler
   global data-copy dans base.js). Signale le geste en soulignant UNIQUEMENT
   la valeur (pas le label "Code magasin") pour rester lisible. */
.picking-store-barcode--copyable {
  cursor: pointer;
}
.picking-store-barcode--copyable .picking-store-barcode-value {
  border-bottom: 1px dashed rgba(125,214,170,0.55);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.picking-store-barcode--copyable:hover .picking-store-barcode-value {
  color: #a8f0cc;
  border-bottom-color: rgba(168,240,204,0.85);
}
.picking-store-barcode--copyable.copy-on-click-done .picking-store-barcode-value {
  color: var(--success, #4caf50);
  border-bottom-color: var(--success, #4caf50);
}

/* Form de saisie du code magasin sur l'onglet Bordereau (quand l'user
   a oublie au moment de "Confirmer la vente"). Compact, inline. */
.picking-store-barcode-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}
.picking-barcode-shell--inline {
  flex: 1;
  min-width: 0;
}
/* Sur l'onglet Bordereau, l'input remplit la coque (elle-meme flex:1) pour que
   l'icone scan (position:absolute; right:4px) reste collee au bord DROIT de
   l'input, et non a l'autre bout d'une coque etiree (bug #69 : input a gauche,
   scan tout a droite avec un grand vide au milieu). "Ajouter" suit juste apres. */
.picking-barcode-shell--inline .picking-barcode-input {
  width: 100%;
  max-width: none;
}
.picking-store-barcode-submit {
  flex-shrink: 0;
}
/* Onglet fusionne (#69) : le code magasin vit DANS la meme rangee que les
   boutons (Bordereau / Envoyer en caisse / X) = Option B validee. La coque
   input+scan prend l'espace restant (flex:1) et pousse la croix a droite ;
   "Ajouter" suit le champ. Le chip (code deja saisi) s'aligne sans marge. */
.picking-store-barcode-form--row {
  flex: 0 0 auto;
  margin: 0;
}
.picking-store-barcode-form--row .picking-barcode-shell--inline { flex: 0 0 auto; }
/* Champ compact (#69) : ~2x plus petit qu'avant (ne remplit plus toute la
   ligne). La croix reste a droite via son propre margin-left:auto. */
.picking-store-barcode-form--row .picking-barcode-input {
  width: 170px;
  max-width: 170px;
}
.picking-store-barcode--inline {
  margin-bottom: 0;
}

.picking-ebay-cancel-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--warning);
  background: var(--surface-inset);
  color: var(--warning);
  text-transform: none;
}
.picking-ebay-cancel-state::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warning);
}
.picking-ebay-cancel-state--refund_pending,
.picking-ebay-cancel-state--refunded {
  border-color: var(--success);
  color: var(--success);
}
.picking-ebay-cancel-state--refund_pending::before,
.picking-ebay-cancel-state--refunded::before {
  background: var(--success);
}
.picking-card-actions .picking-caisse-undo-form {
  align-self: flex-end;
  flex: 0 0 auto;
  margin: 0;
  width: auto;
}
.picking-caisse-undo {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  min-height: 0;
  padding: 2px 0;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 2px;
  width: auto;
}
.picking-caisse-undo:hover {
  color: var(--text);
}
.picking-caisse-undo:disabled {
  cursor: default;
  opacity: 0.45;
}

/* Edition d'un code magasin deja valide : le chip fige recoit un bouton
   "Modifier" qui revele un champ pre-rempli (meme form/scan que "Ajouter",
   meme endpoint set-store-barcode qui ecrase l'ancien code). Le bouton et le
   form sont freres du chip (jamais dedans) pour ne pas declencher la copie. */
.picking-store-barcode-editor {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.picking-store-barcode-editor--inline { margin-bottom: 0; }
.picking-store-barcode-editor .picking-store-barcode { margin-bottom: 0; }
.picking-store-barcode-edit-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.picking-store-barcode-edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
/* Form d'edition cache par defaut ; revele quand le wrap passe en .is-editing. */
.picking-store-barcode-edit-form { display: none; }
.picking-store-barcode-editor.is-editing .picking-store-barcode,
.picking-store-barcode-editor.is-editing .picking-store-barcode-edit-btn { display: none; }
.picking-store-barcode-editor.is-editing .picking-store-barcode-edit-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

/* Boutons de la rangee d'actions sur l'onglet fusionne Confirmer / Bordereau
   (#69) : REFAITS en "pilule" facon maquette validee (et non les .btn carres
   gras d'Achflow). Scope au conteneur --v2 -> n'affecte AUCUN autre bouton. */
.picking-card-actions--v2 .btn {
  border-radius: 999px;
  font-weight: 500;
  padding: 7px 14px;
  font-size: 0.8rem;
  border: 1px solid transparent;
}
.picking-card-actions--v2 .btn--sm { padding: 7px 14px; font-size: 0.8rem; }
.picking-card-actions--v2 .btn--xs { padding: 7px 12px; font-size: 0.78rem; }
.picking-card-actions--v2 .btn--primary {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}
.picking-card-actions--v2 .btn--primary:hover { background: var(--accent-strong); box-shadow: none; }
.picking-card-actions--v2 .btn--outline {
  background: transparent; color: var(--text); border-color: var(--line-2);
}
.picking-card-actions--v2 .btn--outline:hover { background: var(--hover); }
.picking-card-actions--v2 .btn--ghost {
  background: none; color: var(--muted); border-color: transparent; padding: 7px 12px;
}
.picking-card-actions--v2 .btn--ghost:hover { color: var(--text); background: var(--hover); }
.picking-card-actions--v2 .btn--danger { border-radius: 999px; }

/* ── Boutons du rail unifies au style Picking list (refonte 2026-07-15) ──
   Confirmer/Bordereau, Caisse : meme look que Trouve/Introuvable — surface
   NEUTRE, pleine largeur, pastille icone coloree a gauche (la couleur vit dans
   la pastille, pas dans le fond). Place APRES les regles --v2/--caisse pour
   gagner a specificite egale. Annuler garde le rouge (repere fort). */
.picking-card-actions .btn {
  width: 100%; min-height: 46px;
  display: inline-flex; align-items: center; justify-content: flex-start;
  gap: 8px; font-size: 0.9rem; font-weight: 700;
  padding: 6px 12px; border-radius: 10px;
  /* #393/#397 : libelle long = retour a la ligne, jamais de debordement du
     rail (210px) ni des boutons mobiles. overflow-wrap: anywhere effondre le
     min-width:auto de l'item texte flex (sinon il deborde au lieu de replier). */
  white-space: normal; overflow-wrap: anywhere; text-align: left; line-height: 1.25;
  box-shadow: none;
}
.picking-card-actions .btn--primary,
.picking-card-actions .btn--outline,
.picking-card-actions .btn--ghost {
  background: var(--hover-2); color: var(--text); border: 1px solid var(--line-2);
}
.picking-card-actions .btn--primary:hover,
.picking-card-actions .btn--outline:hover,
.picking-card-actions .btn--ghost:hover {
  background: var(--hover); color: var(--text); border-color: var(--line-2);
}
.picking-card-actions .btn .pk-emoji {
  width: 22px; height: 22px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: 0.95rem;
}
/* L'icone SVG nue des boutons sans pastille (Bordereau, Acheter bordereau, QR)
   ne doit pas se faire compresser quand le libelle passe sur 2 lignes. */
.picking-card-actions .btn > svg { flex: 0 0 auto; }
/* Pastilles colorees : icone en currentColor sur fond de couleur semantique. */
.picking-card-actions .btn .pk-emoji--ok { background: var(--success); }
.picking-card-actions .btn .pk-emoji--accent { background: var(--accent); }
/* Annuler : bouton discret contour rouge (garde le sens "danger"). */
.picking-card-actions .btn--danger {
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger); border-radius: 10px;
}
.picking-card-actions .btn--danger:hover { background: var(--hover); }
/* Le bouton "Ajouter" du mini-form code magasin n'est PAS un bouton de rail :
   il reste inline (largeur auto), sinon la regle .picking-card-actions .btn
   ci-dessus l'etire pleine largeur et casse la rangee "input + Ajouter"
   (retour Achille 15/07). Idem : pas de pastille, pas de min-height rail. */
.picking-card-actions .picking-store-barcode-submit {
  width: auto; min-height: 0; align-self: center;
  padding: 8px 14px; font-size: 0.8rem; white-space: nowrap;
}
/* Mini-form code magasin dans le RAIL VERTICAL (refonte 2026-07-15) : la
   variante `--row` (conçue pour l'ancienne rangée horizontale) figeait l'input
   a 170px -> avec "Ajouter" a cote (76px) ca deborde du rail de 210px. On rend
   l'input FLEXIBLE pour que "input + Ajouter" tiennent sur une ligne propre. */
.picking-card-actions .picking-store-barcode-form { width: 100%; gap: 6px; }
.picking-card-actions .picking-store-barcode-form--row .picking-barcode-shell--inline { flex: 1 1 auto; min-width: 0; }
.picking-card-actions .picking-store-barcode-form--row .picking-barcode-input { width: 100%; max-width: none; }

/* eBay shipping label mini-form (Bordereau tab, Packlink Pro). Pattern :
   panneau sombre subtil aligne sur le design Achflow (rgba blanc 3-8%),
   inputs compacts sans surface visible, label + valeur en colonne. */
.picking-ebay-label-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  margin: 4px 0 2px;
  padding: 10px 12px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.picking-ebay-label-form > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.picking-ebay-label-form > label > input {
  width: 70px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  -moz-appearance: textfield;
}
.picking-ebay-label-form > label > input::-webkit-outer-spin-button,
.picking-ebay-label-form > label > input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.picking-ebay-label-form > label > input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
}
.picking-ebay-label-form > label.picking-ebay-label-form-weight > input {
  width: 80px;
}
.picking-ebay-label-form > .picking-ebay-label-form-submit {
  margin-left: auto;
}
@media (max-width: 700px) {
  .picking-ebay-label-form > label > input {
    width: 100%;
    text-align: left;
  }
  .picking-ebay-label-form > label {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }
  .picking-ebay-label-form > .picking-ebay-label-form-submit {
    margin-left: 0;
    flex: 1 1 100%;
  }
}


.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 700; border: none;
  cursor: pointer; text-decoration: none;
  transition: all 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(0.95); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { box-shadow: 0 4px 14px rgba(223,143,120,0.3); }
.btn--danger { background: rgba(255,100,100,0.12); color: #ff8d8d; border: 1px solid rgba(255,100,100,0.2); }
.btn--danger:hover { background: rgba(255,100,100,0.2); }
.btn--outline { background: var(--hover); color: var(--text); border: 1px solid var(--line); }
.btn--outline:hover { background: var(--line); }
.btn--ghost { background: none; color: var(--muted); padding: 6px 12px; }
.btn--ghost:hover { color: var(--text); background: var(--hover); }
.btn--sm { padding: 6px 12px; font-size: 0.78rem; }
.btn--xs { padding: 4px 10px; font-size: 0.72rem; }

/* ── Empty state ── */
.picking-empty {
  text-align: center; padding: 56px 20px;
  color: var(--muted); grid-column: 1 / -1;
  animation: pickFadeIn 500ms ease backwards;
}
.picking-empty svg { margin-bottom: 12px; }
.picking-empty p { margin: 0; font-size: 0.92rem; }

/* Libelles de bouton a 2 variantes : longue sur PC, courte sur mobile
   ("Article introuvable" -> "Introuvable"). Le span court est cache par
   defaut ; la media query mobile inverse. */
.pk-lbl-short { display: none; }

/* ── Mobile — carte COMPACTE (variante A validee par Achille, 2026-07-16) ──
   La version PC "tassee" donnait des cartes demesurees sur telephone : tag
   marketplace geant, badge emplacement en 1.4rem, EAN enorme, photo carree
   de 120px, boutons de 52px empiles... Ici TOUT est redimensionne pour tel :
   photo-vignette 56px, badges/pastilles minis, boutons courts cote a cote
   (les libelles longs ont une variante courte, cf .pk-lbl-short). */
@media (max-width: 700px) {
  .picking-filters { gap: 8px; }
  /* Carte en FLUX (plus une grille) : la colonne photo de 56px reservait une
     bande vide a gauche sur TOUTE la hauteur (retour Achille 16/07, "on perd
     giga de la place"). Ici la photo FLOTTE en haut-gauche : le tag + le titre
     s'enroulent a cote, puis emplacement / EAN / chips / boutons reprennent la
     PLEINE largeur sous la photo. */
  .picking-card {
    display: block;
    padding: 10px;
    border-radius: 12px;
  }
  .picking-card-photo {
    float: left;
    width: 56px; height: 56px; aspect-ratio: auto;
    margin: 0 10px 4px 0;
    border-radius: 8px;
  }
  .picking-card > .picking-ship-alert { margin-bottom: 6px; }
  /* Le corps et la colonne infos repassent en blocs : leurs enfants "line
     boxes" (titre) s'enroulent autour du float, les blocs flex (tag, locrow)
     se calent a cote tant que la photo est la, puis pleine largeur. Les gaps
     flex disparus sont recrees en marges. */
  /* Selecteur double : .picking-card--picking .picking-card-body (desktop) est
     plus specifique que .picking-card-body seul -> on aligne la specificite. */
  .picking-card .picking-card-body,
  .picking-card--picking .picking-card-body { display: block; }
  .picking-card-body > * + * { margin-top: 6px; }
  .picking-card .picking-pk-info,
  .picking-card--picking .picking-pk-info { display: block; max-width: 100%; }
  .picking-pk-info > * + * { margin-top: 4px; }
  .picking-card-body > .picking-pk-info > .picking-card-text { margin-top: 0; }
  .picking-card-text > * + * { margin-top: 4px; }
  /* Mini-ligne meta (logo + etat + icones) : RANGEE alignee a gauche — la
     disposition desktop --picking la met en colonne centree. */
  .picking-card .picking-card-top,
  .picking-card--picking .picking-card-top {
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 6px; margin-bottom: 4px;
  }
  .picking-card-top .picking-card-meta { margin-left: 0; justify-content: flex-start; }
  /* Tout ce qui suit la zone photo repart du bord gauche. */
  .picking-card-actions, .picking-pk-meta, .picking-note, .picking-lookalikes, .picking-bundle { clear: both; }
  .picking-card .picking-card-title { font-size: 0.85rem; line-height: 1.3; -webkit-line-clamp: 2; }
  /* ── Hierarchie "D" (choix Achille 16/07) : 3 niveaux de lecture ──
     1. IDENTITE : photo + titre, avec une mini-ligne meta grise au-dessus
        (logo marketplace SEUL en pastille, etat en petit texte, icones).
     2. OU LE TROUVER : barre a fond leger avec l'emplacement en gros + EAN ;
        les chips Vendu / Prix / Stock deviennent du texte discret dessous.
     3. ACTIONS : les boutons.
     Tout le reste (alerte butoir, note, liaison stock) = discret, sans cadre. */
  /* 1 — Tag marketplace : LOGO SEUL (pastille ronde), plus de gros badge. */
  .picking-tag { font-size: 0; gap: 0; padding: 0; background: none !important; border-radius: 50%; }
  .picking-tag .picking-tag-label { display: none; }
  .picking-tag-logo { width: 18px; height: 18px; }
  /* Badges d'etat : texte colore nu, plus de fond. */
  .picking-badge { font-size: 0.62rem; padding: 0 2px; background: none !important; }
  /* Icones header (bulle / crayon / croix) : compactes. */
  .picking-msg-btn, .picking-hold-btn, .picking-cancel-x { padding: 3px 5px; }
  /* 2 — Barre "ou le trouver" : fond leger, emplacement gros + EAN. */
  .picking-locrow {
    clear: both;
    background: var(--hover-2);
    border-radius: 9px;
    padding: 6px 10px;
    gap: 4px 10px;
  }
  .picking-loc { font-size: 1.05rem; padding: 0; border: 0; background: none; gap: 5px; }
  .picking-loc.copy-on-click { border-bottom: 0; }
  .picking-ean-big { font-size: 0.78rem; }
  /* Chips Vendu / Prix / Stock : petites bulles discretes (retour Achille
     16/07 : "que prix, date soit dans des petites bulles, un truc qui les
     separe") — fond leger, fines, sans crier. */
  .picking-pk-meta { gap: 5px; }
  .picking-pk-chip {
    padding: 2px 8px; gap: 4px;
    background: var(--hover-2); border: 1px solid var(--line);
    border-radius: 999px;
  }
  /* La bulle PRIX garde son lisere vert lime (#404, choix C de Philippe) aussi
     sur mobile — le reset generique ci-dessus l'aurait ecrase. */
  .picking-pk-chip--price {
    padding: 1px 7px;
    border: 2px solid var(--price-ring);
    background: color-mix(in srgb, var(--price-ring) 10%, transparent);
  }
  .picking-pk-chip-lbl { font-size: 0.5rem; }
  .picking-pk-chip-val { font-size: 0.72rem; }
  /* Onglet Caisse : la bulle NET reste 2x plus grosse que Prix aussi sur mobile
     (les resets generiques ci-dessus l'auraient ecrasee). */
  .picking-pk-chip--net {
    padding: 2px 10px;
    border: 2px solid var(--net-ring);
    background: color-mix(in srgb, var(--net-ring) 10%, transparent);
  }
  .picking-pk-chip--net .picking-pk-chip-lbl { font-size: 0.65rem; }
  .picking-pk-chip--net .picking-pk-chip-val { font-size: 1.44rem; }
  /* Alerte butoir : une simple ligne orange (le lisere de la carte
     .picking-card--urgent/overdue reste le signal fort). */
  .picking-card .picking-ship-alert { font-size: 0.72rem; padding: 0; margin: 0 0 6px; gap: 5px; background: none; border: 0; }
  /* Note "Preciser" : italique discret, sans encadre. */
  .picking-card .picking-note { background: none; border: 0; padding: 0; font-style: italic; }
  /* Liaison stock : conteneur allege. */
  .picking-card .picking-lookalikes { padding: 6px 8px; font-size: 0.78rem; }
  .picking-num { min-width: 56px; padding: 6px 6px; }
  .picking-num-val { font-size: 0.8rem; }
  .btn--sm, .btn--primary, .btn--danger, .btn--outline { flex: 1; justify-content: center; min-height: 40px; }
  /* Onglet Picking : infos pleine largeur, boutons Trouve / Introuvable cote a
     cote SOUS les infos — libelles courts (.pk-lbl-short) donc ca tient. */
  .picking-card--picking .picking-pk-info { max-width: 100%; flex: 1 1 100%; }
  .picking-card--picking .picking-card-actions--pk {
    align-self: stretch;
    width: 100%;
    flex-direction: row;
    gap: 6px;
  }
  .picking-card--picking .picking-card-actions--pk > form { flex: 1 1 0; min-width: 0; }
  .picking-card--picking .picking-card-actions--pk .btn { min-height: 44px; justify-content: center; font-size: 0.85rem; }
  /* Rails des autres onglets (Confirmer/Bordereau, Caisse) : pleine largeur
     sous les infos, boutons compacts. */
  .picking-card-actions { width: 100%; align-self: stretch; }
  .picking-card-actions .btn { min-height: 40px; font-size: 0.82rem; }
  /* Cartes "a confirmer" (retour Achille 16/07, fleches jaunes) :
       ligne 1 = [champ code magasin + scan] [Annuler la vente]  <- a droite
       ligne 2 = [ Confirmer la vente pleine largeur ]
     Le champ et Confirmer vivent dans le MEME form, Annuler dans un form frere.
     display:contents sur le form confirm SIMPLE (celui qui a la coque en enfant
     direct — pas les forms de lot qui portent une grille) promeut ses enfants
     dans le rail flex, et `order` recompose les 2 lignes. Le form reste
     pleinement fonctionnel (submit, popup data-confirm-message). */
  .picking-card-actions:has(> .picking-confirm-form > .picking-barcode-shell) {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px;
  }
  .picking-card-actions > .picking-confirm-form:has(> .picking-barcode-shell) { display: contents; }
  .picking-card-actions > .picking-confirm-form > .picking-barcode-shell {
    order: 1; flex: 1 1 0; min-width: 0; width: auto; box-sizing: border-box;
  }
  .picking-card-actions > .picking-confirm-form > .picking-barcode-shell .picking-barcode-input { width: 100%; max-width: none; box-sizing: border-box; }
  .picking-card-actions:has(> .picking-confirm-form > .picking-barcode-shell) > form[data-cancel-sale] { order: 2; }
  .picking-card-actions > .picking-confirm-form:has(> .picking-barcode-shell) > .btn { order: 3; flex: 1 1 100%; width: 100%; }
  /* Annuler : bouton discret, largeur naturelle — UNIQUEMENT sur l'onglet
     Confirmer/Bordereau (rail --v2). La Picking list garde son bouton Annuler
     normal (precision Achille 16/07 : "je t'ai parle uniquement de
     confirmer/bordereau"). */
  .picking-card-actions--v2 form[data-cancel-sale] { width: auto; align-self: center; flex: 0 0 auto; }
  .picking-card-actions--v2 form[data-cancel-sale] .btn--danger {
    width: auto; flex: 0 0 auto;
    min-height: 34px; font-size: 0.78rem; padding: 5px 16px;
  }
  /* #509/#510 — toutes les lignes d'exemplaire (Amazon/LBC mono-ligne et
     bundles Rakuten/eBay/Amazon du meme article) partagent le meme rendu :
     photo + texte, puis les actions sur une ligne pleine largeur. L'ancien
     3e rail `auto` depassait du viewport et coupait « Introuvable ». */
  .picking-bundle-row--unit {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
  }
  .picking-bundle-row--unit > .picking-bundle-row-actions,
  .picking-bundle-row--rakuten.picking-bundle-row--unit.picking-bundle-row--with-lookalikes > .picking-bundle-row-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
  }
  .picking-bundle-row--unit > .picking-bundle-row-actions > form {
    width: 100%;
    min-width: 0;
  }
  .picking-bundle-row--unit > .picking-bundle-row-actions .btn {
    width: 100%;
    justify-content: center;
    min-width: 0;
  }
  .picking-bundle-row--unit .picking-bundle-row-text strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  /* #508 — dans le bloc de confirmation pleine largeur, chaque article garde
     son identite sur la premiere ligne et son champ de scan prend toute la
     ligne suivante. */
  .picking-card-actions--bottom .picking-rk-barcode-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }
  .picking-card-actions--bottom .picking-rk-barcode-shell {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .picking-card-actions--bottom .picking-rk-barcode-input {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }
  /* Libelles : la variante courte remplace la longue (cf. picking.html). */
  .pk-lbl-full { display: none; }
  .pk-lbl-short { display: inline; }
  /* Sous-lignes de lot : vignette et textes reduits. */
  .picking-bundle-row { gap: 8px; padding: 4px 6px; }
  .picking-bundle-img { width: 32px; height: 32px; }
  .picking-bundle-row-text strong { font-size: 0.78rem; }
  .picking-note { font-size: 0.75rem; }
  /* Haut de page compact (retour Achille 16/07 : "en haut aussi on perd de la
     place") : barre de tri et titre degonfles. */
  .picking-sort { margin-left: 0; width: 100%; }
  .picking-select { padding: 7px 10px; font-size: 0.9rem; }
  .picking-sort-label { font-size: 0.9rem; }
  .picking-sync-gate { flex-direction: column; align-items: flex-start; }
  .picking-page-title { font-size: 1.05rem; }
  .picking-count { font-size: 1.3rem; }
  .picking-header { gap: 8px; margin-bottom: 8px; }
  .picking-grid { gap: 10px; }
}
@media (max-width: 420px) {
  .picking-card-numbers { gap: 3px; }
  .picking-num { min-width: 0; padding: 5px 4px; }
  .picking-num-val { font-size: 0.75rem; }
  .picking-num-lbl { font-size: 0.58rem; }
}

.ai-behaviors-overview-panel,
.ai-behavior-panel,
.ai-agent-panel {
  display: grid;
  gap: 18px;
}

.ai-behavior-panel-head,
.ai-agent-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.ai-behavior-helper-box {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.ai-behavior-feedback {
  min-height: 1.2rem;
  margin: 0;
}

.ai-agent-base-box,
.ai-agent-doc-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--hover-2);
  overflow: hidden;
}

.ai-agent-base-box summary,
.ai-agent-doc-card summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
}

.ai-agent-base-text,
.ai-agent-doc-text {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.55;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.94rem;
}

.ai-agent-docs-box {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: var(--hover-2);
  border: 1px solid var(--line);
}

.ai-agent-docs-head h3 {
  margin: 0 0 6px;
}

.ai-agent-upload-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ai-agent-upload-form .input[type="file"] {
  flex: 1 1 320px;
}

.ai-agent-doc-list {
  display: grid;
  gap: 12px;
}

.ai-agent-hub-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ai-agent-hub-card {
  display: grid;
  gap: 16px;
}

.ai-agent-hub-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.ai-agent-hub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .picking-sync-gate {
    flex-direction: column;
    align-items: flex-start;
  }

  .picking-card-top {
    flex-direction: column;
  }

  .picking-card-meta {
    justify-content: flex-start;
  }

  .picking-card-actions {
    width: 100%;
  }

  .picking-bundle-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .picking-bundle-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }
}

/* Format « menu hamburger » tablette (760-1119px, bandeau de gauche en tiroir,
   contenu pleine largeur) : la rangee ne tient pas sur une ligne. On laisse la
   recherche remplir la 1re rangee, les actions se replient a gauche en dessous
   (l'alignement a gauche vient de la suppression du margin-left:auto plus haut). (#400) */
@media (min-width: 760px) and (max-width: 1119px) {
  .stock-toolbar-top .stock-search-shell {
    flex: 1 1 300px;
    min-width: 220px;
  }
}

@media (max-width: 759px) {
  .pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
  }

  .pagination .button {
    width: 100%;
    justify-content: center;
  }

  .pagination-label {
    grid-column: 1 / -1;
    text-align: center;
    justify-content: center;
    order: -1;
  }

  .topbar {
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top)) 12px 10px;
  }

  .brand-inline {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-inline > div:last-child {
    min-width: 0;
  }

  .topbar .brand-inline .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 0.98rem;
    line-height: 1.1;
  }

  .menu-panel {
    width: min(320px, calc(100vw - 12px));
    padding-left: 14px;
    padding-right: 14px;
    backdrop-filter: blur(10px);
  }

  .page-shell,
  .page-messages .page-shell {
    width: min(100%, calc(100vw - 20px));
    padding-top: 14px;
    padding-bottom: calc(32px + var(--mobile-overlay-stack-height));
  }

  .toolbar,
  .panel,
  .form-panel,
  .detail-photo-card {
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 20px;
  }

  .input,
  .select,
  .textarea,
  .button,
  .action-button,
  .mini-button {
    font-size: 16px;
  }

  .button,
  .action-button,
  .mini-button {
    min-height: 46px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-header-actions,
  .header-actions,
  .form-actions,
  .review-actions,
  .marketplace-actions,
  .picking-card-actions,
  .picking-sync-gate-actions,
  .landing-actions,
  .messages-sidebar-top-actions,
  .ai-agent-upload-form {
    width: 100%;
    align-items: stretch;
  }

  .page-header-actions > *,
  .header-actions > *,
  .form-actions > *,
  .review-actions > *,
  .marketplace-actions > *,
  .picking-card-actions > *,
  .picking-sync-gate-actions > *,
  .landing-actions > *,
  .messages-sidebar-top-actions > * {
    flex: 1 1 100%;
  }

  .page-header-actions form,
  .header-actions form,
  .form-actions form,
  .review-actions form,
  .marketplace-actions form,
  .picking-card-actions form,
  .picking-sync-gate-actions form {
    width: 100%;
  }

  .page-header-actions .button,
  .header-actions .button,
  .form-actions .button,
  .review-actions .button,
  .marketplace-actions .button,
  .picking-card-actions .button,
  .picking-sync-gate-actions .button,
  .landing-actions .button,
  .messages-sidebar-top-actions .button,
  .page-header-actions .action-button,
  .form-actions .action-button,
  .picking-card-actions .action-button {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .toolbar {
    gap: 12px;
  }

  .toolbar > *,
  .stock-toolbar > *,
  .stock-toolbar-top,
  .stock-filters-panel,
  .stock-search-shell,
  .stock-toolbar-actions {
    width: 100%;
  }

  .stock-toolbar .select,
  .stock-toolbar > .input,
  .stock-toolbar > .button {
    flex: 1 1 100%;
  }

  /* Mobile : la rangee du haut se replie, chaque element pleine largeur */
  .stock-toolbar-top .stock-toolbar-title,
  .stock-toolbar-top .stock-search-shell,
  .stock-toolbar-top .stock-top-price,
  .stock-toolbar-top .stock-top-btn,
  .stock-toolbar-top .stock-manage-cats {
    flex: 1 1 100%;
    min-width: 0;
  }

  .stock-toolbar-top .stock-top-price .stock-top-price-input {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  .stock-toolbar-top .stock-manage-cats {
    margin-left: 0;
  }

  .stock-search-shell {
    min-width: 0;
    flex-basis: 100%;
  }

  .stock-search-input {
    padding-right: 6.6rem;
  }

  .stock-filter-range {
    flex-direction: column;
  }

  .stock-filter-range .input {
    width: 100%;
  }

  .image-search-head {
    flex-direction: column;
    align-items: stretch;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .item-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
  }

  .item-card-media,
  .item-card-media .media-fallback {
    width: 72px;
    height: 72px;
    min-height: 72px;
  }

  .item-card-title {
    font-size: 1rem;
  }

  .add-recent-card {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .add-recent-media {
    width: 68px;
    height: 68px;
  }

  .human-task-item-row {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
  }

  .review-top,
  .marketplace-card-top {
    flex-direction: column;
    align-items: stretch;
  }

  .review-top .badge,
  .marketplace-card-top .badge {
    align-self: flex-start;
  }

  .review-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .review-actions > *,
  .review-actions form {
    width: 100%;
    min-width: 0;
  }

  .pricing-review-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pricing-modify-form {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .pricing-price-input {
    width: 100% !important;
  }

  .stock-card-thumb,
  .picking-card-thumb {
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
  }

  .picking-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .picking-summary-count {
    font-size: 1.6rem;
  }

  .picking-tab-nav {
    width: 100%;
  }

  .picking-tab-nav > * {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  /* Picking main tabs (Picking list / Confirmer / Bordereau / Caisse /
     Historique) : sur telephone portrait, les 5 tabs avec leur libelle
     complet debordent hors de l'ecran et "Caisse" + "Historique"
     n'etaient plus visibles. On compacte le padding + font-size et on
     autorise le scroll horizontal comme filet de secours. */
  .picking-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    max-width: 100%;
  }
  .picking-tabs::-webkit-scrollbar { display: none; }
  .picking-tab {
    padding: 10px 14px;
    font-size: 1.15rem;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .picking-copy-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .picking-bundle-card {
    padding: 12px;
    border-radius: 18px;
    background: var(--hover-2);
  }

  .picking-bundle-shell {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .picking-bundle-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .picking-bundle-copy {
    gap: 3px;
  }

  .picking-bundle-copy strong {
    font-size: 0.96rem;
    word-break: break-word;
  }

  .picking-bundle-label {
    padding-bottom: 2px;
  }

  .page-add .page-shell {
    padding-bottom: calc(104px + env(safe-area-inset-bottom) + var(--mobile-overlay-stack-height));
  }

  .add-submit-dock {
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 8px 10px;
    border-radius: 20px;
    gap: 10px;
    align-items: center;
  }

  .add-submit-dock-copy {
    display: grid;
    gap: 2px;
  }

  .add-submit-dock-copy[hidden] {
    display: none;
  }

  .add-submit-dock-help {
    font-size: 0.74rem;
  }

  .add-submit-dock-note {
    font-size: 0.7rem;
  }

  .add-submit-dock-button {
    width: auto;
    min-width: 132px;
    flex: 0 0 auto;
    padding-inline: 14px;
  }

  .add-submit-dock-copy[hidden] + .add-submit-dock-button {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible {
    padding: 8px 10px;
    border-radius: 20px;
    gap: 10px;
    align-items: center;
  }

  body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible .add-form-actions-copy {
    gap: 2px;
  }

  body.add-submit-dock-ready .add-form-actions.is-dock-anchor-visible #create_item_button {
    min-width: 132px;
    padding-inline: 14px;
  }

  .page-add .assistant-fab {
    bottom: calc(24px + env(safe-area-inset-bottom));
    --assistant-fab-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .page-add .mobile-install-widget {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .assistant-fab {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    --assistant-fab-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .assistant-fab-toggle {
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 20px;
    display: inline-grid;
    place-items: center;
    justify-content: center;
  }

  .assistant-fab-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    line-height: 0;
    transform: none;
  }

  .assistant-fab-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    transform: none;
    overflow: visible;
  }

  .assistant-fab-toggle span:last-child {
    display: none;
  }

  .assistant-fab-panel {
    left: 10px;
    right: 10px;
    width: auto;
    height: min(68dvh, calc(100dvh - 92px));
    backdrop-filter: blur(10px);
  }

  .assistant-fab-panel.is-expanded {
    left: 10px;
    right: 10px;
    width: auto;
    height: min(82dvh, calc(100dvh - 24px));
  }

  .assistant-fab-handle .muted {
    display: none;
  }

  .mobile-install-widget {
    left: 10px;
    right: 10px;
    width: auto;
    padding: 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
  }

  .mobile-install-widget-top {
    align-items: flex-start;
  }

  .mobile-install-widget-actions .button {
    flex: 1 1 100%;
  }

  .page-landing .page-shell::before,
  .landing-hero-v3::before,
  .landing-hero-v3::after,
  .hero-item-card-v3,
  .hero-hub-v3,
  .hero-jobs-v3,
  .hero-sync-card,
  .marketplace-orbit-v3 .orbit-badge,
  .hero-command-strip span,
  .signal-dot-live,
  .signal-dot-alert,
  .job-dot-live,
  .job-dot-alert,
  .hero-sync-bars span,
  .flow-line,
  .hero-panel-primary::before,
  .hero-panel-primary::after {
    animation: none !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .button:hover,
  .action-button:hover,
  .mini-button:hover,
  .menu-link:hover,
  .item-card:hover,
  .add-recent-card:hover,
  .picking-summary-card-link:hover,
  .pipeline-ribbon-node:hover {
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 420px) {
  .picking-summary-grid {
    grid-template-columns: 1fr;
  }

  .picking-tab-nav > * {
    flex-basis: 100%;
  }
}

.messages-layout-v4 {
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  height: calc(100vh - 212px);
}

.messages-page-toolbar {
  padding: 12px 16px;
}

.messages-page-toolbar-copy p {
  margin: 4px 0 0;
}

.messages-page-toolbar .pricing-strip-actions {
  gap: 10px;
}

.messages-layout-v4 .messages-sidebar-shell,
.messages-layout-v4 .messages-workspace,
.messages-layout-v4 .messages-chat-panel-v4 {
  min-width: 0;
  min-height: 0;
}

.messages-layout-v4 .messages-sidebar-shell {
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.messages-sidebar-heading h2 {
  margin: 2px 0 0;
}

.messages-sidebar-intro {
  margin: 4px 0 0;
  max-width: 42ch;
  font-size: 0.88rem;
}

.messages-layout-v4 .messages-thread-list {
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
}

.messages-layout-v4 .messages-workspace {
  display: grid;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  height: 100%;
}

.messages-chat-panel-v4 {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background:
    radial-gradient(circle at top right, rgba(223, 143, 120, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(31, 26, 26, 0.97), rgba(18, 15, 15, 0.96));
}

.messages-thread-hero {
  display: grid;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--hover);
}

.messages-thread-hero-compact {
  min-width: 0;
}

.messages-thread-hero-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.messages-thread-headline {
  display: grid;
  gap: 4px;
}

.messages-thread-headline-main {
  min-width: 0;
}

.messages-thread-hero h2 {
  margin: 0;
  font-size: clamp(1.12rem, 1.55vw, 1.35rem);
}

.messages-thread-hero-product,
.messages-thread-hero-secondary {
  margin: 0;
}

.messages-thread-hero-product {
  font-weight: 600;
  color: var(--text);
  font-size: 0.98rem;
}

.messages-thread-hero-secondary {
  color: var(--muted);
  font-size: 0.92rem;
}

.messages-thread-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-self: start;
}

.messages-thread-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--hover-2);
  border: 1px solid var(--hover);
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.messages-thread-meta-pill strong {
  color: var(--text);
}

.messages-thread-activity-inline {
  color: var(--muted);
  font-size: 0.84rem;
  margin-left: auto;
}

.messages-linked-context {
  padding: 0;
}

.messages-linked-context .message-item-card {
  margin: 0;
}

.messages-thread-context-drawer {
  margin: 0 16px 10px;
  border: 1px solid var(--hover);
  border-radius: 16px;
  background: var(--hover-2);
  overflow: hidden;
}

.messages-thread-context-drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text);
}

.messages-thread-context-drawer summary::-webkit-details-marker {
  display: none;
}

.messages-thread-context-drawer[open] summary {
  border-bottom: 1px solid var(--hover);
}

.messages-linked-context-compact .message-item-spotlight-compact {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.messages-linked-context-compact .message-item-spotlight-image {
  width: 88px;
  height: 88px;
  min-height: 88px;
}

.messages-linked-context-compact .message-item-spotlight-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.message-item-inline-button {
  align-self: flex-start;
  margin-top: 4px;
}

.messages-layout-v4 .messages-conversation-stream-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.messages-layout-v4 .messages-conversation-stream {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 14px 16px 18px;
  background:
    linear-gradient(180deg, rgba(20, 17, 17, 0.82), rgba(14, 12, 12, 0.92));
}

.messages-thread-empty {
  padding: 0 22px 22px;
}

.messages-layout-v4 .messages-compose-panel {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--hover);
  background: var(--panel);
}

.messages-layout-v4 .message-thread-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  min-height: 0;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.messages-layout-v4 .message-thread-card:hover {
  transform: translateY(-1px);
  border-color: rgba(242, 179, 106, 0.18);
}

.message-thread-channel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.message-thread-reference {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.message-thread-product {
  margin: 2px 0 0;
  font-weight: 700;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.messages-empty-panel-v4 {
  min-height: 520px;
  place-items: center;
  padding: 28px;
}

.messages-layout-v4 .message-thread-snippet {
  display: -webkit-box;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.messages-layout-v4 .message-thread-meta {
  margin-top: 5px;
  gap: 8px;
  font-size: 0.82rem;
}

@media (max-width: 1180px) {
  .messages-layout-v4 {
    grid-template-columns: 1fr;
    height: auto;
  }

  .messages-thread-meta-strip {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .messages-layout-v4 .messages-sidebar-shell {
    padding: 16px;
  }

  .messages-layout-v4.has-thread .messages-sidebar-shell {
    display: none;
  }

  .messages-layout-v4.is-list-mode .messages-workspace {
    display: none;
  }

  .messages-layout-v4 .messages-chat-panel-v4 {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .messages-thread-hero,
  .messages-layout-v4 .messages-conversation-stream,
  .messages-layout-v4 .messages-compose-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .messages-thread-context-drawer {
    margin-left: 16px;
    margin-right: 16px;
  }

  .messages-linked-context-compact .message-item-spotlight-compact {
    grid-template-columns: 1fr;
  }

  .messages-layout-v4 .message-thread-card {
    grid-template-columns: 1fr;
  }

  .messages-layout-v4 .message-thread-card-media {
    width: auto;
    min-width: 0;
  }

  .messages-layout-v4 .message-thread-marketplace-logo {
    right: auto;
    left: 42px;
  }
}

/* ═══════════════════════════════════════════════════════
   MESSAGES V6 — 3-column layout, full-width
   ═══════════════════════════════════════════════════════ */

/* ── Page-level: full-height, full-width, no padding ── */
/* #340 : la topbar sticky mesure 85px (padding 22+18 + la rangée identité), pas 80.
   À -80px, page-shell débordait de 5px → micro-scroll de ~5px sur PC (le body est en
   overflow:hidden mais le débordement remontait sur <html>). -85px cale page-shell
   pile sous la topbar (0 scroll, rien de clippé, vérifié sur la bulle). */
.page-messages .page-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  height: calc(100dvh - 85px);
  max-height: calc(100dvh - 85px);
  min-height: 480px;
  padding: 0;
  overflow: hidden;
}

/* Desktop sidebar: override the 0-3-0 specificity rule from app-shell layout */
@media (min-width: 1120px) {
  .app-shell-messages:not(.app-shell-landing) .page-shell {
    padding: 0;
    height: calc(100dvh - 85px);   /* #340 : topbar = 85px (cf. règle de base ci-dessus) */
    max-height: calc(100dvh - 85px);
    overflow: hidden;
  }

  /* La messagerie est un outil de travail à trois colonnes : aucune bande
     latérale ne doit lui retirer de place. La grille commence au bord du menu
     et se termine au bord droit de la fenêtre. */
  html:not(.grand-ecran) .app-shell-messages:not(.app-shell-landing) .page-shell {
    width: calc(100vw - var(--menu-w-eff));
    margin: 0 0 0 var(--menu-w-eff);
    padding: 0;
  }

  html.grand-ecran .app-shell-messages:not(.app-shell-landing) .page-shell {
    width: 100vw;
    margin: 0;
    padding: 0;
  }
}

/* msg-layout must take full width, override the 1560px cap on page-shell children */
.page-messages .page-shell > .msg-layout {
  width: 100%;
  max-width: none;
  justify-self: stretch;
}

/* Largeur de la colonne « liste des discussions » pilotée par --msg-list-w
   (poignée à glisser, mémorisée par navigateur — #176). clamp() borne la valeur
   quoi qu'il arrive (JS absent, localStorage corrompu) : jamais < 260 ni > 620. */
.msg-layout {
  position: relative;
  display: grid;
  grid-template-columns: clamp(260px, var(--msg-list-w, 340px), 620px) minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.msg-layout.msg-has-thread {
  grid-template-columns: clamp(260px, var(--msg-list-w, 340px), 620px) minmax(0, 1fr) 340px;
}

/* #489 - glissement de la liste au retour instantane (cf. media <=1150px). */
@keyframes msgSidebarSlideIn {
  from { transform: translateX(-16%); opacity: 0.55; }
  to { transform: none; opacity: 1; }
}

/* Poignée de redimensionnement : posée sur la couture liste ⟷ conversation.
   position:absolute → ne prend PAS de cellule de grille. Trait fin visible au
   survol / pendant le glissé. Cachée en mono-colonne (≤1150px, cf. media). */
.msg-list-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  /* Doit rester EXACTEMENT sur la couture : même expression que la 1re piste du
     grid. Défaut = --m-ctx-w (#351bis : liste = même largeur que le panneau droit) ;
     repli 340px scalés par --m-fs si --m-ctx-w indéfini (hors messages / vieux cache). */
  left: clamp(260px, var(--msg-list-w, var(--m-ctx-w, calc(340px * var(--m-fs, 1)))), 620px);
  width: 11px;
  transform: translateX(-50%);
  cursor: col-resize;
  z-index: 20;
  touch-action: none;
  background: transparent;
}

.msg-list-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: transparent;
  transition: background 0.15s ease;
}

.msg-list-resizer:hover::before,
.msg-list-resizer.is-dragging::before {
  background: var(--accent);
}

body.msg-list-resizing {
  cursor: col-resize;
  user-select: none;
}

/* ── Sidebar ── */
.msg-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
}

.msg-sidebar-head {
  display: grid;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.msg-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.msg-sidebar-title-row h2 {
  margin: 0;
  font-size: 1.15rem;
}

.msg-sidebar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.msg-sidebar-actions .button {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.msg-sidebar-actions a.button {
  padding: 6px 8px;
}

.msg-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.msg-filters .select {
  font-size: 0.8rem;
  padding: 6px 8px;
}

/* ── Sync dropdown ── */
.msg-sync-dd {
  position: relative;
}

.msg-sync-dd summary {
  list-style: none;
}

.msg-sync-dd summary::-webkit-details-marker {
  display: none;
}

.msg-sync-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 150px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.msg-sync-pop .button {
  width: 100%;
  justify-content: flex-start;
}

/* ── Thread list ── */
.msg-thread-list {
  overflow-y: auto;
  min-height: 0;
  padding: 6px;
}

/* ── Thread card ── */
.msg-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background 120ms ease;
}

.msg-card:hover {
  background: var(--hover-2);
}

.msg-card.is-active {
  background: var(--accent-soft);
}

.msg-card-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.msg-card-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8f522b);
}

.msg-card-mp {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--bg);
}

.msg-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.msg-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.msg-card-name {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.msg-card-time {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.msg-card-product {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-card-snippet {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
}

.msg-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.msg-card-foot .status-pill {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.msg-card-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.72rem;
  font-weight: 800;
  margin-left: auto;
}

.msg-empty-list {
  padding: 32px 16px;
  text-align: center;
}

/* ── Workspace / Chat panel ── */
.msg-workspace {
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.msg-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.msg-back {
  display: none;
  padding: 10px 14px;
  gap: 6px;
  align-items: center;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}

/* ── Thread header ── */
.msg-thread-head {
  display: grid;
  gap: 6px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--line);
}

.msg-thread-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.msg-thread-identity {
  min-width: 0;
}

.msg-thread-identity h2 {
  margin: 0;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-thread-product {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-thread-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.msg-thread-badges .status-pill {
  padding: 4px 10px;
  font-size: 0.76rem;
}

.msg-ref {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.msg-thread-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.msg-thread-meta span::before {
  content: "";
}

/* ── Context drawer ── */
.msg-context-drawer {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.msg-context-drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.msg-context-drawer summary::-webkit-details-marker {
  display: none;
}

.msg-context-drawer[open] summary {
  border-bottom: 1px solid var(--line);
}

.msg-context-body {
  padding: 12px 20px;
}

.msg-item-link {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.msg-item-link:hover {
  opacity: 0.85;
}

.msg-item-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.msg-item-info {
  display: grid;
  gap: 2px;
  font-size: 0.88rem;
}

/* ── Message stream ── */
.msg-stream-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.msg-load-older {
  padding: 10px 20px 0;
  text-align: center;
}

.msg-load-older .button {
  font-size: 0.82rem;
}

.msg-stream {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 18px 22px 22px;
  overflow-y: auto;
  min-height: 0;
}

.msg-stream-empty {
  padding: 20px;
  text-align: center;
}

/* ── Message rows & bubbles ── */
.msg-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 75%;
}

.msg-row-out {
  align-items: flex-end;
  align-self: flex-end;
}

.msg-row-sys {
  align-items: center;
  align-self: center;
  max-width: 85%;
}

.msg-bubble {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  line-height: 1.5;
  background: var(--hover);
  border: 1px solid var(--hover);
}

.msg-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
}

.msg-bubble-out {
  background: rgba(223, 143, 120, 0.14);
  border-color: rgba(223, 143, 120, 0.22);
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 16px;
}

.msg-bubble-sys {
  background: rgba(138, 168, 191, 0.1);
  border-color: rgba(138, 168, 191, 0.18);
  border-radius: 12px;
  text-align: center;
}

.msg-bubble-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.msg-bubble-head strong {
  font-size: 0.8rem;
  color: var(--accent);
}

.msg-row-in .msg-bubble-head strong {
  color: var(--ink-blue);
}

.msg-row-sys .msg-bubble-head strong {
  color: var(--muted);
}

.msg-bubble-head time {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.msg-bubble-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 210, 127, 0.14);
  color: #ffe1a2;
  border: 1px solid rgba(255, 210, 127, 0.2);
}

/* ── Compose ── */
.msg-compose {
  display: grid;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.msg-compose-input {
  resize: vertical;
  min-height: 80px;
  max-height: 240px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--hover-2);
}

.msg-compose-input.is-readonly {
  opacity: 0.6;
}

.msg-compose-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.msg-compose-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.82rem;
}

.msg-compose-status-label {
  font-weight: 700;
  color: var(--text);
}

.msg-compose-status-note {
  font-size: 0.78rem;
}

.msg-compose-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.msg-btn-ai {
  font-weight: 800;
  letter-spacing: 0.04em;
  min-width: 44px;
}

/* ── Compose attachments (Phase 3 eBay : pieces jointes images) ── */
.msg-compose-attach {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* Wrapper qui regroupe les boutons galerie + camera cote a cote (mobile).
   Sur desktop le bouton camera est cache (capture=environment serait ignore
   et offrirait le meme file picker que le bouton galerie). */
.msg-compose-attach-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Sur desktop : 1 seul bouton "Joindre une image" comme avant. */
.msg-compose-attach-btn-camera { display: none; }
.msg-attach-label-mobile { display: none; }
.msg-attach-label-desktop { display: inline; }
.msg-compose-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.msg-compose-attach-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-soft, rgba(0, 0, 0, 0.03));
}

.msg-compose-attach-btn svg {
  flex: 0 0 14px;
}

.msg-compose-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msg-compose-attach-preview:empty {
  display: none;
}

.msg-attach-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft, #f5f5f5);
  width: 72px;
}

.msg-attach-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-2);
}

.msg-attach-thumb-label {
  font-size: 0.65rem;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  color: var(--muted);
}

.msg-attach-thumb-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--danger, #c0392b);
  color: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.msg-attach-thumb-remove:hover {
  background: var(--danger-hover, #a72f23);
}

/* ============================================================
   Phase 5 : UI/UX upgrade page Messages (skin overrides)
   ============================================================ */

/* ── Cards sidebar : avatar amélioré + thumbnail si dispo ── */
.msg-card {
  position: relative;
  padding: 10px 12px;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease;
}
.msg-card:hover {
  background: var(--hover-2);
  border-color: var(--hover);
}
.msg-card.is-active {
  background: linear-gradient(90deg, rgba(223, 143, 120, 0.12) 0%, transparent 100%);
  border-color: rgba(223, 143, 120, 0.18);
}
.msg-card.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.msg-card-avatar-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  position: relative;
}

.msg-card-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}
/* Item plus disponible (vendu / archivé / stock 0) → vignette grisée dans la liste */
.msg-card-avatar-wrap.is-unavailable .msg-card-thumb {
  filter: grayscale(1);
  opacity: 0.5;
}

.msg-card-avatar-wrap.ch-rakuten .msg-card-avatar { background: linear-gradient(135deg, #bf0000, #7a0a0a); }
.msg-card-avatar-wrap.ch-ebay    .msg-card-avatar { background: linear-gradient(135deg, #e6b400, #8a5a00); }
.msg-card-avatar-wrap.ch-lbc     .msg-card-avatar { background: linear-gradient(135deg, var(--accent, #df8f78), #8f522b); }
.msg-card-avatar-wrap.ch-amazon  .msg-card-avatar { background: linear-gradient(135deg, #ff9900, #b66a00); }

.msg-card-mp {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid #1a1414;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.msg-card-unread {
  background: var(--accent, #df8f78);
  box-shadow: 0 0 0 2px rgba(223, 143, 120, 0.18);
}

/* ── Header thread : mini-thumbnail produit ── */
.msg-thread-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.msg-thread-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Item plus disponible (vendu / archivé / stock 0) → photo grisée */
.msg-thread-thumb.is-unavailable img {
  filter: grayscale(1);
  opacity: 0.5;
}

.msg-thread-identity {
  flex: 1;
  min-width: 0;
}

/* ── Fiche produit panneau droite : hero card ── */
.msg-context-panel .msg-context-product {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

/* Bulle prix enveloppée comme la carte produit dans le panneau de droite :
   le partial garde son margin-top pour la vue mobile, mais ici le wrapper
   .msg-context-product fournit déjà l'inset — on l'annule pour que les deux
   cartes (produit + prix) soient parfaitement alignées, mêmes bords. */
.msg-context-panel .msg-context-product > .msg-price-tool {
  margin-top: 0;
}

.msg-product-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--hover-2) 0%, var(--hover-2) 100%);
  border: 1px solid var(--line);
}

.msg-product-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}
.msg-product-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 280ms ease;
}
.msg-product-card:hover .msg-product-cover img {
  transform: scale(1.03);
}

.msg-product-cover-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.msg-product-channel {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Item plus disponible (vendu / archivé / stock 0) : photo grisée + badge
   raison en haut à droite. Le hover-zoom est neutralisé pour ne pas donner
   l'impression d'un item actionnable. */
.msg-product-cover.is-unavailable img {
  filter: grayscale(1);
  opacity: 0.5;
}
.msg-product-card:hover .msg-product-cover.is-unavailable img {
  transform: none;
}
.msg-product-unavailable {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  color: #fff;
  background: rgba(176, 38, 38, 0.82);
  backdrop-filter: blur(6px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.msg-product-info {
  display: grid;
  gap: 6px;
}

.msg-product-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.msg-product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent, #df8f78);
  letter-spacing: -0.01em;
}

.msg-product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.msg-product-meta .muted {
  min-width: 30px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg-product-actions .button.msg-product-cta {
  width: 100%;
  justify-content: center;
}

/* ── Bulles conversation : polish typo/spacing/hover ── */
.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  line-height: 1.55;
  background: var(--hover-2);
  border: 1px solid var(--hover);
  transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.msg-bubble:hover {
  background: var(--hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.msg-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.55;
}

.msg-bubble-out {
  background: linear-gradient(180deg, rgba(223, 143, 120, 0.16), rgba(223, 143, 120, 0.10));
  border-color: rgba(223, 143, 120, 0.28);
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 16px;
  box-shadow: 0 1px 0 var(--hover-2) inset;
}
.msg-bubble-out:hover {
  box-shadow: 0 4px 16px rgba(223, 143, 120, 0.18);
}

.msg-bubble-head {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hover);
}
.msg-bubble-head strong {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.msg-bubble-head time {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Page batch /messages/ai-questions ── */
.msg-ai-questions-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.msg-ai-questions-header h1 {
  margin: 0 0 4px 0;
}

.msg-ai-questions-header p.muted {
  margin: 0;
  max-width: 720px;
  font-size: 0.88rem;
}

.msg-ai-questions-counts {
  display: flex;
  align-items: center;
  gap: 10px;
}

.msg-ai-questions-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

.msg-ai-questions-empty h2 {
  margin: 4px 0 0 0;
  font-size: 1.1rem;
  color: var(--text);
}

.msg-ai-questions-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.msg-ai-question-card {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-left: 4px solid var(--info, #4a9eff);
  background: linear-gradient(180deg, rgba(74, 158, 255, 0.05) 0%, var(--hover-2) 100%);
  scroll-margin-top: 80px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.msg-ai-question-card.is-just-resolved {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.35);
  border-left-color: var(--success, #4caf50);
}

.msg-ai-question-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.msg-ai-question-card-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--muted);
}
.msg-ai-question-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-ai-question-card-meta {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 200px;
}

.msg-ai-question-card-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-ai-question-card-counterparty {
  font-size: 0.95rem;
}

.msg-ai-question-card-round {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.msg-ai-question-card-subject,
.msg-ai-question-card-price {
  font-size: 0.78rem;
}

.msg-ai-question-card-open {
  flex-shrink: 0;
}

.msg-ai-question-card-original {
  margin: 0;
  padding: 10px 14px;
  border-left: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
}

.msg-ai-question-card-original .muted {
  display: block;
  font-size: 0.7rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.msg-ai-question-card-body {
  display: grid;
  gap: 12px;
}

.msg-ai-question-card-question {
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.22);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.msg-ai-question-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--info, #4a9eff);
}

.msg-ai-question-card-question p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
}

.msg-ai-question-card-question small {
  font-size: 0.75rem;
}

/* Sidebar /messages : lien vers la page batch */
.msg-sidebar-actions .msg-ai-questions-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-sidebar-actions .msg-ai-questions-link-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--info, #4a9eff);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Form question IA integre dans le compose (Phase 2 ask_human polished) ── */
.msg-ai-question {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(74, 158, 255, 0.06) 0%, rgba(74, 158, 255, 0.02) 100%);
  border: 1px solid rgba(74, 158, 255, 0.22);
  border-left: 4px solid var(--info, #4a9eff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), inset 0 1px 0 var(--hover-2);
}

.msg-ai-question-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.msg-ai-question-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(74, 158, 255, 0.15);
  color: var(--info, #4a9eff);
  border: 1px solid rgba(74, 158, 255, 0.32);
}

.msg-ai-question-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.msg-ai-question-head-text strong {
  font-size: 0.92rem;
  color: var(--text);
}

.msg-ai-question-round {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.msg-ai-question-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 2px solid rgba(74, 158, 255, 0.45);
  font-style: italic;
}

.msg-ai-question-reason {
  margin: -4px 0 0 0;
  font-size: 0.78rem;
  font-style: italic;
}

.msg-ai-question-history {
  font-size: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.18);
}

.msg-ai-question-history summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 0;
}

.msg-ai-question-history[open] summary {
  margin-bottom: 6px;
  color: var(--text);
}

.msg-ai-question-history ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.msg-ai-question-form {
  display: grid;
  gap: 10px;
}

.msg-ai-question-field {
  display: grid;
  gap: 4px;
}

.msg-ai-question-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg-ai-question-field .textarea {
  min-height: 70px;
  resize: vertical;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.5;
}

.msg-ai-question-field .textarea:focus {
  border-color: var(--info, #4a9eff);
  outline: none;
  background: var(--hover);
}

.msg-ai-question-image {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-ai-question-image-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--hover-2);
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.msg-ai-question-image:hover .msg-ai-question-image-btn {
  border-style: solid;
  border-color: var(--info, #4a9eff);
  color: var(--text);
  background: rgba(74, 158, 255, 0.06);
}

.msg-ai-question-image.is-recommended .msg-ai-question-image-btn {
  border-color: rgba(74, 158, 255, 0.45);
  color: var(--info, #4a9eff);
}

.msg-ai-question-image-btn svg {
  flex: 0 0 14px;
}

.msg-ai-question-image.has-file .msg-ai-question-image-btn {
  border-style: solid;
  border-color: var(--success, #4caf50);
  color: var(--success, #4caf50);
  background: rgba(76, 175, 80, 0.08);
}
.msg-ai-question-image-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--muted);
}

.msg-ai-question-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.msg-ai-question-actions .button-primary {
  flex: 1 1 auto;
  min-width: 160px;
}

@media (max-width: 600px) {
  .msg-ai-question {
    padding: 14px;
    gap: 12px;
  }
  .msg-ai-question-text {
    font-size: 0.92rem;
  }
}

/* ── Bloc decision IA dans le compose box ── */
.msg-ai-decision {
  display: grid;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
}

.msg-ai-decision-answer  { border-left-color: var(--success, #4caf50); }
.msg-ai-decision-question { border-left-color: var(--info, #4a9eff); }
.msg-ai-decision-review   { border-left-color: var(--warning, #e6b400); }

.msg-ai-decision-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.msg-ai-decision-reason {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
}

.msg-ai-decision-hint {
  margin: 0;
  font-size: 0.78rem;
  font-style: italic;
}
.msg-ai-decision-hint a {
  color: var(--accent, #df8f78);
  text-decoration: underline;
}

/* ── Compose : harmonisation dark theme ── */
.msg-compose {
  background: var(--panel);
  padding: 14px 22px 18px;
}

.msg-compose-input {
  background: var(--hover-2);
  border: 1px solid var(--line);
  transition: border-color 160ms ease, background 160ms ease;
}
.msg-compose-input:focus {
  border-color: var(--accent, #df8f78);
  background: var(--hover);
  outline: none;
}

.msg-ai-confidence-warning {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: -2px 2px 0;
  color: var(--warning, #e0a020);
  font-size: 0.78rem;
  line-height: 1.35;
}

.msg-compose-attach-btn {
  border: 1px dashed var(--line);
  background: var(--hover-2);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
}
.msg-compose-attach-btn:hover {
  border-style: solid;
  border-color: var(--accent, #df8f78);
  color: var(--text);
  background: rgba(223, 143, 120, 0.06);
}

.msg-attach-thumb {
  background: var(--hover-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 76px;
  padding: 4px;
}
.msg-attach-thumb img {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}
.msg-attach-thumb-label {
  color: var(--muted);
}
.msg-attach-thumb-remove {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--line);
  width: 18px;
  height: 18px;
  font-size: 12px;
}
.msg-attach-thumb-remove:hover {
  background: var(--danger, #c0392b);
  border-color: var(--danger, #c0392b);
}

/* ── Empty state ── */
.msg-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  height: 100%;
  text-align: center;
  color: var(--muted);
}

.msg-empty p {
  margin: 0;
  font-size: 0.95rem;
}

/* ── Context panel (right column) ── */
.msg-context-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
}

.msg-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 16px 18px;
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.msg-context-product {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.msg-context-panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.msg-context-panel .msg-item-link {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.msg-context-panel .msg-item-img {
  width: 100%;
  height: auto;
  max-height: 180px;
  border-radius: 10px;
  object-fit: cover;
}

.msg-context-panel .msg-claim-panel {
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

/* ── Claim panel ── */
.msg-claim-panel {
  display: grid;
  gap: 8px;
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 210, 127, 0.04);
}

.msg-claim-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-claim-header strong {
  font-size: 0.88rem;
  color: #ffe1a2;
}

.msg-claim-header .status-pill {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.msg-claim-details {
  display: grid;
  gap: 4px;
}

/* ============================ Assistance à distance (remote_assist) ============================ */

/* Bandeau « X vous assiste » côté employé */
.ra-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 5px solid var(--danger, #ff8d8d);
  background: var(--panel, var(--panel));
  color: var(--text, var(--text));
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
}
/* IMPORTANT : sans ça, `display:flex` ci-dessus écrase l'attribut `hidden` (le CSS auteur
   bat la règle navigateur [hidden]{display:none}) -> le bandeau reste TOUJOURS affiché et
   « Arrêter » ne le cache jamais. Cette règle plus spécifique rétablit le masquage. */
.ra-banner[hidden] { display: none !important; }
.ra-banner-stop {
  border: 1px solid var(--danger, #ff8d8d);
  background: transparent;
  color: var(--danger, #ff8d8d);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.ra-banner-stop:hover { background: var(--danger, #ff8d8d); color: #1a1414; }

/* Curseur fantôme du dépanneur affiché chez l'employé */
.ra-ghost-cursor {
  position: fixed;
  z-index: 2147483000;
  width: 16px;
  height: 16px;
  margin: -3px 0 0 -3px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent-strong, #f2b36a);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
  transform: rotate(-8deg);
  pointer-events: none;
  transition: left 0.05s linear, top 0.05s linear;
}

/* Badges de demandes reçues (côté dépanneur) */
.ra-requests {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ra-request-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel, var(--panel));
  color: var(--text, var(--text));
  border: 1px solid var(--accent, #df8f78);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-width: 320px;
}
.ra-request-accept {
  border: none;
  background: var(--accent, #df8f78);
  color: #1a1414;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
}
.ra-request-accept:hover { background: var(--accent-strong, #f2b36a); }

/* Scène plein écran du dépanneur (écran rejoué de l'employé) */
.ra-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483002;
  display: flex;
  flex-direction: column;
  background: rgba(10, 8, 8, 0.92);
  backdrop-filter: blur(2px);
}
.ra-overlay-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--panel, var(--panel));
  border-bottom: 1px solid var(--border, var(--line-2));
  color: var(--text, var(--text));
}
.ra-overlay-title { font-size: 15px; }
.ra-overlay-hint { font-size: 12px; opacity: 0.7; }
.ra-overlay-close {
  margin-left: auto;
  border: 1px solid var(--danger, #ff8d8d);
  background: var(--danger, #ff8d8d);
  color: #1a1414;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.ra-stage-wrap {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px;
}
.ra-stage {
  background: #fff;
  width: max-content;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
/* rrweb fixe lui-même width/height de l'iframe d'après l'event Meta (dimensions
   de l'écran de l'employé) : on NE force PAS la largeur, sinon écran blanc/0×0. */
.ra-stage iframe { border: 0; display: block; }

.msg-claim-row {
  display: flex;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.msg-claim-row > span:first-child {
  flex-shrink: 0;
  min-width: 90px;
}

.msg-claim-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.msg-action-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(125, 214, 170, 0.12);
  color: #b6ffd8;
  border: 1px solid rgba(125, 214, 170, 0.2);
}

.msg-claim-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--danger);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 141, 141, 0.08);
  border: 1px solid rgba(255, 141, 141, 0.14);
}

/* ── Bubble author & tags ── */
.msg-bubble-author {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.msg-bubble-source {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.msg-bubble-source-muted {
  color: var(--muted);
  background: var(--hover);
}

.msg-bubble-source-warning {
  color: #ffe1a2;
  background: rgba(242, 179, 106, 0.12);
}

.msg-bubble-source-info {
  color: #c8dbef;
  background: rgba(138, 168, 191, 0.12);
}

.msg-bubble-source-success {
  color: #b6ffd8;
  background: rgba(125, 214, 170, 0.12);
}

.msg-bubble-recipient {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.msg-bubble-subject {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
}

.msg-bubble-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.msg-tag-claim {
  background: rgba(255, 210, 127, 0.14);
  color: #ffe1a2;
  border-color: rgba(255, 210, 127, 0.2);
}

.msg-tag-inquiry {
  background: rgba(138, 168, 191, 0.14);
  color: #c8dbef;
  border-color: rgba(138, 168, 191, 0.2);
}

/* ── Responsive: small desktop — collapse context panel ── */
@media (max-width: 1100px) {
  .msg-layout.msg-has-thread {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .msg-context-panel {
    display: none;
  }
}

/* ── Responsive: tablet ── */
@media (max-width: 960px) {
  .msg-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

/* ── Responsive: mobile ET fenêtre PC étroite (#81) ──
   Seuil relevé de 720px à 1150px : dès que la place manque (écran 16", fenêtre
   collée à droite / demi-écran), on bascule sur le MÊME affichage « une seule
   colonne » que le mobile, façon Leboncoin — la liste OU la conversation, avec
   un bouton « retour », et le panneau contexte replié. Au-dessus de 1150px on
   garde l'affichage multi-colonnes classique (16" plein écran, 24"). */
@media (max-width: 1150px) {
  .page-messages .page-shell {
    height: calc(100dvh - 64px);
    max-height: calc(100dvh - 64px);
  }

  .msg-layout,
  .msg-layout.msg-has-thread {
    grid-template-columns: 1fr;
  }

  /* Mono-colonne : plus de couture à redimensionner (#176) */
  .msg-list-resizer {
    display: none;
  }

  /* List mode: show sidebar, hide workspace */
  .msg-list-mode .msg-workspace {
    display: none;
  }

  /* Thread mode: hide sidebar, show workspace */
  .msg-has-thread .msg-sidebar {
    display: none;
  }

  /* #489 - retour instantane a la liste (swipe ou bouton << Retour) : la
     liste glisse en place au lieu d'apparaitre sechement. C'est ce court
     mouvement qui dit << ton geste est passe >> - avant, il ne se passait
     visuellement rien pendant le rechargement. */
  .msg-layout.msg-back-anim .msg-sidebar {
    animation: msgSidebarSlideIn 0.22s ease-out;
  }

  .msg-context-panel {
    display: none;
  }

  .msg-back {
    display: inline-flex;
  }

  .msg-stream {
    padding: 12px 14px 16px;
  }

  .msg-compose {
    padding: 10px 14px 14px;
  }

  .msg-compose-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .msg-compose-actions {
    width: 100%;
  }

  .msg-compose-actions .button {
    flex: 1;
    justify-content: center;
  }

  .msg-row {
    max-width: 88%;
  }

  .msg-thread-head {
    padding: 12px 14px 8px;
  }

  .msg-thread-head-top {
    flex-direction: column;
    gap: 6px;
  }

  /* INVARIANT CRITIQUE — ne pas retirer.
     `.msg-chat` est un flex column (msg-back + msg-thread-head +
     msg-stream-shell{flex:1} + msg-compose). Sans `flex-shrink:0` sur
     les 3 enfants a hauteur intrinseque, Chrome Android (et Safari iOS
     dans certains cas) sous-evaluent leur `min-content` quand le stream
     deborde, ce qui les comprime sous leur taille reelle. Le contenu
     du header (thumb + texte + badges col) overflow alors VERS LE BAS
     et chevauche les premieres bulles du stream.
     Le bug est particulierement reproductible entre 701-720px (zone
     ou app.css passe .msg-thread-head-top en flex-direction:column)
     mais cette regle protege aussi tous les autres viewports <=720. */
  .msg-chat > .msg-thread-head,
  .msg-chat > .msg-back,
  .msg-chat > .msg-compose {
    flex-shrink: 0;
  }
}

/* --- Message bubble body & structured sections --- */
.msg-bubble-body {
  word-break: break-word;
  line-height: 1.5;
}
.msg-bubble-body p {
  margin: 0 0 6px 0;
}
.msg-bubble-body p:last-child {
  margin-bottom: 0;
}
.msg-section {
  padding: 6px 10px;
  margin: 4px 0;
  border-radius: 6px;
  border-left: 3px solid var(--border);
  background: var(--hover-2);
  font-size: 0.93rem;
  line-height: 1.45;
}
.msg-section strong {
  color: var(--text-primary);
  font-weight: 600;
}
.msg-section-warning {
  border-left-color: var(--warning);
  background: rgba(255,193,7,0.06);
}
.msg-section-info {
  border-left-color: var(--accent);
  background: rgba(99,102,241,0.06);
}
.msg-section-accent {
  border-left-color: var(--accent);
  background: rgba(99,102,241,0.08);
}
.msg-section-default {
  border-left-color: var(--border);
}
.msg-section-tracking {
  border-left-color: var(--success);
  background: rgba(34,197,94,0.06);
  font-family: monospace;
}

/* --- Compose reply target toggle buttons --- */
.msg-compose-target {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.msg-target-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.msg-target-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.msg-target-btn.is-active {
  background: rgba(223, 143, 120, 0.14);
  border-color: rgba(223, 143, 120, 0.3);
  color: var(--accent);
}

.msg-compose-no-target {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--danger);
  background: rgba(255, 141, 141, 0.08);
  border: 1px solid rgba(255, 141, 141, 0.14);
}

/* ═══════════════════════════════════════════════════
   UI Polish — mobile-first micro-interactions
   ═══════════════════════════════════════════════════ */

/* --- Smooth scroll globally --- */
html {
  scroll-behavior: smooth;
}

/* --- Spring easing custom property --- */
:root {
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Hamburger → X animation --- */
.menu-button span {
  transition: transform 280ms var(--spring), opacity 180ms ease, width 180ms ease;
  transform-origin: center;
}

.app-menu[open] .menu-button span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.app-menu[open] .menu-button span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.app-menu[open] .menu-button span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --- Menu links stagger entrance --- */
.app-menu[open] .menu-link {
  animation: menuLinkSlideIn 320ms var(--smooth) backwards;
}
.app-menu[open] .menu-links > :nth-child(1) .menu-link,
.app-menu[open] .menu-links > :nth-child(1) { animation-delay: 40ms; }
.app-menu[open] .menu-links > :nth-child(2) .menu-link,
.app-menu[open] .menu-links > :nth-child(2) { animation-delay: 70ms; }
.app-menu[open] .menu-links > :nth-child(3) .menu-link,
.app-menu[open] .menu-links > :nth-child(3) { animation-delay: 100ms; }
.app-menu[open] .menu-links > :nth-child(4) .menu-link,
.app-menu[open] .menu-links > :nth-child(4) { animation-delay: 130ms; }
.app-menu[open] .menu-links > :nth-child(5) .menu-link,
.app-menu[open] .menu-links > :nth-child(5) { animation-delay: 160ms; }
.app-menu[open] .menu-links > :nth-child(6) .menu-link,
.app-menu[open] .menu-links > :nth-child(6) { animation-delay: 190ms; }
.app-menu[open] .menu-links > :nth-child(7) .menu-link,
.app-menu[open] .menu-links > :nth-child(7) { animation-delay: 220ms; }
.app-menu[open] .menu-links > :nth-child(8) .menu-link,
.app-menu[open] .menu-links > :nth-child(8) { animation-delay: 250ms; }
.app-menu[open] .menu-links > :nth-child(9) .menu-link,
.app-menu[open] .menu-links > :nth-child(9) { animation-delay: 280ms; }
.app-menu[open] .menu-links > :nth-child(10) .menu-link,
.app-menu[open] .menu-links > :nth-child(10) { animation-delay: 310ms; }
.app-menu[open] .menu-links > :nth-child(11),
.app-menu[open] .menu-links > :nth-child(12) { animation-delay: 340ms; }

@keyframes menuLinkSlideIn {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Active link glow pulse on menu --- */
.menu-link.is-active {
  position: relative;
  overflow: hidden;
}

.menu-link.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 50%, rgba(223, 143, 120, 0.08), transparent 70%);
  pointer-events: none;
}

/* --- Card touch feedback (press-down on mobile) --- */
.item-card {
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  will-change: transform;
}

.item-card:active {
  transform: scale(0.975);
  transition-duration: 80ms;
}

@media (hover: hover) and (pointer: fine) {
  .item-card:hover {
    border-color: var(--line-2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
  }
  .item-card:active {
    transform: scale(0.99);
  }
}

/* --- Button press spring --- */
.button:active,
.action-button:active,
.mini-button:active {
  transform: scale(0.94);
  transition-duration: 60ms;
}

.button-primary:active,
.action-button:active {
  filter: brightness(1.1);
}

/* --- Badge subtle entrance --- */
.badge,
.status-pill,
.badge-status {
  animation: badgePop 280ms var(--spring) backwards;
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Notice banner slide-in from top --- */
.notice-banner {
  animation: noticeSlideIn 400ms var(--smooth) backwards;
}

@keyframes noticeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Page header entrance --- */
.page-header {
  animation: pageHeaderIn 420ms var(--smooth) backwards;
}

@keyframes pageHeaderIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Toolbar slide up --- */
.toolbar,
.stock-toolbar {
  animation: toolbarSlideUp 380ms var(--smooth) 80ms backwards;
}

@keyframes toolbarSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Panel entrance with subtle scale --- */
.panel,
.form-panel {
  animation: panelEnter 380ms var(--smooth) backwards;
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Floating widgets entrance --- */
.mobile-install-widget:not([hidden]) {
  animation: widgetSlideUp 440ms var(--spring) backwards;
}

@keyframes widgetSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Confirm modal entrance --- */
.confirm-modal:not([hidden]) .confirm-modal-card {
  animation: modalPop 340ms var(--spring) backwards;
}

.confirm-modal:not([hidden]) .confirm-modal-backdrop {
  animation: modalBackdropIn 280ms ease backwards;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Menu link active state — tactile press --- */
.menu-link:active {
  transform: scale(0.96);
  transition-duration: 60ms;
}

/* --- Stock filter pill toggle animation --- */
.stock-filter-pill span {
  transition: transform 160ms var(--spring), background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.stock-filter-pill input:checked + span {
  animation: pillCheck 280ms var(--spring);
}

@keyframes pillCheck {
  0% { transform: scale(1); }
  40% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

/* --- Input focus glow --- */
.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(223, 143, 120, 0.4);
  box-shadow: 0 0 0 3px rgba(223, 143, 120, 0.1);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

/* --- Detail gallery photos — smooth snap with inertia feel --- */
.detail-gallery {
  position: relative;
}

/* --- Topbar subtle entrance --- */
.topbar {
  animation: topbarFadeIn 300ms ease backwards;
}

@keyframes topbarFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- Loading shimmer for placeholder states --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.is-loading-shimmer {
  background: linear-gradient(90deg,
    var(--hover-2) 25%,
    var(--line) 50%,
    var(--hover-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease infinite;
  border-radius: 12px;
}

/* --- Success flash for just-saved items --- */
@keyframes successFlash {
  0% { box-shadow: 0 0 0 0 rgba(125, 214, 170, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(125, 214, 170, 0.12); }
  100% { box-shadow: 0 0 0 0 rgba(125, 214, 170, 0); }
}

.is-just-saved {
  animation: successFlash 600ms ease;
}

/* --- Error shake for invalid inputs --- */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.is-input-error {
  animation: inputShake 400ms ease;
  border-color: var(--danger) !important;
}

/* --- Smoother stock card reveal with spring --- */
@keyframes stockCardRevealV2 {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stock-appear-list .stock-appear-card {
  animation-name: stockCardRevealV2;
  animation-timing-function: var(--spring);
}

/* --- Assistant FAB bounce entrance --- */
.assistant-fab {
  animation: fabBounceIn 500ms var(--spring) 600ms backwards;
}

@keyframes fabBounceIn {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }
  70% {
    transform: scale(1.05) translateY(-2px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- Assistant FAB pulse when idle (subtle attention) --- */
.assistant-fab-toggle {
  animation: fabPulse 4s ease 3s infinite;
}

@keyframes fabPulse {
  0%, 85%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,0.24); }
  92% { box-shadow: 0 8px 24px rgba(0,0,0,0.24), 0 0 0 6px rgba(223, 143, 120, 0.12); }
}

/* --- Pagination links tactile --- */
.pagination a,
.pagination span {
  transition: transform 120ms ease, background 120ms ease;
}

.pagination a:active {
  transform: scale(0.92);
}

/* --- Better mobile touch targets --- */
@media (max-width: 759px) {
  .menu-link {
    min-height: 48px;
    padding: 14px 16px;
  }

  .button,
  .mini-button {
    min-height: 44px;
    padding: 12px 18px;
  }

  .stock-filter-pill span {
    min-height: 40px;
    padding: 8px 14px;
  }

  .pagination a,
  .pagination span {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════
   Round 2 — Real UX improvements
   ═══════════════════════════════════════════════════ */

/* --- Custom scrollbar (dark, thin, unobtrusive) --- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-2);
}

/* Hide scrollbar on mobile (scroll with touch) */
@media (hover: none) and (pointer: coarse) {
  ::-webkit-scrollbar {
    display: none;
  }
  * {
    scrollbar-width: none;
  }
}

/* --- Ripple effect on buttons --- */
.button,
.action-button,
.mini-button,
.menu-link {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.button::after,
.action-button::after,
.mini-button::after,
.menu-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.15), transparent 60%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.button:active::after,
.action-button:active::after,
.mini-button:active::after,
.menu-link:active::after {
  opacity: 1;
  transition-duration: 80ms;
}

/* Don't ripple the active-link glow pseudo-element */
.menu-link.is-active::after {
  background: none;
  opacity: 0;
}

/* --- Gallery arrows mobile --- */

/* --- Better empty states --- */
.detail-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--hover-2);
  border: 2px dashed var(--line);
  border-radius: 18px;
}

/* --- Info grid improvements — cleaner on mobile --- */
.info-grid > div {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--hover-2);
  border: 1px solid var(--hover-2);
  transition: background 160ms ease;
}

.info-grid > div:active {
  background: var(--hover);
}

/* --- Marketplace cards — better touch targets + status feedback --- */
.marketplace-card {
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.marketplace-card:active {
  transform: scale(0.98);
}

/* Marketplace status colors */
.badge-listed { background: rgba(125, 214, 170, 0.15); color: var(--success); border: 1px solid rgba(125, 214, 170, 0.25); }
.badge-not-listed { background: var(--hover); color: var(--muted); border: 1px solid var(--line); }
.badge-unknown { background: rgba(255, 210, 127, 0.15); color: var(--warning); border: 1px solid rgba(255, 210, 127, 0.25); }
.badge-not-eligible { background: rgba(255, 141, 141, 0.12); color: var(--danger); border: 1px solid rgba(255, 141, 141, 0.2); }

/* --- Mini-button bigger touch targets --- */
.mini-button,
.mini-button-ghost {
  min-height: 40px;
  min-width: 40px;
  padding: 10px 14px;
  font-size: 0.88rem;
}

@media (max-width: 759px) {
  .mini-button,
  .mini-button-ghost {
    min-height: 44px;
    padding: 12px 16px;
  }
}

/* --- Action rail — horizontal scroll on mobile for quick access --- */
@media (max-width: 759px) {
  .action-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .action-rail .action-button,
  .action-rail form {
    flex: 0 0 auto;
    min-width: max-content;
    scroll-snap-align: start;
  }

  .action-rail .action-button {
    width: auto;
    padding: 14px 20px;
    white-space: nowrap;
  }
}

/* --- Toast notification system --- */
.toast-container {
  position: fixed;
  top: calc(86px + env(safe-area-inset-top));
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10020;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}

.toast {
  pointer-events: auto;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 380ms var(--spring) backwards;
}

.toast > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast-success { border-color: color-mix(in srgb, var(--success) 42%, var(--line)); }
.toast-success::before { content: "✓"; color: var(--success); font-weight: 800; }

.toast-error { border-color: color-mix(in srgb, var(--danger) 42%, var(--line)); }
.toast-error::before { content: "✕"; color: var(--danger); font-weight: 800; }

.toast-info { border-color: color-mix(in srgb, var(--ink-blue) 42%, var(--line)); }
.toast-info::before { content: "ℹ"; color: var(--ink-blue); font-weight: 800; }

.toast.is-leaving {
  pointer-events: none;
  animation: toastSlideOut 560ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast[data-paused="1"] {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
    filter: blur(2px);
  }
}

@media (max-width: 600px) {
  .toast-container {
    top: calc(72px + env(safe-area-inset-top));
    width: calc(100vw - 24px);
  }

  .toast {
    padding: 12px 14px;
    align-items: flex-start;
  }

  .notice-action-btn {
    flex: 0 0 auto;
    padding: 7px 10px;
  }
}

.assistant-compact-page .toast-container {
  top: calc(12px + env(safe-area-inset-top));
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation-duration: 1ms;
  }
}

/* --- Enrich fail modal --- */
.enrich-fail-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: enrichOverlayIn 200ms ease;
}

.enrich-fail-modal {
  background: var(--panel);
  border: 1px solid rgba(255, 100, 100, 0.35);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 420px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 80, 80, 0.08);
  animation: enrichModalIn 250ms ease;
}

.enrich-fail-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255, 80, 80, 0.15);
  border: 2px solid rgba(255, 100, 100, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #ff6b6b;
}

.enrich-fail-modal h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #ff8d8d;
}

.enrich-fail-modal p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.5;
}

.enrich-fail-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

@keyframes enrichOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes enrichModalIn {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Better typography for readability on small screens --- */
@media (max-width: 759px) {
  body {
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: 0.01em;
  }
}

/* --- Copy on click --- */
.copy-on-click {
  cursor: pointer;
  border-bottom: 1px dashed var(--line-2);
  transition: color 0.2s;
}
.copy-on-click:hover {
  color: var(--accent);
}
.copy-on-click-done {
  color: var(--success, #4caf50);
}
.copy-toast {
  position: absolute;
  transform: translateX(-50%);
  background: var(--success, #4caf50);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 9999;
  animation: copy-toast-fade 1.4s ease forwards;
}
@keyframes copy-toast-fade {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

h1 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    line-height: 1.25;
  }

  h2 {
    font-size: 1.15rem;
  }

  .page-header p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .item-card-title {
    font-size: 1rem;
    line-height: 1.35;
  }
}

/* --- Back link — bigger, more tappable --- */
.back-link,
.back-link-strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px 8px 10px;
  margin: -8px 0 4px -10px;
  border-radius: 14px;
  transition: background 140ms ease, transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.back-link:active,
.back-link-strong:active {
  transform: scale(0.96);
  background: var(--hover);
}

/* --- Stock search bar — sticky on scroll for quick access --- */
@media (max-width: 759px) {
  .stock-toolbar {
    position: sticky;
    top: calc(56px + env(safe-area-inset-top));
    z-index: 20;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    backdrop-filter: blur(16px);
    background: var(--panel);
  }
}

/* --- Picking card actions — better layout --- */
@media (max-width: 759px) {
  .picking-actions,
  .marketplace-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .picking-actions form,
  .marketplace-actions form {
    width: 100%;
  }

  .picking-actions .button,
  .picking-actions .mini-button,
  .marketplace-actions .mini-button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* --- Photo gallery — full bleed on mobile --- */
@media (max-width: 759px) {
  .detail-photo-card {
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 0;
  }

  .detail-gallery {
    border-radius: 0;
  }

  .detail-photo {
    border-radius: 0;
    max-height: 50vh;
  }

  .detail-gallery-caption {
    padding: 8px 16px;
  }
}

/* --- Confirm modal — better on mobile --- */
@media (max-width: 500px) {
  .confirm-modal-card {
    width: 100%;
    border-radius: 22px 22px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    animation-name: modalSlideUp;
  }

  @keyframes modalSlideUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .confirm-modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .confirm-modal-actions .button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* --- Selection mode visual feedback --- */
.item-card.is-selected {
  border-color: rgba(223, 143, 120, 0.4);
  background: rgba(223, 143, 120, 0.06);
  box-shadow: 0 0 0 1px rgba(223, 143, 120, 0.2);
}

/* --- Active filters badges — dismissible look --- */
.stock-active-filter-badge {
  transition: transform 160ms var(--spring), opacity 160ms ease;
}

.stock-active-filter-badge:active {
  transform: scale(0.9);
}

/* --- Job status rows — better visual hierarchy --- */
.job-row {
  transition: background 300ms ease, box-shadow 300ms ease;
  border-radius: 14px;
  padding: 10px 12px;
}

.job-row-done-flash {
  background: rgba(125, 214, 170, 0.08);
  box-shadow: inset 0 0 0 1px rgba(125, 214, 170, 0.15);
}

/* --- Pull-down visual cue at top of page --- */
@media (hover: none) and (pointer: coarse) {
  .page-shell::before {
    content: "";
    display: block;
    height: 0;
    transition: height 200ms ease;
  }
}

/* --- Stock card image — nicer loading placeholder --- */
.item-card-media img {
  background: var(--hover-2);
  transition: opacity 300ms ease;
}

.item-card-media .media-fallback {
  background: linear-gradient(135deg, rgba(223, 143, 120, 0.08), rgba(138, 168, 191, 0.08));
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Settings tiles — card grid with hover lift --- */
.settings-home-grid .panel {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.settings-home-grid .panel:active {
  transform: scale(0.98);
}

/* --- Smoother focus outlines for keyboard nav --- */
:focus-visible {
  outline: 2px solid rgba(223, 143, 120, 0.5);
  outline-offset: 2px;
  border-radius: inherit;
}

/* Remove ugly default focus for mouse/touch */
:focus:not(:focus-visible) {
  outline: none;
}

/* --- Loading dots animation (reusable) --- */
@keyframes loadingDots {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: loadingDots 1.2s ease infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

/* --- Marketplace channel icons color coding --- */
.marketplace-card-top strong {
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

/* --- Quantity badge highlight when low --- */
.badge-quantity-low {
  background: rgba(255, 141, 141, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 141, 141, 0.2);
  animation: pulseDotWarm 3s ease infinite;
}

/* --- Divider utility --- */
.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
  border: none;
}

/* --- Skeleton loading placeholder blocks --- */
.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg,
    var(--hover-2) 25%,
    var(--hover) 50%,
    var(--hover-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease infinite;
}

.skeleton-text {
  height: 14px;
  width: 60%;
  margin: 6px 0;
}

.skeleton-text-short {
  height: 14px;
  width: 35%;
}

.skeleton-image {
  aspect-ratio: 1;
  width: 100%;
}

/* --- Flag modal textarea (item detail) --- */
.flag-modal-textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  margin: 12px 0 0;
  box-sizing: border-box;
}

/* --- User-flagged message in review card --- */
.user-flagged-message {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin: 8px 0 12px;
}

/* --- Lots --- */

/* Prix cible des lots (#451) : bandeau de reglage en tete de /lots. Jetons de
   theme uniquement (s'adapte aux 8 themes clair/sombre). */
/* Onglets d'etat de /lots : A valider / A publier / En ligne / Tous
   (demande Philippe 29/07 — un lot valide se perdait dans la liste). */
.lot-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border-radius: var(--r-pill, 999px);
  background: var(--panel);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.lot-tabs::-webkit-scrollbar { display: none; }
.lot-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: var(--r-pill, 999px);
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}
.lot-tab:hover { background: var(--hover); color: var(--text); }
.lot-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
}
.lot-tab-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: inherit;
  font-size: 0.82em;
  text-align: center;
}
.lot-tab.is-active .lot-tab-count {
  background: color-mix(in srgb, var(--on-accent) 24%, transparent);
}
@media (max-width: 620px) {
  .lot-tab { padding: 9px 12px; font-size: 0.92em; }
}

.lot-target-strip {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.lot-target-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.lot-target-icon { font-size: 1.2em; }
.lot-target-label {
  font-weight: 600;
  color: var(--text);
}
.lot-target-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lot-target-field .input {
  width: 96px;
  text-align: right;
}
.lot-target-unit { color: var(--muted); }
.lot-target-hint {
  margin: 8px 0 0;
  font-size: 0.88em;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 620px) {
  .lot-target-label { flex: 1 1 100%; }
}

/* Etat de la derniere composition de lots medias (en cours / echec). Jetons de
   theme uniquement : lisible sur les 8 themes. */
.lot-media-job {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 0.94em;
  line-height: 1.5;
}
.lot-media-job-ic { display: inline-flex; color: var(--accent); font-size: 1.1em; }
.lot-media-job--running .lot-media-job-ic i { animation: lot-media-spin 1.1s linear infinite; }
.lot-media-job--failed {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
}
.lot-media-job--failed .lot-media-job-ic { color: var(--danger); }
@keyframes lot-media-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .lot-media-job--running .lot-media-job-ic i { animation: none; }
}

.lot-item-banner {
  margin: -8px 0 20px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 183, 77, 0.10);
  border: 1px solid rgba(255, 183, 77, 0.25);
  color: var(--text-secondary);
}
.lot-item-banner strong {
  display: block;
  margin-bottom: 4px;
  color: #ffb74d;
  font-size: 1.05em;
}
.lot-item-banner p {
  margin: 0 0 6px;
  font-size: 0.92em;
  line-height: 1.5;
}
.lot-item-banner-link {
  color: #ffb74d;
  font-weight: 600;
  font-size: 0.92em;
}

.lot-card-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lot-media-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0.5;
}

.lot-detail-info {
  padding: 20px;
  margin-bottom: 20px;
}

.lot-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
}

.lot-detail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lot-detail-label {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lot-detail-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.lot-detail-description {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.lot-detail-description p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.lot-actions {
  padding: 20px;
  margin-bottom: 20px;
}

.lot-actions h2 {
  margin-bottom: 12px;
}

.lot-actions-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lot-dissolve-button {
  color: #e87c7c !important;
  border-color: rgba(232, 124, 124, 0.25) !important;
}

.lot-dissolve-button:hover {
  background: rgba(232, 124, 124, 0.1) !important;
}

.lot-composed-hero {
  aspect-ratio: auto;
  max-height: none;
  width: 100%;
  border-radius: 8px;
}

.lot-photos-section {
  margin-top: 8px;
}
.lot-photos-section h2 {
  margin-bottom: 14px;
}
.lot-photos-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lot-composed-photo {
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.lot-items-section {
  margin-top: 8px;
}

.lot-items-section h2 {
  margin-bottom: 14px;
}

.lot-item-card {
  text-decoration: none;
}

.lot-item-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.lot-item-link:hover {
  text-decoration-color: var(--accent);
}

.lot-remove-form {
  display: inline;
}

.lot-remove-badge {
  cursor: pointer;
  border: none;
  font: inherit;
  color: #e87c7c;
  background: rgba(232, 124, 124, 0.1);
  transition: background 0.15s;
}

.lot-remove-badge:hover {
  background: rgba(232, 124, 124, 0.2);
}

.lot-badge-link {
  cursor: pointer;
  transition: opacity 0.15s;
}

.lot-badge-link:hover {
  opacity: 0.8;
}

.lot-hero-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
  aspect-ratio: 1;
  max-width: 400px;
  margin: 0 auto;
}

.lot-hero-thumb {
  border-radius: 14px;
  overflow: hidden;
  background: var(--hover-2);
  aspect-ratio: 1;
}

.lot-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lot-hero-thumb .media-fallback {
  width: 100%;
  height: 100%;
  min-height: unset;
  border-radius: 0;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lot-hero-more {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-photo-card:has(.lot-hero-mosaic) {
  position: relative;
}

.confirm-modal-card-wide {
  max-width: 520px;
  width: 90vw;
}

.lot-add-results {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  margin: 12px 0 0;
  padding: 2px;
}

.lot-add-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 4px 2px;
}

.lot-add-loading {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.lot-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  transition: background 0.15s;
}

.lot-add-row:hover {
  background: var(--hover);
}

.lot-add-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  min-height: 0;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #281515;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.lot-add-btn:hover {
  opacity: 0.85;
}

.lot-add-row-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hover);
}

.lot-add-row-thumb-empty {
  border: 1px dashed var(--line);
}

.lot-add-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.lot-add-row-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.lot-add-row-info .muted {
  font-size: 0.8rem;
}

.lot-add-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.lot-edit-fields {
  display: grid;
  gap: 14px;
  padding: 8px 0 16px;
}

.lot-edit-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.lot-edit-label .input {
  font-size: 1rem;
}

/* Lots 2026 — espace de pilotage au standard Achflow actuel. */
.lots-workspace {
  width: 100%;
  min-width: 0;
  container-type: inline-size;
}

.lots-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.lots-head-copy h1 {
  margin: 2px 0 4px;
  font-size: clamp(1.75rem, 3cqi, 2.45rem);
  letter-spacing: -0.035em;
}

.lots-head-copy p {
  margin: 0;
  color: var(--muted);
}

.lots-eyebrow,
.lot-flow-kind {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lots-create-button {
  flex: 0 0 auto;
}

.lots-command-center {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.lots-command-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
}

.lots-command-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lots-command-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.lots-command-actions,
.lot-flow-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.lots-command-actions form,
.lot-flow-actions form {
  margin: 0;
}

.lots-command-actions .button,
.lot-flow-actions .button {
  white-space: nowrap;
}

.lots-target-settings {
  border-top: 1px solid var(--line);
}

.lots-target-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.lots-target-settings summary::-webkit-details-marker {
  display: none;
}

.lots-target-settings summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lots-target-settings summary strong {
  color: var(--text);
}

.lots-target-settings form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 18px 16px;
}

.lots-target-settings form > label {
  color: var(--muted);
  font-size: 0.86rem;
}

.lots-target-settings form > p {
  flex: 1 1 280px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.lot-stage-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 14px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  scrollbar-width: none;
}

.lot-stage-tabs::-webkit-scrollbar {
  display: none;
}

.lot-stage-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.lot-stage-tab:hover {
  color: var(--text);
  background: var(--hover);
}

.lot-stage-tab.is-active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 11%, var(--panel));
}

.lot-stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.lot-stage-tab.is-active .lot-stage-dot {
  color: var(--accent);
  opacity: 1;
}

.lot-stage-tab b {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 10%, transparent);
  text-align: center;
  font-size: 0.8rem;
}

.lots-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.lots-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--muted);
}

.lots-search:focus-within {
  border-color: var(--accent);
}

.lots-search input {
  width: 100%;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.lots-status-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lots-status-filter > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.lots-list {
  display: grid;
  gap: 9px;
}

.lot-flow-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(150px, auto);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.lot-flow-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 3%, var(--panel));
  transform: translateY(-1px);
}

.lot-flow-media {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
  color: var(--muted);
}

.lot-flow-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lot-flow-media .lot-media-fallback {
  font-size: 1.45rem;
}

.lot-flow-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.lot-flow-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.lot-flow-title-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lot-flow-title {
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  text-overflow: ellipsis;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}

.lot-flow-title:hover {
  color: var(--accent);
}

.lot-state-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.lot-state-badge--review {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 45%, var(--line));
  background: color-mix(in srgb, var(--warning) 10%, var(--panel));
}

.lot-state-badge--active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
}

.lot-state-badge--sold {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 45%, var(--line));
  background: color-mix(in srgb, var(--success) 9%, var(--panel));
}

.lot-flow-facts {
  display: flex;
  align-items: center;
  gap: 7px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.lot-flow-facts > span,
.lot-flow-live,
.lot-flow-progress {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lot-flow-facts strong {
  color: var(--text);
}

.lot-flow-locations {
  color: var(--text);
}

.lot-flow-warning {
  color: var(--warning);
}

.lot-flow-error {
  display: flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}

.lot-flow-error i {
  flex: 0 0 auto;
}

.lot-flow-error span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lot-flow-next {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 0.82rem;
}

.lot-flow-next span {
  flex: 0 0 auto;
  color: var(--muted);
}

.lot-flow-next strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lot-flow-progress {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}

.lot-flow-progress i,
.lot-media-job--running i {
  animation: lot-media-spin 1.1s linear infinite;
}

.lot-flow-live {
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 700;
}

/* Choix du canal de publication d'un lot : les boutons se placent cote a
   cote sur PC et passent l'un sous l'autre des que la place manque (fiche
   lot en colonne etroite, et telephone). */
.lot-flow-publish-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lot-flow-publish-choices form {
  flex: 1 1 auto;
  min-width: 0;
}

.lot-flow-publish-choices .button {
  width: 100%;
}

.lot-flow-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 6px;
}

.lots-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 52px 24px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
}

.lots-empty h2,
.lots-empty p {
  margin: 0;
}

.lots-empty p {
  color: var(--muted);
}

.lots-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
  font-size: 1.4rem;
}

@container (max-width: 920px) {
  .lots-command-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .lots-command-actions {
    justify-content: flex-start;
  }

  .lots-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .lots-status-filter {
    display: none;
  }

  .lot-flow-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .lot-flow-media {
    width: 76px;
    height: 76px;
  }

  .lot-flow-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .lots-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .lots-create-button {
    width: 100%;
  }

  .lots-command-center {
    border-radius: 15px;
  }

  .lots-command-main {
    padding: 14px;
  }

  .lots-command-actions,
  .lots-command-actions form,
  .lots-command-actions .button {
    width: 100%;
  }

  .lots-target-settings summary {
    padding-inline: 14px;
  }

  .lots-target-settings form {
    align-items: stretch;
    padding-inline: 14px;
  }

  .lots-target-settings form .button {
    flex: 1;
  }

  .lot-stage-tabs {
    margin-inline: -4px;
    border-radius: 13px;
  }

  .lot-stage-tab {
    min-height: 39px;
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .lots-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px;
  }

  .lots-toolbar > .button {
    min-width: 0;
    padding-inline: 12px;
  }

  .lot-flow-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 15px;
  }

  .lot-flow-media {
    align-self: start;
    width: 64px;
    height: 64px;
    border-radius: 11px;
  }

  .lot-flow-title-row {
    display: grid;
    gap: 6px;
  }

  .lot-flow-title {
    white-space: normal;
  }

  .lot-state-badge {
    justify-self: start;
  }

  .lot-flow-next {
    display: grid;
    gap: 2px;
  }

  .lot-flow-next strong {
    white-space: normal;
  }

  .lot-flow-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lot-flow-actions form,
  .lot-flow-actions .button {
    width: 100%;
  }

  .lot-flow-actions > :only-child {
    grid-column: 1 / -1;
  }
}

.button-danger-ghost {
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--panel));
}

.button-danger-ghost:hover {
  background: color-mix(in srgb, var(--danger) 13%, var(--panel));
}

.lot-detail-workspace {
  width: 100%;
  min-width: 0;
  container-type: inline-size;
}

.lot-detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 16px;
}

.lot-detail-head-copy {
  min-width: 0;
}

.lot-detail-head-copy > p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lot-detail-title-line {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  margin-top: 13px;
}

.lot-detail-title-line > div {
  min-width: 0;
}

.lot-detail-title-line h1 {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: clamp(1.65rem, 3.2cqi, 2.45rem);
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lot-detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.lot-detail-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.lot-detail-visual,
.lot-next-panel,
.lot-facts-panel,
.lot-market-panel,
.lot-jobs-fold {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.lot-detail-visual {
  display: grid;
  place-items: center;
  min-height: 360px;
  overflow: hidden;
  padding: 12px;
}

.lot-detail-visual .detail-gallery {
  width: 100%;
}

.lot-detail-main-photo {
  display: block;
  width: 100%;
  max-height: 560px;
  border-radius: 13px;
  object-fit: contain;
  background: var(--bg);
}

.lot-detail-photo-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
}

.lot-detail-photo-empty i {
  color: var(--accent);
  font-size: 2rem;
}

.lot-detail-photo-empty strong {
  color: var(--text);
}

.lot-next-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
  padding: 22px;
}

.lot-next-panel h2 {
  margin: 0;
  font-size: 1.35rem;
}

.lot-next-panel p,
.lot-next-panel small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lot-next-panel > form {
  margin: 0;
}

.lot-next-panel > form > .button,
.lot-next-panel .lot-validate-form .button {
  width: 100%;
}

.lot-next-panel .lot-validate-price {
  display: grid;
  gap: 8px;
}

.lot-next-panel .lot-validate-price-field {
  width: 100%;
}

.lot-next-panel .lot-validate-price-field .input {
  width: 100%;
}

.lot-detail-data {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 14px;
  margin-bottom: 22px;
}

.lot-facts-panel,
.lot-market-panel {
  padding: 18px;
}

.lot-panel-title,
.lot-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lot-panel-title {
  margin-bottom: 14px;
}

.lot-panel-title h2,
.lot-section-head h2 {
  margin: 0;
}

.lot-panel-title > span,
.lot-section-head > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.lot-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.lot-facts-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.lot-facts-grid dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.lot-facts-grid dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.lot-description-fold {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.lot-description-fold summary {
  padding: 12px 0 0;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.lot-description-fold p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.lot-channel-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg);
}

.lot-channel-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
}

.lot-channel-row > div {
  display: grid;
  gap: 2px;
}

.lot-channel-row > div span,
.lot-channel-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.lot-channel-note {
  margin: 12px 0 0;
  line-height: 1.45;
}

.lot-contents {
  margin-bottom: 14px;
}

.lot-section-head {
  margin-bottom: 11px;
}

.lot-section-head > div {
  display: grid;
  gap: 3px;
}

.lot-content-list {
  display: grid;
  gap: 7px;
}

.lot-content-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(120px, auto) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.lot-content-photo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--bg);
  color: var(--muted);
}

.lot-content-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lot-content-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lot-content-copy > a {
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  text-overflow: ellipsis;
  font-weight: 750;
  white-space: nowrap;
}

.lot-content-copy > a:hover {
  color: var(--accent);
}

.lot-content-copy > div {
  display: flex;
  gap: 5px 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.lot-content-location {
  min-width: 0;
}

.lot-jobs-fold {
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
}

.lot-jobs-fold > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
}

.lot-jobs-fold > summary span {
  color: var(--muted);
}

.lot-jobs-fold .job-list {
  padding: 0 16px 16px;
}

@container (max-width: 940px) {
  .lot-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .lot-detail-head-actions {
    justify-content: flex-start;
  }

  .lot-detail-overview,
  .lot-detail-data {
    grid-template-columns: 1fr;
  }

  .lot-next-panel {
    order: -1;
  }

  .lot-facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lot-detail-title-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .lot-detail-title-line h1,
  .lot-detail-head-copy > p {
    white-space: normal;
  }

  .lot-detail-head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lot-detail-head-actions .button {
    width: 100%;
  }

  .lot-detail-overview,
  .lot-detail-data {
    gap: 10px;
  }

  .lot-detail-visual {
    min-height: 230px;
    padding: 8px;
  }

  .lot-next-panel,
  .lot-facts-panel,
  .lot-market-panel {
    padding: 15px;
    border-radius: 15px;
  }

  .lot-facts-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lot-content-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 8px;
  }

  .lot-content-photo {
    width: 52px;
    height: 52px;
  }

  .lot-content-location {
    grid-column: 2 / -1;
  }

  .lot-content-row .lot-remove-form {
    grid-column: 3;
    grid-row: 1;
  }
}

/* --- Lot review cards (reviews page) --- */
.lot-review-block {
  display: grid;
  gap: 12px;
}

.lot-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lot-review-items {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.lot-review-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--hover-2);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.lot-review-item-card:hover {
  background: var(--hover);
}

.lot-review-item-thumb {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hover);
}

.lot-review-item-thumb-empty {
  border: 1px dashed var(--line);
}

.lot-review-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.lot-review-item-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.lot-review-item-info .muted {
  font-size: 0.8rem;
}

.lot-review-dissolve-actions {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.lot-review-dissolve-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lot-review-dissolve-form .pricing-reason-input {
  flex: 1;
  max-width: 320px;
}


/* ── Statistics page ───────────────────────────────────────────────── */

.stats-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 10px;
}
/* Sous-ligne discrete des totaux de stock, sous le hero KPI. */
.stats-hero-substats {
  margin: 0 0 18px;
  font-size: 0.9rem;
  text-align: center;
}

.stats-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stats-kpi::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 0%, rgba(223,143,120,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.stats-kpi-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
}

.stats-kpi-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.stats-kpi-icon-value { background: rgba(242,179,106,0.14); }
.stats-kpi-icon-value svg { color: var(--accent-strong); }
.stats-kpi-icon-invest { background: rgba(138,168,191,0.14); }
.stats-kpi-icon-invest svg { color: var(--ink-blue); }
.stats-kpi-icon-margin { background: rgba(125,214,170,0.14); }
.stats-kpi-icon-margin svg { color: var(--success); }

.stats-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stats-kpi-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.stats-kpi-sub {
  font-size: 0.78rem;
}

.stats-kpi-gold { color: var(--accent-strong); }
.stats-kpi-green { color: var(--success); }
.stats-kpi-red { color: var(--danger); }

/* bar chart rows */
.stats-bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-bar-row {
  display: grid;
  /* Colonne montant en auto (etait 44px fige) : les gros montants type
     « 396 217,67 € » etaient coupes — flagrant depuis Inter (plus large). */
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 10px;
}

.stats-bar-label {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--hover);
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-bar-success { background: var(--success); }
.stats-bar-gold { background: var(--accent-strong); }
.stats-bar-muted { background: var(--muted); opacity: 0.6; }
.stats-bar-dim { background: var(--muted-2); }
.stats-bar-warning { background: var(--warning); }

.stats-bar-count {
  font-size: 0.88rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* marketplace cards */
.stats-mp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats-mp-card {
  background: var(--hover-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.stats-mp-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.stats-mp-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.84rem;
}

.stats-mp-big {
  font-size: 1.3rem;
  font-weight: 700;
}

/* metrics grid (IA, lots, jobs, reviews, activity) */
.stats-metrics {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.stats-metric {
  flex: 1;
  text-align: center;
  background: var(--hover-2);
  border-radius: 12px;
  padding: 12px 8px;
}

.stats-metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
}

.stats-metric-value small {
  font-size: 0.65em;
  color: var(--muted);
  font-weight: 400;
}

.stats-info-grid {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* --- KPIs de pilotage caisse --- */
.stats-pilotage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.stats-period-form { display: flex; align-items: center; gap: 8px; }
.stats-period-form label { color: var(--muted); font-size: 0.85rem; }
.stats-period-select {
  background: var(--hover-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  padding: 7px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}
.stats-block-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 14px 0 8px;
}
.stats-metrics-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.stats-metrics-wrap .stats-metric { min-width: 120px; }
.stats-metric-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.stats-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.stats-chip {
  background: var(--hover-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
}
.stats-chip strong { font-weight: 700; }

/* fréquentation par heure — mini bar chart */
.stats-freq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 110px;
  margin-top: 6px;
}
.stats-freq-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.stats-freq-bar {
  background: var(--accent-strong);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.stats-freq-bar.is-empty { background: var(--line); opacity: 0.5; }
.stats-freq-axis {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  font-size: 0.58rem;
  color: var(--muted);
}
.stats-freq-axis span { flex: 1; text-align: center; }

/* sales table */
.stats-sales-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-sales-table th {
  text-align: right;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 14px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.stats-sales-table th:first-child {
  text-align: left;
}

.stats-sales-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hover-2);
  vertical-align: top;
}

.stats-sales-ch {
  font-weight: 600;
  white-space: nowrap;
}

.stats-sales-cell {
  text-align: right;
}

.stats-sales-count {
  font-weight: 700;
  font-size: 1.05rem;
}

.stats-sales-rev {
  font-size: 0.8rem;
  margin-top: 1px;
}

.stats-sales-net {
  font-size: 0.72rem;
  margin-top: 1px;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.stats-sales-table tfoot td {
  border-top: 1px solid var(--line);
  border-bottom: none;
  padding-top: 12px;
}

.stats-sales-table tfoot .stats-sales-count {
  font-size: 1.15rem;
}

/* Tendance vs fenêtre précédente (ligne Total, colonnes 7 j / 30 j) */
.stats-sales-trend {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
}

/* ── Courbe CA jour par jour (bloc Ventes par canal) ── */
.stats-daily {
  margin: 4px 0 18px;
}

.stats-daily-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 110px;
  margin-top: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.stats-daily-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
}

.stats-daily-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.85;
}

.stats-daily-bar.is-we {
  opacity: 0.5;
}

.stats-daily-col:hover .stats-daily-bar {
  opacity: 1;
}

.stats-daily-lbl {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 3px;
  font-size: 11px;
  white-space: nowrap;
}

.stats-daily-col:last-child .stats-daily-lbl {
  left: auto;
  right: 0;
}

/* ── Blocs secondaires repliables (fermés par défaut) ── */
details.stats-fold {
  margin: 0 0 14px;
}

details.stats-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
}

details.stats-fold > summary::-webkit-details-marker {
  display: none;
}

details.stats-fold > summary:hover {
  border-color: var(--accent);
}

.stats-fold-title {
  font-weight: 600;
  font-size: 1rem;
}

.stats-fold-chev {
  color: var(--muted);
  transition: transform 0.15s ease;
}

details.stats-fold[open] > summary .stats-fold-chev {
  transform: rotate(180deg);
}

details.stats-fold[open] > summary {
  margin-bottom: 12px;
}

/* panel header with link */
.stats-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.stats-panel-header h2 {
  margin: 0;
}

.stats-panel-link {
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 140ms;
}

.stats-panel-link:hover {
  color: var(--accent);
}

/* triple column layout */
.stats-triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

/* ── Statistics responsive ── */

@media (max-width: 1080px) {
  .stats-triple {
    grid-template-columns: 1fr 1fr;
  }
  .stats-triple > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .stats-hero {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .stats-hero {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stats-kpi {
    padding: 14px 12px;
  }
  .stats-kpi-value {
    font-size: 1.25rem;
  }
  .stats-triple {
    grid-template-columns: 1fr;
  }
  .stats-triple > :last-child {
    grid-column: auto;
  }
  .stats-bar-row {
    grid-template-columns: 90px 1fr auto;
    gap: 8px;
  }
  .stats-bar-label {
    font-size: 0.8rem;
  }
  .stats-mp-grid {
    grid-template-columns: 1fr;
  }
  .stats-metrics {
    flex-wrap: wrap;
  }
  .stats-metric {
    min-width: calc(50% - 4px);
  }
}

@media (max-width: 480px) {
  .stats-hero {
    grid-template-columns: 1fr;
  }
  .stats-metrics {
    flex-wrap: wrap;
  }
  .stats-metric {
    min-width: calc(50% - 4px);
  }
}

/* --- Respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============================================================
   Integration cards : logos cuivre + layout v2 (2026-05-12)
   ============================================================ */

.integration-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex: 0 0 auto;
  display: block;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.integration-logo-sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: 0 0 auto;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.integration-card-head.has-logo {
  align-items: center;
  gap: 14px;
}

.integration-card-head.has-logo .integration-card-title {
  flex: 1 1 auto;
  min-width: 0;
}

.integration-card-head.has-logo h2 {
  font-size: 1.15rem;
  line-height: 1.25;
}

.integration-status-card.has-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: auto;
  padding: 14px 16px;
}

.integration-status-card.has-logo .integration-status-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.integration-status-card.has-logo strong {
  font-size: .95rem;
}

.integration-status-card.has-logo .integration-badge {
  padding: 5px 10px;
  font-size: .75rem;
  box-shadow: none;
  border-radius: 999px;
  align-self: flex-start;
}

/* Carte de config un peu plus aeree */
.integrations-grid .integration-card {
  padding: 18px;
  transition: border-color .15s, transform .15s;
}

.integrations-grid .integration-card:hover {
  border-color: rgba(223, 143, 120, 0.45);
}

.integration-details > summary {
  cursor: pointer;
  padding: 8px 0;
  color: var(--muted);
  font-size: .9rem;
  list-style: none;
  user-select: none;
}

.integration-details > summary::-webkit-details-marker { display: none; }

.integration-details > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform .15s;
  margin-right: 4px;
}

.integration-details[open] > summary::before {
  transform: rotate(90deg);
}

.integration-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
  align-items: center;
}

.oauth-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.oauth-icon {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 3px;
  padding: 2px;
  box-sizing: content-box;
  flex: 0 0 auto;
}

/* ── Barre de chargement globale (#198) ────────────────────────────────────
   Feedback IMMEDIAT quand une navigation pleine page demarre (clic sur un lien
   interne, envoi de formulaire, rechargement) : une fine barre en haut de
   l'ecran qui progresse. Sans elle, sur mobile / reseau lent l'utilisateur ne
   voit RIEN pendant que la page charge et re-clique en boucle. Pilotee par
   base.js::initNavProgress (montre au depart, cachee au retour via pageshow).
   z-index au-dessus de tout (topbar, modales, toasts). Pilotee entierement en
   JS -> par defaut invisible (opacity 0), aucun impact sur les pages. */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10050;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.nav-progress.is-active {
  opacity: 1;
}
.nav-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent, #df8f78), var(--accent-strong, #f2b36a));
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent, #df8f78) 70%, transparent);
  transition: width .24s ease;
}
@media (prefers-reduced-motion: reduce) {
  .nav-progress-fill { transition: none; }
}

/* ── #338 (2026-07-13) — Animation festive « Nouvelle vente sur … », GLOBALE ──────────
   Déplacée de home.html vers ici pour qu'elle joue sur TOUTES les pages (le HTML +
   le JS sont dans base.html). Couleurs en dur (indépendantes du thème). L'overlay est
   rattaché au <body> par le JS (position:fixed = plein viewport). */
.hm-sale-cel{ position:fixed; inset:0; z-index:5000; display:flex; align-items:center; justify-content:center; background:rgba(10,12,26,.72); backdrop-filter:blur(3px); opacity:0; pointer-events:none; transition:opacity .25s ease; }
.hm-sale-cel.is-on{ opacity:1; pointer-events:auto; }
.hm-sale-cel[hidden]{ display:none; }
.hm-sale-confetti{ position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.hm-sale-piece{ position:absolute; top:-24px; width:10px; height:13px; opacity:0; will-change:transform; }
.hm-sale-card{ position:relative; z-index:2; display:flex; flex-direction:column; align-items:center; text-align:center; padding:28px 26px; }
.hm-sale-guy{ transform-origin:center bottom; }
.hm-sale-cel.is-on .hm-sale-guy{ animation:hm-sale-jump 1.15s ease-out; }
.hm-sale-cel.is-on .hm-sale-arm-l{ animation:hm-sale-wave-l .42s ease-in-out 2; }
.hm-sale-cel.is-on .hm-sale-arm-r{ animation:hm-sale-wave-r .42s ease-in-out 2; }
.hm-sale-title{ margin-top:14px; font-size:32px; font-weight:800; color:#fff; letter-spacing:.3px; }
.hm-sale-cel.is-on .hm-sale-title{ animation:hm-sale-pop .5s ease-out; }
.hm-sale-amount{ margin-top:4px; font-size:50px; font-weight:800; color:#4ade80; line-height:1.05; }
.hm-sale-cel.is-on .hm-sale-amount{ animation:hm-sale-pop .6s ease-out .08s backwards; }
.hm-sale-meta{ margin-top:12px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:center; max-width:90vw; }
.hm-sale-item{ font-size:15px; color:#cdd0e0; }
.hm-sale-badge{ font-size:12px; font-weight:700; padding:4px 11px; border-radius:20px; }
.hm-sale-hint{ margin-top:18px; font-size:12px; color:#8a8fa8; }
@keyframes hm-sale-jump{ 0%,100%{ transform:translateY(0) scale(1); } 20%{ transform:translateY(-26px) scale(1.04); } 45%{ transform:translateY(0) scale(.97); } 60%{ transform:translateY(-12px) scale(1.02); } }
@keyframes hm-sale-wave-l{ 0%,100%{ transform:rotate(0); } 50%{ transform:rotate(-22deg); } }
@keyframes hm-sale-wave-r{ 0%,100%{ transform:rotate(0); } 50%{ transform:rotate(22deg); } }
@keyframes hm-sale-pop{ 0%{ transform:scale(.3); opacity:0; } 60%{ transform:scale(1.14); opacity:1; } 100%{ transform:scale(1); opacity:1; } }
@keyframes hm-sale-fall{ 0%{ transform:translateY(-24px) rotate(0); opacity:1; } 100%{ transform:translateY(102vh) rotate(560deg); opacity:.85; } }
@media (prefers-reduced-motion:reduce){
  .hm-sale-cel.is-on .hm-sale-guy,
  .hm-sale-cel.is-on .hm-sale-arm-l,
  .hm-sale-cel.is-on .hm-sale-arm-r,
  .hm-sale-cel.is-on .hm-sale-title,
  .hm-sale-cel.is-on .hm-sale-amount{ animation:none; }
  .hm-sale-piece{ display:none; }
}

/* ── Écran « Bonjour » du matin (demande Philippe 2026-07-28) ──────────────
   À la 1re connexion de la journée : overlay plein écran calqué sur
   l'animation « Nouvelle vente » ci-dessus. Le fond, le pop et les confettis
   RÉUTILISENT les classes hm-sale-* (l'élément #bj-cel porte aussi la classe
   hm-sale-cel) → aucune nouvelle couleur ici, uniquement la police Lobster
   (self-host, comme Inter) et les tailles géantes.
   HTML + JS : base.html (#bj-cel). */
@font-face {
  font-family: "Lobster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/lobster-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "Lobster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/lobster-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0;
}
.bj-cel .hm-sale-card{ max-width: 1100px; padding: 28px 34px; }
.bj-title{
  font-family: "Lobster", "Inter", cursive;
  font-weight: 400;
  font-size: 96px;
  line-height: 1.12;
  letter-spacing: 0;
}
.bj-msg{
  font-family: "Lobster", "Inter", cursive;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.3;
}
.bj-msg[hidden]{ display: none; }
@media (max-width: 700px){
  .bj-cel .hm-sale-card{ padding: 20px 16px; }
  .bj-title{ font-size: 52px; }
  .bj-msg{ font-size: 30px; }
}

/* ============================================================
   auto-echelle-0714 — adaptation automatique a la taille d'ecran
   (regle Philippe 14/07 : l'interface s'auto-ajuste du portable 17"
   au moniteur 32", sans largeur figee, sans qu'on ait a le demander).

   Principe : au-dela de ~1920px de fenetre, TOUT est agrandi
   progressivement via `zoom` (texte, boutons, espaces, images) —
   l'equivalent du reglage d'echelle de Windows, mais automatique.
   L'app a ete dessinee pour ~1280-1920px : sur 2560px l'ecran est
   traite comme un 2100px agrandi de 22%, au lieu d'une colonne
   etroite perdue au milieu. En dessous de 2040px, rien ne change
   (les max-width existants s'adaptent deja vers le bas, et le
   mobile a sa propre declinaison).

   - Les media queries se calculent sur la LARGEUR DE FENETRE
     (non affectee par zoom) : pas de boucle de retroaction.
   - `zoom` est standardise : Chrome/Edge, Firefox 126+, Safari.
   - Impression (tickets, etiquettes, factures) : echelle forcee a 1.
   - Kill-switch : classe `no-autozoom` sur <html>.
   ============================================================ */
:root { --af-autozoom: 1; }
@media (min-width: 2040px) { :root { --af-autozoom: 1.1; } }
@media (min-width: 2400px) { :root { --af-autozoom: 1.22; } }
@media (min-width: 2880px) { :root { --af-autozoom: 1.35; } }
@media (min-width: 3400px) { :root { --af-autozoom: 1.5; } }
html:not(.no-autozoom) { zoom: var(--af-autozoom); }
@media print { html { zoom: 1 !important; } }

/* ═══════════ Aperçu photo unifié #352 (survol PC / tap mobile) ═══════════
   Piloté par img_zoom.js sur tout élément [data-imgzoom]. Jetons de thème
   uniquement (fond/bordure/ombre/voile) → tient sur les 8 thèmes. Géométrie
   dans app.css (render-blocking) pour éviter le FOUC (ui_pitfalls §8). */
.imgzoom-pop {
  position: fixed;
  left: -9999px;
  top: -9999px;
  z-index: 10050;
  pointer-events: none;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 130ms ease;
}
.imgzoom-pop.is-visible { opacity: 1; }
.imgzoom-pop img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(400px, 44vw);
  max-height: min(440px, 72vh);
  border-radius: 10px;
}
.imgzoom-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 140ms ease;
}
/* le [hidden] doit vraiment cacher malgré le display:flex auteur */
.imgzoom-lightbox[hidden] { display: none; }
.imgzoom-lightbox.is-visible { opacity: 1; }
.imgzoom-lightbox img {
  max-width: 96vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
@media (hover: hover) and (pointer: fine) {
  [data-imgzoom]:not([data-imgzoom-mode="tap"]) { cursor: zoom-in; }
}

