.ai-bot-fab {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  z-index: 9000;
}

#ai-bot-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--ice);
  background: rgba(0, 2, 10, 0.92);
  backdrop-filter: blur(20px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.2);
}

#ai-bot-toggle:hover {
  border-color: var(--neon);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
  transform: scale(1.06);
}

#ai-bot-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--ice);
  stroke-width: 1.5;
  transition: stroke 0.3s;
}

#ai-bot-toggle:hover svg {
  stroke: var(--neon);
}

#aria-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(79, 195, 247, 0.4);
  animation: aria-ring 2.5s ease-out infinite;
  pointer-events: none;
}

#aria-pulse.hidden {
  display: none;
}

@keyframes aria-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

#ai-bot-container {
  position: fixed;
  bottom: 6.5rem;
  right: 2.5rem;
  width: 380px;
  max-height: 560px;
  z-index: 9001;
  border: 1px solid var(--border-hi);
  background: rgba(1, 5, 16, 0.97);
  backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  transform: scale(0.85) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out), opacity 0.35s;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(79, 195, 247, 0.08);
}

#ai-bot-container.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.ai-bot-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
}

.ai-bot-indicator {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-hi);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-bot-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 10px var(--ice);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

.ai-bot-name {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: var(--ice);
}

.ai-bot-subtitle {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 2px;
}

#ai-bot-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: all 0.3s;
  flex-shrink: 0;
}

#ai-bot-close:hover {
  border-color: var(--ice);
  color: var(--ice);
}

#ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ai-chips {
  padding: 0 1.2rem 0.8rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.ai-chip {
  font-family: var(--font-mono);
  font-size: 0.47rem;
  letter-spacing: 1.5px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.ai-chip:hover {
  border-color: var(--ice);
  color: var(--ice);
}

.ai-input-row {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.7rem;
  flex-shrink: 0;
}

#ai-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--white);
  outline: none;
  transition: border-color 0.3s;
  font-weight: 300;
}

#ai-input::placeholder {
  color: var(--subtle);
  font-style: italic;
}

#ai-input:focus {
  border-color: var(--border-hi);
}

#ai-send {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 2px;
  padding: 0.75rem 1.2rem;
  background: transparent;
  border: 1px solid var(--ice);
  color: var(--ice);
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}

#ai-send:hover:not(:disabled) {
  background: var(--ice);
  color: var(--void);
}

#ai-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ai-msg {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  transition: opacity 0.4s, transform 0.4s;
}

.ai-msg--enter {
  opacity: 0;
  transform: translateY(8px);
}

.ai-msg--user {
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.42rem;
  letter-spacing: 1px;
}

.ai-msg-avatar--ai {
  color: var(--ice);
  border-color: rgba(79, 195, 247, 0.3);
}

.ai-msg-avatar--user {
  color: var(--muted);
}

.ai-msg-bubble {
  max-width: 78%;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--muted);
  background: rgba(79, 195, 247, 0.04);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
}

.ai-msg--user .ai-msg-bubble {
  background: rgba(79, 195, 247, 0.07);
  border-color: rgba(79, 195, 247, 0.2);
  color: var(--white);
}

.ai-typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 1rem;
}

.ai-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ice);
  opacity: 0.4;
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-5px); opacity: 1; }
}

@media (max-width: 480px) {
  #ai-bot-container {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 5.5rem;
  }

  .ai-bot-fab {
    right: 1rem;
    bottom: 1.5rem;
  }
}