.avi-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.avi-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DAA520, #B8860B);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(218, 165, 32, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
  overflow: hidden;
}

.avi-launcher:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(218, 165, 32, 0.5);
}

.avi-launcher svg {
  width: 32px;
  height: 32px;
  fill: #0a0a0f;
}

.avi-launcher-text {
  color: #0a0a0f;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
}

.avi-container {
  position: absolute;
  bottom: 96px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #0a0a0f;
  border-radius: 16px;
  border: 1px solid rgba(218, 165, 32, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.avi-container.open {
  display: flex;
}

.avi-header {
  padding: 20px;
  background: linear-gradient(135deg, rgba(218, 165, 32, 0.1), rgba(184, 134, 11, 0.05));
  border-bottom: 1px solid rgba(218, 165, 32, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avi-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DAA520, #B8860B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #0a0a0f;
}

.avi-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #FDF8F3;
}

.avi-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(253, 248, 243, 0.5);
}

.avi-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: rgba(253, 248, 243, 0.6);
  transition: color 0.2s;
}

.avi-close:hover {
  color: #FDF8F3;
}

.avi-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avi-message {
  display: flex;
  gap: 10px;
  animation: avi-fadeIn 0.3s ease;
}

@keyframes avi-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.avi-message.user {
  flex-direction: row-reverse;
}

.avi-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DAA520, #B8860B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #0a0a0f;
  flex-shrink: 0;
}

.avi-message.user .avi-message-avatar {
  background: rgba(253, 248, 243, 0.1);
  color: #FDF8F3;
}

.avi-message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #FDF8F3;
}

.avi-message.bot .avi-message-content {
  background: rgba(218, 165, 32, 0.1);
  border: 1px solid rgba(218, 165, 32, 0.15);
  border-radius: 4px 16px 16px 16px;
}

.avi-message.user .avi-message-content {
  background: linear-gradient(135deg, #DAA520, #B8860B);
  color: #0a0a0f;
  border-radius: 16px 4px 16px 16px;
}

.avi-message-content p {
  margin: 0 0 8px;
}

.avi-message-content p:last-child {
  margin-bottom: 0;
}

.avi-message-content ul, 
.avi-message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.avi-message-content li {
  margin-bottom: 4px;
}

.avi-message-content strong {
  color: #DAA520;
}

.avi-message-content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.avi-typing {
  display: flex;
  gap: 10px;
  align-items: center;
}

.avi-typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(218, 165, 32, 0.1);
  border-radius: 4px 16px 16px 16px;
}

.avi-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #DAA520;
  animation: avi-bounce 1.4s infinite ease-in-out;
}

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

@keyframes avi-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.avi-input-area {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(218, 165, 32, 0.1);
}

.avi-lead-form {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.avi-lead-form.active {
  display: flex;
}

.avi-lead-form input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(253, 248, 243, 0.05);
  border: 1px solid rgba(218, 165, 32, 0.2);
  border-radius: 8px;
  color: #FDF8F3;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.avi-lead-form input:focus {
  border-color: #DAA520;
}

.avi-lead-form input::placeholder {
  color: rgba(253, 248, 243, 0.4);
}

.avi-lead-form button {
  padding: 12px 20px;
  background: linear-gradient(135deg, #DAA520, #B8860B);
  border: none;
  border-radius: 8px;
  color: #0a0a0f;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.avi-lead-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(218, 165, 32, 0.3);
}

.avi-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.avi-input-wrapper.disabled {
  opacity: 0.5;
}

.avi-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(253, 248, 243, 0.05);
  border: 1px solid rgba(218, 165, 32, 0.2);
  border-radius: 24px;
  color: #FDF8F3;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.avi-input:focus {
  border-color: #DAA520;
}

.avi-input::placeholder {
  color: rgba(253, 248, 243, 0.4);
}

.avi-input:disabled {
  cursor: not-allowed;
}

.avi-message.bot.avi-limit .avi-message-content {
  background: rgba(218, 165, 32, 0.15);
  border: 1px solid rgba(218, 165, 32, 0.3);
  border-radius: 16px 16px 16px 4px;
  padding: 16px;
}

.avi-message.bot.avi-limit .avi-message-content p {
  margin: 0;
  color: #FDF8F3;
  font-size: 14px;
  line-height: 1.5;
}

.avi-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #DAA520, #B8860B);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.avi-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(218, 165, 32, 0.3);
}

.avi-send svg {
  width: 20px;
  height: 20px;
  fill: #0a0a0f;
}

.avi-download-btn {
  display: none;
  margin-top: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #DAA520, #B8860B);
  border: none;
  border-radius: 8px;
  color: #0a0a0f;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.avi-download-btn:hover {
  box-shadow: 0 4px 16px rgba(218, 165, 32, 0.3);
}

@media (max-width: 480px) {
  .avi-widget {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }

  .avi-launcher {
    width: 52px;
    height: 52px;
  }

.avi-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 32px);
    max-width: 400px;
    height: 70vh;
    max-height: 70vh;
    border-radius: 16px;
    z-index: 99998;
    display: none;
    flex-direction: column;
  }

  .avi-container.open {
    display: flex;
  }

  .avi-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
  }

  .avi-header {
    padding: 12px 16px;
    flex-shrink: 0;
  }

  .avi-input-area {
    padding: 10px 12px;
    flex-shrink: 0;
  }

  .avi-lead-form {
    padding-bottom: 0;
  }
}