.av-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue, #4f8cff), var(--accent-purple, #9b59f5));
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.av-chat-launcher:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 40px rgba(79, 140, 255, 0.35);
}

.av-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 1079;
  width: min(400px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 7rem));
  display: none;
  flex-direction: column;
  background: hsla(222, 47%, 9%, 0.98);
  border: 1px solid var(--border-glow, rgba(255, 255, 255, 0.15));
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.av-chat-panel.is-open {
  display: flex;
}

.av-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  background: hsla(224, 47%, 11%, 0.95);
}

.av-chat-header strong {
  font-size: 0.9rem;
}

.av-chat-header small {
  display: block;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  font-size: 0.7rem;
}

.av-chat-close {
  border: none;
  background: transparent;
  color: var(--text-secondary, #aaa);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
}

.av-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.av-chat-bubble {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.av-chat-bubble--bot {
  align-self: flex-start;
  background: hsla(224, 100%, 65%, 0.12);
  border: 1px solid hsla(224, 100%, 65%, 0.2);
}

.av-chat-bubble--user {
  align-self: flex-end;
  background: hsla(263, 85%, 65%, 0.18);
  border: 1px solid hsla(263, 85%, 65%, 0.25);
}

.av-chat-bubble--error {
  align-self: flex-start;
  background: hsla(354, 70%, 54%, 0.12);
  border: 1px solid hsla(354, 70%, 54%, 0.25);
  color: #ffb4b4;
}

.av-chat-typing {
  align-self: flex-start;
  font-size: 0.75rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  padding: 0 0.25rem;
}

.av-chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  background: hsla(222, 47%, 8%, 0.95);
}

.av-chat-input {
  flex: 1;
  resize: none;
  min-height: 2.5rem;
  max-height: 6rem;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  background: hsla(0, 0%, 100%, 0.06);
  color: inherit;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
}

.av-chat-input:focus {
  outline: none;
  border-color: var(--accent-blue, #4f8cff);
}

.av-chat-send {
  border: none;
  border-radius: 10px;
  padding: 0 0.9rem;
  background: linear-gradient(135deg, var(--accent-blue, #4f8cff), var(--accent-purple, #9b59f5));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.av-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 576px) {
  .av-chat-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 5rem;
  }
  .av-chat-launcher {
    right: 1rem;
    bottom: 1rem;
  }
}
