:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #555;
  --ink-faint: #9c9c9c;
  --accent: #c9a99a;
  --accent-deep: #8b6f60;
  --bot-bubble: #efece4;
  --user-bubble: #1a1a1a;
  --user-ink: #fafaf7;
  --border: #e5e1d7;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --radius: 18px;
  --radius-card: 12px;
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg);
}

/* ============ topbar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.brand-meta { line-height: 1.2; }
.brand-sub {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status {
  font-size: 12px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #36a36a;
  border-radius: 50%;
  display: inline-block;
}
.status.offline::before { background: #c84545; }

/* ============ thread ============ */
.thread {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: fade-in 200ms ease-out;
}

.msg.bot {
  background: var(--bot-bubble);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.msg.user {
  background: var(--user-bubble);
  color: var(--user-ink);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.msg.system {
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  align-self: center;
  text-align: center;
  font-style: italic;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* booking deep-link cards */
.booking-card {
  align-self: flex-start;
  max-width: 88%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.booking-card:hover, .booking-card:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.08);
}
.booking-card-text {
  display: flex;
  flex-direction: column;
}
.booking-card-label {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}
.booking-card-sub {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}
.booking-card-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--user-ink);
  border-radius: 50%;
  font-size: 16px;
  flex-shrink: 0;
}

/* typing indicator */
.typing {
  align-self: flex-start;
  background: var(--bot-bubble);
  border-radius: var(--radius);
  border-bottom-left-radius: 6px;
  padding: 14px 18px;
  display: inline-flex;
  gap: 4px;
}
.typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--ink-faint);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* ============ composer ============ */
.composer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

#composer-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

#composer-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 11px 18px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease;
}
#composer-input:focus {
  border-color: var(--accent-deep);
}
#composer-input::placeholder { color: var(--ink-faint); }

#composer-send {
  background: var(--ink);
  color: var(--user-ink);
  border: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 100ms ease, opacity 120ms ease;
}
#composer-send:hover { transform: scale(1.04); }
#composer-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
#composer-send svg { display: block; }

.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.composer-foot a {
  color: var(--ink-soft);
  text-decoration: none;
}
.composer-foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (min-width: 480px) {
  body { box-shadow: var(--shadow); }
}
