:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  --ink: #30272c;
  --muted: #736a70;
  --plum: #28161f;
  --accent: #a41e39;
  --accent-dark: #7e172d;
  --cream: #fbf7f3;
  --line: #eadfe1;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100dvh; color: var(--ink); background: #eee7e2; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, textarea:focus-visible {
  outline: 3px solid #eeb15b;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(790px, calc(100vw - 32px));
  height: min(800px, calc(100dvh - 48px));
  min-height: 470px;
  margin: 24px auto;
  overflow: hidden;
  border: 1px solid #e8dfe0;
  border-radius: 22px;
  background: white;
  box-shadow: 0 20px 70px rgba(28, 19, 24, .14);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 106px;
  padding: 18px 22px;
  color: #fff;
  background: linear-gradient(126deg, #281720 0%, #43202e 68%, #682d3a 100%);
}
.brand-mark {
  display: flex;
  flex: 0 0 49px;
  align-items: center;
  justify-content: center;
  height: 49px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 15px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -.08em;
}
.brand-mark span { position: relative; top: -6px; font-size: 13px; color: #f1b466; }
.brand-copy { min-width: 0; flex: 1; }
.eyebrow { display: block; color: #ead0d8; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 750; }
.brand-copy h1 { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; line-height: 1.1; font-size: 24px; font-weight: 750; letter-spacing: -.035em; }
.brand-copy p { margin: 4px 0 0; color: #e5cdd4; font-size: 12px; }
.online-indicator { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f3b866; }
.header-actions { display: flex; align-items: center; gap: 5px; }
.text-button, .close-button { border: 1px solid rgba(255,255,255,.29); background: rgba(255,255,255,.08); color: #fff; border-radius: 9px; }
.text-button { padding: 8px 10px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.text-button:hover, .close-button:hover { background: rgba(255,255,255,.19); }
.text-button span { margin-right: 4px; font-size: 16px; }
.close-button { width: 36px; height: 36px; line-height: 1; font-size: 25px; }

.messages-scroll { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: #fff; padding: 22px 24px 30px; }
.welcome { flex: 0 0 auto; width: 100%; text-align: center; max-width: 540px; margin: auto; padding: 24px 0; }
.welcome-icon { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 18px; border-radius: 17px; background: #fff1e7; color: var(--accent-dark); font-size: 27px; font-weight: 750; }
.welcome-kicker { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; font-weight: 750; color: var(--accent); }
.welcome h2 { margin: 9px 0 8px; font-size: clamp(23px, 4vw, 29px); letter-spacing: -.045em; line-height: 1.25; }
.welcome p { max-width: 430px; margin: 0 auto; color: var(--muted); font-size: 14px; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 25px 0 0; }
.starter { border: 1px solid #e4d4d8; border-radius: 24px; background: #fff; color: #5c2533; padding: 9px 13px; font-size: 12px; font-weight: 650; }
.starter:hover { background: #f9eff0; border-color: #d4abb4; }

.conversation { display: flex; flex: 0 0 auto; flex-direction: column; gap: 18px; }
.message-row { display: flex; flex-direction: column; gap: 5px; }
.message-row.user { align-items: flex-end; }
.message-row.assistant { align-items: flex-start; }
.message-name { font-size: 10px; color: var(--muted); font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.message-bubble { width: fit-content; max-width: 91%; padding: 13px 16px; border-radius: 16px; font-size: 13px; overflow-wrap: anywhere; }
.message-row.user .message-bubble { color: #fff; background: #452332; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.message-row.assistant .message-bubble { background: var(--cream); border: 1px solid #eee6df; border-bottom-left-radius: 4px; }
.message-bubble p { margin: 0 0 9px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble h3, .message-bubble h4 { font-size: 13px; margin: 12px 0 6px; }
.message-bubble h3:first-child, .message-bubble h4:first-child { margin-top: 0; }
.message-bubble ul, .message-bubble ol { padding-left: 21px; margin: 7px 0 11px; }
.message-bubble li { margin: 3px 0; }
.message-bubble li:last-child { margin-bottom: 0; }
.message-bubble a { color: #8c1b36; text-decoration: underline; text-underline-offset: 2px; font-weight: 650; }
.message-bubble strong { font-weight: 760; }

.chat-footer { padding: 12px 19px 14px; border-top: 1px solid var(--line); background: #fff; }
.footer-top { display: flex; align-items: center; justify-content: space-between; min-height: 25px; gap: 8px; margin-bottom: 7px; }
.status { margin: 0; min-height: 16px; color: var(--muted); font-size: 11px; }
.status.is-error { color: #9b2031; }
.pricing-link { white-space: nowrap; font-size: 11px; font-weight: 800; text-decoration: none; }
.pricing-link:hover { text-decoration: underline; }
#chat-form { display: flex; align-items: flex-end; gap: 9px; padding: 6px; border: 1px solid #d8c9cc; border-radius: 13px; background: #fff; }
#chat-form:focus-within { border-color: #a41e39; box-shadow: 0 0 0 3px #a41e3914; }
#message { min-width: 0; width: 100%; min-height: 48px; max-height: 130px; resize: vertical; border: 0; background: transparent; color: var(--ink); outline: 0; padding: 10px; font-size: 13px; line-height: 1.5; }
#message:focus-visible { outline: 0; }
#message::placeholder { color: #90858c; }
.send-button { display: flex; align-items: center; justify-content: center; gap: 7px; align-self: stretch; min-width: 80px; border: 0; border-radius: 9px; padding: 0 12px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.send-button:hover { background: var(--accent-dark); }
.send-button span { font-size: 12px; }
.disclaimer { font-size: 10px; line-height: 1.45; margin: 10px 3px 0; color: var(--muted); }
.disclaimer a { font-weight: 650; }

body.embed .app-shell { width: 100%; height: 100dvh; min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
body.embed .chat-header { min-height: 89px; padding: 13px 16px; gap: 10px; }
body.embed .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 23px; }
body.embed .brand-mark span { font-size: 11px; top: -5px; }
body.embed .brand-copy h1 { font-size: 20px; }
body.embed .messages-scroll { padding: 18px 16px 25px; }
body.embed .welcome { padding-top: 32px; }
body.embed .chat-footer { padding: 9px 12px 12px; }
body.embed .message-bubble { max-width: 95%; }
body.embed .eyebrow { font-size: 9px; }

@media (max-width: 600px) {
  .app-shell { width: 100%; height: 100dvh; min-height: 0; margin: 0; border: 0; border-radius: 0; }
  .chat-header { padding: 12px 14px; min-height: 87px; gap: 10px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 23px; }
  .brand-mark span { font-size: 11px; top: -5px; }
  .brand-copy h1 { font-size: 20px; }
  .brand-copy p { font-size: 11px; }
  .text-button { font-size: 11px; padding: 7px 8px; }
  .messages-scroll { padding: 15px 13px 25px; }
  .chat-footer { padding: 9px 11px 12px; }
  .message-bubble { max-width: 96%; }
  .welcome { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
