/* STERA — Assistant (bulle et fenêtre de discussion) */
:root { --stera-ass-bas: 20px; --stera-ass-droite: 20px; }
html.stera-ass-avec-barre { --stera-ass-bas: 88px; }
@media (min-width: 960px) { html.stera-ass-avec-barre { --stera-ass-bas: 20px; } }

.stera-ass-bouton {
  position: fixed; right: var(--stera-ass-droite); bottom: var(--stera-ass-bas); z-index: 9000;
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px;
  border: 0; border-radius: 999px; background: #2E8540; color: #fff; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1; box-shadow: 0 8px 24px rgba(17,38,26,.22);
  transition: background-color .2s;
}
.stera-ass-bouton:hover, .stera-ass-bouton:focus-visible { background: #1F5A2B; }
.stera-ass-bouton svg { width: 22px; height: 22px; }
html.stera-ass-ouvert .stera-ass-bouton { display: none; }

.stera-ass {
  position: fixed; right: var(--stera-ass-droite); bottom: var(--stera-ass-bas); z-index: 9001;
  display: flex; flex-direction: column; width: 380px; height: min(600px, calc(100vh - 120px));
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(17,38,26,.22); font-family: inherit; color: #1B1D1E;
}
.stera-ass[hidden] { display: none; }

.stera-ass__tete { display: flex; align-items: center; gap: 4px; padding: 14px 10px 14px 18px; background: #11261A; color: #fff; }
.stera-ass__tete div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.stera-ass__tete strong { font-size: 15px; }
.stera-ass__tete span { font-size: 12px; opacity: .7; }
.stera-ass__tete button { width: 36px; height: 36px; padding: 7px; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; }
.stera-ass__tete button:hover, .stera-ass__tete button:focus-visible { background: rgba(255,255,255,.12); }
.stera-ass__tete svg { width: 22px; height: 22px; display: block; }

.stera-ass__fil { flex: 1; overflow-y: auto; padding: 16px; background: #F4F6F1; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: #D2DDD4 transparent; }
.stera-ass__msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.stera-ass__msg p { margin: 0 0 6px; font-size: inherit; line-height: inherit; }
.stera-ass__msg p:last-child { margin-bottom: 0; }
.stera-ass__msg ul { margin: 4px 0 6px; padding-left: 18px; }
.stera-ass__msg li { margin: 2px 0; font-size: inherit; }
.stera-ass__msg--assistant { align-self: flex-start; background: #fff; border: 1px solid #D2DDD4; border-bottom-left-radius: 4px; }
.stera-ass__msg--user { align-self: flex-end; background: #1D3A28; color: #fff; border-bottom-right-radius: 4px; }
.stera-ass__msg a { color: #2E8540; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.stera-ass__msg a:hover { color: #1F5A2B; }

.stera-ass__msg--attente { display: flex; gap: 4px; padding: 14px; }
.stera-ass__msg--attente span { width: 7px; height: 7px; border-radius: 50%; background: #2E8540; opacity: .3; animation: stera-ass-point 1s infinite; }
.stera-ass__msg--attente span:nth-child(2) { animation-delay: .15s; }
.stera-ass__msg--attente span:nth-child(3) { animation-delay: .3s; }
@keyframes stera-ass-point { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stera-ass__msg--attente span { animation: none; opacity: .6; } }

.stera-ass__entrees { display: flex; flex-wrap: wrap; gap: 8px; }
.stera-ass__entrees button { padding: 8px 14px; border: 1px solid #D2DDD4; border-radius: 999px; background: #E8F3EA; color: #11261A; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.stera-ass__entrees button:hover, .stera-ass__entrees button:focus-visible { background: #2E8540; border-color: #2E8540; color: #fff; }

.stera-ass__saisie { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px; border-top: 1px solid #D2DDD4; background: #fff; }
.stera-ass__saisie label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stera-ass__saisie textarea { flex: 1; box-sizing: border-box; height: 42px; min-height: 42px !important; max-height: 120px; box-shadow: none; margin: 0; padding: 10px 14px; border: 1px solid #D2DDD4; border-radius: 21px; background: #fff; font-family: inherit; font-size: 14px; line-height: 1.4; color: #1B1D1E; resize: none; }
.stera-ass__saisie textarea:focus { outline: none; border-color: #2E8540; }
.stera-ass__saisie button { flex: 0 0 42px; width: 42px; height: 42px; padding: 10px; border: 0; border-radius: 999px; background: #2E8540; color: #fff; cursor: pointer; }
.stera-ass__saisie button:hover { background: #1F5A2B; }
.stera-ass__saisie button:disabled { opacity: .5; cursor: default; }
.stera-ass__saisie svg { width: 22px; height: 22px; display: block; }
.stera-ass__mention { margin: 0; padding: 0 14px 10px; background: #fff; font-size: 11px; line-height: 1.4; color: #5b625e; }
.stera-ass__mention a { color: inherit; text-decoration: underline; }

/* Mobile : fenêtre en bas de l'écran sur toute la largeur, bouton réduit */
@media (max-width: 767px) {
  .stera-ass { right: 0; bottom: 0; width: 100%; height: 85vh; height: 85dvh; border-radius: 20px 20px 0 0; }
  .stera-ass-bouton { --stera-ass-droite: 14px; height: 48px; padding: 0 16px 0 13px; font-size: 14px; }
  .stera-ass__saisie textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
}

/* Le thème (Uncode) impose ses propres styles de boutons : on les neutralise dans la fenêtre */
.stera-ass button, .stera-ass-bouton { min-width: 0 !important; margin: 0 !important; text-transform: none !important; letter-spacing: normal !important; box-sizing: border-box !important; }
.stera-ass .stera-ass__saisie button { flex: 0 0 42px !important; width: 42px !important; height: 42px !important; padding: 10px !important; border-radius: 999px !important; line-height: 1 !important; }
.stera-ass .stera-ass__tete button { width: 36px !important; height: 36px !important; padding: 7px !important; border-radius: 999px !important; }
.stera-ass .stera-ass__entrees button { width: auto !important; height: auto !important; padding: 8px 14px !important; border-radius: 999px !important; }
