:root {
	--wpaibot-primary: #1d4ed8;
	--wpaibot-bg: #ffffff;
	--wpaibot-text: #111827;
	--wpaibot-muted: #6b7280;
	--wpaibot-border: #e5e7eb;
	--wpaibot-page: #f4f6fb;
}

html.wpaibot-page-open,
body.wpaibot-page-open {
	overflow: hidden;
}

.wpaibot-root {
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	color: var(--wpaibot-text);
	z-index: 99999;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.wpaibot-launcher {
	position: fixed !important;
	bottom: 20px !important;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 0;
	background: var(--wpaibot-primary);
	color: #fff;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 28px rgba(29, 78, 216, 0.38);
	z-index: 2147483646 !important;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.wpaibot-launcher:hover,
.wpaibot-launcher:focus {
	transform: scale(1.06);
	box-shadow: 0 14px 32px rgba(29, 78, 216, 0.45);
	outline: none;
}

.wpaibot-launcher svg {
	display: block;
}

.wpaibot-launcher img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.wpaibot-root.wpaibot-bottom-right .wpaibot-launcher {
	right: 20px;
}

.wpaibot-root.wpaibot-bottom-left .wpaibot-launcher {
	left: 20px;
}

.wpaibot-root.wpaibot-float {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 2147483645 !important;
}

.wpaibot-root.wpaibot-float .wpaibot-launcher {
	pointer-events: auto;
}

.wpaibot-root.wpaibot-float .wpaibot-panel {
	position: fixed;
	bottom: 92px;
	width: min(400px, calc(100vw - 24px));
	height: min(640px, calc(100vh - 120px));
	max-width: none;
	margin: 0;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 20px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
	z-index: 2147483646;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.wpaibot-root.wpaibot-float.wpaibot-bottom-right .wpaibot-panel {
	right: 20px;
	transform-origin: bottom right;
}

.wpaibot-root.wpaibot-float.wpaibot-bottom-left .wpaibot-panel {
	left: 20px;
	transform-origin: bottom left;
}

.wpaibot-root.wpaibot-float.wpaibot-open .wpaibot-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.wpaibot-root.wpaibot-open .wpaibot-launcher {
	display: none;
}

.wpaibot-panel {
	display: flex;
	flex-direction: column;
	background: var(--wpaibot-page);
	overflow: hidden;
	min-height: 0;
}

.wpaibot-in-content {
	margin: 2.5rem 0 1.5rem;
}

.wpaibot-embed .wpaibot-panel,
.wpaibot-embed-root .wpaibot-panel {
	width: 100%;
	min-height: min(72vh, 720px);
	height: auto;
	margin: 0;
	border: 1px solid var(--wpaibot-border);
	border-radius: 16px;
}

.wpaibot-embed .wpaibot-page,
.wpaibot-embed-root .wpaibot-page {
	max-height: min(62vh, 620px);
}

.wpaibot-header {
	background: var(--wpaibot-primary);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	flex-shrink: 0;
}

.wpaibot-header-copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.wpaibot-header-copy strong {
	font-size: 15px;
	font-weight: 650;
}

.wpaibot-header-sub {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.82);
	font-weight: 400;
}

.wpaibot-header-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.wpaibot-header button {
	background: transparent;
	border: 0;
	color: inherit;
	cursor: pointer;
	line-height: 1;
	padding: 6px 8px;
	border-radius: 8px;
}

.wpaibot-header button:hover,
.wpaibot-header button:focus {
	background: rgba(255, 255, 255, 0.14);
	outline: none;
}

.wpaibot-home {
	font-size: 13px;
	font-weight: 600;
}

.wpaibot-close {
	font-size: 22px;
	padding: 0 6px;
}

.wpaibot-page {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px 20px;
	min-height: 0;
}

.wpaibot-hero {
	padding: 8px 4px 4px;
}

.wpaibot-hero-title {
	margin: 0 0 8px;
	font-size: 1.45rem;
	line-height: 1.2;
	letter-spacing: -0.03em;
	font-weight: 700;
}

.wpaibot-hero-welcome {
	margin: 0;
	font-size: 0.98rem;
	color: #374151;
}

.wpaibot-thread {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wpaibot-row {
	display: flex;
	max-width: 100%;
}

.wpaibot-row-user {
	justify-content: flex-end;
}

.wpaibot-row-bot {
	justify-content: flex-start;
}

.wpaibot-bubble {
	max-width: 92%;
	padding: 10px 12px;
	border-radius: 16px;
	word-wrap: break-word;
}

.wpaibot-bubble-user {
	background: var(--wpaibot-primary);
	color: #fff;
	border-bottom-right-radius: 6px;
	font-size: 0.95rem;
}

.wpaibot-bubble-bot {
	background: #fff;
	color: var(--wpaibot-text);
	border: 1px solid var(--wpaibot-border);
	border-bottom-left-radius: 6px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.wpaibot-article {
	font-size: 0.95rem;
	line-height: 1.55;
	color: inherit;
}

.wpaibot-article a {
	color: var(--wpaibot-primary);
}

.wpaibot-article code {
	font-size: 0.92em;
	background: #eef2ff;
	padding: 0.1em 0.35em;
	border-radius: 4px;
}

.wpaibot-typing {
	color: var(--wpaibot-muted);
	font-style: italic;
	margin: 0;
}

.wpaibot-composer {
	padding: 10px 12px 12px;
	border-top: 1px solid var(--wpaibot-border);
	background: var(--wpaibot-bg);
	flex-shrink: 0;
}

.wpaibot-composer-inner {
	display: flex;
	gap: 8px;
	width: 100%;
}

.wpaibot-composer textarea {
	flex: 1;
	resize: none;
	min-height: 44px;
	max-height: 120px;
	border: 1px solid var(--wpaibot-border);
	border-radius: 12px;
	padding: 10px 12px;
	font: inherit;
	background: #fff;
}

.wpaibot-composer textarea:focus {
	outline: 2px solid color-mix(in srgb, var(--wpaibot-primary) 35%, transparent);
	border-color: var(--wpaibot-primary);
}

.wpaibot-composer button {
	border: 0;
	border-radius: 12px;
	background: var(--wpaibot-primary);
	color: #fff;
	font: inherit;
	font-weight: 650;
	padding: 0 14px;
	cursor: pointer;
}

.wpaibot-composer button:disabled {
	opacity: 0.6;
	cursor: wait;
}

.wpaibot-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
	margin: 10px 0 2px;
}

.wpaibot-card {
	background: #fff;
	border: 1px solid var(--wpaibot-border);
	border-radius: 12px;
	padding: 10px;
	display: flex;
	gap: 10px;
	text-decoration: none;
	color: inherit;
}

.wpaibot-card-meta {
	flex: 1;
	min-width: 0;
}

.wpaibot-card-price {
	color: var(--wpaibot-muted);
	margin: 4px 0;
	font-size: 0.9rem;
}

.wpaibot-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.wpaibot-card-actions a,
.wpaibot-card-actions button {
	display: inline-block;
	padding: 6px 10px;
	border: 1px solid var(--wpaibot-border);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	font-size: 13px;
}

.wpaibot-card-actions button.wpaibot-quick {
	background: var(--wpaibot-primary);
	border-color: var(--wpaibot-primary);
	color: #fff;
}

.wpaibot-card img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}

.wpaibot-card strong {
	display: block;
}

.wpaibot-card-staff {
	color: var(--wpaibot-muted);
	font-size: 0.8rem;
	margin: 2px 0 0;
}

.wpaibot-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 10px 0 2px;
}

.wpaibot-stat {
	background: #f8fafc;
	border: 1px solid var(--wpaibot-border);
	border-radius: 12px;
	padding: 10px 12px;
}

.wpaibot-stat-value {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.2;
}

.wpaibot-stat-label {
	color: var(--wpaibot-muted);
	font-size: 0.75rem;
	margin-top: 4px;
}

.wpaibot-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 2px;
}

.wpaibot-actions a,
.wpaibot-quick {
	display: inline-block;
	padding: 8px 12px;
	border: 1px solid var(--wpaibot-border);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	font-size: 13px;
}

.wpaibot-starters {
	margin: 18px 0 0;
}

.wpaibot-starters-hint {
	font-size: 12px;
	color: var(--wpaibot-muted);
	margin: 0 0 10px;
	font-weight: 600;
}

.wpaibot-starter-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
}

.wpaibot-starter {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	text-align: left;
	padding: 12px 14px;
	border: 1px solid var(--wpaibot-border);
	border-radius: 12px;
	background: #fff;
	color: var(--wpaibot-text);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.wpaibot-starter:hover,
.wpaibot-starter:focus {
	border-color: var(--wpaibot-primary);
	color: var(--wpaibot-primary);
	outline: none;
}

.wpaibot-citations {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--wpaibot-border);
	font-size: 12px;
	color: var(--wpaibot-muted);
}

.wpaibot-citation-list {
	margin: 6px 0 0;
	padding-left: 18px;
}

.wpaibot-citation-list a {
	color: var(--wpaibot-primary);
}

.wpaibot-root.wpaibot-admin {
	z-index: 100100;
}

.wpaibot-root.wpaibot-admin .wpaibot-launcher {
	z-index: 100100;
}

.wpaibot-root.wpaibot-admin .wpaibot-panel {
	z-index: 100101;
}

.wpaibot-audience-badge {
	display: inline-block;
	margin-top: 4px;
	padding: 1px 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	width: fit-content;
}

.wpaibot-hidden {
	display: none !important;
}

@media (max-width: 640px) {
	.wpaibot-root.wpaibot-float .wpaibot-panel {
		inset: 0;
		bottom: 0;
		right: 0;
		left: 0;
		width: 100%;
		height: 100%;
		max-width: none;
		border-radius: 0;
		border: 0;
		transform: none;
	}

	.wpaibot-page {
		padding: 14px 12px 20px;
	}

	.wpaibot-composer {
		padding-bottom: max(12px, env(safe-area-inset-bottom));
	}
}
