* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  height: 100vh;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 800px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid #1a1a1a;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.subtitle {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.message.user .message-content {
  background: #5c3a1a;
  color: #e0e0e0;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: #1a1a1a;
  color: #e0e0e0;
  border-bottom-left-radius: 4px;
}

.message-content p {
  margin-bottom: 8px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  color: #fff;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
}

.message-content th,
.message-content td {
  padding: 8px 12px;
  border: 1px solid #333;
  text-align: left;
}

.message-content th {
  background: #222;
  color: #fff;
  font-weight: 600;
}

.message-content td {
  background: #111;
}

.message-content ul,
.message-content ol {
  padding-left: 20px;
  margin: 8px 0;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content code {
  background: #222;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.message-content pre {
  background: #111;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 0.85em;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-content h2,
.message-content h3 {
  color: #fff;
  margin: 12px 0 6px;
}

.message-content blockquote {
  border-left: 3px solid #444;
  padding-left: 12px;
  color: #999;
  margin: 8px 0;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #1a1a1a;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  max-width: 90%;
}

.typing span {
  width: 6px;
  height: 6px;
  background: #555;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

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

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

.suggestions {
  display: flex;
  gap: 10px;
  padding: 0 24px 12px;
}

.suggestion {
  flex: 1 1 0;
  background: #141414;
  color: #b8b8b8;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.suggestion:hover {
  background: #1c1c1c;
  border-color: #3a3a3a;
  color: #e8e8e8;
}

@media (max-width: 600px) {
  .suggestions {
    flex-direction: column;
    padding: 0 16px 8px;
  }
}

.input-area {
  padding: 16px 24px 24px;
  display: flex;
  gap: 8px;
  border-top: 1px solid #1a1a1a;
}

#input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 12px;
  background: #111;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  outline: none;
  max-height: 150px;
  line-height: 1.5;
}

#input:focus {
  border-color: #555;
}

#input::placeholder {
  color: #555;
}

#send {
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #8c5a2a;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  align-self: flex-end;
}

#send:hover {
  background: #9c6a3a;
}

#send:disabled {
  background: #222;
  color: #555;
  cursor: not-allowed;
}

.chat::-webkit-scrollbar {
  width: 6px;
}

.chat::-webkit-scrollbar-track {
  background: transparent;
}

.chat::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: #555;
  padding: 0 24px 12px;
}

@media (max-width: 600px) {
  .chat {
    padding: 16px;
  }

  .input-area {
    padding: 12px 16px 16px;
  }

  .message {
    max-width: 95%;
  }
}
