.funky-ai-widget {
	--funky-ai-accent: #23c495;
	--funky-ai-panel: #111;
	--funky-ai-border: rgba(255, 255, 255, 0.1);
	--funky-ai-text: #f4f4f5;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.funky-ai-launcher {
	display: grid;
	width: 70px;
	height: 70px;
	padding: 0;
	overflow: hidden;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--funky-ai-accent);
	color: #06130f;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
	cursor: pointer;
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.funky-ai-launcher:hover {
	transform: scale(1.06);
	box-shadow: 0 12px 34px rgba(35, 196, 149, 0.35);
}

.funky-ai-launcher img,
.funky-ai-launcher canvas {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.funky-ai-launcher-icon {
	font-size: 30px;
	line-height: 1;
}

.funky-ai-panel {
	display: none;
	width: min(420px, calc(100vw - 32px));
	height: min(600px, calc(100vh - 40px));
	overflow: hidden;
	flex-direction: column;
	border: 1px solid var(--funky-ai-border);
	border-radius: 16px;
	background: var(--funky-ai-panel);
	color: var(--funky-ai-text);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.funky-ai-widget[data-open="true"] .funky-ai-panel {
	display: flex;
	animation: funky-ai-enter 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.funky-ai-widget[data-open="true"] .funky-ai-launcher {
	display: none;
}

.funky-ai-header,
.funky-ai-form {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px;
	border-color: var(--funky-ai-border);
}

.funky-ai-header {
	justify-content: space-between;
	border-bottom: 1px solid var(--funky-ai-border);
	background: linear-gradient(135deg, rgba(35, 196, 149, 0.12), rgba(31, 162, 255, 0.06));
}

.funky-ai-header strong {
	font-size: 16px;
}

.funky-ai-close,
.funky-ai-clear {
	border: 0;
	background: transparent;
	color: #a1a1aa;
	cursor: pointer;
	font: inherit;
}

.funky-ai-messages {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	overflow: auto;
}

.funky-ai-message {
	max-width: 88%;
	margin: 0;
	padding: 10px 13px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--funky-ai-text);
	font-size: 14px;
	white-space: pre-wrap;
}

.funky-ai-message[data-role="user"] {
	align-self: flex-end;
	background: var(--funky-ai-accent);
	color: #06130f;
}

.funky-ai-message[data-error="true"] {
	color: #fca5a5;
}

.funky-ai-form {
	border-top: 1px solid var(--funky-ai-border);
}

.funky-ai-input {
	min-width: 0;
	flex: 1;
	padding: 10px 12px;
	border: 1px solid var(--funky-ai-border);
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--funky-ai-text);
}

.funky-ai-send {
	padding: 10px 14px;
	border: 0;
	border-radius: 9px;
	background: var(--funky-ai-accent);
	color: #06130f;
	font-weight: 700;
	cursor: pointer;
}

@keyframes funky-ai-enter {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
	.funky-ai-widget {
		right: 8px;
		bottom: 8px;
	}

	.funky-ai-panel {
		width: calc(100vw - 16px);
		height: min(72vh, 600px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.funky-ai-launcher,
	.funky-ai-panel {
		animation: none;
		transition: none;
	}
}
