/* Chatbot Công Nghệ TLT – mọi class có tiền tố tltcb- để không đụng giao diện website */
#tltcb-root {
  --tltcb-brand: #0d3b8e; --tltcb-brand-2: #8224e3; --tltcb-accent: #c8202f;
  --tltcb-text: #222; --tltcb-muted: #667085; --tltcb-line: #e3e7ee; --tltcb-bot: #eef2f9;
  font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.5; color: var(--tltcb-text);
  --tltcb-side: right; --tltcb-bottom: 20px;
}
#tltcb-root *, #tltcb-root *::before, #tltcb-root *::after { box-sizing: border-box; }
/* Đặt lại kiểu nút / ô nhập để giao diện theme không làm vỡ khung chat */
#tltcb-root button, #tltcb-root input, #tltcb-root a.tltcb-opt {
  margin: 0; min-height: 0; height: auto; width: auto; line-height: 1.3; text-transform: none; letter-spacing: normal;
  font-family: inherit; font-weight: 400; box-shadow: none; text-shadow: none; vertical-align: middle; max-width: none;
}
#tltcb-root p, #tltcb-root ul, #tltcb-root li { margin: 0; padding: 0; font-size: 14px; line-height: 1.5; color: inherit; }
#tltcb-root [hidden] { display: none !important; }

#tltcb-root .tltcb-launcher {
  position: fixed; bottom: var(--tltcb-bottom); width: 60px; height: 60px; padding: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--tltcb-accent), var(--tltcb-brand)); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(13,59,142,.35); font-size: 27px; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
}
#tltcb-root .tltcb-dot { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; background: #12b76a; border: 2px solid #fff; border-radius: 50%; }
#tltcb-root .tltcb-teaser {
  position: fixed; bottom: calc(var(--tltcb-bottom) + 12px); background: #fff; border: 1px solid var(--tltcb-line); border-left: 4px solid var(--tltcb-accent);
  border-radius: 12px; padding: 10px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 2147482999; cursor: pointer; max-width: 250px;
}
#tltcb-root .tltcb-teaser-x { position: absolute; top: 2px; right: 6px; background: none; border: none; color: #999; cursor: pointer; font-size: 14px; padding: 0; }
#tltcb-root .tltcb-chat {
  position: fixed; bottom: calc(var(--tltcb-bottom) + 76px); width: 390px; max-width: calc(100vw - 32px); height: 620px; max-height: calc(100vh - var(--tltcb-bottom) - 100px);
  background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden; z-index: 2147483001; /* luôn nằm trên các nút nổi của giao diện (Zalo, Facebook, hotline...) */
}
#tltcb-root.tltcb-right .tltcb-launcher, #tltcb-root.tltcb-right .tltcb-chat { right: 20px; }
#tltcb-root.tltcb-right .tltcb-teaser { right: 92px; }
#tltcb-root.tltcb-left .tltcb-launcher, #tltcb-root.tltcb-left .tltcb-chat { left: 20px; }
#tltcb-root.tltcb-left .tltcb-teaser { left: 92px; }

#tltcb-root .tltcb-head { background: linear-gradient(135deg, var(--tltcb-accent), var(--tltcb-brand)); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
#tltcb-root .tltcb-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--tltcb-accent); font-weight: 900; font-style: italic; display: flex; align-items: center; justify-content: center; flex: none; font-size: 14px; }
#tltcb-root .tltcb-title { flex: 1; line-height: 1.25; min-width: 0; }
#tltcb-root .tltcb-title b { display: block; font-size: 15.5px; color: #fff; }
#tltcb-root .tltcb-title small { font-size: 11.5px; opacity: .9; color: #fff; }
#tltcb-root .tltcb-icon { background: transparent; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 4px 7px; border-radius: 6px; }
#tltcb-root .tltcb-icon:hover { background: rgba(255,255,255,.15); }

#tltcb-root .tltcb-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fafbfd; }
#tltcb-root .tltcb-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
#tltcb-root .tltcb-msg.tltcb-bot { background: var(--tltcb-bot); align-self: flex-start; border-bottom-left-radius: 4px; }
#tltcb-root .tltcb-msg.tltcb-bot b { color: var(--tltcb-brand); }
#tltcb-root .tltcb-msg.tltcb-bot a { color: var(--tltcb-accent); text-decoration: underline; }
#tltcb-root .tltcb-msg.tltcb-bot ul { margin: 4px 0; padding-left: 18px; list-style: disc; }
#tltcb-root .tltcb-msg.tltcb-bot li { margin: 0 0 2px; }
#tltcb-root .tltcb-msg.tltcb-bot p { margin: 0 0 6px; }
#tltcb-root .tltcb-msg.tltcb-bot p:last-child { margin: 0; }
#tltcb-root .tltcb-msg.tltcb-user { background: var(--tltcb-brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; white-space: pre-wrap; }
#tltcb-root .tltcb-msg.tltcb-ok { align-self: center; background: #e7f8ef; color: #067647; font-size: 13px; border-radius: 10px; max-width: 95%; }

#tltcb-root .tltcb-opts { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 95%; }
#tltcb-root .tltcb-opt { display: inline-block; border: 1px solid var(--tltcb-brand); color: var(--tltcb-brand); background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 13px; cursor: pointer; text-decoration: none; }
#tltcb-root .tltcb-opt:hover { background: #eaf0fb; }
#tltcb-root .tltcb-opt:disabled { opacity: .45; cursor: default; background: #fff; }
#tltcb-root .tltcb-opt.tltcb-call { background: var(--tltcb-accent); border-color: var(--tltcb-accent); color: #fff; }
#tltcb-root .tltcb-opt.tltcb-zalo { background: #0068ff; border-color: #0068ff; color: #fff; }
#tltcb-root .tltcb-typing { display: inline-flex; gap: 4px; }
#tltcb-root .tltcb-typing i { width: 6px; height: 6px; background: #98a2b3; border-radius: 50%; animation: tltcb-blink 1.2s infinite; }
#tltcb-root .tltcb-typing i:nth-child(2) { animation-delay: .2s; }
#tltcb-root .tltcb-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes tltcb-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

#tltcb-root .tltcb-menu { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--tltcb-line); background: #fff; overflow-x: auto; flex: none; }
#tltcb-root .tltcb-menu .tltcb-opt { white-space: nowrap; font-size: 12.5px; }
#tltcb-root .tltcb-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--tltcb-line); background: #fff; margin: 0; flex: none; }
#tltcb-root .tltcb-input { flex: 1; border: 1px solid var(--tltcb-line); border-radius: 10px; padding: 10px; font-size: 14px; background: #fff; color: var(--tltcb-text); }
#tltcb-root .tltcb-input:focus { outline: 2px solid #c3d3f2; border-color: var(--tltcb-brand); }
#tltcb-root .tltcb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
#tltcb-root .tltcb-send { background: linear-gradient(135deg, var(--tltcb-accent), var(--tltcb-brand)); color: #fff; border: none; border-radius: 10px; padding: 0 16px; cursor: pointer; font-weight: 600; }

/* Điện thoại / máy tính bảng: khi đang mở khung chat thì ẩn tạm các nút nổi của giao diện
   (Zalo Chat, Facebook, số hotline ở góc trái) để không đè lên ô nhập câu hỏi. Đóng chat là hiện lại. */
@media (max-width: 768px) {
  html.tltcb-open .hotline-fixed, html.tltcb-open .callus, html.tltcb-open #top-link { display: none !important; }
}

@media (max-width: 480px) {
  /* Cỡ chữ 16px để iPhone không tự phóng to trang khi bấm vào ô nhập */
  #tltcb-root .tltcb-input { font-size: 16px; }
  #tltcb-root.tltcb-right .tltcb-chat, #tltcb-root.tltcb-left .tltcb-chat { left: 8px; right: 8px; width: auto; max-width: none; height: calc(100vh - var(--tltcb-bottom) - 96px); }
  #tltcb-root .tltcb-teaser { display: none !important; }
  #tltcb-root.tltcb-right .tltcb-launcher { right: 14px; }
  #tltcb-root.tltcb-left .tltcb-launcher { left: 14px; }
}
