/* V158 : assistant vocal — bouton micro flottant et panneau de conversation */
:root {
  /* Palette du fichier : couleurs écrites en dur remplacées par ces variables (mêmes valeurs). */
  --c-amber-44: #e0a100;
  --c-black-a25: rgba(0, 0, 0, 0.25);
  --c-blue-16-h212: #1b2735;
  --c-blue-28: #33465c;
  --c-blue-37: #1f5f9e;
  --c-blue-87: #d5dde7;
  --c-gray-94: #e8eef5;
  --c-red-95: #fdecea;
  --c-white: #fff;
}
.as-fab {
  position: fixed;
  right: 16px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--theme-accent, #1f5f9e);
  color: var(--c-white);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px var(--c-black-a25);
  cursor: pointer;
}
.as-fab[hidden] {
  display: none;
}
.as-fab.listening {
  animation: as-pulse 1.2s infinite;
}
@keyframes as-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 95, 158, 0.5);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(31, 95, 158, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 95, 158, 0);
  }
}
.as-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  color: #12263f;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px var(--c-black-a25);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.as-panel[hidden] {
  display: none;
}
.as-panel .as-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 8px 16px;
  border-bottom: 1px solid #e3e8ef;
}
.as-panel .as-head strong {
  flex: 1;
  font-size: 1.05rem;
}
.as-mute {
  border: 1px solid var(--c-blue-87);
  background: var(--c-white);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--c-blue-28);
}
.as-close {
  border: 0;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  color: var(--c-blue-28);
}
.as-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.as-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.as-me {
  align-self: flex-end;
  background: var(--c-blue-37);
  color: var(--c-white);
  border-bottom-right-radius: 4px;
}
.as-bot {
  align-self: flex-start;
  background: #eef2f7;
  border-bottom-left-radius: 4px;
}
.as-wait {
  color: #55657a;
}
.as-err {
  background: var(--c-red-95);
  color: #8a1c1c;
}
.as-card {
  align-self: stretch;
  border: 1.5px solid var(--c-blue-37);
  border-radius: 14px;
  padding: 12px 14px;
  background: #f7fafd;
}
.as-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.as-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
  font-size: 0.93rem;
}
.as-warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff4e5;
  color: #7a4b00;
  font-size: 0.9rem;
}
.as-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.as-card-actions button {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
}
.as-yes {
  border: 0;
  background: var(--c-success);
  color: var(--c-white);
}
.as-no {
  border: 1px solid var(--c-blue-87);
  background: var(--c-white);
  color: var(--c-blue-28);
}
.as-card.done .as-card-actions {
  display: none;
}
.as-card.done.ok {
  border-color: var(--c-success);
}
.as-card.done.ko {
  border-color: var(--c-blue-87);
  opacity: 0.85;
}
.as-card-out {
  margin: 8px 0 0;
  font-weight: 600;
}
.as-card-out:empty {
  display: none;
}
.as-open {
  margin-top: 8px;
  min-height: 40px;
  border: 1px solid var(--c-blue-37);
  background: var(--c-white);
  color: var(--c-blue-37);
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 600;
}
.as-hint {
  flex-shrink: 0;
  margin: 0 12px 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f1f4f8;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #3d4f63;
  overflow-wrap: anywhere;
}
.as-hint:empty {
  display: none;
}
.as-form {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e3e8ef;
}
.as-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--c-blue-87);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
}
/* V172 : boutons aux couleurs du thème (variables de themes.css), nettement visibles actifs comme désactivés. */
.as-mic,
.as-send,
.as-cam,
.as-lang {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.as-mic {
  border: 1.5px solid var(--theme-accent, #1f5f9e);
  background: var(--theme-surface, #fff);
  color: var(--theme-accent-text, #1f5f9e);
}
/* V198 : captures d'écran jointes à l'assistant. */
.as-cam {
  width: 44px;
  border: 1px solid var(--theme-border, #d5dde7);
  background: var(--theme-surface, #fff);
  color: var(--theme-accent-text, #1f5f9e);
}
.as-shots {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px 0;
}
.as-shots[hidden] {
  display: none;
}
.as-shot {
  position: relative;
}
.as-shot img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--theme-border, #d5dde7);
  display: block;
}
.as-shot button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: #192536;
  color: var(--c-white);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.as-pic {
  display: block;
  max-width: 100%;
  max-height: 160px;
  margin-top: 6px;
  border-radius: 8px;
}
@media (max-width: 380px) {
  .as-form {
    gap: 6px;
  }
  .as-form .as-cam,
  .as-form .as-lang {
    width: 40px;
  }
}
.as-send {
  border: 1.5px solid var(--theme-accent, #1f5f9e);
  background: var(--theme-accent, #1f5f9e);
  color: var(--theme-on-accent, #fff);
}
.as-send:disabled {
  background: var(--theme-soft, #eef2f7);
  border-color: var(--theme-border, #d5dde7);
  color: var(--theme-muted, #687686);
  cursor: default;
}
.as-lang {
  width: 44px;
  border: 1px solid var(--theme-border, #d5dde7);
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #192536);
  font-weight: 700;
  font-size: 0.82rem;
}
.as-panel.listening .as-mic {
  background: var(--theme-accent, #1f5f9e);
  color: var(--theme-on-accent, #fff);
  border-color: var(--theme-accent, #1f5f9e);
}
@media (min-width: 900px) {
  .as-fab {
    bottom: 24px;
    right: 24px;
  }
  .as-panel {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 420px;
    border-radius: 18px;
  }
}
@media (prefers-color-scheme: dark) {
  .as-panel {
    background: #16202c;
    color: var(--c-gray-94);
  }
  .as-bot {
    background: #223042;
    color: var(--c-gray-94);
  }
  .as-card {
    background: var(--c-blue-16-h212);
  }
  .as-input,
  .as-mute,
  .as-lang,
  .as-cam,
  .as-no {
    background: var(--c-blue-16-h212);
    color: var(--c-gray-94);
    border-color: var(--c-blue-28);
  }
  .as-mic {
    background: var(--c-blue-16-h212);
    color: var(--c-gray-94);
  }
  .as-hint {
    background: #223042;
    color: var(--c-gray-94);
  }
  .as-panel .as-head,
  .as-form {
    border-color: #2a3a4d;
  }
  .as-close {
    color: var(--c-gray-94);
  }
}
.as-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 48px;
  text-decoration: none;
  font-size: 1rem;
}

/* V175 : carte « contacts » (bouton existant du téléphone et import d'une fiche .vcf) */
.as-vcf {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.as-card.as-contacts.done .as-card-actions {
  display: none;
}

/* V195 : 👎 sous une réponse (supervision) */
.as-down {
  display: block;
  margin-top: 0.3rem;
  border: 0;
  background: transparent;
  font-size: 0.8rem;
  opacity: 0.6;
  cursor: pointer;
  padding: 0;
}
.as-down:hover,
.as-down:focus-visible {
  opacity: 1;
}
/* V196 : la langue devient une liste (dix langues) ; même allure que le bouton. */
select.as-lang {
  display: block;
  width: 56px;
  text-align: center;
  text-align-last: center;
  appearance: none;
  -webkit-appearance: none;
}
/* V199 : note de l'aide reçue. */
.as-stars {
  display: flex;
  gap: 6px;
  margin: 6px 0;
}
.as-stars button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--theme-border, #d5dde7);
  border-radius: 10px;
  background: var(--theme-surface, #fff);
  color: #c3cad4;
  font-size: 1.4rem;
  cursor: pointer;
}
.as-stars button.on {
  color: var(--c-amber-44);
}
.as-rate-c {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--c-blue-87);
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
}
