/* AI Knowledge Chat — widget styles */

.aikc-widget,
.aikc-bubble,
.aikc-panel {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}
.aikc-widget *,
.aikc-bubble *,
.aikc-panel * {
	box-sizing: border-box;
}

/* ---------- Shared chat window ---------- */
.aikc-widget {
	max-width: 480px;
	width: 100%;
	border: 1px solid #e2e2e2;
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.aikc-header {
	background: #f7f7f8;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #ececec;
}
.aikc-header-left { display: flex; align-items: center; gap: 10px; }
.aikc-dot { width: 9px; height: 9px; border-radius: 50%; background: #1da25d; flex-shrink: 0; }
.aikc-title { font-size: 14px; font-weight: 600; margin: 0; color: #1a1a1a; }
.aikc-subtitle { font-size: 12px; margin: 0; color: #777; }

.aikc-lang-toggle { display: flex; gap: 4px; }
.aikc-lang-btn {
	font-size: 12px;
	padding: 3px 10px;
	border-radius: 6px;
	border: 1px solid #ddd;
	background: transparent;
	cursor: pointer;
	color: #666;
}
.aikc-lang-btn.active {
	background: var(--aikc-brand, #0c447c);
	color: #fff;
	border-color: transparent;
}

.aikc-messages {
	height: 340px;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.aikc-msg { display: flex; flex-direction: column; max-width: 88%; }
.aikc-msg.user { align-self: flex-end; align-items: flex-end; }
.aikc-msg.bot { align-self: flex-start; align-items: flex-start; }

.aikc-bubble-text {
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}
.aikc-msg.user .aikc-bubble-text {
	background: var(--aikc-brand, #0c447c);
	color: #fff;
	border-radius: 14px 14px 4px 14px;
}
.aikc-msg.bot .aikc-bubble-text {
	background: #f1f1f2;
	color: #1a1a1a;
	border-radius: 4px 14px 14px 14px;
}
.aikc-msg.error .aikc-bubble-text {
	background: #fdecec;
	color: #8a2222;
}

.aikc-sources {
	margin-top: 5px;
	font-size: 11px;
	color: #888;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
}
.aikc-source-chip {
	border: 1px solid #e3e3e3;
	border-radius: 20px;
	padding: 2px 9px;
	font-size: 11px;
	color: #666;
	text-decoration: none;
	background: #fff;
}
.aikc-source-chip:hover { background: #f7f7f8; }

.aikc-typing { display: flex; align-items: center; gap: 4px; padding: 10px 13px; background: #f1f1f2; border-radius: 4px 14px 14px 14px; }
.aikc-typing span { width: 6px; height: 6px; border-radius: 50%; background: #999; animation: aikc-bounce 1s infinite; }
.aikc-typing span:nth-child(2) { animation-delay: 0.15s; }
.aikc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aikc-bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }

.aikc-suggestions {
	padding: 0 14px 10px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.aikc-sug-btn {
	font-size: 12px;
	padding: 5px 11px;
	border-radius: 20px;
	border: 1px solid #ddd;
	background: transparent;
	cursor: pointer;
	color: #555;
	white-space: nowrap;
}
.aikc-sug-btn:hover { background: #f7f7f8; }

.aikc-footer {
	border-top: 1px solid #ececec;
	padding: 10px 12px;
	display: flex;
	gap: 8px;
	align-items: flex-end;
}
.aikc-input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	max-height: 100px;
	min-height: 38px;
	line-height: 1.4;
}
.aikc-input:focus { outline: none; border-color: var(--aikc-brand, #0c447c); }
.aikc-send {
	padding: 9px 12px;
	border-radius: 10px;
	background: var(--aikc-brand, #0c447c);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.aikc-send:hover { opacity: 0.9; }
.aikc-send:disabled { opacity: 0.5; cursor: default; }

/* ---------- Floating bubble + panel ---------- */
#aikc-floating-root {
	position: fixed;
	bottom: 0;
	right: 0;
	z-index: 99999;
}

.aikc-bubble {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--aikc-brand, #0c447c);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0,0,0,0.18);
	border: none;
	z-index: 99999;
}
.aikc-bubble svg { width: 26px; height: 26px; }

.aikc-panel {
	position: fixed;
	bottom: 90px;
	right: 20px;
	width: 360px;
	max-width: calc(100vw - 24px);
	z-index: 99999;
	display: none;
}
.aikc-panel.open { display: block; }
.aikc-panel .aikc-widget { width: 100%; }
.aikc-panel .aikc-messages { height: 380px; }

@media (max-width: 480px) {
	.aikc-panel {
		right: 12px;
		left: 12px;
		width: auto;
		bottom: 84px;
	}
}
