/* AffiSupport HelpDesk AI — chat window. Theme-driven via CSS variables. */
#affisupport-chat-root {
	--as-accent: #2271b1;
	--as-accent-dark: #135e96;
	--as-bg: #ffffff;
	--as-text: #1d2327;
	--as-muted: #646970;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#affisupport-chat-launcher {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99990;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: var(--as-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, background 0.15s ease;
}

#affisupport-chat-launcher:hover {
	background: var(--as-accent-dark);
	transform: scale(1.06);
}

#affisupport-chat-window {
	position: fixed;
	right: 22px;
	bottom: 92px;
	z-index: 99991;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 130px);
	background: var(--as-bg);
	color: var(--as-text);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#affisupport-chat-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--as-accent);
	color: #fff;
}

.affisupport-chat-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 16px;
	text-transform: uppercase;
}

.affisupport-chat-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.affisupport-chat-status { font-size: 11px; opacity: 0.9; display: flex; align-items: center; gap: 5px; }

.affisupport-chat-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #7fe08a;
	display: inline-block;
}

#affisupport-chat-close {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
}

#affisupport-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--as-bg);
}

.affisupport-msg { display: flex; }

.affisupport-msg-user { justify-content: flex-end; }

.affisupport-bubble {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	word-wrap: break-word;
	white-space: pre-wrap;
}

.affisupport-msg-agent .affisupport-bubble {
	background: #f1f1f1;
	color: var(--as-text);
	border-bottom-left-radius: 4px;
}

.affisupport-msg-user .affisupport-bubble {
	background: var(--as-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.affisupport-msg-typing .affisupport-bubble {
	color: var(--as-muted);
	font-style: italic;
}

#affisupport-chat-inputbar {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	background: var(--as-bg);
}

#affisupport-chat-input {
	flex: 1;
	border: 1px solid rgba(0, 0, 0, 0.16);
	border-radius: 20px;
	padding: 8px 14px;
	font-size: 14px;
	background: #fff;
	color: var(--as-text);
	outline: none;
}

#affisupport-chat-input:focus {
	border-color: var(--as-accent);
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.18);
}

#affisupport-chat-send {
	border: 0;
	border-radius: 20px;
	background: var(--as-accent);
	color: #fff;
	font-weight: 700;
	padding: 0 18px;
	cursor: pointer;
	transition: background 0.15s ease;
}

#affisupport-chat-send:hover { background: var(--as-accent-dark); }
#affisupport-chat-send:disabled { opacity: 0.55; cursor: default; }

#affisupport-chat-notice {
	padding: 8px 14px;
	font-size: 12px;
	background: #fbeaea;
	color: #b32d2e;
}

#affisupport-chat-footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	background: var(--as-bg);
	font-size: 11px;
	color: var(--as-muted);
}

#affisupport-chat-footer a {
	color: var(--as-accent);
	text-decoration: none;
	font-weight: 700;
}

#affisupport-chat-compliance {
	padding: 8px 12px;
	font-size: 12px;
	background: #fbeaea;
	color: #b32d2e;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
	#affisupport-chat-window { right: 8px; left: 8px; bottom: 84px; width: auto; }
}
