/* ==========================================================================
   creapres — interface de la plateforme (charte FIP)
   ========================================================================== */

:root {
  --green-900: #043b36;
  --green-700: #0a564e;
  --green-500: #49b29f;
  --green-200: #a9ddd4;
  --ink: #0e1413;
  --ink-2: #2a3331;
  --muted: #4e5856;
  --muted-2: #7c8583;
  --line: rgba(4, 59, 54, 0.1);
  --line-soft: rgba(4, 59, 54, 0.06);
  --bg: #ffffff;
  --bg-soft: #f7f7f6;
  --dark: #0b100f;
  --danger: #bb274b;
  --font: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;
  --shadow-card: 0 2px 8px rgba(4, 59, 54, 0.05);
  --shadow-lift: 0 18px 40px rgba(4, 59, 54, 0.12);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 0.18s;
  --dur-mid: 0.32s;
  --topbar: 96px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--green-900); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--green-500); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
::selection { background: var(--green-200); }
:focus-visible { outline: 2px solid var(--green-500); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */

.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; }
.h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.1; letter-spacing: -0.025em; font-weight: 600; }
.h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.lead { font-size: 16px; font-weight: 300; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.accent { color: var(--green-500); }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding-inline: 22px; border-radius: var(--r-pill);
  background: var(--green-900); color: #fff; font-size: 15px; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.btn:hover { background: var(--green-500); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--sm { height: 40px; padding-inline: 14px; font-size: 13px; }
.btn--light { background: #fff; color: var(--green-900); box-shadow: inset 0 0 0 1px var(--line); }
.btn--light:hover { background: var(--green-200); color: var(--green-900); }
.btn--ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: #fff; color: var(--green-900); }
.btn--danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(187, 39, 75, 0.3); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-pill); background: var(--bg-soft); color: var(--green-900); font-size: 18px; }
.btn--icon:hover { background: var(--green-200); }
.btn svg { width: 18px; height: 18px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--green-900); }
.link-arrow::after { content: "›"; transition: transform var(--dur-fast) var(--ease-out); }
.link-arrow:hover::after { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Champs (16 px minimum : pas de zoom automatique sur mobile)
   -------------------------------------------------------------------------- */

.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-2); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: #fff; color: var(--ink); font: inherit; font-size: 16px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(73, 178, 159, 0.18); }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234e5856' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green-900); margin: 0; }
.hint { font-size: 13px; color: var(--muted-2); }
.form-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.error { padding: 12px 16px; border-radius: var(--r-sm); background: rgba(187, 39, 75, 0.08); color: var(--danger); font-size: 14px; }

/* Interrupteur */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 42px; height: 24px; border-radius: var(--r-pill); background: rgba(4, 59, 54, 0.15); position: relative; transition: background var(--dur-mid) var(--ease-out); flex: 0 0 auto; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform var(--dur-mid) var(--ease-out); }
.switch input:checked + .switch__track { background: var(--green-500); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--green-500); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   Barre du haut et conteneurs
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40; min-height: var(--topbar);
  background: rgba(255, 255, 255, 0.82); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner { display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 10px 12px; min-height: var(--topbar); max-width: 1360px; margin: 0 auto; padding: 8px 16px; }
.topbar__logo img { height: 26px; width: auto; }
/* Sur écran étroit la navigation passe sur sa propre ligne et défile. */
.topbar__nav { order: 3; flex-basis: 100%; display: flex; align-items: center; gap: 16px; font-size: 13px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
.topbar__nav::-webkit-scrollbar { display: none; }
.topbar__nav a { white-space: nowrap; }
.topbar__nav a { position: relative; color: var(--ink-2); padding-block: 4px; }
.topbar__nav a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1.5px; background: var(--green-500); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-mid) var(--ease-out); }
.topbar__nav a:hover::after, .topbar__nav a[aria-current="page"]::after { transform: scaleX(1); }
.topbar__nav a[aria-current="page"] { color: var(--green-900); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px; border-radius: var(--r-pill); background: var(--bg-soft); font-size: 0; color: var(--ink-2); }
.user-pill .avatar { font-size: 13px; }
.avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green-900); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }

.container { max-width: 1360px; margin: 0 auto; padding: 24px 16px 60px; }
.container--narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .eyebrow { margin-bottom: 8px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 200px; }
.toolbar__spacer { flex: 1; }

.tabs { position: relative; display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(4, 59, 54, 0.06); }
.tabs button { position: relative; z-index: 1; height: 40px; padding-inline: 16px; border-radius: var(--r-pill); font-size: 13.5px; color: var(--muted); transition: color var(--dur-mid) var(--ease-out); }
.tabs button:hover { color: var(--green-900); }
.tabs button[aria-selected="true"] { color: var(--green-900); }

/* Curseur glissant commun aux .tabs et .seg */
.seg-pill { position: absolute; left: 0; top: 0; z-index: 0; border-radius: var(--r-pill); background: #fff; box-shadow: var(--shadow-card); pointer-events: none; opacity: 0; transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s; }
.seg-pill.is-instant { transition: none; }
.seg-pill.is-press { animation: seg-press 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes seg-press { 0% { scale: 1; } 35% { scale: 0.9 0.84; } 70% { scale: 1.04 1.06; } 100% { scale: 1; } }
.seg .seg-pill { border-radius: 7px; }
@media (prefers-reduced-motion: reduce) { .seg-pill { transition: none; animation: none !important; } }

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */

.card { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-card); padding: 24px; }
.card + .card { margin-top: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }

.pres {
  position: relative; display: flex; flex-direction: column; background: #fff; border-radius: var(--r-md);
  box-shadow: var(--shadow-card); transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out);
}
.pres:has(.menu.is-open) { z-index: 5; }
.pres:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.pres__cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(160deg, #05433d 0%, #043b36 55%, #063029 100%); overflow: hidden; display: block; border-radius: var(--r-md) var(--r-md) 0 0; }
.pres__cover img { width: 100%; height: 100%; object-fit: cover; }
.pres__cover-title { position: absolute; left: 20px; right: 20px; bottom: 18px; color: #fff; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.pres__cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 16, 15, 0) 40%, rgba(11, 16, 15, 0.7)); pointer-events: none; }
.pres__body { padding: 16px 18px 14px; display: grid; gap: 4px; }
.pres__title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pres__meta { font-size: 13px; color: var(--muted-2); display: flex; gap: 8px; flex-wrap: wrap; }
.pres__actions { display: flex; gap: 6px; padding: 0 12px 12px; margin-top: auto; }
.pres__actions .btn { flex: 0 0 auto; }
.pres__menu { margin-left: auto; }
.pres__menu .menu__list { top: auto; bottom: calc(100% + 6px); }
.pres.is-locked { opacity: 0.55; filter: grayscale(0.6); }
.pres.is-locked:hover { transform: none; box-shadow: var(--shadow-card); }
.pres__lock { position: absolute; top: 12px; left: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.94); color: var(--ink-2); font-size: 12px; }
.pres__lock svg { width: 13px; height: 13px; }
.pres__lock--mine { background: var(--green-200); color: var(--green-900); }
.badge { display: inline-flex; align-items: center; height: 22px; padding-inline: 9px; border-radius: var(--r-pill); background: var(--bg-soft); color: var(--ink-2); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.badge--green { background: var(--green-900); color: #fff; }
.badge--mint { background: var(--green-200); color: var(--green-900); }

.empty { padding: 56px 24px; text-align: center; color: var(--muted); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-card); }
.empty .h2 { margin-bottom: 8px; }

/* Menu contextuel */
.menu { position: relative; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; border-radius: var(--r-sm); background: #fff; box-shadow: var(--shadow-lift); display: none; }
.menu.is-open .menu__list { display: block; }
.menu__list button, .menu__list a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); text-align: left; }
.menu__list button:hover, .menu__list a:hover { background: var(--bg-soft); color: var(--green-900); }
.menu__list .is-danger { color: var(--danger); }
.menu__list hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; }

/* Présence */
.presence { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.presence__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.presence__names { display: flex; gap: 4px; }

/* --------------------------------------------------------------------------
   Fenêtres modales et notifications
   -------------------------------------------------------------------------- */

.modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-root.is-open { display: block; }
.modal-root__veil { position: absolute; inset: 0; background: rgba(11, 16, 15, 0.45); backdrop-filter: blur(4px); }
.modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 20px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-lift); animation: modal-in 0.32s var(--ease-out); }
.modal--wide { width: min(880px, calc(100vw - 32px)); }

.modal__body { display: grid; gap: 16px; }
/* Le pied reste au bas de la fenêtre, quelle que soit la longueur du
   formulaire : chercher « Enregistrer » en faisant défiler n'est pas une
   manière de travailler. Il déborde des marges de la fenêtre pour masquer
   proprement le contenu qui passe dessous, et se pose au-dessus du fond.
   Même règle pour le titre, en haut : on sait toujours où l'on est. */
.modal__foot {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  /* C'est le pied qui fournit la marge basse de la fenêtre, laquelle n'en a
     plus : sans quoi le collant s'arrête au-dessus et on aperçoit le
     formulaire passer dessous. */
  margin: 22px -20px 0; padding: 14px 20px 20px;
  background: #fff; box-shadow: 0 -1px 0 var(--line), 0 -10px 18px -12px rgba(4, 59, 54, 0.25);
}
.modal:has(.modal__foot) { padding-bottom: 0; }
.modal .h2 {
  position: sticky; top: -20px; z-index: 3;
  margin: -20px -20px 18px; padding: 20px 20px 12px;
  background: #fff;
}
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -48%); } }

.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 120; display: grid; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { padding: 11px 18px; border-radius: var(--r-pill); background: var(--dark); color: #fff; font-size: 14px; box-shadow: var(--shadow-lift); animation: toast-in 0.32s var(--ease-out); white-space: nowrap; }
.toast--error { background: var(--danger); }
.toast--success { background: var(--green-900); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------------------------------------------------------
   Zone de dépôt et envois
   -------------------------------------------------------------------------- */

.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; min-height: 130px; padding: 20px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--r-md); background: var(--bg-soft); color: var(--muted); font-size: 14px; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--green-500); background: rgba(73, 178, 159, 0.08); color: var(--green-900); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { font-weight: 600; color: var(--ink-2); }
.dropzone.is-disabled { pointer-events: none; opacity: 0.5; }

.uploads { display: grid; gap: 8px; margin-top: 10px; }
.upload { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.upload__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload__bar { grid-column: 1 / -1; height: 4px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.upload__bar span { display: block; height: 100%; width: 0; background: var(--green-500); transition: width 0.2s linear; }
.upload.is-done .upload__bar span { background: var(--green-900); }
.upload.is-error { color: var(--danger); }
.upload.is-error .upload__bar span { background: var(--danger); }

/* --------------------------------------------------------------------------
   Tableaux
   -------------------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); font-weight: 400; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: rgba(4, 59, 54, 0.18); margin-right: 8px; vertical-align: middle; }
.dot.is-on { background: var(--green-500); }

/* --------------------------------------------------------------------------
   Connexion
   -------------------------------------------------------------------------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%); position: relative; overflow: hidden; }
.auth::before { content: ""; position: absolute; left: 50%; top: -260px; width: min(1000px, 130vw); height: 640px; transform: translateX(-50%); border-radius: var(--r-pill); background: radial-gradient(ellipse at center, rgba(169, 221, 212, 0.55), rgba(169, 221, 212, 0) 65%); pointer-events: none; }
.auth__card { position: relative; width: min(420px, 100%); padding: 36px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-lift); display: grid; gap: 18px; }
.auth__logo { height: 32px; width: auto; margin-bottom: 8px; }
.auth__card .h2 { margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   Catalogue
   -------------------------------------------------------------------------- */

.catalogue { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
.side { position: static; top: calc(var(--topbar) + 24px); display: grid; gap: 12px; }
.side .card { padding: 14px; }
.side-list { display: grid; gap: 2px; }
.side-list button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); text-align: left; }
.side-list button:hover { background: var(--bg-soft); }
.side-list button[aria-current="true"] { background: var(--green-900); color: #fff; }
.side-list button[aria-current="true"] .count { background: rgba(255, 255, 255, 0.2); color: #fff; }
.count { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg-soft); color: var(--muted); }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.product-card { position: relative; background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-card); overflow: hidden; cursor: grab; transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out); }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.product-card:active { cursor: grabbing; }
.product-card__img { aspect-ratio: 1; background: var(--bg-soft); display: grid; place-items: center; color: var(--muted-2); font-size: 13px; }
.product-card__img img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: 12px 14px 14px; display: grid; gap: 2px; }
.product-card__title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card__desc { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity var(--dur-fast); }
.product-card:hover .product-card__tools, .product-card:focus-within .product-card__tools { opacity: 1; }
.product-card__tools button { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--ink-2); font-size: 14px; display: grid; place-items: center; box-shadow: var(--shadow-card); }
.product-card__tools button:hover { background: var(--green-900); color: #fff; }

/* --------------------------------------------------------------------------
   Éditeur
   -------------------------------------------------------------------------- */

.editor { display: grid; grid-template-rows: auto 1fr; height: auto; overflow: visible; }
.editor__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line-soft); }
.editor__bar .title-input { flex: 1 1 100%; order: 1; min-width: 120px; height: 40px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; background: transparent; }
/* Sur écran étroit la barre porte huit commandes : on les resserre pour
   qu'elles tiennent sur une ligne de moins. */
.editor__bar .btn--sm { padding-inline: 10px; font-size: 12.5px; }
.editor__bar .title-input:hover { border-color: var(--line); }
.editor__bar .title-input:focus { outline: none; border-color: var(--green-500); background: #fff; }
.editor__status { font-size: 12.5px; color: var(--muted-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.editor__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
.editor__status.is-saving::before { background: #efe43a; }
.editor__status.is-error::before { background: var(--danger); }
.editor__status.is-readonly::before { background: var(--muted-2); }
/* Une seule colonne par défaut. min-width: 0 est indispensable : sans lui la
   colonne s'étire à la largeur minimale de son contenu et déborde de l'écran. */
.editor__body { display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto auto; min-height: 0; }
.editor__body > * { min-height: 0; min-width: 0; }

.rail { overflow-x: auto; padding: 14px; background: var(--bg-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: row; gap: 10px; }
.rail-item { flex: 0 0 150px; }
.rail-add { margin-top: 0; flex: 0 0 auto; align-self: center; }
.rail-item { position: relative; display: grid; gap: 6px; padding: 6px; border-radius: 12px; cursor: pointer; transition: background var(--dur-fast); }
.rail-item:hover { background: rgba(4, 59, 54, 0.05); }
.rail-item.is-active { background: #fff; box-shadow: 0 0 0 2px var(--green-500); }
.rail-item.is-dragover { box-shadow: inset 0 3px 0 var(--green-500); }
.rail-item.is-dragging { opacity: 0.4; }
.rail-item__label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted-2); padding-inline: 2px; }
.rail-item__label b { color: var(--ink-2); font-weight: 600; }
.rail-add { margin-top: auto; display: grid; gap: 6px; }

.thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: var(--shadow-card); }
.thumb__scale { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; pointer-events: none; }

.stage-wrap { position: relative; display: grid; grid-template-rows: 1fr auto; background: #e9ebea; overflow: hidden; }
/* Empilé, l'aperçu n'a plus de hauteur propre : on lui en donne une, sinon il
   se réduit à quelques pixels et devient invisible. */
.stage { position: relative; display: grid; place-items: center; height: 44vh; min-height: 220px; padding: 12px; overflow: hidden; }
.stage__scale { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform: translate(-50%, -50%) scale(0.3); transform-origin: center; box-shadow: var(--shadow-lift); border-radius: 6px; overflow: hidden; background: #fff; }
.stage.is-over::after { content: "Déposer pour ajouter l'image"; position: absolute; inset: 24px; display: grid; place-items: center; border: 3px dashed var(--green-500); border-radius: 12px; background: rgba(73, 178, 159, 0.15); color: var(--green-900); font-size: 20px; font-weight: 600; pointer-events: none; }
.stage-nav { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px; font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, 0.6); }

/* Compte protégé : marqueur discret, visible des seuls comptes protégés */
.badge--shield { background: rgba(4, 59, 54, 0.08); color: var(--green-900); }
.log li.is-read { opacity: 0.55; }
.alert-sign { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; vertical-align: 1px; }
.log li.is-read .alert-sign { background: var(--muted-2); }

/* Avertissement de texte trop long, sous l'aperçu */
.stage-warn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(187, 39, 75, 0.1); color: var(--danger); font-size: 12px; }
.stage-warn::before { content: "!"; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; font-weight: 600; }

/* Diapos rendues dans l'éditeur : statiques, visibles, sans animation */
.editor .slide, .thumb .slide {
  position: absolute; left: 0; top: 0; transform: none; opacity: 1; visibility: visible; pointer-events: none; transition: none;
}
.editor .slide [data-reveal] { opacity: 1; transform: none; }

.panel { overflow: auto; background: #fff; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; }
.panel__section { padding: 18px 20px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 14px; }
.panel__section .h3 { display: flex; align-items: center; justify-content: space-between; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel .eyebrow { font-size: 11px; }
.seg { position: relative; display: grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg-soft); }
.seg button { position: relative; z-index: 1; height: 40px; border-radius: 7px; font-size: 13px; color: var(--muted); transition: color var(--dur-mid) var(--ease-out); }
.seg button:hover, .seg button[aria-pressed="true"] { color: var(--green-900); }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line-soft); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile__tools { position: absolute; inset: auto 4px 4px 4px; display: flex; justify-content: space-between; gap: 2px; opacity: 0; transition: opacity var(--dur-fast); }
.tile:hover .tile__tools { opacity: 1; }
.tile__tools button { width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--ink-2); font-size: 12px; display: grid; place-items: center; }
.tile__tools button:hover { background: var(--green-900); color: #fff; }
.tile__tools .del:hover { background: var(--danger); }

.drawer-toggle { display: inline-flex; align-items: center; gap: 8px; }
.catalogue-drawer { display: grid; gap: 10px; }
.catalogue-drawer .products { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.catalogue-drawer .product-card__body { padding: 8px 10px 10px; }
.catalogue-drawer .product-card__title { font-size: 12.5px; }
.catalogue-drawer .product-card__desc { display: none; }
.mini-product { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: var(--bg-soft); cursor: grab; }
.mini-product img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.mini-product span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-product:hover { background: var(--green-200); }

.banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff7d6; color: #6b5a00; font-size: 14px; border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.banner--danger { background: rgba(187, 39, 75, 0.08); color: var(--danger); }
.banner .btn { margin-left: auto; }

.versions { display: grid; gap: 6px; }
.versions button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--bg-soft); font-size: 14px; text-align: left; }
.versions button:hover { background: var(--green-200); }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-family: inherit; color: var(--muted); }

/* --------------------------------------------------------------------------
   Lecture plein écran : barre d'outils flottante
   -------------------------------------------------------------------------- */

/* Centrée en bas : c'est la seule zone libre sur toutes les pages. À gauche
   se trouve la signature de pied de page, à droite le folio et les flèches. */
.present-tools { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 60; display: flex; gap: 8px; transition: opacity 0.4s var(--ease-out); }
.present-tools.is-idle { opacity: 0; }
/* Pastille sombre et non translucide : la barre flotte au-dessus de pages qui
   sont tantôt vertes, tantôt noires, tantôt blanches. Du blanc translucide
   disparaissait complètement sur les pages produit. */
.present-tools .btn {
  height: 40px; background: rgba(4, 59, 54, 0.88); color: #fff; font-size: 13px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(4, 59, 54, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.present-tools .btn:hover { background: var(--green-500); color: #fff; }
@media print { .present-tools { display: none !important; } }

/* --------------------------------------------------------------------------
   Réglages
   -------------------------------------------------------------------------- */

.settings-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.values-editor { display: grid; gap: 10px; }
.values-editor .row { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; }
input[type="color"].input { padding: 4px; height: 46px; }
.stat { display: grid; gap: 2px; }
.stat__value { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; color: var(--green-900); }
.stat__label { font-size: 13px; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr; gap: 16px; }
.team-preview { width: 100%; aspect-ratio: 3 / 2; border-radius: var(--r-sm); object-fit: cover; background: var(--bg-soft); }
.log { display: grid; gap: 6px; font-size: 13px; }
.log li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.log time { color: var(--muted-2); flex: 0 0 120px; }

/* --------------------------------------------------------------------------
   Élargissements

   Tout ce qui précède décrit l'écran étroit : une colonne, cibles tactiles
   confortables, barre du haut sur deux lignes. Les règles ci-dessous n'ajoutent
   que ce qu'un écran plus large permet — jamais l'inverse.
   -------------------------------------------------------------------------- */

@media (min-width: 560px) {
  .user-pill { height: 34px; padding: 0 12px 0 4px; font-size: 13px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .values-editor .row { grid-template-columns: 1fr 80px 100px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .modal { padding: 28px; }
}

@media (min-width: 720px) {
  :root { --topbar: 56px; }

  /* La barre du haut retrouve une seule ligne */
  .topbar__inner { flex-wrap: nowrap; gap: 24px; padding-inline: 24px; }
  .topbar__nav { order: 0; flex-basis: auto; gap: 22px; font-size: 13.5px; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .topbar__nav span { display: inline; }

  .container { padding: 36px 24px 80px; }
  .form-row { grid-template-columns: 1fr 1fr; }

  /* Boutons et champs reviennent à leur taille de bureau */
  .btn { height: 40px; }
  .btn--sm { height: 34px; }
  .btn--icon { width: 40px; height: 40px; }
  .input, .select, .textarea { min-height: 42px; }
  .seg button { height: 32px; }
  .tabs button { height: 34px; }
  .topbar__inner { padding-block: 0; }
  .product-card__tools button { width: 30px; height: 30px; }
  .who-btn { height: 34px; }
  .editor__bar .title-input { height: 36px; }
}

@media (min-width: 900px) {
  .catalogue { grid-template-columns: 280px 1fr; }
  .side { position: sticky; }
  .settings-grid { grid-template-columns: 1fr 1fr; }

  /* L'éditeur passe en trois colonnes et tient dans la hauteur de l'écran */
  .editor { height: 100vh; height: 100dvh; overflow: hidden; }
  .editor__bar { flex-wrap: nowrap; height: var(--topbar); padding-block: 0; }
  .editor__bar .title-input { flex: 1 1 auto; order: 0; }
  .editor__bar .btn--sm { padding-inline: 14px; font-size: 13px; }
  .editor__body { grid-template-columns: 200px 1fr 340px; grid-template-rows: auto; }
  .rail { flex-direction: column; overflow: auto; border-right: 1px solid var(--line-soft); border-bottom: 0; }
  .rail-item { flex: 0 0 auto; }
  .rail-add { margin-top: auto; align-self: stretch; }
  .stage { height: auto; min-height: 0; padding: 24px; }
  .panel { border-left: 1px solid var(--line-soft); border-top: 0; }
}

@media (min-width: 1100px) {
  .editor__body { grid-template-columns: 236px 1fr 380px; }
}

/* --------------------------------------------------------------------------
   Temps réel : qui fait quoi, messagerie
   -------------------------------------------------------------------------- */

.who { position: relative; }
.who-btn { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; height: 40px; padding: 0 12px 0 6px; border-radius: var(--r-pill); background: var(--bg-soft); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.who-btn:hover { background: var(--green-200); }
.who-btn__avatars { display: inline-flex; }
.who-btn__avatars .avatar { box-shadow: 0 0 0 2px #fff; }
.who-btn__avatars .avatar + .avatar { margin-left: -6px; }
.avatar--me { background: var(--green-500); }
.who-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 280px; padding: 14px; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-lift); }
.who-pop .eyebrow { margin-bottom: 10px; }
.who-pop ul { display: grid; gap: 10px; }
.who-pop li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.3; }
.who-pop li .avatar { flex: 0 0 auto; }
.pres__lock--view { left: auto; right: 12px; background: rgba(255, 255, 255, 0.94); }

.chat-toggle { position: relative; }
.badge-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.chat-toggle .badge-count { position: absolute; top: -4px; right: -4px; }
.tabs .badge-count { vertical-align: middle; }

.chat { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(400px, 100vw); display: grid; grid-template-rows: auto 1fr auto auto; background: #fff; box-shadow: -18px 0 40px rgba(4, 59, 54, 0.12); animation: chat-in 0.32s var(--ease-out); }
@keyframes chat-in { from { transform: translateX(30px); opacity: 0; } }
.chat__head { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line-soft); }
.chat__head .h3 { flex: 1; }
.chat__title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.chat__title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__body { overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-soft); }
.conv-group { display: grid; gap: 4px; }
.conv-group + .conv-group { margin-top: 10px; }
.conv-group .eyebrow { margin: 4px 0 6px; }
.conv { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-card); text-align: left; transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out); }
.conv:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.conv--person { background: transparent; box-shadow: none; }
.conv--person:hover { background: #fff; }
.conv__avatar { width: 40px; height: 40px; font-size: 13px; flex: 0 0 auto; }
.conv__avatar--team { background: var(--green-500); }
.conv__avatar--pres { background: var(--green-700); font-size: 18px; }
.conv__avatar--group { background: var(--ink-2); }
.conv__text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.conv__name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__last { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__time { font-size: 11.5px; color: var(--muted-2); flex: 0 0 auto; }
.conv-people { margin-top: 4px; }
.member-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; max-height: 240px; overflow: auto; padding: 4px 0; }
.chat__msg { position: relative; display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.chat__msg.is-mine { align-self: flex-end; }
.chat__msg.is-new { animation: msg-in 0.4s var(--ease-out); }
@keyframes msg-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
.chat__msg .avatar { flex: 0 0 auto; margin-bottom: 2px; }
.chat__bubble { position: relative; display: grid; gap: 3px; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: #fff; box-shadow: var(--shadow-card); font-size: 14.5px; line-height: 1.4; }
.chat__msg.is-mine .chat__bubble { border-radius: 16px 16px 4px 16px; background: var(--green-900); color: #fff; }
.chat__msg.is-mine .chat__bubble a { color: var(--green-200); }
.chat__meta { font-size: 11.5px; color: var(--muted-2); }
.chat__msg.is-mine .chat__meta { color: rgba(255, 255, 255, 0.6); }
.chat__text { word-break: break-word; }
.chat__deleted { color: var(--muted-2); }
.chat__msg.is-mine .chat__deleted { color: rgba(255, 255, 255, 0.6); }
.chat__msg.is-deleted .chat__bubble { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.chat__del { position: absolute; left: -30px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--muted); font-size: 14px; box-shadow: var(--shadow-card); opacity: 0; transition: opacity var(--dur-fast); }
.chat__msg:hover .chat__del { opacity: 1; }
.chat__del:hover { background: var(--danger); color: #fff; }
.chat__empty { margin: auto; text-align: center; color: var(--muted-2); font-size: 14px; }
.chat__more { align-self: center; }
.chat__typing { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 12.5px; color: var(--muted); background: var(--bg-soft); animation: msg-in 0.3s var(--ease-out); }
.typing-dots { display: inline-flex; gap: 3px; padding: 6px 8px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-card); }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); animation: typing 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
.chat__form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line-soft); }
.chat__form .textarea { min-height: 46px; max-height: 140px; resize: none; }
.chat__form .btn { width: 46px; padding: 0; flex: 0 0 auto; }
@media (prefers-reduced-motion: reduce) { .chat, .chat__msg.is-new, .chat__typing, .typing-dots i { animation: none; } }

/* --------------------------------------------------------------------------
   Avatars photo, sélecteur de produits, options repliées
   -------------------------------------------------------------------------- */

.avatar--img { overflow: hidden; background: var(--bg-soft); }
.avatar--img img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xl { width: 72px; height: 72px; font-size: 24px; flex: 0 0 auto; }
.avatar--inline { display: inline-grid; vertical-align: middle; }
.group-avatar { display: flex; align-items: center; gap: 16px; }

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; padding: 4px; }
.pick { position: relative; display: grid; gap: 6px; padding: 6px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow var(--dur-fast), transform var(--dur-mid) var(--ease-out); }
.pick:hover { transform: translateY(-2px); }
.pick.is-on { box-shadow: inset 0 0 0 2px var(--green-500); background: rgba(73, 178, 159, 0.08); }
.pick input { position: absolute; top: 10px; left: 10px; width: 18px; height: 18px; accent-color: var(--green-900); margin: 0; z-index: 1; }
.pick__img { aspect-ratio: 1; border-radius: 8px; background: var(--bg-soft); overflow: hidden; display: block; }
.pick__img img { width: 100%; height: 100%; object-fit: cover; }
.pick__title { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 2px; }

.wizard-steps { display: flex; gap: 8px; margin-bottom: 4px; }
.wizard-steps span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); padding: 4px 10px; border-radius: var(--r-pill); background: var(--bg-soft); }
.wizard-steps span.is-on { background: var(--green-900); color: #fff; }

details.more { border-top: 1px solid var(--line-soft); padding-top: 12px; }
details.more summary { cursor: pointer; font-size: 13px; color: var(--green-900); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "›"; display: inline-block; transition: transform var(--dur-fast); }
details.more[open] summary::before { transform: rotate(90deg); }
details.more > div { display: grid; gap: 14px; margin-top: 14px; }

.chat__msg.is-gone { transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); opacity: 0; transform: translateY(-6px) scale(0.96); }
.chat__head .conv__avatar { width: 36px; height: 36px; font-size: 12px; }

/* Lignes produit dans le panneau de l'éditeur */
.prow { cursor: grab; display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: 12px; background: var(--bg-soft); }

/* Bandeau d'images du produit : jusqu'à quatre vignettes, plus le bouton d'ajout */
.prow__imgs { display: flex; flex-direction: column; gap: 4px; }
.pimg { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #fff; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-soft); font-size: 11px; color: var(--muted-2); }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.pimg__del { position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--danger); font-size: 13px; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-card); opacity: 0; transition: opacity var(--dur-fast); }
.pimg:hover .pimg__del, .pimg__del:focus-visible { opacity: 1; }
.pimg--add { cursor: pointer; background: #fff; color: var(--green-900); font-size: 20px; box-shadow: inset 0 0 0 1.5px var(--line); }
.pimg--add:hover { background: var(--green-200); }
.pimg--add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pimg--full, .pimg--none { background: transparent; box-shadow: inset 0 0 0 1px var(--line-soft); }
.prow__fields { display: grid; gap: 6px; min-width: 0; }
.prow__fields .input, .prow__fields .textarea { min-height: 40px; padding: 8px 10px; font-size: 16px; }
.prow__fields .textarea { min-height: 64px; }
.prow__tools { display: grid; gap: 4px; }
.prow__tools .btn--icon { width: 30px; height: 30px; font-size: 14px; background: #fff; }
.prow__tools .del:hover { background: var(--danger); color: #fff; }
.prow__tools .is-flat { background: transparent; box-shadow: none; color: var(--green-500); cursor: default; }
.pill-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding-inline: 5px; border-radius: 999px; background: var(--green-500); color: #fff; font-size: 11px; font-weight: 600; }
.rail-add { display: grid; gap: 6px; }
.panel .seg { grid-auto-columns: 1fr; }

/* --------------------------------------------------------------------------
   Mouvement de l'interface : entrées, sorties, transitions
   -------------------------------------------------------------------------- */

/* Boutons : légère pression */
.btn { transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast); }
.btn:active { transform: scale(0.96); }
.btn--icon:active { transform: scale(0.9); }

/* Modales : entrée et sortie */
.modal-root__veil { opacity: 0; transition: opacity 0.26s var(--ease-out); }
.modal-root.is-open .modal-root__veil { opacity: 1; }
.modal-root.is-closing .modal-root__veil { opacity: 0; }
.modal { animation: modal-in 0.36s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); } }
.modal-root.is-closing .modal { animation: modal-out 0.22s var(--ease-out) forwards; }
@keyframes modal-out { to { opacity: 0; transform: translate(-50%, -48%) scale(0.97); } }
.modal .field, .modal .pick, .modal .check { animation: rise 0.4s var(--ease-out) both; }
.modal .field:nth-child(2) { animation-delay: 0.04s; }
.modal .field:nth-child(3) { animation-delay: 0.08s; }
.modal .field:nth-child(4) { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Toasts : sortie */
.toast { transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out); }
.toast.is-leaving { opacity: 0; transform: translateY(8px) scale(0.98); }

/* Menus contextuels */
.menu__list { transform-origin: bottom right; animation: pop 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pres__menu .menu__list { transform-origin: bottom right; }
.who-pop { transform-origin: top right; animation: pop 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(4px); } }

/* Cartes du tableau de bord et du catalogue : apparition en cascade */
.pres.is-in, .product-card.is-in { animation: card-in 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } }

/* Pages de l'application : fondu à l'arrivée */
.container { animation: page-in 0.4s var(--ease-out); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* Zone de dépôt : respiration au survol d'un fichier */
.dropzone { transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-mid) var(--ease-out); }
.dropzone.is-over { transform: scale(1.015); animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 6px rgba(73, 178, 159, 0.14); } }

/* Barres d'envoi */
.upload { animation: rise 0.3s var(--ease-out); }
.upload.is-done .upload__bar span { animation: flash 0.6s var(--ease-out); }
@keyframes flash { 0% { filter: brightness(1.6); } }

/* Bandeau de verrou */
.banner { animation: banner-in 0.36s var(--ease-out); }
@keyframes banner-in { from { opacity: 0; transform: translateY(-8px); } }

/* Éditeur : scène à deux calques pour la transition entre pages */
.stage__layer { position: absolute; inset: 0; transition: opacity 0.42s var(--ease-out), transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
.stage__layer.is-entering { opacity: 0; transform: scale(0.985); }
.stage__layer.is-entering.from-right { transform: translateX(6%) scale(0.985); }
.stage__layer.is-entering.from-left { transform: translateX(-6%) scale(0.985); }
.stage__layer.is-leaving { opacity: 0; pointer-events: none; }
.stage__layer.is-leaving.to-left { transform: translateX(-6%) scale(0.985); }
.stage__layer.is-leaving.to-right { transform: translateX(6%) scale(0.985); }

/* Panneau : contenu qui monte à chaque changement de page */
.panel.is-fresh > * { animation: rise 0.4s var(--ease-out) both; }
.panel.is-fresh > *:nth-child(2) { animation-delay: 0.05s; }
.panel.is-fresh > *:nth-child(3) { animation-delay: 0.1s; }
.panel.is-fresh > *:nth-child(4) { animation-delay: 0.15s; }
.panel.is-fresh > *:nth-child(5) { animation-delay: 0.2s; }

/* Rail : sélection fluide, nouvelle page qui surgit */
.rail-item { transition: background var(--dur-fast), box-shadow var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out); }
.rail-item:hover { transform: translateY(-2px); }
.rail-item.is-new { animation: rail-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes rail-in { from { opacity: 0; transform: scale(0.9) translateY(10px); } }
.thumb { transition: box-shadow var(--dur-mid) var(--ease-out); }
.rail-item.is-active .thumb { box-shadow: var(--shadow-lift); }

/* Lignes produit et vignettes */
.prow { animation: rise 0.32s var(--ease-out); transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out), background var(--dur-fast); }
.prow.is-removing { opacity: 0; transform: translateX(12px) scale(0.98); }
.tile { animation: pop 0.3s var(--ease-out); }
.mini-product { transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.mini-product:hover { transform: translateX(3px); }

/* Messagerie : fermeture du panneau, changement de vue, lignes de conversation */
.chat.is-closing { animation: chat-out 0.26s var(--ease-out) forwards; }
@keyframes chat-out { to { transform: translateX(30px); opacity: 0; } }
.chat__body.is-swapping > * { animation: rise 0.34s var(--ease-out) both; }
.conv { animation: rise 0.34s var(--ease-out) both; }
.conv-group .conv:nth-child(2) { animation-delay: 0.03s; }
.conv-group .conv:nth-child(3) { animation-delay: 0.06s; }
.conv-group .conv:nth-child(4) { animation-delay: 0.09s; }
.conv-group .conv:nth-child(5) { animation-delay: 0.12s; }

/* Utilisateurs, journal, réglages */
.table tr { animation: rise 0.3s var(--ease-out) both; }
.log li { animation: rise 0.3s var(--ease-out) both; }
.switch__track { transition: background var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out); }
.switch input:active + .switch__track::after { width: 22px; }

@media (prefers-reduced-motion: reduce) {
  .modal, .toast, .menu__list, .who-pop, .pres.is-in, .product-card.is-in, .container, .upload, .banner, .stage__layer,
  .panel.is-fresh > *, .rail-item.is-new, .prow, .tile, .chat.is-closing, .chat__body.is-swapping > *, .conv, .table tr, .log li, .dropzone.is-over {
    animation: none !important; transition: none !important;
  }
}

/* Rappel des réglages d'impression (vue lecture, avant d'ouvrir la boîte) */
.print-help {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 16, 15, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.print-help__panel {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 28px;
  border-radius: var(--r-lg, 26px);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(4, 59, 54, 0.35);
}
.print-help__panel h2 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 8px; }
.print-help__intro { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.print-help__list { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: ph; }
.print-help__list li {
  display: grid; grid-template-columns: 1fr; gap: 4px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line-soft);
}
.print-help__list li:last-child { border-bottom: 0; padding-bottom: 0; }
.print-help__list b { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
.print-help__list span { font-size: 15px; }
.print-help__list em { font-style: normal; color: var(--danger); }
.print-help__skip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.print-help__foot { display: flex; justify-content: flex-end; gap: 10px; }

@media (min-width: 560px) {
  .print-help__list li { grid-template-columns: 170px 1fr; gap: 14px; align-items: baseline; }
}

@media print { .print-help { display: none !important; } }

/* Fenêtre « Ajouter au catalogue » : une ligne par produit hors catalogue */
.orows { display: grid; gap: 8px; max-height: 46vh; overflow: auto; padding-right: 4px; }
.orow { display: grid; grid-template-columns: auto 52px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--bg-soft); cursor: pointer; }
.orow.is-linked { background: rgba(73, 178, 159, 0.08); }
.orow.is-match { background: rgba(239, 228, 58, 0.14); }
.orow__state { display: grid; place-items: center; min-width: 22px; }
.orow .select { grid-column: 2 / -1; }
.orow:hover { background: rgba(4, 59, 54, 0.06); }
.orow__img { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: #fff; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--muted-2); }
.orow__img img { width: 100%; height: 100%; object-fit: cover; }
.orow__txt { display: grid; gap: 2px; min-width: 0; }
.orow__txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow__bulk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.select--sm { height: 34px; padding: 0 10px; font-size: 13px; }
.input--sm { height: 34px; padding: 0 10px; font-size: 14px; }
.newcol { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border-radius: 12px; background: var(--bg-soft); margin-bottom: 8px; }
.field__row { display: flex; gap: 8px; align-items: center; }
.field__row .select { flex: 1; min-width: 0; }

/* Film de la page de clôture, dans le panneau de l'éditeur */
.film-edit { display: grid; gap: 10px; }
.film-edit__preview { position: relative; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--muted-2); font-size: 13px; }
.film-edit__preview img { width: 100%; height: 100%; object-fit: cover; }
.film-edit__preview.is-empty { aspect-ratio: auto; min-height: 70px; }
.film-edit__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.film-edit__tools .btn { flex: 1 1 auto; }

/* Prix et promotion dans la ligne produit du panneau */
.prow__price { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prow__price .input { flex: 1 1 90px; min-width: 0; }
.switch--sm { gap: 8px; font-size: 12.5px; flex: 0 0 auto; }
.switch--sm .switch__track { width: 34px; height: 20px; }
.switch--sm .switch__track::after { width: 14px; height: 14px; }
.switch--sm input:checked + .switch__track::after { transform: translateX(14px); }

/* --------------------------------------------------------------------------
   Barre de mise en forme des textes

   Aucun menu déroulant : un <select> prend le focus et efface la sélection du
   texte. Tout se fait au bouton, et les couleurs s'ouvrent en pastilles.
   -------------------------------------------------------------------------- */

.rt-bar {
  position: fixed; z-index: 120; display: none; flex-direction: column; gap: 6px;
  padding: 5px 6px; border-radius: var(--r-md); background: rgba(11, 16, 15, 0.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(4, 59, 54, 0.34);
}
.rt-bar.is-on { display: flex; }
.rt-bar__row { display: flex; align-items: center; gap: 4px; }
.rt-bar button {
  display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 8px; color: #fff; font-size: 14px; line-height: 1;
}
.rt-bar button:hover { background: rgba(255, 255, 255, 0.16); }
.rt-bar__sep { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.22); margin-inline: 2px; }

/* Bouton couleur : une roue en dégradé, qui annonce ce qu'il ouvre */
.rt-bar__roue {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(#e24a4a, #efe43a, #49b29f, #4a7fe2, #b44ae2, #e24a4a);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* Tailles : le même A à quatre échelles, l'une d'elles remet au normal */
.rt-size { font-weight: 600; }
.rt-size--s-sm { font-size: 11px; }
.rt-size--normal { font-size: 14px; }
.rt-size--s-lg { font-size: 17px; }
.rt-size--s-xl { font-size: 20px; }

/* Pastilles de couleur, sous la barre */
.rt-pop {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  max-width: 250px; padding: 6px 4px 2px; border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.rt-pop__sep { width: 100%; height: 0; }
.rt-bar .rt-dot {
  position: relative; width: 22px; min-width: 22px; height: 22px; padding: 0;
  border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55);
  cursor: pointer; transition: transform var(--dur-fast);
}
.rt-bar .rt-dot:hover { transform: scale(1.12); box-shadow: inset 0 0 0 2px #fff; }
.rt-dot--none { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #b9c2c0 3px, #b9c2c0 6px); }
.rt-dot--c-green { background: #49b29f; }
.rt-dot--c-deep { background: #043b36; }
.rt-dot--c-ink { background: #0e1413; }
.rt-dot--c-muted { background: #7c8583; }
.rt-dot--c-white { background: #fff; }
.rt-dot--c-red { background: #bb274b; }
.rt-dot--plus {
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.14);
  color: #fff; font-size: 15px; line-height: 1;
}

/* Sélecteur de couleur maison : on explore en glissant, on valide au bouton */
.rt-picker { display: grid; gap: 8px; width: 214px; padding: 8px 4px 4px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.rt-picker__sv {
  position: relative; height: 120px; border-radius: 8px; cursor: crosshair; touch-action: none;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, var(--teinte, #49b29f));
}
.rt-picker__dot {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.5); pointer-events: none;
}
.rt-picker__hue {
  width: 100%; height: 14px; margin: 0; border-radius: 999px; appearance: none; cursor: pointer;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.rt-picker__hue::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); cursor: pointer;
}
.rt-picker__foot { display: flex; align-items: center; gap: 6px; }
.rt-picker__apercu { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55); }
.rt-bar .rt-picker__hex {
  flex: 1 1 auto; min-width: 0; width: 74px; height: 24px; padding: 0 6px; border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.14); color: #fff; font: inherit; font-size: 12px;
}
.rt-bar .rt-picker__foot button { min-width: 0; height: 24px; padding: 0 8px; font-size: 12px; background: rgba(255, 255, 255, 0.14); }
.rt-bar .rt-picker__foot button:hover { background: rgba(255, 255, 255, 0.26); }
.rt-bar .rt-picker__ok { background: var(--green-500); }
.rt-bar .rt-picker__ok:hover { background: var(--green-200); color: var(--green-900); }

/* État actif : le bouton reste allumé comme au survol, pour qu'on voie ce qui
   est déjà appliqué au passage sélectionné. */
.rt-bar button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.24); color: #fff; }
.rt-bar button[aria-pressed="true"]:hover { background: rgba(255, 255, 255, 0.32); }
.rt-bar .rt-dot[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px rgba(255, 255, 255, 0.45);
  transform: scale(1.12);
}
.rt-bar .rt-dot[aria-pressed="true"]:hover { transform: scale(1.18); }
/* La roue prend la couleur en cours ; sans couleur elle reprend son dégradé. */
.rt-bar__roue.is-set { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.25); }

/* Champ de texte enrichi dans le panneau : même allure que les autres champs */
.rt-field {
  min-height: 44px; padding: 10px 12px; border-radius: var(--r-sm);
  background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; line-height: 1.5;
  color: var(--ink); overflow-wrap: break-word;
}
.rt-field:focus { outline: none; box-shadow: inset 0 0 0 2px var(--green-500); }
.rt-field:empty::before { content: attr(data-placeholder); color: var(--muted-2); }
.rt-field--sm { min-height: 40px; font-size: 15px; }

/* Textes modifiables directement dans l'aperçu. La diapositive est en
   pointer-events: none dans l'éditeur ; on rend le clic à ces zones-là
   seulement, sinon on ne peut pas y placer le curseur. */
.editor .slide [data-edit] { pointer-events: auto; cursor: text; border-radius: 4px; transition: box-shadow var(--dur-fast); }
.editor .slide [data-edit]:hover { box-shadow: 0 0 0 2px rgba(73, 178, 159, 0.35); }
.editor .slide [data-edit]:focus { outline: none; box-shadow: 0 0 0 2px var(--green-500); }

/* Fenêtre de reprise : la version de la présentation face à celle du
   catalogue. Empilées sur petit écran, côte à côte dès qu'il y a la place. */
.reprise__champ { display: grid; gap: 8px; }
.reprise__nom { margin: 0; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-2); }
.reprise__paire { display: grid; gap: 10px; }
.reprise__cote {
  display: grid; gap: 6px; padding: 12px; border-radius: var(--r-sm);
  background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line);
}
.reprise__cote--neuf { background: rgba(73, 178, 159, 0.08); box-shadow: inset 0 0 0 1px rgba(73, 178, 159, 0.45); }
.reprise__etiquette { font-size: 12px; font-weight: 600; color: var(--muted-2); }
.reprise__cote--neuf .reprise__etiquette { color: var(--green-700, #1f7a6b); }
/* Le texte garde sa mise en forme : c'est justement ce qu'on compare. */
.reprise__texte { font-size: 15px; line-height: 1.5; color: var(--ink); overflow-wrap: break-word; max-height: 30vh; overflow: auto; }

@media (min-width: 720px) {
  .reprise__paire { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Menu contextuel du catalogue : mêmes options au clic droit et sur « ⋯ ». */
.ctx {
  position: fixed; z-index: 200; min-width: 220px; padding: 6px;
  display: grid; gap: 2px; border-radius: var(--r-sm);
  background: var(--bg); box-shadow: 0 10px 34px rgba(4, 59, 54, 0.18), 0 0 0 1px var(--line);
}
.ctx button {
  padding: 9px 12px; border-radius: 6px; text-align: left; font-size: 14px;
  color: var(--ink); background: none; border: 0; cursor: pointer; min-height: 38px;
}
.ctx button:hover, .ctx button:focus-visible { background: var(--bg-soft); }
.ctx__danger { color: var(--danger); }

/* Repère interne et catégories, sur la fiche du catalogue */
.product-card__ref { margin: 2px 0 0; font-size: 12px; color: var(--muted-2); }
.product-card__cats { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.product-card.is-dragging { opacity: 0.45; }

/* Catégorie visée pendant un glisser-déposer */
.side-list button.is-target {
  background: rgba(73, 178, 159, 0.14);
  box-shadow: inset 0 0 0 2px var(--green-500);
}

.badge--soft { background: var(--bg-soft); color: var(--muted-2); box-shadow: inset 0 0 0 1px var(--line); }
.rangement { margin: 0; font-size: 14px; line-height: 1.8; }

/* ---- Déroulants maison -------------------------------------------------
   Le <select> d'origine reste dans la page, hors de vue : il porte toujours
   la valeur. Le bouton qui s'affiche reprend exactement l'allure d'un champ. */
.xsel { position: relative; display: block; }
.xsel__vrai {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; clip-path: inset(50%); border: 0; pointer-events: none;
}
.xsel__btn {
  width: 100%; min-height: 46px; padding: 10px 38px 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font: inherit; font-size: 16px;
  text-align: left; cursor: pointer; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234e5856' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.xsel__btn:hover { border-color: var(--green-500); }
.xsel__btn:focus-visible { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(73, 178, 159, 0.22); }
.xsel__btn.is-vide { color: var(--muted-2); }
.xsel__btn[disabled] { background: var(--bg-soft); color: var(--muted-2); cursor: default; }
.xsel__btn.select--sm { min-height: 34px; padding: 0 30px 0 10px; font-size: 13px; background-position: right 9px center; }

.xsel__pop {
  position: fixed; z-index: 220; max-height: min(320px, 60vh); overflow-y: auto;
  padding: 6px; display: grid; gap: 2px; border-radius: var(--r-sm);
  background: var(--bg); box-shadow: 0 14px 40px rgba(4, 59, 54, 0.2), 0 0 0 1px var(--line);
}
.xsel__opt {
  min-height: 40px; padding: 9px 12px; border: 0; border-radius: 6px;
  background: none; color: var(--ink); font: inherit; font-size: 15px;
  text-align: left; cursor: pointer;
}
.xsel__opt.is-actif { background: var(--bg-soft); }
.xsel__opt.is-choisi { color: var(--green-900); font-weight: 600; }
.xsel__opt.is-choisi::after { content: " ✓"; }
.xsel__opt[disabled] { color: var(--muted-2); cursor: default; }
.xsel__groupe {
  margin: 6px 0 2px; padding: 0 12px; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-2);
}

/* ---- Champ à liste (fournisseur) --------------------------------------- */
.combo__pop {
  position: fixed; z-index: 230; max-height: min(300px, 55vh); overflow-y: auto;
  padding: 6px; display: grid; gap: 2px; border-radius: var(--r-sm);
  background: var(--bg); box-shadow: 0 14px 40px rgba(4, 59, 54, 0.2), 0 0 0 1px var(--line);
}
.combo__ligne { display: flex; align-items: stretch; gap: 2px; }
.combo__opt {
  flex: 1; min-width: 0; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 6px;
  background: none; color: var(--ink); font: inherit; font-size: 15px; text-align: left;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.combo__opt.is-actif { background: var(--bg-soft); }
.combo__opt.is-choisi { color: var(--green-900); font-weight: 600; }
.combo__opt--neuf { color: var(--green-900); }
.combo__n { margin-left: auto; font-size: 12px; color: var(--muted-2); }
.combo__edit {
  flex: 0 0 auto; width: 38px; border: 0; border-radius: 6px; background: none;
  color: var(--muted-2); font-size: 14px; cursor: pointer;
}
.combo__edit:hover { background: var(--bg-soft); color: var(--ink); }
.combo__vide { margin: 0; padding: 10px 12px; font-size: 13px; color: var(--muted-2); }
.combo__edit--del:hover { background: rgba(187, 39, 75, 0.1); color: var(--danger); }
