:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  line-height: 1.4;
  background: #f3f4f6;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f4f6;
  color: #111827;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar,
.conversation {
  padding: 1rem;
}

.sidebar {
  border-right: 1px solid #d1d5db;
  background: #fff;
}

.conversation {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 1rem;
}

.panel-header h1,
.panel-header h2,
.composer-label {
  margin: 0;
}

.eyebrow,
.section-label {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.muted {
  margin: 0.25rem 0 0;
  color: #6b7280;
}

.thread-list,
.message-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.thread-card,
.message-card,
.status-banner,
.composer {
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  background: #fff;
}

.thread-card {
  width: 100%;
  padding: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.thread-card.active {
  border-color: #111827;
  background: #f9fafb;
}

.thread-card strong,
.message-card strong {
  display: block;
}

.thread-card span,
.message-card span,
.thread-card small,
.message-card small {
  display: block;
  color: #4b5563;
}

.message-list {
  min-height: 220px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.message-card {
  padding: 0.9rem;
}

.message-card.outbound {
  border-left: 4px solid #2563eb;
}

.message-card.inbound {
  border-left: 4px solid #059669;
}

.message-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.composer {
  padding: 1rem;
}

textarea {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #9ca3af;
  border-radius: 0.5rem;
  resize: vertical;
  font: inherit;
  background: #fff;
  color: inherit;
}

.composer-actions,
.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

button {
  border: 1px solid #111827;
  border-radius: 0.5rem;
  background: #111827;
  color: #fff;
  padding: 0.65rem 1rem;
  font: inherit;
  cursor: pointer;
}

button.secondary-button,
button.thread-card {
  background: #fff;
  color: #111827;
}

button:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-banner {
  padding: 0.85rem 1rem;
}

.status-banner.error {
  border-color: #b91c1c;
  background: #fef2f2;
  color: #991b1b;
}

.status-banner.success {
  border-color: #166534;
  background: #f0fdf4;
  color: #166534;
}

.empty {
  padding: 1rem;
  color: #6b7280;
  border: 1px dashed #d1d5db;
  border-radius: 0.75rem;
  background: #fff;
}

.hidden {
  display: none;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #d1d5db;
  }

  .message-list {
    max-height: none;
  }
}
