/* Copied from design/1-welcome, 2-chat and 3-handoff. Colors: white, black, grey and charcoal only. */
:root {
  --charcoal-fade: linear-gradient(160deg, #3b3b3b 0%, #1c1c1c 55%, #0b0b0b 100%);
  --button-fade: linear-gradient(180deg, #3a3a3a 0%, #111111 100%);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  /* Design v2: soft grey with a charcoal glow from the top right. */
  background:
    radial-gradient(1100px 560px at 75% -160px, rgba(40,40,40,0.38) 0%, rgba(40,40,40,0) 70%),
    radial-gradient(900px 500px at 0% 110%, rgba(40,40,40,0.10) 0%, rgba(40,40,40,0) 70%),
    #f5f5f5;
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: 'Inter', system-ui, sans-serif;
  color: #111111;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid #111111; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font-family: inherit; }

/* On a laptop the chat is a centered phone-sized column. */
.app {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  /* The chat itself: grey with a smaller glow, so the white bubbles lift off it. */
  background: radial-gradient(520px 360px at 90% -80px, rgba(40,40,40,0.22) 0%, rgba(40,40,40,0) 70%), #f5f5f5;
  overflow: hidden;
}
@media (min-width: 600px) {
  .app { border-left: 1px solid #e2e2e2; border-right: 1px solid #e2e2e2; box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 16px 18px 8px;
  background: var(--charcoal-fade);
  color: #ffffff;
}
.header.no-back { padding-left: 16px; }
.header :focus-visible, .card :focus-visible { outline-color: #ffffff; }
.back {
  width: 44px; height: 44px; border: 0; background: transparent; padding: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.logo {
  width: 40px; height: 40px; flex: none; border-radius: 10px; background: #ffffff; color: #111111;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600;
}
.title { flex: 1; min-width: 0; }
.name { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #b5b5b5; margin-top: 2px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #ffffff; }
.call {
  width: 44px; height: 44px; flex: none; border: 1px solid rgba(255,255,255,0.22); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}

/* Messages */
.messages {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px; padding: 20px 18px 10px;
}
.plain { font-size: 16px; line-height: 1.45; }
.stamp { align-self: center; font-size: 12px; color: #6b6b6b; margin-bottom: 2px; }
.bubble { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
/* The mockup's bubbles measure 327px (assistant) and 296px (lead) wide at 390px: 92.4% and 83.7% of the padded column. */
.bubble.assistant, .bubble.staff {
  align-self: flex-start; max-width: 92.4%; background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.04);
  padding: 11px 15px; border-radius: 18px 18px 18px 4px;
}
.bubble.lead {
  align-self: flex-end; max-width: 83.7%; background: #1c1c1c; color: #ffffff; line-height: 1.4;
  padding: 11px 15px; border-radius: 18px 18px 4px 18px;
}
.sender { align-self: flex-start; font-size: 12px; color: #6b6b6b; margin: 4px 0 -4px 2px; }
.send-error { align-self: flex-end; max-width: 84%; text-align: right; font-size: 13px; line-height: 1.4; color: #3d3d3d; }
.retry {
  align-self: flex-end; min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: #111111;
  font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* Privacy notice (design/1-welcome) */
.notice {
  align-self: stretch; border: 1px solid #e7e7e7; border-radius: 14px; padding: 14px 16px; background: #ffffff;
  font-size: 14px; line-height: 1.5; color: #3d3d3d; margin-top: 4px;
}
.notice a { color: #111111; font-weight: 500; text-underline-offset: 3px; }

/* Quick replies */
.chips-label { font-size: 13px; color: #6b6b6b; margin-top: 8px; padding-left: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; background: #ffffff; color: #111111;
  border: 1px solid #d6d6d6; box-shadow: 0 1px 2px rgba(0,0,0,0.04); font-size: 15px; font-weight: 500; cursor: pointer;
}
.chip.primary { background: var(--button-fade); color: #ffffff; border-color: #111111; box-shadow: none; }
.chip:hover:not(.primary) { background: #fafafa; }

/* Cards (design/2-chat booking card, design/3-handoff card) */
.card {
  align-self: stretch; background: var(--charcoal-fade); color: #ffffff; border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18); margin-top: 4px; display: flex; flex-direction: column;
}
.card.booking { align-self: flex-start; width: 86%; padding: 16px; gap: 12px; }
.card.handoff { padding: 18px; gap: 14px; }
.card-head { display: flex; align-items: center; gap: 14px; }
.card.handoff .card-head { align-items: flex-start; gap: 12px; }
.date-badge {
  width: 52px; height: 56px; flex: none; border-radius: 10px; background: #ffffff; color: #111111;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.date-badge .weekday { font-size: 11px; color: #6b6b6b; }
.date-badge .day { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.tick {
  width: 36px; height: 36px; flex: none; border-radius: 50%; background: #ffffff;
  display: flex; align-items: center; justify-content: center;
}
.card-title { font-size: 16px; font-weight: 600; }
.card-detail { font-size: 14px; color: #b5b5b5; margin-top: 3px; line-height: 1.45; }
.card.handoff .card-detail { color: #c4c4c4; }
.card-btn {
  min-height: 44px; border: 0; border-radius: 10px; background: #ffffff; color: #111111; font-size: 15px;
  font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.card-link {
  min-height: 44px; margin-top: -12px; border: 0; background: transparent; color: #d4d4d4; font-size: 14px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

/* Typing indicator */
.typing {
  align-self: flex-start; background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); padding: 14px 16px; border-radius: 18px 18px 18px 4px;
  display: flex; gap: 5px;
}
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #9a9a9a; animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { background: #c4c4c4; animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.4; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }

/* Footer and composer */
.footnote { padding: 8px 24px; text-align: center; font-size: 12px; color: #6b6b6b; }
.composer {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px 10px; border-top: 1px solid #e7e7e7; background: #ffffff;
}
.powered { padding: 0 18px 14px; text-align: center; font-size: 12px; color: #6b6b6b; background: #ffffff; }
.composer input {
  flex: 1; min-width: 0; height: 48px; border-radius: 24px; border: 1px solid #e7e7e7; background: #f4f4f4;
  padding: 0 20px; font-family: inherit; font-size: 16px; color: #111111;
}
.composer input::placeholder { color: #6b6b6b; opacity: 1; }
.send {
  width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: var(--button-fade);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.send:disabled { opacity: 0.5; cursor: default; }
@supports (padding: max(0px)) {
  .powered { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}

.powered { display: flex; align-items: center; justify-content: center; gap: 6px; }
.powered-mark { width: 16px; height: 16px; flex: none; }
