.kl-chat-open, .kl-chat-panel {
	--klc-bg: #fff;
	--klc-text: #333;
	--klc-muted: #5F6873;
	--klc-line: #E4E7EC;
	--klc-bot: #F1F4F9;
	--klc-brand: #0B379B;
	--klc-link: #0B379B;
	font-family: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[data-theme="dark"] .kl-chat-open, html[data-theme="dark"] .kl-chat-panel {
	--klc-bg: #151D30;
	--klc-text: #E4E8F1;
	--klc-muted: #AEB6C6;
	--klc-line: #2A3550;
	--klc-bot: #1F2A44;
	--klc-link: #9DB8FF;
}
.kl-chat-open {
	position: fixed !important;
	right: 20px;
	bottom: 20px;
	z-index: 9000;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--klc-brand) !important;
	color: #fff !important;
	box-shadow: 0 6px 20px rgba(11, 55, 155, .35) !important;
	cursor: pointer;
}
.kl-chat-open[hidden] { display: none !important; }
.kl-chat-open:focus-visible, .kl-chat-panel button:focus-visible, .kl-chat-panel a:focus-visible { outline: 2px solid #FF6666; outline-offset: 2px; }
.kl-chat-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9001;
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 40px);
	height: 540px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	overflow: hidden;
	border: 1px solid var(--klc-line);
	border-radius: 14px;
	background: var(--klc-bg);
	color: var(--klc-text);
	box-shadow: 0 12px 36px rgba(0, 0, 0, .28);
	font-size: 15px;
	line-height: 1.45;
}
.kl-chat-panel[hidden] { display: none; }
.kl-chat-panel *, .kl-chat-panel *::before { box-sizing: border-box; }
.kl-chat-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 10px 8px 10px 16px; background: var(--klc-brand); color: #fff; }
.kl-chat-head strong { color: #fff; font-weight: 600; }
.kl-chat-close { width: 36px; height: 36px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: none !important; box-shadow: none !important; color: #fff !important; font-size: 24px; line-height: 1; cursor: pointer; }
.kl-chat-log { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; min-height: 0; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.kl-chat-msg { max-width: 86%; padding: 8px 12px; border-radius: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.kl-chat-assistant { align-self: flex-start; background: var(--klc-bot); color: var(--klc-text); }
.kl-chat-user { align-self: flex-end; background: var(--klc-brand); color: #fff; }
.kl-chat-msg a { color: var(--klc-link); text-decoration: underline; }
.kl-chat-wait { color: var(--klc-muted); font-style: italic; }
.kl-chat-notice { flex: 0 0 auto; margin: 0; padding: 6px 14px; color: var(--klc-muted); font-size: 11.5px; line-height: 1.35; }
.kl-chat-notice[hidden] { display: none; }
.kl-chat-notice a { color: var(--klc-link); }
.kl-chat-form { position: relative; display: flex; flex: 0 0 auto; gap: 8px; margin: 0; padding: 8px 12px; border-top: 1px solid var(--klc-line); }
.kl-chat-form[hidden], .kl-chat-contact[hidden] { display: none; }
.kl-chat-panel textarea, .kl-chat-panel input:not(.kl-chat-trap) {
	display: block;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid var(--klc-line) !important;
	border-radius: 8px;
	background: var(--klc-bg) !important;
	color: var(--klc-text) !important;
	font: inherit;
	font-size: 16px; /* Stops phones zooming in when the box is tapped. */
	resize: none;
}
.kl-chat-trap { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }
.kl-chat-send { flex: 0 0 auto; padding: 8px 14px !important; border: 0 !important; border-radius: 8px !important; background: var(--klc-brand) !important; color: #fff !important; font: inherit; font-weight: 600; cursor: pointer; }
.kl-chat-send:disabled { opacity: .6; cursor: default; }
.kl-chat-person { flex: 0 0 auto; align-self: center; margin: 0 0 6px; padding: 4px 8px !important; border: 0 !important; background: none !important; box-shadow: none !important; color: var(--klc-link) !important; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.kl-chat-person[hidden] { display: none; }
.kl-chat-contact { display: flex; flex: 0 0 auto; flex-direction: column; gap: 8px; margin: 0; padding: 10px 14px; border-top: 1px solid var(--klc-line); }
.kl-chat-contact p { margin: 0; font-size: 14px; }
.kl-chat-contact label { display: block; color: var(--klc-text); font-size: 13px; }
.kl-chat-contact .kl-chat-person { margin-bottom: 0; }
@media (max-width: 480px) {
	.kl-chat-open { right: 16px; bottom: 16px; }
	.kl-chat-panel { top: 0; right: 0; bottom: 0; left: 0; width: 100%; max-width: none; height: auto; max-height: none; border: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: no-preference) {
	.kl-chat-open { transition: transform .15s ease; }
	.kl-chat-open:hover { transform: scale(1.05); }
}
