.fu-ai-root {
  position: fixed;
  z-index: 99990;
  right: 16px;
  bottom: 24px;
  left: auto;
  top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  --fu-ai-fab: 52px;
}

.fu-ai-root.pos-left-bottom,
.fu-ai-root.edge-left {
  left: 16px;
  right: auto;
}

.fu-ai-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 2;
}
.fu-ai-dock:has(.fu-backtop-fab.is-show) {
  gap: 8px;
}

.fu-ai-toggle {
  width: var(--fu-ai-fab);
  height: var(--fu-ai-fab);
  border: 1px solid #e8edf3;
  border-radius: 10px;
  background: #fff;
  color: var(--fu-ai-color, #2563eb);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform .18s ease, box-shadow .18s ease;
  box-sizing: border-box;
}

.fu-ai-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

.fu-ai-toggle-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
}

.fu-ai-toggle-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--fu-ai-color, #2563eb);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fu-ai-toggle-text { display: none; }

button.fu-backtop-fab,
#fuBackTopFab.fu-backtop-fab {
  --fu-backtop-size: 40px;
  width: var(--fu-backtop-size) !important;
  height: var(--fu-backtop-size) !important;
  min-width: var(--fu-backtop-size) !important;
  min-height: var(--fu-backtop-size) !important;
  max-width: var(--fu-backtop-size) !important;
  max-height: var(--fu-backtop-size) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #e8edf3 !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #4b5563 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08) !important;
  display: grid !important;
  place-items: center !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, box-shadow .15s ease;
  cursor: pointer;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  overflow: hidden !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  z-index: 99989;
}

.fu-ai-root button.fu-backtop-fab,
.fu-ai-root #fuBackTopFab.fu-backtop-fab {
  position: relative !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  bottom: auto !important;
  order: 2;
}
.fu-ai-root .fu-ai-toggle {
  order: 1;
}

button.fu-backtop-fab.is-solo,
#fuBackTopFab.fu-backtop-fab.is-solo {
  position: fixed !important;
  right: 16px !important;
  left: auto !important;
  top: auto !important;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
}

button.fu-backtop-fab.is-show,
#fuBackTopFab.fu-backtop-fab.is-show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  height: var(--fu-backtop-size, 40px) !important;
  min-height: var(--fu-backtop-size, 40px) !important;
  max-height: var(--fu-backtop-size, 40px) !important;
  margin-bottom: 0 !important;
}

.fu-ai-root button.fu-backtop-fab:not(.is-show),
.fu-ai-root #fuBackTopFab.fu-backtop-fab:not(.is-show) {
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: none !important;
  transform: none !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

button.fu-backtop-fab:hover,
#fuBackTopFab.fu-backtop-fab:hover {
  background: #fff !important;
  color: #1f2937 !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12) !important;
}

button.fu-backtop-fab svg,
#fuBackTopFab.fu-backtop-fab svg {
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.fu-ai-root:has(.fu-backtop-fab.is-show) .fu-ai-panel {
  bottom: calc(var(--fu-backtop-size, 40px) + 8px);
}

.fu-ai-panel {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 0;
  width: 0;
  height: min(var(--fu-ai-h, 480px), calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  opacity: 0;
  pointer-events: none;
  transition: width .28s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
  z-index: 1;
}

.fu-ai-root.edge-left .fu-ai-panel,
.fu-ai-root.pos-left-bottom .fu-ai-panel {
  left: calc(100% + 10px);
  right: auto;
}

.fu-ai-root.open .fu-ai-panel {
  width: min(var(--fu-ai-w, 360px), calc(100vw - 80px));
  opacity: 1;
  pointer-events: auto;
}

.fu-ai-head {
  padding: 14px 16px;
  background: var(--fu-ai-color, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.fu-ai-head button {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}

.fu-ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
  min-height: 0;
}

.fu-ai-msg {
  margin-bottom: 10px;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.fu-ai-msg.bot { background: #fff; border: 1px solid #e2e8f0; color: #1e293b; }
.fu-ai-msg.user { background: var(--fu-ai-color, #2563eb); color: #fff; margin-left: auto; }

.fu-ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 8px;
  flex-shrink: 0;
}

.fu-ai-quick button {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.fu-ai-foot {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}

.fu-ai-foot input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.fu-ai-foot input:focus { border-color: var(--fu-ai-color, #2563eb); }

.fu-ai-foot button {
  border: none;
  background: var(--fu-ai-color, #2563eb);
  color: #fff;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.fu-ai-products { margin-top: 8px; }
.fu-ai-products a {
  display: block;
  padding: 8px 10px;
  background: #eff6ff;
  border-radius: 8px;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 12px;
  margin-top: 4px;
}

@media (max-width: 768px){
  .fu-ai-root {
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0));
    gap: 6px;
    --fu-ai-fab: 40px;
  }
  body.fu-has-tabbar .fu-ai-root {
    bottom: calc(56px + 10px + env(safe-area-inset-bottom, 0));
  }
  
  body.fu-has-tabbar:has(.fu-cart-cats-bar) .fu-ai-root {
    bottom: calc(56px + var(--fu-cart-cats-h, 52px) + 8px + env(safe-area-inset-bottom, 0)) !important;
  }
  
  body.fu-has-tabbar:has(.type_configureproduct) .fu-ai-root {
    bottom: calc(56px + 72px + 8px + env(safe-area-inset-bottom, 0)) !important;
  }
  
  body.fu-has-tabbar:has(.fu-viewcart-footer) .fu-ai-root,
  body.fu-has-tabbar:has(.fu-viewcart-page) .fu-ai-root {
    bottom: calc(56px + 72px + 10px + env(safe-area-inset-bottom, 0)) !important;
  }
  body:not(.fu-has-tabbar):has(.fu-viewcart-footer) .fu-ai-root,
  body:not(.fu-has-tabbar):has(.fu-viewcart-page) .fu-ai-root {
    bottom: calc(72px + 10px + env(safe-area-inset-bottom, 0)) !important;
  }
  body:not(.fu-has-tabbar):has(.fu-cart-cats-bar) .fu-ai-root {
    bottom: calc(var(--fu-cart-cats-h, 52px) + 8px + env(safe-area-inset-bottom, 0)) !important;
  }
  body:not(.fu-has-tabbar):has(.type_configureproduct) .fu-ai-root {
    bottom: calc(72px + 8px + env(safe-area-inset-bottom, 0)) !important;
  }
  .fu-ai-toggle {
    border-radius: 8px !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .08) !important;
  }
  .fu-ai-toggle-icon {
    width: 26px !important;
    height: 26px !important;
    border-radius: 6px !important;
  }
  .fu-ai-toggle-icon svg {
    width: 15px !important;
    height: 15px !important;
  }
  .fu-ai-dock:has(.fu-backtop-fab.is-show) {
    gap: 6px;
  }
  button.fu-backtop-fab,
  #fuBackTopFab.fu-backtop-fab {
    --fu-backtop-size: 36px;
    border-radius: 50% !important;
  }
  .fu-ai-root button.fu-backtop-fab.is-show,
  .fu-ai-root #fuBackTopFab.fu-backtop-fab.is-show {
    height: var(--fu-backtop-size) !important;
    min-height: var(--fu-backtop-size) !important;
    max-height: var(--fu-backtop-size) !important;
  }
  button.fu-backtop-fab.is-solo,
  #fuBackTopFab.fu-backtop-fab.is-solo {
    right: 10px !important;
    left: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0)) !important;
  }
  body.fu-has-tabbar button.fu-backtop-fab.is-solo,
  body.fu-has-tabbar #fuBackTopFab.fu-backtop-fab.is-solo {
    bottom: calc(56px + 10px + env(safe-area-inset-bottom, 0)) !important;
  }
  
  body:has(.fu-viewcart-footer) button.fu-backtop-fab.is-solo,
  body:has(.fu-viewcart-footer) #fuBackTopFab.fu-backtop-fab.is-solo,
  body:has(.fu-viewcart-page) button.fu-backtop-fab.is-solo,
  body:has(.fu-viewcart-page) #fuBackTopFab.fu-backtop-fab.is-solo {
    bottom: calc(72px + 12px + env(safe-area-inset-bottom, 0)) !important;
  }
  body.fu-has-tabbar:has(.fu-viewcart-footer) button.fu-backtop-fab.is-solo,
  body.fu-has-tabbar:has(.fu-viewcart-footer) #fuBackTopFab.fu-backtop-fab.is-solo,
  body.fu-has-tabbar:has(.fu-viewcart-page) button.fu-backtop-fab.is-solo,
  body.fu-has-tabbar:has(.fu-viewcart-page) #fuBackTopFab.fu-backtop-fab.is-solo {
    bottom: calc(56px + 72px + 12px + env(safe-area-inset-bottom, 0)) !important;
  }
  .fu-ai-root.open .fu-ai-panel {
    width: min(300px, calc(100vw - 56px));
    height: min(420px, calc(100vh - 140px));
    border-radius: 12px;
  }
  .fu-ai-head {
    padding: 10px 12px !important;
    font-size: 14px !important;
  }
  .fu-ai-body {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
  .fu-ai-foot {
    padding: 8px 10px !important;
  }
  .fu-ai-foot input {
    height: 34px !important;
    font-size: 13px !important;
  }
  .fu-ai-foot button {
    height: 34px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
  }
}

.pls-back2top,#tthetop{display:none!important}
