:root {
  color-scheme: light;
  --ink: #15372f;
  --green: #123f32;
  --green-soft: #22604d;
  --cream: #f8f3e7;
  --paper: rgba(255, 253, 247, 0.91);
  --gold: #f2b63f;
  --gold-soft: #ffe9a9;
  --line: rgba(18, 63, 50, 0.14);
  --muted: #6c7d76;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: radial-gradient(circle at 18% 12%, rgba(255, 226, 131, 0.58), transparent 34rem), linear-gradient(145deg, #faf7ee, #f1ead9);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}
.ambient-one {
  width: 26rem;
  height: 26rem;
  top: -10rem;
  right: -7rem;
  border: 1px solid rgba(18, 63, 50, 0.15);
  box-shadow: inset 0 0 0 4rem rgba(255, 255, 255, 0.12);
}
.ambient-two {
  width: 17rem;
  height: 17rem;
  bottom: -8rem;
  left: -6rem;
  background: rgba(18, 63, 50, 0.08);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 54px;
}
.brandbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 1.04rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.brand-mark { position: relative; display: inline-block; width: 42px; height: 46px; transform: rotate(-4deg); }
.glass-body {
  position: absolute;
  inset: 9px 5px 1px;
  border: 3px solid var(--green);
  border-top: 0;
  border-radius: 2px 2px 9px 9px;
  background: linear-gradient(to bottom, var(--gold-soft) 0 24%, var(--gold) 24% 100%);
  clip-path: polygon(3% 0, 97% 0, 85% 100%, 15% 100%);
}
.glass-foam {
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 4px;
  width: 35px;
  height: 15px;
  border: 3px solid var(--green);
  border-radius: 50%;
  background: #fff7dc;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--green-soft);
  font-size: 0.76rem;
  font-weight: 600;
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: #31a66f; box-shadow: 0 0 0 4px rgba(49, 166, 111, 0.13); }

.chat-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(420px, 1.22fr);
  grid-template-rows: minmax(430px, 66vh) auto auto;
  overflow: hidden;
  border: 1px solid rgba(18, 63, 50, 0.12);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(21, 55, 47, 0.16);
  backdrop-filter: blur(18px);
}
.chat-heading {
  grid-row: 1 / 4;
  padding: clamp(36px, 6vw, 76px) clamp(30px, 5vw, 64px);
  color: #fffaf0;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), transparent 45%), var(--green);
}
.eyebrow { margin: 0 0 22px; color: var(--gold); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.chat-heading h1 { max-width: 8ch; margin: 0; font-size: clamp(2.7rem, 5.7vw, 5.4rem); font-weight: 800; line-height: 0.96; letter-spacing: -0.065em; }
.chat-heading h1 em { color: var(--gold); font-style: normal; }
.chat-heading > p:last-child { max-width: 28rem; margin: 30px 0 0; color: rgba(255, 250, 240, 0.68); font-size: 0.94rem; line-height: 1.7; }

.conversation {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  padding: 48px 44px 28px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-color: rgba(18, 63, 50, 0.2) transparent;
}
.message { display: flex; align-items: flex-end; gap: 11px; max-width: 86%; animation: rise 260ms ease both; }
.message > div:last-child { min-width: 0; }
.message-label { display: block; margin: 0 0 6px 3px; color: var(--muted); font-size: 0.67rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.message p { margin: 0; padding: 14px 17px; border-radius: 6px 18px 18px; background: #fff; box-shadow: 0 8px 24px rgba(18, 63, 50, 0.08); line-height: 1.45; overflow-wrap: anywhere; }
.avatar { display: grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; border-radius: 12px; color: var(--green); background: var(--gold); font-size: 0.87rem; font-weight: 800; }
.user-message { align-self: flex-end; }
.user-message .message-label { text-align: right; }
.user-message p { border-radius: 18px 6px 18px 18px; color: #fff; background: var(--green-soft); }
.typing-message { align-items: center; }
.typing { display: flex; gap: 4px; padding: 15px 17px; border-radius: 6px 18px 18px; background: #fff; box-shadow: 0 8px 24px rgba(18, 63, 50, 0.08); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 900ms infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 120ms; }
.typing i:nth-child(3) { animation-delay: 240ms; }

.composer { display: flex; gap: 10px; margin: 0 44px; padding: 9px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 9px 30px rgba(18, 63, 50, 0.09); }
.composer:focus-within { border-color: rgba(18, 63, 50, 0.44); box-shadow: 0 0 0 4px rgba(18, 63, 50, 0.08), 0 9px 30px rgba(18, 63, 50, 0.09); }
.composer input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 8px 10px; color: var(--ink); background: transparent; }
.composer input::placeholder { color: #97a49f; }
.composer button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 16px; color: #fff; background: var(--green); font-weight: 700; cursor: pointer; transition: transform 150ms ease, background 150ms ease; }
.composer button:hover { background: var(--green-soft); transform: translateY(-1px); }
.composer button:active { transform: translateY(0); }
.composer svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.fine-print { margin: 14px 44px 22px; color: var(--muted); font-size: 0.69rem; text-align: center; }
.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; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 680px); padding-top: 20px; }
  .chat-card { grid-template-columns: 1fr; grid-template-rows: auto minmax(360px, 54vh) auto auto; border-radius: 24px; }
  .chat-heading { grid-row: auto; padding: 34px 30px; }
  .chat-heading h1 { max-width: 12ch; font-size: clamp(2.35rem, 10vw, 4rem); }
  .chat-heading > p:last-child { margin-top: 18px; }
  .conversation { padding: 30px 24px 24px; }
  .composer { margin: 0 24px; }
  .fine-print { margin-inline: 24px; }
}

@media (max-width: 480px) {
  .brandbar { margin-bottom: 16px; }
  .brand small, .status { display: none; }
  .chat-heading { padding: 28px 24px; }
  .chat-heading > p:last-child { display: none; }
  .conversation { padding: 24px 16px 20px; }
  .message { max-width: 94%; }
  .composer { margin: 0 16px; }
  .composer button { width: 46px; padding-inline: 0; }
  .composer button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
