/* =====================================================================
 * CV Compagnon — Barre sticky bottom
 * V1 MVP — esthétique Claude Design + structure spec
 * Spec : /000-architecture/26-ASSISTANT-PROACTIF-BANDEAU/03-mapping-templates-boutons.md
 * ===================================================================== */

/* ===== Variables CSS (héritent du thème si présent) ===== */
:root {
  --lf-cb-bg: #24332A;
  --lf-cb-text: #FBFAF5;
  --lf-cb-text-muted: rgba(251, 250, 245, .7);
  --lf-cb-text-dim: rgba(251, 250, 245, .4);
  --lf-cb-border: rgba(251, 250, 245, .15);
  --lf-cb-border-hover: rgba(251, 250, 245, .35);
  --lf-cb-primary: #B08867;
  --lf-cb-primary-hover: #C09A78;
  --lf-cb-brand: #6B7F6C;
  --lf-cb-h-desktop: 80px;
  --lf-cb-h-tablet: 72px;
  --lf-cb-h-mobile: 64px;
  --lf-cb-z: 9990;
}

/* ===== Padding-bottom du body pour éviter le recouvrement ===== */
body.has-cv-compagnon {
  padding-bottom: var(--lf-cb-h-desktop);
}
@media (max-width: 1024px) {
  body.has-cv-compagnon { padding-bottom: var(--lf-cb-h-tablet); }
}
@media (max-width: 768px) {
  body.has-cv-compagnon { padding-bottom: var(--lf-cb-h-mobile); }
}

/* ===== Quand un message d'accroche est présent → +36px de padding ===== */
body.has-cv-compagnon.has-cv-compagnon-message {
  padding-bottom: calc(var(--lf-cb-h-desktop) + 36px);
}
@media (max-width: 1024px) {
  body.has-cv-compagnon.has-cv-compagnon-message {
    padding-bottom: calc(var(--lf-cb-h-tablet) + 36px);
  }
}
@media (max-width: 768px) {
  body.has-cv-compagnon.has-cv-compagnon-message {
    padding-bottom: calc(var(--lf-cb-h-mobile) + 36px);
  }
}

/* ===== Pages où le Compagnon est SUPPRIMÉ temporairement (modale, lightbox, etc.) ===== */
body.lf-cb-suppressed.has-cv-compagnon {
  padding-bottom: 0;
}

/* ===== Conteneur principal ===== */
/*
 * V2.0.2 : passage à animation 100% CSS-first.
 * État par défaut = VISIBLE. L'animation @keyframes se rejoue au load.
 * Si JS échoue (Edge tracking prevention, nav privée stricte, etc.) → barre toujours visible.
 */
.lf-cb {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--lf-cb-z);
  background: var(--lf-cb-bg);
  border-top: 1px solid rgba(176, 136, 103, .25);
  box-shadow: 0 -10px 40px -16px rgba(36, 51, 42, .35);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--lf-cb-text);
  -webkit-font-smoothing: antialiased;

  /* État par défaut visible (robuste) */
  opacity: 1;
  transform: translateY(0);

  /* Animation d'entrée — both = applique 'from' avant + 'to' après l'animation */
  animation: lfCbSlideUp .9s cubic-bezier(.22, .61, .36, 1) both;
  will-change: transform, opacity;
}

@keyframes lfCbSlideUp {
  from {
    opacity: 0;
    transform: translateY(130%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Animation STAGGERED des éléments internes =====
 * Chaque sous-élément apparaît un par un avec animation-delay incrémental.
 * État par défaut visible (robuste sans JS).
 */
.lf-cb__avatar,
.lf-cb__identity,
.lf-cb__actions > *,
.lf-cb__toggle {
  opacity: 1;
  transform: translateY(0);
  animation: lfCbItemFadeUp .55s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes lfCbItemFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lf-cb__avatar    { animation-delay: .15s; }
.lf-cb__identity  { animation-delay: .23s; }
.lf-cb__actions > *:nth-child(1) { animation-delay: .31s; }
.lf-cb__actions > *:nth-child(2) { animation-delay: .39s; }
.lf-cb__actions > *:nth-child(3) { animation-delay: .47s; }
.lf-cb__actions > *:nth-child(4) { animation-delay: .55s; }
.lf-cb__actions > *:nth-child(5) { animation-delay: .63s; }
.lf-cb__actions > *:nth-child(6) { animation-delay: .71s; }
.lf-cb__toggle    { animation-delay: .79s; }

/* La classe .is-visible n'est plus nécessaire (animation auto au load) — gardée pour compat JS */
.lf-cb.is-visible { opacity: 1; transform: translateY(0); }

.lf-cb__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== Message d'accroche (V2 — suggested_message au-dessus des boutons) ===== */
.lf-cb__message {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(251, 250, 245, .92);
  padding: 12px 4px 10px;
  border-bottom: 1px solid rgba(251, 250, 245, .08);
  margin-bottom: 0;
}
.lf-cb.has-message {
  /* Variante visuelle pour la barre quand il y a un message */
  --lf-cb-h-desktop: 116px;
}
@media (max-width: 768px) {
  .lf-cb.has-message {
    --lf-cb-h-mobile: 100px;
  }
  .lf-cb__message {
    font-size: 13.5px;
    padding: 10px 4px 8px;
  }
}

.lf-cb__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--lf-cb-h-desktop);
  padding: 14px 0;
}

/* ===== Avatar flamme ===== */
.lf-cb__avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6B7F6C 0%, #8FA391 100%);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 0 1px rgba(251, 250, 245, .12);
}
.lf-cb__avatar svg {
  width: 26px;
  height: 26px;
  stroke: var(--lf-cb-text);
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lf-cb__avatar::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #9BC2A4;
  border: 2px solid var(--lf-cb-bg);
}

/* ===== Identité ===== */
.lf-cb__identity {
  min-width: 0;
  flex: 0 0 auto;
}
.lf-cb__name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 18px;
  line-height: 1.15;
  color: var(--lf-cb-text);
}
.lf-cb__name em {
  color: #C7CFC4;
  font-style: italic;
}
.lf-cb__status {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lf-cb-text-dim);
  font-weight: 500;
  margin-top: 4px;
}

/* ===== Conteneur des actions (scrollable horizontalement si débordement) ===== */
.lf-cb__actions {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lf-cb__actions::-webkit-scrollbar { display: none; }

/* ===== Boutons d'action ===== */
.lf-cb__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--lf-cb-border);
  background: transparent;
  color: var(--lf-cb-text);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.lf-cb__btn:hover,
.lf-cb__btn:focus {
  background: rgba(251, 250, 245, .08);
  border-color: var(--lf-cb-border-hover);
  color: var(--lf-cb-text);
  text-decoration: none;
  outline: none;
}
.lf-cb__btn:focus-visible {
  outline: 2px solid var(--lf-cb-primary);
  outline-offset: 2px;
}
.lf-cb__btn:active {
  transform: scale(0.98);
}
.lf-cb__btn--primary {
  background: var(--lf-cb-primary);
  color: var(--lf-cb-bg);
  border-color: var(--lf-cb-primary);
  font-weight: 600;
}
.lf-cb__btn--primary:hover,
.lf-cb__btn--primary:focus {
  background: var(--lf-cb-primary-hover);
  border-color: var(--lf-cb-primary-hover);
  color: var(--lf-cb-bg);
}
.lf-cb__btn--tertiary {
  border-color: transparent;
  color: var(--lf-cb-text-muted);
}
.lf-cb__btn--tertiary:hover {
  color: var(--lf-cb-text);
  border-color: var(--lf-cb-border);
}

.lf-cb__btn-icon {
  display: inline-flex;
  align-items: center;
}
.lf-cb__btn-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== Bouton toggle (chevron déployer) ===== */
.lf-cb__toggle {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--lf-cb-border);
  background: transparent;
  color: var(--lf-cb-text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .15s ease;
}
.lf-cb__toggle:hover {
  color: var(--lf-cb-text);
  border-color: var(--lf-cb-border-hover);
  background: rgba(251, 250, 245, .06);
}
.lf-cb__toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease;
}
.lf-cb.is-open .lf-cb__toggle svg {
  transform: rotate(180deg);
}

/* ===== Responsive ===== */

/* Tablette */
@media (max-width: 1024px) {
  .lf-cb__identity { display: none; }
  .lf-cb__bar {
    min-height: var(--lf-cb-h-tablet);
    gap: 12px;
  }
  .lf-cb__avatar {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }
  .lf-cb__avatar svg {
    width: 22px;
    height: 22px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .lf-cb__bar {
    min-height: var(--lf-cb-h-mobile);
    gap: 10px;
    padding: 10px 0;
  }
  .lf-cb__inner {
    padding: 0 16px;
  }
  .lf-cb__avatar {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
  .lf-cb__avatar svg {
    width: 20px;
    height: 20px;
  }
  .lf-cb__avatar::after {
    width: 9px;
    height: 9px;
  }
  .lf-cb__btn {
    padding: 8px 12px;
    font-size: 12.5px;
  }
  .lf-cb__btn-icon svg {
    width: 14px;
    height: 14px;
  }
  .lf-cb__toggle {
    width: 32px;
    height: 32px;
  }
}

/* ===== Format CHIPS (variantes intent_news_browsing) ===== */
.lf-cb--format-chips .lf-cb__actions {
  gap: 14px;
  justify-content: flex-start;
}
.lf-cb__btn--chip-equal {
  flex: 1 1 0;
  min-width: 0;
  max-width: 480px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(251, 250, 245, .15);
  background: rgba(251, 250, 245, .04);
  color: var(--lf-cb-text);
  text-decoration: none;
  white-space: normal;
}
.lf-cb__btn--chip-equal:hover {
  background: rgba(251, 250, 245, .08);
  border-color: rgba(251, 250, 245, .35);
}
.lf-cb__chip-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--lf-cb-primary);
  font-size: 18px;
}
.lf-cb__chip-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lf-cb__chip-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lf-cb__chip-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(251, 250, 245, .5);
  font-weight: 500;
}
.lf-cb