* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
}

.app {
  width: min(900px, 94vw);
  margin: 32px auto;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.10);
  overflow: hidden;
}

.header {
  padding: 22px 24px;
  background: #111827;
  color: white;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.header h1 {
  margin: 0 0 6px 0;
  font-size: 24px;
}

.header p {
  margin: 0;
  color: #d1d5db;
}

.chat-window {
  min-height: 420px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f9fafb;
}

.message {
  max-width: 78%;
  padding: 13px 15px;
  border-radius: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.user {
  align-self: flex-end;
  background: #2563eb;
  color: white;
}

.assistant {
  align-self: flex-start;
  background: #e5e7eb;
  color: #111827;
}

.meta {
  display: block;
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 5px;
}

.composer {
  padding: 18px 24px 24px;
  border-top: 1px solid #e5e7eb;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  outline: none;
}

textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

button {
  border: none;
  background: #2563eb;
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.95);
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

@media (max-width: 640px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .message {
    max-width: 92%;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
