.az-chat-root {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10001;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

.has-scroll-to-top .az-chat-root {
  right: calc(2rem + 180px);
}

.az-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(40, 38, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #FEDEC5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.az-fab:hover {
  background: rgba(50, 48, 54, 0.95);
  border-color: #FEDEC5;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.az-fab--hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

.az-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-height: 540px;
  background: rgba(22, 21, 24, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  outline: none;
}

.az-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.az-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.az-header-left {
  display: flex;
  gap: 4px;
}

.az-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.az-header-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FEDEC5;
}

.az-header-title {
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.2px;
}

.az-close-btn:hover {
  background: rgba(255, 80, 80, 0.15);
  color: #ff8080;
}

.az-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.az-body::-webkit-scrollbar {
  width: 5px;
}

.az-body::-webkit-scrollbar-track {
  background: transparent;
}

.az-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.az-intro-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
}

.az-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #D4835F;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.az-intro-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.az-msg {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  animation: azFadeIn 0.2s ease;
}

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

.az-msg--user {
  align-self: flex-end;
  background: #D4835F;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  font-weight: 500;
  margin-left: auto;
}

.az-msg--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-bottom-left-radius: 4px;
}

.az-answer-list {
  margin: 0;
  padding: 0 0 0 16px;
  list-style: none;
}

.az-answer-list li {
  position: relative;
  padding-left: 8px;
  margin-bottom: 6px;
}

.az-answer-list li:last-child {
  margin-bottom: 0;
}

.az-answer-list li::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #D4835F;
}

.az-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.az-chip {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #FEDEC5;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.az-chip:hover {
  background: rgba(212, 131, 95, 0.15);
  border-color: rgba(212, 131, 95, 0.4);
  transform: translateX(2px);
}

.az-chip:active {
  transform: translateX(1px);
}

.az-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 11px 16px;
  flex-shrink: 0;
}

.az-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.az-footer-email {
  font-size: 13px;
  font-weight: 500;
  color: #FEDEC5;
  letter-spacing: -0.1px;
  user-select: all;
}

.az-copy-btn {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.az-copy-btn:hover {
  background: rgba(212, 131, 95, 0.15);
  border-color: rgba(212, 131, 95, 0.35);
  color: #FEDEC5;
}

.az-copy-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #D4835F;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.az-copy-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 8px;
  border: 4px solid transparent;
  border-top-color: #D4835F;
}

.az-copy-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 991px) {
  .az-chat-root {
    bottom: calc(58px + 1rem + env(safe-area-inset-bottom));
    right: 1rem;
  }

  .has-scroll-to-top .az-chat-root {
    right: calc(1rem + 56px + 12px);
    bottom: calc(58px + 1rem + env(safe-area-inset-bottom));
  }

  .az-header-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .az-header-btn svg {
    width: 20px;
    height: 20px;
  }

  .az-header {
    padding: 10px 12px;
  }

  .az-header-title {
    font-size: 16px;
  }

  .az-intro-bar {
    padding: 12px 16px;
  }

  .az-intro-text {
    font-size: 14px;
  }

  .az-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .az-msg {
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.6;
    border-radius: 14px;
  }

  .az-chips {
    gap: 10px;
    padding: 8px 16px 16px;
  }

  .az-chip {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 12px;
    line-height: 1.45;
  }

  .az-body {
    padding: 16px;
    gap: 14px;
  }

  .az-footer {
    padding: 14px 16px;
  }

  .az-footer-email {
    font-size: 15px;
  }

  .az-copy-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }

  .az-copy-btn svg {
    width: 18px;
    height: 18px;
  }

  .az-answer-list li {
    margin-bottom: 8px;
    padding-left: 10px;
  }
}

@media (max-width: 768px) {
  .az-panel {
    position: fixed;
    bottom: calc(58px + env(safe-area-inset-bottom));
    right: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
  }
}
