:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2430;
  --text: #f2f4f8;
  --muted: #99a1b3;
  --accent: #4f8cff;
  --accent-2: #2d6cdf;
  --border: #2c3343;
  --success: #2bb673;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--panel);
  padding: 18px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sidebar-note {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.agent-list {
  display: grid;
  gap: 10px;
}

.agent-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
}

.agent-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.agent-card-name {
  font-weight: 600;
}

.agent-card-role {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

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

.chat-header,
.composer {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.composer {
  border-bottom: 0;
  border-top: 1px solid var(--border);
}

.agent-title {
  font-weight: 700;
  font-size: 18px;
}

.agent-subtitle,
.status-line {
  color: var(--muted);
  font-size: 13px;
}

.messages {
  padding: 20px;
  display: grid;
  gap: 14px;
  align-content: start;
  background: #12151c;
}

.message {
  max-width: 760px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.message.user {
  justify-self: end;
  background: rgba(79, 140, 255, 0.14);
  border-color: rgba(79, 140, 255, 0.35);
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 14px;
  font: inherit;
}

.composer-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

.primary-btn {
  background: var(--accent);
  color: white;
}

.primary-btn:hover { background: var(--accent-2); }

.secondary-btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.file-btn input { display: none; }

.attachment-preview {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.hidden { display: none; }

.recording {
  color: #ff7979;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}
