#atechglobe-chat-root {
	--atg-brand: #1652f0;
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#atechglobe-chat-root.atechglobe-chat-pos-right { right: 20px; }
#atechglobe-chat-root.atechglobe-chat-pos-left { left: 20px; }

.atg-fab {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var(--atg-brand);
	box-shadow: 0 6px 24px rgba(0,0,0,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: none;
	color: #fff;
	transition: transform 0.2s ease;
	position: relative;
}
.atg-fab:hover { transform: scale(1.06); }
.atg-fab svg { width: 28px; height: 28px; }
.atg-fab-dot {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	background: #22c55e;
	border-radius: 50%;
	border: 2px solid #fff;
}

.atg-panel {
	position: absolute;
	bottom: 78px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0,0,0,0.2);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
#atechglobe-chat-root.atechglobe-chat-pos-right .atg-panel { right: 0; }
#atechglobe-chat-root.atechglobe-chat-pos-left .atg-panel { left: 0; }
.atg-panel.atg-open { display: flex; }

.atg-header {
	background: var(--atg-brand);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.atg-header-title { font-weight: 600; font-size: 15px; }
.atg-header-sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.atg-close-btn {
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 4px;
}

.atg-quick-actions {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	background: #f7f8fb;
	border-bottom: 1px solid #eceef2;
	flex-wrap: wrap;
}
.atg-quick-btn {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	padding: 8px 6px;
	border-radius: 8px;
	border: 1px solid #e1e4ea;
	background: #fff;
	color: #222;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
}
.atg-quick-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.atg-quick-btn.atg-whatsapp { color: #128C7E; border-color: #cdeee9; }
.atg-quick-btn.atg-call { color: #1652f0; }
.atg-quick-btn.atg-email { color: #b45309; }

.atg-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fff;
}
.atg-msg {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.4;
}
.atg-msg-bot {
	align-self: flex-start;
	background: #f1f3f7;
	color: #1a1a1a;
	border-bottom-left-radius: 4px;
}
.atg-msg-user {
	align-self: flex-end;
	background: var(--atg-brand);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.atg-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 10px 14px;
	background: #f1f3f7;
	border-radius: 14px;
}
.atg-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9aa1ad;
	animation: atg-bounce 1.2s infinite ease-in-out;
}
.atg-typing span:nth-child(2) { animation-delay: 0.15s; }
.atg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes atg-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
	40% { transform: translateY(-4px); opacity: 1; }
}

.atg-lead-form {
	padding: 12px 14px;
	border-top: 1px solid #eceef2;
	background: #fafbfc;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.atg-lead-form input {
	padding: 8px 10px;
	border: 1px solid #dfe2e8;
	border-radius: 8px;
	font-size: 13px;
}
.atg-lead-form button {
	background: var(--atg-brand);
	color: #fff;
	border: none;
	padding: 9px;
	border-radius: 8px;
	font-weight: 600;
	cursor: pointer;
	font-size: 13px;
}
.atg-lead-note { font-size: 11px; color: #757a85; }

.atg-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #eceef2;
	background: #fff;
}
.atg-input-row input {
	flex: 1;
	border: 1px solid #dfe2e8;
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 13.5px;
	outline: none;
}
.atg-input-row input:focus { border-color: var(--atg-brand); }
.atg-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--atg-brand);
	border: none;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}
.atg-send-btn svg { width: 16px; height: 16px; }
.atg-send-btn:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
	.atg-panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 120px);
	}
}

/* ---- v2: dynamic features ---- */
.atg-header { gap: 10px; }
.atg-header-text { flex: 1; min-width: 0; }
.atg-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, 0.6);
	flex-shrink: 0;
}
.atg-header-sub { display: flex; align-items: center; gap: 6px; }
.atg-header-sub:empty { display: none; }
.atg-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ade80;
	flex-shrink: 0;
}
.atg-status-dot.is-offline { background: #cbd5e1; }
.atg-status-text:empty, .atg-status-text:empty ~ * { display: none; }

.atg-msg a { color: inherit; text-decoration: underline; word-break: break-all; }

.atg-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 14px;
}
.atg-chips:not(:empty) { padding-bottom: 10px; background: #fff; }
.atg-chip {
	background: #fff;
	color: var(--atg-brand);
	border: 1px solid var(--atg-brand);
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 12.5px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	text-align: left;
}
.atg-chip:hover { background: var(--atg-brand); color: #fff; }

.atg-lead-wrap { max-height: 45%; overflow-y: auto; }

.atg-launcher-label {
	position: absolute;
	bottom: 12px;
	background: #fff;
	color: #1a1a1a;
	border: none;
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
}
#atechglobe-chat-root.atechglobe-chat-pos-right .atg-launcher-label { right: 76px; }
#atechglobe-chat-root.atechglobe-chat-pos-left .atg-launcher-label { left: 76px; }

@media (max-width: 782px) {
	#atechglobe-chat-root.atg-hide-mobile { display: none; }
}
@media (max-width: 480px) {
	.atg-launcher-label { display: none; }
}
