/* =========================================================
   PRETTIEST - assistante de discussion
   ========================================================= */
.chat {
  --chat-w: 380px;
  position: fixed; right: 24px; bottom: 24px; z-index: 150;
  font-family: var(--mono);
}

/* ---------- Bouton ---------- */
.chat__launcher {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: var(--charcoal); color: var(--white);
  border: 1px solid rgba(255, 255, 255, .18);
  font: inherit; font-size: var(--text-ui); letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(21, 21, 21, .25);
  transition: background .3s var(--ease-out), transform .3s var(--ease-out);
}
.chat__launcher:hover { background: var(--rose); transform: translateY(-2px); }
.chat__launcher svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.chat.is-open .chat__launcher { opacity: 0; pointer-events: none; transform: translateY(8px); }

/* ---------- Fenêtre ---------- */
.chat__panel {
  position: absolute; right: 0; bottom: 0;
  width: var(--chat-w); height: min(560px, calc(100vh - 140px));
  display: flex; flex-direction: column;
  background: var(--white); color: var(--black);
  border: 1px solid var(--charcoal);
  box-shadow: 0 24px 60px rgba(21, 21, 21, .28);
  opacity: 0; transform: translateY(16px); transform-origin: bottom right;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.chat.is-open .chat__panel { opacity: 1; transform: none; }
.chat__panel[hidden] { display: none; }

.chat__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: var(--charcoal); color: var(--white);
}
.chat__title {
  font-family: var(--display); font-stretch: 125%; font-weight: 800;
  font-size: 16px; letter-spacing: 0.12em;
}
.chat__status { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: var(--text-caption); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }
.chat__status i { width: 7px; height: 7px; background: #5fbf7f; }
.chat__close { width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 1px solid rgba(255, 255, 255, .25); color: inherit; cursor: pointer; }
.chat__close:hover { border-color: var(--white); }
.chat__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; }

/* ---------- Messages ---------- */
.chat__log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  background: #faf8f6;
}
.chat__msg { max-width: 86%; font-size: 13px; line-height: 1.6; animation: chat-in .35s var(--ease-out); }
.chat__msg p { padding: 11px 14px; }
.chat__msg--bot p { background: var(--white); border: 1px solid var(--ash); }
.chat__msg--bot b { font-weight: 700; }
.chat__msg--user { align-self: flex-end; }
.chat__msg--user p { background: var(--charcoal); color: var(--white); }
@keyframes chat-in { from { opacity: 0; transform: translateY(6px); } }

.chat__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat__action {
  padding: 9px 12px;
  background: var(--rose); color: var(--white); border: 0;
  font: inherit; font-size: var(--text-small); letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .25s;
}
.chat__action:hover { background: var(--charcoal); }

.chat__typing p { display: flex; gap: 4px; }
.chat__typing i { width: 6px; height: 6px; background: var(--charcoal); opacity: .3; animation: chat-dot 1s infinite; }
.chat__typing i:nth-child(2) { animation-delay: .15s; }
.chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 50% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Suggestions ---------- */
.chat__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px; background: #faf8f6; }
.chat__chips:not(:empty) { padding-bottom: 12px; }
.chat__chip {
  padding: 7px 11px;
  background: var(--white); color: var(--charcoal);
  border: 1px solid var(--charcoal);
  font: inherit; font-size: var(--text-small); letter-spacing: 0.04em;
  cursor: pointer; transition: background .25s, color .25s;
}
.chat__chip:hover { background: var(--charcoal); color: var(--white); }

/* ---------- Saisie ---------- */
.chat__form { display: flex; border-top: 1px solid var(--ash); }
.chat__input {
  flex: 1; min-width: 0; padding: 16px 18px;
  border: 0; background: var(--white); color: var(--black);
  font: inherit; font-size: 14px;
}
.chat__input:focus { outline: none; }
.chat__send { width: 56px; display: grid; place-items: center; background: var(--charcoal); color: var(--white); border: 0; cursor: pointer; }
.chat__send:hover { background: var(--rose); }
.chat__send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .chat { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .chat__launcher { padding: 13px; }
  .chat__launcher span { display: none; }
  .chat__launcher svg { width: 22px; height: 22px; }
  body:has(.lp-sticky.is-visible) .chat { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .chat.is-open { left: 0; right: 0; bottom: 0; }
  .chat__panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; height: min(78vh, 620px); border-width: 1px 0 0; }
  .chat__input { font-size: 16px; }
}

/* =========================================================
   TYPOGRAPHIE v2 - serif (titres) + sans douce (texte)
   ========================================================= */
.chat { font-family: var(--ui); }
.chat__title {
  font-family: var(--display); font-stretch: normal; font-weight: 600;
  font-size: 21px; letter-spacing: 0.01em; text-transform: none; line-height: 1.1;
}
.chat__status { font-size: var(--text-caption); letter-spacing: 0.08em; color: rgba(255, 255, 255, .78); }
.chat__msg { font-size: 15px; line-height: 1.55; }
.chat__msg--bot b { font-weight: 600; }
.chat__action { font-size: 12.5px; letter-spacing: 0.08em; font-weight: 500; }
.chat__chip { font-size: 13px; letter-spacing: 0.01em; }
.chat__input { font-size: 15px; }
@media (max-width: 720px) { .chat__input { font-size: 16px; } }

@media (prefers-reduced-motion: reduce) {
  .chat__panel, .chat__msg, .chat__typing i { animation: none; transition: none; }
}
