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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

/* ── Master container ── */
#master {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 520px;
  height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0 24px;
}

/* ── Gif section ── */
#wizard-section {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-bottom: 32px;
}
#wizard-section img {
  width: 220px;
  height: auto;
}

/* ── Scrollable chat with fade at top ── */
#chat-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
#chat-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--bg-color, white), transparent);
}
#chat-section {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
  padding: 56px 0 24px;
}
#chat-section::-webkit-scrollbar { display: none; }

/* ── Messages ── */
.msg-user {
  align-self: flex-end;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  max-width: 85%;
  line-height: 1.5;
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.msg-assistant {
  align-self: flex-start;
  font-size: 15px;
  max-width: 85%;
  line-height: 1.6;
  white-space: pre-wrap;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

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

/* ── Typing indicator ── */
.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 4px 0;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}
.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: bounce 1.2s infinite;
  opacity: 0.6;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* ── Suggested questions ── */
#suggestions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 16px 0 14px;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  animation-delay: 1.2s;
}

.suggestion {
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

/* ── Input bar ── */
#input-bar {
  flex-shrink: 0;
  background: #e8e8e8;
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 54px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

#input-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #555;
  font-family: Arial, Helvetica, sans-serif;
}
#input-bar input::placeholder { color: #aaa; }

#send-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}
#send-btn:hover { opacity: 1; }

/* ── Mobile ── */
@media (max-width: 480px) {
  #wizard-section img { width: 104px; } /* 80px + 30% */
  #wizard-section { padding-bottom: 20px; }
  #master { height: 85vh; }
  .msg-user, .msg-assistant { font-size: 13px; }
  .suggestion { font-size: 11px; padding: 5px 11px; }
  #input-bar input { font-size: 13px; }
  #input-bar { height: 46px; }
}
