/* Page « Assistant IA » */
.ox-chat-page { padding: 56px 0 88px; background: linear-gradient(var(--surface), #fff 60%); }
.ox-chat-page__inner { max-width: 860px; }
.ox-chat-head { text-align: center; margin-bottom: 28px; }
.ox-chat-head .eyebrow { justify-content: center; }
.ox-chat-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 12px; }
.ox-chat-head .lead { max-width: 640px; margin: 0 auto; }

.ox-chat { display: flex; flex-direction: column; height: min(72vh, 680px); min-height: 460px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.ox-chat__bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.ox-chat__avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--navy-700); }
.ox-chat__avatar svg { width: 24px; height: 22px; }
.ox-chat__avatar .logo__ring { stroke: #fff; }
.ox-chat__avatar .logo__nodes { stroke: rgba(255, 255, 255, .65); }
.ox-chat__who { display: flex; flex-direction: column; line-height: 1.3; }
.ox-chat__who b { font-family: var(--font-head); color: var(--slate-900); font-size: .98rem; }
.ox-chat__who small { display: inline-flex; align-items: center; gap: 6px; color: var(--slate-500); font-size: .8rem; }
.ox-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: #12B76A; }
.ox-chat[data-state="busy"] .ox-chat__dot { background: var(--gold-500); }
.ox-chat__reset { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--slate-600); font: inherit; font-size: .82rem; cursor: pointer; }
.ox-chat__reset:hover { border-color: var(--navy-700); color: var(--navy-700); }
.ox-chat__reset .icon { width: 14px; height: 14px; }

.ox-chat__log { flex: 1; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); scroll-behavior: smooth; }
.ox-msg { display: flex; flex-direction: column; max-width: 82%; }
.ox-msg--user { align-self: flex-end; align-items: flex-end; }
.ox-msg--bot { align-self: flex-start; }
.ox-msg__bubble { padding: 12px 16px; border-radius: 18px; font-size: .97rem; line-height: 1.6; word-wrap: break-word; }
.ox-msg--user .ox-msg__bubble { background: var(--navy-700); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.ox-msg--bot .ox-msg__bubble { background: #fff; color: var(--slate-700); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.ox-msg__bubble p { margin: 0 0 .6em; }
.ox-msg__bubble p:last-child { margin-bottom: 0; }
.ox-msg__bubble ul { margin: .3em 0 .6em; padding-left: 1.2em; list-style: disc; }
.ox-msg__bubble li { margin-bottom: .25em; }
.ox-msg__bubble a { color: var(--navy-700); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.ox-msg__bubble b { color: var(--slate-900); }

/* Indicateur « l'assistant écrit » */
.ox-msg--typing .ox-msg__bubble { display: inline-flex; gap: 5px; padding: 14px 16px; }
.ox-msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-400); animation: oxTyping 1.2s infinite ease-in-out; }
.ox-msg--typing i:nth-child(2) { animation-delay: .15s; }
.ox-msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes oxTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.ox-chat__suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 0; background: #fff; border-top: 1px solid var(--line); }
.ox-chat__suggest[hidden] { display: none; }
.ox-chat__chip { padding: 8px 14px; border: 1px solid #D5DFEE; border-radius: 999px; background: var(--navy-50); color: var(--navy-700); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.ox-chat__chip:hover { background: #E3EAF6; border-color: var(--navy-700); }

.ox-chat__form { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px; background: #fff; }
.ox-chat__suggest:not([hidden]) + .ox-chat__form { padding-top: 12px; }
.ox-chat__suggest[hidden] + .ox-chat__form { border-top: 1px solid var(--line); }
.ox-chat__form textarea { flex: 1; resize: none; min-height: 48px; max-height: 140px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 24px; font: inherit; font-size: 1rem; line-height: 1.5; color: var(--slate-900); background: var(--surface); }
.ox-chat__form textarea:focus { outline: none; border-color: var(--navy-600); background: #fff; box-shadow: 0 0 0 4px rgba(29, 79, 156, .12); }
.ox-chat__send { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--navy-700); color: #fff; cursor: pointer; transition: background .15s, transform .15s; }
.ox-chat__send:hover { background: var(--navy-600); transform: translateY(-1px); }
.ox-chat__send .icon { width: 20px; height: 20px; }
.ox-chat[data-state="busy"] .ox-chat__send { opacity: .5; pointer-events: none; }
.ox-chat-note { margin: 16px auto 0; max-width: 680px; text-align: center; font-size: .82rem; color: var(--slate-500); }

@media (max-width: 680px) {
	.ox-chat-page { padding: 24px 0 40px; }
	.ox-chat-head { margin-bottom: 18px; }
	.ox-chat-head h1 { font-size: 1.45rem; }
	.ox-chat-head .lead { font-size: .92rem; }
	.ox-chat { height: calc(100svh - 180px); min-height: 420px; border-radius: 18px; }
	.ox-chat__bar { padding: 12px 14px; }
	.ox-chat__reset { padding: 7px 10px; font-size: 0; gap: 0; }
	.ox-chat__reset .icon { width: 16px; height: 16px; }
	.ox-chat__log { padding: 16px 12px; }
	.ox-msg { max-width: 90%; }
	.ox-msg__bubble { font-size: .93rem; padding: 10px 14px; }
	.ox-chat__suggest { flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px 0; scrollbar-width: none; }
	.ox-chat__chip { flex: none; font-size: .82rem; }
	.ox-chat__form { padding: 10px 12px; }
	.ox-chat__form textarea { font-size: 16px; min-height: 44px; }
	.ox-chat__send { width: 44px; height: 44px; }
}
.ox-chat__avatar .icon { width: 22px; height: 22px; color: #fff; }
/* Zone de message : pas de barre de défilement visible (le texte défile toujours au doigt ou à la molette) */
.ox-chat__form textarea { scrollbar-width: none; -ms-overflow-style: none; }
.ox-chat__form textarea::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Ordinateur : le cadre de discussion prend la largeur normale du site (au lieu de 860 px) et un peu plus de hauteur.
 * Les bulles gardent une largeur de lecture confortable. */
@media (min-width: 1025px) {
	.ox-chat-page__inner { max-width: calc(var(--container) + 48px); }
	.ox-chat { height: min(78vh, 780px); }
	.ox-chat__log { padding: 28px 32px; }
	.ox-msg { max-width: min(82%, 780px); }
	.ox-chat__form { padding: 16px 32px; }
}

/* ==========================================================================
 * Fenêtre flottante de l'assistant : bouton rond en bas à droite (à la place de l'accessibilité)
 * ======================================================================== */
.ox-launcher__btn {
	position: fixed; right: 22px; bottom: 22px; z-index: 160; display: grid; place-items: center; width: 58px; height: 58px; padding: 0;
	border: 0; border-radius: 50%; background: var(--navy-700); color: #fff; cursor: pointer; box-shadow: 0 12px 30px -8px rgba(11, 45, 99, .55);
	transition: transform .2s var(--ease), background .2s;
}
.ox-launcher__btn:hover { transform: translateY(-2px); background: var(--navy-800); }
.ox-launcher__btn:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }
.ox-launcher__btn .icon { width: 26px; height: 26px; }
.ox-launcher__shut, .ox-launcher.is-open .ox-launcher__open { display: none; }
.ox-launcher.is-open .ox-launcher__shut { display: grid; }

.ox-launcher__panel { position: fixed; right: 22px; bottom: 94px; z-index: 170; width: 390px; height: min(620px, calc(100vh - 130px)); } /* Au-dessus de l'en-tête (100) et du menu mobile (150). */
.ox-launcher__panel[hidden] { display: none; }
.ox-launcher__panel .ox-chat { height: 100%; min-height: 0; border-radius: 18px; box-shadow: 0 24px 60px -18px rgba(11, 45, 99, .45); animation: oxPop .2s var(--ease); }
@keyframes oxPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.ox-launcher__panel .ox-chat__bar { padding: 12px 12px 12px 16px; }
.ox-launcher__panel .ox-chat__log { padding: 16px 14px; }
.ox-launcher__panel .ox-msg { max-width: 88%; }
.ox-launcher__panel .ox-chat__reset { padding: 8px; }
.ox-launcher__panel .ox-chat__reset span { display: none; }
.ox-launcher__panel .ox-chat__form { padding: 10px 12px; }
.ox-chat__close {
	display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin-left: 6px; padding: 0; border: 0; border-radius: 50%;
	background: none; color: var(--slate-500); cursor: pointer;
}
.ox-chat__reset[hidden] + .ox-chat__close { margin-left: auto; }
.ox-chat__close:hover { background: var(--surface); color: var(--navy-700); }
.ox-chat__close .icon { width: 18px; height: 18px; }
.ox-chat__popup-note { margin: 0; padding: 0 14px 10px; color: var(--slate-500); font-size: 11.5px; line-height: 1.4; text-align: center; background: #fff; }

/* Téléphone : fenêtre plus large, au-dessus du bouton. */
@media (max-width: 680px) {
	.ox-launcher__btn { right: 14px; bottom: 14px; width: 54px; height: 54px; }
	.ox-launcher__panel { left: 8px; right: 8px; top: auto; bottom: 78px; width: auto; height: min(70svh, 560px); }
	html.ox-chat-open { overflow: hidden; }
}
.ox-chat__reset[hidden] { display: none; } /* Visible seulement quand une conversation a commencé. */

/* Fenêtre ouverte : le bouton rond disparaît (la croix du haut suffit) et la fenêtre descend à sa place. */
.ox-launcher.is-open .ox-launcher__btn { display: none; }
.ox-launcher__panel { bottom: 22px; height: min(640px, calc(100vh - 44px)); }
@media (max-width: 680px) {
	.ox-launcher__panel { bottom: 8px; height: min(70svh, 560px); }
}
/* Clavier ouvert sur téléphone : on garde la place pour les messages et le champ de saisie. */
.ox-launcher.is-typing .ox-chat__suggest,
.ox-launcher.is-typing .ox-chat__popup-note { display: none; }
.ox-launcher.is-typing .ox-chat__bar { padding-top: 8px; padding-bottom: 8px; }
.ox-launcher.is-typing .ox-chat__form { border-top: 1px solid var(--line); }
