#adage-chatbot-ia.adage-chatbot-ia {
  position: fixed;
  right: 32px;
  bottom: 24px;
  z-index: 2147483647;
  width: min(420px, calc(100vw - 24px));
  font-family: Inter, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  --adage-status-color: #13945b;
  --adage-bot-text-color: #fff;
  --adage-bot-background-color: #2d1c45;
  --adage-user-text-color: #2b2826;
  --adage-user-background-color: #e7e3dc;
}

#adage-chatbot-ia .adage-chatbot-ia__toggle {
  width: 68px;
  height: 68px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}


#adage-chatbot-ia .adage-chatbot-ia__toggle {
  display: block;
  margin-left: auto;
}

@media (max-width: 640px) {
  #adage-chatbot-ia.adage-chatbot-ia {
    right: 12px;
    bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + var(--adage-launcher-offset, 0px));
  }
  #adage-chatbot-ia .adage-chatbot-ia__toggle { width: 56px; height: 56px; }
  #adage-chatbot-ia .adage-chatbot-ia__panel { position: fixed; right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); width: calc(100vw - 24px); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
}

#adage-chatbot-ia :is(.adage-chatbot-ia__toggle, .adage-chatbot-ia__panel, .adage-chatbot-ia__teaser) { pointer-events: auto; }

/* Bulle d'accroche : discrète, au-dessus de l'avatar, sans couvrir l'écran (mobile compris). */
#adage-chatbot-ia .adage-chatbot-ia__teaser { position: relative; box-sizing: border-box; max-width: min(280px, calc(100vw - 32px)); margin: 0 4px 12px auto; padding: 12px 40px 12px 14px; background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); font-size: 14px; line-height: 1.45; animation: adage-chatbot-ia-teaser .25s ease-out; }
#adage-chatbot-ia .adage-chatbot-ia__teaser::after { content: ""; position: absolute; right: 26px; bottom: -7px; width: 12px; height: 12px; background: #fff; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; transform: rotate(45deg); }
#adage-chatbot-ia .adage-chatbot-ia__teaser-message { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
#adage-chatbot-ia .adage-chatbot-ia__teaser-close { position: absolute; top: 2px; right: 2px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #6b7280; font-size: 20px; line-height: 1; cursor: pointer; }
/* Les styles de boutons du site hôte (retour à la ligne interdit, fonds au survol…) ne s'appliquent pas à la bulle. */
#adage-chatbot-ia :is(.adage-chatbot-ia__teaser-message, .adage-chatbot-ia__teaser-close) { min-height: 0; box-shadow: none; text-transform: none; letter-spacing: normal; font-weight: inherit; text-decoration: none; }
#adage-chatbot-ia .adage-chatbot-ia__teaser-message { height: auto; white-space: normal; overflow-wrap: break-word; line-height: inherit; }
#adage-chatbot-ia .adage-chatbot-ia__teaser-close { padding: 0; }
#adage-chatbot-ia :is(.adage-chatbot-ia__teaser-message, .adage-chatbot-ia__teaser-close):is(:hover, :focus, :active) { background: transparent; color: inherit; box-shadow: none; }
#adage-chatbot-ia .adage-chatbot-ia__teaser-close:is(:hover, :focus, :active) { color: #1f2937; }
#adage-chatbot-ia :is(.adage-chatbot-ia__teaser-message, .adage-chatbot-ia__teaser-close):focus-visible { outline: 2px solid var(--adage-bot-background-color); outline-offset: 2px; }
@keyframes adage-chatbot-ia-teaser { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #adage-chatbot-ia .adage-chatbot-ia__teaser { animation: none; } }
#adage-chatbot-ia .adage-chatbot-ia__new-conversation { border: 1px solid currentColor; border-radius: 8px; padding: 8px; color: var(--adage-bot-background-color); background: transparent; font: inherit; font-size: 12px; cursor: pointer; min-height: 44px; }
#adage-chatbot-ia .adage-chatbot-ia__new-conversation:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

#adage-chatbot-ia .adage-chatbot-ia__panel { margin-top: 0; background: #f7f7f7; border: 1px solid #e5e7eb; border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.16); overflow: hidden; }
#adage-chatbot-ia .adage-chatbot-ia__header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:18px; border-bottom:1px solid #e6e4e0; background:#f7f7f7; }
#adage-chatbot-ia .adage-chatbot-ia__header-main { display:flex; flex:1; min-width:0; align-items:center; gap:12px; }
#adage-chatbot-ia .adage-chatbot-ia__new-conversation { order:3; width:100%; text-align:left; }
#adage-chatbot-ia .adage-chatbot-ia__avatar { width:44px; height:44px; border-radius:50%; object-fit:cover; background:#ddd; }
#adage-chatbot-ia .adage-chatbot-ia__avatar--toggle { width:100%; height:100%; }
#adage-chatbot-ia .adage-chatbot-ia__bot-name { font-size:15px; }
#adage-chatbot-ia .adage-chatbot-ia__bot-status { margin:0; color:var(--adage-status-color); font-size:small; }
#adage-chatbot-ia .adage-chatbot-ia__close { border:0; background:transparent; font-size:24px; line-height:1; cursor:pointer; color:#4b5563; min-width:44px; min-height:44px; }
#adage-chatbot-ia .adage-chatbot-ia__messages { max-height:360px; overflow-y:auto; padding:16px 18px; }
#adage-chatbot-ia .adage-chatbot-ia__message-row { display:flex; margin:0 0 12px; gap:10px; }
#adage-chatbot-ia .adage-chatbot-ia__message-row--user { justify-content:flex-end; }

#adage-chatbot-ia .adage-chatbot-ia__message {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 80%;
  min-width: 0;
  overflow-wrap: anywhere;
}

#adage-chatbot-ia .adage-chatbot-ia__message :is(h1, h2, h3, h4, h5, h6) {
  margin: 1em 0 .5em;
  color: inherit;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: normal;
}

#adage-chatbot-ia .adage-chatbot-ia__message h1 { font-size: 1.35em; }
#adage-chatbot-ia .adage-chatbot-ia__message h2 { font-size: 1.2em; }
#adage-chatbot-ia .adage-chatbot-ia__message h3 { font-size: 1.1em; }
#adage-chatbot-ia .adage-chatbot-ia__message :is(h4, h5, h6) { font-size: 1em; }
#adage-chatbot-ia .adage-chatbot-ia__message :is(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }

#adage-chatbot-ia .adage-chatbot-ia__message :is(a, a:visited, a:hover, a:focus, a:active) {
  color: inherit;
  background: transparent;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: .15em;
}

#adage-chatbot-ia .adage-chatbot-ia__message a:hover { text-decoration-thickness: 2px; }
#adage-chatbot-ia .adage-chatbot-ia__message a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

#adage-chatbot-ia .adage-chatbot-ia__message code {
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: .25em;
  padding: .1em .3em;
  font-family: monospace;
  font-size: .9em;
  white-space: normal;
}

#adage-chatbot-ia .adage-chatbot-ia__message p { margin: 0 0 10px; }
#adage-chatbot-ia .adage-chatbot-ia__message p:last-child { margin-bottom: 0; }
#adage-chatbot-ia .adage-chatbot-ia__completion-notice { margin-top: .75em; padding-top: .75em; border-top: 1px solid currentColor; }
#adage-chatbot-ia :is(.adage-chatbot-ia__recovery, .adage-chatbot-ia__suggestions button) { border: 1px solid currentColor; border-radius: 1em; background: transparent; color: inherit; font: inherit; padding: .5em .75em; cursor: pointer; }
#adage-chatbot-ia :is(.adage-chatbot-ia__recovery, .adage-chatbot-ia__suggestions button):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
#adage-chatbot-ia .adage-chatbot-ia__suggestions { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .75em; }
#adage-chatbot-ia .adage-chatbot-ia__suggestions button { max-width: 100%; min-height: 44px; white-space: normal; text-align: start; }
#adage-chatbot-ia .adage-chatbot-ia__message ul { margin: 0 0 10px 18px; padding: 0; }
#adage-chatbot-ia .adage-chatbot-ia__message li { margin-bottom: 6px; }

#adage-chatbot-ia .adage-chatbot-ia__message--user { background:var(--adage-user-background-color); color:var(--adage-user-text-color); }
#adage-chatbot-ia .adage-chatbot-ia__message--bot { background:var(--adage-bot-background-color); color:var(--adage-bot-text-color); }

#adage-chatbot-ia .adage-chatbot-ia__form { display:flex; align-items:flex-end; gap:10px; border-top:0; padding:12px 18px 18px; }
#adage-chatbot-ia .adage-chatbot-ia__form textarea { flex:1; min-width:0; border:1px solid #d8d4ce; border-radius:22px; padding:14px 16px; background:var(--adage-user-background-color); font-family:inherit; font-size:16px; line-height:1.4; resize:none; overflow:hidden; scrollbar-width:thin; max-height:120px; box-sizing:border-box; }
#adage-chatbot-ia .adage-chatbot-ia__message--user { white-space:pre-wrap; }

#adage-chatbot-ia .adage-chatbot-ia__send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--adage-bot-background-color);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#adage-chatbot-ia .adage-chatbot-ia__loader {
  background: var(--adage-bot-background-color);
  border-radius: 16px;
  padding: 14px 16px;
  display: inline-flex;
  gap: 6px;
}

#adage-chatbot-ia .adage-chatbot-ia__loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8f8b85;
  animation: adage-chatbot-ia-blink 1.3s infinite;
}

#adage-chatbot-ia .adage-chatbot-ia__loader span:nth-child(2) { animation-delay: .2s; }
#adage-chatbot-ia .adage-chatbot-ia__loader span:nth-child(3) { animation-delay: .4s; }

@keyframes adage-chatbot-ia-blink {
  0%, 80%, 100% { opacity: .4; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

#adage-chatbot-ia .adage-chatbot-ia__send { transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease; }
#adage-chatbot-ia .adage-chatbot-ia__send:hover { background:var(--adage-status-color); box-shadow:0 8px 18px rgba(91,58,141,.35); transform: translateY(-1px); }
#adage-chatbot-ia .adage-chatbot-ia__send:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 3px #5b3a8d; }

#adage-chatbot-ia [hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  #adage-chatbot-ia .adage-chatbot-ia__header { gap: 8px; padding: 12px; }
  #adage-chatbot-ia .adage-chatbot-ia__messages { min-height: 0; flex: 1; max-height: min(360px, calc(100dvh - 220px)); }
}
