:root {
  --bg: #f5efe3;
  --paper: #fffaf0;
  --ink: #1f2a1f;
  --muted: #5e6757;
  --accent: #175c4c;
  --accent-strong: #0b3e33;
  --line: #d7c8aa;
  --user: #e4f1ec;
  --assistant: #fff8e7;
  --shadow: 0 18px 50px rgba(53, 46, 25, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(212, 138, 47, 0.22), transparent 28%),
    linear-gradient(180deg, #f7f1e6 0%, #f0e7d7 100%);
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
}

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

.hero {
  padding: 20px 0 28px;
}

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

.hero h1 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.98;
  max-width: 8ch;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-notes span {
  padding: 10px 14px;
  border: 1px solid rgba(23, 92, 76, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.chat-card {
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(215, 200, 170, 0.95);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.notice {
  padding: 16px 20px;
  background: #f6ebcf;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.5;
  color: #694d21;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 380px;
  max-height: 60vh;
  padding: 22px;
  overflow-y: auto;
}

.message {
  max-width: min(780px, 90%);
  padding: 16px 18px;
  border-radius: 22px;
  line-height: 1.6;
  white-space: pre-wrap;
  border: 1px solid transparent;
}

.message p {
  margin: 0;
}

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

.message.user {
  align-self: flex-end;
  background: var(--user);
  border-color: #b6d4ca;
}

.composer {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: rgba(250, 244, 231, 0.8);
}

.composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  border: 1px solid #c9b894;
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  line-height: 1.6;
  color: var(--ink);
  background: #fffdf7;
}

.composer textarea:focus,
.composer button:focus {
  outline: 3px solid rgba(23, 92, 76, 0.2);
  outline-offset: 2px;
}

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

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.composer button {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.composer button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.credit {
  margin: 18px 6px 0;
  color: var(--muted);
  text-align: right;
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .hero h1 {
    max-width: 100%;
  }

  .message {
    max-width: 100%;
  }

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

  .composer button {
    width: 100%;
  }
}
