/* ── Chat page overrides & specific styles ── */
html, body { height: 100%; }
body { overflow: hidden; }
img { display: block; max-width: 100%; }

/* Chat layout */
.chat-container {
  display: flex; flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding-top: var(--nav-h);
  position: relative;
  z-index: 1;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column;
  gap: 16px;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Welcome */
.welcome {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 24px;
}
.welcome-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  position: relative;
}
.welcome-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-icon svg { width: 24px; height: 24px; position: relative; z-index: 1; }
.welcome h2 {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.03em;
}
.welcome p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 400px;
  font-weight: 300;
  line-height: 1.7;
}
.suggestions {
  display: flex; flex-wrap: wrap;
  gap: 8px; justify-content: center;
  max-width: 720px;
  margin: 0 auto 12px;
  transition: opacity 0.3s, max-height 0.3s;
}
.suggestions.hidden { opacity: 0; max-height: 0; overflow: hidden; margin-bottom: 0; pointer-events: none; }
.suggestion-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.suggestion-btn:hover {
  border-color: rgba(129,140,248,0.3);
  color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(129,140,248,0.1);
}

/* Info toggle */
.info-toggle {
  font-family: var(--sans); font-size: 12px; font-weight: 400;
  color: var(--text-tertiary); background: none; border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.info-toggle:hover { border-color: rgba(129,140,248,0.3); color: var(--accent); }
.info-toggle svg { width: 14px; height: 14px; }
.info-panel {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s, margin 0.4s;
  text-align: center; margin-top: 0; padding: 0 20px;
}
.info-panel.open {
  max-height: 300px; opacity: 1; margin-top: 16px;
}
.info-panel p {
  font-size: 13px; color: var(--text-secondary); line-height: 1.7;
  font-weight: 300; margin-bottom: 12px;
  max-width: 480px; margin-left: auto; margin-right: auto;
}
.info-panel p:last-of-type { margin-bottom: 14px; }
.info-panel strong { color: var(--text); font-weight: 500; }
.info-stack { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 480px; margin: 0 auto; }
.tech-tag {
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  color: var(--text-tag); background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 4px 10px; border-radius: 6px;
}

/* Messages */
.message {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 12px;
}
.message.user { flex-direction: row-reverse; }
.message-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  font-family: var(--mono);
  margin-top: 2px;
}
.message.assistant .message-avatar {
  background: var(--accent-glow);
  border: 1px solid rgba(129, 140, 248, 0.2);
  color: var(--accent);
}
.message.user .message-avatar {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}
.message-content { flex: 1; min-width: 0; }
.message.user .message-content { text-align: right; }
.message-bubble {
  display: inline-block;
  text-align: left;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.75;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-weight: 300;
}
.message.assistant .message-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.message.user .message-bubble {
  background: var(--accent-dim);
  color: #fff;
  font-weight: 400;
}
.message-bubble p { margin-bottom: 8px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble strong { font-weight: 600; color: var(--text); }
.message.user .message-bubble strong { color: #fff; }
.message-bubble em { font-style: italic; }
.message-bubble code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
}
.message-bubble ul, .message-bubble ol { margin: 8px 0; padding-left: 20px; }
.message-bubble li { margin-bottom: 4px; }
.message-bubble a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(129,140,248,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.message-bubble a:hover { text-decoration-color: var(--accent); }
.message-bubble pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
  font-family: var(--mono);
  font-size: 12px;
}

/* Typing indicator */
.typing { display: flex; gap: 4px; padding: 14px 18px; }
.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: blink 1.4s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Input */
.chat-input-area {
  padding: 16px 24px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.chat-input-wrapper {
  max-width: 720px;
  margin: 0 auto;
  display: flex; gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color 0.3s;
}
.chat-input::placeholder { color: var(--text-tertiary); }
.chat-input:focus { border-color: rgba(129,140,248,0.3); box-shadow: 0 0 0 3px rgba(129,140,248,0.05); }
.chat-send {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
.chat-send:hover { background: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(129,140,248,0.3); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.chat-send svg { width: 18px; height: 18px; }

.chat-disclaimer {
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 10px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.02em;
}

/* Slot picker */
.slot-picker {
  margin: 12px 0;
  border: 1px solid rgba(129, 140, 248, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}
.slot-day-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid rgba(129, 140, 248, 0.1);
  background: rgba(129, 140, 248, 0.03);
}
.slot-day-tabs::-webkit-scrollbar { display: none; }
.slot-day-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
.slot-day-tab:hover { color: var(--text-secondary); }
.slot-day-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(129, 140, 248, 0.05);
}
.slot-day-tab .tab-date { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-tertiary); margin-top: 1px; font-weight: 400; }
.slot-day-tab.active .tab-date { color: rgba(129, 140, 248, 0.6); }
.slot-day-panel {
  display: none;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(129, 140, 248, 0.2) transparent;
}
.slot-day-panel::-webkit-scrollbar { width: 4px; }
.slot-day-panel::-webkit-scrollbar-track { background: transparent; }
.slot-day-panel::-webkit-scrollbar-thumb { background: rgba(129, 140, 248, 0.2); border-radius: 2px; }
.slot-day-panel.active { display: block; }
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}
.slot-card {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
  background: rgba(129, 140, 248, 0.04);
  border: 1px solid rgba(129, 140, 248, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}
.slot-card:hover {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(129, 140, 248, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(129, 140, 248, 0.15);
}
.slot-card.selected {
  border-color: var(--accent);
  background: rgba(129, 140, 248, 0.18);
  color: #fff;
  box-shadow: 0 0 16px rgba(129, 140, 248, 0.25);
}

/* Booking form */
.booking-form {
  margin: 12px 0;
  padding: 16px;
  background: rgba(129, 140, 248, 0.04);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.booking-form-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.booking-form-selected {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.booking-form input {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.3s;
}
.booking-form input::placeholder { color: var(--text-tertiary); }
.booking-form input:focus { border-color: rgba(129, 140, 248, 0.4); }
.booking-form-submit {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent-dim);
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 8px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 4px;
}
.booking-form-submit:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}
.booking-form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Booking result states */
.booking-result {
  margin: 12px 0;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}
.booking-result-success {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.booking-result-success .booking-result-title {
  font-size: 14px;
  font-weight: 500;
  color: #4ade80;
  margin-bottom: 6px;
}
.booking-result-success a {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
}
.booking-result-info {
  padding: 14px;
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.2);
}
.booking-result-info a {
  color: var(--accent);
}

/* Chat responsive */
@media (max-width: 640px) {
  .nav-inner { padding: 0 20px; }
  .chat-messages { padding: 16px; }
  .chat-input-area { padding: 12px 16px 16px; }
  .welcome h2 { font-size: 18px; }
  .welcome p { font-size: 13px; }
  .suggestion-btn { font-size: 12px; padding: 8px 14px; }
}
