#thaphaco-chat-bubble {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: linear-gradient(135deg, #1a7d4b, #26a866);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(26,125,75,.35);
	z-index: 999999;
	font-size: 26px;
	transition: transform .15s ease;
}

#thaphaco-chat-bubble:hover {
	transform: scale(1.06);
}

#thaphaco-chat-window {
	position: fixed;
	bottom: 92px;
	right: 20px;
	width: 340px;
	max-width: 90vw;
	height: 460px;
	max-height: 72vh;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 12px 40px rgba(0,0,0,.22);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	border: 1px solid rgba(0,0,0,.06);
}

#thaphaco-chat-window.open {
	display: flex;
	animation: thaphaco-chat-pop .18s ease-out;
}

#thaphaco-chat-window.thaphaco-chat-expanded {
	width: 420px;
	height: 640px;
	max-height: 85vh;
	bottom: 20px;
}

@keyframes thaphaco-chat-pop {
	from { opacity: 0; transform: translateY(10px) scale(.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

#thaphaco-chat-header {
	background: linear-gradient(135deg, #1a7d4b, #26a866);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.thaphaco-chat-header-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

.thaphaco-chat-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255,255,255,.2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.thaphaco-chat-title {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
}

.thaphaco-chat-status {
	font-size: 11px;
	opacity: .85;
	line-height: 1.3;
}

.thaphaco-chat-status::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #7CFFB2;
	margin-right: 5px;
}

.thaphaco-chat-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

#thaphaco-chat-expand,
#thaphaco-chat-close {
	cursor: pointer;
	line-height: 1;
	opacity: .9;
	padding: 4px;
}

#thaphaco-chat-expand {
	font-size: 15px;
}

#thaphaco-chat-close {
	font-size: 20px;
}

#thaphaco-chat-expand:hover,
#thaphaco-chat-close:hover {
	opacity: 1;
}

#thaphaco-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px 12px;
	background: #f4f6f5;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.thaphaco-chat-row {
	display: flex;
	flex-direction: column;
	margin: 4px 0;
}

.thaphaco-chat-row.user {
	align-items: flex-end;
}

.thaphaco-chat-row.bot {
	align-items: flex-start;
}

.thaphaco-chat-msg {
	padding: 10px 14px;
	border-radius: 16px;
	max-width: 78%;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.thaphaco-chat-msg.user {
	background: linear-gradient(135deg, #1a7d4b, #26a866);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.thaphaco-chat-msg.bot {
	background: #fff;
	color: #222;
	border-bottom-left-radius: 4px;
}

.thaphaco-chat-time {
	font-size: 10px;
	color: #9aa39d;
	margin-top: 3px;
	padding: 0 4px;
}

.thaphaco-chat-typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 16px;
}

.thaphaco-chat-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9aa5a1;
	display: inline-block;
	animation: thaphaco-chat-blink 1.2s infinite ease-in-out;
}

.thaphaco-chat-dot:nth-child(2) { animation-delay: .2s; }
.thaphaco-chat-dot:nth-child(3) { animation-delay: .4s; }

@keyframes thaphaco-chat-blink {
	0%, 80%, 100% { opacity: .3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

#thaphaco-chat-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	border-top: 1px solid #eee;
	padding: 10px 12px;
	background: #fff;
}

#thaphaco-chat-input {
	flex: 1;
	border: 1px solid #e2e5e3;
	background: #f4f6f5;
	border-radius: 20px;
	padding: 10px 16px;
	font-size: 14px;
	outline: none;
}

#thaphaco-chat-input:focus {
	border-color: #26a866;
}

#thaphaco-chat-send {
	border: none;
	background: linear-gradient(135deg, #1a7d4b, #26a866);
	color: #fff;
	height: 38px;
	padding: 0 18px;
	border-radius: 19px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

#thaphaco-chat-send:disabled {
	opacity: .6;
	cursor: default;
}
