.chat-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
}

.chat-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg);
}

.chat-enter { opacity: 0; transform: translateY(20px); }
.chat-enter-active { transition: all 250ms ease; }
.chat-leave-active { opacity: 0; transform: translateY(20px); transition: all 200ms ease; }

.chat-panel {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 380px;
  max-height: 560px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--color-border);
}

.chat-header h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
}

.chat-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

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

.chat-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.chat-suggestions button {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.chat-suggestions button:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-msg--user {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--color-border);
  color: var(--color-text-muted);
}

.chat-msg--user .chat-msg-avatar {
  background: var(--color-accent);
  color: #fff;
}

.chat-msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg--user .chat-msg-bubble {
  background: var(--color-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg--assistant .chat-msg-bubble {
  background: var(--color-bg);
  border-bottom-left-radius: 4px;
}

.chat-typing {
  display: flex;
  gap: 5px;
  padding: 8px 16px;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: typing-bounce 1.4s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
}

.chat-input-area textarea {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 100px;
  transition: border-color var(--transition);
}

.chat-input-area textarea:focus {
  border-color: var(--color-accent);
}

.chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.chat-send:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 32px);
    right: -4px;
    max-height: 480px;
  }
  .chat-trigger {
    bottom: 16px;
    right: 16px;
  }
}
