/* Assistant du site Ophsem — reprend la charte (navy / sage en accents, police du site). */
.oa-bulle {
  position: fixed; left: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px); z-index: 998;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 18px 6px 6px; border: 2px solid var(--navy, #1B3A6B); border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--navy, #1B3A6B); font: inherit; text-align: left;
  box-shadow: 0 8px 24px rgba(18, 42, 82, .3);
}
.oa-bulle:hover { background: var(--off, #F5F8FC); }
.oa-bulle:focus-visible, .oa-panneau :focus-visible { outline: 3px solid var(--sage, #7ABFB0); outline-offset: 2px; }
.oa-bulle[hidden] { display: none; }
.oa-bulle-texte { display: flex; flex-direction: column; font-size: .95rem; font-weight: 700; line-height: 1.15; }
.oa-bulle-texte small { font-size: .74rem; font-weight: 600; color: var(--sage-d, #5a9f90); }
.oa-avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #eef7f5; }
.oa-avatar .oa-robot { width: 40px; height: 40px; }
.oa-avatar-entete { width: 42px; height: 42px; }
.oa-avatar-entete .oa-robot { width: 34px; height: 34px; }
/* Clignement discret des yeux (désactivé si l'utilisateur limite les animations). */
@media (prefers-reduced-motion: no-preference) {
  .oa-robot .oa-oeil { transform-box: fill-box; transform-origin: center; animation: oa-cligne 6s infinite; }
  @keyframes oa-cligne { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.15); } }
}
@media (max-width: 600px) {
  .oa-bulle { padding: 4px; border-radius: 50%; }
  .oa-bulle-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.oa-panneau {
  position: fixed; left: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px); z-index: 1001;
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white, #fff); color: var(--g800, #1A2535); font-size: .95rem; line-height: 1.5;
  border: 1px solid var(--g100, #EBF0F7); border-radius: var(--radius, 16px);
  box-shadow: 0 18px 50px rgba(18, 42, 82, .25);
}
.oa-panneau[hidden] { display: none; }
@media (max-width: 600px) {
  .oa-panneau { left: 0; right: 0; bottom: 0; top: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
}

.oa-entete { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--g100, #EBF0F7); }
.oa-entete-texte { flex: 1; min-width: 0; }
.oa-entete strong { display: block; color: var(--navy, #1B3A6B); font-size: 1.02rem; }
.oa-entete small { display: block; color: var(--g600, #4A5568); font-size: .8rem; }
.oa-icone-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--navy, #1B3A6B); cursor: pointer; }
.oa-icone-btn:hover { background: var(--off, #F5F8FC); }
.oa-icone-btn svg { width: 20px; height: 20px; }

.oa-fil { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; background: var(--off, #F5F8FC); }
.oa-avertissement { font-size: .8rem; color: var(--g600, #4A5568); background: #fff; border: 1px solid var(--g100, #EBF0F7); border-radius: 12px; padding: 10px 12px; }
.oa-avertissement b { color: var(--navy, #1B3A6B); }
.oa-msg { max-width: 92%; padding: 10px 12px; border-radius: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.oa-msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--g100, #EBF0F7); border-bottom-left-radius: 4px; }
.oa-msg-moi { align-self: flex-end; background: var(--navy, #1B3A6B); color: #fff; border-bottom-right-radius: 4px; }
.oa-msg-urgence { border-color: #c0392b; border-left: 4px solid #c0392b; }
.oa-msg a { color: var(--navy, #1B3A6B); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.oa-source { display: block; margin-top: 6px; font-size: .78rem; color: var(--g600, #4A5568); }
.oa-attente { align-self: flex-start; color: var(--g600, #4A5568); font-size: .85rem; padding: 4px 6px; }

.oa-cartes { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; white-space: normal; }
.oa-carte { border: 1px solid var(--g100, #EBF0F7); border-radius: 12px; padding: 10px 12px; background: var(--off, #F5F8FC); }
.oa-carte strong { color: var(--navy, #1B3A6B); display: block; }
.oa-carte span { display: block; font-size: .82rem; color: var(--g600, #4A5568); margin: 2px 0 8px; }
.oa-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; white-space: normal; }
.oa-bouton { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: .86rem; font-weight: 700; text-decoration: none !important; }
.oa-bouton-plein { background: var(--navy, #1B3A6B); color: #fff !important; }
.oa-bouton-plein:hover { background: var(--navy-l, #2a4d80); }
.oa-bouton-contour { border: 1.5px solid var(--navy, #1B3A6B); color: var(--navy, #1B3A6B) !important; background: #fff; }

.oa-choix { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--g100, #EBF0F7); background: #fff; max-height: 38%; overflow-y: auto; }
.oa-choix:empty { display: none; }
.oa-puce { border: 1.5px solid var(--sage-d, #5a9f90); background: #fff; color: var(--navy, #1B3A6B); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.oa-puce:hover { background: #eef7f5; }

.oa-saisie { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--g100, #EBF0F7); background: #fff; }
.oa-saisie textarea { flex: 1; resize: none; min-height: 42px; max-height: 110px; padding: 10px 12px; border: 1.5px solid var(--g200, #D5DEEB); border-radius: 12px; font: inherit; font-size: .92rem; color: inherit; }
.oa-saisie textarea:focus { border-color: var(--navy, #1B3A6B); outline: none; }
.oa-saisie button { flex: none; width: 44px; border: 0; border-radius: 12px; background: var(--navy, #1B3A6B); color: #fff; cursor: pointer; display: grid; place-items: center; }
.oa-saisie button:disabled { opacity: .45; cursor: default; }
.oa-saisie button svg { width: 20px; height: 20px; }
.oa-pied { padding: 0 14px 10px; background: #fff; font-size: .72rem; color: var(--g600, #4A5568); }
.oa-pied a { color: inherit; }
.oa-invisible { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print { .oa-bulle, .oa-panneau { display: none !important; } }
