.asvika-ai-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 9999;
  width: 360px;
  max-height: 520px;
  background: linear-gradient(180deg, #ffffff, #fbf8fa);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(109,59,82,0.22), 0 0 0 1px rgba(201,138,163,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  font-family: 'Inter', sans-serif;
}
.asvika-ai-widget.hidden { transform: translateY(24px) scale(0.96); opacity: 0; pointer-events: none; }

/* Header */
.asvika-ai-header {
  background: linear-gradient(120deg, #6d3b52, #b77a91 45%, #d9a25f);
  background-size: 180% 100%;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}
.asvika-ai-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: aiHeaderShine 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes aiHeaderShine { 0%, 60% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.asvika-ai-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35);
  animation: aiAvatarBob 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes aiAvatarBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.asvika-ai-header-title { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.asvika-ai-header-title strong { font-size: 14px; letter-spacing: 0.3px; }
.asvika-ai-status { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.85); display: inline-flex; align-items: center; gap: 4px; }
.ai-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7CFC9B; box-shadow: 0 0 6px #7CFC9B; animation: aiStatusPulse 1.6s ease-in-out infinite; }
@keyframes aiStatusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.asvika-ai-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.asvika-ai-tool {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, transform 0.2s;
}
.asvika-ai-tool:hover { background: rgba(255,255,255,0.28); transform: translateY(-1px); }
.asvika-ai-tool.off { opacity: 0.55; }
.asvika-ai-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 0 4px; line-height: 1; transition: transform 0.2s; }
.asvika-ai-close:hover { transform: rotate(90deg); }

/* Messages */
.asvika-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 300px;
  background:
    radial-gradient(60% 40% at 90% 10%, rgba(217,162,95,0.08), transparent 70%),
    radial-gradient(50% 40% at 10% 90%, rgba(201,138,163,0.08), transparent 70%),
    #f8f7fa;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,138,163,0.5) transparent;
}
.asvika-ai-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: aiFadeIn 0.25s ease;
}
@keyframes aiFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.asvika-ai-user {
  background: linear-gradient(120deg, #b77a91, #9e5f76);
  color: #fff;
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 2px 8px rgba(183,122,145,0.25);
}
.asvika-ai-bot {
  background: #fff;
  color: #333;
  align-self: flex-start;
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid rgba(201,138,163,0.12);
}
.asvika-ai-typing { color: #999; font-size: 12px; font-style: italic; display: flex; align-items: center; gap: 6px; }
.ai-typing-dots { display: inline-flex; gap: 3px; }
.ai-typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: #b77a91; animation: aiTyping 1.2s ease-in-out infinite; }
.ai-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiTyping { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-4px); opacity: 1; } }

/* Quick chips */
.asvika-ai-chips {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid #f0e9ef;
  scrollbar-width: none;
}
.asvika-ai-chips::-webkit-scrollbar { display: none; }
.ai-chip {
  flex-shrink: 0;
  background: #f7eef3;
  border: 1px solid rgba(201,138,163,0.3);
  color: #6d3b52;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.ai-chip:hover { background: #b77a91; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(183,122,145,0.3); }

/* Input row */
.asvika-ai-input-wrap {
  display: flex;
  align-items: center;
  padding: 10px;
  gap: 6px;
  border-top: 1px solid #eee;
  background: #fff;
}
.asvika-ai-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.asvika-ai-input:focus { border-color: #b77a91; box-shadow: 0 0 0 3px rgba(183,122,145,0.15); }

.asvika-ai-mic {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  color: #6d3b52;
  border: 1px solid rgba(201,138,163,0.4);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s, color 0.2s;
}
.asvika-ai-mic:hover { background: #f7eef3; transform: scale(1.06); }
.asvika-ai-mic.listening { background: #d94f4f; color: #fff; border-color: #d94f4f; animation: aiMicPulse 1.2s ease-in-out infinite; }
@keyframes aiMicPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,79,79,0.5); } 50% { box-shadow: 0 0 0 10px rgba(217,79,79,0); } }
.ai-mic-wave { display: none; gap: 2px; align-items: center; }
.asvika-ai-mic.listening svg { display: none; }
.asvika-ai-mic.listening .ai-mic-wave { display: inline-flex; }
.ai-mic-wave span { width: 3px; height: 8px; background: #fff; border-radius: 3px; animation: aiWave 0.9s ease-in-out infinite; }
.ai-mic-wave span:nth-child(2) { animation-delay: 0.12s; }
.ai-mic-wave span:nth-child(3) { animation-delay: 0.24s; }
.ai-mic-wave span:nth-child(4) { animation-delay: 0.36s; }
.ai-mic-wave span:nth-child(5) { animation-delay: 0.48s; }
@keyframes aiWave { 0%, 100% { height: 6px; } 50% { height: 18px; } }

.asvika-ai-send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(120deg, #6d3b52, #b77a91, #d9a25f);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(183,122,145,0.3);
}
.asvika-ai-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.asvika-ai-send:hover:not(:disabled) { transform: scale(1.08); box-shadow: 0 5px 14px rgba(183,122,145,0.4); }

/* Toggle button */
.asvika-ai-toggle {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(120deg, #6d3b52, #b77a91 50%, #d9a25f);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(183,122,145,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s, box-shadow 0.25s;
  font-family: 'Inter', sans-serif;
}
.asvika-ai-toggle:hover { transform: scale(1.1) rotate(10deg); box-shadow: 0 8px 26px rgba(183,122,145,0.55); }
.ai-toggle-icon { animation: aiToggleBob 2.6s ease-in-out infinite; display: inline-block; }
@keyframes aiToggleBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-8deg); } }
.ai-toggle-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(217,162,95,0.6);
  animation: aiPing 2s ease-out infinite;
  pointer-events: none;
}
@keyframes aiPing { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.7); opacity: 0; } }

/* Spoken indicator inside bot bubbles */
.asvika-ai-speaker { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 11px; color: #b77a91; cursor: pointer; }

/* Mobile */
@media (max-width: 480px) {
  .asvika-ai-widget { width: calc(100vw - 24px); right: 12px; bottom: 84px; max-height: 78vh; }
  .asvika-ai-toggle { bottom: 18px; right: 14px; }
}
