:root {
  --ink: #17201d;
  --muted: #70807a;
  --cream: #f5f1e9;
  --paper: #fffefa;
  --green: #245b49;
  --green-dark: #122a23;
  --lime: #cce66b;
  --line: rgba(23, 32, 29, 0.11);
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: #dfe5df;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 10% 10%, #f2efe4 0, transparent 36%), #dce4de;
}
button, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1440px, calc(100% - 32px));
  height: calc(100dvh - 32px);
  min-height: 0;
  margin: 16px auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(21, 43, 34, 0.18);
  background: var(--paper);
}

.intro-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  padding: 42px 48px 48px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  color: #f7f4ea;
  background: linear-gradient(150deg, #153a2e 0%, #10231e 76%);
}
.intro-panel::-webkit-scrollbar { display: none; }
.intro-panel::before, .intro-panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(204, 230, 107, 0.22);
  border-radius: 50%;
}
.intro-panel::before { width: 420px; height: 420px; right: -250px; top: 130px; }
.intro-panel::after { width: 280px; height: 280px; right: -140px; top: 200px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--lime); border-radius: 50%; color: var(--lime); letter-spacing: 0; }
.intro-copy { align-self: end; margin: 28px 0 clamp(22px, 4vh, 48px); position: relative; z-index: 1; }
.eyebrow { color: var(--lime); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; }
.intro-copy h1 { margin: 16px 0 22px; font: 600 clamp(38px, 4vw, 56px)/1.04 "Playfair Display", serif; letter-spacing: -0.03em; }
.intro-copy > p:last-child { max-width: 390px; color: rgba(247, 244, 234, 0.68); font-size: 14px; line-height: 1.7; }
.feature-list { position: relative; z-index: 1; display: grid; gap: 14px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px; }
.feature-list div { display: flex; gap: 16px; align-items: center; }
.feature-list span { color: var(--lime); font-size: 10px; }
.feature-list p { margin: 0; font-size: 12px; color: rgba(247,244,234,.75); }
.environment { margin: 26px 0 0; font-size: 9px; letter-spacing: .18em; color: rgba(247,244,234,.3); }

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}
.chat-header { min-height: 88px; display: flex; align-items: center; gap: 14px; padding: 18px 26px; border-bottom: 1px solid var(--line); }
.agent-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--green); color: white; font: 600 22px "Playfair Display", serif; }
.chat-header h2 { margin: 0 0 3px; font-size: 15px; }
.chat-header p { margin: 0; color: var(--muted); font-size: 11px; }
.online-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #75bd73; box-shadow: 0 0 0 3px rgba(117,189,115,.14); }
.icon-button { margin-left: auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-size: 20px; transition: .2s; }
.icon-button:hover { color: var(--green); border-color: rgba(36,91,73,.35); transform: rotate(-25deg); }

.messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 26px;
  scroll-behavior: smooth;
}
.message-row { display: flex; margin-bottom: 16px; animation: rise .28s ease both; }
.message-row.user { justify-content: flex-end; }
.bubble { max-width: min(78%, 460px); padding: 12px 15px; border-radius: 17px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.assistant .bubble { background: var(--cream); border-bottom-left-radius: 5px; }
.user .bubble { background: var(--green); color: white; border-bottom-right-radius: 5px; }
.bubble-link {
  color: #17634e;
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.bubble-link:hover { color: var(--green-dark); }
.bubble-link:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 2px; }
.user .bubble-link { color: #f2ffbf; }
.message-time { display: block; margin-top: 6px; font-size: 9px; opacity: .5; text-align: right; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.suggestions { display: flex; gap: 8px; padding: 0 26px 14px; overflow-x: auto; }
.suggestions button { flex: 0 0 auto; border: 1px solid rgba(36,91,73,.18); border-radius: 999px; padding: 8px 12px; color: var(--green); background: #f9fbf7; font-size: 10px; font-weight: 600; }
.suggestions button:hover { background: #eef4e9; }
.activity { min-height: 28px; display: flex; align-items: center; gap: 4px; padding: 0 28px 10px; color: var(--muted); font-size: 10px; }
.activity span { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: pulse 1s infinite alternate; }
.activity span:nth-child(2) { animation-delay: .2s; }
.activity span:nth-child(3) { animation-delay: .4s; }
.activity p { margin: 0 0 0 5px; }
@keyframes pulse { to { opacity: .2; transform: translateY(-2px); } }
.hidden { display: none; }
.system-status { min-height: 18px; padding: 0 28px 5px; color: #8a6a1f; font-size: 10px; }
.system-status:empty { display: none; }

.composer { display: flex; align-items: flex-end; gap: 10px; margin: 0 20px; padding: 7px 10px 7px 16px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 10px 30px rgba(19,50,39,.06); }
.composer:focus-within { border-color: rgba(36,91,73,.4); }
.composer textarea { width: 100%; min-height: 40px; max-height: 110px; padding: 10px 0; resize: none; overflow-y: auto; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 20px; font-size: 16px; }
.composer textarea::placeholder { color: #a0aba7; }
.composer button { flex: 0 0 40px; height: 40px; border: 0; border-radius: 13px; background: var(--green); color: white; font-size: 20px; transition: .2s; }
.composer button:hover { background: var(--green-dark); transform: translateY(-1px); }
.composer button:disabled { opacity: .45; cursor: default; transform: none; }
.disclaimer { margin: 10px 0 14px; text-align: center; color: #9ba5a1; font-size: 9px; }

@media (max-width: 760px) {
  body { background: var(--paper); }
  .app-shell { width: 100%; height: 100dvh; min-height: 0; margin: 0; display: block; border-radius: 0; box-shadow: none; }
  .intro-panel { display: none; }
  .chat-panel { height: 100%; }
  .chat-header { min-height: 76px; padding: 14px 18px; }
  .messages { padding: 20px 16px; }
  .suggestions { padding-inline: 16px; }
  .composer { margin-inline: 12px; }
  .bubble { max-width: 86%; }
}

@media (min-width: 761px) and (max-height: 900px) {
  .intro-panel { padding-block: 28px 32px; }
  .intro-copy { margin-top: 20px; margin-bottom: 24px; }
  .intro-copy h1 { font-size: clamp(34px, 3.7vw, 48px); margin-block: 12px 16px; }
  .intro-copy > p:last-child { line-height: 1.55; }
  .feature-list { gap: 10px; padding-top: 18px; }
  .environment { margin-top: 18px; }
}
