#ava-widget-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00D4FF, #0EA5E9, #10B981);
  border: 2px solid rgba(0, 212, 255, 0.4);
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.45), 0 0 40px rgba(14, 165, 233, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#ava-widget-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(0, 212, 255, 0.6), 0 0 60px rgba(14, 165, 233, 0.25);
}
#ava-widget-launcher.ava-pulse {
  animation: avaPulseGlow 2s ease-in-out infinite;
}
@keyframes avaPulseGlow {
  0%, 100% { box-shadow: 0 4px 24px rgba(0, 212, 255, 0.45), 0 0 40px rgba(14, 165, 233, 0.2); transform: scale(1); }
  50% { box-shadow: 0 4px 32px rgba(0, 212, 255, 0.7), 0 0 60px rgba(14, 165, 233, 0.4), 0 0 80px rgba(16, 185, 129, 0.2); transform: scale(1.1); }
}

#ava-launcher-tooltip {
  position: fixed;
  bottom: 32px;
  right: 82px;
  background: #111;
  color: #e5e5e5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 212, 255, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 212, 255, 0.1);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
}
#ava-launcher-tooltip.ava-tooltip-visible {
  opacity: 1;
  transform: translateX(0);
}
#ava-launcher-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #111;
  border-right: none;
}
#ava-widget-launcher .ava-icon-chat {
  color: #fff;
  font-size: 20px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}
#ava-widget-launcher.ava-open .ava-icon-chat { display: none; }
#ava-widget-launcher.ava-open .ava-icon-close { display: flex; }
#ava-widget-launcher:not(.ava-open) .ava-icon-chat { display: flex; }
#ava-widget-launcher:not(.ava-open) .ava-icon-close { display: none; }

#ava-widget-panel {
  position: fixed;
  bottom: 82px;
  right: 24px;
  width: 340px;
  max-height: 420px;
  background: #0a0a0a;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 16px;
  z-index: 99998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 0 32px rgba(0, 212, 255, 0.06);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#ava-widget-panel.ava-visible {
  display: flex;
  animation: avaSlideUp 0.3s ease;
}

@keyframes avaSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.ava-header {
  background: linear-gradient(135deg, #00D4FF, #0EA5E9, #10B981);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ava-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ava-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.ava-header-text h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.ava-header-text p {
  margin: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.3px;
}
.ava-voice-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
  color: #fff;
}
.ava-voice-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.ava-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 255, 0.25) transparent;
}
.ava-messages::-webkit-scrollbar { width: 5px; }
.ava-messages::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.25); border-radius: 4px; }
.ava-messages::-webkit-scrollbar-track { background: transparent; }

.ava-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #e5e5e5;
  word-wrap: break-word;
}
.ava-msg-ava {
  align-self: flex-start;
  background: #141414;
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-bottom-left-radius: 4px;
}
.ava-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #00D4FF, #0EA5E9, #10B981);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ava-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: #141414;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0, 212, 255, 0.12);
}
.ava-msg-ava a {
  color: #00D4FF;
  text-decoration: underline;
  word-break: break-all;
  transition: color 0.2s ease;
}
.ava-msg-ava a:hover {
  color: #10B981;
}
.ava-typing-dot {
  width: 7px;
  height: 7px;
  background: #0EA5E9;
  border-radius: 50%;
  animation: avaBounce 1.2s infinite;
}
.ava-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.ava-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes avaBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.ava-input-area {
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 8px;
  align-items: center;
  background: #080808;
  flex-shrink: 0;
}
.ava-input-area input {
  flex: 1;
  background: #141414;
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #e5e5e5;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.ava-input-area input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.ava-input-area input:focus {
  border-color: rgba(0, 212, 255, 0.45);
}
.ava-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00D4FF, #0EA5E9, #10B981);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.ava-send-btn:hover { opacity: 0.85; }
.ava-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ava-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.ava-powered {
  text-align: center;
  padding: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  background: #080808;
  letter-spacing: 0.3px;
}

@media (max-width: 440px) {
  #ava-widget-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 72px;
    max-height: 60vh;
  }
  #ava-widget-launcher {
    right: 14px;
    bottom: 14px;
  }
  #ava-launcher-tooltip {
    right: 62px;
    bottom: 22px;
    font-size: 12px;
    padding: 6px 10px;
  }
}
