:root {
  --bg: #f4ede1;
  --panel: rgba(255, 250, 240, 0.88);
  --panel-strong: #fff8ef;
  --text: #1f1a17;
  --muted: #6d6259;
  --accent: #0f766e;
  --accent-2: #d97706;
  --border: rgba(31, 26, 23, 0.12);
  --shadow: 0 24px 60px rgba(54, 43, 30, 0.12);
  --user: #1f766c;
  --assistant: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.2), transparent 24%),
    linear-gradient(180deg, #f8f2e8 0%, var(--bg) 100%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 48px;
}

.hero {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.95;
}

.lead {
  max-width: 700px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.badge,
button {
  border-radius: 999px;
  font: inherit;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.ghost,
#sendButton {
  cursor: pointer;
  border: 0;
  padding: 12px 18px;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.ghost {
  background: rgba(31, 26, 23, 0.06);
  color: var(--text);
}

#sendButton {
  background: linear-gradient(135deg, var(--accent), #155e75);
  color: #fff;
  min-width: 144px;
}

.ghost:hover,
#sendButton:hover {
  transform: translateY(-1px);
}

.ghost:disabled,
#sendButton:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.chat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.messages {
  min-height: 440px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: min(780px, 100%);
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  animation: rise 0.24s ease-out;
}

.message.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--user) 88%, white 12%);
  color: #fff;
  border-color: transparent;
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant);
}

.message-role {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.message-body {
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
  word-break: break-word;
}

.composer {
  padding: 22px 24px 24px;
  border-top: 1px solid var(--border);
  background: var(--panel-strong);
}

.composer-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  border: 1px solid rgba(31, 26, 23, 0.14);
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  color: var(--text);
  background: #fffdf9;
  outline: none;
}

textarea:focus {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 18px;
  }

  .hero,
  .messages,
  .composer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .composer-actions,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #sendButton,
  .ghost {
    width: 100%;
  }
}
