:root {
	--bizchat-primary: #2563eb;
	--bizchat-primary-dark: #1d4ed8;
	--bizchat-bg: #ffffff;
	--bizchat-bubble-bot: #f1f3f6;
	--bizchat-text: #1f2430;
	--bizchat-radius: 16px;
}

#bizchat-widget * {
	box-sizing: border-box;
}

#bizchat-widget {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#bizchat-toggle {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: none;
	background: var(--bizchat-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#bizchat-toggle:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

#bizchat-window {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: 340px;
	max-width: calc(100vw - 32px);
	height: 460px;
	max-height: calc(100vh - 140px);
	background: var(--bizchat-bg);
	border-radius: var(--bizchat-radius);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
}

#bizchat-widget.bizchat-open #bizchat-window {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

#bizchat-header {
	background: var(--bizchat-primary);
	color: #fff;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: 600;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

#bizchat-wa-header-btn {
	color: #fff;
	opacity: 0.9;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	flex-shrink: 0;
	transition: opacity 0.15s ease, background 0.15s ease;
}

#bizchat-wa-header-btn:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.28);
}

#bizchat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fafbfc;
}

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

.bizchat-msg.bot {
	align-self: flex-start;
	background: var(--bizchat-bubble-bot);
	color: var(--bizchat-text);
	border-bottom-left-radius: 4px;
}

.bizchat-msg.user {
	align-self: flex-end;
	background: var(--bizchat-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.bizchat-msg.error {
	align-self: flex-start;
	background: #fdecec;
	color: #b3261e;
	border-bottom-left-radius: 4px;
}

.bizchat-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 10px 13px;
	background: var(--bizchat-bubble-bot);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.bizchat-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #98a0ad;
	animation: bizchat-blink 1.2s infinite ease-in-out;
}

.bizchat-typing span:nth-child(2) { animation-delay: 0.2s; }
.bizchat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bizchat-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

#bizchat-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #eceff2;
	flex-shrink: 0;
}

#bizchat-input {
	flex: 1;
	border: 1px solid #dfe3e8;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
}

#bizchat-input:focus {
	border-color: var(--bizchat-primary);
}

#bizchat-send {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: var(--bizchat-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

#bizchat-send:hover {
	background: var(--bizchat-primary-dark);
}

#bizchat-wa-footer-link {
	display: block;
	text-align: center;
	font-size: 12.5px;
	padding: 8px 10px 12px;
	color: var(--bizchat-primary);
	text-decoration: none;
	flex-shrink: 0;
}

#bizchat-wa-footer-link:hover {
	text-decoration: underline;
}

.bizchat-wa-cta {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #25d366;
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 20px;
	margin-top: -2px;
}

.bizchat-wa-cta:hover {
	background: #1ebc59;
	color: #fff;
}

@media (max-width: 480px) {
	#bizchat-window {
		width: calc(100vw - 24px);
		right: -10px;
	}
}
