:root {
  --ink: #1a1a1a;
  --bg: #f7f5f1;
  --bubble-assistant: #ffffff;
  --bubble-user: #ffe4da;
  --accent: #ff5a3c;
  --border: #e3ddd3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: "Heebo", system-ui, sans-serif;
  color: var(--ink);
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Landing state (no messages yet): header + composer centered together,
   like a search-box landing screen rather than a pinned chat bar. */
.app:not(.started) {
  justify-content: center;
  gap: 1.5rem;
}

.app-header {
  padding: 1.25rem 0 0.75rem;
  text-align: center;
}

.app.started .app-header {
  border-bottom: 1px solid var(--border);
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.7;
}

/* --- chat log (hidden until the first message, like the landing-screen reference) --- */
.chat-log {
  flex: 1;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 0;
}

.app.started .chat-log {
  display: flex;
}

.msg {
  max-width: 80%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg.user {
  align-self: flex-start;
  background: var(--bubble-user);
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  align-self: flex-end;
  background: var(--bubble-assistant);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg.pending {
  opacity: 0.6;
}

.msg.error {
  align-self: flex-end;
  background: var(--bubble-assistant);
  border: 1px solid #e0a99f;
  color: #a33;
}

/* --- composer: floating white rounded card, same shape whether centered
   on the landing screen or pinned at the bottom once chatting --- */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

#askInput {
  flex: 1;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.4rem 0.2rem;
  border: none;
  background: transparent;
  resize: none;
  max-height: 6.5em;
}

#askInput:focus {
  outline: none;
}

#askSubmit {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#askSubmit:disabled {
  opacity: 0.5;
  cursor: default;
}
