/* LineaPix Chat — widget Léon */
#lpchat-root {
  --lp-orange: #F47C5A;
  --lp-orange-dark: #d9623f;
  --lp-night: #2E3336;
  --lp-yellow: #FFD166;
  --lp-cream: #FCF7F1;
  --lp-peach: #FFF4EE;
  --lp-line: #EEE6DC;
  font-family: 'Poppins', Arial, sans-serif;
  color: var(--lp-night);
}
#lpchat-root *, #lpchat-root *::before, #lpchat-root *::after { box-sizing: border-box; font-family: inherit; }

/* Bouton d'ouverture */
#lpchat-root .lpchat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 9998;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 18px 6px 6px; border: 0; border-radius: 999px;
  background: var(--lp-orange); color: #fff; cursor: pointer;
  font-size: 16px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(46, 51, 54, .25);
  transition: transform .15s ease, background .15s ease;
}
#lpchat-root .lpchat-launcher:hover { background: var(--lp-orange-dark); transform: translateY(-2px); }
#lpchat-root .lpchat-launcher:focus-visible { outline: 3px solid var(--lp-yellow); outline-offset: 3px; }
#lpchat-root .lpchat-launcher.is-hidden { display: none; }
#lpchat-root .lpchat-launcher-img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: contain; object-position: center; padding: 3px; background: #FCF7F1; border: 2px solid #fff;
}

/* Panneau */
#lpchat-root .lpchat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  width: 390px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 40px);
  display: none; flex-direction: column;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(46, 51, 54, .3);
}
#lpchat-root .lpchat-panel.is-open { display: flex; }

#lpchat-root .lpchat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--lp-night); color: #fff;
}
#lpchat-root .lpchat-header-img { width: 46px; height: 46px; border-radius: 50%; object-fit: contain; object-position: center; padding: 3px; background: #FCF7F1; }
#lpchat-root .lpchat-header-txt { flex: 1; min-width: 0; }
#lpchat-root .lpchat-title { font-size: 18px; font-weight: 700; line-height: 1.2; }
#lpchat-root .lpchat-subtitle { font-size: 13px; color: var(--lp-yellow); }
#lpchat-root .lpchat-close {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}
#lpchat-root .lpchat-close:hover { background: rgba(255, 255, 255, .2); }

/* Messages */
#lpchat-root .lpchat-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  background: var(--lp-cream);
  display: flex; flex-direction: column; gap: 10px;
}
#lpchat-root .lpchat-msg {
  max-width: 88%; padding: 10px 14px; border-radius: 16px;
  font-size: 16px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere;
}
#lpchat-root .lpchat-assistant { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
#lpchat-root .lpchat-user { align-self: flex-end; background: var(--lp-orange); color: #fff; border-bottom-right-radius: 4px; }
#lpchat-root .lpchat-msg a { color: var(--lp-orange-dark); font-weight: 600; text-decoration: underline; }
#lpchat-root .lpchat-user a { color: #fff; }

#lpchat-root .lpchat-typing { display: flex; gap: 5px; padding: 14px 16px; }
#lpchat-root .lpchat-typing span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--lp-orange);
  animation: lpchat-dot 1.2s infinite ease-in-out;
}
#lpchat-root .lpchat-typing span:nth-child(2) { animation-delay: .15s; }
#lpchat-root .lpchat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes lpchat-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* Suggestions */
#lpchat-root .lpchat-chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 4px; background: var(--lp-cream);
}
#lpchat-root .lpchat-chip {
  border: 2px solid var(--lp-orange); background: #fff; color: var(--lp-night);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 500; cursor: pointer;
}
#lpchat-root .lpchat-chip:hover { background: var(--lp-peach); }

/* Saisie */
#lpchat-root .lpchat-form {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--lp-line); background: #fff;
}
#lpchat-root .lpchat-input {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  padding: 10px 12px; border: 2px solid var(--lp-line); border-radius: 14px;
  font-size: 16px; line-height: 1.4; color: var(--lp-night); background: #fff;
}
#lpchat-root .lpchat-input:focus { outline: none; border-color: var(--lp-orange); }
#lpchat-root .lpchat-send {
  width: 46px; height: 46px; flex: 0 0 46px; border: 0; border-radius: 50%;
  background: var(--lp-orange); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#lpchat-root .lpchat-send:disabled { opacity: .5; cursor: default; }

#lpchat-root .lpchat-footer {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0 12px 10px; background: #fff; text-align: center;
}
#lpchat-root .lpchat-team {
  border: 0; background: none; color: var(--lp-night); font-size: 15px; font-weight: 600;
  text-decoration: underline; cursor: pointer; padding: 4px;
}
#lpchat-root .lpchat-note { font-size: 11px; color: #6b7275; line-height: 1.3; }

/* Bouton « Écrire à l'équipe » sous une réponse */
#lpchat-root .lpchat-teamcta { align-self: flex-start; margin-top: -2px; }
#lpchat-root .lpchat-teamcta-btn { background: var(--lp-peach); }

/* Formulaire équipe */
#lpchat-root .lpchat-teamform {
  align-self: stretch; background: #fff; border: 2px solid var(--lp-orange);
  border-radius: 14px; padding: 14px; font-size: 15px;
}
#lpchat-root .lpchat-teamform-title { margin: 0 0 4px; font-weight: 700; font-size: 16px; }
#lpchat-root .lpchat-teamform-help { margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
#lpchat-root .lpchat-teamform label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
#lpchat-root .lpchat-teamform input,
#lpchat-root .lpchat-teamform textarea {
  display: block; width: 100%; margin-top: 3px; padding: 9px 10px;
  border: 2px solid var(--lp-line); border-radius: 10px; font-size: 16px; font-weight: 400; color: var(--lp-night);
}
#lpchat-root .lpchat-teamform input:focus,
#lpchat-root .lpchat-teamform textarea:focus { outline: none; border-color: var(--lp-orange); }
#lpchat-root .lpchat-teamform-legal { margin: 2px 0 10px; font-size: 12px; color: #6b7275; }
#lpchat-root .lpchat-teamform-legal a { color: var(--lp-orange-dark); }
#lpchat-root .lpchat-teamform-actions { display: flex; gap: 8px; }
#lpchat-root .lpchat-teamform-send {
  flex: 1; border: 0; border-radius: 999px; padding: 11px; background: var(--lp-orange);
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
}
#lpchat-root .lpchat-teamform-send:disabled { opacity: .6; }
#lpchat-root .lpchat-teamform-cancel {
  border: 2px solid var(--lp-line); border-radius: 999px; padding: 9px 14px; background: #fff;
  color: var(--lp-night); font-size: 15px; cursor: pointer;
}
#lpchat-root .lpchat-teamform-error { margin: 8px 0 0; color: #b3261e; font-size: 14px; font-weight: 600; }
#lpchat-root .lpchat-teamform-error:empty { display: none; }

/* Mobile : plein écran */
@media (max-width: 575px) {
  #lpchat-root .lpchat-launcher { right: 12px; bottom: 12px; padding-right: 6px; }
  #lpchat-root .lpchat-launcher-label { display: none; }
  #lpchat-root .lpchat-panel {
    right: 0; bottom: 0; width: 100vw; max-width: 100vw;
    height: 100%; max-height: 100%; border-radius: 0;
  }
  html.lpchat-lock, html.lpchat-lock body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  #lpchat-root .lpchat-typing span { animation: none; }
  #lpchat-root .lpchat-launcher { transition: none; }
}
@media print { #lpchat-root { display: none; } }

/* 1.3.0 : bouton « Faire mon inventaire » (lien) */
#lpchat-root a.lpchat-chip { display: inline-block; text-decoration: none; }
