:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0d0f14;
  color: #f1f5f9;
}

.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid #1f2937;
  padding: 20px;
  background: #0b0d12;
}

.sidebar h1 {
  margin: 0;
  font-size: 1.3rem;
}

.sidebar p {
  color: #94a3b8;
  margin-top: 6px;
  margin-bottom: 24px;
}

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

select,
textarea,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  padding: 10px 12px;
  font-size: 0.95rem;
}

button {
  cursor: pointer;
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

button.secondary {
  border-color: #334155;
  background: #1e293b;
}

.chat-area {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1f2937;
  padding: 14px 20px;
}

#status {
  color: #38bdf8;
  font-size: 0.9rem;
}

.messages {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 76%;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.msg.user {
  align-self: flex-end;
  background: #1d4ed8;
}

.msg.assistant {
  align-self: flex-start;
  background: #111827;
  border: 1px solid #334155;
}

.msg .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.msg .speak {
  width: auto;
  padding: 5px 8px;
  font-size: 0.78rem;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #334155;
}

.composer {
  border-top: 1px solid #1f2937;
  padding: 16px;
  display: grid;
  gap: 10px;
  background: #0b0d12;
}

.actions {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
}

textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 180px;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid #1f2937;
  }
}
