/* ─── GUEST CHAT PAGE ─── */
html, body.guest-body { height: 100%; overflow: hidden; }

body.guest-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* dynamic viewport for mobile */
}

/* ─── GUEST HEADER ─── */
.guest-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 20px;
  flex-shrink: 0;
}

.guest-header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 64px;
}

.guest-property-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guest-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.guest-prop-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.guest-status {
  font-size: 12px;
  color: var(--fg-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-sm.on {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── CHAT WINDOW ─── */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  scroll-behavior: smooth;
}

/* Inner content max-width centering */
.messages,
.chat-start {
  max-width: 640px;
  margin: 0 auto;
}

/* ─── START SCREEN ─── */
.chat-start { padding: 16px 0; }

.chat-welcome {
  background: var(--bg-card);
  border: 1px solid rgba(212,148,58,0.15);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 24px;
}

.chat-welcome-icon { font-size: 40px; margin-bottom: 12px; }

.chat-welcome h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.chat-welcome p {
  color: var(--fg-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.start-form {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* ─── QUICK PROMPTS ─── */
.quick-prompts { text-align: center; }

.quick-label {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 100px;
  color: var(--fg-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  margin: 4px;
  transition: border-color 0.2s, color 0.2s;
}

.quick-btn:hover {
  border-color: rgba(212,148,58,0.3);
  color: var(--accent);
}

/* ─── MESSAGES ─── */
.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.msg { display: flex; flex-direction: column; max-width: 85%; }
.msg.guest { align-self: flex-end; align-items: flex-end; }
.msg.ai { align-self: flex-start; align-items: flex-start; }
.msg.system-note { align-self: center; max-width: 100%; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
}

.msg.guest .msg-bubble {
  background: var(--accent);
  color: #0c0c0f;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.msg.ai .msg-bubble {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--fg-primary);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 4px;
  padding: 0 4px;
}

/* ─── TYPING INDICATOR ─── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  min-width: 60px;
}

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

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── SYSTEM NOTE ─── */
.system-note-text {
  font-size: 13px;
  color: var(--fg-secondary);
  background: rgba(212,148,58,0.08);
  border: 1px solid rgba(212,148,58,0.2);
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
}

/* ─── INPUT BAR ─── */
.chat-input-bar {
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.chat-input-form {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
  transition: border-color 0.2s;
}

.chat-input-form:focus-within { border-color: rgba(212,148,58,0.4); }

#messageInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 0;
}

#messageInput::placeholder { color: var(--fg-muted); }

.send-btn {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #0c0c0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.send-btn:hover { background: var(--accent-soft); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-resolved-note {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  color: var(--fg-muted);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  .chat-window { padding: 16px 12px; }
  .chat-input-bar { padding: 10px 12px; }
  .msg { max-width: 92%; }
  .chat-welcome { padding: 20px; }
  .start-form { padding: 20px; }
}
