/* Climb Kili AI Assistant — widget styles. Scoped under .cka-root. */
.cka-root {
	--cka-accent: #1f6f4a;
	--cka-bg: #ffffff;
	--cka-ink: #1d2320;
	--cka-muted: #5f6b66;
	--cka-line: #e3e8e5;
	--cka-soft: #f3f6f4;
	position: fixed;
	bottom: 20px;
	z-index: 999990;
	font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--cka-ink);
}
.cka-root *, .cka-root *::before, .cka-root *::after { box-sizing: border-box; }
.cka-pos-right { right: 20px; }
.cka-pos-left { left: 20px; }

.cka-launcher {
	display: flex; align-items: center; gap: 8px;
	margin-left: auto;
	border: 0; border-radius: 999px;
	padding: 12px 18px 12px 14px;
	background: var(--cka-accent); color: #fff;
	font: inherit; font-weight: 600; cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	transition: transform .15s ease;
}
.cka-pos-left .cka-launcher { margin-left: 0; }
.cka-launcher:hover { transform: translateY(-2px); }
.cka-launcher:focus-visible, .cka-root button:focus-visible, .cka-root a:focus-visible, .cka-input:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--cka-accent) 45%, transparent); outline-offset: 2px;
}
.cka-open .cka-launcher-label { display: none; }

.cka-panel {
	display: flex; flex-direction: column;
	width: 380px; height: min(620px, calc(100vh - 110px));
	margin-bottom: 12px;
	background: var(--cka-bg);
	border: 1px solid var(--cka-line); border-radius: 16px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
	overflow: hidden;
}
.cka-panel[hidden] { display: none; }

.cka-header {
	display: flex; align-items: center; gap: 4px;
	padding: 12px 10px 12px 16px;
	background: var(--cka-accent); color: #fff;
}
.cka-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cka-title strong { font-size: 16px; }
.cka-sub { font-size: 12px; opacity: .85; }
.cka-icon-btn {
	width: 34px; height: 34px; border: 0; border-radius: 8px;
	background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.cka-icon-btn:hover { background: rgba(255, 255, 255, .15); }

.cka-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cka-soft); }
.cka-msg { display: flex; flex-direction: column; max-width: 88%; }
.cka-user { align-self: flex-end; align-items: flex-end; }
.cka-assistant { align-self: flex-start; }
.cka-bubble { padding: 10px 13px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.cka-user .cka-bubble { background: var(--cka-accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.cka-assistant .cka-bubble { background: #fff; border: 1px solid var(--cka-line); border-bottom-left-radius: 4px; }
.cka-bubble p { margin: 0; }
.cka-bubble p + p { margin-top: 6px; }
.cka-bubble ul { margin: 6px 0; padding-left: 20px; }
.cka-bubble li { margin: 2px 0; }
.cka-bubble a { color: var(--cka-accent); text-decoration: underline; }
.cka-gap { height: 6px; }

.cka-cta {
	margin-top: 8px; display: inline-block;
	padding: 10px 14px; border-radius: 10px;
	background: var(--cka-accent); color: #fff !important; text-decoration: none !important; font-weight: 600;
}

.cka-typing .cka-bubble { display: flex; gap: 4px; padding: 14px; }
.cka-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--cka-muted); animation: cka-bounce 1.2s infinite ease-in-out; }
.cka-typing span:nth-child(2) { animation-delay: .15s; }
.cka-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cka-bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.cka-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; background: var(--cka-soft); }
.cka-chips:not(:empty) { padding-bottom: 10px; }
.cka-chip {
	border: 1px solid var(--cka-accent); border-radius: 999px;
	background: #fff; color: var(--cka-accent);
	padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer;
}
.cka-chip:hover { background: var(--cka-accent); color: #fff; }

.cka-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--cka-line); background: #fff; }
.cka-input {
	flex: 1; resize: none; min-height: 40px; max-height: 120px;
	padding: 9px 12px; border: 1px solid var(--cka-line); border-radius: 10px;
	font: inherit; color: var(--cka-ink); background: #fff;
}
.cka-send {
	border: 0; border-radius: 10px; padding: 0 16px;
	background: var(--cka-accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.cka-send:disabled { opacity: .5; cursor: default; }

.cka-human { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 14px 10px; font-size: 12.5px; color: var(--cka-muted); background: #fff; }
.cka-human-link { color: var(--cka-accent) !important; font-weight: 600; text-decoration: none !important; }

@media (max-width: 480px) {
	.cka-root { bottom: 12px; }
	.cka-pos-right { right: 12px; }
	.cka-pos-left { left: 12px; }
	.cka-open { inset: 0; }
	.cka-open .cka-panel { position: fixed; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 0; border: 0; }
	.cka-open .cka-launcher { display: none; }
	.cka-launcher-label { display: none; }
	.cka-launcher { padding: 14px; }
	.cka-input { font-size: 16px; } /* Prevents iOS zoom. */
}
@media (prefers-reduced-motion: reduce) {
	.cka-typing span { animation: none; }
	.cka-launcher { transition: none; }
}
