:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wine: #38243d;
  --wine-soft: #66506c;
  --gold: #b4863d;
  --cream: #fbf8f2;
  --line: #e8dfd3;
  --ink: #29242b;
  --muted: #756e77;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #eee8df; }
button, textarea { font: inherit; }
.chat-shell { width: min(100%, 480px); height: min(760px, 100vh); margin: auto; display: grid; grid-template-rows: auto 1fr auto auto auto; background: var(--cream); box-shadow: 0 22px 70px rgba(53, 37, 50, .18); }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 17px 18px; color: white; background: linear-gradient(135deg, var(--wine), #59405f); }
.avatar { display: block; width: 48px; height: 48px; border: 2px solid rgba(255,255,255,.72); border-radius: 50%; object-fit: cover; object-position: center 25%; background: #f8efe1; box-shadow: 0 3px 12px rgba(24,12,27,.22); }
h1 { margin: 0; font: 23px Georgia, serif; }
.chat-header p { margin: 2px 0 0; color: #dacfdc; font-size: 12px; }
.online { margin-left: auto; font-size: 12px; color: #eee7ef; }
.online i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #7fd59a; }
.messages { overflow-y: auto; padding: 18px 16px 8px; scroll-behavior: smooth; }
.message { display: flex; margin: 0 0 12px; }
.message.user { justify-content: flex-end; }
.bubble { max-width: 86%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px 17px 17px 17px; background: white; line-height: 1.5; font-size: 14px; white-space: pre-wrap; box-shadow: 0 5px 18px rgba(65,48,54,.05); }
.user .bubble { color: white; border: 0; border-radius: 17px 5px 17px 17px; background: var(--wine-soft); }
.bubble p { margin: 0 0 9px; }.bubble p:last-child { margin-bottom: 0; }
.bubble a { color: #805812; font-weight: 700; text-decoration-thickness: 1px; }
.pending .bubble { color: var(--muted); font-style: italic; }
.error .bubble { color: #902c34; border-color: #e9b9bd; background: #fff4f4; }
.quick-actions { display: flex; gap: 8px; padding: 8px 16px 10px; }
.quick-actions[hidden] { display: none; }
.quick-actions button { padding: 9px 13px; border: 1px solid #cbb79a; border-radius: 999px; color: #6f4d18; background: #fffaf0; cursor: pointer; }
.composer { display: flex; align-items: flex-end; gap: 9px; padding: 11px 13px; border-top: 1px solid var(--line); background: white; }
textarea { flex: 1; min-height: 43px; max-height: 120px; resize: none; padding: 11px 13px; border: 1px solid #d8cfc5; border-radius: 13px; color: var(--ink); background: #fcfaf7; outline: none; }
textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(180,134,61,.12); }
.composer button { min-height: 43px; padding: 0 16px; border: 0; border-radius: 12px; color: white; background: var(--wine); cursor: pointer; font-weight: 700; }
.composer button:disabled { opacity: .45; cursor: wait; }
footer { padding: 7px 14px 10px; color: var(--muted); background: white; text-align: center; font-size: 10px; }
.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 (min-height: 780px) and (min-width: 520px) { body { display: grid; place-items: center; padding: 20px; }.chat-shell { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; } }
