/* Assistant DiGit — reprend les jetons du thème (couleurs, rayons, police), avec des valeurs de repli. */
.dsg {
	--g-fond: var(--c-surface, #fff);
	--g-doux: var(--c-surface-2, #E6EBF7);
	--g-encre: var(--c-encre, #0B0B12);
	--g-titre: var(--c-titre, #000);
	--g-gris: var(--c-gris, #585C6B);
	--g-filet: var(--c-filet, #C5CDE0);
	--g-marque: var(--c-marque, #000);
	--g-sur-marque: var(--c-sur-marque, #fff);
	--g-rayon: var(--rayon, 16px);
	--g-rayon-int: var(--rayon-int, 10px);
	--g-ease: var(--ease, cubic-bezier(.22, 1, .36, 1));
	font-family: var(--f-texte, system-ui, sans-serif);
}
.dsg [hidden] { display: none !important; }
.dsg svg { width: 18px; height: 18px; flex: none; }
.dsg :is(button, input, textarea) { font-family: inherit; letter-spacing: normal; text-transform: none; }

/* Pastille : à gauche du bouton WhatsApp (la flèche « haut » reste au-dessus de lui). */
.dsg-lanceur { position: fixed; right: 16px; bottom: 16px; z-index: 91; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--g-marque); color: var(--g-sur-marque); font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .35s, transform .35s var(--g-ease); }
.dsg-avec-wa .dsg-lanceur { right: 80px; }
.dsg-lanceur.est-visible { opacity: 1; transform: none; pointer-events: auto; }
.dsg-lanceur:hover { transform: translateY(-2px); }
.dsg-lanceur:focus-visible, .dsg button:focus-visible, .dsg a:focus-visible { outline: 2px solid var(--g-marque); outline-offset: 2px; }
.dsg-lanceur.a-conversation::after { content: ""; position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #25D366; }
.dsg-ouvert .dsg-lanceur, .dsg-ouvert .ds-whatsapp, .dsg-ouvert .ds-haut { opacity: 0 !important; pointer-events: none !important; }

/* Invitation : petite bulle au-dessus de la pastille, jamais bloquante. */
.dsg-invite { position: fixed; right: 16px; bottom: 80px; z-index: 92; display: grid; gap: 8px; width: min(320px, calc(100vw - 32px)); padding: 18px 18px 16px; border-radius: var(--g-rayon); background: var(--g-fond); color: var(--g-encre); box-shadow: inset 0 0 0 1px var(--g-filet); opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .4s var(--g-ease); }
.dsg-invite.est-visible { opacity: 1; transform: none; }
.dsg-invite p { margin: 0; }
.dsg-invite__titre { padding-right: 28px; color: var(--g-titre); font-family: var(--f-section, inherit); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.dsg-invite__texte { color: var(--g-gris); font-size: .875rem; line-height: 1.5; }
.dsg-invite .dsg-btn { justify-self: start; margin-top: 4px; }
.dsg-invite__fermer { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--g-gris); cursor: pointer; }
.dsg-invite__fermer:hover { background: var(--g-doux); color: var(--g-encre); }

/* Panneau : latéral, non bloquant ; la page reste lisible à côté. */
.dsg-panneau { position: fixed; right: 16px; bottom: 16px; z-index: 95; display: flex; flex-direction: column; width: 400px; height: min(660px, calc(100dvh - 32px)); overflow: hidden; border-radius: var(--g-rayon); background: var(--g-fond); color: var(--g-encre); box-shadow: inset 0 0 0 1px var(--g-filet); opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .35s var(--g-ease); }
.dsg-panneau.est-ouvert { opacity: 1; transform: none; }
.dsg-tete { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; border-bottom: 1px solid var(--g-filet); }
.dsg-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--g-marque); color: var(--g-sur-marque); flex: none; }
.dsg-tete__texte { flex: 1; min-width: 0; }
.dsg-tete h2 { margin: 0; color: var(--g-titre); font-family: var(--f-section, inherit); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.dsg-tete p { margin: 0; color: var(--g-gris); font-size: .8125rem; line-height: 1.4; }
.dsg-icone { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--g-gris); cursor: pointer; flex: none; }
.dsg-icone:hover { background: var(--g-doux); color: var(--g-encre); }

.dsg-fil { position: relative; flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.dsg-msg { max-width: 88%; padding: 12px 14px; border-radius: 14px; font-size: .9375rem; line-height: 1.5; }
.dsg-msg p { margin: 0; white-space: pre-line; }
.dsg-msg--bot { align-self: flex-start; display: grid; gap: 10px; border-bottom-left-radius: 4px; background: var(--g-doux); color: var(--g-encre); }
.dsg-msg--moi { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--g-marque); color: var(--g-sur-marque); }
.dsg-msg--form { max-width: 100%; width: 100%; }

.dsg-choix { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dsg-option { min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--g-fond); color: var(--g-encre); box-shadow: inset 0 0 0 1px var(--g-filet); font-size: .875rem; font-weight: 500; line-height: 1.3; text-align: left; cursor: pointer; transition: background .2s, box-shadow .2s; }
.dsg-option:hover { background: var(--g-doux); box-shadow: inset 0 0 0 1px var(--g-encre); }

.dsg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dsg-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--g-fond); color: var(--g-encre); box-shadow: inset 0 0 0 1px var(--g-filet); font-size: .875rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s var(--g-ease); }
.dsg-btn:hover { transform: translateY(-1px); }
.dsg-btn--plein { background: var(--g-marque); color: var(--g-sur-marque); box-shadow: none; }
.dsg-btn svg { width: 16px; height: 16px; }
.dsg-btn:disabled { opacity: .55; cursor: wait; }

.dsg-liens { display: grid; gap: 4px; }
.dsg-lien { display: inline-flex; align-items: center; gap: 6px; color: var(--g-titre); font-size: .875rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.dsg-lien svg { width: 14px; height: 14px; }

.dsg-carte { display: grid; gap: 4px; padding: 14px; border-radius: var(--g-rayon-int); background: var(--g-fond); color: var(--g-encre); text-decoration: none; transition: transform .2s var(--g-ease); }
.dsg-carte:hover { transform: translateY(-1px); }
.dsg-carte__sur { color: var(--g-gris); font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.dsg-carte b { color: var(--g-titre); font-family: var(--f-section, inherit); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.02em; }
.dsg-carte__texte { color: var(--g-gris); font-size: .875rem; line-height: 1.5; }
.dsg-carte__lien { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--g-titre); font-size: .875rem; font-weight: 600; }
.dsg-carte__lien svg { width: 14px; height: 14px; }

.dsg-creneaux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dsg-creneau { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--g-rayon-int); background: var(--g-fond); color: var(--g-encre); text-decoration: none; font-size: .8125rem; line-height: 1.35; transition: box-shadow .2s; }
.dsg-creneau:hover { box-shadow: inset 0 0 0 1px var(--g-encre); }
.dsg-creneau span::first-letter { text-transform: uppercase; }
.dsg-creneau b { color: var(--g-titre); font-size: .9375rem; }

.dsg-attente { display: flex; gap: 5px; padding: 16px; }
.dsg-attente span { width: 7px; height: 7px; border-radius: 50%; background: var(--g-gris); animation: dsg-point 1s infinite ease-in-out; }
.dsg-attente span:nth-child(2) { animation-delay: .15s; }
.dsg-attente span:nth-child(3) { animation-delay: .3s; }
@keyframes dsg-point { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

/* Formulaire de contact intégré. */
.dsg-form { display: grid; gap: 10px; }
.dsg-champ { display: grid; gap: 4px; }
.dsg-champ label { color: var(--g-encre); font-size: .8125rem; font-weight: 600; }
.dsg .dsg-champ input, .dsg .dsg-champ textarea { width: 100%; margin: 0; box-sizing: border-box; min-height: 42px; padding: 9px 12px; border: 0; border-radius: var(--g-rayon-int); background: var(--g-fond); color: var(--g-encre); box-shadow: inset 0 0 0 1px var(--g-filet); font: inherit; font-size: .9375rem; }
.dsg-champ textarea { resize: vertical; min-height: 72px; }
.dsg .dsg-champ input:focus, .dsg .dsg-champ textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--g-encre); }
.dsg-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dsg-case { position: relative; display: flex; align-items: flex-start; gap: 10px; font-size: .8125rem; line-height: 1.45; cursor: pointer; }
.dsg-case input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dsg-case__boite { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--g-fond); box-shadow: inset 0 0 0 1.5px var(--g-gris); color: transparent; flex: none; }
.dsg-case__boite svg { width: 14px; height: 14px; }
.dsg-case input:checked + .dsg-case__boite { background: var(--g-marque); box-shadow: none; color: var(--g-sur-marque); }
.dsg-case input:focus-visible + .dsg-case__boite { outline: 2px solid var(--g-marque); outline-offset: 2px; }
.dsg-erreur { margin: 0; color: var(--g-titre); font-size: .8125rem; font-weight: 600; }
.dsg-erreur:empty { display: none; }
.dsg-form .dsg-btn { justify-self: start; }
.dsg-ok { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; }

.dsg-pied { padding: 10px 12px 12px; border-top: 1px solid var(--g-filet); }
.dsg-question { display: flex; align-items: flex-end; gap: 8px; padding: 4px 4px 4px 14px; border-radius: 22px; background: var(--g-doux); }
.dsg .dsg-saisie { flex: 1; min-width: 0; min-height: 40px; max-height: 120px; margin: 0; padding: 10px 0; border: 0; border-radius: 0; background: none; box-shadow: none; appearance: none; color: var(--g-encre); font: inherit; font-size: .9375rem; line-height: 1.35; resize: none; }
.dsg .dsg-saisie:focus, .dsg .dsg-saisie:focus-visible { outline: none; box-shadow: none; border: 0; }
.dsg-question:focus-within { box-shadow: inset 0 0 0 2px var(--g-encre); }
.dsg-saisie::placeholder { color: var(--g-gris); opacity: 1; }
.dsg-envoyer { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--g-marque); color: var(--g-sur-marque); cursor: pointer; flex: none; }
.dsg-envoyer:disabled { opacity: .5; cursor: wait; }
.dsg-mention { margin: 8px 4px 0; color: var(--g-gris); font-size: .75rem; line-height: 1.4; }
.dsg-mention a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Téléphone et tablette : le panneau monte du bas, sur toute la largeur. */
@media (max-width: 560px) {
	.dsg-panneau { right: 0; bottom: 0; left: 0; width: auto; height: min(88dvh, 680px); border-radius: var(--g-rayon) var(--g-rayon) 0 0; }
	.dsg-msg { max-width: 92%; }
	.dsg-invite { right: 16px; }
}
@media (max-width: 900px) {
	/* La barre d'appel des fiches projet et la relance du thème ont la priorité. */
	body:has(.ds-barre-appel.est-visible) .dsg-lanceur, body:has(.ds-relance.est-visible) .dsg-lanceur { opacity: 0; pointer-events: none; }
}
@media (max-width: 380px) {
	.dsg-lanceur span { display: none; }
	.dsg-lanceur { width: 52px; padding: 0; justify-content: center; }
	.dsg-lanceur.a-conversation::after { top: 6px; right: 6px; }
}
@media (max-width: 900px) {
	.dsg-calme .dsg-lanceur span { display: none; }
	.dsg-calme .dsg-lanceur { width: 52px; padding: 0; justify-content: center; }
	.dsg-calme .dsg-lanceur.a-conversation::after { top: 6px; right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
	.dsg-lanceur, .dsg-invite, .dsg-panneau, .dsg-btn, .dsg-carte { transition: none; }
	.dsg-attente span { animation: none; opacity: .6; }
	.dsg-fil { scroll-behavior: auto; }
}
.dsg-lanceur.est-sous-heros { opacity: 0; transform: translateY(12px); pointer-events: none; }
