/* =========================================================
   Assistant PharmaX — feuille de style de la page Assistant
   Design repris du maquettage fourni (header vert, onglets,
   bulles de discussion, actions rapides, champ arrondi).
   ========================================================= */

:root {
  --primary-color: #008758;
  --primary-dark: #00663f;
  --primary-light: #e6f6f0;
  --bg-color: #f4f6f8;
  --border-color: #e2e8f0;
  --text-dark: #333333;
  --text-gray: #666666;
  --accent-blue: #38bdf8;
  --accent-blue-dark: #0369a1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-color);
  overflow: hidden;
  color: var(--text-dark);
}

.hidden { display: none !important; }
[hidden] { display: none !important; }

/* --- MAIN CONTAINER --- */
.main-container {
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* --- TAB CONTENT SECTIONS --- */
.tab-content {
  display: none;
  width: 100%;
  height: 100%;
}

.tab-content.active { display: flex; }

/* --- CHAT SECTION --- */
.chat-section {
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-header {
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-guest {
  background: #f1f5f9;
  color: var(--text-gray);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid var(--border-color);
}

.header-icon-btn {
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}

.header-icon-btn:hover { color: var(--primary-color); background: var(--primary-light); }

/* --- MESSAGES --- */
.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #fafafa;
  min-height: 0;
}

.message {
  max-width: 60%;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.message.bot {
  background: white;
  border: 1px solid var(--border-color);
  align-self: flex-start;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.message.user {
  background: var(--primary-color);
  color: white;
  align-self: flex-end;
}

.timestamp {
  font-size: 12px;
  color: #556274;
  margin-top: 6px;
}

/* Boutons de démarrage dans le message d'accueil */
.welcome-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.welcome-starters button {
  background: var(--primary-light);
  border: 1px solid #cdeade;
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}

.welcome-starters button:hover { background: #d8f0e5; }

/* --- MESSAGES GÉNÉRÉS PAR LE SCRIPT --- */
.ai-message { display: flex; width: 100%; }
.ai-message-user { justify-content: flex-end; }
.ai-message-assistant { justify-content: flex-start; }

.ai-message-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 72%;
}

.ai-message-user .ai-message-inner { max-width: 60%; }

.ai-user-bubble {
  background: var(--primary-color);
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-assistant-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #ffffff url("../img/logo-icon.png") center / 26px 26px no-repeat;
  background-image: image-set(url("../img/logo-icon-48.webp") type("image/webp"),
                              url("../img/logo-icon.png") type("image/png"));
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Le caractère inséré par le script est masqué au profit du logo */
  font-size: 0;
  color: transparent;
}

.ai-assistant-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ai-answer {
  background: white;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dark);
}

/* --- PROVENANCE DE LA GARDE (sous chaque pharmacie) --- */
.ai-card-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
  font-size: 12px;
  color: #4b5563;
}
.ai-card-source i { color: #087f65; font-size: 14px; }
.ai-card-source-item { font-weight: 600; color: #111827; }
.ai-card-source-item a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ai-card-source-item a:hover { color: #087f65; }
.ai-card-source-item.is-unknown { font-weight: 400; color: #9ca3af; font-style: italic; }

/* --- SOURCE DE LA RÉPONSE --- */
.ai-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin-top: -4px;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
}
.ai-sources i { font-size: 13px; align-self: center; }
.ai-sources-label { font-weight: 600; }
.ai-sources a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ai-sources a:hover { color: #087f65; }

/* --- CARTES PHARMACIES --- */
.ai-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-pharmacy-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ai-pharmacy-card.is-first { border-color: var(--primary-color); box-shadow: 0 2px 10px rgba(0,168,107,.12); }

.ai-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-card-rank {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-card-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ai-card-title strong { font-size: 14px; color: var(--text-dark); }
.ai-card-title span { font-size: 12px; color: var(--text-gray); }

.ai-card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.ai-guard {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #cdeade;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.ai-distance {
  background: #f1f5f9;
  color: var(--text-gray);
  border: 1px solid var(--border-color);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.ai-card-address {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-gray);
  line-height: 1.45;
}

.ai-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ai-card-actions button,
.ai-card-actions a {
  border-radius: 20px;
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-gray);
  transition: all .2s;
}

.ai-guide-button {
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: white !important;
}

.ai-guide-button:hover { background: var(--primary-dark) !important; }

.ai-detail-button:hover,
.ai-card-action:hover { background: #f8fafc; color: var(--text-dark); }

/* --- SUGGESTIONS DE SUIVI --- */
.follow-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.follow-chip {
  background: white;
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue-dark);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}

.follow-chip:hover { background: #f0f9ff; }

/* --- CHIP DE CONTEXTE --- */
.context-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 24px;
  padding: 8px 14px;
  background: var(--primary-light);
  border: 1px solid #cdeade;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-gray);
  align-self: flex-start;
}

.context-chip strong { color: var(--primary-dark); }

.context-chip button {
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

/* --- INDICATEUR DE SAISIE --- */
.ai-typing { padding: 6px 24px 0; }
.ai-typing .ai-message-inner { align-items: center; }

.ai-typing-dots {
  display: flex;
  gap: 5px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ai-typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-color);
  opacity: .35;
  animation: typingDot 1.1s infinite ease-in-out;
}

.ai-typing-dots i:nth-child(2) { animation-delay: .15s; }
.ai-typing-dots i:nth-child(3) { animation-delay: .3s; }

@keyframes typingDot {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* --- QUICK ACTIONS --- */
.quick-actions {
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: white;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.action-btn {
  background: white;
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue-dark);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover { background: #f0f9ff; }

/* Accès rapide aux numéros de secours */
.action-btn.urgent {
  border-color: #f87171;
  color: #b91c1c;
  font-weight: 600;
}

.action-btn.urgent:hover { background: #fef2f2; }

/* Réponse d'urgence : lisible d'un coup d'œil */
.ai-answer.is-emergency {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
  font-weight: 500;
  white-space: pre-line;
}

/* --- INPUT AREA --- */
.chat-input-area {
  padding: 16px 24px 8px;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.chat-input-area textarea {
  flex: 1;
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  resize: none;
  max-height: 180px;
  line-height: 1.4;
  color: var(--text-dark);
}

.chat-input-area textarea:focus { border-color: var(--primary-color); }

.input-icon-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #556274;
  cursor: pointer;
  display: flex;
  align-items: center;
  line-height: 1;
}

.input-icon-btn:hover { color: var(--primary-color); }
.input-icon-btn.active { color: var(--primary-color); }
.input-icon-btn.loading { color: var(--primary-color); animation: pulseIcon 1s infinite; }

@keyframes pulseIcon { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.btn-send {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.btn-send:hover { background: var(--primary-dark); }

.composer-note {
  background: white;
  padding: 0 24px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  font-size: 12px;
  color: #556274;
  flex-shrink: 0;
}

/* =========================================================
   MODALE DE GUIDAGE (navigation live)
   ========================================================= */
.route-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.route-modal.open { display: block; }

.route-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 34, 50, .45);
}

body.route-modal-open { overflow: hidden; }

.route-navigation {
  position: absolute;
  inset: 3vh 3vw;
  border-radius: 20px;
  overflow: hidden;
  background: white;
  box-shadow: 0 24px 60px rgba(15, 40, 30, .30);
}

.ai-route-map { position: absolute; inset: 0; background: #e3ebf3; }

.route-nav-header {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  z-index: 5;
  backdrop-filter: blur(6px);
}

.route-nav-title { flex: 1; min-width: 0; }
.route-nav-title small { display: block; font-size: 12px; letter-spacing: .12em; color: var(--primary-dark); }
.route-nav-title h2 { font-size: 15px; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.route-round-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-dark);
  font-size: 17px;
  cursor: pointer;
}

.route-round-button:hover { background: var(--primary-light); color: var(--primary-dark); }

/* Retour explicite vers la conversation */
.route-back-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-dark);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.route-back-button i { font-size: 17px; }
.route-back-button:hover { background: var(--primary-light); color: var(--primary-dark); }

.route-status-pill {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-gray);
  white-space: nowrap;
}

.route-status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.route-status-pill span.ok { background: var(--primary-color); box-shadow: 0 0 8px rgba(0,168,107,.6); }

.route-empty {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  margin: 0 14px 14px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border-color);
  text-align: center;
}

.route-empty-icon { font-size: 26px; color: var(--primary-color); }
.route-empty h3 { font-size: 15px; margin: 6px 0 4px; }
.route-empty p { font-size: 13px; color: var(--text-gray); }

.route-bottom-sheet {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 6;
  margin: 0 14px 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--border-color);
  box-shadow: 0 -6px 24px rgba(15,40,30,.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.route-destination-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.route-pharmacy-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-destination-line small { display: block; font-size: 12px; letter-spacing: .1em; color: var(--primary-dark); }
.route-destination-line strong { font-size: 15px; color: var(--text-dark); }

.route-live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.route-live-stat {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
}

.route-live-stat small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #556274; }
.route-live-stat strong { font-size: 15px; color: var(--primary-dark); }

.route-instruction {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--primary-light);
}

.route-instruction .nav-arrow { font-size: 18px; color: var(--primary-dark); }
.route-instruction small { display: block; font-size: 12px; color: var(--primary-dark); }
.route-instruction strong { font-size: 13px; color: var(--text-dark); }

.ai-route-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.ai-route-actions button,
.ai-route-actions a {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-gray);
}

.ai-route-actions button.active {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-dark);
}

.ai-route-actions a {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.ai-route-actions a:hover { background: var(--primary-dark); }

/* --- MARQUEURS LEAFLET --- */
.live-user-marker { position: relative; width: 44px; height: 44px; }

.live-user-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 168, 107, .22);
  animation: userPulse 2s infinite;
}

@keyframes userPulse {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(1.15); opacity: 0; }
}

.live-user-core {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 0 0 3px white;
}

.live-pharmacy-marker {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.live-pharmacy-marker span { transform: rotate(45deg); font-size: 14px; }

.leaflet-control-zoom a {
  color: var(--text-dark) !important;
  border-radius: 8px !important;
}

/* --- RESPONSIVE --- */

/* Tablettes et petits écrans */
@media (max-width: 1024px) {
  .message,
  .ai-message-inner { max-width: 78%; }
  .ai-message-user .ai-message-inner { max-width: 72%; }
}

/* Mobiles et tablettes en portrait */
@media (max-width: 900px) {
  .message,
  .ai-message-inner,
  .ai-message-user .ai-message-inner { max-width: 88%; }

  .chat-header { padding: 10px 14px; }
  .chat-messages { padding: 16px 14px; gap: 14px; }
  .quick-actions,
  .chat-input-area { padding-left: 14px; padding-right: 14px; }
  .context-chip { margin: 0 14px; }
  .composer-note { padding-left: 14px; padding-right: 14px; }
  .ai-typing { padding-left: 14px; padding-right: 14px; }

  /* Les actions rapides défilent horizontalement au lieu d'empiler
     plusieurs lignes et de manger la hauteur de la conversation */
  .quick-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .quick-actions::-webkit-scrollbar { display: none; }
  .action-btn { flex: 0 0 auto; white-space: nowrap; }

  .route-navigation { inset: 0; border-radius: 0; }
  .route-nav-header { top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; padding: 8px 10px; }
  .route-back-button span { display: none; }
  .route-back-button { padding: 9px 12px; }
  .route-status-pill { top: 68px; font-size: 12px; }
  .route-bottom-sheet,
  .route-empty { margin: 0 10px 10px; }
  .route-live-stat strong { font-size: 14px; }
}

/* Téléphones */
@media (max-width: 640px) {
  .avatar { width: 34px; height: 34px; }
  .chat-header h4 { font-size: 14px; }

  .message,
  .ai-message-inner,
  .ai-message-user .ai-message-inner { max-width: 94%; }

  .ai-card-top { flex-wrap: wrap; }
  .ai-card-badges { flex-direction: row; align-items: center; width: 100%; margin-left: 38px; }
  .ai-card-actions button,
  .ai-card-actions a { flex: 1 1 auto; text-align: center; }

  .ai-route-actions { flex-direction: column; }
  .ai-route-actions button,
  .ai-route-actions a { width: 100%; }

  .route-live-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .route-live-stat { padding: 6px 4px; }
  .route-live-stat small { font-size: 12px; }
  .route-nav-title h2 { font-size: 14px; }

  .composer-note { font-size: 12px; }
}

/* Très petits écrans */
@media (max-width: 400px) {
  .chat-messages { padding: 14px 10px; }
  .quick-actions,
  .chat-input-area,
  .composer-note { padding-left: 10px; padding-right: 10px; }
  .context-chip { margin: 0 10px; }
  .chat-input-area { gap: 8px; }
  .chat-input-area textarea { padding: 10px 16px; }
  .btn-send { width: 38px; height: 38px; min-width: 38px; font-size: 16px; }
  .badge-guest { display: none; }
}

/* Le tiroir de navigation est en position fixe : il doit passer
   au-dessus de la conversation, qui occupe toute la hauteur */
.nav-drawer, .nav-drawer-backdrop { position: fixed; }

/* Écrans tactiles : évite le zoom automatique d'iOS sur le champ de saisie */
@media (max-width: 900px) {
  .chat-input-area textarea { font-size: 16px; }
}

/* Paysage très bas (téléphone couché) : on récupère de la hauteur */
@media (max-height: 520px) and (max-width: 900px) {
  .chat-header { padding-top: 6px; padding-bottom: 6px; }
  .composer-note { display: none; }
}

/* Pastille de diagnostic : intention détectée sous la réponse.
   Visible seulement si SHOW_INTENT_BADGE est activé dans config.py. */
.intent-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed var(--border-color);
  font-size: 12px;
  color: #556274;
}

.intent-badge .intent-name {
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: 6px;
  padding: 2px 8px;
}

.intent-badge span + span::before {
  content: "·";
  margin-right: 8px;
  color: #cbd5e1;
}

/* Retour de l'utilisateur sur une réponse : alimente le taux de réussite
   affiché dans la page Analytique de l'administration. */
.answer-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: -2px;
  font-size: 12px;
  color: #556274;
}

.answer-feedback button {
  border: 1px solid var(--border-color);
  background: white;
  color: #556274;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .18s ease;
}

.answer-feedback button:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

.answer-feedback button[data-value="0"]:hover {
  border-color: #fecaca;
  color: #dc2626;
  background: #fef2f2;
}

.feedback-done { font-size: 12px; color: var(--primary-dark); }

/* --- LOTS DE 5 PHARMACIES (bouton « Suivantes ») --- */
.ai-results-block { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; }
.ai-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px 0;
}
.ai-pager-info { font-size: 12.5px; color: #6b7280; text-align: center; flex: 1; }
.ai-pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #d6d6d6;
  background: #fff;
  color: #323232;
  border-radius: 20px;
  padding: 8px 14px;
  font: 600 13px Inter, Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.ai-pager-btn.is-next { background: #10a37f; border-color: #10a37f; color: #fff; }
.ai-pager-btn.is-next:hover:not(:disabled) { background: #0d8d70; }
.ai-pager-btn:hover:not(:disabled) { background: #f5f5f5; }
.ai-pager-btn:disabled { opacity: .4; cursor: default; }
@media (max-width: 480px) {
  .ai-pager-btn { padding: 8px 10px; font-size: 12px; }
}

/* Pharmacie choisie : celle que l'utilisateur a touchée (carte ou bouton) ; aucune n'est choisie d'office */
.ai-pharmacy-card[data-id] { cursor: pointer; }
.ai-pharmacy-card.is-selected { border-color: #10a37f; background: linear-gradient(180deg, #f3fcf8, #fff); box-shadow: 0 0 0 2px rgba(16, 163, 127, .18); }
.ai-pharmacy-card.is-selected .ai-card-rank { background: #10a37f; color: #fff; }

/* Lignes d'état vides (aucun message en cours) : elles ne prennent pas de place */
#locationStatus:empty, .voice-status:empty { display: none; }
