:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f5ef;
  color: #211f1b;
}

body {
  margin: 0;
  min-height: 100vh;
}

.shell {
  box-sizing: border-box;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 56px 24px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #7c6f5b;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.subtle {
  max-width: 620px;
  margin: 18px 0 0;
  color: #6d665a;
  font-size: 18px;
  line-height: 1.6;
}

.card {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid rgba(33, 31, 27, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 80px rgba(60, 46, 24, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

button {
  appearance: none;
  border: 1px solid rgba(33, 31, 27, 0.18);
  border-radius: 999px;
  background: #211f1b;
  color: #f7f5ef;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 12px 18px;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.auth-slot {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.loader {
  color: #6d665a;
}

.hidden {
  display: none;
}

h3 {
  margin: 0 0 12px;
  color: #6d665a;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 20px;
}

.conversation-list,
.message-list {
  display: grid;
  gap: 10px;
}

.conversation-list {
  max-height: 420px;
  overflow: auto;
}

.conversation-row {
  border: 1px solid rgba(33, 31, 27, 0.12);
  border-radius: 16px;
  background: rgba(247, 245, 239, 0.7);
  cursor: pointer;
  padding: 12px;
}

.conversation-row.active {
  border-color: #211f1b;
}

.conversation-title {
  font-weight: 800;
}

.conversation-date {
  margin-top: 4px;
  color: #7c6f5b;
  font-size: 12px;
}

.chat-pane {
  display: grid;
  gap: 14px;
}

.message-list {
  min-height: 240px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.message {
  border-radius: 18px;
  padding: 14px 16px;
  white-space: pre-wrap;
}

.message.user {
  background: #211f1b;
  color: #f7f5ef;
  justify-self: end;
  max-width: 80%;
}

.message.assistant {
  background: rgba(33, 31, 27, 0.08);
  color: #211f1b;
  justify-self: start;
  max-width: 86%;
}

textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(33, 31, 27, 0.18);
  border-radius: 18px;
  font: inherit;
  line-height: 1.5;
  padding: 14px 16px;
  resize: vertical;
}

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

pre {
  overflow: auto;
  margin: 0 0 18px;
  padding: 18px;
  border-radius: 18px;
  background: #211f1b;
  color: #f7f5ef;
  font-size: 13px;
  line-height: 1.5;
}

pre:last-child {
  margin-bottom: 0;
}

.error {
  color: #9f1d1d;
  white-space: pre-wrap;
}
