.chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 7.5rem);
  max-width: 800px;
  margin: 0 auto;
}

.chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.chat-welcome h1 {
  margin: 0;
  font-size: 1.5rem;
}

.chat-welcome p {
  margin: 0;
  font-size: 0.875rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.chat-messages li {
  list-style: none;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.chat-input-wrap {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.chat-input-wrap form {
  max-width: none;
}

.chat-input {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chat-input input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9375rem;
  color: inherit;
  background: var(--input-bg);
  outline: none;
}

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

.chat-input button {
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.chat-input button:hover {
  background: var(--btn-border);
  border-color: var(--accent);
}

.chat-input button:active {
  transform: scale(0.98);
}

.chat-loader {
  display: flex;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
}

.chat-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chat-bounce 1.4s ease-in-out infinite;
}

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

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

@keyframes chat-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
