/* Lexana - the AI assistant of every website (@lexana.latte, lexana.js) */

.lexana {
	--lx-navy: #112b5d;
	--lx-blue: #18448c;
	--lx-green: #18ae41;
	--lx-ink: #1d2433;
	--lx-muted: #6b7486;
	--lx-line: #e3e8f0;
	--lx-surface: #f4f6fa;
	--lx-shadow: 0 12px 40px rgba(17, 43, 93, 0.22), 0 2px 8px rgba(17, 43, 93, 0.12);
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 1000000000;
	font-size: 15px;
	line-height: 1.45;
	color: var(--lx-ink);
}

.lexana [hidden] {
	display: none !important;
}

.lexana button {
	touch-action: manipulation;
	font: inherit;
}

/* the avatar in the corner */

.lexana-launcher {
	position: relative;
	display: block;
	width: 80px;
	height: 80px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #fff;
	box-shadow: var(--lx-shadow);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lexana-launcher img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.lexana-launcher:hover,
.lexana-launcher:focus-visible {
	transform: scale(1.06);
	box-shadow: 0 16px 44px rgba(17, 43, 93, 0.3), 0 0 0 4px rgba(24, 68, 140, 0.18);
	outline: none;
}

.lexana-status {
	position: absolute;
	right: 3px;
	bottom: 3px;
	width: 15px;
	height: 15px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--lx-green);
}

.lexana.is-open .lexana-launcher {
	display: none;
}

/* the greeting bubble next to the head */

.lexana-teaser {
	position: absolute;
	right: 12px;
	bottom: 94px;
	width: max-content;
	max-width: 260px;
	animation: lexana-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.lexana-teaser-body {
	display: block;
	width: 100%;
	padding: 12px 16px 13px;
	border: 0;
	border-radius: 18px 18px 4px 18px;
	background: #fff;
	box-shadow: var(--lx-shadow);
	text-align: left;
	cursor: pointer;
}

.lexana-teaser-body::after {
	content: "";
	position: absolute;
	right: 18px;
	bottom: -7px;
	width: 14px;
	height: 14px;
	background: #fff;
	transform: rotate(45deg);
	border-radius: 0 0 3px 0;
}

.lexana-teaser-label {
	display: block;
	margin-bottom: 2px;
	padding-right: 18px;
	font-size: 12px;
	font-weight: 600;
	color: var(--lx-blue);
}

.lexana-teaser-text {
	display: block;
	color: var(--lx-ink);
}

.lexana-teaser-close {
	position: absolute;
	top: -12px;
	right: -12px;
	z-index: 1;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.lexana-teaser-close i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(17, 43, 93, 0.25);
	color: var(--lx-muted);
	font-size: 18px;
}

.lexana-teaser-close:hover i {
	color: var(--lx-ink);
}

/* the chat window */

.lexana-window {
	display: flex;
	flex-direction: column;
	width: 380px;
	height: min(620px, calc(100vh - 48px));
	height: min(620px, calc(100dvh - 48px));
	overflow: hidden;
	border-radius: 20px;
	background: #fff;
	box-shadow: var(--lx-shadow);
	animation: lexana-pop 0.25s ease-out both;
	transform-origin: bottom right;
}

.lexana-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 10px 14px 16px;
	background: linear-gradient(135deg, var(--lx-navy) 0%, var(--lx-blue) 100%);
	color: #fff;
}

.lexana-avatar {
	position: relative;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
}

.lexana-avatar img {
	width: 44px;
	height: 44px;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	object-fit: cover;
}

.lexana-avatar .lexana-status {
	right: -1px;
	bottom: -1px;
	width: 12px;
	height: 12px;
	border-color: var(--lx-blue);
}

.lexana-identity {
	flex: 1 1 auto;
	min-width: 0;
}

.lexana-name {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
}

.lexana-role {
	display: block;
	overflow: hidden;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.78);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.lexana-icon-btn {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	transition: background 0.15s;
}

.lexana-icon-btn:hover,
.lexana-icon-btn:focus-visible {
	background: rgba(255, 255, 255, 0.16);
	outline: none;
}

/* messages */

.lexana-messages {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 14px 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--lx-surface);
}

.lexana-msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 88%;
	animation: lexana-in 0.25s ease-out both;
}

.lexana-msg-avatar {
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.lexana-bubble {
	min-width: 0;
	padding: 10px 14px;
	border-radius: 18px 18px 18px 4px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(17, 43, 93, 0.08);
	border: 1px solid var(--lx-line);
	overflow-wrap: anywhere;
	text-align: start;
}

.lexana-bubble p {
	margin: 0 0 6px;
}

.lexana-bubble p:last-child {
	margin-bottom: 0;
}

.lexana-bubble a {
	color: var(--lx-blue);
	font-weight: 600;
	text-decoration: underline;
}

.lexana-msg-me {
	align-self: flex-end;
}

.lexana-msg-me .lexana-bubble {
	border: 0;
	border-radius: 18px 18px 4px 18px;
	background: var(--lx-blue);
	color: #fff;
	white-space: pre-wrap;
}

.lexana-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-left: 36px;
}

.lexana-chip {
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid rgba(24, 68, 140, 0.35);
	border-radius: 18px;
	background: #fff;
	color: var(--lx-blue);
	font-size: 14px;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.lexana-chip:hover,
.lexana-chip:focus-visible {
	background: var(--lx-blue);
	color: #fff;
	outline: none;
}

.lexana-typing .lexana-bubble {
	display: flex;
	gap: 4px;
	padding: 14px 16px;
}

.lexana-typing .lexana-bubble span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa5b8;
	animation: lexana-dot 1.2s infinite ease-in-out;
}

.lexana-typing .lexana-bubble span:nth-child(2) {
	animation-delay: 0.15s;
}

.lexana-typing .lexana-bubble span:nth-child(3) {
	animation-delay: 0.3s;
}

/* the form */

.lexana-form {
	padding: 10px 12px 8px;
	border-top: 1px solid var(--lx-line);
	background: #fff;
}

.lexana-notice {
	margin-bottom: 8px;
	padding: 8px 12px;
	border-radius: 10px;
	background: #fdecec;
	color: #a12a2a;
	font-size: 13px;
}

.lexana-input {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 6px 6px 6px 14px;
	border: 1px solid var(--lx-line);
	border-radius: 22px;
	background: var(--lx-surface);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.lexana-input:focus-within {
	border-color: rgba(24, 68, 140, 0.5);
	box-shadow: 0 0 0 3px rgba(24, 68, 140, 0.12);
	background: #fff;
}

.lexana-input textarea {
	flex: 1 1 auto;
	min-width: 0;
	max-height: 120px;
	padding: 7px 0;
	border: 0;
	outline: none;
	background: transparent;
	color: var(--lx-ink);
	font: inherit;
	line-height: 1.4;
	resize: none;
}

.lexana-send {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--lx-blue);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
}

.lexana-send:hover,
.lexana-send:focus-visible {
	background: var(--lx-navy);
	outline: none;
}

.lexana-form.is-busy .lexana-send {
	opacity: 0.5;
	cursor: default;
}

.lexana-disclaimer {
	margin: 6px 4px 0;
	font-size: 11.5px;
	line-height: 1.35;
	color: var(--lx-muted);
	text-align: center;
}

.grecaptcha-badge {
	visibility: hidden;
}

@keyframes lexana-pop {
	from { opacity: 0; transform: translateY(10px) scale(0.96); }
	to { opacity: 1; transform: none; }
}

@keyframes lexana-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

@keyframes lexana-dot {
	0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
	.lexana *,
	.lexana *::before,
	.lexana *::after {
		animation: none !important;
		transition: none !important;
	}
}

/* phones - a smaller avatar, the chat over the whole screen */

@media (max-width: 575.98px) {
	.lexana {
		right: 16px;
		bottom: 16px;
	}

	.lexana-launcher {
		width: 68px;
		height: 68px;
	}

	.lexana-teaser {
		bottom: 82px;
		right: 4px;
		max-width: calc(100vw - 40px);
	}

	.lexana.is-open {
		inset: 0;
	}

	.lexana-window {
		width: 100%;
		height: 100%;
		border-radius: 0;
	}

	.lexana-header {
		padding-top: max(14px, env(safe-area-inset-top));
	}

	.lexana-form {
		padding-bottom: max(8px, env(safe-area-inset-bottom));
	}

	/* 16px and more - iOS zooms into a smaller input */
	.lexana-input textarea {
		font-size: 16px;
	}
}

@media print {
	.lexana {
		display: none !important;
	}
}
