*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --orange: #e67e22;
  --orange-light: #fff3e0;
  --orange-dark: #c0601a;
  --red: #e74c3c;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --user-bg: #e67e22;
  --assistant-bg: #ffffff;
  --radius: 14px;
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg);
}

/* Header */
.header {
  flex-shrink: 0;
  padding: 1.25rem 1.5rem 0;
  text-align: center;
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.accent-bar {
  height: 3px;
  margin-top: 1rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--orange), #f39c12, var(--red));
}

/* Chat */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: var(--orange-light);
}

.message.user .message-avatar {
  background: var(--user-bg);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
}

.message-bubble {
  max-width: 75%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: 0.92rem;
}

.message.assistant .message-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.message.user .message-bubble {
  background: var(--user-bg);
  color: white;
  border-top-right-radius: 4px;
}

.message-bubble p {
  margin-bottom: 0.5rem;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble ul {
  margin: 0.4rem 0 0.5rem 1.2rem;
}

.message-bubble li {
  margin-bottom: 0.25rem;
}

.message-bubble strong {
  font-weight: 600;
}

/* Typing indicator */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: bounce 1.4s infinite ease-in-out both;
}

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

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Quick trips */
.quick-trips {
  flex-shrink: 0;
  display: flex;
  gap: 0.45rem;
  padding: 0 1rem 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-trips::-webkit-scrollbar {
  display: none;
}

.trip-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--orange);
  background: var(--orange-light);
  color: var(--orange-dark);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.trip-chip:hover {
  background: var(--orange);
  color: white;
}

/* Input */
.input-area {
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

#userInput {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
}

#userInput:focus {
  border-color: var(--orange);
}

#sendBtn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--orange);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

#sendBtn:hover {
  background: var(--orange-dark);
}

#sendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .header h1 {
    font-size: 1.3rem;
  }
  .message-bubble {
    max-width: 85%;
  }
}
