/* Floating AI assistant bubble + embed panel (Desk + Website) */

#fac-ai-assistant-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	font-family: var(--font-stack, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: 14px;
	box-sizing: border-box;
}

#fac-ai-assistant-root *,
#fac-ai-assistant-root *::before,
#fac-ai-assistant-root *::after {
	box-sizing: border-box;
}

#fac-ai-assistant-bubble {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
	color: #fff;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#fac-ai-assistant-bubble:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 20px rgba(79, 70, 229, 0.55);
}

#fac-ai-assistant-bubble:focus-visible {
	outline: 2px solid #a5b4fc;
	outline-offset: 2px;
}

#fac-ai-assistant-bubble svg {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
}

#fac-ai-assistant-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.35);
	z-index: 2147482999;
}

#fac-ai-assistant-overlay.fac-ai-visible {
	display: block;
}

#fac-ai-assistant-panel {
	/* Match embedded chat header band so overlay controls align with in-frame icons */
	--fac-ai-assistant-header-height: 56px;
	--fac-ai-assistant-toolbar-btn-size: 18px;
	display: none;
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min(1080px, 100vw);
	max-width: 100vw;
	background: #fff;
	box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
	z-index: 2147483001;
	flex-direction: column;
	overflow: hidden;
}

#fac-ai-assistant-panel.fac-ai-visible {
	display: flex;
}

#fac-ai-assistant-panel-toolbar {
	position: absolute;
	top: calc((var(--fac-ai-assistant-header-height) - var(--fac-ai-assistant-toolbar-btn-size)) / 2);
	right: 5px;
	z-index: 5;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 3px;
	pointer-events: auto;
}

.fac-ai-assistant-toolbar-btn {
	width: var(--fac-ai-assistant-toolbar-btn-size);
	height: var(--fac-ai-assistant-toolbar-btn-size);
	padding: 0;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.92);
	color: #475569;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fac-ai-assistant-toolbar-btn:hover {
	background: #f8fafc;
	color: #1e293b;
	border-color: #cbd5e1;
}

.fac-ai-assistant-toolbar-btn:focus-visible {
	outline: 1px solid #6366f1;
	outline-offset: 1px;
}

.fac-ai-assistant-toolbar-btn svg {
	width: 9px;
	height: 9px;
	flex-shrink: 0;
}

.fac-ai-assistant-toolbar-btn-close:hover {
	color: #b91c1c;
	border-color: #fecaca;
	background: #fef2f2;
}

#fac-ai-assistant-resize-handle {
	position: absolute;
	left: -4px;
	top: 0;
	width: 8px;
	height: 100%;
	cursor: ew-resize;
	z-index: 2;
}

#fac-ai-assistant-resize-handle::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 0;
	width: 2px;
	height: 100%;
	background: transparent;
	transition: background 0.15s ease;
}

#fac-ai-assistant-panel:hover #fac-ai-assistant-resize-handle::after,
body.fac-ai-assistant-resizing #fac-ai-assistant-resize-handle::after {
	background: #cbd5e1;
}

body.fac-ai-assistant-resizing {
	user-select: none;
	cursor: ew-resize;
}

#fac-ai-assistant-iframe {
	flex: 1;
	width: 100%;
	border: 0;
	background: #fff;
}

@media (max-width: 480px) {
	#fac-ai-assistant-root {
		right: 12px;
		bottom: 12px;
	}

	#fac-ai-assistant-panel {
		width: 100vw;
	}
}
