/* ==========================================================================
   AI CHATBOT POPUP - GK AERO AI ASSISTANT
   Phong cách: Cyber Aviation & Luxury Glassmorphism 2026
   ========================================================================== */

/* 1. KHUNG CHÍNH POPUP CHATBOT */
.ai-chatbot-popup {
	position: fixed;
	bottom: 24px;
	right: 84px;
	width: 430px;
	max-width: calc(100vw - 32px);
	height: min(640px, calc(100dvh - 32px));
	max-height: calc(100dvh - 32px);
	background: linear-gradient(180deg, rgba(13, 22, 41, 0.94) 0%, rgba(7, 12, 24, 0.98) 100%);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid rgba(56, 189, 248, 0.35);
	box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75), 0 0 35px rgba(14, 165, 233, 0.2);
	border-radius: 22px;
	z-index: 2147483642;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	overscroll-behavior: contain;
	opacity: 0;
	visibility: hidden;
	transform: translateY(24px) scale(0.95);
	transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #f8fafc;
	user-select: text;
}

/* Đảm bảo luôn hiển thị trong Fullscreen */
:fullscreen .ai-chatbot-popup,
:-webkit-full-screen .ai-chatbot-popup,
:-moz-full-screen .ai-chatbot-popup,
:-ms-fullscreen .ai-chatbot-popup {
	position: fixed !important;
	z-index: 2147483647 !important;
}

.ai-chatbot-popup.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	z-index: 2147483649 !important;
}

/* Ẩn các nút floating (Menu Phải, Zalo Chat, Logo VIAexpo trung tâm, Menu góc trên phải) khi mở cửa sổ AI Chatbot */
body:has(.ai-chatbot-popup.is-open) .top-center-logo,
body:has(.ai-chatbot-popup.is-open) #topCenterLogo,
body:has(.ai-chatbot-popup.is-open) .menu-top-right-container,
body:has(.ai-chatbot-popup.is-open) .menu-phai-container,
body:has(.ai-chatbot-popup.is-open) .zalo-floating-btn,
body:has(.ai-chatbot-popup.is-open) .zalo-btn-float,
body.ai-chat-is-active .top-center-logo,
body.ai-chat-is-active #topCenterLogo,
body.ai-chat-is-active .menu-top-right-container,
body.ai-chat-is-active .menu-phai-container,
body.ai-chat-is-active .zalo-floating-btn,
body.ai-chat-is-active .zalo-btn-float {
	opacity: 0 !important;
	pointer-events: none !important;
	visibility: hidden !important;
	transform: scale(0.4) !important;
	transition: all 0.25s ease !important;
}

body:has(.ai-chatbot-popup.is-open) .top-center-logo,
body.ai-chat-is-active .top-center-logo {
	display: none !important;
}

.ai-chatbot-popup.is-minimized {
	height: 68px !important;
	overflow: hidden;
}

/* 2. HEADER POPUP CHATBOT */
.ai-chat-header {
	padding: 14px 18px;
	background: linear-gradient(135deg, #0d1629 0%, #111e38 100%) !important;
	border-bottom: 1px solid rgba(56, 189, 248, 0.25);
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	gap: 10px;
}

.ai-chat-header::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 100%;
	height: 1px;
	background: linear-gradient(90deg, transparent, #38bdf8, transparent);
}

.ai-chat-bot-info {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.ai-chat-avatar-wrap {
	position: relative;
	width: 42px;
	height: 42px;
	flex-shrink: 0;
}

.ai-chat-avatar {
	width: 100%;
	height: 100%;
	border-radius: 12px;
	background: linear-gradient(135deg, #0284c7, #2563eb);
	border: 1.5px solid rgba(56, 189, 248, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	box-shadow: 0 0 16px rgba(14, 165, 233, 0.45);
}

.ai-chat-live-status {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 12px;
	height: 12px;
	background: #22c55e;
	border: 2px solid #0f172a;
	border-radius: 50%;
	box-shadow: 0 0 8px #22c55e;
}

.ai-chat-title-group {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ai-chat-bot-name {
	font-size: 0.98rem;
	font-weight: 700;
	color: #ffffff;
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ai-chat-bot-badge {
	font-size: 0.65rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 20px;
	background: rgba(56, 189, 248, 0.15);
	color: #38bdf8;
	border: 1px solid rgba(56, 189, 248, 0.35);
	letter-spacing: 0.5px;
}

.ai-chat-bot-desc {
	font-size: 0.74rem;
	color: #94a3b8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Các nút điều khiển trên Header */
.ai-chat-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.ai-chat-btn-icon {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #cbd5e1;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	transition: all 0.2s ease;
	outline: none;
}

.ai-chat-btn-icon:hover {
	background: rgba(56, 189, 248, 0.2);
	border-color: #38bdf8;
	color: #38bdf8;
	transform: scale(1.05);
}

/* 3. KHUNG HIỂN THỊ TIN NHẮN (MESSAGE BODY) */
.ai-chat-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	scroll-behavior: smooth;
}

.ai-chat-body::-webkit-scrollbar {
	width: 5px;
}

.ai-chat-body::-webkit-scrollbar-thumb {
	background: rgba(56, 189, 248, 0.3);
	border-radius: 10px;
}

/* Hàng tin nhắn */
.ai-msg-row {
	display: flex;
	gap: 10px;
	max-width: 92%;
	animation: aiFadeSlideUp 0.3s ease forwards;
}

.ai-msg-row.ai-msg-assistant {
	align-self: flex-start;
}

.ai-msg-row.ai-msg-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.ai-msg-avatar {
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: rgba(2, 132, 199, 0.3);
	border: 1px solid rgba(56, 189, 248, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	flex-shrink: 0;
	margin-top: 2px;
}

.ai-msg-user .ai-msg-avatar {
	background: rgba(245, 158, 11, 0.2);
	border-color: rgba(245, 158, 11, 0.5);
}

.ai-msg-bubble {
	padding: 11px 15px;
	border-radius: 16px;
	font-size: 0.86rem;
	line-height: 1.55;
	position: relative;
	word-break: break-word;
}

.ai-msg-assistant .ai-msg-bubble {
	background: rgba(20, 31, 53, 0.85);
	border: 1px solid rgba(56, 189, 248, 0.2);
	color: #e2e8f0;
	border-top-left-radius: 4px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ai-msg-user .ai-msg-bubble {
	background: linear-gradient(135deg, #0284c7, #1d4ed8);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-top-right-radius: 4px;
	box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.ai-msg-time {
	font-size: 0.65rem;
	color: rgba(255, 255, 255, 0.5);
	margin-top: 4px;
	display: block;
	text-align: right;
}

/* Định dạng Markdown nội dung bot */
.ai-msg-bubble strong {
	color: #38bdf8;
	font-weight: 700;
}

.ai-msg-bubble a {
	color: #38bdf8;
	text-decoration: underline;
}

.ai-msg-bubble ul, .ai-msg-bubble ol {
	margin: 6px 0;
	padding-left: 18px;
}

.ai-msg-bubble li {
	margin-bottom: 4px;
}

/* 4. THANH GỢI Ý CÂU HỎI NHANH (QUICK CHIPS) */
/* 4. THANH GỢI Ý CÂU HỎI NHANH & NÚT HÀNH ĐỘNG CHỦ ĐỘNG (PROACTIVE ACTION CHIPS) */
.ai-chat-quick-chips {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin-top: 10px;
	width: 100%;
}

.ai-quick-chip {
	background: linear-gradient(135deg, rgba(22, 33, 54, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
	border: 1px solid rgba(56, 189, 248, 0.3);
	color: #f1f5f9;
	font-size: 0.82rem;
	font-weight: 600;
	padding: 9px 13px;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
	text-align: left;
	position: relative;
	overflow: hidden;
	user-select: none;
}

.ai-quick-chip::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 60%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
	transform: skewX(-25deg);
	transition: 0.5s ease;
}

.ai-quick-chip:hover::before {
	left: 140%;
}

.ai-quick-chip:hover {
	background: linear-gradient(135deg, rgba(30, 48, 80, 0.95) 0%, rgba(18, 30, 56, 0.95) 100%);
	border-color: #38bdf8;
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(14, 165, 233, 0.3);
}

.ai-quick-chip:active {
	transform: scale(0.98);
}

.ai-chip-left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.ai-chip-text {
	line-height: 1.35;
	font-size: 0.81rem;
	color: inherit;
	word-break: break-word;
}

.ai-chip-badge {
	font-size: 0.65rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 6px;
	background: rgba(56, 189, 248, 0.15);
	color: #38bdf8;
	border: 1px solid rgba(56, 189, 248, 0.3);
	flex-shrink: 0;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.ai-chip-arrow {
	color: #64748b;
	font-size: 14px;
	transition: transform 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}

.ai-quick-chip:hover .ai-chip-arrow {
	transform: translateX(3px);
	color: #38bdf8;
}

/* Biến thể nút hành động chủ động chuyên biệt */
.ai-quick-chip-knowledge {
	background: linear-gradient(135deg, rgba(88, 28, 135, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
	border-color: rgba(168, 85, 247, 0.5);
}
.ai-quick-chip-knowledge .ai-chip-badge {
	background: rgba(168, 85, 247, 0.25);
	color: #c084fc;
	border-color: rgba(168, 85, 247, 0.55);
}
.ai-quick-chip-knowledge:hover {
	border-color: #a855f7;
	box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.ai-quick-chip-register {
	background: linear-gradient(135deg, rgba(6, 78, 59, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
	border-color: rgba(16, 185, 129, 0.45);
}
.ai-quick-chip-register .ai-chip-badge {
	background: rgba(16, 185, 129, 0.25);
	color: #34d399;
	border-color: rgba(16, 185, 129, 0.5);
}
.ai-quick-chip-register:hover {
	border-color: #10b981;
	box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.ai-quick-chip-hotline {
	background: linear-gradient(135deg, rgba(136, 19, 55, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
	border-color: rgba(244, 63, 94, 0.45);
}
.ai-quick-chip-hotline .ai-chip-badge {
	background: rgba(244, 63, 94, 0.25);
	color: #fb7185;
	border-color: rgba(244, 63, 94, 0.5);
}
.ai-quick-chip-hotline:hover {
	border-color: #f43f5e;
	box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35);
}

.ai-quick-chip-zalo {
	background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(15, 23, 42, 0.95) 100%);
	border-color: rgba(56, 189, 248, 0.45);
}
.ai-quick-chip-zalo .ai-chip-badge {
	background: rgba(2, 132, 199, 0.25);
	color: #38bdf8;
	border-color: rgba(56, 189, 248, 0.5);
}
.ai-quick-chip-zalo:hover {
	border-color: #0ea5e9;
	box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

.ai-quick-chip-scholarship {
	background: linear-gradient(135deg, rgba(88, 28, 135, 0.4) 0%, rgba(15, 23, 42, 0.95) 100%);
	border-color: rgba(168, 85, 247, 0.45);
}
.ai-quick-chip-scholarship .ai-chip-badge {
	background: rgba(168, 85, 247, 0.25);
	color: #c084fc;
	border-color: rgba(168, 85, 247, 0.5);
}
.ai-quick-chip-scholarship:hover {
	border-color: #a855f7;
	box-shadow: 0 6px 20px rgba(168, 85, 247, 0.35);
}

.ai-quick-chip-news {
	background: linear-gradient(135deg, rgba(180, 83, 9, 0.4) 0%, rgba(15, 23, 42, 0.95) 100%);
	border-color: rgba(245, 158, 11, 0.45);
}
.ai-quick-chip-news .ai-chip-badge {
	background: rgba(245, 158, 11, 0.25);
	color: #fbbf24;
	border-color: rgba(245, 158, 11, 0.5);
}
.ai-quick-chip-news:hover {
	border-color: #f59e0b;
	box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.ai-quick-chip-url {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(15, 23, 42, 0.95) 100%);
	border-color: rgba(99, 102, 241, 0.45);
}
.ai-quick-chip-url .ai-chip-badge {
	background: rgba(99, 102, 241, 0.25);
	color: #818cf8;
	border-color: rgba(99, 102, 241, 0.5);
}
.ai-quick-chip-url:hover {
	border-color: #6366f1;
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

/* 5. THẺ ĐĂNG KÝ XÉT TUYỂN THÔNG MINH (SMART REGISTRATION CARD) */
.ai-smart-card {
	margin-top: 10px;
	background: linear-gradient(135deg, rgba(16, 28, 52, 0.95), rgba(9, 16, 33, 0.95));
	border: 1.5px solid #38bdf8;
	border-radius: 14px;
	padding: 14px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.25);
}

.ai-smart-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	border-bottom: 1px solid rgba(56, 189, 248, 0.2);
	padding-bottom: 8px;
}

.ai-smart-card-title {
	font-size: 0.86rem;
	font-weight: 700;
	color: #38bdf8;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ai-smart-card-badge {
	font-size: 0.65rem;
	padding: 2px 8px;
	border-radius: 12px;
	background: #10b981;
	color: #ffffff;
	font-weight: 700;
}

.ai-smart-fields {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ai-smart-field-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	font-size: 0.78rem;
}

.ai-smart-field-label {
	color: #94a3b8;
	font-weight: 600;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 5px;
}

.ai-smart-field-val {
	font-weight: 700;
	color: #f8fafc;
	text-align: right;
	word-break: break-word;
}

.ai-smart-card-actions {
	margin-top: 12px;
	display: flex;
	gap: 8px;
}

.ai-smart-btn-confirm {
	flex: 1;
	background: linear-gradient(135deg, #10b981, #059669);
	color: #ffffff;
	border: none;
	padding: 8px 14px;
	border-radius: 10px;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: all 0.2s ease;
}

.ai-smart-btn-confirm:hover {
	transform: scale(1.02);
	background: linear-gradient(135deg, #059669, #047857);
}

.ai-smart-btn-cancel {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #cbd5e1;
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 0.78rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ai-smart-btn-cancel:hover {
	background: rgba(239, 68, 68, 0.2);
	color: #f87171;
	border-color: rgba(239, 68, 68, 0.4);
}

/* 6. THẺ XEM TIN TỨC TRỰC TIẾP (NEWS CARD) */
.ai-news-card {
	margin-top: 8px;
	background: rgba(15, 23, 42, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 12px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	transition: all 0.2s ease;
}

.ai-news-card:hover {
	border-color: #38bdf8;
	background: rgba(30, 41, 59, 0.9);
}

.ai-news-card-title {
	font-size: 0.82rem;
	font-weight: 700;
	color: #38bdf8;
	line-height: 1.35;
}

.ai-news-card-excerpt {
	font-size: 0.74rem;
	color: #cbd5e1;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ai-news-card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.68rem;
	color: #94a3b8;
	margin-top: 4px;
}

.ai-news-card-btn {
	color: #f472b6;
	font-weight: 700;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.ai-news-card-btn:hover {
	text-decoration: underline;
}

/* 7. HIỆU ỨNG TYPING (AI ĐANG SUY NGHĨ) */
.ai-typing-indicator {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 10px 14px;
	background: rgba(20, 31, 53, 0.8);
	border-radius: 14px;
	border: 1px solid rgba(56, 189, 248, 0.2);
	width: fit-content;
}

.ai-typing-dot {
	width: 7px;
	height: 7px;
	background: #38bdf8;
	border-radius: 50%;
	animation: aiDotBounce 1.4s infinite ease-in-out;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes aiDotBounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1.1); opacity: 1; }
}

@keyframes aiFadeSlideUp {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* 8. KHUNG NHẬP LIỆU (FOOTER INPUT BAR) */
.ai-chat-footer {
	padding: 12px 14px;
	background: rgba(11, 18, 33, 0.95);
	border-top: 1px solid rgba(56, 189, 248, 0.2);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ai-chat-input-form {
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(18, 28, 50, 0.9);
	border: 1px solid rgba(56, 189, 248, 0.3);
	border-radius: 14px;
	padding: 4px 6px 4px 14px;
	transition: all 0.2s ease;
	min-height: 44px;
	box-sizing: border-box;
}

.ai-chat-input-form:focus-within {
	border-color: #38bdf8;
	box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.ai-chat-input {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: #ffffff;
	font-size: 0.88rem;
	line-height: 1.4;
	font-family: inherit;
	padding: 7px 0;
	resize: none;
	min-height: 34px;
	max-height: 80px;
	box-sizing: border-box;
	overflow-y: auto;
}

.ai-chat-input::placeholder {
	color: #94a3b8;
	font-size: 0.84rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ai-chat-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: linear-gradient(135deg, #0284c7, #2563eb);
	border: none;
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	transition: all 0.2s ease;
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.ai-chat-send-btn:hover {
	transform: scale(1.06);
	background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
}

.ai-chat-send-btn:active {
	transform: scale(0.94);
}

.ai-chat-footer-hint {
	font-size: 0.68rem;
	color: #64748b;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* 9. NÚT NỔI THU NHỎ / TỰ ĐỘNG MỞ NẾU CẦN */
.ai-chatbot-badge-notification {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #ef4444;
	color: #fff;
	font-size: 10px;
	font-weight: bold;
	border-radius: 50%;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1.5px solid #0f172a;
	animation: pulse 2s infinite;
}

/* 10. RESPONSIVE THIẾT BỊ DI ĐỘNG & BÀN PHÍM ẢO */
@media screen and (max-width: 768px) {
	/* Khóa cuộn background khi mở Chatbot để tránh giật lag khung nhìn */
	body.ai-chat-is-active {
		overflow: hidden !important;
		touch-action: none;
	}

	.ai-chatbot-popup {
		bottom: 12px;
		right: 12px;
		left: auto;
		width: min(390px, calc(100vw - 24px));
		max-width: calc(100vw - 24px);
		height: min(520px, 68dvh);
		max-height: 70dvh;
		border-radius: 20px;
		overscroll-behavior: contain;
		transition: height 0.16s ease-out, top 0.16s ease-out, transform 0.25s ease, opacity 0.25s ease;
	}

	@media screen and (max-width: 420px) {
		.ai-chatbot-popup {
			left: 10px;
			right: 10px;
			width: calc(100vw - 20px);
			max-width: calc(100vw - 20px);
			height: min(500px, 68dvh);
			max-height: 70dvh;
		}
	}

	/* Khi bàn phím ảo mở trên điện thoại: popup tự động co lại cân đối phía trên bàn phím */
	.ai-chatbot-popup.is-keyboard-open {
		border-radius: 14px;
		box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95), 0 0 25px rgba(14, 165, 233, 0.35);
	}

	.ai-chatbot-popup.is-minimized {
		height: 52px !important;
		border-radius: 14px;
		bottom: 10px;
	}

	.ai-chat-header {
		padding: 8px 12px;
		min-height: 46px;
	}

	.ai-chat-avatar-wrap {
		width: 34px;
		height: 34px;
	}

	.ai-chat-avatar {
		font-size: 16px;
	}

	.ai-chat-bot-desc {
		display: none;
	}

	.ai-chat-bot-name {
		font-size: 0.95rem;
	}

	.ai-chat-bot-badge {
		font-size: 0.62rem;
		padding: 2px 6px;
	}

	.ai-chat-btn-icon {
		width: 30px;
		height: 30px;
		font-size: 13px;
	}

	.ai-chat-body {
		padding: 10px 12px;
		gap: 10px;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.ai-msg-bubble {
		padding: 9px 12px;
		font-size: 0.82rem;
	}

	.ai-chat-quick-chips {
		gap: 6px;
		margin-top: 8px;
	}

	.ai-quick-chip {
		font-size: 0.74rem;
		padding: 6px 10px;
	}

	.ai-chat-footer {
		padding: 8px 10px;
		gap: 4px;
		background: rgba(11, 18, 33, 0.98);
	}

	.ai-chat-input-form {
		padding: 3px 6px 3px 12px;
		border-radius: 12px;
		min-height: 42px;
	}

	.ai-chat-input {
		font-size: 16px !important; /* Chuẩn 16px để ngăn iOS Safari auto-zoom gây biến dạng lệch khung hình */
		line-height: 1.35;
		min-height: 34px;
		max-height: 75px;
		padding: 6px 0;
	}

	.ai-chat-input::placeholder {
		font-size: 0.82rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.ai-chat-send-btn {
		width: 36px;
		height: 36px;
		border-radius: 9px;
		font-size: 15px;
	}

	/* Khi bàn phím đang mở: ẩn dòng hint bên dưới để tối đa hóa không gian nhìn tin nhắn */
	.ai-chatbot-popup.is-keyboard-open .ai-chat-footer-hint {
		display: none !important;
	}

	.ai-chat-footer-hint {
		font-size: 0.65rem;
		line-height: 1.25;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		padding: 0 4px;
		margin-top: 2px;
	}
}

