/* Ayeim Integrations — launcher, chat fallback panel, consent banner.
   Tokens mirror the theme's design system with safe fallbacks. */

:root {
	--ayeim-int-brand: var(--brand-600, #654797);
	--ayeim-int-brand-dark: var(--brand-700, #4f3878);
	--ayeim-int-ink: var(--ink-900, #16121d);
	--ayeim-int-line: var(--line, #e7e2ef);
	--ayeim-int-paper: var(--white, #fff);
}

/* ---------------- launcher ---------------- */
.ayeim-chat-launcher {
	position: fixed;
	right: clamp(1rem, 2vw, 1.5rem);
	bottom: clamp(1rem, 2vw, 1.5rem);
	z-index: 2147483000;
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.7rem 1.1rem;
	font: 600 0.95rem/1 "Inter", system-ui, sans-serif;
	color: #fff;
	background: var(--ayeim-int-brand);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 6px 24px -6px rgba(40, 24, 70, 0.45);
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}
.ayeim-chat-launcher:hover { background: var(--ayeim-int-brand-dark); }
.ayeim-chat-launcher:focus-visible { outline: 3px solid #b79fe0; outline-offset: 2px; }
.ayeim-chat-launcher__dot {
	width: 0.5rem; height: 0.5rem; border-radius: 50%;
	background: #7ee0b0; box-shadow: 0 0 0 3px rgba(126, 224, 176, 0.3);
}
/* When HubSpot's own bubble is present, defer to it. */
.ayeim-chat-launcher--hs { display: none; }

@media (max-width: 600px) {
	.ayeim-chat-launcher { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
	.ayeim-chat-launcher__text { display: none; }
	.ayeim-chat-launcher { padding: 0.85rem; }
}

/* ---------------- fallback panel ---------------- */
.ayeim-chat-panel {
	position: fixed;
	right: clamp(1rem, 2vw, 1.5rem);
	bottom: calc(clamp(1rem, 2vw, 1.5rem) + 3.5rem);
	z-index: 2147483000;
	width: min(22rem, calc(100vw - 2rem));
	background: var(--ayeim-int-paper);
	color: var(--ayeim-int-ink);
	border: 1px solid var(--ayeim-int-line);
	border-radius: 14px;
	box-shadow: 0 24px 60px -20px rgba(30, 18, 55, 0.4);
	font-family: "Inter", system-ui, sans-serif;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
}
.ayeim-chat-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }
.ayeim-chat-panel__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 0.85rem 1rem;
	font-weight: 650;
	color: #fff;
	background: var(--ayeim-int-brand);
	border-radius: 14px 14px 0 0;
}
.ayeim-chat-panel__close {
	background: transparent; border: 0; color: #fff;
	font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 0.2rem;
}
.ayeim-chat-panel__body { padding: 1rem; font-size: 0.92rem; line-height: 1.55; }
.ayeim-chat-panel__qas { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.ayeim-chat-panel__qa {
	display: inline-block;
	padding: 0.4rem 0.7rem;
	font-size: 0.83rem;
	color: var(--ayeim-int-brand-dark);
	background: var(--brand-50, #f3eefb);
	border: 1px solid var(--ayeim-int-line);
	border-radius: 999px;
	text-decoration: none;
}
.ayeim-chat-panel__qa:hover { background: var(--brand-100, #e7ddf6); }
.ayeim-chat-panel__note { margin: 0.5rem 0 0; font-size: 0.78rem; color: #6b6577; }
.ayeim-chat-panel__handoff {
	display: inline-block;
	margin-top: 0.85rem;
	font-weight: 600;
	color: var(--ayeim-int-brand-dark);
	text-decoration: none;
}
.ayeim-chat-panel__handoff:hover { text-decoration: underline; }

/* ---------------- consent banner ---------------- */
.ayeim-consent {
	position: fixed;
	left: clamp(1rem, 3vw, 2rem);
	right: clamp(1rem, 3vw, 2rem);
	bottom: clamp(1rem, 3vw, 2rem);
	z-index: 2147483001;
	max-width: 40rem;
	margin-inline: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.9rem 1.25rem;
	padding: 1rem 1.15rem;
	background: var(--ayeim-int-paper);
	color: var(--ayeim-int-ink);
	border: 1px solid var(--ayeim-int-line);
	border-radius: 12px;
	box-shadow: 0 20px 50px -18px rgba(30, 18, 55, 0.35);
	font: 400 0.88rem/1.5 "Inter", system-ui, sans-serif;
}
.ayeim-consent[hidden] { display: none; }
.ayeim-consent__text { margin: 0; flex: 1 1 16rem; }
.ayeim-consent__text a { color: var(--ayeim-int-brand-dark); }
.ayeim-consent__actions { display: flex; gap: 0.5rem; margin-left: auto; }
.ayeim-consent__btn {
	padding: 0.5rem 1rem;
	font: 600 0.85rem/1 "Inter", system-ui, sans-serif;
	border-radius: 999px;
	cursor: pointer;
	border: 1px solid var(--ayeim-int-brand);
}
.ayeim-consent__btn--ghost { background: transparent; color: var(--ayeim-int-brand-dark); }
.ayeim-consent__btn--primary { background: var(--ayeim-int-brand); color: #fff; }
.ayeim-consent__btn:focus-visible { outline: 3px solid #b79fe0; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.ayeim-chat-panel { transition: none; }
}
