/* Chatbot, voorkant (voorkant.php, voorkant.js). Alles onder .kx-chatbot; kleuren per bot als CSS-variabelen op de root
   (--kxcb-balk, -bot, -bot-tekst, -mens, met een leesbare tekstkleur uit PHP). Selectors met twee klassen: thema's en
   Elementor-kits stylen button, textarea, h2 en p breed. */
.kx-chatbot {
	--kxcb-rand: rgba(17, 24, 39, .1);
	--kxcb-zacht: #6b7280;
	--kxcb-vlak: #ffffff;
	--kxcb-schaduw: 0 24px 60px -12px rgba(17, 24, 39, .28), 0 4px 14px rgba(17, 24, 39, .08);
	--kxcb-ease: cubic-bezier(.2, .8, .2, 1);
	font-size: 15px;
	line-height: 1.5;
	color: #1f2937;
	-webkit-font-smoothing: antialiased;
}
.kx-chatbot *, .kx-chatbot *::before, .kx-chatbot *::after { box-sizing: border-box; }
.kx-chatbot[hidden], .kx-chatbot [hidden] { display: none !important; }

/* Knoppen: thema-stijlen neutraliseren. */
.kx-chatbot .kx-chatbot__knop, .kx-chatbot .kx-chatbot__sluit, .kx-chatbot .kx-chatbot__stuur, .kx-chatbot .kx-chatbot__opnieuw {
	margin: 0; padding: 0; border: 0; background: none; box-shadow: none; text-transform: none; letter-spacing: normal;
	min-height: 0; min-width: 0; width: auto; height: auto; font: inherit; line-height: 1; color: inherit; cursor: pointer;
	-webkit-tap-highlight-color: transparent; -webkit-appearance: none; appearance: none; text-decoration: none;
}

/* Zwevende knop */
.kx-chatbot--popup { position: fixed; right: 20px; bottom: var(--kxcb-pos-d, 30px); z-index: 99980; }
.kx-chatbot .kx-chatbot__knop {
	display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
	background: var(--kxcb-balk); color: var(--kxcb-balk-tekst);
	box-shadow: 0 10px 28px -6px rgba(17, 24, 39, .35), 0 2px 6px rgba(17, 24, 39, .12);
	transition: transform .2s var(--kxcb-ease), box-shadow .2s var(--kxcb-ease);
}
.kx-chatbot .kx-chatbot__knop:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -6px rgba(17, 24, 39, .4), 0 2px 6px rgba(17, 24, 39, .12); }
.kx-chatbot .kx-chatbot__knop:active { transform: scale(.96); }
.kx-chatbot .kx-chatbot__knop:focus-visible { outline: 3px solid var(--kxcb-balk); outline-offset: 3px; }
.kx-chatbot .kx-chatbot__ico { display: block; grid-area: 1 / 1; transition: opacity .18s ease, transform .2s var(--kxcb-ease); }
.kx-chatbot .kx-chatbot__ico--dicht { opacity: 0; transform: rotate(-90deg) scale(.6); }
.kx-chatbot.is-open .kx-chatbot__ico--open { opacity: 0; transform: rotate(90deg) scale(.6); }
.kx-chatbot.is-open .kx-chatbot__ico--dicht { opacity: 1; transform: none; }

/* Venster */
.kx-chatbot .kx-chatbot__venster {
	display: flex; flex-direction: column; overflow: hidden; background: var(--kxcb-vlak);
	border-radius: 18px; border: 1px solid var(--kxcb-rand); text-align: left;
}
.kx-chatbot--popup .kx-chatbot__venster {
	position: fixed; right: 20px; bottom: calc(var(--kxcb-pos-d, 30px) + 58px + 14px);
	width: 384px; height: min(620px, calc(100vh - var(--kxcb-pos-d, 30px) - 58px - 40px));
	box-shadow: var(--kxcb-schaduw);
	opacity: 0; transform: translateY(12px) scale(.98); transform-origin: bottom right;
	transition: opacity .2s ease, transform .24s var(--kxcb-ease);
}
.kx-chatbot--popup .kx-chatbot__venster.is-zichtbaar { opacity: 1; transform: none; }
.kx-chatbot--ingebed { width: 100%; max-width: 720px; height: min(600px, 80vh); margin: 1.5em 0; }
.kx-chatbot--ingebed .kx-chatbot__venster { height: 100%; box-shadow: 0 8px 30px -12px rgba(17, 24, 39, .18); }

/* Kop */
.kx-chatbot .kx-chatbot__kop {
	display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; flex: none;
	background: var(--kxcb-balk); color: var(--kxcb-balk-tekst);
}
.kx-chatbot .kx-chatbot__avatar {
	display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
	background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.kx-chatbot .kx-chatbot__titels { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.kx-chatbot .kx-chatbot__titel {
	margin: 0; padding: 0; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.25; color: inherit; letter-spacing: -.005em;
	text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kx-chatbot .kx-chatbot__ai { font-size: 12.5px; line-height: 1.3; opacity: .82; display: inline-flex; align-items: center; gap: 6px; }
.kx-chatbot .kx-chatbot__ai::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.kx-chatbot .kx-chatbot__sluit {
	display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; color: inherit; opacity: .85;
	transition: background-color .15s ease, opacity .15s ease;
}
.kx-chatbot .kx-chatbot__sluit:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
.kx-chatbot .kx-chatbot__sluit:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }

/* Berichten */
.kx-chatbot .kx-chatbot__berichten {
	flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px;
	background: #fafbfc; scroll-behavior: smooth;
}
.kx-chatbot .kx-chatbot__berichten:focus-visible { outline: 2px solid var(--kxcb-balk); outline-offset: -2px; }
.kx-chatbot .kx-chatbot__rij { display: flex; }
.kx-chatbot .kx-chatbot__rij--mens { justify-content: flex-end; }
.kx-chatbot .kx-chatbot__bericht {
	max-width: 86%; padding: 10px 14px; border-radius: 16px; overflow-wrap: anywhere; word-break: normal;
	animation: kx-chatbot-in .22s var(--kxcb-ease) both;
}
.kx-chatbot .kx-chatbot__bericht--bot { background: var(--kxcb-bot); color: var(--kxcb-bot-tekst); border-bottom-left-radius: 6px; }
.kx-chatbot .kx-chatbot__bericht--mens { background: var(--kxcb-mens); color: var(--kxcb-mens-tekst); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.kx-chatbot .kx-chatbot__tekst > :first-child { margin-top: 0; }
.kx-chatbot .kx-chatbot__tekst > :last-child { margin-bottom: 0; }
.kx-chatbot .kx-chatbot__tekst p, .kx-chatbot .kx-chatbot__tekst ul, .kx-chatbot .kx-chatbot__tekst ol {
	margin: 0 0 .6em; padding: 0; font: inherit; color: inherit; line-height: 1.5;
}
.kx-chatbot .kx-chatbot__tekst ul, .kx-chatbot .kx-chatbot__tekst ol { padding-left: 1.25em; }
.kx-chatbot .kx-chatbot__tekst ul { list-style: disc; }
.kx-chatbot .kx-chatbot__tekst ol { list-style: decimal; }
.kx-chatbot .kx-chatbot__tekst li { margin: 0 0 .2em; padding: 0; }
.kx-chatbot .kx-chatbot__tekst strong { font-weight: 650; }
.kx-chatbot .kx-chatbot__link { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; font-weight: 500; }
.kx-chatbot .kx-chatbot__link:hover { text-decoration-thickness: 2px; }
.kx-chatbot .kx-chatbot__link:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; border-radius: 2px; }

.kx-chatbot .kx-chatbot__bronnen { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(17, 24, 39, .1); font-size: 13px; }
.kx-chatbot .kx-chatbot__bronnen-kop { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.kx-chatbot .kx-chatbot__bronnen ul { list-style: none; margin: 0; padding: 0; }
.kx-chatbot .kx-chatbot__bronnen li { margin: 2px 0; padding: 0 0 0 14px; position: relative; }
.kx-chatbot .kx-chatbot__bronnen li.is-link::before { content: "↗"; position: absolute; left: 0; opacity: .6; font-size: 11px; top: 1px; }
.kx-chatbot .kx-chatbot__afgeschermd { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(17, 24, 39, .1); font-size: 13px; opacity: .8; }
.kx-chatbot .kx-chatbot__afgeschermd p { margin: 2px 0; }

/* Typindicator */
.kx-chatbot .kx-chatbot__typ { display: inline-flex; gap: 4px; padding: 6px 0; align-items: center; }
.kx-chatbot .kx-chatbot__typ i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: kx-chatbot-typ 1.2s infinite ease-in-out; }
.kx-chatbot .kx-chatbot__typ i:nth-child(3) { animation-delay: .15s; }
.kx-chatbot .kx-chatbot__typ i:nth-child(4) { animation-delay: .3s; }

/* Fout */
.kx-chatbot .kx-chatbot__fout {
	max-width: 86%; padding: 10px 14px; border-radius: 14px; background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; font-size: 14px;
}
.kx-chatbot .kx-chatbot__fout p { margin: 0; font: inherit; color: inherit; }
.kx-chatbot .kx-chatbot__opnieuw {
	margin-top: 8px; padding: 7px 12px; border-radius: 999px; background: #ffffff; border: 1px solid #fca5a5; color: #7f1d1d;
	font-size: 13.5px; font-weight: 600;
}
.kx-chatbot .kx-chatbot__opnieuw:hover { background: #fff5f5; }
.kx-chatbot .kx-chatbot__opnieuw:focus-visible { outline: 2px solid #b91c1c; outline-offset: 2px; }

/* Invoer */
.kx-chatbot .kx-chatbot__voet { flex: none; padding: 10px 12px 10px; background: var(--kxcb-vlak); border-top: 1px solid var(--kxcb-rand); }
.kx-chatbot .kx-chatbot__vorm {
	display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 6px 6px 6px 14px;
	border: 1px solid rgba(17, 24, 39, .16); border-radius: 22px; background: #ffffff; transition: border-color .15s ease, box-shadow .15s ease;
}
.kx-chatbot .kx-chatbot__vorm:focus-within { border-color: var(--kxcb-balk); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kxcb-balk) 14%, transparent); }
.kx-chatbot .kx-chatbot__invoer {
	flex: 1; min-width: 0; margin: 0; padding: 7px 0; border: 0; outline: 0; background: transparent; box-shadow: none; resize: none;
	font: inherit; font-size: 15px; line-height: 1.45; color: #111827; max-height: 132px; height: auto; min-height: 0; border-radius: 0;
}
/* De focusring staat op de vorm (:focus-within hierboven). Een sitebrede regel zoals :focus-visible:not([tabindex="-1"]) (V4-rebuilds)
   is even sterk als .kx-chatbot .kx-chatbot__invoer en tekende een tweede ring in het veld: hier sterker uitzetten. */
.kx-chatbot .kx-chatbot__invoer:focus, .kx-chatbot .kx-chatbot__invoer:focus-visible { outline: 0; outline-offset: 0; box-shadow: none; }
.kx-chatbot .kx-chatbot__invoer::placeholder { color: #8b929c; opacity: 1; }
.kx-chatbot .kx-chatbot__invoer:disabled { background: transparent; cursor: not-allowed; }
.kx-chatbot .kx-chatbot__stuur {
	display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
	background: var(--kxcb-balk); color: var(--kxcb-balk-tekst); transition: opacity .15s ease, transform .15s ease;
}
.kx-chatbot .kx-chatbot__stuur:hover { transform: scale(1.05); }
.kx-chatbot .kx-chatbot__stuur:disabled { opacity: .45; cursor: default; transform: none; }
.kx-chatbot .kx-chatbot__stuur:focus-visible { outline: 2px solid var(--kxcb-balk); outline-offset: 2px; }
.kx-chatbot .kx-chatbot__melding { margin: 7px 4px 0; padding: 0; font-size: 11.5px; line-height: 1.35; color: var(--kxcb-zacht); text-align: center; }

.kx-chatbot .kx-chatbot__sr {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@keyframes kx-chatbot-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes kx-chatbot-typ { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: .8; transform: translateY(-3px); } }

/* Gsm: het venster als vel over het hele scherm, knop weg zolang het open is. */
@media (max-width: 600px) {
	.kx-chatbot--popup { right: 15px; bottom: calc(var(--kxcb-pos-m, 15px) + env(safe-area-inset-bottom, 0px)); }
	.kx-chatbot--popup.is-open .kx-chatbot__knop { visibility: hidden; }
	.kx-chatbot--popup .kx-chatbot__venster {
		position: fixed; inset: 0; right: 0; bottom: 0; width: 100%; height: 100vh; height: 100dvh; border-radius: 0; border: 0;
		transform: translateY(24px); transform-origin: bottom center;
	}
	.kx-chatbot .kx-chatbot__kop { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
	.kx-chatbot--popup .kx-chatbot__voet { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
	/* 16px: geen automatische zoom van iOS bij focus. */
	.kx-chatbot .kx-chatbot__invoer { font-size: 16px; }
	.kx-chatbot--ingebed { height: min(560px, 85vh); }
	.kx-chatbot .kx-chatbot__bericht, .kx-chatbot .kx-chatbot__fout { max-width: 90%; }
	html.kx-chatbot-open, html.kx-chatbot-open body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	.kx-chatbot *, .kx-chatbot *::before, .kx-chatbot *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
	.kx-chatbot--popup .kx-chatbot__venster { transform: none; }
	.kx-chatbot .kx-chatbot__typ i { opacity: .55; }
}

/* § 18: knoppen in het venster, melding meelezen, knop in de inhoud ([kx_chatbot_knop], klasse kx-chatbot-inhoudknop: kx-chatbot-open is de toestandsklasse op <html>). */
.kx-chatbot .kx-chatbot__knoppen { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; padding: 0 2px; }
/* Kleur van de titelbalk, niet die van de eigen berichten: die is vaak wit of heel licht (MxChat-standaard) en dan stond de knop wit op wit. */
.kx-chatbot .kx-chatbot__snelknop {
	appearance: none; margin: 0; padding: 9px 16px; min-height: 40px; border-radius: 999px; cursor: pointer;
	font: inherit; font-size: 15px; font-weight: 500; line-height: 1.3; text-align: left; background: #ffffff; color: var(--kxcb-balk);
	border: 1.5px solid color-mix(in srgb, var(--kxcb-balk) 40%, #ffffff); transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.kx-chatbot .kx-chatbot__snelknop:hover { background: var(--kxcb-balk); color: var(--kxcb-balk-tekst); border-color: var(--kxcb-balk); }
.kx-chatbot .kx-chatbot__snelknop:active { transform: scale(.97); }
.kx-chatbot .kx-chatbot__snelknop:focus-visible { outline: 2px solid var(--kxcb-balk); outline-offset: 2px; }
.kx-chatbot .kx-chatbot__meelezen { margin: 3px 4px 0; padding: 0; font-size: 11.5px; line-height: 1.35; color: var(--kxcb-zacht); text-align: center; font-weight: 600; }
.kx-chatbot--zonder-knop .kx-chatbot__knop { display: none; }
.kx-chatbot-inhoudknop {
	appearance: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 999px; cursor: pointer;
	font: inherit; font-weight: 600; background: var(--kxcb-balk, #1f2937); color: var(--kxcb-balk-tekst, #ffffff);
}
.kx-chatbot-inhoudknop:focus-visible { outline: 2px solid var(--kxcb-balk, #1f2937); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .kx-chatbot .kx-chatbot__snelknop { transition: none; } }
