/* WeTransform Live Chat – khung chat phía khách */
#wtlc-root {
	--wtlc-color: #4aa3bd;
	--wtlc-text: #1f2328;
	--wtlc-muted: #6b7280;
	--wtlc-bubble: #f3f2f0;
	--wtlc-gap: 20px;
	position: fixed;
	bottom: var(--wtlc-gap);
	right: var(--wtlc-gap);
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--wtlc-text);
	-webkit-font-smoothing: antialiased;
}
#wtlc-root.wtlc-pos-left { right: auto; left: var(--wtlc-gap); }
#wtlc-root *, #wtlc-root *::before, #wtlc-root *::after { box-sizing: border-box; }
#wtlc-root [hidden] { display: none !important; }
#wtlc-root button, #wtlc-root input, #wtlc-root textarea {
	font: inherit; color: inherit; margin: 0; letter-spacing: normal; text-transform: none; box-shadow: none; min-height: 0; line-height: 1.4;
}
#wtlc-root button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; width: auto; height: auto; }
#wtlc-root svg { display: block; }
#wtlc-root a { color: #1a5fd0; text-decoration: underline; word-break: break-word; }

/* Nút tròn */
.wtlc-launcher {
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 60px !important;
	height: 60px !important;
	border-radius: 50% !important;
	background: var(--wtlc-color) !important;
	color: #fff !important;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .22) !important;
	transition: transform .15s ease;
	margin-left: auto !important;
}
.wtlc-pos-left .wtlc-launcher { margin-left: 0 !important; }
.wtlc-launcher:hover { transform: scale(1.06); }
.wtlc-launcher:focus-visible { outline: 3px solid rgba(0, 0, 0, .35); outline-offset: 2px; }
.wtlc-launch-close { display: none; }
.wtlc-is-open .wtlc-launch-chat { display: none; }
.wtlc-is-open .wtlc-launch-close { display: block; }
.wtlc-launch-close svg { width: 30px; height: 30px; }
.wtlc-badge {
	position: absolute; top: -4px; right: -4px;
	min-width: 22px; height: 22px; padding: 0 6px;
	border-radius: 11px; background: #e5484d; color: #fff;
	font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
	border: 2px solid #fff;
}

/* Lời chào nổi */
.wtlc-teaser {
	position: absolute; bottom: 76px; right: 0;
	width: 300px; max-width: calc(100vw - 40px);
	background: #fff; border-radius: 14px;
	box-shadow: 0 6px 28px rgba(0, 0, 0, .18);
	animation: wtlc-pop .25s ease;
}
.wtlc-pos-left .wtlc-teaser { right: auto; left: 0; }
.wtlc-teaser-body { display: flex; gap: 10px; padding: 14px 16px; cursor: pointer; }
.wtlc-teaser-text { font-size: 14px; line-height: 1.45; padding-right: 14px; }
.wtlc-teaser-text a { pointer-events: none; }
.wtlc-teaser-x {
	position: absolute !important; top: -10px; right: -6px;
	width: 26px !important; height: 26px !important; border-radius: 50% !important;
	background: #fff !important; box-shadow: 0 1px 6px rgba(0, 0, 0, .25) !important;
	display: flex !important; align-items: center; justify-content: center; color: #555 !important;
}
.wtlc-teaser-x svg { width: 14px; height: 14px; }

/* Khung chat */
.wtlc-panel {
	position: absolute; bottom: 76px; right: 0;
	width: 420px; height: min(680px, calc(100vh - 110px));
	display: flex; flex-direction: column;
	background: #fff; border-radius: 16px; overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
	animation: wtlc-pop .2s ease;
	transition: width .2s ease, height .2s ease;
}
.wtlc-pos-left .wtlc-panel { right: auto; left: 0; }
.wtlc-expanded .wtlc-panel { width: min(760px, calc(100vw - 40px)); height: calc(100vh - 110px); }
@keyframes wtlc-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.wtlc-head {
	display: flex; align-items: center; gap: 12px;
	padding: 18px 12px 18px 18px;
	background: var(--wtlc-color); color: #fff;
}
.wtlc-head-text { flex: 1; min-width: 0; }
.wtlc-owner { font-size: 19px; font-weight: 700; line-height: 1.25; }
.wtlc-sub { font-size: 13px; opacity: .95; margin-top: 2px; }
.wtlc-head-av { position: relative; flex: none; display: inline-flex; }
.wtlc-status { position: absolute; right: 1px; bottom: 2px; width: 13px; height: 13px; border-radius: 50%; background: #9ca3af; border: 2px solid #fff; }
.wtlc-status.on { background: #22c55e; }
.wtlc-icon { display: flex !important; align-items: center; justify-content: center; width: 34px !important; height: 34px !important; border-radius: 8px !important; color: inherit; flex: none; }
.wtlc-head .wtlc-icon { color: #fff !important; }
.wtlc-head .wtlc-icon:hover { background: rgba(255, 255, 255, .16) !important; }

.wtlc-av { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; background: var(--wtlc-color); color: #fff; font-weight: 700; }
.wtlc-av img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border: 0; }
.wtlc-av-lg { width: 56px; height: 56px; border: 3px solid #fff; font-size: 20px; }
.wtlc-av-md { width: 36px; height: 36px; font-size: 13px; }
.wtlc-av-sm { width: 36px; height: 36px; font-size: 13px; }
.wtlc-initials { letter-spacing: .5px; }

.wtlc-body { flex: 1; overflow-y: auto; padding: 20px 16px 8px; overscroll-behavior: contain; }
.wtlc-row { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 6px; }
.wtlc-agent .wtlc-av { align-self: flex-start; }
.wtlc-agent.wtlc-cont .wtlc-av { visibility: hidden; }
.wtlc-me { justify-content: flex-end; }
.wtlc-bubble {
	max-width: 80%;
	padding: 11px 15px;
	border-radius: 16px;
	background: var(--wtlc-bubble);
	white-space: normal; overflow-wrap: anywhere;
}
.wtlc-me .wtlc-bubble { background: var(--wtlc-color); color: #fff; border-bottom-right-radius: 6px; }
#wtlc-root .wtlc-me .wtlc-bubble a { color: #fff; }
.wtlc-agent .wtlc-bubble { border-top-left-radius: 6px; }
.wtlc-pending { opacity: .6; }
.wtlc-time { font-size: 11.5px; color: var(--wtlc-muted); margin: 0 0 12px 46px; }
.wtlc-time-me { text-align: right; margin-left: 0; }
.wtlc-img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; margin: 2px 0; }
#wtlc-root .wtlc-file { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; }
.wtlc-file svg { flex: none; }

.wtlc-typing { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.wtlc-dots { display: inline-flex; gap: 4px; padding: 14px 16px; background: var(--wtlc-bubble); border-radius: 16px; border-top-left-radius: 6px; }
.wtlc-dots i { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: wtlc-blink 1.2s infinite; }
.wtlc-dots i:nth-child(2) { animation-delay: .2s; }
.wtlc-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes wtlc-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Form để lại email */
.wtlc-capture { width: 100%; }
.wtlc-capture p { margin: 0 0 10px; }
#wtlc-root .wtlc-capture input {
	display: block; width: 100%; margin: 0 0 8px; padding: 9px 12px;
	border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font-size: 14px; height: auto;
}
#wtlc-root .wtlc-capture input:focus { outline: none; border-color: var(--wtlc-color); box-shadow: 0 0 0 2px rgba(74, 163, 189, .2); }
.wtlc-capture-actions { display: flex; align-items: center; gap: 14px; }
#wtlc-root .wtlc-btn { background: var(--wtlc-color); color: #fff; padding: 8px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; }
#wtlc-root .wtlc-btn:disabled { opacity: .6; }
#wtlc-root .wtlc-skip { color: var(--wtlc-muted); font-size: 13px; text-decoration: underline; }

.wtlc-error { margin: 0 16px 8px; padding: 8px 12px; border-radius: 8px; background: #fef2f2; color: #b42318; font-size: 13px; }

/* Ô nhập */
.wtlc-compose {
	display: flex; align-items: flex-end; gap: 2px;
	margin: 8px 16px 10px; padding: 6px 8px 6px 18px;
	border: 1.5px solid #4b5563; border-radius: 28px; background: #fff;
}
.wtlc-compose:focus-within { border-color: var(--wtlc-color); }
.wtlc-compose.wtlc-locked { opacity: .5; pointer-events: none; }
#wtlc-root .wtlc-input {
	flex: 1; border: 0 !important; outline: none !important; resize: none; background: transparent !important;
	padding: 9px 0; font-size: 15px; max-height: 120px; min-height: 0; height: 40px; overflow-y: auto;
}
#wtlc-root .wtlc-input::placeholder { color: #6b7280; opacity: 1; }
.wtlc-compose .wtlc-icon { color: #9ca3af !important; cursor: pointer; }
.wtlc-compose .wtlc-icon:hover { color: var(--wtlc-color) !important; }
.wtlc-foot { text-align: center; font-size: 11.5px; color: var(--wtlc-muted); padding: 0 0 10px; }

/* Trợ lý AI */
.wtlc-av-bot { background: linear-gradient(135deg, #7c5cff, var(--wtlc-color)) !important; color: #fff; }
.wtlc-av-bot svg { width: 18px; height: 18px; }
.wtlc-ai-tag { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #6d4fe0; margin: -2px 0 4px; }
.wtlc-ai-tag svg { width: 12px; height: 12px; }

/* Câu hỏi gợi ý */
.wtlc-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 4px 0 14px 46px; }
#wtlc-root .wtlc-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 14px; border: 1.5px solid var(--wtlc-color); border-radius: 18px;
	background: #fff; color: var(--wtlc-color); font-size: 13.5px; font-weight: 600; text-align: left; line-height: 1.3;
}
#wtlc-root .wtlc-chip:hover { background: var(--wtlc-color); color: #fff; }
#wtlc-root .wtlc-chip-book { background: var(--wtlc-color); color: #fff; }
#wtlc-root .wtlc-chip-book:hover { filter: brightness(.93); }

/* Đặt lịch trong khung chat */
.wtlc-panel { position: absolute; }
.wtlc-book { position: absolute; left: 0; right: 0; bottom: 0; top: 92px; background: #fff; display: flex; flex-direction: column; z-index: 2; }
.wtlc-book-head { padding: 6px 10px; border-bottom: 1px solid #e5e7eb; }
#wtlc-root .wtlc-book-back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--wtlc-color); }
#wtlc-root .wtlc-book-back:hover { background: #f3f4f6; }
.wtlc-book iframe { flex: 1; width: 100%; border: 0; }

/* Đánh giá */
.wtlc-rate { margin: 10px 0 6px; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 14px; text-align: center; font-size: 14px; }
.wtlc-rate p { margin: 0 0 8px; }
.wtlc-rate-btns { display: flex; justify-content: center; gap: 14px; }
#wtlc-root .wtlc-rate-btns button { font-size: 26px; width: 52px; height: 44px; border-radius: 12px; border: 1px solid #e5e7eb; }
#wtlc-root .wtlc-rate-btns button:hover { background: #f3f4f6; }

/* Điện thoại: khung chat toàn màn hình */
@media (max-width: 480px) {
	#wtlc-root { --wtlc-gap: 14px; }
	#wtlc-root.wtlc-no-mobile { display: none; }
	.wtlc-panel, .wtlc-expanded .wtlc-panel {
		position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0;
	}
	.wtlc-expand { display: none !important; }
	.wtlc-book { top: 76px; }
	.wtlc-is-open .wtlc-launcher { display: none !important; }
	#wtlc-root .wtlc-input { font-size: 16px; } /* tránh iOS tự phóng to */
	.wtlc-teaser { width: calc(100vw - 28px); }
	.wtlc-sub { font-size: 12.5px; }
	.wtlc-head { padding: 14px 10px 14px 14px; }
	.wtlc-av-lg { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
	.wtlc-panel, .wtlc-teaser, .wtlc-dots i { animation: none; }
}
@media print { #wtlc-root { display: none; } }

/* Chọn loại lịch hẹn, đăng ký workshop (1.2) */
.wtlc-book-head { display: flex; align-items: center; gap: 8px; }
.wtlc-book-title { font-size: 13px; color: var(--wtlc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtlc-cardrow .wtlc-bubble.wtlc-card { width: 100%; max-width: 100%; }
.wtlc-card-title { margin: 0 0 8px; font-weight: 600; }
#wtlc-root .wtlc-opt { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 9px 12px; margin-top: 8px; font-size: 13.5px; line-height: 1.4; color: inherit; cursor: pointer; }
#wtlc-root .wtlc-opt:hover { border-color: var(--wtlc-color); box-shadow: 0 0 0 2px rgba(74, 163, 189, .15); }
#wtlc-root .wtlc-opt b { display: block; color: var(--wtlc-color); font-size: 14px; }
#wtlc-root .wtlc-opt span { display: block; color: var(--wtlc-muted); font-size: 12.5px; margin-top: 2px; }
.wtlc-ev-meta { margin: 0 0 10px; font-size: 13px; color: var(--wtlc-muted); line-height: 1.5; }
.wtlc-ev-meta svg { vertical-align: -3px; }
.wtlc-tks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
#wtlc-root .wtlc-tk { display: flex; gap: 8px; align-items: flex-start; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; }
#wtlc-root .wtlc-tk:has(input:checked) { border-color: var(--wtlc-color); box-shadow: 0 0 0 1px var(--wtlc-color); }
#wtlc-root .wtlc-tk input { margin: 3px 0 0; accent-color: var(--wtlc-color); }
#wtlc-root .wtlc-tk em { display: block; font-style: normal; color: var(--wtlc-muted); font-size: 12px; }
#wtlc-root .wtlc-qty { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
#wtlc-root .wtlc-qty select { border: 1px solid #d1d5db; border-radius: 8px; padding: 4px 8px; font: inherit; background: #fff; }
#wtlc-root .wtlc-ev input[type=text], #wtlc-root .wtlc-ev input[type=email], #wtlc-root .wtlc-ev input[type=tel] {
	display: block; width: 100%; box-sizing: border-box; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 10px; margin: 0 0 8px; font: inherit; font-size: 14px; background: #fff; color: #111;
}
#wtlc-root .wtlc-ev input:focus { outline: none; border-color: var(--wtlc-color); }
#wtlc-root .wtlc-consent { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--wtlc-muted); margin: 2px 0 10px; }
#wtlc-root .wtlc-consent input { margin: 2px 0 0; accent-color: var(--wtlc-color); }
