/* ================================================
   pages.css — Annonce, Messagerie, Profil, Carte,
               Comparateur, Vitrine éditeur, Analytics
   ================================================ */

/* ════════════════════════════════════════════════
   ANNONCE DETAIL (annonce.html)
   ════════════════════════════════════════════════ */

/* Galerie */
.annonce-img-wrap {
  grid-area: img;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--s1);
  border: 1px solid var(--border);
  position: relative;
  min-width: 0;
}

.annonce-img-main {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--s2);
  position: relative;
}
.annonce-img-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}


.annonce-aside {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
}

/* Séparateur aside */
.aside-divider {
  border: none;
  border-top: 1px solid rgba(var(--cyan-rgb),.08);
  margin: 1rem 0;
}

/* Vendeur */
.aside-vendeur {
  display: flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
}
.aside-vendeur .vendeur-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}
.aside-vendeur .vendeur-sub {
  font-size: .75rem;
  color: var(--muted);
}
.aside-vendeur .stars { font-size: .75rem; }

/* Boutons contact aside */
.aside-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }

/* Bouton "voir le numéro" */
.reveal-tel-btn { text-align: center; }

/* Bloc HistoVec — émis par renderHistovecBlock() dans script.js */
.histovec-block {
  padding: .85rem 1rem;
  border-radius: var(--r-s);
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid;
}
.histovec-ok    { background: rgba(0,220,100,.08); border-color: rgba(0,220,100,.25); color: #66e89a; }
.histovec-ask   { background: rgba(255,122,0,.08);  border-color: rgba(255,122,0,.25);  color: #ffa040; }
.histovec-empty { background: rgba(255,255,255,.03); border-color: var(--border);       color: var(--muted); }

/* Corps principal annonce */
.annonce-main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

/* Specs */
.annonce-specs {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
}
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem 1rem;
}
.spec-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.spec-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec-value {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
}

/* Section actions secondaires (partage, signalement, itinéraire) */
.annonce-actions-secondary {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(var(--cyan-rgb),.08);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

/* Chat IA zone */
#chatIAZone {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: 1rem;
  margin-top: .75rem;
}
/* Chat IA acheteur (annonce.html) — bulles émises dans #chatIAConv par ouvrirChatIA/chatIAAnnonce */
#chatIAConv { display: flex; flex-direction: column; gap: .5rem; }
.chat-ia-msg {
  padding: .55rem .8rem;
  border-radius: var(--r-s);
  font-size: .82rem;
  line-height: 1.5;
  max-width: 90%;
}
.chat-ia-msg strong {
  display: block;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .65;
  margin-bottom: .18rem;
}
.chat-ia-msg-user { background: rgba(var(--cyan-rgb),.12); color: var(--text); align-self: flex-end; }
.chat-ia-msg-bot  { background: var(--s2); color: var(--text-dim); align-self: flex-start; border: 1px solid var(--border); }

/* Mini-vitrine (carte boutique pro) — émise par _renderMiniVitrine (couleurs en inline) */
.vmc-card {
  display: block;
  max-width: 340px;
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  transition: transform var(--t), border-color var(--t);
}
.vmc-card:hover { transform: translateY(-2px); border-color: var(--cyan); }
.vmc-banner { min-height: 88px; display: flex; align-items: flex-end; padding: .7rem .8rem; }
.vmc-overlay-row { display: flex; align-items: center; gap: .6rem; width: 100%; }
.vmc-cta { padding: .55rem .8rem; text-align: center; font-weight: 700; font-size: .82rem; }

/* Sélection IA recherche — émise par afficherSelectionIA (insérée avant #resultats) */
#iaSelectionSection { margin-bottom: 1.5rem; }
.ia-selection-header { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .9rem; }
.ia-selection-title { font-size: 1.15rem; font-weight: 800; color: var(--cyan); }
.ia-selection-sub { font-size: .82rem; color: var(--muted); }
.ia-picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.ia-pick-wrap { display: flex; flex-direction: column; gap: .4rem; }
.ia-pick-raison {
  font-size: .78rem;
  color: var(--cyan);
  background: rgba(var(--cyan-rgb),.07);
  border: 1px solid rgba(var(--cyan-rgb),.2);
  border-radius: var(--r-s);
  padding: .4rem .6rem;
  line-height: 1.4;
}
.ia-selection-suite {
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* ════════════════════════════════════════════════
   RECHERCHE (recherche.html)
   ════════════════════════════════════════════════ */

.recherche-header {
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 64px;
  z-index: calc(var(--z-header) - 1);
}

.recherche-top-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  max-width: 1280px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.recherche-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  align-items: start;
}

.filtres-sidebar {
  position: sticky;
  top: 130px;
}

.resultats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.resultats-count {
  font-size: .88rem;
  color: var(--text-dim);
}
.resultats-count strong { color: var(--text); }

/* Vue liste / grille toggle */
.view-toggle {
  display: flex;
  gap: .25rem;
}
.view-toggle .btn-icon.active {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ════════════════════════════════════════════════
   MESSAGERIE (messagerie.html)
   ════════════════════════════════════════════════ */

.messagerie-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.conv-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--s1);
  min-height: 0;
}

.conv-header {
  padding: .85rem 1rem .6rem;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--s1);
  z-index: 1;
}

.conv-search {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--s1);
  z-index: 2;
}

.conv-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(var(--cyan-rgb),.05);
  transition: background var(--t);
}
.conv-item:hover     { background: rgba(var(--cyan-rgb),.05); }
.conv-item.active    { background: rgba(var(--cyan-rgb),.08); border-left: 2px solid var(--cyan); }
.conv-item.unread .conv-preview { color: var(--text); font-weight: 600; }

.conv-item .conv-info { flex: 1; min-width: 0; }
.conv-item .conv-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-item .conv-annonce {
  font-size: .72rem;
  font-weight: 600;
  color: var(--orange);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: .2rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.conv-item .conv-annonce .ti { flex-shrink: 0; font-size: .85rem; opacity: .85; }
.conv-item .conv-annonce-deleted { color: var(--muted); font-weight: 500; font-style: italic; }
.conv-item .conv-preview {
  font-size: .78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: .15rem;
}
.conv-item .conv-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
}
.conv-item .conv-date { font-size: .7rem; color: var(--muted); }
.conv-item .conv-unread-count {
  width: 18px; height: 18px;
  background: var(--cyan);
  color: var(--bg);
  font-size: .65rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Avatar initiales dans la liste de conversations (émis par chargerConversations) */
.conv-avatar {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg,#0d1f60 0%,#1e3a9a 100%);
  border: 1px solid rgba(var(--cyan-rgb),.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 800;
  color: var(--cyan);
  font-family: 'Inter', sans-serif;
}

/* Badge compteur non-lus (liste conv + compteur nav #compteurMessagesNav) */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--cyan);
  color: var(--bg);
  font-size: .65rem;
  font-weight: 800;
  border-radius: 999px;
  line-height: 1;
}
.conv-name .unread-badge { margin-left: .35rem; vertical-align: middle; }

/* Zone de chat */
.chat-zone {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-height: 0;
  position: relative;
}

.chat-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--s1);
  flex-shrink: 0;
}
.chat-header .chat-annonce-thumb {
  width: 50px;
  height: 36px;
  border-radius: var(--r-s);
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Bloc nom + titre annonce dans le header de conv */
.chat-header-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.chat-header-nom {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header-titre {
  font-size: 0.78rem;
  color: var(--orange);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thumbnail annonce dans le header */
.chat-annonce-thumb-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.2rem 0.4rem;
  transition: background .15s;
}
.chat-annonce-thumb-link:hover { background: rgba(var(--cyan-rgb), .08); }
.chat-annonce-thumb-img {
  width: 48px;
  height: 34px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--s2);
}
.chat-annonce-thumb-label {
  font-size: 0.75rem;
  color: var(--orange);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Bouton retour mobile (liste ⇄ chat) — masqué en desktop */
.chat-back-btn {
  display: none;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--cyan-rgb), .12);
  border: 1.5px solid rgba(var(--cyan-rgb), .25);
  color: var(--cyan);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background .18s;
}
.chat-back-btn:hover { background: rgba(var(--cyan-rgb), .2); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.message-bubble {
  max-width: 72%;
  padding: .65rem .9rem;
  border-radius: var(--r);
  font-size: .88rem;
  line-height: 1.5;
  color: var(--text);
}
.message-bubble.sent {
  background: rgba(var(--cyan-rgb),.15);
  border: 1px solid rgba(var(--cyan-rgb),.2);
  align-self: flex-end;
  border-radius: var(--r) var(--r-s) var(--r) var(--r);
}
.message-bubble.received {
  background: var(--s2);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-radius: var(--r-s) var(--r) var(--r) var(--r);
}
.message-time {
  font-size: .65rem;
  color: var(--muted);
  margin-top: .25rem;
  text-align: right;
}

/* ── Pièces jointes messagerie ──────────────────────────────── */
.attachment-bubble {
  max-width: 280px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--s2);
  border: 1px solid var(--border);
}
.attachment-bubble.sent {
  background: rgba(var(--cyan-rgb),.1);
  border-color: rgba(var(--cyan-rgb),.22);
}
.attachment-img-link {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.attachment-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.attachment-filename {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  padding: .3rem .6rem .4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-pdf {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .85rem;
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
}
.attachment-pdf .ti {
  color: #ef4444;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.attachment-pdf span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-pdf:hover { color: var(--cyan); }

/* ── Preview fichiers sélectionnés (avant envoi) — émise par renderFilePreview() dans script.js ── */
.chat-file-preview {
  border-top: 1px solid var(--border);
  background: rgba(var(--cyan-rgb),.03);
  padding: .6rem .9rem .5rem;
}
.chat-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .5rem;
}
.chat-file-chip {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-s);
  padding: .25rem .4rem .25rem .3rem;
  max-width: 190px;
  min-width: 0;
}
.chat-file-thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.chat-file-pdf-icon {
  font-size: 1.3rem;
  color: #ef4444;
  flex-shrink: 0;
}
.chat-file-name {
  font-size: .73rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.chat-file-remove {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: .72rem;
  transition: background .14s, color .14s;
}
.chat-file-remove:hover { background: rgba(239,68,68,.18); color: #ef4444; }
/* Barre de progression */
.chat-upload-progress-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .5rem;
}
.chat-upload-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--s2);
  border-radius: 3px;
  overflow: hidden;
}
.chat-upload-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 3px;
  transition: width .35s ease;
  width: 0%;
}
.chat-upload-label {
  font-size: .73rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 110px;
  text-align: right;
}
/* Bouton envoyer les fichiers */
.chat-file-actions {
  display: flex;
  justify-content: flex-end;
}
.btn-send-attach {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .32rem .75rem;
  background: var(--orange);
  color: #fff;
  border-radius: var(--r-s);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: filter .15s;
}
.btn-send-attach:hover:not(:disabled) { filter: brightness(1.1); }
.btn-send-attach:disabled { opacity: .45; cursor: not-allowed; }

/* Carte offre structurée — émise par _renderOfferBubble() dans script.js */
.offer-card {
  max-width: 320px;
  background: var(--s1);
  border: 1px solid rgba(255,200,0,.25);
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.offer-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffc800;
}
.offer-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Bulle d'offre : wrap + alignement gauche/droite (émis par _renderOfferBubble) */
.offer-wrap { display: flex; flex-direction: column; gap: .25rem; }
.offer-wrap-me   { align-items: flex-end; }
.offer-wrap-them { align-items: flex-start; }
.offer-title { font-size: .82rem; font-weight: 700; }
.offer-msg   { font-size: .85rem; line-height: 1.45; }
.offer-time  { font-size: .65rem; color: var(--muted); }
.offer-answered-tag { font-size: .72rem; font-style: italic; color: #6b7280; }

/* Boutons Accepter / Refuser / Contre-proposer (dans la carte beige) */
.offer-btn {
  flex: 1 1 80px;
  padding: .42rem .55rem;
  border: 1px solid transparent;
  border-radius: var(--r-s);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s;
}
.offer-btn:hover { filter: brightness(1.07); }
.offer-btn-accept  { background: rgba(16,185,129,.18); border-color: #10b981; color: #065f46; }
.offer-btn-refuse  { background: rgba(239,68,68,.14);  border-color: #ef4444; color: #991b1b; }
.offer-btn-counter { background: rgba(59,130,246,.14); border-color: #3b82f6; color: #1e40af; }

/* Bulle de réponse à une offre (couleurs portées en inline par le JS) */
.offer-response {
  max-width: 320px;
  padding: .55rem .85rem;
  border: 1px solid;
  border-radius: var(--r);
  font-size: .84rem;
  line-height: 1.45;
}

/* Modales offre / refus / contre-proposition (messagerie.html) */
.modal-offre-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-offre-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 520px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  padding: 1.5rem 1.6rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-offre-close {
  position: absolute; top: .75rem; right: .9rem;
  background: transparent; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--muted); padding: 0; line-height: 1;
}
.modal-offre-close:hover { color: var(--text); }
.modal-offre-title {
  font-size: 1.2rem; font-weight: 800;
  margin: 0 0 .85rem;
  color: var(--orange);
}
.modal-offre-vehicule {
  background: rgba(var(--gold-rgb),.1);
  border: 1px solid rgba(var(--gold-rgb),.25);
  border-radius: 8px;
  padding: .7rem .9rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  color: var(--text);
}
.modal-offre-row { margin-bottom: 1rem; }
.modal-offre-label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--text); margin-bottom: .35rem;
}
.modal-offre-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.modal-offre-actions {
  display: flex; gap: .6rem; justify-content: flex-end;
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 600px) {
  .modal-offre-card { padding: 1.2rem 1rem; }
  .modal-offre-actions { flex-direction: column-reverse; }
  .modal-offre-actions .btn { width: 100%; justify-content: center; }
}

/* Input zone */
.chat-input-zone {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--s1);
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input-zone textarea {
  flex: 1;
  min-height: 42px;
  max-height: 150px;
  resize: none;
  border-radius: var(--r-s);
  font-size: .88rem;
  padding: .55rem .8rem;
}

/* ════════════════════════════════════════════════
   PROFIL (profil.html)
   ════════════════════════════════════════════════ */

.profil-hero {
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 1.5rem 0;
}
.profil-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.profil-identity {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profil-avatar-big {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--s3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
  overflow: hidden;
}
.profil-avatar-big img { width: 100%; height: 100%; object-fit: cover; }

.profil-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: .3rem;
}
.profil-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: var(--r-s);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.plan-free         { background: rgba(255,255,255,.06); color: var(--text-dim); border: 1px solid var(--border); }
.plan-particulier  { background: rgba(0,220,100,.1); color: #00dc64; border: 1px solid rgba(0,220,100,.2); }
.plan-pro_starter  { background: rgba(var(--cyan-rgb),.1); color: var(--cyan); border: 1px solid rgba(var(--cyan-rgb),.2); }
.plan-pro_business { background: linear-gradient(135deg, rgba(var(--cyan-rgb),.15), rgba(0,100,255,.1)); color: var(--cyan); border: 1px solid rgba(var(--cyan-rgb),.3); }
.plan-pro_business_plus { background: linear-gradient(135deg, rgba(255,200,0,.15), rgba(255,122,0,.1)); color: #ffc800; border: 1px solid rgba(255,200,0,.3); }

.profil-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.profil-tabs::-webkit-scrollbar { display: none; }
.profil-tabs .tab-btn {
  flex-shrink: 0;
  padding: .7rem 1.2rem;
  font-size: .82rem;
}

/* Contenu tab */
.profil-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Barre de complétion profil */
.completion-bar-wrap {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.completion-score {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--cyan);
}
.completion-label {
  font-size: .82rem;
  color: var(--text-dim);
}
.completion-items {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}

/* Card annonce dans mes annonces */
.annonce-manage-card {
  display: flex;
  gap: 1rem;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .85rem;
  align-items: flex-start;
  transition: border-color var(--t);
}
.annonce-manage-card:hover { border-color: rgba(var(--cyan-rgb),.3); }
.annonce-manage-card .thumb {
  width: 110px;
  height: 75px;
  flex-shrink: 0;
  border-radius: var(--r-s);
  object-fit: cover;
  background: var(--s2);
}
.annonce-manage-card .manage-info { flex: 1; min-width: 0; }
.annonce-manage-card .manage-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.annonce-manage-card .manage-actions {
  display: flex;
  gap: .4rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}

/* Brouillon en cours */
.draft-banner {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: rgba(var(--cyan-rgb),.07);
  border: 1px solid rgba(var(--cyan-rgb),.2);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* ─── ABONNEMENT ─────────────────────────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.plan-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--t);
}
.plan-card:hover {
  border-color: rgba(var(--cyan-rgb),.35);
  box-shadow: var(--cyan-glow);
}
.plan-card.recommended {
  border-color: rgba(var(--cyan-rgb),.4);
  background: linear-gradient(135deg, var(--s1), rgba(0,50,100,.15));
}
.plan-card .plan-name  { font-size: .88rem; font-weight: 700; color: var(--text-dim); margin-bottom: .5rem; }
.plan-card .plan-price { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.plan-card .plan-price sup { font-size: 1rem; font-weight: 600; vertical-align: super; }
.plan-card .plan-period { font-size: .75rem; color: var(--muted); margin-bottom: 1rem; }
.plan-features {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.25rem;
  font-size: .82rem;
  color: var(--text-dim);
}
.plan-features li::before { content: '✓ '; color: var(--cyan); font-weight: 700; }

/* ════════════════════════════════════════════════
   CARTE (carte.html)
   ════════════════════════════════════════════════ */

#mapWrap {
  display: flex;
  height: calc(100vh - 64px);
  position: relative;
}

#map {
  flex: 1;
  position: relative;
  z-index: 1;
}

.map-sidebar {
  width: 340px;
  flex-shrink: 0;
  background: var(--s1);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  z-index: 2;
}
.map-sidebar-header {
  position: sticky;
  top: 0;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
  padding: .85rem 1rem;
  z-index: 3;
}
.map-sidebar-results {
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* Popup map */
.leaflet-popup-content-wrapper {
  background: var(--s1) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.5) !important;
  color: var(--text) !important;
}
.leaflet-popup-tip { background: var(--s1) !important; }
.leaflet-popup-content { margin: .75rem !important; min-width: 200px; }

/* ════════════════════════════════════════════════
   COMPARATEUR (comparateur.html)
   ════════════════════════════════════════════════ */

.comparateur-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  overflow-x: auto;
  min-width: 0;
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.comp-table th {
  background: var(--s1);
  border: 1px solid var(--border);
  padding: 1rem;
  vertical-align: top;
  min-width: 200px;
  text-align: left;
}

.comp-table th:first-child {
  position: sticky;
  left: 0;
  background: var(--s2);
  z-index: 2;
  min-width: 140px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.comp-table td {
  border: 1px solid rgba(var(--cyan-rgb),.06);
  padding: .75rem 1rem;
  font-size: .85rem;
  color: var(--text-dim);
  vertical-align: middle;
}
.comp-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--s2);
  z-index: 1;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.comp-table tr:hover td { background: rgba(var(--cyan-rgb),.03); }

.comp-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--r-s);
  margin-bottom: .5rem;
}

.comp-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,60,60,.15);
  border: none;
  color: #ff6b6b;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  float: right;
  transition: background var(--t);
}
.comp-remove:hover { background: rgba(255,60,60,.3); }

.comp-best { color: #00dc64; font-weight: 700; }
.comp-worst { color: #ff6b6b; }

/* ════════════════════════════════════════════════
   ANALYTICS PRO (pro_analytics)
   ════════════════════════════════════════════════ */

.analytics-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Graphe bâtons CSS */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  padding-bottom: .25rem;
}
.chart-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: var(--cyan-dim);
  border: 1px solid rgba(var(--cyan-rgb),.15);
  min-height: 2px;
  cursor: pointer;
  transition: background var(--t);
}
.chart-bar:hover { background: rgba(var(--cyan-rgb),.3); }

/* Heatmap horaire */
.heatmap-grid {
  display: grid;
  grid-template-columns: 60px repeat(24, 1fr);
  gap: 2px;
  font-size: .65rem;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--s3);
  transition: opacity var(--t);
}

/* Scatter marché */
.scatter-wrap {
  position: relative;
  height: 300px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.scatter-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(var(--cyan-rgb),.5);
  border: 1px solid var(--cyan);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform var(--t);
}
.scatter-dot.current {
  background: var(--orange);
  border-color: var(--orange);
  z-index: 2;
  width: 14px;
  height: 14px;
}
.scatter-dot:hover { transform: translate(-50%, -50%) scale(1.5); }

/* ════════════════════════════════════════════════
   VITRINE ÉDITEUR (dans profil.html)
   ════════════════════════════════════════════════ */

.vitrine-editor-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.vitrine-editor-panel {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
}

.vitrine-img-preview {
  width: 100%;
  aspect-ratio: 16/5;
  border-radius: var(--r-s);
  border: 1px solid var(--border);
  background: var(--s2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.vitrine-logo-preview {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--s2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
  margin: 0 auto;
}

/* ════════ Sélecteur de thèmes vitrine (éditeur profil) ════════
   NB : les classes ci-dessous correspondent à ce qu'émet
   _vitrineRenderThemes() dans script.js (.is-active / .is-locked /
   .vitrine-theme-meta / .vitrine-theme-lock). Les anciens noms
   (.selected/.locked/.theme-preview/.theme-name) étaient morts. */
.vitrine-themes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
}
@media (max-width: 900px) { .vitrine-themes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .vitrine-themes-grid { grid-template-columns: 1fr; } }

.vitrine-theme-card {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--s2);
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.vitrine-theme-card:not(.is-locked):hover {
  border-color: rgba(var(--cyan-rgb),.5);
  transform: translateY(-2px);
}
.vitrine-theme-card.is-active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 8px 22px rgba(var(--cyan-rgb),.18);
}
.vitrine-theme-card.is-locked {
  opacity: .5;
  cursor: not-allowed;
}
.vitrine-theme-card.is-locked .vitrine-theme-preview { filter: grayscale(.6); }

/* mini-mockup (contenu inline généré par le JS) */
.vitrine-theme-preview { display: block; }

/* libellé + description sous la preview */
.vitrine-theme-meta {
  padding: .6rem .7rem;
  background: var(--s1);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .18rem;
}
.vitrine-theme-meta strong {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}
.vitrine-theme-card.is-active .vitrine-theme-meta strong { color: var(--cyan); }
.vitrine-theme-meta span {
  font-size: .73rem;
  line-height: 1.35;
  color: var(--muted);
}
.vitrine-theme-lock {
  margin-top: .15rem;
  font-size: .66rem;
  font-weight: 600;
  color: #f59e0b;
}

/* ════════ Cases à cocher (Services proposés / Affichage) ════════ */
.vitrine-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}
.vitrine-options-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
@media (max-width: 480px) { .vitrine-options-grid { grid-template-columns: 1fr; } }

.vitrine-opt-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .65rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .84rem;
  line-height: 1.3;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.vitrine-opt-row:hover { border-color: rgba(var(--cyan-rgb),.4); }
.vitrine-opt-row input[type="checkbox"] {
  accent-color: var(--cyan);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}
.vitrine-opt-row:has(input:checked) {
  border-color: var(--cyan);
  background: rgba(var(--cyan-rgb),.07);
}

/* Bandeau vitrine sur annonce.html */
.vitrine-link-bandeau {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1rem;
  background: rgba(var(--cyan-rgb),.05);
  border: 1px solid rgba(var(--cyan-rgb),.15);
  border-radius: var(--r-s);
  font-size: .82rem;
  color: var(--cyan);
  text-decoration: none;
  transition: all var(--t);
}
.vitrine-link-bandeau:hover {
  background: var(--cyan-dim);
  border-color: var(--cyan);
}
.vitrine-link-bandeau img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ════════════════════════════════════════════════
   PAGES LÉGALES / ARTICLE / GUIDE
   ════════════════════════════════════════════════ */

.legal-content,
.art-content {
  max-width: 820px;
  margin: 2rem auto;
  padding: 0 1.5rem 4rem;
  font-size: .92rem;
  color: var(--text-dim);
  line-height: 1.8;
}

.legal-content h1,
.art-content h1 { font-size: 1.8rem; margin-bottom: 1.5rem; }

.legal-content h2,
.art-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 .75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(var(--cyan-rgb),.08);
}

.legal-content h3,
.art-content h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 1.25rem 0 .5rem; }

.legal-content p,
.art-content p { margin-bottom: .75rem; }

.legal-content ul,
.art-content ul { padding-left: 1.4rem; margin-bottom: .75rem; }
.legal-content li,
.art-content li { list-style: disc; margin-bottom: .3rem; color: var(--text-dim); }

/* Guides listing */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.guide-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  transition: all var(--t);
}
.guide-card:hover { border-color: rgba(var(--cyan-rgb),.35); box-shadow: var(--cyan-glow); transform: translateY(-2px); }
.guide-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.guide-card .guide-body { padding: 1rem; }
.guide-card .guide-cat { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: .4rem; }
.guide-card .guide-title { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }

/* ════════════════════════════════════════════════
   RESPONSIVE PAGES
   ════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .recherche-layout {
    grid-template-columns: 260px 1fr;
  }

  .vitrine-editor-wrap { grid-template-columns: 1fr; }

  #mapWrap { flex-direction: column; height: auto; }
  #map { height: 50vh; }
  .map-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 768px) {
  .recherche-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .filtres-sidebar { position: static; }

  .messagerie-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 64px);
  }
  /* Master/détail plein écran : liste seule par défaut, chat seul une fois ouvert */
  .messagerie-layout .conv-list {
    border-right: none;
    height: auto;
  }
  .messagerie-layout .chat-zone { display: none; }
  .messagerie-layout.chat-open .conv-list { display: none; }
  .messagerie-layout.chat-open .chat-zone { display: flex; }
  .chat-back-btn { display: inline-flex; }

  /* Header de conv mobile : compact, sans le label texte dupliqué */
  .chat-header { padding: .6rem .85rem; gap: .6rem; }
  .chat-header-nom { font-size: .92rem; }
  .chat-header-titre { font-size: .72rem; }
  .chat-annonce-thumb-label { display: none; }
  .chat-annonce-thumb-img { width: 40px; height: 28px; }
  .chat-annonce-thumb-link { padding: 0.15rem; }

  .profil-identity { flex-direction: column; gap: 1rem; }
  .profil-hero { padding: 1.5rem 1rem 0; }
  .profil-content { padding: 1rem; }

  .comp-table th:first-child,
  .comp-table td:first-child {
    position: static;
  }
  .comp-table th { min-width: 140px; }

  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }

  .plans-grid { grid-template-columns: 1fr; max-width: 380px; }
}

@media (max-width: 480px) {
  .specs-grid     { grid-template-columns: repeat(2, 1fr); }

  .analytics-kpis { grid-template-columns: 1fr; }

  .message-bubble { max-width: 88%; }


}
