/**
 * L'entonnoir et sa modale.
 *
 * Aucune dépendance, aucune variable de thème : ce service tourne sur un
 * WordPress dont le thème peut être n'importe lequel, et il doit rester lisible
 * quel qu'il soit.
 *
 * @package ChatbotToWebHtml
 */

.ctwh-app {
	--ctwh-ink: #17212b;
	--ctwh-muted: #5a6b7b;
	--ctwh-line: #d8e0e7;
	--ctwh-accent: #1f6feb;
	--ctwh-accent-ink: #fff;
	--ctwh-bg: #fff;
	--ctwh-soft: #f4f7fa;

	box-sizing: border-box;
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 16px 48px;
	color: var(--ctwh-ink);
	font-size: 16px;
	line-height: 1.55;
}

.ctwh-app *,
.ctwh-modal * {
	box-sizing: border-box;
}

/* --- En-tête --------------------------------------------------------- */

.ctwh-header {
	text-align: center;
	margin-bottom: 24px;
}

.ctwh-title {
	margin: 0 0 8px;
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	line-height: 1.2;
}

.ctwh-subtitle {
	margin: 0;
	color: var(--ctwh-muted);
}

/* --- Fil d'Ariane ---------------------------------------------------- */

.ctwh-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
}

.ctwh-steps__item {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 140px;
	padding: 8px 12px;
	border: 1px solid var(--ctwh-line);
	border-radius: 999px;
	background: var(--ctwh-bg);
	color: var(--ctwh-muted);
	font-size: 0.85rem;
}

.ctwh-steps__num {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	border-radius: 50%;
	background: var(--ctwh-soft);
	font-size: 0.75rem;
	font-weight: 700;
}

.ctwh-steps__item.is-done {
	border-color: #2f9e63;
	color: #2f9e63;
}

/*
 * Une étape franchie se reclique pour y revenir. Elle doit donc se **voir**
 * cliquable : un élément qui réagit sans l'annoncer ne sert qu'à ceux qui
 * essaient au hasard.
 */
.ctwh-steps__item[role="button"] {
	cursor: pointer;
	transition: background .12s, transform .08s;
}

.ctwh-steps__item[role="button"]:hover {
	background: #eefaf2;
	transform: translateY(-1px);
}

.ctwh-steps__item[role="button"]:focus-visible {
	outline: 2px solid var(--ctwh-accent);
	outline-offset: 2px;
}

.ctwh-steps__item.is-done .ctwh-steps__num {
	background: #2f9e63;
	color: #fff;
}

.ctwh-steps__item.is-current {
	border-color: var(--ctwh-accent);
	color: var(--ctwh-ink);
	font-weight: 600;
}

.ctwh-steps__item.is-current .ctwh-steps__num {
	background: var(--ctwh-accent);
	color: var(--ctwh-accent-ink);
}

/* --- Panneau --------------------------------------------------------- */

.ctwh-panel {
	border: 1px solid var(--ctwh-line);
	border-radius: 14px;
	background: var(--ctwh-bg);
	padding: 16px;
}

.ctwh-steps__item.is-viewed {
	box-shadow: 0 0 0 2px var(--ctwh-accent);
}

.ctwh-degraded {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-left: 3px solid #d99e2b;
	background: #fdf6e7;
	color: #6b5316;
}

/* --- Puces ----------------------------------------------------------- */

.ctwh-chips {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}

.ctwh-chip {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 14px;
	border: 1px solid var(--ctwh-line);
	border-radius: 12px;
	background: var(--ctwh-bg);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s, background .15s, transform .1s;
}

.ctwh-chip:hover {
	border-color: var(--ctwh-accent);
}

.ctwh-chip:active {
	transform: translateY(1px);
}

.ctwh-chip.is-picked {
	border-color: var(--ctwh-accent);
	background: #eef4ff;
}

.ctwh-chip__label {
	font-weight: 600;
}

.ctwh-chip__desc {
	color: var(--ctwh-muted);
	font-size: 0.85rem;
}

/* --- Champs libres --------------------------------------------------- */

.ctwh-fields__intro {
	margin: 0 0 10px;
	color: var(--ctwh-muted);
	font-size: 0.9rem;
}

.ctwh-fields__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}

.ctwh-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ctwh-field__label {
	font-size: 0.85rem;
	font-weight: 600;
}

.ctwh-field__input {
	padding: 9px 11px;
	border: 1px solid var(--ctwh-line);
	border-radius: 9px;
	font: inherit;
	color: inherit;
	background: var(--ctwh-bg);
}

.ctwh-field__input:focus {
	outline: 2px solid var(--ctwh-accent);
	outline-offset: 1px;
}

textarea.ctwh-field__input {
	min-height: 84px;
	resize: vertical;
}

/* --- Boutons --------------------------------------------------------- */

.ctwh-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.ctwh-btn {
	padding: 10px 18px;
	border: 1px solid var(--ctwh-line);
	border-radius: 999px;
	background: var(--ctwh-bg);
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ctwh-btn:hover {
	border-color: var(--ctwh-accent);
}

.ctwh-btn--primary {
	border-color: var(--ctwh-accent);
	background: var(--ctwh-accent);
	color: var(--ctwh-accent-ink);
}

.ctwh-hint {
	margin: 12px 0 0;
	min-height: 1.4em;
	color: var(--ctwh-muted);
	font-size: 0.9rem;
}

/* --- Modale ---------------------------------------------------------- */

/*
 * Centrage par la grille, pas par des marges négatives : la boîte reste
 * centrée quelle que soit sa hauteur, y compris quand NotifReach y ajoute son
 * propre bloc au moment de l'abonnement.
 */
.ctwh-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	place-items: center;
	padding: 16px;
}

.ctwh-modal[hidden] {
	display: none;
}

.ctwh-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(14, 22, 31, .62);
}

.ctwh-modal__box {
	position: relative;
	width: min(720px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px;
	border-radius: 16px;
	background: #fff;
	color: #17212b;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	text-align: center;
}

/* --- Les listes : valeurs par défaut, ou saisie --- */

/*
 * Les deux modes sont **toujours** offerts côte à côte, jamais l'un caché
 * derrière l'autre : le visiteur voit d'un coup d'œil ce qu'il a choisi et ce
 * qu'il pourrait choisir. Demandé par Pascal le 17/09.
 */
.ctwh-repeat__intro[hidden] {
	display: none;
}

.ctwh-repeat__intro {
	display: grid;
	gap: 10px;
	justify-items: start;
	margin-bottom: 12px;
}

.ctwh-repeat__lead {
	margin: 0;
	color: #1d2b3a;
}

/* « Laisser tel quel » revient sur un geste ; il ne se dispute pas la vedette. */
.ctwh-btn--quiet {
	border-color: transparent;
	background: none;
	color: #5a6b7b;
	text-decoration: underline;
}

.ctwh-repeat__list {
	display: grid;
	gap: 12px;
}

.ctwh-repeat__item {
	display: grid;
	gap: 8px;
	padding: 12px;
	border: 1px solid #dbe3ec;
	border-radius: 10px;
}

.ctwh-repeat__item-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.ctwh-repeat__rank {
	color: #5a6b7b;
	font-size: .85rem;
}

/* La zone d'image dit son état : rien, un fichier choisi, ou un manque. */
.ctwh-repeat__drop {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 72px;
	padding: 10px;
	border: 1px dashed #9fb3c8;
	border-radius: 10px;
	color: #5a6b7b;
	text-align: center;
	cursor: pointer;
}

.ctwh-repeat__drop.is-over,
.ctwh-repeat__drop.is-filled {
	border-style: solid;
	border-color: #1f6feb;
	color: #1d2b3a;
}

.ctwh-repeat__drop.is-missing {
	border-color: #b42318;
	color: #b42318;
}

@media (max-width: 640px) {
	.ctwh-repeat__modes {
		grid-template-columns: 1fr;
	}
}

/* --- Le voile d'attente --- */

/*
 * **Il ne paraît qu'au bout d'un quart de seconde.** Une réponse immédiate ne
 * doit pas produire un éclair blanc : l'attente n'est signalée que lorsqu'elle
 * commence à se voir. L'animation est celle de la fenêtre modale, déjà écrite
 * et déjà coupée pour qui demande moins d'animations.
 */
/*
 * **`display` l'emporte sur l'attribut `hidden`.** Relevé en ligne le 17/09 :
 * le voile restait en travers de l'écran dès le chargement, et aucun script ne
 * pouvait le retirer. C'est le défaut du bandeau de cookies du 15/09, répété.
 * Toute règle qui pose un `display` doit rendre le sien à `hidden`.
 */
.ctwh-veil[hidden] {
	display: none;
}

.ctwh-veil {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(12, 18, 28, .45);
	opacity: 0;
	animation: ctwh-veil-in .2s ease .25s forwards;
}

.ctwh-veil__box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 22px 28px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .55);
}

.ctwh-veil__spinner {
	display: flex;
	gap: 6px;
}

.ctwh-veil__spinner span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #1f6feb;
	animation: ctwh-bounce 1s infinite ease-in-out;
}

.ctwh-veil__spinner span:nth-child(2) { animation-delay: .15s; }
.ctwh-veil__spinner span:nth-child(3) { animation-delay: .3s; }

.ctwh-veil__text {
	margin: 0;
	color: #1d2b3a;
	font-size: .95rem;
}

@keyframes ctwh-veil-in {
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ctwh-veil {
		animation: none;
		opacity: 1;
	}

	.ctwh-veil__spinner span {
		animation: none;
	}
}

.ctwh-modal__spinner {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-bottom: 14px;
}

.ctwh-modal__spinner span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #1f6feb;
	animation: ctwh-bounce 1s infinite ease-in-out;
}

.ctwh-modal__spinner span:nth-child(2) { animation-delay: .15s; }
.ctwh-modal__spinner span:nth-child(3) { animation-delay: .3s; }

@keyframes ctwh-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: .45; }
	40% { transform: translateY(-7px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ctwh-modal__spinner span {
		animation: none;
	}
}

.ctwh-modal__title {
	margin: 0 0 8px;
	font-size: 1.4rem;
}

.ctwh-modal__text {
	margin: 0 0 20px;
	color: #5a6b7b;
}

.ctwh-modal__choice {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	text-align: left;
}

.ctwh-modal__option {
	padding: 16px;
	border: 1px solid #d8e0e7;
	border-radius: 12px;
	background: #f9fbfd;
}

.ctwh-modal__option-title {
	margin: 0 0 6px;
	font-size: 1rem;
}

.ctwh-modal__option-text {
	margin: 0 0 12px;
	color: #5a6b7b;
	font-size: 0.9rem;
}

.ctwh-modal__label {
	display: block;
	margin: 12px 0 6px;
	font-size: 0.85rem;
	font-weight: 600;
}

.ctwh-modal__sms-row {
	display: flex;
	gap: 8px;
}

.ctwh-modal__phone {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 11px;
	border: 1px solid #d8e0e7;
	border-radius: 9px;
	font: inherit;
}

.ctwh-modal__phone-save {
	padding: 9px 14px;
	border: 1px solid #1f6feb;
	border-radius: 9px;
	background: #1f6feb;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ctwh-modal__warn {
	margin: 0;
	padding: 10px;
	border-radius: 8px;
	background: #fdf6e7;
	color: #6b5316;
	font-size: 0.85rem;
}

.ctwh-modal__status {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
}

.ctwh-modal__feedback {
	margin: 16px 0 0;
	min-height: 1.4em;
	color: #2f9e63;
	font-size: 0.9rem;
}

/* --- Écrans étroits -------------------------------------------------- */

@media (max-width: 600px) {
	.ctwh-steps__item {
		flex: 1 1 100%;
	}

	.ctwh-modal__box {
		padding: 20px 16px;
	}
}

/*
 * La promesse de redirection, mise en avant.
 *
 * Un encadré plutôt qu'un paragraphe de plus : c'est la seule ligne de la
 * modale que le visiteur doit avoir lue avant de quitter des yeux son écran.
 */
.ctwh-modal__promise {
	margin: 0 0 20px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #eef7f1;
	color: #1d6b45;
	font-weight: 600;
}

/* --- Modale de relecture --------------------------------------------- */

/*
 * Trois rangées : en-tête, corps qui défile, pied fixe. La hauteur est
 * plafonnee pour que le pied reste toujours visible — un bouton [Soumettre]
 * posé en fin de contenu se retrouverait hors de l'écran dès que la
 * conversation s'allonge, et le visiteur qui a tout relu ne trouverait plus
 * par où envoyer.
 */
.ctwh-recap__box {
	position: relative;
	display: grid;
	grid-template-rows: auto 1fr auto;
	width: min(760px, 100%);
	max-height: min(86vh, 900px);
	border-radius: 16px;
	background: #fff;
	color: #17212b;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	overflow: hidden;
	text-align: left;
}

.ctwh-recap__head {
	padding: 22px 24px 14px;
	border-bottom: 1px solid #e6ecf2;
}

.ctwh-recap__title {
	margin: 0 0 6px;
	font-size: 1.3rem;
	line-height: 1.25;
}

.ctwh-recap__intro {
	margin: 0;
	color: #5a6b7b;
	font-size: .9rem;
}

.ctwh-recap__body {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 4px 24px 20px;
}

.ctwh-recap__section {
	padding: 18px 0 4px;
	border-bottom: 1px solid #eef2f6;
}

.ctwh-recap__section:last-child {
	border-bottom: 0;
}

.ctwh-recap__section-title {
	margin: 0 0 10px;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #1f6feb;
}

.ctwh-recap__facts {
	display: grid;
	grid-template-columns: minmax(120px, 34%) 1fr;
	gap: 6px 14px;
	margin: 0 0 12px;
}

.ctwh-recap__facts dt {
	color: #5a6b7b;
	font-size: .85rem;
}

.ctwh-recap__facts dd {
	margin: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.ctwh-recap__empty {
	margin: 0 0 12px;
	color: #8a99a8;
	font-size: .85rem;
	font-style: italic;
}

.ctwh-recap__exchange {
	margin: 0 0 10px;
	padding: 10px 12px;
	border-left: 2px solid #e6ecf2;
	background: #f8fafc;
	border-radius: 0 8px 8px 0;
}

.ctwh-recap__line {
	margin: 0;
	font-size: .88rem;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.ctwh-recap__line + .ctwh-recap__line {
	margin-top: 6px;
}

.ctwh-recap__tag {
	display: block;
	color: #8a99a8;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.ctwh-recap__line--a .ctwh-recap__said {
	font-weight: 600;
}

.ctwh-recap__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 14px 24px;
	border-top: 1px solid #e6ecf2;
	background: #fff;
}

.ctwh-recap__hint {
	flex: 1 1 100%;
	margin: 0;
	min-height: 0;
	color: #5a6b7b;
	font-size: .85rem;
}

@media (max-width: 600px) {
	.ctwh-recap__box {
		max-height: 92vh;
	}

	.ctwh-recap__head,
	.ctwh-recap__body,
	.ctwh-recap__foot {
		padding-left: 16px;
		padding-right: 16px;
	}

	.ctwh-recap__facts {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.ctwh-recap__facts dd {
		margin-bottom: 8px;
	}
}

/* --- Modale d'accueil ------------------------------------------------- */

.ctwh-start__box {
	position: relative;
	width: min(640px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px 22px;
	border-radius: 16px;
	background: #fff;
	color: #17212b;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	text-align: center;
}

.ctwh-start__title {
	margin: 0 0 8px;
	font-size: 1.35rem;
	line-height: 1.25;
}

.ctwh-start__intro {
	margin: 0 0 22px;
	color: #5a6b7b;
}

.ctwh-start__choice {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

/*
 * Deux cibles larges, et non deux liens.
 *
 * Ce choix est le tout premier geste du visiteur, souvent sur téléphone et
 * parfois avec des gants : une zone de la taille d'une carte se touche du
 * premier coup, là où un lien se manque.
 */
.ctwh-start__option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 20px 16px;
	border: 2px solid #d8e0e7;
	border-radius: 14px;
	background: #fff;
	color: inherit;
	font: inherit;
	text-align: center;
	cursor: pointer;
	transition: border-color .15s, background .15s, transform .1s;
}

.ctwh-start__option:hover {
	border-color: #1f6feb;
	background: #f6f9ff;
}

.ctwh-start__option:active {
	transform: translateY(1px);
}

.ctwh-start__option:focus-visible {
	outline: 2px solid #1f6feb;
	outline-offset: 2px;
}

/* Mis en avant : le dernier choix du visiteur, sinon la voix. */
.ctwh-start__option--voice,
.ctwh-start__option.is-preferred {
	border-color: #1f6feb;
	background: #f6f9ff;
}

.ctwh-start__choice.has-preference .ctwh-start__option--voice:not(.is-preferred) {
	border-color: #d8e0e7;
	background: #fff;
}

.ctwh-start__icon {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #eaf1ff;
	color: #1f6feb;
}

.ctwh-start__option-title {
	font-size: 1.02rem;
	font-weight: 700;
}

.ctwh-start__option-text {
	color: #5a6b7b;
	font-size: .86rem;
	line-height: 1.4;
}

.ctwh-start__note {
	margin: 0;
	color: #8a99a8;
	font-size: .8rem;
}

@media (max-width: 600px) {
	.ctwh-start__box {
		padding: 22px 16px 18px;
	}

	.ctwh-start__choice {
		grid-template-columns: 1fr;
	}
}

/* --- Mise en page : formulaire, conversation, choix ------------------ */

/*
 * Un seul parent pour les trois : `#ctwh-fields`, `#ctwh-chat` (rendu par
 * TalkActive) et `#ctwh-choices`. Sur bureau, trois colonnes ; la conversation
 * et les choix ont la même largeur, le formulaire est plus étroit.
 */
.ctwh-conversation {
	margin-bottom: 16px;
}

/* Un panneau masqué doit disparaître : `display` l'emporte sur `hidden`. */
.ctwh-side[hidden] {
	display: none;
}

.ctwh-side {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--ctwh-line);
	border-radius: 12px;
	background: var(--ctwh-soft);
}

.ctwh-side__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--ctwh-line);
}

.ctwh-side__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
}

/* Le bouton de fermeture ne sert qu'aux popups. */
.ctwh-side__close {
	display: none;
	place-items: center;
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	border: 1px solid var(--ctwh-line);
	border-radius: 50%;
	background: var(--ctwh-bg);
	color: var(--ctwh-ink);
	cursor: pointer;
}

.ctwh-side__close:focus-visible,
.ctwh-toolbar__btn:focus-visible,
.ctwh-chip:focus-visible,
.ctwh-btn:focus-visible {
	outline: 2px solid var(--ctwh-accent);
	outline-offset: 2px;
}

.ctwh-side__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 12px 14px;
}

.ctwh-side__intro,
.ctwh-side__note {
	margin: 0 0 12px;
	color: var(--ctwh-muted);
	font-size: .88rem;
}

.ctwh-side__note {
	padding: 8px 10px;
	border-radius: 8px;
	background: #fdf6e7;
	color: #6b5316;
}

.ctwh-side__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px 14px;
	border-top: 1px solid var(--ctwh-line);
}

.ctwh-side__foot[hidden],
.ctwh-side__intro[hidden],
.ctwh-side__note[hidden] {
	display: none;
}

.ctwh-side--choices .ctwh-chips {
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	margin-bottom: 0;
}

.ctwh-side--choices.is-reconfirm .ctwh-side__head {
	border-bottom-color: #d99e2b;
}

.ctwh-chip.is-none {
	border-style: dashed;
}

/* --- Formulaire -------------------------------------------------------- */

.ctwh-form__group {
	margin: 0 0 16px;
	padding: 10px 12px 12px;
	border: 1px solid var(--ctwh-line);
	border-radius: 10px;
	background: var(--ctwh-bg);
}

.ctwh-form__group.is-viewed {
	border-color: var(--ctwh-accent);
}

.ctwh-form__legend {
	padding: 0 4px;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--ctwh-muted);
}

.ctwh-form__group .ctwh-field + .ctwh-field {
	margin-top: 10px;
}

.ctwh-field__hint,
.ctwh-field__note {
	font-size: .78rem;
	color: var(--ctwh-muted);
}

.ctwh-field__note:empty {
	display: none;
}

.ctwh-field.is-reconfirm .ctwh-field__input {
	border-color: #d99e2b;
	background: #fffaf0;
}

.ctwh-field.is-reconfirm .ctwh-field__note {
	color: #8a5a00;
	font-weight: 600;
}

.ctwh-field__input[aria-invalid="true"] {
	border-color: #c0392b;
}

.ctwh-field.is-invalid .ctwh-field__note {
	color: #c0392b;
}

/* --- Barre d'outils et fond des popups --------------------------------- */

.ctwh-toolbar {
	display: none;
}

.ctwh-toolbar__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 16px;
	border: 1px solid var(--ctwh-line);
	border-radius: 999px;
	background: var(--ctwh-bg);
	color: var(--ctwh-ink);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.ctwh-toolbar__btn[aria-expanded="true"] {
	border-color: var(--ctwh-accent);
	color: var(--ctwh-accent);
}

.ctwh-toolbar__badge {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #e8590c;
	box-shadow: 0 0 0 2px var(--ctwh-bg);
}

.ctwh-toolbar__badge[hidden],
.ctwh-backdrop[hidden] {
	display: none;
}

.ctwh-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99980;
	background: rgba(14, 22, 31, .5);
}

.ctwh-app .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* --- Bureau : trois colonnes ------------------------------------------- */

@media (min-width: 1024px) {
	.ctwh-conversation {
		display: grid;
		grid-template-columns: minmax(220px, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr);
		gap: 16px;
		align-items: start;
	}

	.ctwh-conversation > * {
		min-width: 0;
	}

	.ctwh-side {
		position: sticky;
		top: 16px;
		max-height: min(80vh, 760px);
	}
}

/* --- Tablette et mobile : popups --------------------------------------- */

@media (max-width: 1023.98px) {
	.ctwh-toolbar {
		display: flex;
		flex-wrap: wrap;
		gap: 10px;
		margin: 0 0 14px;
	}

	.ctwh-side {
		display: none;
	}

	.ctwh-side[data-open] {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 99990;
		display: flex;
		width: 100%;
		max-height: 88vh;
		border-radius: 16px 16px 0 0;
		background: var(--ctwh-bg);
		box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
		animation: ctwh-sheet .18s ease-out;
	}

	.ctwh-side[data-open] .ctwh-side__head {
		position: sticky;
		top: 0;
		background: var(--ctwh-bg);
		border-radius: 16px 16px 0 0;
	}

	.ctwh-side__close {
		display: grid;
	}

	.ctwh-side--choices .ctwh-chips {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}
}

@keyframes ctwh-sheet {
	from { transform: translateY(24px); opacity: .6; }
	to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ctwh-side[data-open] {
		animation: none;
	}
}
