* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef1f6;
  font-family: "Segoe UI", "Noto Sans Thai", sans-serif;
  color: #212529;
}

.widget {
  width: min(420px, 90vw);
  min-height: 640px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #35c9b0 0%, #ff8fa3 55%, #ff6f61 100%);
  border-radius: 28px;
  padding: 2.5rem 2rem 1.75rem;
  text-align: center;
  color: #fff;
  box-shadow: 0 25px 60px rgba(255, 111, 97, 0.35);
}

h1 { margin: 0 0 .35rem; font-size: 1.5rem; font-weight: 700; }
.subtitle { margin: 0 0 2rem; color: rgba(255, 255, 255, 0.85); font-size: .9rem; }

.mic-btn {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease;
  box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.6), 0 0 40px 6px rgba(255, 90, 90, 0.45);
}
.mic-btn #mic-icon { width: 40px; height: 40px; }
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.active {
  background: rgba(255, 255, 255, 0.25);
  animation: pulse 1.4s infinite;
}
.mic-btn.connecting { background: rgba(255, 255, 255, 0.1); opacity: .7; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.55), 0 0 40px 6px rgba(255, 90, 90, 0.45); }
  70% { box-shadow: 0 0 0 20px rgba(255, 90, 90, 0), 0 0 40px 6px rgba(255, 90, 90, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0), 0 0 40px 6px rgba(255, 90, 90, 0.45); }
}

.status { margin-top: 1.25rem; font-size: .85rem; color: rgba(255, 255, 255, 0.9); font-weight: 500; }

.transcript {
  margin-top: 1.5rem;
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
  text-align: left;
  font-size: .85rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.transcript .line {
  flex-shrink: 0;
  padding: .6rem .85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
  color: #fff;
}
.transcript .line.user { background: rgba(255, 255, 255, 0.28); align-self: flex-end; }
.transcript .line.agent { background: rgba(255, 255, 255, 0.16); align-self: flex-start; }
.transcript .line.tool {
  background: rgba(0, 0, 0, 0.15);
  font-family: monospace;
  font-size: .75rem;
  color: rgba(255, 255, 255, 0.85);
}

.transcript .line.booking-link {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-start;
}
.booking-link-title { font-weight: 600; color: #fff; }
.booking-link-btn {
  display: inline-block;
  background: #fff;
  color: #ff6f61;
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 700;
}
.booking-link-btn:hover { background: rgba(255, 255, 255, 0.9); }

.transcript .line.package-card {
  background: #fff;
  border: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.package-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.package-card-body {
  padding: .65rem .85rem .8rem;
  text-align: left;
}
.package-card-title { font-weight: 700; color: #212529; font-size: .95rem; }
.package-card-price {
  margin-top: .3rem;
  font-weight: 700;
  color: #ff6f61;
  font-size: .95rem;
}

.package-recs {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.package-recs::-webkit-scrollbar { display: none; }
.package-rec-card {
  flex: 0 0 auto;
  width: 176px;
  scroll-snap-align: start;
  background: #fff;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.package-rec-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.package-rec-body { padding: .45rem .55rem; }
.package-rec-title {
  font-size: .72rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.package-rec-price {
  margin-top: .25rem;
  font-size: .72rem;
  font-weight: 700;
  color: #ff6f61;
}

.tagline {
  margin: 1.5rem 0 0;
  font-size: .75rem;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, 0.75);
}

.credit {
  margin: .4rem 0 0;
  font-size: .6rem;
  color: rgba(255, 255, 255, 0.45);
}
.credit a {
  color: inherit;
  text-decoration: underline;
}
