/* Assistant de vente Jelocalise — couleurs du site, assombries pour un contraste d'au moins 4,5:1 avec le texte (WCAG AA) */
#jla { --jla-brand: #1a73a8; --jla-brand-dark: #155f8b; --jla-brand-light: #35a0d9; --jla-ink: #1b3a57; --jla-text: #26323d; --jla-muted: #5b6875; --jla-line: #e3ebf2; --jla-soft: #f2f7fb;
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483000; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--jla-text); }
#jla *, #jla *::before, #jla *::after { box-sizing: border-box; }
#jla button { font: inherit; cursor: pointer; }
#jla svg { width: 20px; height: 20px; display: block; flex: none; }

.jla-bubble { display: flex; align-items: center; gap: 10px; margin-left: auto; height: 54px; padding: 0 20px 0 16px; border: 0; border-radius: 27px;
  background: var(--jla-brand); color: #fff; box-shadow: 0 8px 24px rgba(27, 58, 87, .28); transition: transform .15s, background .15s; }
.jla-bubble:hover { background: var(--jla-brand-dark); transform: translateY(-2px); }
.jla-bubble:focus-visible { outline: 3px solid var(--jla-ink); outline-offset: 3px; }
.jla-bubble svg { width: 24px; height: 24px; }
.jla-bubble-label { font-weight: 600; white-space: nowrap; }
.jla-open .jla-bubble { display: none; }

.jla-panel { display: none; flex-direction: column; width: 380px; height: min(620px, calc(100vh - 40px)); background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(27, 58, 87, .3); border: 1px solid var(--jla-line); }
.jla-open .jla-panel { display: flex; animation: jla-in .18s ease-out; }
@keyframes jla-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.jla-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--jla-ink); color: #fff; }
.jla-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--jla-brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex: none; }
.jla-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.jla-titles b { font-size: 15.5px; }
.jla-namerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.jla-always { flex: none; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 10px; background: rgba(76, 210, 138, .18); color: #bff0d4; white-space: nowrap; }
.jla-sub { font-size: 12.5px; opacity: .8; }
.jla-sub::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4cd28a; margin-right: 6px; vertical-align: 1px; }
.jla-icon { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; opacity: .85; }
.jla-icon:hover, .jla-icon:focus-visible { background: rgba(255, 255, 255, .14); opacity: 1; outline: none; }

.jla-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--jla-soft); display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.jla-msg { display: flex; }
.jla-text { max-width: 86%; padding: 9px 13px; border-radius: 14px; overflow-wrap: anywhere; }
.jla-assistant .jla-text { background: #fff; border: 1px solid var(--jla-line); border-bottom-left-radius: 4px; }
.jla-user { justify-content: flex-end; }
.jla-user .jla-text { background: var(--jla-brand); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.jla-text p { margin: 0 0 8px; }
.jla-text p:last-child, .jla-text ul:last-child { margin-bottom: 0; }
#jla .jla-text ul { margin: 0 0 8px; padding-left: 18px; list-style: disc outside; }
#jla .jla-text ol { margin: 0 0 8px; padding-left: 20px; list-style: decimal outside; }
#jla .jla-text li { margin: 2px 0; display: list-item; list-style: inherit; }
.jla-text a { color: var(--jla-brand-dark); font-weight: 600; text-decoration: underline; }
.jla-text strong { color: var(--jla-ink); }
.jla-typing .jla-text { min-height: 38px; min-width: 62px; position: relative; }
.jla-typing .jla-text::after { content: "• • •"; position: absolute; left: 14px; top: 8px; color: var(--jla-muted); letter-spacing: 1px; animation: jla-dots 1s infinite; }
@keyframes jla-dots { 50% { opacity: .3; } }

.jla-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; background: var(--jla-soft); }
.jla-chips:not(:empty) { padding-bottom: 10px; }
.jla-chip { border: 1px solid var(--jla-brand); background: #fff; color: var(--jla-brand-dark); border-radius: 16px; padding: 5px 12px; font-size: 13.5px; font-weight: 600; }
.jla-chip:hover, .jla-chip:focus-visible { background: var(--jla-brand); color: #fff; outline: none; }

.jla-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--jla-line); background: #fff; }
.jla-form textarea { flex: 1; resize: none; border: 1px solid var(--jla-line); border-radius: 12px; padding: 9px 12px; font: inherit; color: var(--jla-text); max-height: 120px; line-height: 1.4; background: #fff; margin: 0; }
.jla-form textarea:focus { outline: none; border-color: var(--jla-brand); box-shadow: 0 0 0 3px rgba(26, 115, 168, .2); }
.jla-send { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--jla-brand); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.jla-send:hover { background: var(--jla-brand-dark); }
.jla-send:disabled { opacity: .5; cursor: default; }
.jla-note { margin: 0; padding: 0 14px 10px; background: #fff; font-size: 11px; line-height: 1.4; color: var(--jla-muted); }
.jla-note a { color: inherit; text-decoration: underline; }

/* Sous une réponse : cartes produit et transmission à l'équipe */
.jla-has-extras { flex-direction: column; align-items: flex-start; gap: 8px; }
.jla-card { display: flex; gap: 10px; align-items: center; width: 86%; padding: 8px 10px; background: #fff; border: 1px solid var(--jla-line); border-radius: 12px; }
.jla-card img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; flex: none; background: var(--jla-soft); }
.jla-card-info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; font-size: 14px; }
.jla-card-name { color: var(--jla-ink); font-weight: 600; text-decoration: none; line-height: 1.3; }
.jla-card-name:hover { text-decoration: underline; }
.jla-card-price { color: var(--jla-text); }
.jla-card-add { margin-top: 4px; border: 0; border-radius: 16px; padding: 5px 12px; background: var(--jla-brand); color: #fff; font-size: 13.5px; font-weight: 600; }
.jla-card-add:hover, .jla-card-add:focus-visible { background: var(--jla-brand-dark); outline: none; }
.jla-card-add:disabled { opacity: .7; cursor: default; }
.jla-card-ok { margin-top: 4px; font-size: 13.5px; color: #1d6b3a; font-weight: 600; }
.jla-card-ok a { color: var(--jla-brand-dark); text-decoration: underline; }
.jla-handoff { width: 86%; padding: 14px; background: #fff; border: 1px solid var(--jla-line); border-top: 3px solid var(--jla-brand); border-radius: 14px;
  box-shadow: 0 4px 14px rgba(27, 58, 87, .08); font-size: 14px; animation: jla-in .2s ease-out; }
.jla-handoff form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.jla-handoff-head { display: flex; align-items: flex-start; gap: 10px; }
.jla-handoff-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--jla-soft); color: var(--jla-brand); display: flex; align-items: center; justify-content: center; }
#jla .jla-handoff-icon svg { width: 19px; height: 19px; }
.jla-handoff-htxt { min-width: 0; }
.jla-handoff-title { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--jla-ink); }
.jla-handoff-sub { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--jla-muted); }
.jla-handoff-field { display: flex; flex-direction: column; gap: 4px; }
#jla .jla-handoff-field label { font-size: 12.5px; font-weight: 600; color: var(--jla-ink); }
#jla .jla-handoff input, #jla .jla-handoff textarea { width: 100%; border: 1px solid #cfdbe6; border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 14px; line-height: 1.4; color: var(--jla-text); background: #fbfdfe; margin: 0; resize: vertical; transition: border-color .15s, box-shadow .15s, background .15s; }
#jla .jla-handoff textarea { min-height: 58px; }
.jla-handoff input::placeholder { color: #8a96a3; }
#jla .jla-handoff input:focus, #jla .jla-handoff textarea:focus { outline: none; background: #fff; border-color: var(--jla-brand); box-shadow: 0 0 0 3px rgba(26, 115, 168, .2); }
#jla .jla-handoff input[aria-invalid="true"] { border-color: #b42318; box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }
.jla-handoff-send { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; border: 0; border-radius: 21px; background: var(--jla-brand); color: #fff; font-weight: 600; font-size: 14.5px; transition: background .15s; }
#jla .jla-handoff-send svg { width: 17px; height: 17px; }
.jla-handoff-send:hover { background: var(--jla-brand-dark); }
.jla-handoff-send:focus-visible { outline: 3px solid var(--jla-ink); outline-offset: 2px; }
.jla-handoff-send:disabled { opacity: .65; cursor: default; }
.jla-handoff-busy .jla-handoff-send svg { animation: jla-dots 1s infinite; }
.jla-handoff-err { margin: 0; color: #b42318; font-size: 13px; }
.jla-handoff-err:empty { display: none; }
.jla-handoff-done { border-top-color: #1d8a4a; padding: 12px 14px; }
.jla-handoff-ok { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: #1d4d31; font-weight: 600; line-height: 1.4; }
.jla-handoff-check { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #1d8a4a; color: #fff; display: flex; align-items: center; justify-content: center; }
#jla .jla-handoff-check svg { width: 15px; height: 15px; }

/* Carte d'accueil */
#jla .jla-welcome { max-width: 100%; width: 100%; padding: 14px 14px 12px; border-radius: 16px; border-bottom-left-radius: 4px; }
#jla .jla-w-hi { margin: 0 0 2px; font-size: 15px; line-height: 1.4; color: var(--jla-text); }
#jla .jla-w-hi strong { color: var(--jla-brand-dark); }
#jla .jla-w-lead { margin: 8px 0 8px; font-size: 13px; font-weight: 600; color: var(--jla-muted); }
#jla .jla-w-list { display: flex; flex-direction: column; gap: 6px; }
#jla .jla-w-item { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 8px 10px; border: 1px solid var(--jla-line); border-radius: 12px; background: var(--jla-soft); color: var(--jla-text); text-align: left; font-size: 14px; line-height: 1.3; transition: background .15s, border-color .15s; }
#jla button.jla-w-item:not(:disabled):hover, #jla button.jla-w-item:focus-visible { background: #fff; border-color: var(--jla-brand); outline: none; }
#jla button.jla-w-item:not(:disabled):hover .jla-w-go { color: var(--jla-brand-dark); transform: translateX(2px); }
#jla .jla-w-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--jla-brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--jla-line); }
#jla .jla-w-ico svg { width: 17px; height: 17px; }
#jla .jla-w-label { flex: 1; min-width: 0; }
#jla .jla-w-go { flex: none; color: #9aa7b4; transition: transform .15s, color .15s; }
#jla .jla-w-go svg { width: 16px; height: 16px; }
#jla button.jla-w-item:disabled { cursor: default; }
#jla button.jla-w-item:disabled .jla-w-go { display: none; }
#jla .jla-w-ask { margin: 10px 0 0; font-weight: 600; color: var(--jla-ink); }

/* Tableau comparatif dans une réponse */
.jla-table { overflow-x: auto; margin: 0 0 8px; }
.jla-table:last-child { margin-bottom: 0; }
.jla-table table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.35; }
.jla-table th, .jla-table td { border: 1px solid var(--jla-line); padding: 6px 8px; text-align: left; vertical-align: top; overflow-wrap: normal; word-break: normal; hyphens: auto; }
.jla-text:has(.jla-table) { max-width: 100%; }
.jla-table th { background: var(--jla-soft); color: var(--jla-ink); font-weight: 700; }
.jla-table tbody tr td:first-child { font-weight: 600; color: var(--jla-ink); }

/* Avis 👍 / 👎 sous une réponse */
.jla-rate { display: flex; align-items: center; gap: 2px; margin-top: -4px; min-height: 28px; }
#jla .jla-rate-btn { width: 30px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--jla-muted); display: flex; align-items: center; justify-content: center; padding: 0; }
#jla .jla-rate-btn svg { width: 17px; height: 17px; }
#jla .jla-rate-btn:hover, #jla .jla-rate-btn:focus-visible { background: #e3ebf2; color: var(--jla-ink); outline: none; }
.jla-rate-ok { font-size: 12.5px; color: var(--jla-muted); padding-left: 4px; }

/* Invitation affichée près de la bulle (page contact sur mobile, relances panier et fiche produit) */
.jla-teaser { position: absolute; right: 0; bottom: 68px; width: min(280px, calc(100vw - 24px)); display: flex; align-items: flex-start; gap: 4px; padding: 10px 6px 10px 14px;
  background: #fff; border: 1px solid var(--jla-line); border-radius: 14px; border-bottom-right-radius: 4px; box-shadow: 0 10px 30px rgba(27, 58, 87, .25); animation: jla-in .2s ease-out; }
.jla-teaser-text { flex: 1; border: 0; background: transparent; padding: 0; text-align: left; color: var(--jla-text); font-size: 14px; line-height: 1.4; }
.jla-teaser-close { flex: none; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--jla-muted); display: flex; align-items: center; justify-content: center; }
.jla-teaser-close svg { width: 16px; height: 16px; }
.jla-teaser-close:hover, .jla-teaser-close:focus-visible { background: var(--jla-soft); outline: none; }
.jla-teaser-text:focus-visible { outline: 2px solid var(--jla-brand); outline-offset: 2px; border-radius: 4px; }
.jla-open .jla-teaser { display: none; }

@media (max-width: 520px) {
  #jla { right: 12px; bottom: 12px; }
  .jla-bubble-label { display: none; }
  .jla-bubble { width: 56px; height: 56px; padding: 0; justify-content: center; }
  #jla.jla-open { left: 0; right: 0; top: 0; bottom: 0; }
  .jla-open .jla-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  #jla .jla-form textarea, #jla .jla-handoff input, #jla .jla-handoff textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
  .jla-card, .jla-handoff { width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .jla-open .jla-panel, .jla-bubble, .jla-typing .jla-text::after, .jla-handoff, .jla-handoff-busy .jla-handoff-send svg { animation: none; transition: none; } }
