.ai-chat-pluginwp-chat,
.ai-chat-pluginwp-chat * {
	box-sizing: border-box;
}

.ai-chat-pluginwp-chat {
	--ai-chat-pluginwp-surface: #ffffff;
	--ai-chat-pluginwp-muted: #64748b;
	--ai-chat-pluginwp-border: rgba(100, 116, 139, 0.18);
	--ai-chat-pluginwp-soft-shadow: 0 24px 80px rgba(15, 23, 42, 0.16);
	display: flex;
	flex-direction: column;
	max-width: 100%;
	min-height: 360px;
	overflow: hidden;
	border: 1px solid var(--ai-chat-pluginwp-border);
	border-radius: 24px;
	background: var(--ai-chat-pluginwp-chat-bg, #ffffff);
	color: var(--ai-chat-pluginwp-text, #0f172a);
	box-shadow: var(--ai-chat-pluginwp-soft-shadow);
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ai-chat-pluginwp-chat--inline {
	margin: 18px 0;
}

.ai-chat-pluginwp-chat--floating {
	margin: 0;
	width: 420px !important;
	height: min(680px, calc(100vh - 120px)) !important;
	border-radius: 24px;
	box-shadow: var(--ai-chat-pluginwp-soft-shadow);
}

.ai-chat-pluginwp-chat__header {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 96px;
	padding: 20px 22px;
	overflow: hidden;
	background:
		radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.22), transparent 26%),
		linear-gradient(135deg, var(--ai-chat-pluginwp-header-bg, #111827) 0%, var(--ai-chat-pluginwp-primary, #4f46e5) 58%, #7c3aed 100%);
	color: #ffffff;
}

.ai-chat-pluginwp-chat__header::after {
	position: absolute;
	inset: auto -24px -46px auto;
	width: 190px;
	height: 120px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.09);
	content: "";
	pointer-events: none;
	transform: rotate(-12deg);
}

.ai-chat-pluginwp-chat__identity {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.ai-chat-pluginwp-chat__avatar {
	position: relative;
	display: grid;
	flex: 0 0 54px;
	width: 54px;
	height: 54px;
	overflow: visible;
	place-items: center;
	border: 3px solid rgba(255, 255, 255, 0.88);
	border-radius: 50%;
	background: radial-gradient(circle at 32% 22%, #ffffff, #eef6ff 58%, #dbeafe);
	color: var(--ai-chat-pluginwp-primary, #4f46e5);
	box-shadow: 0 12px 30px rgba(37, 99, 235, 0.2), 0 0 0 6px rgba(255, 255, 255, 0.12);
}

.ai-chat-pluginwp-chat__avatar::after {
	position: absolute;
	right: -1px;
	bottom: 2px;
	width: 14px;
	height: 14px;
	border: 3px solid #ffffff;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
	content: "";
}

.ai-chat-pluginwp-chat__avatar img,
.ai-chat-pluginwp-chat__avatar svg {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: contain;
}

.ai-chat-pluginwp-chat__avatar-icon {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
}

.ai-chat-pluginwp-chat__title {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.ai-chat-pluginwp-chat__title strong {
	display: block;
	overflow: hidden;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.2;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-chat-pluginwp-chat__title span {
	display: flex;
	align-items: center;
	gap: 6px;
	overflow: hidden;
	color: rgba(255, 255, 255, 0.88);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-chat-pluginwp-chat__status-line i {
	display: block;
	width: 10px;
	height: 10px;
	border: 2px solid rgba(255, 255, 255, 0.7);
	border-radius: 50%;
	background: #22c55e;
}

.ai-chat-pluginwp-chat__tools {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

.ai-chat-pluginwp-chat__tool {
	display: grid;
	width: 40px;
	height: 40px;
	padding: 0;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #ffffff;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.ai-chat-pluginwp-chat__tool svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.ai-chat-pluginwp-chat__tool:hover {
	background: rgba(255, 255, 255, 0.22);
	transform: translateY(-1px);
}

.ai-chat-pluginwp-chat__tool:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.34);
	outline: none;
}

.ai-chat-pluginwp-chat__messages {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 16px;
	min-height: 0;
	padding: 20px 18px 16px;
	overflow-y: auto;
	background:
		linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(255, 255, 255, 0.96) 32%),
		var(--ai-chat-pluginwp-surface);
	scroll-behavior: smooth;
}

.ai-chat-pluginwp-message {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	max-width: 85%;
	animation: aiChatPluginWPFadeUp 220ms ease both;
}

.ai-chat-pluginwp-message--user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.ai-chat-pluginwp-message--assistant {
	align-self: flex-start;
}

.ai-chat-pluginwp-message__avatar {
	display: grid;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	overflow: visible;
	place-items: center;
	border: 1px solid rgba(191, 219, 254, 0.9);
	border-radius: 50%;
	background: radial-gradient(circle at 32% 22%, #ffffff, #eef6ff 62%, #dbeafe);
	color: var(--ai-chat-pluginwp-primary, #4f46e5);
	box-shadow: 0 8px 22px rgba(37, 99, 235, 0.13);
	font-size: 11px;
	font-weight: 700;
}

.ai-chat-pluginwp-message--user .ai-chat-pluginwp-message__avatar {
	display: none;
}

.ai-chat-pluginwp-message__avatar img,
.ai-chat-pluginwp-message__avatar svg {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: contain;
}

.ai-chat-pluginwp-message__avatar-icon {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
}

.ai-chat-pluginwp-message__bubble {
	max-width: 100%;
	padding: 13px 15px;
	border: 1px solid rgba(226, 232, 240, 0.8);
	border-radius: 18px 18px 18px 6px;
	background: var(--ai-chat-pluginwp-ai-bubble, #f8fafc);
	color: var(--ai-chat-pluginwp-text, #0f172a);
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
	font-size: 14.5px;
	line-height: 1.58;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.ai-chat-pluginwp-message__bubble p {
	margin: 0 0 8px;
}

.ai-chat-pluginwp-message__bubble p:last-child,
.ai-chat-pluginwp-message__bubble ul:last-child {
	margin-bottom: 0;
}

.ai-chat-pluginwp-message__bubble ul {
	margin: 0 0 8px;
	padding-left: 20px;
}

.ai-chat-pluginwp-message__bubble li {
	margin: 0 0 4px;
}

.ai-chat-pluginwp-message__bubble a {
	color: var(--ai-chat-pluginwp-primary, #4f46e5);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.ai-chat-pluginwp-message--user .ai-chat-pluginwp-message__bubble {
	border-color: transparent;
	border-radius: 18px 18px 6px 18px;
	background: linear-gradient(135deg, var(--ai-chat-pluginwp-user-bubble, #4f46e5), #4338ca);
	color: #ffffff;
	box-shadow: 0 10px 30px rgba(79, 70, 229, 0.22);
}

.ai-chat-pluginwp-message.is-typing .ai-chat-pluginwp-message__bubble {
	color: rgba(15, 23, 42, 0.62);
	font-style: italic;
}

.ai-chat-pluginwp-typing-dots {
	display: inline-flex;
	gap: 3px;
	margin-left: 6px;
	vertical-align: middle;
}

.ai-chat-pluginwp-typing-dots i {
	display: block;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	animation: aiChatPluginWPTyping 1s infinite ease-in-out;
}

.ai-chat-pluginwp-typing-dots i:nth-child(2) {
	animation-delay: 120ms;
}

.ai-chat-pluginwp-typing-dots i:nth-child(3) {
	animation-delay: 240ms;
}

.ai-chat-pluginwp-message.is-error .ai-chat-pluginwp-message__bubble {
	border-color: rgba(248, 113, 113, 0.24);
	background: #fef2f2;
	color: #991b1b;
}

.ai-chat-pluginwp-chat__suggestions {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
	padding: 0 18px 14px;
	overflow-x: auto;
	background: #ffffff;
}

.ai-chat-pluginwp-chat__suggestion {
	flex: 0 0 auto;
	max-width: 180px;
	min-height: 38px;
	padding: 7px 14px;
	border: 1px solid rgba(79, 70, 229, 0.2);
	border-radius: 999px;
	background: #ffffff;
	color: var(--ai-chat-pluginwp-primary, #4f46e5);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 650;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
	white-space: nowrap;
}

.ai-chat-pluginwp-chat__suggestion:nth-child(n+4) {
	display: none;
}

.ai-chat-pluginwp-chat__suggestion:hover {
	border-color: rgba(79, 70, 229, 0.38);
	background: rgba(79, 70, 229, 0.06);
	transform: translateY(-1px);
}

.ai-chat-pluginwp-chat__suggestion:focus-visible {
	border-color: var(--ai-chat-pluginwp-primary, #4f46e5);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
	outline: none;
}

.ai-chat-pluginwp-chat__status {
	min-height: 18px;
	padding: 0 20px;
	background: #ffffff;
	color: var(--ai-chat-pluginwp-muted);
	font-size: 12px;
	line-height: 18px;
}

.ai-chat-pluginwp-chat__form {
	position: sticky;
	bottom: 0;
	z-index: 1;
	flex: 0 0 auto;
	padding: 12px 18px 16px;
	border-top: 1px solid rgba(226, 232, 240, 0.8);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(14px);
}

.ai-chat-pluginwp-chat__composer {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	min-height: 52px;
	padding: 6px 6px 6px 16px;
	border: 1px solid rgba(148, 163, 184, 0.34);
	border-radius: 18px;
	background: #ffffff;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
	transition: border-color 180ms ease, box-shadow 180ms ease;
}

.ai-chat-pluginwp-chat__composer:focus-within {
	border-color: rgba(79, 70, 229, 0.48);
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), 0 12px 34px rgba(15, 23, 42, 0.08);
}

.ai-chat-pluginwp-chat__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	max-height: 112px;
	min-height: 38px;
	padding: 9px 0;
	resize: none;
	border: 0;
	background: transparent;
	color: var(--ai-chat-pluginwp-text, #0f172a);
	font: inherit;
	font-size: 14.5px;
	line-height: 1.45;
	outline: none;
}

.ai-chat-pluginwp-chat__input::placeholder {
	color: #94a3b8;
}

.ai-chat-pluginwp-chat__send {
	display: grid;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--ai-chat-pluginwp-primary, #4f46e5), #4338ca);
	color: #ffffff;
	cursor: pointer;
	font: inherit;
	box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
	transition: opacity 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.ai-chat-pluginwp-chat__send svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
	transform: translateX(1px);
}

.ai-chat-pluginwp-chat__send:hover {
	box-shadow: 0 13px 28px rgba(79, 70, 229, 0.34);
	transform: translateY(-1px);
}

.ai-chat-pluginwp-chat__send:focus-visible {
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 10px 24px rgba(79, 70, 229, 0.28);
	outline: none;
}

.ai-chat-pluginwp-chat__send:disabled {
	cursor: wait;
	opacity: 0.62;
	transform: none;
}

.ai-chat-pluginwp-floating,
.ai-chat-pluginwp-floating * {
	box-sizing: border-box;
}

.ai-chat-pluginwp-floating {
	position: fixed;
	right: var(--ai-chat-pluginwp-floating-side, 24px);
	bottom: var(--ai-chat-pluginwp-floating-bottom, 24px);
	z-index: 99999;
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ai-chat-pluginwp-floating--left {
	right: auto;
	left: var(--ai-chat-pluginwp-floating-side, 24px);
}

.ai-chat-pluginwp-floating__button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	width: 68px;
	height: 68px;
	padding: 0;
	overflow: visible;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--ai-chat-pluginwp-primary, #4f46e5), #7c3aed);
	color: #ffffff;
	cursor: pointer;
	box-shadow: 0 18px 42px rgba(79, 70, 229, 0.32);
	font: inherit;
	text-align: left;
	transition: box-shadow 220ms ease, gap 220ms ease, padding 220ms ease, transform 180ms ease, width 220ms ease;
}

.ai-chat-pluginwp-floating__button:hover {
	width: 188px;
	gap: 10px;
	justify-content: flex-start;
	padding: 0 22px 0 12px;
	box-shadow: 0 22px 50px rgba(79, 70, 229, 0.38);
	transform: translateY(-1px);
}

.ai-chat-pluginwp-floating__button:focus-visible {
	box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 18px 42px rgba(79, 70, 229, 0.32);
	outline: none;
}

.ai-chat-pluginwp-floating__mark {
	position: relative;
	display: grid;
	flex: 0 0 54px;
	width: 54px;
	height: 54px;
	place-items: center;
	overflow: visible;
	border: 2px solid rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	background: radial-gradient(circle at 32% 22%, #ffffff, #eef6ff 58%, #dbeafe);
	color: #ffffff;
	box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.ai-chat-pluginwp-floating__mark img,
.ai-chat-pluginwp-floating__mark svg {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: contain;
}

.ai-chat-pluginwp-floating__badge {
	position: absolute;
	right: 7px;
	bottom: 7px;
	width: 14px;
	height: 14px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 5px 14px rgba(34, 197, 94, 0.35);
}

.ai-chat-pluginwp-floating__copy {
	display: block;
	width: 0;
	overflow: hidden;
	opacity: 0;
	transition: opacity 180ms ease 70ms, width 220ms ease;
	white-space: nowrap;
}

.ai-chat-pluginwp-floating__button:hover .ai-chat-pluginwp-floating__copy {
	width: 92px;
	opacity: 1;
}

.ai-chat-pluginwp-floating__copy strong {
	display: block;
	font-size: 15px;
	font-weight: 750;
	line-height: 1.2;
}

.ai-chat-pluginwp-floating__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 16px);
	opacity: 0;
	pointer-events: none;
	transform: translateY(16px) scale(0.96);
	transform-origin: right bottom;
	transition: opacity 220ms ease, transform 220ms ease;
}

.ai-chat-pluginwp-floating__panel[hidden] {
	display: none;
}

.ai-chat-pluginwp-floating--left .ai-chat-pluginwp-floating__panel {
	right: auto;
	left: 0;
	transform-origin: left bottom;
}

.ai-chat-pluginwp-floating.is-open .ai-chat-pluginwp-floating__panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

@keyframes aiChatPluginWPTyping {
	0%,
	80%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

@keyframes aiChatPluginWPFadeUp {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 640px) {
	.ai-chat-pluginwp-chat {
		width: 100% !important;
		min-height: 360px;
		border-radius: 22px;
	}

	.ai-chat-pluginwp-chat--floating {
		height: calc(var(--ai-chat-pluginwp-viewport-height, 100dvh) - 24px) !important;
		max-height: calc(var(--ai-chat-pluginwp-viewport-height, 100dvh) - 24px);
		border-radius: 22px;
	}

	.ai-chat-pluginwp-chat__header {
		min-height: 86px;
		padding: 16px;
	}

	.ai-chat-pluginwp-chat__avatar {
		flex-basis: 48px;
		width: 48px;
		height: 48px;
	}

	.ai-chat-pluginwp-chat__title strong {
		font-size: 17px;
	}

	.ai-chat-pluginwp-chat__tool {
		width: 38px;
		height: 38px;
	}

	.ai-chat-pluginwp-chat__messages {
		padding: 18px 14px 14px;
	}

	.ai-chat-pluginwp-message {
		max-width: 88%;
	}

	.ai-chat-pluginwp-message__bubble {
		font-size: 14px;
	}

	.ai-chat-pluginwp-chat__suggestions {
		padding-right: 14px;
		padding-left: 14px;
	}

	.ai-chat-pluginwp-chat__form {
		padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.ai-chat-pluginwp-chat__composer {
		border-radius: 17px;
	}

	.ai-chat-pluginwp-floating {
		right: 12px;
		left: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.ai-chat-pluginwp-floating--hide-mobile {
		display: none;
	}

	.ai-chat-pluginwp-floating__button {
		width: 64px;
		height: 64px;
		margin-left: auto;
	}

	.ai-chat-pluginwp-floating__button:hover {
		width: 64px;
		gap: 0;
		justify-content: center;
		padding: 0;
	}

	.ai-chat-pluginwp-floating__button:hover .ai-chat-pluginwp-floating__copy,
	.ai-chat-pluginwp-floating__copy {
		width: 0;
		opacity: 0;
	}

	.ai-chat-pluginwp-floating.is-open .ai-chat-pluginwp-floating__button {
		display: none;
	}

	.ai-chat-pluginwp-floating__panel,
	.ai-chat-pluginwp-floating--left .ai-chat-pluginwp-floating__panel {
		position: fixed;
		top: calc(12px + env(safe-area-inset-top, 0px));
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		left: 12px;
		width: auto;
		max-height: calc(var(--ai-chat-pluginwp-viewport-height, 100dvh) - 24px);
		transform-origin: center bottom;
	}
}

@media (min-width: 641px) {
	.ai-chat-pluginwp-floating--hide-desktop {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ai-chat-pluginwp-chat *,
	.ai-chat-pluginwp-floating * {
		animation-duration: 1ms !important;
		transition-duration: 1ms !important;
	}
}
