#messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 16px 14px 10px;
  background: transparent;
  scrollbar-width: none;
}

#messages::-webkit-scrollbar,
.carousel::-webkit-scrollbar {
  display: none;
}

.msg {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  max-width: 84%;
  animation: fadeIn .25s ease;
  word-break: break-word;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

.bot {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border-bottom-left-radius: 8px;
}

.user {
  background: #234A84;
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 8px;
  box-shadow: 0 14px 30px rgba(35, 74, 132, 0.2);
}

.ai-inline-action {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 12px;
}

.ai-order-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.ai-order-summary {
  display: grid;
  gap: 4px;
}

.ai-order-summary-title,
.ai-order-summary-meta,
.ai-order-summary-hint,
.ai-order-summary-prompt {
  margin: 0;
}

.ai-order-summary-title,
.ai-order-summary-prompt {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.ai-order-summary-meta {
  font-size: 12px;
  color: #334155;
}

.ai-order-summary-hint {
  font-size: 11px;
  color: #64748b;
}

.ai-inline-action-button {
  appearance: none;
  outline: none;
  border: 1px solid rgba(35, 74, 132, 0.24);
  border-radius: 999px;
  padding: 11px 16px;
  background: #234A84;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(35, 74, 132, 0.2);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  margin-bottom: 0;
}

.ai-inline-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(35, 74, 132, 0.28);
}

.ai-order-link {
  text-decoration: none;
  display: inline-flex;
  width: fit-content;
}

.ai-order-options {
  display: grid;
  gap: 6px;
}

.ai-order-option {
  text-align: left;
  background: rgba(248, 250, 252, 0.96);
  color: #16304f;
  border-color: rgba(195, 210, 232, 0.95);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  margin-bottom: 0;
}

.ai-typing-message {
  width: fit-content;
  min-width: 70px;
  padding: 12px 14px;
}

.ai-typing-label {
  margin-bottom: 7px;
  font-size: 12px;
  line-height: 1.3;
  color: #475569;
}

.ai-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
  opacity: .35;
  animation: aiTypingPulse 1.2s infinite ease-in-out;
}

.ai-typing-dots span:nth-child(2) {
  animation-delay: .16s;
}

.ai-typing-dots span:nth-child(3) {
  animation-delay: .32s;
}

.carousel {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 10px 38px 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.carousel-shell {
  position: relative;
  margin: 6px 0 2px;
}

.single-product {
  margin: 6px 0 2px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  padding: 0;
  appearance: none;
  outline: none;
}

.carousel-arrow svg {
  width: 15px;
  height: 15px;
}

.carousel-arrow-prev {
  left: 2px;
}

.carousel-arrow-next {
  right: 2px;
}

.carousel-arrow:active,
.carousel-arrow:hover {
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.3);
}

.carousel-arrow:disabled {
  opacity: 0;
  cursor: default;
  box-shadow: none;
}

.carousel-arrow[hidden] {
  display: none;
}

.carousel-arrow.is-hidden {
  display: none !important;
}

.card {
  min-width: 214px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  scroll-snap-align: start;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
}

.card.card-single {
  min-width: 0;
  width: 100%;
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  margin-bottom: 14px;
}

.card h4 {
  font-size: 14px;
  line-height: 1.35;
  margin: 0 0 6px;
  color: #0f172a;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.card p {
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.card-actions {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.card button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #111827;
  border-radius: 12px;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.14);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, background-color .18s ease;
}

.card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
}

.card button + button {
  margin-top: 6px;
  background: #f8fafc;
  color: #111827;
  border-color: #e2e8f0;
  box-shadow: none;
}

@media (max-width: 480px) {
  .carousel {
    padding-left: 34px;
    padding-right: 34px;
  }

  .carousel-arrow {
    width: 32px;
    height: 32px;
  }
}

@keyframes aiTypingPulse {
  0%, 80%, 100% {
    opacity: .35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
