
:root {
  color-scheme: dark;
  --background: #0b1120;
  --surface: #141e30;
  --surface-light: #1c2940;
  --border: #293850;
  --text: #f1f5f9;
  --muted: #91a0b7;
  --accent: #60a5fa;
  --green: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

button, input, textarea {
  font: inherit;
}

.app {
  width: 100%;
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 22px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 900;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

.brand h1 {
  margin-bottom: 3px;
  font-size: 17px;
}

.brand p, .welcome > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
}

.welcome {
  padding: 34px 0 26px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

.welcome h2 {
  margin-bottom: 10px;
  font-size: clamp(23px, 5vw, 32px);
  letter-spacing: -1px;
}

.welcome > p:last-child {
  max-width: 550px;
  line-height: 1.7;
  font-size: 14px;
}

.agents, .chat-section, .settings {
  margin-bottom: 24px;
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 17px;
}

.section-heading h3, .settings h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.section-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.agent-icon {
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #263d61;
  color: #bfdbfe;
  font-weight: 800;
}

.agent-card h4 {
  margin-bottom: 4px;
  font-size: 13px;
}

.agent-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
}

.agent-state {
  margin-left: auto;
  color: var(--green);
  font-size: 10px;
}

.agent-state.manual {
  color: #93c5fd;
}

.agent-state.pending {
  color: #fbbf24;
}

.connection {
  color: #fbbf24 !important;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 130px;
  max-height: 420px;
  overflow-y: auto;
  padding: 14px 0;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #263d61;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
}

.message-content {
  min-width: 0;
  padding: 11px 13px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 4px 13px 13px;
}

.message-content strong {
  font-size: 12px;
}

.message-content p {
  margin: 7px 0 0;
  color: #d2dbea;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.user {
  flex-direction: row-reverse;
}

.message.user .message-avatar {
  background: #174b3c;
  color: #a7f3d0;
}

.message.user .message-content {
  background: #183a3a;
  border-radius: 13px 4px 13px 13px;
}

.composer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

textarea, input {
  width: 100%;
  padding: 13px;
  color: var(--text);
  background: #0e1728;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 85px;
}

textarea:focus, input:focus {
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 12px 17px;
  color: white;
  background: #2563eb;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.privacy-note, .settings-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.settings h3 {
  margin-bottom: 17px;
}

.settings label {
  display: block;
  margin: 13px 0 7px;
  color: #cbd5e1;
  font-size: 12px;
}

.secondary-button {
  width: 100%;
  margin-top: 14px;
  background: #293850;
  border: 1px solid #40516d;
}

footer {
  padding: 10px 0 25px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

@media (max-width: 430px) {
  .app {
    padding: 13px;
  }

  .agents, .chat-section, .settings {
    padding: 14px;
  }

  .agent-card {
    flex-wrap: wrap;
  }

  .agent-state {
    margin-left: 45px;
  }
}
