#aiw-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  font-family: 'DM Sans', sans-serif;
}

#aiw-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border2, rgba(255,255,255,0.13));
  background: var(--bg2, #12151d);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}

#aiw-toggle:hover {
  transform: scale(1.06);
}

#aiw-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% calc(50% + 5.5px);
}

#aiw-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: 320px;
  max-width: calc(100vw - 44px);
  background: var(--bg2, #12151d);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  border-radius: var(--radius, 10px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  overflow: hidden;
  transform-origin: bottom right;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

#aiw-panel.aiw-closed {
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  pointer-events: none;
}

#aiw-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  background: var(--bg3, #181c26);
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.07));
}

#aiw-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border2, rgba(255,255,255,0.13));
  object-fit: cover;
  object-position: 50% calc(50% + 3.5px);
  flex-shrink: 0;
}

#aiw-headerText {
  flex: 1;
  min-width: 0;
}

#aiw-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #dde1ea);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#aiw-subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--accent, #3AABCB);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

#aiw-close {
  background: none;
  border: none;
  color: var(--text-dim, #7e8799);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

#aiw-close:hover {
  color: var(--text, #dde1ea);
}

#aiw-mute {
  background: none;
  border: none;
  color: var(--text-dim, #7e8799);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#aiw-mute:hover {
  color: var(--text, #dde1ea);
}

#aiw-mute .aiw-sound-off {
  display: none;
}

#aiw-mute.aiw-muted .aiw-sound-on {
  display: none;
}

#aiw-mute.aiw-muted .aiw-sound-off {
  display: block;
}

#aiw-mute.aiw-muted {
  color: var(--accent-r, #E06060);
}

#aiw-bubbleWrap {
  padding: 16px 14px;
  max-height: 260px;
  overflow-y: auto;
}

#aiw-bubble {
  background: var(--bg3, #181c26);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  color: var(--text, #dde1ea);
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: var(--radius, 10px);
}

#aiw-form {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}

#aiw-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border, rgba(255,255,255,0.07));
  background: var(--bg3, #181c26);
  color: var(--text, #dde1ea);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}

#aiw-input::placeholder {
  color: var(--text-mute, #434c62);
}

#aiw-input:focus {
  outline: none;
  border-color: var(--accent, #3AABCB);
}

#aiw-send {
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius, 10px);
  background: var(--accent, #3AABCB);
  color: var(--bg, #0d0f14);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
}

#aiw-send:hover {
  opacity: 0.85;
}

#aiw-avatar.aiw-talking,
#aiw-toggle.aiw-talking {
  animation: aiw-talk-pulse 0.4s infinite alternate;
}

@keyframes aiw-talk-pulse {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

@media (max-width: 480px) {
  #aiw-root {
    right: 14px;
    bottom: 14px;
  }
  #aiw-panel {
    width: calc(100vw - 28px);
  }
}
