:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9dde4;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --agent: #ffffff;
  --user: #183b56;
  --user-ink: #ffffff;
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.10), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-panel {
  width: min(940px, 100%);
  height: min(860px, calc(100vh - 48px));
  min-height: 560px;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #16a34a;
}

.status.is-error .dot {
  background: #dc2626;
}

.summary-strip {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-chip {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #344054;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.2;
}

.summary-chip a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.messages {
  overflow-y: auto;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.message-row {
  display: flex;
}

.message-row.user {
  justify-content: flex-end;
}

.bubble {
  width: fit-content;
  max-width: min(680px, 86%);
  border: 1px solid var(--line);
  padding: 12px 14px 8px;
  background: var(--agent);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.user .bubble {
  border-color: var(--user);
  background: var(--user);
  color: var(--user-ink);
}

.meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.user .meta {
  color: rgba(255, 255, 255, 0.76);
}

.cards {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.media-card,
.booking-card,
.payment-card {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 12px;
}

.media-card img,
.media-card video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  background: #eef2f7;
}

.card-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  font-size: 13px;
}

.card-grid span {
  color: var(--muted);
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
}

.typing {
  padding: 0 20px 12px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.composer {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  background: #fbfcfd;
}

textarea {
  width: 100%;
  min-height: 42px;
  max-height: 140px;
  resize: none;
  border: 1px solid var(--line);
  padding: 11px 12px;
  outline: none;
  color: var(--ink);
  background: #ffffff;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.icon-button,
.send-button {
  border: 0;
  min-height: 42px;
  cursor: pointer;
  font-weight: 800;
}

.icon-button {
  background: #e6eaf0;
  color: #344054;
}

.send-button {
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
}

.send-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.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 (max-width: 720px) {
  .shell {
    padding: 0;
  }

  .chat-panel {
    height: 100vh;
    min-height: 100vh;
    border: 0;
  }

  .chat-header {
    align-items: flex-start;
  }

  h1 {
    font-size: 19px;
  }

  .messages {
    padding: 16px 12px;
  }

  .bubble {
    max-width: 92%;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .composer {
    grid-template-columns: 38px 1fr auto;
    padding: 10px;
  }

  .send-button {
    padding: 0 12px;
  }
}
