* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f3f4f6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.app {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  width: 100%;
  max-width: 900px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header h1 {
  font-size: 20px;
  color: #111827;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 14px;
  color: #6b7280;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 500px;
}

.chat {
  flex: 1;
  background: #f9fafb;
  border-radius: 12px;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message {
  max-width: 70%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.user {
  margin-left: auto;
  background: #3b82f6;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.message.bot {
  margin-right: auto;
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 2px;
}

.message.system {
  margin: 0 auto;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
}

.input-block {
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status {
  font-size: 12px;
  color: #6b7280;
}

.row {
  display: flex;
  gap: 8px;
}

#messageInput {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
}

#messageInput:focus {
  border-color: #3b82f6;
}

#sendBtn {
  border-radius: 999px;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  background: #3b82f6;
  color: #ffffff;
  cursor: pointer;
}

#sendBtn:disabled {
  opacity: 0.6;
  cursor: default;
}
.msg {
  max-width: 70%;
  padding: 12px 16px;
  margin: 10px 0;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.msg.bot {
  background: #f1f3f4;
  color: #111;
  align-self: flex-start;
}

.msg.user {
  background: #3B82F6;
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

#chat {
  display: flex;
  flex-direction: column;
  padding: 20px;
}
