:root {
  --reset-enabled: #2e8fcc;
  --reset-enabled-hover: #2752ae;
  --reset-busy: #aaa;
  --muted: #5f6b7a;
  --muted-strong: #19191b;
  --brand: #0b1f33;
  --brand-2: #124c7e;
}

/* ============================
   Shell global : fenêtre modale
   ============================ */

.modal-chatbot--host {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: min(26.25rem, 100vw - 2rem); /* 420px */
  height: min(37.5rem, 60vh);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  background: #fff;
  border-radius: 0.75rem;
  -webkit-box-shadow: 0 0.625rem 1.875rem rgb(0 0 0 / 20%);
          box-shadow: 0 0.625rem 1.875rem rgb(0 0 0 / 20%);
  resize: both;
  overflow: hidden;
  z-index: 1000;
}

.modal-chatbot--host[hidden] {
  display: none;
}

.modal-chatbot--host.is-empty {
  /* On laisse le layout flex par défaut, pas de grid comme avant */
}

.modal-chatbot [type='button'],
.modal-chatbot [type='submit'] {
  border-radius: 999px;
}

/* ============================
   Bouton d’activation du chatbot
   ============================ */

.modal-chatbot__toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--brand-2);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  -webkit-box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 20%);
          box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 20%);
  -webkit-transition:
    background-color 0.15s ease,
    -webkit-transform 0.15s ease,
    -webkit-box-shadow 0.15s ease;
  transition:
    background-color 0.15s ease,
    -webkit-transform 0.15s ease,
    -webkit-box-shadow 0.15s ease;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease,
    -webkit-transform 0.15s ease,
    -webkit-box-shadow 0.15s ease;
}

.modal-chatbot__toggle:hover {
  -webkit-transform: translateY(-1px);
          transform: translateY(-1px);
  -webkit-box-shadow: 0 0.375rem 1rem rgb(0 0 0 / 25%);
          box-shadow: 0 0.375rem 1rem rgb(0 0 0 / 25%);
  background: #0f4169;
}

.modal-chatbot__toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ============================
   Header de la fenêtre
   ============================ */

.modal-chatbot__window-header {
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e5e5;
  background: #f8fafc;
  cursor: move;
}

.modal-chatbot__window-help {
  background: none;
  border: none;
  padding: 0.25rem;
  margin-right: 0.5rem;
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}

.modal-chatbot__icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentcolor;
}

.modal-chatbot--host.is-dragging {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

.modal-chatbot__window-header .modal-chatbot__window-title {
  font-size: 0.9rem;
  color: #0f172a;
  margin: 0;
}

.modal-chatbot__window-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  color: #4b5563;
  border-radius: 999px;
  -webkit-transition:
    background-color 0.15s ease,
    color 0.15s ease,
    -webkit-transform 0.1s ease;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    -webkit-transform 0.1s ease;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease,
    -webkit-transform 0.1s ease;
}

.modal-chatbot__window-close:hover {
  background: #e5e7eb;
  color: #111827;
  -webkit-transform: scale(1.05);
          transform: scale(1.05);
}

.modal-chatbot__window-close:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.modal-chatbot__window-help-panel {
  padding: 1rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.modal-chatbot__window-help-panel p {
  line-height: 1.2;
}

/* ============================
   Output wrapper
   ============================ */

.modal-chatbot__output-wrapper {
  -webkit-box-flex: 1;
      -ms-flex: 1 1 auto;
          flex: 1 1 auto;
  width: 100%;
  overflow-y: auto;
  background: #fff;
  display: block;
}

/* En mode "is-empty", on masque l’historique pour ne garder que le composer */
.modal-chatbot--host.is-empty .modal-chatbot__output-wrapper {
  display: none;
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
}

/* ============================
   Formulaire
   ============================ */

.modal-chatbot__form-wrapper {
  max-width: 50rem;
  width: 100%;
}

.modal-chatbot--host.is-empty .modal-chatbot__form-wrapper {
  -ms-flex-item-align: center;
      align-self: center;
}

.modal-chatbot__form {
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
}

.modal-chatbot__form-inner {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  margin-bottom: 1rem;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  padding: 0.75rem 0.75rem 0.25rem;
}

.modal-chatbot__composer {
  -webkit-box-flex: 1;
      -ms-flex: 1 1 auto;
          flex: 1 1 auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.875rem;
  padding: 0.5rem 0.5rem 0.4rem;
  -webkit-box-shadow: 0 0.0625rem 0.125rem rgb(0 0 0 / 5%);
          box-shadow: 0 0.0625rem 0.125rem rgb(0 0 0 / 5%);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
}

.modal-chatbot__composer:focus-within {
  border-color: #ddd;
  -webkit-box-shadow: none;
          box-shadow: none;
}

.modal-chatbot__textarea:focus {
  border: none;
  -webkit-box-shadow: none;
          box-shadow: none;
  outline: none;
}

.modal-chatbot__composer-main {
  position: relative;
}

.modal-chatbot__textarea {
  width: 98%;
  margin: 0;
  background: transparent;
  border: none;
  padding: 0.5rem 0.5rem 0.25rem;
  min-height: 4.5rem;
  overflow-y: hidden;
  resize: none;
  line-height: 1.5;
  font-size: 0.9rem;
  color: #111;
  outline: none;
}

.modal-chatbot__form textarea:disabled {
  background-color: white;
}

.modal-chatbot__form textarea::-webkit-input-placeholder {
  color: #36363c;
  opacity: 0.8;
  font-size: 0.9rem;
}

.modal-chatbot__form textarea::-moz-placeholder {
  color: #36363c;
  opacity: 0.8;
  font-size: 0.9rem;
}

.modal-chatbot__form textarea:-ms-input-placeholder {
  color: #36363c;
  opacity: 0.8;
  font-size: 0.9rem;
}

.modal-chatbot__form textarea::-ms-input-placeholder {
  color: #36363c;
  opacity: 0.8;
  font-size: 0.9rem;
}

.modal-chatbot__form textarea::placeholder {
  color: #36363c;
  opacity: 0.8;
  font-size: 0.9rem;
}

/* ============================
   Footer du composer (reset + send)
   ============================ */

.modal-chatbot__composer-footer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem 0.15rem;
}

/* ============================
   Bouton reset history
   ============================ */

.modal-chatbot__reset {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--reset-busy);
  opacity: 0.7;
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
}

.modal-chatbot__reset:not([disabled]) {
  color: var(--reset-enabled);
  opacity: 1;
}

.modal-chatbot__reset:not([disabled]):hover {
  color: var(--reset-enabled-hover);
}

.modal-chatbot__reset[disabled] {
  cursor: not-allowed;
  color: var(--reset-busy);
  opacity: 0.5;
}

.modal-chatbot--host.is-empty .modal-chatbot__reset {
  display: none;
}

/* ============================
   Bouton envoyer
   ============================ */

.modal-chatbot__actions {
  /* Pousse le bouton send complètement à droite */
  margin-left: auto;
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
}

.modal-chatbot__send {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 62.4375rem;
  background: #111827;
  color: #fff;
  border: none;
  cursor: pointer;
  opacity: 0.35;
  -webkit-transition: opacity 0.15s ease-in-out;
  transition: opacity 0.15s ease-in-out;
}

.modal-chatbot__send:not(:disabled)[aria-busy='false'] {
  opacity: 1;
}

.modal-chatbot__send:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.modal-chatbot__send .icon {
  width: 1.25rem;
  height: 1.25rem;
  display: none;
}

.modal-chatbot__send[aria-busy='false'] .icon--send {
  display: block;
}

.modal-chatbot__send[aria-busy='true'] .icon--busy {
  display: block;
}

/* ============================
   Historique
   ============================ */

.modal-chatbot__output {
  max-width: 50rem;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 0.75rem;
}

.chat-turn {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 0.75rem;
}

/* ============================
   Status / loader
   ============================ */

.is-empty .modal-chatbot__status {
  display: none;
}

.modal-chatbot__status {
  max-width: 50rem;
  margin-left: 0;
  margin-right: auto;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #555;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  -webkit-transform: translateY(0.25rem);
          transform: translateY(0.25rem);
  -webkit-transition:
    opacity 0.2s ease,
    max-height 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    max-height 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    max-height 0.2s ease,
    transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    max-height 0.2s ease,
    transform 0.2s ease,
    -webkit-transform 0.2s ease;
}

.modal-chatbot.is-loading .modal-chatbot__status {
  opacity: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  max-height: 2rem;
  -webkit-transform: translateY(0);
          transform: translateY(0);
}

.modal-chatbot__status-icon {
  width: 1.5rem;
  height: 1.5rem;
  position: relative;
  -webkit-box-flex: 0;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
}

.modal-chatbot__status-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 0.25rem;
  background: conic-gradient(#3b82f6, #10b981, #ef4444, #3b82f6);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0)
    content-box;
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0)
    content-box;
  -webkit-animation: modal-spin 0.8s linear infinite;
          animation: modal-spin 0.8s linear infinite;
}

/* ============================
   Bloc <think>
   ============================ */

/**
 * Affiché pendant le streaming du bloc <think>…</think>.
 * Reste visible après le début de la réponse (classe --done),
 * atténué visuellement pour assurer la continuité du flux.
 */
.chat-think-block {
  display: block;
  margin-bottom: 0.625rem;
  padding: 0.5rem 0.875rem;
  border-left: 2px solid rgb(0 154 116 / 50%);
  background: rgb(11 31 51 / 4%);
  border-radius: 0 0.375rem 0.375rem 0;
  font-size: 0.8125rem;
  color: #5f6b7a;
  max-width: 40rem;
  -webkit-animation: think-block-in 0.2s ease;
          animation: think-block-in 0.2s ease;
  -webkit-transition:
    opacity 0.4s ease,
    border-color 0.4s ease;
  transition:
    opacity 0.4s ease,
    border-color 0.4s ease;
}

/* Une fois la réponse commencée : reste visible mais atténué */
.chat-think-block--done {
  opacity: 0.55;
  border-left-color: rgb(0 154 116 / 20%);
}

.chat-think-block__lines {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 0.2rem;
}

/* Chaque ligne validée slide-in à son apparition */
.chat-think-block__line {
  -webkit-animation: think-line-in 0.2s ease;
          animation: think-line-in 0.2s ease;
  line-height: 1.5;
}

/* Ligne en cours de frappe */
.chat-think-block__line--current {
  color: #444;
}

/* Curseur clignotant sur la ligne active */
.chat-think-block__cursor {
  display: inline-block;
  width: 1px;
  height: 0.85em;
  background: currentcolor;
  margin-left: 1px;
  vertical-align: text-bottom;
  -webkit-animation: think-cursor-blink 0.9s step-end infinite;
          animation: think-cursor-blink 0.9s step-end infinite;
}

@-webkit-keyframes think-block-in {
  from {
    opacity: 0;
    -webkit-transform: translateY(0.2rem);
            transform: translateY(0.2rem);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

@keyframes think-block-in {
  from {
    opacity: 0;
    -webkit-transform: translateY(0.2rem);
            transform: translateY(0.2rem);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

@-webkit-keyframes think-line-in {
  from {
    opacity: 0;
    -webkit-transform: translateX(-0.3rem);
            transform: translateX(-0.3rem);
  }

  to {
    opacity: 1;
    -webkit-transform: translateX(0);
            transform: translateX(0);
  }
}

@keyframes think-line-in {
  from {
    opacity: 0;
    -webkit-transform: translateX(-0.3rem);
            transform: translateX(-0.3rem);
  }

  to {
    opacity: 1;
    -webkit-transform: translateX(0);
            transform: translateX(0);
  }
}

@-webkit-keyframes think-cursor-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes think-cursor-blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ============================
   Bulles utilisateur
   ============================ */

.chat-message {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
}

.chat-message.user {
  -webkit-box-pack: end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
}

.chat-message.user .bubble {
  background: #dfdede;
  color: #333;
  padding: 0.5rem 0.75rem;
  max-width: 65%;
  white-space: pre-wrap;
  line-height: 1.4;
  -webkit-box-shadow: 0 0.0625rem 0.125rem rgb(0 0 0 / 8%);
          box-shadow: 0 0.0625rem 0.125rem rgb(0 0 0 / 8%);
  font-size: 0.95rem;
  border-radius: 1rem 1rem 0.25rem;
}

/* ============================
   Bulles assistant
   ============================ */

.chat-message.assistant {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 6px;
}

.chat-message.assistant .bubble {
  font-size: 0.95rem;
}

.chat-message.assistant .bubble p,
.chat-message.assistant .bubble li {
  line-height: 1.2;
}

.chat-message.assistant .bubble li {
  margin-bottom: 0.25rem;
}

.chat-message.assistant .bubble p:last-of-type {
  margin-bottom: 0.5rem;
}

.assistant-tools {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  padding-top: 2px;
  margin-bottom: 1rem;
}

.assistant-feedback--hidden {
  display: none !important;
}

.assistant-feedback-thanks {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #eef6ff;
  color: #235;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  -webkit-animation: fade-in 0.2s ease;
          animation: fade-in 0.2s ease;
}

@-webkit-keyframes fade-in {
  from {
    opacity: 0;
    -webkit-transform: translateY(2px);
            transform: translateY(2px);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    -webkit-transform: translateY(2px);
            transform: translateY(2px);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

.assistant-feedback-thanks--fadeout {
  -webkit-animation: fade-out 0.25s ease forwards;
          animation: fade-out 0.25s ease forwards;
}

@-webkit-keyframes fade-out {
  from {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }

  to {
    opacity: 0;
    -webkit-transform: translateY(2px);
            transform: translateY(2px);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }

  to {
    opacity: 0;
    -webkit-transform: translateY(2px);
            transform: translateY(2px);
  }
}

/* ============================
   Bouton copy message assistant
   ============================ */

.modal-chatbot__copy {
  margin-top: 0.25rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: start;
      -ms-flex-pack: start;
          justify-content: flex-start;
}

.modal-chatbot__copy-btn {
  border: none;
  background: none;
  padding: 0.125rem;
  cursor: pointer;
  opacity: 0.7;
  -webkit-transition:
    opacity 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    -webkit-transform 0.2s ease;
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 0.25rem;
  line-height: 1;
}

.modal-chatbot__copy-check,
.modal-chatbot__copy-text {
  display: none;
}

.modal-chatbot__copy-btn:hover {
  opacity: 1;
  -webkit-transform: scale(1.05);
          transform: scale(1.05);
}

.chat-message.assistant.is-copied .modal-chatbot__copy-btn {
  opacity: 1;
}

.modal-chatbot__copy-btn.is-success .modal-chatbot__copy-icon {
  display: none;
}

.modal-chatbot__copy-btn.is-success .modal-chatbot__copy-check {
  display: inline-block;
  font-size: 0.8rem;
  color: #16a34a;
}

.modal-chatbot__copy-btn.is-success .modal-chatbot__copy-text {
  display: inline-block;
  font-size: 0.75rem;
  color: #444;
}

/* ============================
   Evaluation message assistant
   ============================ */

.modal-chatbot__evaluation {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 8px;
}

.modal-chatbot__thumb {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 999px;
  color: var(--muted);
  opacity: 0.7;
  -webkit-transition:
    opacity 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    -webkit-transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    -webkit-transform 0.2s ease;
}

.modal-chatbot__thumb:hover {
  opacity: 1;
  -webkit-transform: scale(1.05);
          transform: scale(1.05);
}

.modal-chatbot__thumb.is-active {
  color: var(--brand);
  background: rgb(96 172 228 / 50%);
}

.modal-chatbot__thumb--down .modal-chatbot__thumb-icon {
  -webkit-transform: translateY(2px);
          transform: translateY(2px);
}

.assistant-feedback {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 10px;
  background: #f7faff;
  border: 1px solid #dce7f7;
  -webkit-box-shadow: 0 1px 4px rgb(0 50 100 / 8%);
          box-shadow: 0 1px 4px rgb(0 50 100 / 8%);
  -webkit-animation: fade-in-feedback 0.2s ease-out;
          animation: fade-in-feedback 0.2s ease-out;
}

@-webkit-keyframes fade-in-feedback {
  from {
    opacity: 0;
    -webkit-transform: translateY(-4px);
            transform: translateY(-4px);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

@keyframes fade-in-feedback {
  from {
    opacity: 0;
    -webkit-transform: translateY(-4px);
            transform: translateY(-4px);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

.assistant-feedback__field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 0.35rem;
}

.assistant-feedback select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #c4d4ea;
  font-size: 0.95rem;
  color: #1a2d45;
  -webkit-transition:
    border-color 0.2s,
    -webkit-box-shadow 0.2s;
  transition:
    border-color 0.2s,
    -webkit-box-shadow 0.2s;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    -webkit-box-shadow 0.2s;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6b7a90 50%),
    linear-gradient(135deg, #6b7a90 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

.assistant-feedback select:focus {
  outline: none;
  border-color: #2a7de1;
  -webkit-box-shadow: 0 0 0 3px rgb(42 125 225 / 20%);
          box-shadow: 0 0 0 3px rgb(42 125 225 / 20%);
}

.assistant-feedback textarea {
  width: 100%;
  max-width: 98%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #c4d4ea;
  background: #fff;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 70px;
  color: #1a2d45;
  -webkit-transition:
    border-color 0.2s,
    -webkit-box-shadow 0.2s;
  transition:
    border-color 0.2s,
    -webkit-box-shadow 0.2s;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    -webkit-box-shadow 0.2s;
}

.assistant-feedback textarea:focus {
  outline: none;
  border-color: #2a7de1;
  -webkit-box-shadow: 0 0 0 3px rgb(42 125 225 / 20%);
          box-shadow: 0 0 0 3px rgb(42 125 225 / 20%);
}

.assistant-feedback__actions {
  margin-top: 0.75rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 0.5rem;
}

.assistant-feedback__submit {
  background: #2a7de1;
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  -webkit-transition:
    background 0.2s,
    -webkit-transform 0.1s;
  transition:
    background 0.2s,
    -webkit-transform 0.1s;
  transition:
    background 0.2s,
    transform 0.1s;
  transition:
    background 0.2s,
    transform 0.1s,
    -webkit-transform 0.1s;
}

.assistant-feedback__submit:hover {
  background: #1c65b6;
}

.assistant-feedback__submit:active {
  -webkit-transform: scale(0.97);
          transform: scale(0.97);
}

.assistant-feedback__cancel {
  background: transparent;
  color: #49627a;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #c4d4ea;
  font-size: 0.9rem;
  cursor: pointer;
  -webkit-transition:
    background 0.2s,
    border-color 0.2s;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.assistant-feedback__cancel:hover {
  background: #eef4fc;
  border-color: #9ab7d9;
}

/* ============================
   Message d'erreur pour validation du prompt
   ============================ */

.modal-chatbot__error {
  color: #b00020;
  background-color: #f6e1e1;
  border-left: 0.25rem solid #b00020;
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.3;
  border-radius: 0.25rem;
  -webkit-animation: fade-in-error 0.2s ease-out;
          animation: fade-in-error 0.2s ease-out;
}

@-webkit-keyframes fade-in-error {
  from {
    opacity: 0;
    -webkit-transform: translateY(-4px);
            transform: translateY(-4px);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

@keyframes fade-in-error {
  from {
    opacity: 0;
    -webkit-transform: translateY(-4px);
            transform: translateY(-4px);
  }

  to {
    opacity: 1;
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

/* ============================
   Mode "floating" 50vw / 80vh centré
   ============================ */
@media (min-width: 50rem) {
  .modal-chatbot--host.modal-chatbot--floating {
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
    width: 50vw;
    height: 80vh;
    max-width: 50rem;
    max-height: 80vh;
    border-radius: 0.75rem;
    z-index: 1001;
  }

  .modal-chatbot__backdrop {
    position: fixed;
    inset: 0;
    background-color: rgb(15 23 42 / 45%); /* voile sombre */
    backdrop-filter: blur(4px);
    z-index: 1000;
  }

  .modal-chatbot__backdrop[hidden] {
    display: none;
  }

  .modal-chatbot--host.modal-chatbot--floating .modal-chatbot__window-header {
    cursor: default;
  }
}

/* ============================
   Divers
   ============================ */

@-webkit-keyframes modal-spin {
  to {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

@keyframes modal-spin {
  to {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

@media (min-width: 50rem) {
  .chat-message.assistant .assistant-tools {
    opacity: 0;
    -webkit-transition: opacity 0.15s ease-in-out;
    transition: opacity 0.15s ease-in-out;
  }

  .chat-message.assistant.is-latest .assistant-tools {
    opacity: 1;
  }

  .chat-message.assistant:not(.is-latest):hover .assistant-tools {
    opacity: 1;
  }
}

/* ============================== *\
  THÈMES DE COULEUR
\* ============================== */

/* === ORANGE === */
.modal-chatbot__toggle.amu-chabot--orange,
.modal-chatbot__window-header.amu-chabot--orange {
  background-color: #ff7920;
  color: #000;
}

/* === GREEN === */
.modal-chatbot__toggle.amu-chabot--green,
.modal-chatbot__window-header.amu-chabot--green {
  background-color: #52de94;
  color: #000;
}

/* === CORAL === */
.modal-chatbot__toggle.amu-chabot--coral,
.modal-chatbot__window-header.amu-chabot--coral {
  background-color: #ff8b7c;
  color: #000;
}

/* === LAVENDER === */
.modal-chatbot__toggle.amu-chabot--lavender,
.modal-chatbot__window-header.amu-chabot--lavender {
  background-color: #9966fb;
  color: #000;
}

/* === YELLOW === */
.modal-chatbot__toggle.amu-chabot--yellow,
.modal-chatbot__window-header.amu-chabot--yellow {
  background-color: #ffff85;
  color: #000;
}

/* === BLUE === */
.modal-chatbot__toggle.amu-chabot--blue,
.modal-chatbot__window-header.amu-chabot--blue {
  background-color: #1f63de;
  color: #fff;
}

/* === BLACK === */
.modal-chatbot__toggle.amu-chabot--black,
.modal-chatbot__window-header.amu-chabot--black {
  background-color: #000;
  color: #fff;
}

/* ============================
   Responsive mobile
   ============================ */

@media (max-width: 50rem) {
  .header__position-absolute .modal-header,
  .header__position-absolute .modal-header:not(.is-empty) {
    background-color: #fff;
  }

  .modal-chatbot--host {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 95vh;
    border-radius: 0;
  }

  .modal-chatbot__window-header {
    font-size: 0.8rem;
  }

  .modal-chatbot__toggle {
    bottom: 2rem;
  }

  .modal-chatbot__output {
    padding: 0.5rem 0.75rem;
  }

  .modal-chatbot__form-inner {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .chat-turn {
    padding: 0.5rem 0.75rem;
  }

  .modal-chatbot__send {
    margin-bottom: 0.2rem;
    margin-right: 1rem;
  }

  .chat-message.user .bubble {
    margin-right: 0.5rem;
  }

  .modal-chatbot__reset {
    bottom: 2.5rem;
    left: 1.5rem;
  }

  .modal-chatbot__backdrop {
    backdrop-filter: none;
  }
}
