/* Trợ lý QS Crystal — khung chat. Màu lấy theo màu chính của giao diện (Flatsome #446084). */
#qstl {
  --qstl-ac: #446084; --qstl-ac-dk: #33496a; --qstl-bg: #ffffff; --qstl-mu: #f3f5f8;
  --qstl-tx: #1d2430; --qstl-tx2: #5b6573; --qstl-bd: #dfe3ea; --qstl-ok: #1f7a4d;
  font-family: Roboto, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; color: var(--qstl-tx);
}
#qstl *, #qstl *::before, #qstl *::after { box-sizing: border-box; }
#top-link.back-to-top { bottom: 92px !important; }

#qstl .qstl-mo {
  position: fixed; right: 20px; bottom: 20px; z-index: 99998;
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 14px;
  border: 0; border-radius: 26px; background: var(--qstl-ac); color: #fff; cursor: pointer;
  font: 500 15px/1 Roboto, "Segoe UI", Arial, sans-serif; box-shadow: 0 6px 20px rgba(20, 35, 60, .25);
}
#qstl .qstl-mo:hover { background: var(--qstl-ac-dk); }
#qstl .qstl-mo:focus-visible, #qstl button:focus-visible, #qstl a:focus-visible, #qstl input:focus-visible, #qstl textarea:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
#qstl .qstl-mo svg { width: 22px; height: 22px; flex: none; }
#qstl.mo .qstl-mo { display: none; }

#qstl .qstl-khung {
  position: fixed; right: 20px; bottom: 20px; z-index: 99999; display: none; flex-direction: column;
  width: 380px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 40px);
  background: var(--qstl-bg); border: 1px solid var(--qstl-bd); border-radius: 14px; overflow: hidden;
  box-shadow: 0 16px 48px rgba(20, 35, 60, .28);
}
#qstl.mo .qstl-khung { display: flex; }
#qstl .qstl-dau { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--qstl-ac); color: #fff; }
#qstl .qstl-dau b { display: block; font-size: 15px; }
#qstl .qstl-dau small { display: block; font-size: 12px; opacity: .85; }
#qstl .qstl-dau .qstl-dong { margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
#qstl .qstl-dau .qstl-dong:hover { background: rgba(255, 255, 255, .15); }
#qstl .qstl-tat { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--qstl-bd); background: var(--qstl-mu); }
#qstl .qstl-tat a { flex: 1; white-space: nowrap; text-align: center; padding: 6px 4px; border: 1px solid var(--qstl-bd); border-radius: 8px; background: #fff; color: var(--qstl-ac); font-size: 13px; font-weight: 500; text-decoration: none; }
#qstl .qstl-tat a:hover { border-color: var(--qstl-ac); }

#qstl .qstl-tin { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
#qstl .qstl-b { max-width: 86%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
#qstl .qstl-b.tl { align-self: flex-start; background: var(--qstl-mu); border-top-left-radius: 4px; }
#qstl .qstl-b.kh { align-self: flex-end; background: var(--qstl-ac); color: #fff; border-top-right-radius: 4px; }
#qstl .qstl-nut { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
#qstl .qstl-nut a, #qstl .qstl-nut button, #qstl .qstl-goi button {
  padding: 6px 10px; border: 1px solid var(--qstl-ac); border-radius: 16px; background: #fff; color: var(--qstl-ac);
  font: 500 13px/1.3 Roboto, "Segoe UI", Arial, sans-serif; text-decoration: none; cursor: pointer; text-align: left;
}
#qstl .qstl-nut a:hover, #qstl .qstl-nut button:hover, #qstl .qstl-goi button:hover { background: var(--qstl-ac); color: #fff; }
#qstl .qstl-goi { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }
#qstl .qstl-goi span { font-size: 12px; color: var(--qstl-tx2); }
#qstl .qstl-dang { align-self: flex-start; color: var(--qstl-tx2); font-size: 13px; }
#qstl .qstl-dang i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--qstl-tx2); animation: qstl-n 1s infinite ease-in-out; }
#qstl .qstl-dang i:nth-child(2) { animation-delay: .15s; } #qstl .qstl-dang i:nth-child(3) { animation-delay: .3s; }
@keyframes qstl-n { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #qstl .qstl-dang i { animation: none; } }

#qstl form.qstl-lh { align-self: stretch; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--qstl-bd); border-radius: 10px; background: #fff; }
#qstl form.qstl-lh input[type=text], #qstl form.qstl-lh input[type=tel], #qstl form.qstl-lh input[type=email], #qstl form.qstl-lh textarea {
  width: 100%; margin: 0; padding: 7px 9px; border: 1px solid var(--qstl-bd); border-radius: 8px; font: 14px/1.4 Roboto, Arial, sans-serif; color: var(--qstl-tx); background: #fff; box-shadow: none; height: auto;
}
#qstl form.qstl-lh label.qstl-dy { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--qstl-tx2); }
#qstl form.qstl-lh label.qstl-dy input { margin: 3px 0 0; }
#qstl form.qstl-lh .qstl-hp { position: absolute; left: -9999px; }
#qstl form.qstl-lh button { align-self: flex-start; padding: 7px 14px; border: 0; border-radius: 8px; background: var(--qstl-ac); color: #fff; font-weight: 500; cursor: pointer; }
#qstl form.qstl-lh .qstl-loi { color: #b3261e; font-size: 12px; }

#qstl .qstl-nhap { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--qstl-bd); }
#qstl .qstl-nhap textarea { flex: 1; resize: none; height: 42px; max-height: 110px; margin: 0; padding: 10px 12px; border: 1px solid var(--qstl-bd); border-radius: 10px; font: 14px/1.4 Roboto, Arial, sans-serif; color: var(--qstl-tx); box-shadow: none; }
#qstl .qstl-nhap textarea:focus, #qstl form.qstl-lh input:focus, #qstl form.qstl-lh textarea:focus { outline: none !important; border-color: var(--qstl-ac); box-shadow: 0 0 0 2px rgba(68, 96, 132, .2); }
#qstl .qstl-nhap button { width: 44px; height: 42px; border: 0; border-radius: 10px; background: var(--qstl-ac); color: #fff; cursor: pointer; }
#qstl .qstl-nhap button:disabled { opacity: .5; cursor: default; }
#qstl .qstl-nhap button svg { width: 18px; height: 18px; }
#qstl .qstl-chan { padding: 0 12px 8px; font-size: 11px; color: var(--qstl-tx2); }

@media (max-width: 480px) {
  #qstl .qstl-khung { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
  #qstl .qstl-mo { right: 16px; bottom: 16px; }
  #qstl .qstl-mo span { display: none; }
  #qstl .qstl-mo { width: 52px; padding: 0; justify-content: center; }
}

/* Chặn kiểu của giao diện (Flatsome viết hoa nút, đặt chiều cao ô nhập…) */
#qstl button, #qstl input, #qstl textarea, #qstl a { text-transform: none; letter-spacing: normal; min-height: 0; margin: 0; text-shadow: none; }
#qstl .qstl-nhap textarea { min-height: 0 !important; height: 42px; line-height: 1.4; }
#qstl form.qstl-lh textarea { min-height: 0 !important; height: auto; }
#qstl form.qstl-lh input[type=text], #qstl form.qstl-lh input[type=tel], #qstl form.qstl-lh input[type=email] { height: 36px; }
#qstl .qstl-nut a, #qstl .qstl-nut button, #qstl .qstl-goi button { line-height: 1.3 !important; min-height: 0 !important; font-size: 13px !important; }
#qstl .qstl-nhap button { padding: 0 !important; line-height: 1 !important; display: flex; align-items: center; justify-content: center; }
#qstl .qstl-mo { margin: 0 !important; min-height: 0 !important; text-transform: none !important; }
#qstl form.qstl-lh label.qstl-dy, #qstl form.qstl-lh label.qstl-dy span { font-weight: 400 !important; font-size: 12px !important; line-height: 1.45; }
#qstl form.qstl-lh button { padding: 7px 16px !important; line-height: 1.3 !important; }
