.abi-shell {
  --abi-primary: #0f3460;
  --abi-accent: #f59e0b;
  --abi-ink: #101828;
  --abi-muted: #667085;
  --abi-line: rgba(16, 24, 40, 0.1);
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  /* Le conteneur lui-meme ne doit jamais capter de clic : sur mobile, la regle
     left:0/right:0 plus bas l'etire a la largeur ecran (ex. 390x66 constate en
     inspecteur le 2026-08-21) et cette zone invisible bloquait des boutons de
     page (ex. "Suivant" d'un quiz) juste en dessous. Seuls les elements
     visibles et cliquables (icone, panneau ouvert) reactivent pointer-events. */
  pointer-events: none;
}

.abi-shell.abi-js-ready {
  display: block;
}

/* .abi-form/.abi-footer/.abi-email-gate set their own `display`, which as
   author CSS otherwise always wins over the UA `[hidden]{display:none}`
   rule — restore native hidden-attribute behavior everywhere in the widget. */
.abi-shell [hidden] {
  display: none !important;
}

.abi-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--abi-primary), #0b2f9e 72%);
  box-shadow: 0 18px 44px rgba(15, 52, 96, 0.28);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  pointer-events: auto;
}

.abi-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 56px rgba(15, 52, 96, 0.34);
}

.abi-shell.is-open .abi-launcher {
  opacity: 0;
  pointer-events: none;
}

.abi-launcher__pulse {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--abi-accent);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.56);
  animation: lscPulse 2s infinite;
}

.abi-launcher__avatar {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.abi-launcher__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.abi-launcher__label {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.abi-launcher__subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
}

.abi-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  width: min(408px, calc(100vw - 20px));
  max-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(15, 52, 96, 0.36);
  border-radius: 30px;
  background: #f8fafc;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  color: var(--abi-ink);
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
  pointer-events: none;
}

/* top desktop seulement — mobile gère via bottom: 0 */
@media (min-width: 641px) {
  .abi-panel {
    top: max(env(safe-area-inset-top, 12px), calc(100dvh - 738px));
  }
}

.abi-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.abi-panel__top {
  flex: 0 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
}

.abi-panel__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.abi-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #344054;
  font-size: 0;
  cursor: pointer;
}

.abi-shell.abi-rdv-open {
  display: none !important;
}

.abi-close:hover {
  background: #fff;
}

.abi-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 18px 64px 18px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(120deg, #08b06e 0%, #0f7db6 48%, #1d4ed8 100%);
}

.abi-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #0f172a;
  background: linear-gradient(135deg, #fde68a, var(--abi-accent));
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.abi-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.abi-header__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.abi-header__copy strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.12;
}

.abi-header__copy span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.3;
}

.abi-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 10px;
  background: linear-gradient(180deg, #eff4ff 0, #f8fafc 54px, #f8fafc 100%);
  scrollbar-width: thin;
}

.abi-message {
  display: flex;
  margin: 0 0 12px;
}

.abi-message--assistant {
  justify-content: flex-start;
}

.abi-message--user {
  justify-content: flex-end;
}

.abi-bubble {
  max-width: 88%;
  border-radius: 22px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.abi-message--assistant .abi-bubble {
  color: #1d2939;
  background: #fff;
  border: 1px solid var(--abi-line);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}

.abi-message--user .abi-bubble {
  color: #fff;
  background: linear-gradient(135deg, var(--abi-primary), #0b2f9e);
  box-shadow: 0 12px 28px rgba(15, 52, 96, 0.18);
}

.abi-bubble.has-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.abi-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  color: #fff !important;
  background: linear-gradient(135deg, var(--abi-primary), #0b2f9e 72%);
  box-shadow: 0 10px 22px rgba(15, 52, 96, 0.18);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
}

.abi-cta:hover {
  color: #fff !important;
  transform: translateY(-1px);
}

.abi-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.abi-suggest-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--abi-primary);
  color: var(--abi-primary);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 120ms ease;
}

.abi-suggest-chip:hover {
  background: var(--abi-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Image gallery thumbnail strip */
.abi-img-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 4px;
}

.abi-img-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  width: 110px;
  height: 78px;
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.abi-img-thumb:hover,
.abi-img-thumb:focus-visible {
  border-color: #1a6fba;
  box-shadow: 0 0 0 2px rgba(26,111,186,0.18);
  outline: none;
}

.abi-img-thumb img {
  width: 106px !important;
  height: 70px !important;
  object-fit: cover !important;
  object-position: center top;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.10);
  display: block !important;
  flex-shrink: 0;
}

.abi-img-cap {
  display: none;
}

/* Lightbox overlay */
.abi-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 2147483647;
  align-items: center;
  justify-content: center;
}

.abi-lightbox--open {
  display: flex;
}

.abi-lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 92vh;
}

.abi-lb-img {
  max-width: 88vw;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 6px 40px rgba(0,0,0,0.6);
  display: block;
}

.abi-lb-close {
  position: absolute;
  top: -38px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 10px;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.abi-lb-close:hover { opacity: 1; }

.abi-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
}

.abi-lb-nav:hover { background: rgba(255,255,255,0.28); }

.abi-lb-prev { left: -58px; }
.abi-lb-next { right: -58px; }

.abi-lb-caption {
  display: none;
}

.abi-lb-counter {
  color: #aaa;
  font-size: 11px;
  min-height: 16px;
}

.abi-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 58px;
}

.abi-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--abi-primary);
  animation: lscTyping 1.2s ease-in-out infinite;
}

.abi-typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.abi-typing span:nth-child(3) {
  animation-delay: 0.32s;
}

.abi-form {
  display: flex;
  flex: 0 0 auto;
  /* flex-end : boutons restent en bas quand le textarea grandit */
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  background: #fff;
}

.abi-input {
  flex: 1 1 auto;
  min-width: 0;
  /* min-height = hauteur d'une ligne, max-height = ~4 lignes */
  min-height: 44px;
  max-height: 130px;
  padding: 11px 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 22px;
  color: var(--abi-ink);
  background: #f8fafc;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  outline: none;
  resize: none;
  overflow-y: hidden;
  display: block;
  box-sizing: border-box;
  /* Transition douce quand le champ grandit */
  transition: height 80ms ease;
}

.abi-input:focus {
  border-color: var(--abi-primary);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.12);
}

.abi-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--abi-primary), #0b2f9e);
  cursor: pointer;
}

.abi-send:disabled {
  cursor: wait;
  opacity: 0.68;
}

.abi-send svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Voice button ──────────────────────────────────────────── */
.abi-voice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--abi-muted);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.abi-voice svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: transform 150ms ease;
}

.abi-voice:hover {
  background: rgba(15, 52, 96, 0.08);
  color: var(--abi-primary);
}

/* Enregistrement en cours */
.abi-voice.is-recording {
  background: #ef4444;
  color: #fff;
  transform: scale(1.18);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
  animation: abi-mic-pulse 0.8s ease-in-out infinite;
}

.abi-voice.is-recording svg {
  transform: scale(1.1);
}

/* Transcription en cours */
.abi-voice.is-transcribing {
  background: rgba(15, 52, 96, 0.10);
  color: var(--abi-primary);
  cursor: wait;
  animation: abi-spin-border 1s linear infinite;
  box-shadow: inset 0 0 0 2px rgba(15, 52, 96, 0.25);
}

@keyframes abi-mic-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0.5); transform: scale(1.18); }
  50%  { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);  transform: scale(1.22); }
  100% { box-shadow: 0 0 0 0   rgba(239, 68, 68, 0);   transform: scale(1.18); }
}

@keyframes abi-spin-border {
  0%   { box-shadow: inset 0 0 0 2px rgba(15, 52, 96, 0.15), 2px 0 0 0 var(--abi-primary, #0f3460); border-radius: 50%; transform: rotate(0deg); }
  100% { box-shadow: inset 0 0 0 2px rgba(15, 52, 96, 0.15), 2px 0 0 0 var(--abi-primary, #0f3460); border-radius: 50%; transform: rotate(360deg); }
}

/* Barre de statut vocal au-dessus du formulaire */
.abi-voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #fff5f5;
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  font-size: 13px;
  font-weight: 500;
  color: #ef4444;
  animation: abi-status-in 0.2s ease-out;
}

.abi-voice-status.is-transcribing {
  background: rgba(15, 52, 96, 0.04);
  border-top-color: rgba(15, 52, 96, 0.12);
  color: var(--abi-primary, #0f3460);
}

.abi-voice-status.is-error {
  background: #fff5f5;
  border-top-color: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.abi-voice-status__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: abi-dot-blink 1s ease-in-out infinite;
}

.abi-voice-status.is-transcribing .abi-voice-status__dot {
  background: var(--abi-primary, #0f3460);
  animation: none;
  opacity: 0.5;
}

@keyframes abi-dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

@keyframes abi-status-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.abi-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 25px 20px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  background: #fff;
  color: var(--abi-muted);
  font-size: 11px;
}

.abi-restart {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--abi-primary);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.abi-restart svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.abi-session-end {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  background: #fff;
}

.abi-session-end__text {
  margin: 0 0 10px;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.abi-session-end__rating-title {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.abi-session-end__rating {
  display: flex;
  gap: 6px;
}

.abi-rating-star {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.abi-rating-star.is-active {
  color: #f59e0b;
}

.abi-rating-star:disabled {
  cursor: default;
}

.abi-session-end__feedback {
  margin: 8px 0 0;
  color: #059669;
  font-size: 12px;
}

.abi-footer__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.abi-export,
.abi-support-shortcut {
  padding: 0;
  border: 0;
  color: var(--abi-primary);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes lscPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.56);
  }
  70% {
    box-shadow: 0 0 0 13px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

@keyframes lscTyping {
  0%, 70%, 100% {
    opacity: 0.45;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

/* ── Email gate ────────────────────────────────────────────────────────── */

.abi-email-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px 24px;
  background: #fff;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  text-align: center;
}

/* Hard reset against theme styles on section/header elements */
.abi-panel {
  padding: 0 !important;
  margin: 0 !important;
}

.abi-panel > .abi-header {
  display: flex !important;
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  float: none !important;
  clear: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 0 !important;
  transform: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 1 !important;
}

.abi-panel > .abi-messages {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.abi-panel > .abi-panel__top {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.abi-panel > .abi-panel__body {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

.abi-email-gate__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eff4ff;
  color: var(--abi-primary);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.abi-email-gate__text {
  font-size: 14px;
  line-height: 1.55;
  color: #374151;
  margin: 0 0 18px;
  max-width: 300px;
}

.abi-email-gate__form {
  width: 100%;
}

.abi-email-gate__input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(16, 24, 40, 0.18);
  border-radius: 12px;
  color: var(--abi-ink);
  background: #f8fafc;
  font: inherit;
  font-size: 15px;
  outline: none;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.abi-email-gate__input:focus {
  border-color: var(--abi-primary);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.12);
}

.abi-email-gate__input.is-invalid {
  border-color: #d63638;
  box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.12);
}

.abi-email-gate__error {
  font-size: 12px;
  color: #d63638;
  margin: -4px 0 10px;
  text-align: left;
}

.abi-email-gate__consent {
  font-size: 10px;
  line-height: 1.35;
  color: #6b7280;
  margin: -2px 0 12px;
  text-align: center;
}

.abi-email-gate__btn {
  display: block;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: #16a34a;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}

.abi-email-gate__btn:hover {
  background: #15803d;
}

.abi-email-gate__btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.abi-email-gate__skip {
  display: block;
  width: 100%;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Modal RDV ─────────────────────────────────────────────────────────── */

.abi-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 220ms ease;
}

.abi-modal-overlay.is-open {
  opacity: 1;
}

.abi-modal-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  height: min(720px, calc(100dvh - 32px));
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.28);
  transform: translateY(16px) scale(0.98);
  transition: transform 220ms ease;
}

.abi-modal-overlay.is-open .abi-modal-box {
  transform: translateY(0) scale(1);
}

.abi-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #344054;
  font-size: 0;
  cursor: pointer;
}

.abi-modal-close:hover {
  background: #fff;
}

.abi-modal-iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
}

.abi-cta--rdv {
  font-family: inherit;
  cursor: pointer;
}

.abi-cta--mail {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.abi-inline-link {
  color: var(--abi-primary) !important;
  text-decoration: underline !important;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.abi-support-sheet {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity 180ms ease;
}

.abi-support-sheet.is-open {
  opacity: 1;
}

.abi-support-sheet__box {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 30px;
  overflow: auto;
}

.abi-support-sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #344054;
  font-size: 0;
  cursor: pointer;
}

.abi-support-sheet__body {
  padding: 22px 16px 16px;
}

.abi-support-sheet__title {
  margin: 0 0 8px;
  color: #111827;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.12;
}

.abi-support-sheet__desc {
  margin: 0 0 14px;
  color: #475467;
  font-size: 14px;
  line-height: 1.4;
}

.abi-support-sheet__input,
.abi-support-sheet__textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d0d5dd;
  border-radius: 16px;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  outline: none;
  padding: 12px 12px;
  margin: 0 0 12px;
}

.abi-support-sheet__input {
  min-height: 50px;
}

.abi-support-sheet__textarea {
  min-height: 160px;
  resize: vertical;
}

.abi-support-sheet__input:focus,
.abi-support-sheet__textarea:focus {
  border-color: #9bb4f6;
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.15);
}

.abi-support-sheet__file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  padding: 10px 12px;
  border: 1px dashed #d0d5dd;
  border-radius: 12px;
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.abi-support-sheet__file-label:hover {
  border-color: var(--abi-primary, #0f3460);
  color: var(--abi-primary, #0f3460);
}

.abi-support-sheet__file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.abi-support-sheet__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 10px;
  color: #344054;
  font-size: 13px;
  line-height: 1.35;
}

.abi-support-sheet__check input {
  margin-top: 3px;
}

.abi-support-sheet__help {
  margin: 0 0 8px;
  color: #344054;
  font-size: 13px;
  line-height: 1.4;
}

.abi-support-sheet__help summary {
  cursor: pointer;
  color: #0f3460;
  font-weight: 600;
}

.abi-support-sheet__help ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.abi-support-sheet__error {
  margin: 0 0 10px;
  color: #b42318;
  font-size: 13px;
}

.abi-support-sheet__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.abi-support-sheet__btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.abi-support-sheet__btn--ghost {
  background: #e9efff;
  color: #1f4ed8;
}

.abi-support-sheet__btn--primary {
  background: #16a34a;
  color: #fff;
}

@media (max-width: 640px) {
  .abi-shell {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
  }

  .abi-launcher {
    margin-left: auto;
    margin-right: 12px;
    margin-bottom: 12px;
    /* Icone seule sur mobile : le libelle+sous-titre prenaient toute la largeur
       de l'ecran et recouvraient les boutons de la page (ex. "Demarrer le quiz")
       juste derriere. */
    width: 54px;
    height: 54px;
    min-height: 54px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .abi-launcher__copy {
    display: none;
  }

  /* Panel en bottom sheet flottant — position:fixed du desktop, ancré au bas */
  .abi-panel {
    pointer-events: none; /* évite de bloquer les clics quand panel est fermé */
    top: auto;            /* annule toute valeur top héritée */
    right: 12px;
    left: 12px;
    bottom: 16px;         /* flotte légèrement — tous les radius visibles */
    width: auto;          /* déterminé par left + right */
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    height: 82vh;         /* fallback navigateurs sans svh */
    height: 82svh;        /* ignore la barre navigateur iOS */
    max-height: 92svh;
    border-radius: 20px;  /* 4 coins arrondis — border du desktop s'applique partout */
    overflow: hidden;
    /* Animation bottom-sheet : glisse depuis le bas de l'écran */
    transform: translateY(calc(100% + 32px));
    opacity: 1;
    transition: transform 380ms cubic-bezier(0.32, 0.72, 0, 1);
  }

  .abi-panel.is-open {
    pointer-events: auto;
    transform: translateY(0);
    opacity: 1;
  }

  /* Bouton "Démarrer la conversation" au-dessus de la barre home iPhone */
  .abi-email-gate {
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
  }

  /* Footer conversation aussi au-dessus de la barre home */
  .abi-footer {
    padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 10px));
  }

  .abi-bubble {
    max-width: 92%;
  }

  .abi-footer span {
    display: none;
  }

  /* Fix Chrome/Safari iOS : font-size < 16px → zoom auto → scroll horizontal */
  .abi-input {
    font-size: 16px !important;
    touch-action: manipulation;
  }

  /* Formulaire pleine largeur sans débordement */
  .abi-form {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  /* Shell ouvert */
  .abi-shell.is-open {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
  }
}

@media (max-width: 640px) {
  .abi-modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .abi-modal-box {
    border-radius: 20px 20px 0 0;
    height: min(90dvh, 720px);
  }
}

/* ──────────────────────────────────────────────────────────────
   Auto-behavior animations & notifications
   ────────────────────────────────────────────────────────────── */

@keyframes abi-pulse-ring {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(15, 52, 96, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(15, 52, 96, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(15, 52, 96, 0);
  }
}

.abi-launcher.has-pulse {
  animation: abi-pulse-ring 2s infinite;
}

/* Speech bubble animation */
@keyframes abi-bubble-in {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(10px);
    transform-origin: bottom right;
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    transform-origin: bottom right;
  }
}

@keyframes abi-bubble-out {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
    transform-origin: bottom right;
  }
  100% {
    opacity: 0;
    transform: scale(0.7) translateY(8px);
    transform-origin: bottom right;
  }
}

/* Speech bubble au-dessus du bouton */
.abi-notification {
  position: fixed;
  bottom: 120px;
  right: 80px;
  background: #ffffff;
  color: var(--abi-primary, #0f3460);
  padding: 11px 16px;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  white-space: nowrap;
  box-shadow:
    0 4px 20px rgba(15, 52, 96, 0.18),
    0 1px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  z-index: 100001;
  animation: abi-bubble-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  user-select: none;
  pointer-events: all;
}

/* Petite flèche pointant vers le bouton (bas-droite) */
.abi-notification::after {
  content: '';
  position: absolute;
  bottom: -9px;
  right: 14px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 0 solid transparent;
  border-top: 10px solid #ffffff;
  filter: drop-shadow(1px 3px 2px rgba(15, 52, 96, 0.10));
}

.abi-notification:hover {
  box-shadow:
    0 8px 28px rgba(15, 52, 96, 0.24),
    0 2px 8px rgba(0, 0, 0, 0.10);
}

.abi-notification.is-closing {
  animation: abi-bubble-out 0.35s ease-in forwards;
}

/* Bulle "Besoin d'aide ?" retiree partout (desktop et mobile), a la demande
   du 2026-08-21 : en plus de recouvrir des boutons de page sur mobile (ex.
   "Demarrer le quiz"), le rendu n'etait pas voulu non plus sur desktop.
   L'icone du lanceur reste cliquable seule, sans cette bulle. */
.abi-notification {
  display: none !important;
}

/* ── Live chat (handoff humain) ───────────────────────────────────────── */
.abi-live-notice{
  margin:10px 0;padding:8px 12px;border-radius:10px;
  background:#eff6ff;color:#1e3a8a;font-size:13px;line-height:1.4;text-align:center;
}
.abi-message--agent .abi-bubble {
  background: #fff;
  color: #101828;
}

.abi-agent-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--abi-muted);
  margin-bottom: 3px;
}

/* ── CTA button block layout — prevents overlap when multiple buttons in one bubble ── */
.abi-bubble .abi-cta {
  display: block;
  width: -moz-fit-content;
  width: fit-content;
  margin-top: 8px;
}

/* ── Upload (PJ) button — hidden by default, shown in live support mode ── */
.abi-upload-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--abi-muted);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}
.abi-upload-btn:hover {
  color: var(--abi-primary);
  background: rgba(15, 52, 96, 0.08);
}
.abi-upload-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Attachment rendering inside message bubbles ── */
.abi-attachment {
  margin-top: 8px;
  max-width: 100%;
}
.abi-attachment img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: block;
  cursor: zoom-in;
}
.abi-attachment__file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(15, 52, 96, 0.25);
  font-size: 12px;
  font-weight: 600;
  color: var(--abi-primary);
  text-decoration: none !important;
}
.abi-attachment__file:hover {
  background: rgba(15, 52, 96, 0.06);
  text-decoration: none !important;
}

/* ── Video attachment button ── */
.abi-attachment__video {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: #1a1a2e;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}
.abi-attachment__video:hover {
  background: #2a2a4e;
  transform: translateY(-1px);
}
.abi-attachment__video svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Media preview modal ── */
.abi-media-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  cursor: zoom-out;
}
.abi-media-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.abi-media-modal__inner {
  position: relative;
  cursor: default;
  max-width: 92vw;
}
.abi-media-modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}
.abi-media-modal__close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.abi-media-modal__img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.abi-media-modal__frame {
  display: block;
  width: min(820px, 92vw);
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.abi-media-modal__video {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  outline: none;
}

/* Tutoriels pas a pas dans les reponses d'Abi : etapes numerotees en pastilles.
   Styles explicites pour ne pas dependre du reset de listes du theme. */
.abi-bubble ol {
  list-style: none;
  counter-reset: abi-step;
  margin: 10px 0;
  padding: 0;
}

.abi-bubble ol > li {
  counter-increment: abi-step;
  position: relative;
  margin: 0 0 8px;
  padding: 1px 0 0 30px;
  line-height: 1.45;
}

.abi-bubble ol > li:last-child {
  margin-bottom: 0;
}

.abi-bubble ol > li::before {
  content: counter(abi-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--abi-primary, #0f3460);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
}

.abi-bubble ul {
  list-style: disc;
  margin: 8px 0;
  padding-left: 18px;
}

.abi-bubble ul > li {
  margin: 0 0 4px;
}

.abi-bubble strong {
  font-weight: 700;
}
