#helpbot-btn {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 1000;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: var(--bg, #0b0f19);
  box-shadow: 0 4px 24px rgba(34,211,238,.25), 0 0 0 4px rgba(34,211,238,.10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
#helpbot-btn:hover {
  box-shadow: 0 0 32px 8px var(--accent, #22d3ee), 0 4px 24px rgba(34,211,238,.25);
  transform: scale(1.08);
}
#helpbot-btn img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
#helpbot-popup {
  position: fixed;
  right: 32px;
  bottom: 110px;
  z-index: 1001;
  width: 340px;
  max-width: 95vw;
  background: var(--bg, #0b0f19);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(34,211,238,.18), 0 1.5px 8px rgba(0,0,0,.18);
  border: 1.5px solid var(--accent, #22d3ee);
  overflow: hidden;
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#helpbot-popup.open {
  display: flex;
  animation: popupOpen 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popupOpen {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
#helpbot-popup-header {
  background: linear-gradient(90deg, var(--accent, #22d3ee), var(--purple, #7c5cff));
  color: #fff;
  font-weight: 900;
  padding: 14px 18px;
  font-size: 18px;
  letter-spacing: .2px;
}
#helpbot-popup-body {
  padding: 18px;
  color: var(--text, #eaf0ff);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}
#helpbot-intro {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 6px;
}
#helpbot-footer {
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted, rgba(234,240,255,.75));
  text-align: center;
}
#helpbot-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
#helpbot-questions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.helpbot-question {
  background: rgba(34,211,238,.1);
  border: 1px solid rgba(34,211,238,.3);
  color: var(--text, #eaf0ff);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all .2s ease;
}
.helpbot-question:hover {
  background: rgba(34,211,238,.2);
  border-color: rgba(34,211,238,.5);
  transform: translateX(4px);
  box-shadow: 0 0 12px rgba(34,211,238,.3);
}
.helpbot-message {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 85%;
  animation: slideIn 0.3s ease;
}
.helpbot-message-user {
  background: rgba(34,211,238,.2);
  border: 1px solid rgba(34,211,238,.4);
  align-self: flex-end;
  text-align: right;
}
.helpbot-message-bot {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  align-self: flex-start;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#helpbot-popup-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s;
}
#helpbot-popup-close:hover {
  opacity: 1;
}

body.ai-overlay-open {
  overflow: hidden;
}

#helpbot-popup.ai-overlay {
  inset: 0;
  right: auto;
  bottom: auto;
  width: 100vw;
  height: 100vh;
  max-width: none;
  z-index: 20000;
  border-radius: 0;
  border: none;
  background: rgba(6, 9, 16, 0.9);
  box-shadow: none;
  transform: none;
  transform-origin: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  display: none;
  align-items: center;
  justify-content: center;
}

#helpbot-popup.ai-overlay.open {
  display: flex;
  opacity: 1;
  animation: none;
}

.personalize__panel.ai-mode {
  grid-template-columns: 1fr;
}

.personalize__panel.ai-mode .personalize__hero,
.personalize__panel.ai-mode .form--compact {
  display: none;
}

.personalize__panel .ai-overlay {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  max-width: 100%;
  min-height: 320px;
  border-radius: 18px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  background: rgba(6, 9, 16, 0.85);
  display: none;
  opacity: 1;
  padding: 28px;
  align-items: stretch;
  justify-content: center;
  transition: none;
  z-index: 2;
}

.personalize__panel.ai-mode .ai-overlay {
  display: block;
}

.personalize__panel .ai-split {
  display: none;
}

.personalize__panel .ai-glow {
  inset: 0;
  opacity: 0.4;
}

.personalize__panel .ai-overlay__content {
  width: 100%;
  opacity: 1;
  transform: none;
  transition: none;
}

.personalize__panel .ai-close {
  top: 18px;
  right: 18px;
}

.ai-split {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50vh;
  background: #0b0f19;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.ai-split--top {
  top: 0;
  transform: translateY(0);
  border-bottom: 1px solid rgba(34, 211, 238, 0.08);
}

.ai-split--bottom {
  bottom: 0;
  transform: translateY(0);
  border-top: 1px solid rgba(124, 92, 255, 0.08);
}

#helpbot-popup.ai-overlay.open .ai-split--top {
  transform: translateY(-100%);
}

#helpbot-popup.ai-overlay.open .ai-split--bottom {
  transform: translateY(100%);
}

.ai-glow {
  position: absolute;
  inset: -10% 0 0 0;
  background: radial-gradient(40% 30% at 50% 25%, rgba(34, 211, 238, 0.18), transparent 70%),
              radial-gradient(35% 28% at 60% 60%, rgba(124, 92, 255, 0.15), transparent 70%);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.ai-overlay__content {
  position: relative;
  z-index: 2;
  width: min(860px, 90vw);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.35s ease 0.45s, transform 0.35s ease 0.45s;
}

#helpbot-popup.ai-overlay.open .ai-overlay__content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ai-prompt {
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.ai-prompt__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
  color: #eaf0ff;
}

.ai-prompt__brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: rgba(234, 240, 255, 0.8);
  text-transform: uppercase;
}

.ai-prompt__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 18px;
}

.ai-message {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  max-width: 85%;
  color: #eef2ff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  animation: slideIn 0.3s ease;
}

.ai-message--user {
  align-self: flex-end;
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.45);
}

.ai-message--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ai-message--loading {
  opacity: 0.7;
  font-style: italic;
}

.ai-prompt__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.ai-prompt__input {
  width: 100%;
  min-height: 52px;
  max-height: 160px;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 15, 26, 0.85);
  color: #eef2ff;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.ai-prompt__input:focus {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.ai-send {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.14);
  color: #eaf0ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ai-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.22);
}

.ai-prompt__hint {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(234, 240, 255, 0.65);
}

.ai-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 86, 117, 0.12);
  border: 1px solid rgba(255, 86, 117, 0.3);
  color: #ffd6df;
  font-size: 14px;
}

.ai-error[hidden] {
  display: none !important;
}

.ai-config {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(6, 12, 22, 0.7);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.ai-config[hidden] {
  display: none !important;
}

.ai-config__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ai-config__kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(234, 240, 255, 0.6);
}

.ai-config__title {
  font-size: 16px;
  font-weight: 700;
  color: #eaf0ff;
}

.ai-config__cta {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 12px;
  white-space: nowrap;
}

.ai-config__summary {
  display: grid;
  gap: 8px;
  color: rgba(234, 240, 255, 0.9);
  font-size: 14px;
  margin-bottom: 12px;
}

.ai-config__summary strong {
  color: #fff;
}

.ai-config__details {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  color: rgba(234, 240, 255, 0.8);
  font-size: 13px;
}

.ai-config__details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

.ai-config__json {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 12px;
  max-height: 200px;
  overflow: auto;
  font-size: 12px;
  color: #eaf0ff;
}

@media (max-width: 640px) {
  .ai-prompt {
    padding: 20px;
  }

  .ai-prompt__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .ai-prompt__title {
    font-size: 18px;
    letter-spacing: 1px;
  }

  .ai-chat {
    max-height: 36vh;
  }

  .ai-message {
    font-size: 14px;
    max-width: 100%;
    word-break: break-word;
  }

  .ai-prompt__form {
    grid-template-columns: 1fr;
  }

  .ai-send {
    width: 100%;
    height: 44px;
  }

  .ai-config__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ai-config__cta {
    width: 100%;
    text-align: center;
  }
}

.ai-retry {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.ai-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  z-index: 3;
}

.ai-close::before,
.ai-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
}

.ai-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.ai-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.is-hidden {
  display: none !important;
}
