:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65726c;
  --cream: #f5f2e9;
  --paper: #fffdf8;
  --green: #174d3b;
  --green-light: #dce9e1;
  --gold: #d6a84e;
  --line: #dedfd8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(214, 168, 78, 0.13), transparent 30%),
    var(--cream);
  font-family: "DM Sans", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-family: "Playfair Display", serif;
  font-size: 23px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
}

.brand-mark.large { width: 56px; height: 56px; margin: 0 auto 14px; }
.brand span:last-child { display: grid; }
.brand strong { font-size: 18px; }
.brand small { color: var(--muted); }

.text-button {
  border: 0;
  color: var(--green);
  background: transparent;
  font-weight: 600;
}

.hero { padding: 56px 0 34px; text-align: center; }
.hero h1 {
  margin: 4px 0 10px;
  font: 600 clamp(42px, 7vw, 72px)/1.05 "Playfair Display", serif;
  letter-spacing: -2px;
}
.hero p { margin: 0 auto; max-width: 590px; color: var(--muted); font-size: 17px; }
.hero .eyebrow { color: var(--green); font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

.chat-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 20px 50px rgba(30, 45, 38, 0.1);
}

.messages {
  height: min(50vh, 480px);
  min-height: 340px;
  overflow-y: auto;
  padding: 26px;
}

.message { display: flex; gap: 10px; margin-bottom: 20px; align-items: flex-start; }
.message.user { flex-direction: row-reverse; }
.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-family: "Playfair Display", serif;
}
.user .avatar { background: #8a6b35; }
.bubble {
  max-width: min(75%, 660px);
  padding: 12px 15px;
  border-radius: 4px 16px 16px 16px;
  background: var(--green-light);
  line-height: 1.55;
  white-space: pre-wrap;
}
.user .bubble { border-radius: 16px 4px 16px 16px; color: white; background: var(--green); }

.composer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: white;
}

textarea {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  resize: none;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}
textarea:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,77,59,.1); }

.composer button, dialog button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--green);
  font-weight: 700;
}
button:disabled { opacity: .55; cursor: wait; }
.status { min-height: 20px; margin: 0; padding: 0 18px 12px; color: var(--muted); font-size: 13px; }
.footnote { color: var(--muted); text-align: center; font-size: 12px; }

dialog {
  width: min(410px, calc(100% - 32px));
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(17,31,25,.72); backdrop-filter: blur(4px); }
dialog form { display: grid; padding: 32px; }
dialog h2 { margin: 0 0 8px; text-align: center; font: 600 30px "Playfair Display", serif; }
dialog p { margin: 0 0 22px; color: var(--muted); text-align: center; }
dialog label { margin-bottom: 7px; font-weight: 600; }
dialog input { min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; }
dialog button { margin-top: 16px; }
dialog .error { min-height: 18px; margin: 6px 0 0; color: #a12c2c; font-size: 13px; text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 600px) {
  .topbar { padding: 18px 0; }
  .brand small { display: none; }
  .hero { padding: 32px 0 24px; }
  .messages { min-height: 380px; padding: 18px; }
  .bubble { max-width: 86%; }
  .composer { gap: 8px; }
  .composer button { padding: 0 16px; }
}
