*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #e0f2fe 0%, #dcfce7 100%);
  min-height: 100vh;
}

#app {
  max-width: 680px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  background: white;
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}

#house-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e40af;
}

.tagline {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

#arrived-btn {
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

#arrived-btn:hover { background: #d97706; }

#messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

#starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

#messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.message {
  max-width: 80%;
  padding: 0.7rem 1rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.user-message {
  background: #3b82f6;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  align-self: flex-start;
  max-width: 85%;
}

.avatar {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.3rem;
}

.bot-message {
  background: white;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.bot-message p { margin-bottom: 0.5rem; }
.bot-message p:last-child { margin-bottom: 0; }
.bot-message ul, .bot-message ol { padding-left: 1.4rem; margin-bottom: 0.5rem; }
.bot-message li { margin-bottom: 0.25rem; }
.bot-message li:last-child { margin-bottom: 0; }
.bot-message strong { font-weight: 600; }
.bot-message h3, .bot-message h4 { font-weight: 600; font-size: 0.95rem; margin: 0.5rem 0 0.25rem; }

#typing {
  color: #6b7280;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

#suggestions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.suggestions-label {
  width: 100%;
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.1rem;
}

.chip {
  background: white;
  border: 1.5px solid #bbf7d0;
  color: #065f46;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.12s;
  font-family: inherit;
}

.chip:hover { background: #d1fae5; }

.suggestion-chip {
  background: #f0fdf4;
  border-color: #22c55e;
}

#input-bar {
  background: white;
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

#input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 24px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}

#input:focus { border-color: #3b82f6; }

#send-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#send-btn:hover { background: #2563eb; }

@media (max-width: 480px) {
  #app { max-width: 100%; }
  .message { max-width: 90%; }
  .message-wrapper { max-width: 95%; }
}
