* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1 { font-size: 1.1rem; margin: 0; }
section { padding: 16px; flex: 1; display: flex; flex-direction: column; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
label { display: block; margin: 12px 0 4px; }
input, button {
  font-size: 1rem;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #334155;
}
input { width: 100%; background: #1e293b; color: #e2e8f0; }
button {
  background: #2563eb;
  color: white;
  border: none;
  cursor: pointer;
  margin-top: 8px;
}
button:disabled { opacity: 0.6; cursor: default; }
.error { color: #f87171; min-height: 1.2em; }
#messages { flex: 1; overflow-y: auto; margin-bottom: 8px; }
.bubble {
  white-space: pre-wrap;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 6px 0;
  max-width: 85%;
}
.bubble.user { background: #2563eb; margin-left: auto; }
.bubble.bot { background: #1e293b; }
.bubble.error { background: #7f1d1d; }
.buttons { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.button-row { display: flex; gap: 6px; }
.button-row button { flex: 1; margin-top: 0; }
#message-form { display: flex; gap: 8px; }
#message-form input { flex: 1; }
#message-form button { width: auto; white-space: nowrap; }
