* {
  box-sizing: border-box;
}

:root {
  --wa-bg: #efeae2;
  --wa-header: #075e54;
  --wa-header-dark: #064c44;
  --wa-input: #f0f2f5;
  --wa-user: #d9fdd3;
  --wa-assistant: #ffffff;
  --wa-text: #111b21;
  --wa-muted: #667781;
  --wa-border: #d1d7db;
  --sebastian: #6f42c1;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #d7d7d7;
  color: var(--wa-text);
}

.app-shell {
  width: min(100%, 1100px);
  height: 100vh;
  min-height: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--wa-bg);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.12);
}

/* HEADER */

.wa-header {
  min-height: 72px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--wa-header);
  color: #ffffff;
}

.wa-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 25px;
}

.wa-header-copy {
  min-width: 0;
  flex: 1;
}

.wa-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
}

.wa-status {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-link {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-decoration: none;
  cursor: pointer;
}

.account-link:hover,
.account-link:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.account-logout[hidden] {
  display: none;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  font-size: 25px;
  font-weight: 400;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* CHAT */

.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px clamp(12px, 4vw, 72px) 24px;
  background-color: var(--wa-bg);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-position: 0 0, 14px 14px;
  background-size: 28px 28px;
}

.message {
  width: 100%;
  display: flex;
  margin-bottom: 12px;
}

.message.assistant {
  justify-content: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  position: relative;
  max-width: min(82%, 760px);
  padding: 9px 11px 18px;
  border-radius: 9px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.assistant .bubble {
  background: var(--wa-assistant);
}

.user .bubble {
  background: var(--wa-user);
}

.assistant-intro {
  margin-bottom: 12px;
  padding: 8px 10px 17px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #202c33;
}

.welcome-bubble {
  max-width: 520px;
  background: #fff !important;
}

.welcome-title {
  font-size: 15px;
  font-weight: 700;
}

.welcome-text {
  margin-top: 3px;
  color: #46545c;
  font-size: 14px;
}

.welcome-time,
.message-time {
  position: absolute;
  right: 8px;
  bottom: 4px;
  color: #667781;
  font-size: 10px;
}

/* RESULT CARDS — keep rich content, but visually closer to a WhatsApp bubble */

.hotel-card,
.wine-card,
.book-card,
.playlist-card {
  width: min(100%, 720px);
  margin: 0 0 10px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(84, 95, 104, 0.12);
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.hotel-image,
.wine-image,
.book-image,
.playlist-image {
  display: block;
  width: 100%;
  object-fit: cover;
  background: #e8ecef;
}

.hotel-image {
  height: 190px;
}
.wine-image {
  height: 200px;
}
.book-image {
  height: 230px;
}
.playlist-image {
  height: 210px;
}

.hotel-content,
.wine-content,
.book-content,
.playlist-content {
  padding: 14px;
}

.hotel-card-header,
.wine-card-header,
.book-card-header,
.playlist-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 8px;
}

.hotel-card-title,
.wine-card-title,
.book-card-title,
.playlist-card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.28;
  color: #111b21;
}

.hotel-score,
.wine-score,
.book-score {
  flex-shrink: 0;
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff4c2;
  color: #6f4f00;
  font-size: 13px;
  font-weight: 700;
}

.hotel-description,
.wine-description,
.book-description,
.playlist-description {
  margin: 0 0 12px;
  color: #3b4a54;
  line-height: 1.55;
  font-size: 14px;
}

.hotel-amenities,
.wine-meta,
.wine-pairings,
.book-tags,
.playlist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.amenity-tag,
.wine-tag,
.book-tag,
.playlist-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.amenity-tag {
  background: #eef2ff;
  color: #3730a3;
}

.wine-tag,
.book-tag,
.playlist-tag {
  background: #f5f0ff;
  color: var(--sebastian);
}

.playlist-tag.secondary {
  background: #f3f4f6;
  color: #4b5563;
}

.wine-producer,
.book-author,
.book-metadata {
  color: var(--wa-muted);
  font-size: 13px;
}

.wine-producer {
  margin-top: 3px;
}
.book-author {
  margin-top: 4px;
}
.book-metadata {
  margin-bottom: 10px;
}

.wine-section-title {
  margin-bottom: 6px;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.playlist-mood {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 12px;
  font-weight: 700;
}

.hotel-card-footer,
.wine-card-footer,
.book-card-footer,
.playlist-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #edf0f2;
}

.hotel-rank,
.wine-rank,
.book-rank,
.playlist-rank {
  flex-shrink: 0;
  color: var(--wa-muted);
  font-size: 12px;
}

.hotel-actions,
.wine-actions,
.book-actions,
.playlist-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.hotel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.hotel-button.primary {
  background: #128c7e;
  color: #ffffff;
}

.hotel-button.secondary {
  background: #f0f2f5;
  color: #374151;
  border: 1px solid #d9dee2;
}

.assistant-footer {
  margin-top: 4px;
  padding: 10px 12px 16px;
  background: transparent;
  border: 0;
  color: #4b5563;
  font-size: 13px;
}

/* COMPOSER */

.input-area {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: var(--wa-input);
  border-top: 1px solid var(--wa-border);
}

.attach-button,
.send-button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.attach-button {
  background: transparent;
  color: #54656f;
  font-size: 29px;
  font-weight: 300;
}

.attach-button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.send-button {
  background: var(--wa-header);
  color: #ffffff;
  font-size: 18px;
}

.send-button:hover {
  background: var(--wa-header-dark);
}

.send-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  font-size: 15px;
  border: 0;
  border-radius: 22px;
  outline: none;
  background: #ffffff;
  color: var(--wa-text);
}

input::placeholder {
  color: #8696a0;
}

input:focus {
  box-shadow: 0 0 0 1px rgba(7, 94, 84, 0.18);
}

.load-more-button {
  display: block;
  width: min(100%, 720px);
  margin: 12px 0 6px;
  padding: 10px 14px;
  border: 1px solid #d9d9e8;
  border-radius: 9px;
  background: #ffffff;
  color: var(--sebastian);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.load-more-button:hover {
  background: #f7f4ff;
}

@media (max-width: 700px) {
  body {
    background: var(--wa-bg);
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    box-shadow: none;
  }

  .wa-header {
    min-height: 64px;
    padding: 8px 12px;
  }

  .wa-avatar {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 23px;
  }

  .chat {
    padding: 18px 9px 20px;
  }

  .bubble {
    max-width: 92%;
  }

  .assistant .bubble {
    max-width: 94%;
  }

  .user .bubble {
    max-width: 85%;
  }

  .hotel-card,
  .wine-card,
  .book-card,
  .playlist-card,
  .load-more-button {
    width: 100%;
  }

  .hotel-image {
    height: 165px;
  }
  .wine-image {
    height: 175px;
  }
  .book-image {
    height: 200px;
  }
  .playlist-image {
    height: 180px;
  }

  .hotel-card-header,
  .wine-card-header,
  .book-card-header,
  .playlist-card-header {
    gap: 7px;
  }

  .hotel-score,
  .wine-score,
  .book-score,
  .playlist-mood {
    align-self: flex-start;
  }

  .hotel-card-footer,
  .wine-card-footer,
  .book-card-footer,
  .playlist-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hotel-actions,
  .wine-actions,
  .book-actions,
  .playlist-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
