/* ========================================================================
   Zone client (topbar + sidebar desktop + bottom nav mobile)
   Variables --client-* pilotées par CrmSettings et appliquées au boot.
   ======================================================================== */

/* ====== Design system client "DiWallet" ======
   Fond gris très clair, cartes blanches très arrondies, ombres douces,
   accent = couleur du tenant (white-label). */
body[data-client-zone] {
  --primary: var(--client-primary);
  /* Tokens DiWallet */
  --dw-bg: #f4f5f7;
  --dw-card: #ffffff;
  --dw-radius: 20px;
  --dw-radius-sm: 14px;
  --dw-border: rgba(15, 23, 42, 0.06);
  --dw-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
  --bg-app: var(--dw-bg);
  background: var(--dw-bg);
  /* Police propre à la plateforme client, sans polluer le CRM admin. */
  font-family: var(--client-font-sans, var(--font-sans));
}

/* Cartes DiWallet : très arrondies, bordure quasi invisible, ombre douce */
body[data-client-zone] .card {
  border-radius: var(--dw-radius);
  border-color: var(--dw-border);
  box-shadow: var(--dw-shadow);
}
body[data-client-zone] .btn { border-radius: var(--radius-full); }
body[data-client-zone] .input,
body[data-client-zone] .select,
body[data-client-zone] .textarea { border-radius: var(--dw-radius-sm); }

.client-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: row;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); /* espace bottom nav mobile */
}
@media (min-width: 1024px) {
  .client-shell { padding-bottom: 0; }
}

/* --- Sidebar gauche (desktop) — DiWallet : blanche, épurée --- */
.client-sidebar {
  display: none;
  width: 232px;
  flex-shrink: 0;
  background: var(--dw-card);
  border-right: 1px solid var(--dw-border);
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  padding: var(--space-5) var(--space-3);
  gap: var(--space-5);
}
@media (min-width: 1024px) {
  .client-sidebar { display: flex; }
  /* La marque vit dans la sidebar sur desktop */
  .client-topbar .client-brand { display: none; }
}
/* 09/10 : logo = lien vers l'accueil (desktop + mobile) */
a.client-brand, a.client-sidebar-brand { text-decoration: none; color: inherit; cursor: pointer; }
a.client-brand:hover img, a.client-sidebar-brand:hover img { opacity: .85; }
.client-sidebar-brand {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2);
}
/* Logo principal : pleine largeur de la sidebar (hauteur plafonnée) */
.client-sidebar-brand img {
  width: 100%;
  max-height: 64px;
  object-fit: contain;
  object-position: left center;
}
.client-sidebar-logo {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--client-primary);
  color: #fff;
  font-weight: var(--weight-bold);
  font-size: var(--text-base);
  flex-shrink: 0;
}
.client-sidebar-name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--dw-border);
  padding-top: var(--space-3);
  display: flex; align-items: center; gap: var(--space-2);
  padding-left: var(--space-2); padding-right: var(--space-2);
}
.client-sidebar-footer .client-user-avatar { width: 34px; height: 34px; font-size: 12px; }
.client-sidebar-footer-meta { flex: 1; min-width: 0; }
.client-sidebar-footer-name {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-sidebar-footer-email {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- Topbar — DiWallet : légère, fond du canvas, contenu à droite --- */
.client-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: calc(64px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--space-4) 0;
  background: color-mix(in srgb, var(--dw-bg) 82%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  border-bottom: 1px solid var(--dw-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .client-topbar { padding: 0 var(--space-8); }
}
.client-brand {
  display: flex; align-items: center; gap: var(--space-3);
}
.client-brand img { max-height: 36px; }
.client-brand-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 40vw;
}
.client-topbar-right {
  display: flex; align-items: center; gap: var(--space-4);
}
/* Pastille rouge "notifications non lues" sur la cloche */
.notif-badge {
  position: absolute; top: 0; right: 0;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  border-radius: var(--radius-full);
  background: #dc2626;
  color: #fff;
  font-size: 10px; font-weight: var(--weight-semibold); line-height: 15px;
  text-align: center;
  border: 2px solid var(--bg-card);
  box-sizing: content-box;
  pointer-events: none;
}
.notif-badge[hidden] { display: none; }
/* Pastille rouge "nouvelles offres" sur l'onglet Offres (sidebar + nav mobile) */
.nav-offer-badge {
  margin-left: auto;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: #dc2626;
  color: #fff;
  font-size: 10px; font-weight: var(--weight-semibold); line-height: 16px;
  text-align: center;
  flex-shrink: 0;
}
.nav-offer-badge[hidden] { display: none; }
/* Bottom bar mobile : liens en colonne → pastille en absolu sur l'icône */
.client-nav-mobile > a .nav-offer-badge {
  position: absolute;
  top: 2px; right: calc(50% - 18px);
  margin-left: 0;
}

/* "Mes souscriptions" — cards dépliables de suivi livret (onglet Livrets) */
.dw-mysub {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dw-mysub > summary {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.dw-mysub > summary::-webkit-details-marker { display: none; }
.dw-mysub-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dw-mysub-name strong { font-size: 14px; font-weight: var(--weight-semibold); }
.dw-mysub-name small { font-size: 11px; color: var(--text-muted); }
.dw-mysub-stat { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: var(--weight-medium); }
.dw-mysub-stat small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: var(--weight-medium); }
.dw-mysub-stat em { font-style: normal; }
.dw-mysub-chevron { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; transition: transform var(--transition-fast); }
.dw-mysub[open] .dw-mysub-chevron { transform: rotate(180deg); }
.dw-mysub-body { padding: 4px 18px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.dw-mysub-chart { margin-top: 12px; }
.dw-mysub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; }
.dw-mysub-grid > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.dw-mysub-grid small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: var(--weight-medium); }
.dw-mysub-payouts { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; max-height: 220px; overflow-y: auto; }
.dw-mysub-payouts-head { padding: 8px 12px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: var(--weight-semibold); background: var(--bg-subtle); position: sticky; top: 0; }
.dw-mysub-payout-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--border); }
.dw-mysub-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .dw-mysub > summary { flex-wrap: wrap; gap: var(--space-3); }
  .dw-mysub-name { flex-basis: 100%; }
}

/* Historiques — relevé façon banque (Débit | Crédit) */
.dw-hist-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 14px; max-width: 560px;
}
.dw-hist-tile {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 12px 16px;
}
.dw-hist-tile-icon {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  display: grid; place-items: center; flex-shrink: 0;
}
.dw-hist-tile-icon svg { width: 16px; height: 16px; }
.dw-hist-tile.is-in .dw-hist-tile-icon { background: color-mix(in oklch, #059669 13%, transparent); color: #059669; }
.dw-hist-tile.is-out .dw-hist-tile-icon { background: color-mix(in oklch, #dc2626 13%, transparent); color: #dc2626; }
.dw-hist-tile small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: var(--weight-medium); }
.dw-hist-tile strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.dw-hist-tile.is-in strong { color: #059669; }
.dw-hist-tile.is-out strong { color: #dc2626; }
.dw-hist-cols, .dw-hist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 110px;
  gap: 12px; align-items: center;
}
.dw-hist-cols {
  padding: 10px 16px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: var(--weight-semibold);
  border-bottom: 1px solid var(--dw-border);
  background: var(--bg-subtle);
}
.dw-hist-cols span:nth-child(2), .dw-hist-cols span:nth-child(3) { text-align: right; }
.dw-hist-month {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); font-weight: var(--weight-medium);
  background: var(--bg-subtle); border-bottom: 1px solid var(--dw-border);
}
.dw-hist-month-totals { display: flex; gap: 10px; font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; }
.dw-hist-month-totals em { font-style: normal; font-weight: var(--weight-semibold); }
.dw-hist-month-totals em.in { color: #059669; }
.dw-hist-month-totals em.out { color: #dc2626; }
.dw-hist-row { padding: 13px 16px; border-bottom: 1px solid var(--dw-border); }
.dw-hist-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dw-hist-icon {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.dw-hist-icon svg { width: 16px; height: 16px; }
.dw-hist-label { font-size: 14px; font-weight: var(--weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-hist-date { font-size: 11px; color: var(--text-muted); }
.dw-hist-debit, .dw-hist-credit {
  text-align: right; font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums; font-size: 14px;
}
.dw-hist-debit { color: #dc2626; }
.dw-hist-credit { color: #059669; }
.dw-hist-neutral {
  grid-column: 2 / 4; text-align: right;
  font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.dw-hist-balance {
  text-align: right; font-size: 14px; font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums; color: var(--text-primary);
}
@media (max-width: 560px) {
  /* police des montants réduite : « 1 234 567,89 € » tient dans les 88px
     (12px tabular ≈ 84px) au lieu de déborder sur la colonne voisine */
  .dw-hist-cols, .dw-hist-row { grid-template-columns: minmax(0, 1fr) 88px 88px; gap: 8px; }
  .dw-hist-cols { padding: 8px 12px; }
  .dw-hist-row { padding: 12px; }
  .dw-hist-debit, .dw-hist-credit, .dw-hist-balance, .dw-hist-neutral { font-size: 12px; }
}

/* Bornes "entre telle année et telle année" dans la rangée de filtres */
.dw-char-range {
  display: flex; align-items: center; gap: var(--space-2);
}
.dw-char-range-word { font-size: 12px; color: var(--text-muted); }
.dw-char-range-input {
  width: 88px;
  height: 36px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
/* Masque les spinners natifs : la saisie directe est le geste principal */
.dw-char-range-input::-webkit-outer-spin-button,
.dw-char-range-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dw-char-range-input { -moz-appearance: textfield; appearance: textfield; }

/* Filtre prix (jauge à double curseur) — catalogue client */
.dw-price-filter {
  display: flex; align-items: center; gap: var(--space-4);
  max-width: 520px;
  /* Se cale sous la toolbar (qui a un gros margin-bottom) et laisse de l'air
     avant les filtres caractéristiques. */
  margin: calc(-1 * var(--space-3)) 0 var(--space-5);
}
.dw-price-filter[hidden] { display: none; }
/* Les filtres caractéristiques ont une marge top négative pour se coller à la
   toolbar — quand la jauge de prix est visible entre les deux, on l'annule
   (sinon ils remontent sur la jauge). */
.dw-price-filter:not([hidden]) ~ .dw-char-filters { margin-top: 0; }
.dw-price-filter-label {
  font-size: 11px; font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  flex-shrink: 0;
}
.dw-price-values {
  font-size: 13px; font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  flex-shrink: 0; min-width: 160px; text-align: right;
}
.dw-price-range { position: relative; flex: 1; height: 28px; min-width: 160px; }
.dw-price-track, .dw-price-fill {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 4px; border-radius: 2px;
  pointer-events: none;
}
.dw-price-track { left: 0; right: 0; background: color-mix(in oklch, var(--text-muted) 25%, transparent); }
.dw-price-fill { background: var(--client-primary); }
.dw-price-range input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 28px;
  margin: 0; background: none;
  -webkit-appearance: none; appearance: none;
  pointer-events: none; /* seuls les pouces sont cliquables */
}
.dw-price-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: auto;
  width: 16px; height: 16px; border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--client-primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.dw-price-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 12px; height: 12px; border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--client-primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
@media (max-width: 640px) {
  .dw-price-filter { flex-wrap: wrap; max-width: none; }
  .dw-price-values { min-width: 0; margin-left: auto; }
}
/* Écrans tactiles, zone client : cibles ≥ 44px (reco Apple/Google) — les
   btn-sm à 30px (Régler, Signer, Accepter/Refuser, pagination, cloche,
   déconnexion) étaient pénibles au doigt et sujets aux mauvais taps. */
@media (pointer: coarse) {
  body[data-client-zone] .btn-sm { min-height: 44px; padding: var(--space-2) var(--space-4); }
  body[data-client-zone] .pagination button { min-height: 44px; min-width: 44px; }
}

/* Écrans tactiles : pouces du double curseur agrandis (16px/12px étaient
   quasi insaisissables au doigt, surtout quand les deux se chevauchent) */
@media (pointer: coarse) {
  .dw-price-range { height: 40px; }
  .dw-price-range input[type="range"] { height: 40px; }
  .dw-price-range input[type="range"]::-webkit-slider-thumb {
    width: 28px; height: 28px; border-width: 3px;
  }
  .dw-price-range input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px; border-width: 3px;
  }
}
.client-balance {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 1.15;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: color-mix(in oklch, var(--client-primary) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--client-primary) 25%, transparent);
}
.client-balance-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.client-balance-value {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.client-balance { background: var(--dw-card); border-color: var(--dw-border); box-shadow: var(--dw-shadow); }
@media (max-width: 480px) {
  /* Mobile : chip compacte, on garde le montant (info clé) et on drop le label */
  .client-balance { padding: 4px 10px; }
  .client-balance-label { display: none; }
  .client-balance-value { font-size: var(--text-sm); }
}

/* --- Body : colonne topbar + contenu, à droite de la sidebar --- */
.client-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.client-user-card {
  padding: 0 var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--space-3);
}
.client-user-avatar {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--client-icon-soft);
  color: var(--client-icon-color);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}
.client-user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.client-user-email {
  font-size: 11px;
  color: var(--client-sidebar-fg-muted);
}
/* Nav sidebar : liste verticale d'items arrondis (DiWallet) */
.client-nav-list {
  display: flex; flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.client-nav-list::-webkit-scrollbar { display: none; }
.client-nav-list a {
  position: relative;
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--dw-radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.client-nav-list a svg { width: 17px; height: 17px; flex-shrink: 0; }
.client-nav-list a:hover { background: rgba(15, 23, 42, 0.04); color: var(--text-primary); }
.client-nav-list a[aria-current="page"] {
  background: color-mix(in oklch, var(--client-primary) 10%, var(--dw-card));
  color: var(--client-primary);
  font-weight: var(--weight-semibold);
}

/* --- Main --- */
.client-main {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}
.client-main .page {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}
@media (min-width: 768px) {
  .client-main .page {
    padding: var(--space-6) var(--space-6);
  }
}

/* ====== Bloc bénéfices (hero accueil) : investi → aujourd'hui ====== */
.dw-benef {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid color-mix(in oklch, #059669 20%, var(--dw-border));
  border-radius: var(--dw-radius-sm);
  background: color-mix(in oklch, #059669 5%, var(--dw-card));
}
.dw-benef-main {
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
}
.dw-benef-item { display: flex; flex-direction: column; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.dw-benef-item small {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: var(--weight-medium);
}
.dw-benef-item strong { font-weight: var(--weight-bold); }
.dw-benef-arrow { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.dw-benef-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.dw-benef-badge.up { background: #059669; color: #fff; }
.dw-benef-badge.down { background: #dc2626; color: #fff; }
.dw-benef-sub { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ====== Donut répartition du patrimoine (hero accueil) ====== */
.dw-donut-wrap {
  display: flex; align-items: center; gap: var(--space-6);
  flex-wrap: wrap;
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius-sm);
  background: var(--bg-subtle);
}
.dw-donut-legend { flex: 1; min-width: 200px; }
.dw-donut-legend-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
  font-size: var(--text-sm);
}
.dw-donut-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dw-donut-legend-label { color: var(--text-secondary); flex: 1; }
.dw-donut-legend-value {
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.dw-donut-legend-value small { color: var(--text-muted); font-weight: 400; }

/* ====== Profil : en-tête cadré ====== */
.dw-profile-head {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-5);
}
.dw-profile-avatar {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  border-radius: 24px;
  background: color-mix(in oklch, var(--client-primary) 12%, var(--dw-card));
  color: var(--client-primary);
  font-size: 22px; font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.dw-profile-meta { min-width: 0; }
.dw-profile-name {
  font-size: var(--text-lg); font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dw-profile-email {
  font-size: var(--text-sm); color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dw-profile-phone {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--text-secondary);
  margin-top: 4px;
}
.dw-profile-phone svg { width: 12px; height: 12px; color: var(--client-primary); }

/* ====== Badge rareté livrets ====== */
.dw-scarcity-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #c2410c;
  font-size: 11px; font-weight: var(--weight-semibold);
}
.dw-scarcity-badge svg { width: 11px; height: 11px; }

/* ====== Footer réassurance ====== */
.client-reassurance {
  margin-top: var(--space-8);
  padding: var(--space-6) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--dw-border);
}
.client-reassurance-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-6); flex-wrap: wrap;
}
.client-reassurance-inner span {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  color: var(--text-muted);
}
.client-reassurance-inner svg { width: 15px; height: 15px; color: var(--client-primary); }
.client-reassurance-copy {
  text-align: center; margin-top: var(--space-3);
  font-size: 11px; color: var(--text-muted);
}

/* ====== Skeletons de chargement ====== */
.dw-skeleton-page { display: flex; flex-direction: column; gap: var(--space-5); }
.dw-skeleton {
  border-radius: var(--dw-radius);
  background: linear-gradient(90deg,
    rgba(15, 23, 42, 0.05) 25%,
    rgba(15, 23, 42, 0.09) 50%,
    rgba(15, 23, 42, 0.05) 75%);
  background-size: 400% 100%;
  animation: dw-shimmer 1.3s ease-in-out infinite;
}
@keyframes dw-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* ====== Transition de page ====== */
.dw-page-enter { animation: dw-page-in 0.22s ease-out; }
@keyframes dw-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== Lignes documents ====== */
.dw-doc-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--dw-radius-sm);
}
.dw-doc-row + .dw-doc-row { border-top: 1px solid var(--dw-border); }
.dw-doc-row:hover { background: rgba(15, 23, 42, 0.03); }

/* ====== Mode sombre client (CrmSettings.clientTheme = 'dark') ====== */
html[data-client-theme="dark"] body[data-client-zone] {
  --dw-bg: #0e1116;
  --dw-card: #171b22;
  --dw-border: rgba(255, 255, 255, 0.08);
  --dw-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --bg-card: #171b22;
  --bg-app: #0e1116;
  --bg-muted: #222833;
  --bg-subtle: rgba(255, 255, 255, 0.04);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #8a94a6;
  --slate-100: #222833;
  --slate-400: #64748b;
  --white: #171b22;
  color: var(--text-primary);
}
html[data-client-theme="dark"] body[data-client-zone] .dw-cave-row:hover,
html[data-client-theme="dark"] body[data-client-zone] .dw-notif-row:hover,
html[data-client-theme="dark"] body[data-client-zone] .dw-offer-row:hover,
html[data-client-theme="dark"] body[data-client-zone] .dw-livret-row:hover,
html[data-client-theme="dark"] body[data-client-zone] .dw-doc-row:hover { background: rgba(255, 255, 255, 0.05); }
html[data-client-theme="dark"] body[data-client-zone] .dw-buy-img { background: #222833; }
html[data-client-theme="dark"] body[data-client-zone] .dw-skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%);
  background-size: 400% 100%;
}
html[data-client-theme="dark"] body[data-client-zone] .dw-scarcity-badge {
  background: rgba(194, 65, 12, 0.15); border-color: rgba(253, 186, 116, 0.35); color: #fdba74;
}

/* ====== Panneau notifications (cloche topbar) ====== */
.client-notif-panel {
  position: fixed;
  top: 60px; right: 16px;
  width: 340px; max-width: calc(100vw - 24px);
  max-height: 70vh; overflow-y: auto;
  background: var(--dw-card);
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius-sm);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
  z-index: calc(var(--z-sticky) + 2);
  animation: fade-in 0.12s ease-out;
}
.client-notif-panel-head {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  border-bottom: 1px solid var(--dw-border);
  position: sticky; top: 0; background: var(--dw-card);
}
.client-notif-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--dw-border);
  color: inherit;
  transition: background var(--transition-fast);
}
.client-notif-row:hover { background: rgba(15, 23, 42, 0.03); }
.client-notif-row.is-unread { background: color-mix(in oklch, var(--client-primary) 6%, transparent); }
.client-notif-row-title { font-size: 13px; font-weight: var(--weight-medium); }
.client-notif-row-body {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.client-notif-row-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ====== Stepper livraison ====== */
.dw-steps {
  display: flex; align-items: flex-start;
  margin: var(--space-2) 0 var(--space-4);
}
.dw-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0;
  min-width: 62px;
}
.dw-step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 2px solid transparent;
  transition: all 0.2s;
}
.dw-step-dot svg { width: 13px; height: 13px; }
.dw-step-label { font-size: 10px; color: var(--text-muted); font-weight: var(--weight-medium); }
.dw-step.is-done .dw-step-dot,
.dw-step.is-current .dw-step-dot {
  background: color-mix(in oklch, var(--client-primary) 12%, var(--dw-card));
  color: var(--client-primary);
}
.dw-step.is-current .dw-step-dot {
  background: var(--client-primary);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in oklch, var(--client-primary) 40%, transparent);
}
.dw-step.is-current .dw-step-label { color: var(--client-primary); font-weight: var(--weight-semibold); }
.dw-step-line {
  flex: 1;
  height: 2px;
  margin-top: 14px;
  background: var(--bg-muted);
  border-radius: 1px;
}
.dw-step-line.is-done { background: color-mix(in oklch, var(--client-primary) 55%, var(--bg-muted)); }

/* ====== Toolbar catalogue : recherche + chips catégories ====== */
.dw-catalog-toolbar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.dw-search {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--dw-card);
  border: 1px solid var(--dw-border);
  border-radius: var(--radius-full);
  box-shadow: var(--dw-shadow);
  padding: 9px 16px;
  flex: 0 1 320px;
  min-width: 200px;
}
.dw-search svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.dw-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: var(--text-sm); color: var(--text-primary);
  font-family: inherit;
}
.dw-cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dw-sort-select {
  width: auto;
  margin-left: auto;
  border-radius: var(--radius-full);
  border-color: var(--dw-border);
  background-color: var(--dw-card);
  box-shadow: var(--dw-shadow);
  font-size: var(--text-xs);
  padding: 9px 34px 9px 14px;
}

/* Filtres par caractéristiques de la catégorie sélectionnée */
.dw-char-filters {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin: calc(-1 * var(--space-3)) 0 var(--space-5);
}
.dw-char-filters[hidden] { display: none; }
.dw-char-select { margin-left: 0; }
.dw-cat-chip {
  padding: 7px 14px;
  border: 1px solid var(--dw-border);
  border-radius: var(--radius-full);
  background: var(--dw-card);
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.dw-cat-chip:hover { border-color: color-mix(in oklch, var(--client-primary) 40%, var(--dw-border)); }
.dw-cat-chip.is-active {
  background: var(--client-primary);
  border-color: var(--client-primary);
  color: #fff;
}

/* ====== KPIs patrimoine (cave) ====== */
.dw-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.dw-kpi { padding: var(--space-4) var(--space-5); }
.dw-kpi-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); font-weight: var(--weight-medium);
}
.dw-kpi-value {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.dw-kpi-value small { font-size: 12px; font-weight: var(--weight-semibold); }

/* ====== Modal de succès "All Done" (confettis) ====== */
.dw-success-modal {
  max-width: 380px !important;
  background: linear-gradient(160deg,
    color-mix(in oklch, var(--client-primary, var(--primary)) 88%, #1e1b4b) 0%,
    color-mix(in oklch, var(--client-primary, var(--primary)) 65%, #1e1b4b) 100%) !important;
  border: 0 !important;
}
.dw-success {
  position: relative;
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: #fff;
  overflow: hidden;
}
.dw-success-confetti { position: absolute; inset: 0; pointer-events: none; }
.dw-success-confetti span {
  position: absolute; top: -12px;
  border-radius: 2px;
  opacity: 0;
  animation-name: dw-confetti-fall;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
@keyframes dw-confetti-fall {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  10% { opacity: 1; }
  100% { opacity: 0.9; transform: translateY(340px) rotate(300deg); }
}
.dw-success-badge {
  position: relative;
  width: 74px; height: 74px;
  margin: 0 auto var(--space-4);
  display: grid; place-items: center;
  background: #a7f3d0;
  color: #065f46;
  border-radius: 26px;
  rotate: 8deg;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  animation: dw-badge-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dw-success-badge svg { width: 34px; height: 34px; stroke-width: 3; }
@keyframes dw-badge-pop {
  from { scale: 0.4; rotate: -30deg; opacity: 0; }
  to { scale: 1; rotate: 8deg; opacity: 1; }
}
.dw-success-title { font-size: var(--text-xl); font-weight: var(--weight-bold); letter-spacing: -0.01em; }
.dw-success-body { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.75); margin-top: 8px; line-height: 1.5; }
.dw-success-btn {
  margin-top: var(--space-6);
  width: 100%;
  padding: 12px;
  border: 0; border-radius: var(--radius-full);
  background: #fff; color: var(--text-primary);
  font-weight: var(--weight-semibold); font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.dw-success-btn:hover { transform: translateY(-1px); }

/* ====== En-tête de page commun (toutes les pages client) ====== */
.dw-page-head { margin-bottom: var(--space-6); }
.dw-page-head h1 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
}
.dw-page-head p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 4px;
}

/* ====== Accueil wallet (Phase 2 DiWallet) ====== */
.dw-greeting {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}
.dw-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
@media (min-width: 1180px) {
  .dw-home { grid-template-columns: minmax(0, 1fr) 340px; }
}
.dw-home-main, .dw-home-rail {
  display: flex; flex-direction: column; gap: var(--space-5);
  min-width: 0;
}

/* Hero solde */
.dw-hero { padding: var(--space-6); }
.dw-hero-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); font-weight: var(--weight-medium);
  display: flex; align-items: center; gap: 6px;
}
.dw-hero-balance {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  margin-top: 4px;
  color: var(--text-primary);
}
.dw-hero-stats {
  display: flex; gap: var(--space-5); flex-wrap: wrap;
  margin-top: var(--space-2);
  font-size: var(--text-xs); color: var(--text-muted);
}
.dw-hero-stats strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dw-actions {
  display: flex; gap: var(--space-5); flex-wrap: wrap;
  margin-top: var(--space-6);
}
.dw-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer;
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  color: var(--text-secondary);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.dw-action-icon {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--client-primary) 10%, var(--dw-card));
  color: var(--client-primary);
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.dw-action-icon svg { width: 22px; height: 22px; }
.dw-action:hover .dw-action-icon {
  background: var(--client-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* Cartes liste (cave / notifs / rail) */
.dw-list-card { padding: var(--space-5); }
.dw-list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-3);
}
.dw-list-head h2 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}
.dw-see-all {
  font-size: var(--text-xs); font-weight: var(--weight-medium);
  color: var(--client-primary);
}
.dw-empty { font-size: 13px; color: var(--text-muted); padding: var(--space-2) 0; }
.dw-empty a { color: var(--client-primary); text-decoration: underline; }

/* Rangée cave (style watchlist) */
.dw-cave-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--dw-radius-sm);
  color: inherit; text-decoration: none;
  transition: background var(--transition-fast);
}
.dw-cave-row:hover { background: rgba(15, 23, 42, 0.03); }
.dw-cave-row + .dw-cave-row { border-top: 1px solid var(--dw-border); }
.dw-cave-img {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--slate-100); overflow: hidden;
  display: grid; place-items: center; color: var(--slate-400);
  flex-shrink: 0;
}
.dw-cave-img img { width: 100%; height: 100%; object-fit: cover; }
.dw-cave-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dw-cave-title {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dw-cave-sub { font-size: 11px; color: var(--text-muted); }
/* Actions de ligne (règlement, signature) : HORS du titre nowrap/ellipsis —
   sinon elles étaient rognées sur mobile et le paiement devenait intappable */
.dw-cave-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px; margin-top: 6px;
}
.dw-cave-spark { flex-shrink: 0; display: none; }
@media (min-width: 560px) { .dw-cave-spark { display: block; } }
.dw-cave-value { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.dw-cave-price {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}
.dw-cave-delta { font-size: 11px; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.dw-cave-delta.up { color: #059669; }
.dw-cave-delta.down { color: #dc2626; }

/* Souscriptions (cards) */
.dw-subs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-3);
}
.dw-sub-card {
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius-sm);
  padding: var(--space-4);
  background: color-mix(in oklch, var(--client-primary) 3%, var(--dw-card));
}
.dw-sub-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dw-sub-name { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.dw-sub-rate {
  font-size: var(--text-lg); font-weight: var(--weight-bold);
  color: var(--client-primary); font-variant-numeric: tabular-nums;
}
.dw-sub-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: 12px; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums;
}
.dw-sub-stats small {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: var(--weight-medium);
  margin-bottom: 2px;
}
.dw-sub-stats em { font-style: normal; color: #059669; }

/* Notifications */
.dw-notif-row {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--dw-radius-sm);
  color: inherit;
}
.dw-notif-row:hover { background: rgba(15, 23, 42, 0.03); }
.dw-notif-row + .dw-notif-row { border-top: 1px solid var(--dw-border); }
.dw-notif-row.is-unread { background: color-mix(in oklch, var(--client-primary) 5%, transparent); }
.dw-notif-icon {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in oklch, var(--client-primary) 10%, transparent);
  color: var(--client-primary);
}
.dw-notif-icon svg { width: 14px; height: 14px; }
.dw-notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dw-notif-title { font-size: 13px; font-weight: var(--weight-medium); }
.dw-notif-sub {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dw-notif-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* Rail droit : offres */
.dw-offer-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--dw-radius-sm);
  color: inherit;
}
.dw-offer-row:hover { background: rgba(15, 23, 42, 0.03); }
.dw-offer-row + .dw-offer-row { border-top: 1px solid var(--dw-border); }
.dw-offer-meta { min-width: 0; display: flex; flex-direction: column; }
.dw-offer-title {
  font-size: 13px; font-weight: var(--weight-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dw-offer-sub {
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.dw-offer-sub svg { width: 11px; height: 11px; }
.dw-offer-amount {
  display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* Rail droit : livrets en vedette */
.dw-livret-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--dw-radius-sm);
  color: inherit;
}
.dw-livret-row:hover { background: rgba(15, 23, 42, 0.03); }
.dw-livret-row + .dw-livret-row { border-top: 1px solid var(--dw-border); }
.dw-livret-rate {
  font-size: var(--text-lg); font-weight: var(--weight-bold);
  color: var(--client-primary); font-variant-numeric: tabular-nums;
  min-width: 74px;
}
.dw-livret-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dw-livret-name {
  font-size: 13px; font-weight: var(--weight-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dw-livret-sub { font-size: 11px; color: var(--text-muted); }
.dw-livret-row > svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

/* ====== Fiche produit "asset detail" (Phase 3 DiWallet) ====== */
.dw-asset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
@media (min-width: 1080px) {
  .dw-asset { grid-template-columns: minmax(0, 1fr) 340px; }
}
.dw-asset-main, .dw-asset-rail { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
@media (min-width: 1080px) {
  .dw-asset-rail { position: sticky; top: 80px; }
}

/* CTA d'achat fixe sur mobile : sur petit écran, le panneau d'achat passe
   APRÈS le graphe et les caractéristiques — le bouton principal reste ainsi
   toujours visible, ancré au-dessus de la bottom nav. */
.dw-buy-cta-mobile { display: none; }
@media (max-width: 1023px) {
  .dw-buy-cta-mobile {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 29; /* sous la nav (30) et les modals (100+) */
    display: flex; align-items: center; gap: var(--space-4);
    padding: 10px var(--space-4);
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .dw-buy-cta-mobile .btn { flex: 1; min-height: 46px; }
  .dw-buy-cta-price { display: flex; flex-direction: column; line-height: 1.2; }
  .dw-buy-cta-price small { font-size: 11px; color: var(--text-muted); }
  .dw-buy-cta-price strong { font-size: var(--text-lg); font-variant-numeric: tabular-nums; white-space: nowrap; }
  /* réserve la place de la barre en fin de page */
  .dw-asset { padding-bottom: 72px; }
}

.dw-asset-head { padding: var(--space-6); }
.dw-asset-title-row { display: flex; align-items: center; gap: var(--space-3); }
.dw-asset-thumb {
  width: 52px; height: 52px; border-radius: 14px;
  background: #fff; border: 1px solid var(--dw-border);
  overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center; color: var(--slate-400);
  padding: 3px;
}
.dw-asset-thumb img { width: 100%; height: 100%; object-fit: contain; }
.dw-asset-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); font-weight: var(--weight-medium);
}
.dw-asset-name {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.dw-asset-price-row {
  display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-4);
}
.dw-asset-price {
  font-size: clamp(30px, 4.5vw, 40px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.dw-asset-delta { font-size: var(--text-sm); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.dw-asset-delta small { color: var(--text-muted); font-weight: 400; }
.dw-asset-delta.up { color: #059669; }
.dw-asset-delta.down { color: #dc2626; }
.dw-asset-chart { margin-top: var(--space-4); }

/* Tuiles caractéristiques */
.dw-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
}
.dw-tile {
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius-sm);
  padding: var(--space-3);
  background: var(--dw-card);
}
.dw-tile-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: var(--weight-medium);
  margin-bottom: 3px;
}
.dw-tile-value { font-size: var(--text-sm); font-weight: var(--weight-semibold); }

/* Panneau d'achat */
.dw-buy-panel { padding: var(--space-5); }
.dw-buy-img {
  border-radius: var(--dw-radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--dw-border);
  margin-bottom: var(--space-4);
  padding: var(--space-2);
}
/* contain : la photo est toujours entière, jamais recadrée */
.dw-buy-img img { width: 100%; height: 100%; object-fit: contain; }
.dw-buy-rows { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.dw-buy-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px;
}
.dw-buy-row span { color: var(--text-muted); }
.dw-buy-row strong { font-variant-numeric: tabular-nums; }
.dw-buy-row:first-child strong { font-size: var(--text-lg); }
.dw-buy-hint {
  font-size: 11px; color: var(--text-muted);
  text-align: center; margin-top: var(--space-2);
}
.dw-sub-pending { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.dw-sub-pending-item {
  border: 1px solid color-mix(in oklch, #d97706 35%, var(--dw-border));
  background: color-mix(in oklch, #f59e0b 7%, var(--dw-card));
  border-radius: var(--dw-radius-sm); padding: 10px 12px; font-size: 12px;
}
.dw-sub-pending-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-muted); margin-bottom: 6px; }
.dw-sub-pending-head strong { color: var(--text-primary); font-variant-numeric: tabular-nums; font-size: 13px; }
.dw-sub-pending-line { display: flex; align-items: center; gap: 6px; line-height: 1.4; color: var(--text-secondary); }
.dw-sub-pending-line + .dw-sub-pending-line { margin-top: 4px; }
.dw-sub-pending-line svg { width: 13px; height: 13px; flex-shrink: 0; }
.dw-sub-pending-line.ok { color: #059669; }
.dw-sub-pending-line.warn { color: #b45309; }
.dw-sub-pending-line.warn strong { font-variant-numeric: tabular-nums; }
/* Liste livrets : section « Demandes en cours » */
.dw-subreq-list { display: flex; flex-direction: column; gap: 10px; }
.dw-subreq {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--dw-border); background: var(--dw-card);
  border-radius: var(--dw-radius-sm); padding: 12px 16px; font-size: 13px;
}
.dw-subreq-name { flex: 1 1 200px; min-width: 0; }
.dw-subreq-name strong { display: block; }
.dw-subreq-name small { color: var(--text-muted); }
.dw-subreq-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.dw-subreq-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.dw-subreq-state svg { width: 14px; height: 14px; }
.dw-subreq-state.warn { color: #b45309; }
.dw-subreq-state.ok { color: #059669; }
.dw-subreq-state.wait { color: var(--text-secondary); }
.dw-owned-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px;
  border-radius: var(--dw-radius-sm);
  background: color-mix(in oklch, #059669 8%, var(--dw-card));
  color: #059669;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
}
.dw-owned-note svg { width: 16px; height: 16px; }
/* Lien discret (livraison) : simple texte, pas un CTA */
.dw-discreet-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  margin-top: var(--space-3);
  background: none; border: 0; cursor: pointer;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dw-discreet-link:hover { color: var(--text-secondary); }
.dw-discreet-link svg { width: 12px; height: 12px; }

/* --- Compteurs de gains temps réel : point vert pulsant --- */
.live-earn-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: live-earn-pulse 1.6s ease-in-out infinite;
}
@keyframes live-earn-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  50% { opacity: 0.65; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

/* --- Grilles responsive (remplacent les inline styles fixes des pages) --- */
.c-split { display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: start; }
@media (min-width: 900px) {
  .c-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
}
.c-fields-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 640px) { .c-fields-2 { grid-template-columns: 1fr 1fr; } }
.c-field-row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 640px) { .c-field-row { grid-template-columns: 1fr 2fr; } }

/* --- Bottom nav mobile (+ safe area iOS) --- */
.client-nav-mobile {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: var(--z-sticky);
}
@media (min-width: 1024px) {
  .client-nav-mobile { display: none; }
}
.client-nav-mobile a,
.client-nav-mobile .client-nav-more {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-muted);
  padding: var(--space-1);
  background: none; border: 0; cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition-fast);
}
.client-nav-mobile a svg,
.client-nav-mobile .client-nav-more svg { width: 20px; height: 20px; }
.client-nav-mobile a[aria-current="page"] {
  color: var(--client-primary);
  font-weight: var(--weight-semibold);
}

/* --- Sheet "Menu" mobile : toutes les sections accessibles --- */
.client-nav-sheet { position: fixed; inset: 0; z-index: calc(var(--z-sticky) + 1); }
.client-nav-sheet[hidden] { display: none; }
.client-nav-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  animation: fade-in 0.15s ease-out;
}
.client-nav-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: var(--space-4) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.25);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  animation: client-sheet-in 0.22s ease-out;
}
@keyframes client-sheet-in {
  from { transform: translateY(32px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.client-nav-sheet-panel::before {
  content: '';
  grid-column: 1 / -1;
  justify-self: center;
  width: 40px; height: 4px;
  border-radius: var(--radius-full);
  background: var(--border);
  margin-bottom: var(--space-2);
}
.client-nav-sheet-panel a {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-lg);
  font-size: 11px; font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.client-nav-sheet-panel a svg { width: 20px; height: 20px; color: var(--client-primary); }
.client-nav-sheet-panel a[aria-current="page"] {
  background: color-mix(in oklch, var(--client-primary) 10%, transparent);
  color: var(--client-primary);
}

/* --- Modals en bottom-sheet sur mobile (zone client) --- */
@media (max-width: 640px) {
  body[data-client-zone] .modal-backdrop { align-items: flex-end; padding: 0; }
  body[data-client-zone] .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    animation: client-sheet-in 0.22s ease-out;
  }
}

/* --- Preview banner --- */
.preview-banner {
  position: sticky;
  top: 0;
  z-index: var(--z-preview-banner);
  background: linear-gradient(to right, #f59e0b, #ea580c);
  color: var(--white);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-3);
}
.intervention-banner { background: linear-gradient(to right, #dc2626, #b91c1c); flex-wrap: wrap; }
.preview-banner button {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 2px 10px;
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.preview-banner button svg { width: 14px; height: 14px; }
.preview-banner > span { text-align: center; }

/* --- Catalogue client (grille Apple Store) --- */
.catalogue-group + .catalogue-group { margin-top: var(--space-10); }
.catalogue-group-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  font-weight: var(--weight-medium);
}
.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
@media (min-width: 640px) { .catalogue-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .catalogue-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product-card {
  background: var(--dw-card);
  border-radius: var(--dw-radius);
  overflow: hidden;
  border: 1px solid var(--dw-border);
  box-shadow: var(--dw-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1); }
.product-card-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--slate-100);
}
.product-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.product-card:hover .product-card-image img { transform: scale(1.03); }
.product-card-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.product-card-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}
.product-card-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-top: 2px;
}
.product-card-price {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  font-variant-numeric: tabular-nums;
}
/* Mode démo catalogue (12/10) : produit « Vendu » → carte grisée, badge sur l'image */
.product-card.is-sold .product-card-image { position: relative; }
.product-card.is-sold .product-card-image img { filter: grayscale(1); opacity: 0.55; }
.product-card.is-sold .product-card-name,
.product-card.is-sold .product-card-price { color: var(--text-muted); }
.product-card.is-sold .product-card-price { text-decoration: line-through; }
.product-card.is-sold:hover .product-card-image img { transform: none; }
.product-card-sold {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: var(--radius-full, 9999px);
  background: #0f172a; color: #fff;
  font-size: 11px; font-weight: var(--weight-semibold); letter-spacing: 0.04em; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}
/* Fiche produit : pastille « Vendu » à côté du prix */
.dw-asset-sold {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-full, 9999px);
  background: #0f172a; color: #fff;
  font-size: 12px; font-weight: var(--weight-semibold); letter-spacing: 0.04em; text-transform: uppercase;
  vertical-align: middle;
}
.dw-asset-sold svg { width: 14px; height: 14px; }

/* --- Livret card (700×700 image, gros taux) --- */
.livret-card {
  background: var(--dw-card);
  border-radius: var(--dw-radius);
  overflow: hidden;
  border: 1px solid var(--dw-border);
  box-shadow: var(--dw-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.livret-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1); }
.livret-card-image {
  aspect-ratio: 1 / 1;
  background: var(--slate-100);
  display: grid; place-items: center;
}
.livret-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.livret-card:hover .livret-card-image img { transform: scale(1.03); }
.livret-card-body { padding: var(--space-4) var(--space-5) var(--space-5); }
.livret-card-rate {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--client-primary);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
  .livret-card-rate { font-size: var(--text-4xl); }
}
.livret-card-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-1);
}
.livret-card-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}


/* Bottom-sheet : boutons de validation au-dessus de la home bar iPhone */
@media (max-width: 640px) {
  body[data-client-zone] .modal-footer {
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  }
}

/* Titres produits : 2 lignes max dans la grille catalogue */
.product-card-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tap : pas de flash gris sur les éléments interactifs (iOS/Android) */
body[data-client-zone] button,
body[data-client-zone] a,
body[data-client-zone] summary {
  -webkit-tap-highlight-color: transparent;
}

/* ── Bannières pub de l'accueil client (carte du rail droit, sous les livrets) ── */
.dw-banner-list { display: flex; flex-direction: column; gap: var(--space-4); }
/* Cadre façon photo : marge intérieure, liseré fin, ombre douce ; la fenêtre
   intérieure porte le format et recadre l'image. */
.dw-banner {
  display: block; width: 100%; box-sizing: border-box;
  padding: 8px;
  border: 1px solid var(--dw-border);
  border-radius: var(--dw-radius);
  background: var(--dw-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px -8px rgba(15, 23, 42, 0.18);
  color: inherit;
}
.dw-banner-img {
  display: block; width: 100%; overflow: hidden;
  border-radius: calc(var(--dw-radius) - 6px);
  background: var(--dw-bg);
}
.dw-banner-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dw-banner.is-auto .dw-banner-img img { height: auto; }
a.dw-banner { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
a.dw-banner:hover {
  transform: translateY(-2px);
  border-color: var(--client-primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 28px -10px rgba(15, 23, 42, 0.28);
}
html[data-client-theme="dark"] body[data-client-zone] .dw-banner {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px -8px rgba(0, 0, 0, 0.6);
}
