.wpstore-ai-chat-root {
	position: fixed;
	bottom: var(--wpstore-ai-launcher-offset-bottom, 22px);
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--wpstore-ai-panel-bg: #ffffff;
	--wpstore-ai-soft-bg: #f8fafc;
	--wpstore-ai-border: rgba(15, 23, 42, 0.08);
	--wpstore-ai-muted: #64748b;
}

.wpstore-ai-chat-bottom-right {
	right: var(--wpstore-ai-launcher-offset-side, 22px);
}

.wpstore-ai-chat-bottom-left {
	left: var(--wpstore-ai-launcher-offset-side, 22px);
}

.wpstore-ai-chat-launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	box-shadow: 0 12px 34px rgba(15, 23, 42, .22);
	cursor: pointer;
	font-weight: 700;
	font-size: 15px;
	background: var(--wpstore-ai-launcher-bg, var(--wpstore-ai-primary-color, #111827));
	color: var(--wpstore-ai-launcher-color, #fff);
	box-sizing: border-box;
	transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.wpstore-ai-chat-launcher:not(.wpstore-ai-chat-launcher-image-mode)::after {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: inherit;
	box-shadow: 0 0 0 0 var(--wpstore-ai-launcher-pulse-color, #22c55e);
	pointer-events: none;
	animation: wpstore-ai-default-launcher-pulse 2.8s ease-out infinite;
}

@keyframes wpstore-ai-default-launcher-pulse {
	0% { box-shadow: 0 0 0 0 var(--wpstore-ai-launcher-pulse-color, #22c55e); }
	70% { box-shadow: 0 0 0 12px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

.wpstore-ai-chat-launcher:hover,
.wpstore-ai-chat-launcher:focus {
	background: var(--wpstore-ai-launcher-hover, var(--wpstore-ai-launcher-bg, #111827));
	transform: translateY(-1px);
	outline: none;
}

.wpstore-ai-chat-launcher-icon {
	font-size: 20px;
	line-height: 1;
}

.wpstore-ai-chat-launcher-image-mode {
	position: relative;
	width: var(--wpstore-ai-launcher-image-width, 96px);
	height: var(--wpstore-ai-launcher-image-height, auto);
	min-height: 0;
	background: transparent !important;
	box-shadow: none;
	padding: 0;
	border-radius: var(--wpstore-ai-launcher-radius, 999px);
	overflow: visible;
}

.wpstore-ai-chat-launcher-image-mode:hover,
.wpstore-ai-chat-launcher-image-mode:focus {
	background: transparent !important;
}

.wpstore-ai-chat-launcher-image-wrap {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	overflow: hidden;
	filter: drop-shadow(0 12px 26px rgba(15, 23, 42, .22));
}

.wpstore-ai-chat-launcher-image-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: 0;
}

.wpstore-ai-chat-launcher-image-mode.is-animated .wpstore-ai-chat-launcher-image-wrap {
	animation: wpstore-ai-custom-launcher-pulse 2.4s ease-in-out infinite;
	box-shadow: 0 0 0 0 var(--wpstore-ai-launcher-pulse-color, #22c55e);
}

@keyframes wpstore-ai-custom-launcher-pulse {
	0%, 100% { transform: translateY(0) scale(1); }
	50% { transform: translateY(-2px) scale(1.035); }
}

.wpstore-ai-chat-unread {
	min-width: 20px;
	height: 20px;
	padding: 0 4px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 12px;
	line-height: 20px;
	text-align: center;
}

.wpstore-ai-chat-launcher-image-mode .wpstore-ai-chat-unread {
	position: absolute;
	top: -7px;
	right: -7px;
	box-shadow: 0 4px 12px rgba(239, 68, 68, .35);
}

.wpstore-ai-screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.wpstore-ai-chat-panel {
	width: min(390px, calc(100vw - 32px));
	height: min(620px, calc(100vh - 48px));
	background: var(--wpstore-ai-panel-bg, #fff);
	border-radius: 22px;
	box-shadow: 0 22px 70px rgba(15, 23, 42, 0.28);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--wpstore-ai-border, rgba(15, 23, 42, 0.08));
	animation: wpstore-ai-panel-in .18s ease-out;
}

.wpstore-ai-chat-panel[hidden] {
	display: none;
}

@keyframes wpstore-ai-panel-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.wpstore-ai-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 18px;
	background: linear-gradient(135deg, var(--wpstore-ai-primary-color, #111827), var(--wpstore-ai-accent-color, #2563eb));
	color: #fff;
}

.wpstore-ai-chat-header-identity {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.wpstore-ai-chat-avatar {
	width: 42px;
	height: 42px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .18);
	border: 1px solid rgba(255, 255, 255, .28);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 900;
	font-size: 13px;
	line-height: 1;
	text-transform: uppercase;
	flex: 0 0 auto;
}

.wpstore-ai-chat-header-text {
	min-width: 0;
}

.wpstore-ai-chat-title {
	font-weight: 800;
	font-size: 15px;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wpstore-ai-chat-status {
	margin-top: 3px;
	font-size: 12px;
	line-height: 1.2;
	opacity: .88;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wpstore-ai-chat-close {
	width: 34px;
	height: 34px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 999px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color .16s ease, transform .16s ease;
	flex: 0 0 auto;
}

.wpstore-ai-chat-close:hover,
.wpstore-ai-chat-close:focus {
	background: rgba(255, 255, 255, .22);
	transform: rotate(4deg);
	outline: none;
}

.wpstore-ai-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background:
		radial-gradient(circle at 20% 0, rgba(37, 99, 235, .07), transparent 32%),
		linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.wpstore-ai-chat-intro {
	margin-bottom: 12px;
}

.wpstore-ai-chat-message {
	display: flex;
	margin-bottom: 12px;
}

.wpstore-ai-chat-message-visitor {
	justify-content: flex-end;
}

.wpstore-ai-chat-bubble {
	max-width: 84%;
	padding: 11px 13px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.48;
	word-break: break-word;
}

.wpstore-ai-chat-message-assistant .wpstore-ai-chat-bubble {
	background: #fff;
	color: #111827;
	border: 1px solid rgba(226, 232, 240, .95);
	border-bottom-left-radius: 5px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.wpstore-ai-chat-message-visitor .wpstore-ai-chat-bubble {
	background: linear-gradient(135deg, var(--wpstore-ai-primary-color, #111827), var(--wpstore-ai-accent-color, #2563eb));
	color: #fff;
	border-bottom-right-radius: 5px;
	box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

.wpstore-ai-chat-bubble a {
	color: inherit;
	text-decoration: underline;
}

.wpstore-ai-chat-bubble small {
	display: inline-block;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(148, 163, 184, .25);
	color: var(--wpstore-ai-muted, #64748b);
	font-size: 11px;
	line-height: 1.35;
}

.wpstore-ai-chat-message-meta {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(148, 163, 184, .25);
	color: var(--wpstore-ai-muted, #64748b);
	font-size: 11px;
	line-height: 1.35;
}

.wpstore-ai-chat-quick-questions {
	margin: 4px 0 12px;
}

.wpstore-ai-chat-quick-label {
	margin: 0 0 7px;
	color: #475569;
	font-size: 12px;
	font-weight: 800;
}

.wpstore-ai-chat-quick-list {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.wpstore-ai-chat-quick-chip {
	border: 1px solid #dbeafe;
	border-radius: 999px;
	background: rgba(255, 255, 255, .9);
	color: var(--wpstore-ai-primary-color, #111827);
	cursor: pointer;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	padding: 7px 10px;
	box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
	transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.wpstore-ai-chat-quick-chip:hover,
.wpstore-ai-chat-quick-chip:focus {
	border-color: var(--wpstore-ai-accent-color, #2563eb);
	box-shadow: 0 8px 22px rgba(37, 99, 235, .12);
	transform: translateY(-1px);
	outline: none;
}

.wpstore-ai-chat-privacy {
	margin: 4px 0 12px;
	padding: 9px 10px;
	border-radius: 14px;
	background: rgba(238, 242, 255, .96);
	color: #374151;
	font-size: 12px;
	line-height: 1.45;
	border: 1px solid #dbeafe;
}

.wpstore-ai-chat-privacy a {
	color: var(--wpstore-ai-primary-color, #111827);
	font-weight: 800;
	text-decoration: underline;
}

.wpstore-ai-chat-form {
	padding: 12px;
	background: #fff;
	border-top: 1px solid #e5e7eb;
}

.wpstore-ai-chat-email {
	width: 100%;
	margin-bottom: 8px;
	border: 1px solid #d1d5db;
	border-radius: 12px;
	padding: 10px 12px;
	font-size: 14px;
	box-sizing: border-box;
}

.wpstore-ai-chat-input-row {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.wpstore-ai-chat-input {
	flex: 1;
	resize: none;
	min-height: 44px;
	max-height: 118px;
	border: 1px solid #d1d5db;
	border-radius: 14px;
	padding: 11px 12px;
	font-size: 14px;
	line-height: 1.35;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}

.wpstore-ai-chat-input:focus,
.wpstore-ai-chat-email:focus {
	border-color: var(--wpstore-ai-accent-color, #2563eb);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
	outline: none;
}

.wpstore-ai-chat-send {
	border: 0;
	border-radius: 14px;
	min-height: 44px;
	padding: 11px 14px;
	background: linear-gradient(135deg, var(--wpstore-ai-primary-color, #111827), var(--wpstore-ai-accent-color, #2563eb));
	color: #fff;
	font-weight: 800;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
	transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.wpstore-ai-chat-send:hover,
.wpstore-ai-chat-send:focus {
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(37, 99, 235, .22);
	outline: none;
}

.wpstore-ai-chat-send-icon {
	font-size: 13px;
	line-height: 1;
}

.wpstore-ai-chat-send:disabled,
.wpstore-ai-chat-input:disabled,
.wpstore-ai-chat-email:disabled {
	opacity: 0.65;
	cursor: wait;
}

.wpstore-ai-chat-typing .wpstore-ai-chat-bubble {
	min-width: 54px;
}

.wpstore-ai-chat-typing-dots {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.wpstore-ai-chat-typing-dots span {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--wpstore-ai-accent-color, #2563eb);
	opacity: .35;
	animation: wpstore-ai-typing-dot 1.2s ease-in-out infinite;
}

.wpstore-ai-chat-typing-dots span:nth-child(2) {
	animation-delay: .15s;
}

.wpstore-ai-chat-typing-dots span:nth-child(3) {
	animation-delay: .3s;
}

@keyframes wpstore-ai-typing-dot {
	0%, 80%, 100% {
		transform: translateY(0);
		opacity: .35;
	}
	40% {
		transform: translateY(-3px);
		opacity: 1;
	}
}

@media (max-width: 480px) {
	.wpstore-ai-chat-root {
		bottom: max(14px, var(--wpstore-ai-launcher-offset-bottom, 14px));
	}

	.wpstore-ai-chat-bottom-right {
		right: max(14px, var(--wpstore-ai-launcher-offset-side, 14px));
	}

	.wpstore-ai-chat-bottom-left {
		left: max(14px, var(--wpstore-ai-launcher-offset-side, 14px));
	}

	.wpstore-ai-chat-launcher {
		font-size: 13px;
		padding: 0 16px;
	}

	.wpstore-ai-chat-launcher-image-mode {
		width: var(--wpstore-ai-launcher-mobile-width, 72px);
		height: var(--wpstore-ai-launcher-mobile-height, auto);
		padding: 0;
	}

	.wpstore-ai-chat-panel {
		width: calc(100vw - 24px);
		height: min(620px, calc(100vh - 28px));
		border-radius: 20px;
	}

	.wpstore-ai-chat-header {
		padding: 14px 15px;
	}

	.wpstore-ai-chat-avatar {
		width: 38px;
		height: 38px;
		border-radius: 13px;
	}

	.wpstore-ai-chat-messages {
		padding: 14px;
	}

	.wpstore-ai-chat-bubble {
		max-width: 88%;
		font-size: 13px;
	}

	.wpstore-ai-chat-send-text {
		display: none;
	}

	.wpstore-ai-chat-send {
		width: 46px;
		justify-content: center;
		padding-left: 0;
		padding-right: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpstore-ai-chat-launcher::after,
	.wpstore-ai-chat-launcher-image-mode.is-animated .wpstore-ai-chat-launcher-image-wrap,
	.wpstore-ai-chat-typing-dots span,
	.wpstore-ai-chat-panel {
		animation: none !important;
	}
}


.wpstore-ai-chat-feedback {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid rgba(148, 163, 184, .22);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.wpstore-ai-chat-feedback-label {
	flex-basis: 100%;
	font-size: 11px;
	font-weight: 700;
	color: var(--wpstore-ai-muted, #64748b);
}

.wpstore-ai-chat-feedback-button {
	border: 1px solid rgba(148, 163, 184, .35);
	border-radius: 999px;
	background: #fff;
	color: #334155;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.2;
	padding: 5px 8px;
	cursor: pointer;
}

.wpstore-ai-chat-feedback-button:hover,
.wpstore-ai-chat-feedback-button:focus {
	border-color: var(--wpstore-ai-accent-color, #2563eb);
	outline: none;
}

.wpstore-ai-chat-feedback-button:disabled {
	cursor: default;
	opacity: .75;
}

.wpstore-ai-chat-feedback-selected {
	border-color: var(--wpstore-ai-accent-color, #2563eb);
	background: rgba(37, 99, 235, .08);
}
