.savatech-ai-chat{position:fixed;left:24px;bottom:24px;right:auto;top:auto;z-index:999999;font-family:Arial,sans-serif}.st-ai-toggle{width:58px;height:58px;border:0;border-radius:50%;background:var(--st-ai-primary,#0b57d0);color:#fff;font-size:25px;cursor:pointer;box-shadow:0 5px 20px rgba(0,0,0,.2)}.st-ai-panel{display:none;width:360px;height:520px;background:#fff;border-radius:18px;box-shadow:0 12px 40px rgba(0,0,0,.22);overflow:hidden;margin-bottom:12px}.savatech-ai-chat.open .st-ai-panel{display:flex;flex-direction:column}.savatech-ai-chat.open .st-ai-toggle{display:none}.st-ai-header{background:var(--st-ai-primary,#0b57d0);color:#fff;padding:15px 16px;display:flex;justify-content:space-between;align-items:center}.st-ai-header strong{display:block;font-size:16px}.st-ai-header small{opacity:.85}.st-ai-close{border:0;background:transparent;color:#fff;font-size:28px;cursor:pointer}.st-ai-messages{flex:1;padding:14px;overflow:auto;background:#f6f7f9}.st-ai-msg{max-width:88%;padding:10px 12px;margin:8px 0;border-radius:14px;line-height:1.45;font-size:14px;white-space:pre-wrap}.st-ai-msg.bot{background:#fff;border:1px solid #e5e7eb;margin-right:auto}.st-ai-msg.user{background:var(--st-ai-primary,#0b57d0);color:#fff;margin-left:auto}.st-ai-msg.loading{opacity:.65}.st-ai-form{display:flex;padding:10px;border-top:1px solid #e5e7eb;background:#fff}.st-ai-input{flex:1;border:1px solid #d1d5db;border-radius:10px;padding:11px;outline:none;min-width:0}.st-ai-form button{margin-left:8px;width:44px;border:0;border-radius:10px;background:var(--st-ai-primary,#0b57d0);color:#fff;font-size:18px;cursor:pointer}@media(max-width:600px){.savatech-ai-chat{left:12px;bottom:12px;right:auto;top:auto}.st-ai-panel{width:calc(100vw - 24px);height:70vh;max-height:600px}}

.st-ai-link{color:inherit;text-decoration:underline;word-break:break-all}.st-ai-msg.bot .st-ai-link{color:var(--st-ai-primary,#0b57d0)}
.st-ai-link{color:var(--st-ai-primary,#0b57d0);text-decoration:underline;word-break:break-word}.st-ai-phone,.st-ai-email{font-weight:600}.st-ai-phone:before{content:'📞 ';}.st-ai-email:before{content:'✉️ ';}
.st-ai-category-link{font-weight:600;text-decoration:none}.st-ai-category-link:hover{text-decoration:underline}
.st-ai-source-link{color:var(--st-ai-primary,#0b57d0);font-weight:600;text-decoration:underline;word-break:break-word}.st-ai-source-link:hover{text-decoration:none}
.savatech-ai-chat.open .st-ai-toggle{display:none}

/* FIX 6.5.0 - VỊ TRÍ CHAT BOX DO ADMIN CHỌN + KÉO THẢ TỰ DO
   QUAN TRỌNG: tuyệt đối KHÔNG đặt !important lên left/right/top/bottom của
   .savatech-ai-chat ở đây. JS (chat.js) là nơi DUY NHẤT quyết định left/top
   qua inline style theo vị trí đã chọn trong Cài đặt AI hoặc theo vị trí
   khách vừa kéo thả. Một khai báo !important trên left/right/top/bottom tại
   CSS sẽ luôn thắng inline style thường của JS (dù style đó không important),
   khiến Chat Box không bao giờ di chuyển đúng vị trí đã cấu hình. */
.savatech-ai-chat{
  position:fixed !important;
  z-index:2147483647 !important;
  margin:0 !important;
  transform:none !important;
  pointer-events:auto !important;
  max-width:calc(100vw - 20px) !important;
}
.savatech-ai-chat .st-ai-panel{
  position:absolute !important;
  left:0 !important;
  top:0 !important;
  right:auto !important;
  bottom:auto !important;
  margin:0 !important;
  z-index:2147483647 !important;
  pointer-events:auto !important;
}
@media (max-width:768px){
  .savatech-ai-chat .st-ai-panel{
    width:min(calc(100vw - 24px),420px) !important;
    max-width:calc(100vw - 24px) !important;
  }
}
.savatech-ai-chat .st-ai-header,
.savatech-ai-chat .st-ai-title{
  width:100% !important;
  cursor:grab !important;
  user-select:none !important;
  -webkit-user-select:none !important;
  touch-action:none !important;
}
.savatech-ai-chat.st-ai-dragging,
.savatech-ai-chat.st-ai-dragging *{
  cursor:grabbing !important;
}

/* FIX 6.6.0 - ROBOT CHAT ICON WITH HEADSET */
.st-ai-toggle{
  width:60px !important;
  height:60px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:50% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow:0 7px 24px rgba(0,0,0,.28) !important;
  position:relative !important;
  overflow:visible !important;
  animation:st-ai-float 2.6s ease-in-out infinite;
}
.st-ai-robot-icon{width:42px;height:42px;display:block;position:relative;z-index:1}
.robot-shell{fill:#eaf2ff;stroke:#fff;stroke-width:2}
.robot-face{fill:var(--st-ai-primary,#0b57d0);stroke:#fff;stroke-width:2}
.robot-eye{fill:#fff}
.robot-mouth,.headband,.ear,.mic,.antenna{
  fill:none;stroke:#fff;stroke-width:3;
  stroke-linecap:round;stroke-linejoin:round;
}

/* Vòng phát sáng lan tỏa - giúp icon nổi bật, thu hút sự chú ý */
.st-ai-toggle-pulse{
  position:absolute;
  inset:-8px;
  border-radius:50%;
  background:var(--st-ai-primary,#0b57d0);
  opacity:.5;
  z-index:0;
  pointer-events:none;
  animation:st-ai-pulse 2.2s cubic-bezier(.4,0,.3,1) infinite;
}

/* Bong bóng "đang trả lời tin nhắn" với 3 chấm nhấp nháy, đặt ở góc trên bên phải icon */
.st-ai-toggle-bubble{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:22px;
  height:18px;
  padding:0 4px;
  border-radius:9px;
  background:#22c55e;
  border:2px solid #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:2px;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
  z-index:2;
}
.st-ai-toggle-bubble span{
  width:4px;
  height:4px;
  border-radius:50%;
  background:#fff;
  animation:st-ai-dot 1.2s ease-in-out infinite;
}
.st-ai-toggle-bubble span:nth-child(2){animation-delay:.15s}
.st-ai-toggle-bubble span:nth-child(3){animation-delay:.3s}

@keyframes st-ai-pulse{
  0%{transform:scale(.85);opacity:.55}
  70%{transform:scale(1.6);opacity:0}
  100%{transform:scale(1.6);opacity:0}
}
@keyframes st-ai-float{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-4px)}
}
@keyframes st-ai-dot{
  0%,60%,100%{transform:translateY(0);opacity:.5}
  30%{transform:translateY(-3px);opacity:1}
}

/* Ẩn hiệu ứng khi chat đang mở, và tôn trọng cài đặt giảm chuyển động của người dùng */
.savatech-ai-chat.open .st-ai-toggle-pulse,
.savatech-ai-chat.open .st-ai-toggle-bubble{display:none !important}
@media (prefers-reduced-motion:reduce){
  .st-ai-toggle,.st-ai-toggle-pulse,.st-ai-toggle-bubble span{animation:none !important}
}


/* ============================================================
   SAVATECH AI CHAT - BOTTOM RIGHT POSITION ONLY
   6.10.1
   Chỉ thay đổi vị trí. KHÔNG thay đổi icon/HTML/animation.
   ============================================================ */

/* Chat launcher + panel wrapper */
.savatech-ai-chat {
    position: fixed !important;
    right: 12px !important;
    bottom: 12px !important;
    left: auto !important;
    top: auto !important;
    z-index: 2147483647 !important;
    margin: 0 !important;
}

/* Panel mở phía trên icon, giữ nguyên toàn bộ giao diện/icon hiện có */
.savatech-ai-chat .st-ai-panel {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    bottom: calc(100% + 12px) !important;
    top: auto !important;
    margin: 0 !important;
    z-index: 2147483646 !important;
}

/* Không thay đổi kích thước, màu sắc hoặc nội dung icon hiện tại.
   Chỉ neo launcher vào góc phải dưới của wrapper. */
.savatech-ai-chat .st-ai-toggle {
    position: relative !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
}

/* Mobile: vẫn giữ góc phải dưới và chỉ điều chỉnh khoảng cách an toàn */
@media (max-width: 600px) {
    .savatech-ai-chat {
        right: 12px !important;
        bottom: 12px !important;
        left: auto !important;
        top: auto !important;
    }

    .savatech-ai-chat .st-ai-panel {
        right: 0 !important;
        left: auto !important;
        bottom: calc(100% + 10px) !important;
        top: auto !important;
        max-width: calc(100vw - 24px) !important;
    }
}


/* 6.10.2 - ONLY replace the Chat Box icon with the supplied robot SVG.
   Existing Chat Box position, behavior and other styling are preserved. */
.savatech-ai-chat .st-ai-toggle .st-ai-custom-robot-icon{
    width:48px !important;
    height:48px !important;
    display:block !important;
    flex:0 0 auto !important;
    pointer-events:none !important;
}


/* 6.10.3 - Robot icon transparent background
   Giữ nguyên SVG robot; chỉ bỏ nền tròn xanh của nút icon. */
.savatech-ai-chat .st-ai-toggle{
    background:transparent !important;
    box-shadow:none !important;
}

/* Nếu SVG có nền/khung ngoài do CSS cũ, không cho nút tạo thêm nền. */
.savatech-ai-chat .st-ai-toggle::before,
.savatech-ai-chat .st-ai-toggle::after{
    background:transparent !important;
}

/* Tiêu đề Chat Box gọn hơn nhưng vẫn giữ màu xanh dương */
.savatech-ai-chat .st-ai-header{
    background:var(--st-ai-primary,#0b57d0) !important;
    color:#fff !important;
    padding:10px 13px !important;
    min-height:48px !important;
    box-sizing:border-box !important;
}

.savatech-ai-chat .st-ai-header strong{
    font-size:15px !important;
    line-height:1.2 !important;
    margin:0 !important;
}

.savatech-ai-chat .st-ai-header small{
    font-size:11px !important;
    line-height:1.2 !important;
    margin-top:2px !important;
}

.savatech-ai-chat .st-ai-close{
    font-size:24px !important;
    line-height:1 !important;
    padding:0 2px !important;
}


/* 6.10.4 - Toggle Chat Box ONLY by clicking the robot icon.
   Không cần nút X. Giữ .st-ai-close trong DOM để tương thích JS cũ,
   nhưng ẩn hoàn toàn khỏi giao diện. */
.savatech-ai-chat .st-ai-close{
    display:none !important;
}

/* Khi Chat Box mở, icon robot vẫn phải nhìn thấy và bấm được.
   Không ẩn toggle nữa. */
.savatech-ai-chat.open .st-ai-toggle{
    display:flex !important;
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
}


/* 6.10.5 - ICON SIZE x2
   Tăng kích thước icon hiện tại lên gấp đôi.
   Không thay đổi SVG, màu sắc hay chức năng. */
.savatech-ai-chat .st-ai-toggle{
    width:120px !important;
    height:120px !important;
}

.savatech-ai-chat .st-ai-toggle .st-ai-custom-robot-icon{
    width:96px !important;
    height:96px !important;
}

/* ST_AI_TTS_CSS_6106 */
.savatech-ai-chat .st-ai-tts-toggle{border:0!important;background:transparent!important;color:#fff!important;width:30px!important;height:30px!important;padding:0!important;margin-right:6px!important;cursor:pointer!important;font-size:16px!important;line-height:30px!important}
.savatech-ai-chat .st-ai-tts-controls{border:0!important;background:transparent!important;padding:2px 4px!important;margin-left:4px!important;cursor:pointer!important;font-size:13px!important;opacity:.7!important}
.savatech-ai-chat .st-ai-tts-controls:hover{opacity:1!important}
