.khl-ai-chatbot {
	--khl-ai-accent: #0091a8;
	position: fixed;
	bottom: 16px;
	z-index: 999999;
	font-family: inherit;
}

.khl-ai-chatbot.bottom-left { left: 16px; }
.khl-ai-chatbot.bottom-right { right: 16px; }

.khl-ai-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--khl-ai-accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 10px 14px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.15);
	cursor: pointer;
	font-weight: 700;
	position: relative;
	overflow: hidden;
}


/* Two simple robot icons (pure CSS) */
.khl-ai-toggle::before,
.khl-ai-toggle::after {
	content: "";
	width: 14px;
	height: 14px;
	border-radius: 4px;
	background: rgba(255,255,255,0.95);
	box-shadow:
		inset 0 0 0 2px rgba(0,0,0,0.08),
		inset -3px 0 0 rgba(0,0,0,0.06);
	display: inline-block;
	flex: 0 0 auto;
	position: relative;
}

/* eyes */
.khl-ai-toggle::before {
	margin-right: 6px;
	background-image: radial-gradient(circle at 5px 6px, #111 2px, transparent 3px), radial-gradient(circle at 10px 6px, #111 2px, transparent 3px);
}
.khl-ai-toggle::after {
	margin-left: 6px;
	background-image: radial-gradient(circle at 5px 6px, #111 2px, transparent 3px), radial-gradient(circle at 10px 6px, #111 2px, transparent 3px);
}

.khl-ai-toggle-label {
	white-space: nowrap;
}

.khl-ai-panel {
	position: absolute;
	bottom: 60px;
	width: 340px;
	max-width: calc(100vw - 32px);
	/* Flex layout so footer/input is never clipped */
	display: flex;
	flex-direction: column;
	height: 500px;
	max-height: calc(100vh - 110px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0,0,0,0.18);
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.08);
}

.khl-ai-chatbot.bottom-right .khl-ai-panel {
	right: 0;
}

.khl-ai-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 12px;
	background: linear-gradient(0deg, rgba(255,255,255,0.0), rgba(255,255,255,0.0)), var(--khl-ai-accent);
	color: #fff;
}

.khl-ai-title {
	font-weight: 800;
	font-size: 14px;
}

.khl-ai-close {
	border: none;
	background: rgba(255,255,255,0.2);
	color: #fff;
	border-radius: 8px;
	padding: 6px 10px;
	cursor: pointer;
}

.khl-ai-body {
	padding: 12px;
	flex: 1 1 auto;
	min-height: 0; /* important so overflow works in flex children */
	overflow: auto;
	background: #f7f7f7;
}

.khl-ai-footer {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	padding: 10px;
	background: #fff;
	border-top: 1px solid rgba(0,0,0,0.08);
	flex: 0 0 auto;
}

.khl-ai-input {
	width: 100%;
	resize: none;
	border-radius: 10px;
	border: 1px solid rgba(0,0,0,0.15);
	padding: 10px;
	font-size: 14px;
}

.khl-ai-send {
	background: var(--khl-ai-accent);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 0 14px;
	font-weight: 800;
	cursor: pointer;
}

.khl-ai-msg { margin: 0 0 10px 0; }

.khl-ai-msg.user { display: flex; justify-content: flex-end; }
.khl-ai-msg.bot { display: flex; justify-content: flex-start; }

.khl-ai-bubble {
	max-width: 85%;
	white-space: pre-wrap;
	word-break: break-word;
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.35;
}

.khl-ai-msg.user .khl-ai-bubble {
	background: var(--khl-ai-accent);
	color: #fff;
	border-top-right-radius: 6px;
}

.khl-ai-msg.bot .khl-ai-bubble {
	background: #fff;
	color: #222;
	border: 1px solid rgba(0,0,0,0.08);
	border-top-left-radius: 6px;
}

.khl-ai-sources {
	font-size: 12px;
	margin-top: 6px;
	color: rgba(0,0,0,0.6);
}

.khl-ai-sources a {
	color: rgba(0,0,0,0.65);
	text-decoration: underline;
}

@media (max-width: 480px) {
	.khl-ai-panel { width: 92vw; height: 70vh; }
}
