
@keyframes ai-btn-idle-ring {
  0% {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4),
                0 0 0 0 rgba(37, 99, 235, 0.5);
  }
  70% {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4),
                0 0 0 14px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4),
                0 0 0 0 rgba(37, 99, 235, 0);
  }
}
.ai-assistant-btn {
  animation: ai-btn-idle-ring 2.2s ease-out infinite;
}


@keyframes ai-btn-pop {
  0%, 100% { transform: scale(1); }
  20%      { transform: scale(1.35); }
  40%      { transform: scale(0.9); }
  60%      { transform: scale(1.25); }
  80%      { transform: scale(1.05); }
}
.ai-assistant-btn.ai-attention {
  animation:
    ai-btn-pop 1.3s ease-in-out 1,
    ai-btn-idle-ring 2.2s ease-out 1.4s infinite; 
}
.ai-assistant-btn.ai-attention::before,
.ai-assistant-btn.ai-attention::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 4px solid rgba(37, 99, 235, 0.65);
  opacity: 0;
  animation: ai-ring-pulse 1.6s ease-out 3;
  pointer-events: none;
}
.ai-assistant-btn.ai-attention::after {
  border-color: rgba(37, 99, 235, 0.4);
  animation-delay: 0.5s;
}
@keyframes ai-ring-pulse {
  0%   { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}


.ai-helper-bubble {
  position: fixed; 
  width: 230px;
  max-width: calc(100vw - 40px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 14px 16px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.6);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 1001;
  cursor: default;
}

.ai-helper-bubble::before {
  content: '';
  position: absolute;
  bottom: -5px;
  right: 22px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  transform: rotate(45deg);
  border-radius: 2px;
}
.ai-helper-bubble.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ai-bubble-text {
  margin: 0 0 10px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #151515;
  font-weight: 300;
  padding-right: 14px;
}
.ai-bubble-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  padding: 8px 16px;
  text-decoration: none;
  transition: background 0.3s ease;
}
.ai-bubble-btn:hover { background: #1d4ed8; }
.ai-bubble-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}
.ai-bubble-close:hover { color: #151515; }

@media (max-width: 480px) {
  .ai-helper-bubble {
    width: 210px;
    padding: 12px 14px;
  }
  .ai-bubble-text { font-size: 11px; }
  .ai-bubble-btn { font-size: 11px; padding: 7px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-assistant-btn,
  .ai-assistant-btn.ai-attention,
  .ai-assistant-btn.ai-attention::before,
  .ai-assistant-btn.ai-attention::after {
    animation: none !important;
  }
}