/* Hub AI livechat — #arvinlink-hub-chat (compact panel, tawk-control visual language) */
#arvinlink-hub-chat-launcher {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 2147482999;
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var(--al-hub-accent, #6366f1);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#arvinlink-hub-chat-launcher:hover {
	transform: scale(1.04);
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}
#arvinlink-hub-chat-launcher.al-hidden {
	display: none;
}

#arvinlink-hub-chat {
	position: fixed;
	bottom: 90px;
	/* Default clears a 56px float column + gap (same idea as Tawk panel_offset_x). */
	right: var(--al-hub-panel-right, 92px);
	z-index: 2147483000;
	width: 360px;
	max-width: calc(100vw - 32px);
	min-height: 420px;
	max-height: min(640px, calc(100vh - 48px));
	display: none;
	flex-direction: column;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
	font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	font-size: 14px;
}
#arvinlink-hub-chat.al-open {
	display: flex;
	opacity: 1;
	transform: translateY(0);
}

#arvinlink-hub-chat .al-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	color: #fff;
	background: var(--al-hub-accent, #6366f1);
	flex: 0 0 auto;
}
#arvinlink-hub-chat .al-ava {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	flex: 0 0 38px;
	background: rgba(255, 255, 255, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
}
#arvinlink-hub-chat .al-meta {
	flex: 1;
	min-width: 0;
}
#arvinlink-hub-chat .al-name {
	font-weight: 700;
	font-size: 14px;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#arvinlink-hub-chat .al-sub {
	font-size: 11.5px;
	opacity: 0.9;
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 2px;
}
#arvinlink-hub-chat .al-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}
#arvinlink-hub-chat .al-x {
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	opacity: 0.85;
	padding: 2px 4px;
	border-radius: 6px;
	border: none;
	background: transparent;
	color: inherit;
}
#arvinlink-hub-chat .al-x:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.18);
}

#arvinlink-hub-chat .al-body {
	padding: 14px 14px 8px;
	flex: 1 1 auto;
	min-height: 220px;
	max-height: none;
	overflow-y: auto;
	background: #f7f8fa;
}
#arvinlink-hub-chat .al-row {
	display: flex;
	margin-bottom: 10px;
	align-items: flex-end;
	gap: 8px;
}
#arvinlink-hub-chat .al-row.al-me {
	flex-direction: row-reverse;
}
#arvinlink-hub-chat .al-bub {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 13.5px;
	word-wrap: break-word;
	line-height: 1.45;
}
#arvinlink-hub-chat .al-row.al-agent .al-bub {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}
#arvinlink-hub-chat .al-row.al-me .al-bub {
	background: var(--al-hub-accent, #6366f1);
	color: #fff;
	border-bottom-right-radius: 4px;
}

#arvinlink-hub-chat .al-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px;
	margin-top: 4px;
}
#arvinlink-hub-chat .al-card h4 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	color: #111827;
}
#arvinlink-hub-chat .al-form label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
	margin: 8px 0 4px;
}
#arvinlink-hub-chat .al-form input,
#arvinlink-hub-chat .al-form textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid #d1d5db;
	border-radius: 9px;
	font-size: 13.5px;
	box-sizing: border-box;
}
#arvinlink-hub-chat .al-form textarea {
	min-height: 72px;
	resize: vertical;
}
#arvinlink-hub-chat .al-form button.al-submit {
	margin-top: 10px;
	width: 100%;
	padding: 10px;
	border: none;
	border-radius: 9px;
	background: var(--al-hub-accent, #6366f1);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
#arvinlink-hub-chat .al-handoff a {
	display: block;
	margin: 6px 0;
	color: var(--al-hub-accent, #6366f1);
	text-decoration: none;
	font-weight: 600;
}
#arvinlink-hub-chat .al-handoff .al-note {
	font-size: 12px;
	color: #6b7280;
	margin-top: 8px;
}

#arvinlink-hub-chat .al-form-help {
	margin: 0 0 8px;
	font-size: 12px;
	line-height: 1.45;
	color: #6b7280;
}
#arvinlink-hub-chat .al-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 12px 10px;
	background: #f7f8fa;
	flex: 0 0 auto;
}
#arvinlink-hub-chat .al-chips:empty {
	display: none;
}
#arvinlink-hub-chat .al-chip {
	border: 1px solid #d1d5db;
	background: #fff;
	color: #374151;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12.5px;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
#arvinlink-hub-chat .al-chip:hover {
	border-color: var(--al-hub-accent, #6366f1);
	color: var(--al-hub-accent, #6366f1);
	background: #fff;
}

#arvinlink-hub-chat .al-compose {
	display: flex;
	gap: 8px;
	padding: 10px 12px 12px;
	background: #f7f8fa;
	border-top: 1px solid #e5e7eb;
	flex: 0 0 auto;
}
#arvinlink-hub-chat .al-compose input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	font-size: 13.5px;
}
#arvinlink-hub-chat .al-compose button {
	border: none;
	border-radius: 20px;
	padding: 0 14px;
	background: var(--al-hub-accent, #6366f1);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
#arvinlink-hub-chat .al-compose.al-disabled {
	opacity: 0.55;
	pointer-events: none;
}

#arvinlink-hub-chat .al-typing {
	display: inline-flex;
	gap: 4px;
	padding: 11px 12px;
}
#arvinlink-hub-chat .al-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #c4c8ce;
	display: inline-block;
	animation: al-hub-bounce 1.2s infinite ease-in-out;
}
#arvinlink-hub-chat .al-typing i:nth-child(2) {
	animation-delay: 0.15s;
}
#arvinlink-hub-chat .al-typing i:nth-child(3) {
	animation-delay: 0.3s;
}
@keyframes al-hub-bounce {
	0%, 80%, 100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-5px);
	}
}

/* Keep panel above float stack; right margin clears the button column. */
body.arvinlink-has-float-stack #arvinlink-hub-chat-launcher {
	bottom: calc(24px + var(--al-float-stack-offset, 220px) + var(--al-hub-panel-extra-bottom, 0px));
	right: 24px;
	z-index: 2147483000;
}
body.arvinlink-has-float-stack #arvinlink-hub-chat,
html.arvinlink-has-float-stack #arvinlink-hub-chat {
	bottom: calc(var(--al-float-stack-offset, 220px) + 16px + var(--al-hub-panel-extra-bottom, 0px));
	right: var(--al-hub-panel-right, 92px);
}
/* Float stack is portaled onto <html>, so match on html/document — not body only. */
html:has(.arvinlink-float-hubai) #arvinlink-hub-chat-launcher,
body:has(.arvinlink-float-hubai) #arvinlink-hub-chat-launcher,
html:has([data-arvinlink-hub-chat="1"]) #arvinlink-hub-chat-launcher,
#arvinlink-hub-chat-launcher.al-removed {
	display: none !important;
	pointer-events: none !important;
	visibility: hidden !important;
}
@media (max-width: 640px) {
	#arvinlink-hub-chat {
		left: 12px;
		right: 12px !important;
		width: auto;
		max-width: none;
		min-height: 380px;
		max-height: calc(100vh - 96px);
		bottom: 78px;
	}
	body.arvinlink-has-float-stack #arvinlink-hub-chat-launcher {
		bottom: calc(16px + var(--al-float-stack-offset, 200px) + var(--al-hub-panel-extra-bottom, 0px));
		right: 16px;
	}
	body.arvinlink-has-float-stack #arvinlink-hub-chat,
	html.arvinlink-has-float-stack #arvinlink-hub-chat {
		bottom: calc(var(--al-float-stack-offset, 200px) + 12px + var(--al-hub-panel-extra-bottom, 0px));
		left: 12px;
		right: 12px !important;
	}
}
