/**
 * STYLESHEET TRỢ LÝ ẢO AI HÀNH CHÍNH CÔNG (HCCLD -> PHONGDOANH)
 * Hỗ trợ:
 * 1. Banner Trợ lý ảo AI trên Trang chủ (index.html)
 * 2. Khung chat nổi góc phải màn hình (Floating Widget)
 * 3. Trang Trợ lý ảo toàn màn hình (tro-ly.html / /tro-ly)
 */

/* =========================================================
   1. BANNER TRỢ LÝ ẢO TRÊN TRANG CHỦ (INDEX.HTML)
   ========================================================= */
.home-ai-section {
  margin-top: 26px;
  margin-bottom: 12px;
}

.home-ai-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #650f0f 0%, #8b1616 52%, #741b1b 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 18px 40px rgba(127, 29, 29, 0.22);
  padding: 26px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  color: #ffffff;
}

.home-ai-card .home-ai-drum {
  position: absolute;
  right: -70px;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: 420px;
  opacity: 0.08;
  pointer-events: none;
  animation: tlaDrumRotate 80s linear infinite;
}

@keyframes tlaDrumRotate {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.home-ai-avatar-card {
  position: relative;
  width: 176px;
  height: 206px;
  border-radius: 18px;
  border: 2px solid rgba(251, 191, 36, 0.65);
  background: radial-gradient(circle at 50% 35%, #1e3a8a 0%, #172554 55%, #0f172a 100%);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-ai-avatar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
}

.home-ai-avatar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, rgba(251, 191, 36, 0.22), transparent 65%);
  pointer-events: none;
}

.home-ai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 12px;
  padding: 10px 10px 34px 10px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  animation: tlaMascotFloat 3.6s ease-in-out infinite;
}

@keyframes tlaMascotFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.home-ai-avatar-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 8px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.55) 65%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
}

.tla-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
  display: inline-block;
  flex-shrink: 0;
}

.home-ai-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.home-ai-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.home-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde047;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.home-ai-fullscreen-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fde047;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.2s ease;
}

.home-ai-fullscreen-link:hover {
  background: rgba(251, 191, 36, 0.25);
  border-color: #fde047;
  color: #ffffff;
}

.home-ai-title {
  font-size: 25px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
  line-height: 1.28;
}

.home-ai-desc {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 0 16px 0;
  line-height: 1.55;
  max-width: 780px;
}

.home-ai-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.home-ai-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-ai-input {
  flex: 1;
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-ai-input:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.35);
}

.home-ai-submit-btn {
  height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #fbbf24 0%, #eab308 100%);
  color: #422006;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(234, 179, 8, 0.35);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.home-ai-submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.home-ai-quick-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.home-ai-quick-tag {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.home-ai-quick-tag:hover {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #422006;
}

/* =========================================================
   2. KHUNG CHAT NỔI GÓC PHẢI (FLOATING WIDGET)
   ========================================================= */
.tla-floating-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Nút mở khi thu nhỏ */
.tla-launcher-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  border: 2px solid #fbbf24;
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(153, 27, 27, 0.42);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.tla-launcher-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 40px rgba(153, 27, 27, 0.55);
}

.tla-launcher-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #1e3a8a, #0f172a);
  border: 2px solid #fde047;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tla-launcher-avatar img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.tla-launcher-text {
  text-align: left;
  line-height: 1.25;
}

.tla-launcher-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #fde047;
  display: block;
}

.tla-launcher-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

/* Hộp thoại nổi khi mở */
.tla-widget-card {
  width: 385px;
  max-width: calc(100vw - 24px);
  height: 590px;
  max-height: calc(100vh - 32px);
  background: #ffffff;
  border-radius: 22px;
  border: 2.5px solid #991b1b;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: tlaPopUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tlaPopUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tla-hidden {
  display: none !important;
}

/* Phần Header Hình ảnh Linh vật / Trợ lý ảo (Giống hệt ảnh mẫu 2) */
.tla-widget-stage {
  position: relative;
  height: 192px;
  flex-shrink: 0;
  background: radial-gradient(circle at 50% 35%, #1e3a8a 0%, #172554 52%, #450a0a 100%);
  overflow: hidden;
  border-bottom: 2px solid rgba(251, 191, 36, 0.45);
}

.tla-widget-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 25%, rgba(251, 191, 36, 0.2), transparent 60%),
    linear-gradient(180deg, rgba(153, 27, 27, 0.25) 0%, rgba(15, 23, 42, 0.78) 100%);
  pointer-events: none;
}

.tla-stage-drum {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  opacity: 0.12;
  pointer-events: none;
}

.tla-stage-mascot {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 8px;
  padding: 8px 16px 36px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s ease;
  animation: tlaMascotFloat 3.6s ease-in-out infinite;
}

.tla-stage-mascot.tla-speaking {
  animation: tlaMascotSpeak 0.65s ease-in-out infinite alternate;
}

@keyframes tlaMascotSpeak {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-4px) scale(1.03); }
}

/* 3 nút điều khiển góc phải trên: Loa, Toàn màn hình, Đóng */
.tla-stage-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tla-ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.tla-ctrl-btn:hover {
  background: #991b1b;
  border-color: #fde047;
  color: #fde047;
}

.tla-ctrl-btn.is-muted {
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

.tla-ctrl-btn svg {
  width: 15px;
  height: 15px;
}

/* Nhãn tên & trạng thái góc trái dưới của Stage */
.tla-stage-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 24px 14px 10px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.55) 65%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.tla-stage-name {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.tla-stage-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #dcfce7;
  margin-top: 3px;
}

/* Thân khung chat */
.tla-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.tla-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.tla-msg-row.is-user {
  justify-content: flex-end;
}

.tla-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #1e3a8a, #0f172a);
  border: 1.5px solid #f59e0b;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.tla-msg-avatar img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.tla-msg-bubble {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.tla-msg-row.is-bot .tla-msg-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 6px;
}

.tla-msg-row.is-user .tla-msg-bubble {
  background: #991b1b;
  color: #ffffff;
  font-weight: 500;
  border-top-right-radius: 6px;
}

.tla-msg-sender {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #991b1b;
  margin-bottom: 4px;
}

.tla-msg-speak-btn {
  border: none;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tla-msg-speak-btn:hover {
  background: #fee2e2;
}

/* Nội dung HTML giàu định dạng trong câu trả lời FAQ HCCLD */
.tla-rich-content p,
.tla-rich-content div {
  margin-bottom: 4px;
}

.tla-rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 8px 0;
  border: 1px solid #e2e8f0;
  cursor: zoom-in;
}

.tla-rich-content a {
  color: #b91c1c;
  font-weight: 700;
  text-decoration: underline;
}

.tla-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #ea580c;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.tla-link-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* Các bước hướng dẫn tiếp theo (continuations) từ HCCLD */
.tla-continuation-step {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.tla-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tla-next-step-btn {
  padding: 7px 13px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
  transition: all 0.18s ease;
}

.tla-next-step-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.tla-stop-step-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tla-stop-step-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* Danh sách lựa chọn thủ tục gần giống */
.tla-choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.tla-choice-btn {
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tla-choice-btn.is-best {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}

.tla-choice-btn:hover {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

/* Các câu hỏi gợi ý nhanh trong khung chat (Giống hệt ảnh mẫu) */
.tla-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 38px;
}

.tla-quick-pill {
  border: 1px solid #fecaca;
  background: #fffafa;
  color: #991b1b;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.tla-quick-pill:hover {
  background: #991b1b;
  border-color: #991b1b;
  color: #ffffff;
}

/* Khung gợi ý Autocomplete khi gõ */
.tla-suggestions-dropdown {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 6px);
  max-height: 230px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #fecaca;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  padding: 6px;
  z-index: 30;
}

.tla-sug-header {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: #fef2f2;
  font-size: 11px;
  font-weight: 700;
  color: #991b1b;
}

.tla-sug-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 9px;
  border-radius: 9px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: #1e293b;
  transition: background 0.15s ease;
}

.tla-sug-item:hover {
  background: #fef2f2;
  color: #991b1b;
}

.tla-sug-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.tla-sug-item.is-top .tla-sug-num {
  background: #dc2626;
  color: #ffffff;
}

/* Chân khung chat (Ô nhập + Mic + Gửi) */
.tla-chat-footer {
  position: relative;
  padding: 10px 12px 8px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.tla-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tla-input-group:focus-within {
  border-color: #991b1b;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.1);
}

.tla-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: #0f172a;
  outline: none;
  min-width: 0;
}

.tla-mic-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tla-mic-btn:hover {
  background: #f1f5f9;
  color: #991b1b;
}

.tla-mic-btn.is-listening {
  background: #fee2e2;
  color: #dc2626;
  animation: tlaPulseMic 1s infinite;
}

@keyframes tlaPulseMic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.tla-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #991b1b;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease;
}

.tla-send-btn:hover {
  background: #7f1d1d;
  transform: scale(1.04);
}

.tla-send-btn svg,
.tla-mic-btn svg {
  width: 16px;
  height: 16px;
}

.tla-disclaimer {
  text-align: center;
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 6px;
}

/* =========================================================
   3. TRANG TOÀN MÀN HÌNH (TRO-LY.HTML / /TRO-LY)
   ========================================================= */
.tla-page-main {
  background: #fdf8f3;
  min-height: calc(100vh - 220px);
  padding: 28px 0 56px;
}

.tla-fs-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: stretch;
}

/* Cột trái: Thẻ hình ảnh Trợ lý ảo lớn (Giống hệt ảnh mẫu 1) */
.tla-fs-visual-card {
  position: relative;
  height: 640px;
  border-radius: 24px;
  border: 3px solid #991b1b;
  background: radial-gradient(circle at 50% 32%, #1e3a8a 0%, #172554 55%, #450a0a 100%);
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(153, 27, 27, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tla-fs-visual-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 25%, rgba(251, 191, 36, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(153, 27, 27, 0.18) 0%, rgba(15, 23, 42, 0.88) 100%);
  pointer-events: none;
}

.tla-fs-drum {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 420px;
  opacity: 0.11;
  pointer-events: none;
  animation: tlaDrumRotateFs 90s linear infinite;
}

@keyframes tlaDrumRotateFs {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.tla-fs-top-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  gap: 8px;
}

.tla-fs-top-actions .tla-ctrl-btn {
  width: 40px;
  height: 40px;
}

.tla-fs-top-actions .tla-ctrl-btn svg {
  width: 18px;
  height: 18px;
}

.tla-fs-mascot-wrap {
  position: absolute;
  inset: 0 0 110px 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tla-fs-mascot-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.5));
  animation: tlaMascotFloat 3.6s ease-in-out infinite;
  transition: all 0.3s ease;
}

.tla-fs-visual-Overlay {
  position: relative;
  z-index: 4;
  padding: 36px 22px 20px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.72) 68%, transparent 100%);
  color: #ffffff;
}

.tla-fs-badge-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fbbf24;
  margin-bottom: 4px;
}

.tla-fs-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.tla-fs-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
}

.tla-fs-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #dcfce7;
  font-size: 12px;
  font-weight: 700;
}

/* Cột phải: Khung trò chuyện lớn */
.tla-fs-chat-card {
  height: 640px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tla-fs-chat-header {
  padding: 16px 22px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
}

.tla-fs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tla-fs-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tla-fs-header-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.tla-fs-header-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.tla-fs-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tla-fs-action-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: all 0.16s ease;
}

.tla-fs-action-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.tla-fs-chat-card .tla-chat-body {
  padding: 20px 22px;
  gap: 14px;
}

.tla-fs-chat-card .tla-msg-bubble {
  max-width: 78%;
  font-size: 14px;
  padding: 12px 16px;
}

.tla-fs-chat-card .tla-chat-footer {
  padding: 14px 22px 12px;
}

.tla-fs-chat-card .tla-input-group {
  padding: 6px 8px 6px 18px;
}

/* Lightbox xem ảnh hướng dẫn phóng to */
.tla-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tla-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  background: #ffffff;
}

.tla-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 992px) {
  .tla-fs-grid {
    grid-template-columns: 1fr;
  }
  .tla-fs-visual-card {
    height: 300px;
  }
  .tla-fs-mascot-wrap {
    inset: 0 0 85px 0;
  }
  .tla-fs-chat-card {
    height: 560px;
  }
}

@media (max-width: 768px) {
  .home-ai-card {
    flex-direction: column;
    text-align: center;
    padding: 22px 18px;
    gap: 18px;
  }
  .home-ai-badge-row {
    justify-content: center;
  }
  .home-ai-search-bar {
    flex-direction: column;
  }
  .home-ai-input,
  .home-ai-submit-btn {
    width: 100%;
    justify-content: center;
  }
  .home-ai-quick-tags {
    justify-content: center;
  }
  .tla-floating-root {
    right: 12px;
    bottom: 12px;
  }
  .tla-widget-card {
    width: calc(100vw - 24px);
    height: calc(100vh - 80px);
  }
}
