:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  --theatre-beige: #e3ddd5;
  --theatre-paper: #f8f5ef;
  --theatre-blue: #4f9fc7;
  --theatre-blue-dark: #357fa4;
  --theatre-blue-light: #9acae2;
  --theatre-brown: #805e47;
  --ink: #000000;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--theatre-paper); color: var(--ink); }
.demo { max-width: 760px; margin: 80px auto; padding: 32px; text-align: center; }
.demo h1 { font-family: Georgia, serif; font-size: 42px; margin-bottom: 8px; }

.launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 10;
  display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 14px 19px; color: white; font-weight: 700;
  background: linear-gradient(135deg, #69b2d5, var(--theatre-blue));
  border: 2px solid white; box-shadow: 0 10px 30px #365f7338, 0 0 0 3px #9acae24d;
  color: #000000;
  cursor: pointer; transition: transform .2s ease, box-shadow .2s ease;
}
.launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px #365f7348, 0 0 0 4px #9acae266; }
.launcher:focus-visible { outline: 4px solid var(--theatre-blue-light); outline-offset: 3px; }

.chat {
  position: fixed; right: 24px; bottom: 84px; z-index: 9;
  width: min(390px, calc(100vw - 24px)); height: min(650px, calc(100vh - 110px));
  display: grid; grid-template-rows: auto 1fr auto auto;
  overflow: hidden; border: 1px solid var(--theatre-beige); border-radius: 18px;
  background: var(--theatre-paper); box-shadow: 0 18px 55px #365f7330;
}
.chat[hidden] { display: none; }
.chat__header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; background: var(--theatre-blue); color: #000000; border-top: 4px solid var(--theatre-blue-dark); }
.chat__header strong { display: block; font-family: Georgia, serif; font-size: 19px; }
.chat__header span { display: block; margin-top: 2px; font-size: 12px; opacity: .82; }
.chat__header button { border: 0; background: transparent; color: #000000; font-size: 28px; cursor: pointer; }
.chat__messages { overflow-y: auto; padding: 16px; }
.message { max-width: 88%; margin: 0 0 12px; padding: 11px 13px; border-radius: 14px; white-space: pre-wrap; line-height: 1.4; }
.message--bot { background: white; border: 1px solid var(--theatre-beige); border-bottom-left-radius: 4px; }
.message--user { margin-left: auto; background: var(--theatre-blue); color: #000000; border-bottom-right-radius: 4px; }
.card { margin: 0 0 10px; padding: 12px; border-left: 4px solid var(--theatre-blue-dark); border-radius: 8px; background: white; box-shadow: 0 3px 12px #365f7318; }
.card strong, .card span { display: block; }
.card span { margin-top: 4px; font-size: 13px; color: #675958; }
.card a { display: inline-block; margin-top: 9px; color: #315f77; font-weight: 700; }
.quick { display: flex; gap: 7px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid #eadfd2; }
.quick button { flex: 0 0 auto; border: 1px solid var(--theatre-beige); border-radius: 999px; padding: 7px 10px; background: white; color: #000000; cursor: pointer; }
.quick button:hover { border-color: var(--theatre-blue-dark); background: #eaf6fb; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-top: 1px solid #eadfd2; background: white; }
.composer input { min-width: 0; border: 1px solid var(--theatre-beige); border-radius: 999px; padding: 11px 14px; font-size: 15px; }
.composer input:focus { outline: 3px solid #9acae266; border-color: var(--theatre-blue); }
.composer button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--theatre-blue); color: #000000; font-size: 20px; cursor: pointer; }
.composer button:hover { background: var(--theatre-blue-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@media (max-width: 520px) {
  .chat { right: 12px; bottom: 76px; width: calc(100vw - 24px); height: calc(100vh - 96px); }
  .launcher { right: 12px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .launcher { transition: none; }
}
