/* ======================================================
🌐 ROOT VARIABLES — Premium Blue Theme
====================================================== */
:root {
  --botly-color-primary:       #0b1b3a;  /* deep navy */
  --botly-color-primary-600:   #1e3a8a;  /* royal navy */
  --botly-color-accent:        #3b82f6;  /* brand blue (replaces orange) */
  --botly-color-accent-2:      #06b6d4;  /* cyan-blue for gradients */
  --botly-color-bg:            #ffffff;
  --botly-color-surface:       #ffffff;
  --botly-color-muted:         #6b7280;

  --botly-color-bot-bubble:    #f3f5f9;  /* soft slate */
  --botly-color-user-bubble:   #1f3a8a;  /* richer blue */
  --botly-color-text:          #0f172a;  /* slate-900 */
  --botly-color-border:        rgba(15, 23, 42, 0.08);

  --botly-success:             #22c55e;

  --botly-shadow-sm:           0 6px 18px rgba(2, 6, 23, 0.12);
  --botly-shadow-md:           0 12px 32px rgba(2, 6, 23, 0.18);
  --botly-shadow-lg:           0 18px 48px rgba(2, 6, 23, 0.22);

  --botly-radius-sm:           10px;
  --botly-radius-md:           14px;
  --botly-radius-lg:           18px;

  --botly-font-family:         "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Reset a few things */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; background: transparent; }
body { font-family: var(--botly-font-family); color: var(--botly-color-text); }

/* ======================================================
💬 CHAT BUBBLE BUTTON — premium, subtle glow
====================================================== */
#botly-bubble {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 9999;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  background:
    radial-gradient(120% 120% at 20% 20%, rgba(255,255,255,0.18), transparent 60%),
    linear-gradient(135deg, var(--botly-color-primary-600), var(--botly-color-accent));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    var(--botly-shadow-md);
  transition: transform .18s ease, box-shadow .2s ease, filter .2s ease;
  isolation: isolate;
}

#botly-bubble::after {
  /* soft outer ring */
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(90% 90% at 50% 50%, rgba(59,130,246,0.25), transparent 70%);
  z-index: -1;
  filter: blur(4px);
  opacity: .8;
  transition: opacity .2s ease, transform .2s ease;
}

#botly-bubble:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--botly-shadow-lg);
}
#botly-bubble:hover::after { opacity: 1; transform: scale(1.03); }

/* Tiny pulsing highlight (very subtle) */
@keyframes premiumPulse {
  0% { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), var(--botly-shadow-md); }
  50%{ box-shadow: inset 0 0 0 1px rgba(255,255,255,0.26), 0 16px 40px rgba(2,6,23,0.22); }
  100%{ box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), var(--botly-shadow-md); }
}
#botly-bubble { animation: premiumPulse 4.2s ease-in-out infinite; }

/* ======================================================
💡 TOOLTIP ON CHAT BUBBLE
====================================================== */
.botly-tooltip {
  position: absolute;
  bottom: 74px;
  right: 0;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  box-shadow: var(--botly-shadow-sm);
  transition: opacity .18s ease, transform .18s ease;
}
#botly-bubble:hover .botly-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ======================================================
📦 CHAT WIDGET CONTAINER — glass, refined
====================================================== */
#botly-widget {
  position: fixed;
  bottom: 96px;
  right: 22px;
  width: 392px;
  max-width: calc(100vw - 32px);
  height: 620px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--botly-color-border);
  border-radius: var(--botly-radius-lg);
  box-shadow: var(--botly-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  font-family: var(--botly-font-family);
  animation: slideUp .28s ease forwards;
}
#botly-widget.hidden { display: none; }

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

/* Inner scaffold */
.botly-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ======================================================
🧠 HEADER SECTION — deep blue gradient
====================================================== */
.botly-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--botly-color-primary-600), var(--botly-color-accent));
}

.botly-back {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background .18s ease, opacity .18s ease;
}
.botly-back:hover { background: rgba(255,255,255,0.12); opacity: 0.9; }

.botly-avatar img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(2,6,23,0.25);
}

.botly-meta { display: flex; flex-direction: column; min-width: 0; }
#botly-name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.botly-status { font-size: 12.5px; opacity: .85; }
.botly-status .dot {
  display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
}
.dot.online { background: var(--botly-success); }

/* Minimize button (header & cover use same class) */
.botly-minimize {
  margin-left: auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.14);
  border: none; border-radius: 8px; color: #fff;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}
.botly-minimize:hover {
  background: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.18) inset;
}

/* ======================================================
💬 MESSAGE AREA
====================================================== */
.botly-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(59,130,246,0.06), transparent 40%),
    #f8fafc;
}

.botly-message {
  margin-bottom: 14px;
  max-width: 85%;
  font-size: 15px;
  line-height: 1.55;
}

.botly-message-bot .botly-bubble-text,
.botly-message-user .botly-bubble-text {
  padding: 10px 14px;
  border-radius: 18px;
  display: inline-block;
  position: relative;
  animation: dropIn .24s ease;
  box-shadow: 0 2px 6px rgba(2,6,23,0.06);
}

.botly-message-bot .botly-bubble-text {
  background: var(--botly-color-bot-bubble);
  color: var(--botly-color-text);
  border-radius: 16px 16px 16px 6px;
}

.botly-message-user { display: flex; justify-content: flex-end; }
.botly-message-user .botly-bubble-text {
  background: linear-gradient(135deg, var(--botly-color-user-bubble), var(--botly-color-accent));
  color: #fff;
  border-radius: 16px 16px 6px 16px;
}

@keyframes dropIn {
  0% { transform: translateY(8px); opacity: 0; }
  100%{ transform: translateY(0);  opacity: 1; }
}

/* Tail dots (subtle, optional) */
.botly-message-bot .botly-bubble-text::before,
.botly-message-user .botly-bubble-text::before {
  content: "";
  position: absolute;
  bottom: 0;
  width: 10px; height: 10px; border-radius: 50%;
}
.botly-message-bot .botly-bubble-text::before { left: -6px;  background: var(--botly-color-bot-bubble); }
.botly-message-user .botly-bubble-text::before { right: -6px; background: var(--botly-color-user-bubble); }

/* ======================================================
⠿ TYPING DOTS
====================================================== */
.botly-typing {
  padding: 0 16px 12px;
  display: flex; gap: 5px;
}
.botly-typing.hidden { display: none; }
.botly-typing .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #cbd5e1;
  animation: blink 1.4s infinite;
}
.botly-typing .dot:nth-child(2){ animation-delay: .2s; }
.botly-typing .dot:nth-child(3){ animation-delay: .4s; }

@keyframes blink {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}

/* ======================================================
⚡ QUICK REPLIES — soft chips (no orange)
====================================================== */
.botly-quick-replies {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.botly-quick-replies button {
  background: #fff;
  color: var(--botly-color-primary-600);
  border: 1px solid rgba(30,58,138,0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.botly-quick-replies button:hover {
  background: linear-gradient(135deg, var(--botly-color-primary-600), var(--botly-color-accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(2,6,23,0.14);
}

/* ======================================================
✏️ INPUT FIELD
====================================================== */
.botly-input {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--botly-color-border);
  background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(90deg, rgba(30,58,138,.18), rgba(59,130,246,.18)) border-box;
}
.botly-input input {
  flex: 1;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid rgba(2,6,23,0.12);
  border-radius: 10px;
  outline: none;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.botly-input input:focus {
  border-color: rgba(59,130,246,0.55);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

.botly-input button {
  background: linear-gradient(135deg, var(--botly-color-primary-600), var(--botly-color-accent));
  color: #fff;
  border: none;
  padding: 0 16px;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  box-shadow: 0 6px 16px rgba(2,6,23,0.18);
}
.botly-input button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(2,6,23,0.22); }
.botly-input button:active { transform: translateY(0); filter: brightness(.98); }

/* ======================================================
📎 FOOTER
====================================================== */
.botly-footer {
  display: none;
  text-align: center;
  font-size: 11.5px;
  color: var(--botly-color-muted);
  padding: 8px;
  border-top: 1px solid var(--botly-color-border);
  background: #fff;
}
.botly-footer a {
  color: var(--botly-color-accent);
  text-decoration: none;
}
.botly-footer a:hover { text-decoration: underline; }

/* ======================================================
📱 RESPONSIVE
====================================================== */
@media (max-width: 480px) {
  #botly-widget {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  #botly-bubble {
    bottom: 18px;
    right: 18px;
  }
}

/* ======================================================
🎯 COVER PAGE — Premium Blue (no orange)
====================================================== */

.botly-widget { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* Full-bleed gradient background */
.botly-cover {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #0b2460, #123b8c 55%, #1ba3d7);
  overflow: hidden;
  animation: fadeIn .6s ease-in-out;
}

/* Optional subtle noise overlay */
.botly-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/botly/widget/noise.png') repeat;
  opacity: .03;
  pointer-events: none;
}

/* Minimize (same class reused) positioned for cover */
.botly-cover .botly-minimize {
  position: absolute; top: 16px; right: 16px;
}

/* Main title */
.cover-title {
  font-size: clamp(1.45rem, 2.6vw, 1.7rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 1.2em;
  text-align: left;
  align-self: flex-start;
  line-height: 1.35;
  letter-spacing: .2px;
  opacity: 0; transform: translateY(16px);
  animation: fadeSlideIn .5s ease-out .15s forwards;
}

/* Subtitle */
.cover-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  margin: 0 0 1.8em;
  text-align: center;
  max-width: 40ch;
  opacity: 0; transform: translateY(16px);
  animation: fadeSlideIn .5s ease-out .28s forwards;
}

/* Actions */
.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  z-index: 1;
}

/* Primary + Secondary buttons reused here */
.btn-premium {
  position: relative;
  overflow: hidden;
  padding: 13px 26px;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--botly-color-primary-600), var(--botly-color-accent));
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(2,6,23,0.2);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-premium:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(2,6,23,0.26); }
.btn-premium:active { transform: translateY(0); filter: brightness(.98); }

.btn-secondary {
  padding: 11px 22px;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.95); }

/* Subscribe area */
.cover-subscribe-container {
  display: flex; flex-direction: column; align-items: center;
  margin-top: auto; padding-bottom: 64px; width: 100%;
  animation: fadeIn .8s ease .4s forwards;
}
.cover-subscribe-cta {
  font-size: .78rem; color: rgba(255,255,255,0.7);
  margin-bottom: 6px; text-align: center; font-weight: 600;
}
.cover-subscribe {
  display: flex; gap: 8px; margin-top: 10px;
  padding: 6px 8px; background: rgba(255,255,255,0.08);
  border-radius: 999px; box-shadow: 0 2px 8px rgba(2,6,23,0.25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  align-items: center; width: 100%; max-width: 320px;
}
.cover-subscribe input {
  flex: 1; background: transparent; border: none;
  padding: 10px 12px; font-size: .9rem; color: #fff; font-weight: 500; outline: none;
}
.cover-subscribe input::placeholder { color: rgba(255,255,255,0.55); }
.cover-subscribe button {
  background: linear-gradient(135deg, var(--botly-color-accent), var(--botly-color-accent-2));
  color: #fff; border: none; padding: 10px 16px; border-radius: 999px;
  font-size: 1rem; font-weight: 800; cursor: pointer; transition: transform .16s ease, filter .16s ease;
}
.cover-subscribe button:hover { transform: translateY(-1px); }
.cover-subscribe button:active { transform: translateY(0); filter: brightness(.97); }

/* Entry animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive tweaks */
@media (max-width: 480px) {
  .cover-title   { font-size: 1.35rem; }
  .cover-subtitle{ font-size: .98rem; }
  .cover-actions { gap: 12px; }
  .btn-premium   { padding: 12px 22px; font-size: .9rem; }
  .btn-secondary { padding: 10px 18px; font-size: .85rem; }
}

/* ======================================================
🧾 INLINE BOOKING FORM (inside chat bubble)
====================================================== */
.botly-inline-form {
  display: block;
  margin-top: 8px;
}

.botly-inline-form .muted {
  font-size: 12.5px;
  color: var(--botly-color-muted);
}

/* form fields */
.botly-inline-form input[type="text"],
.botly-inline-form input[type="email"],
.botly-inline-form input[type="tel"] {
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid rgba(2, 6, 23, 0.12);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.botly-inline-form input::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

/* focus + valid/invalid hints */
.botly-inline-form input:focus {
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 4px rgba(59,130,246,.14);
}

.botly-inline-form input[type="email"]:user-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}

/* submit button (compact primary) */
.botly-inline-form .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--botly-color-primary-600), var(--botly-color-accent));
  box-shadow: 0 6px 16px rgba(2,6,23,.18);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, opacity .2s ease;
}

.botly-inline-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(2,6,23,.22);
}

.botly-inline-form .btn-primary:active {
  transform: translateY(0);
  filter: brightness(.98);
}

.botly-inline-form .btn-primary[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* tiny text button used in booking card switch */
.btn-text {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--botly-color-primary-600);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* optional: booking link card look */
.booking-card .booking-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.booking-card .booking-actions {
  margin-top: 8px;
}

/* ---------- Sticker Mascot Launcher ---------- */
.botly-bubble--sticker {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 64px; height: 64px;
  z-index: 9999;
  cursor: pointer;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

/* sticker frame */
.botly-bubble--sticker .botly-sticker {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  background: #fff;
  border-radius: 50%;
  box-shadow:
    0 10px 24px rgba(2,6,23,.18),
    inset 0 0 0 2px rgba(255,255,255,.9);
  padding: 6px;           /* white border thickness */
  position: relative;
  transition: transform .18s ease, box-shadow .2s ease, filter .2s ease;
}

/* inner face */
.botly-bubble--sticker .botly-face {
  width: 100%; height: 100%;
  border-radius: 50%;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(2,6,23,.18));
}

/* presence badge (ring) */
.botly-bubble--sticker .botly-presence {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 12px; height: 12px;
  border-radius: 999px;
  background: #22c55e; /* online green */
  box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(34,197,94,.6);
}

/* subtle halo underneath */
.botly-bubble--sticker::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(60% 60% at 50% 40%, rgba(59,130,246,.25), transparent 70%);
  filter: blur(8px);
  z-index: -1;
  opacity: .9;
  pointer-events: none;
}

/* idle breathe */
.botly-bubble--sticker .botly-sticker { animation: botlyBreathe 4.2s ease-in-out infinite; }
@keyframes botlyBreathe {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.03); }
}

/* hover: tilt + lift */
.botly-bubble--sticker:hover .botly-sticker {
  transform: translateY(-1px) rotate(-2deg) scale(1.04);
  box-shadow: 0 14px 34px rgba(2,6,23,.22), inset 0 0 0 2px rgba(255,255,255,1);
}

/* press feedback */
.botly-bubble--sticker:active .botly-sticker { transform: scale(0.98); }

/* wink animation (right eye) */
.botly-bubble--sticker .eye { transform-origin: center; }
.botly-bubble--sticker .eye--right {
  animation: botlyWink 8s ease-in-out infinite;
  /* desync first cycle a bit so it feels natural */
  animation-delay: 1.2s;
}
@keyframes botlyWink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%           { transform: scaleY(0.2); }  /* closed */
  96%           { transform: scaleY(1); }    /* open */
}

/* tooltip retained */
.botly-bubble--sticker .botly-tooltip {
  position: absolute;
  bottom: 74px; right: 0;
  background: rgba(15,23,42,.92);
  color: #fff; font-size: 12.5px;
  padding: 7px 10px; border-radius: 8px;
  white-space: nowrap; opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(2,6,23,.18);
  transition: opacity .18s ease, transform .18s ease;
}
.botly-bubble--sticker:hover .botly-tooltip { opacity: 1; transform: translateY(0); }

/* ---------- Confetti burst (fires when chat opens) ---------- */
/* we rely on logic.js adding :root.botly-open when the widget opens */
.botly-bubble--sticker .botly-confetti { position: absolute; inset: 0; pointer-events: none; }
.botly-bubble--sticker .botly-confetti i {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 10px; border-radius: 2px;
  background: #fff; opacity: 0; transform: translate(-50%,-50%) rotate(0deg);
  /* default: no animation */
  animation: none;
}

/* six pieces with different colors and trajectories */
.botly-bubble--sticker .botly-confetti i:nth-child(1){ background:#3b82f6; }
.botly-bubble--sticker .botly-confetti i:nth-child(2){ background:#0ea5e9; }
.botly-bubble--sticker .botly-confetti i:nth-child(3){ background:#22c55e; }
.botly-bubble--sticker .botly-confetti i:nth-child(4){ background:#f59e0b; }
.botly-bubble--sticker .botly-confetti i:nth-child(5){ background:#a855f7; }
.botly-bubble--sticker .botly-confetti i:nth-child(6){ background:#ef4444; }

/* when opening, play burst */
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(1){ animation: botlyConfetti 600ms ease-out 0s forwards; transform: translate(-50%,-50%) rotate(-10deg); }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(2){ animation: botlyConfetti 700ms ease-out 40ms forwards; transform: translate(-50%,-50%) rotate(20deg);  }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(3){ animation: botlyConfetti 650ms ease-out 80ms forwards; transform: translate(-50%,-50%) rotate(-35deg); }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(4){ animation: botlyConfetti 620ms ease-out 120ms forwards; transform: translate(-50%,-50%) rotate(35deg); }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(5){ animation: botlyConfetti 700ms ease-out 160ms forwards; transform: translate(-50%,-50%) rotate(-60deg); }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(6){ animation: botlyConfetti 680ms ease-out 200ms forwards; transform: translate(-50%,-50%) rotate(60deg); }

@keyframes botlyConfetti {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.6) rotate(var(--r,0deg)); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x, 0px)), calc(-50% - var(--y, 0px))) rotate(var(--r2, 0deg)); }
}
/* give each piece its own path using CSS variables */
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(1){ --x: -36px; --y: 44px;  --r2: -120deg; }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(2){ --x:  42px; --y: 36px;  --r2: 150deg; }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(3){ --x: -28px; --y: 52px;  --r2: -90deg; }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(4){ --x:  26px; --y: 58px;  --r2: 120deg; }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(5){ --x: -12px; --y: 64px;  --r2: -180deg; }
:root.botly-open .botly-bubble--sticker .botly-confetti i:nth-child(6){ --x:  14px; --y: 62px;  --r2: 180deg; }

/* accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .botly-bubble--sticker .botly-sticker,
  .botly-bubble--sticker .eye--right { animation: none; }
  :root.botly-open .botly-bubble--sticker .botly-confetti i { animation: none; }
}

/* ======================================================
📱 Mobile: lock width + wrap long content (no X-scroll)
====================================================== */

/* 1) Hard stop: no horizontal scroll anywhere */
html, body { overflow-x: hidden; }

/* 2) Widget stays within the viewport */
#botly-widget {
  max-width: 100vw;   /* never wider than the screen */
}

/* 3) Messages never create horizontal overflow */
.botly-messages { 
  overflow-x: hidden;       /* hide any accidental overflow */
}

/* 4) Bubbles wrap anything (URLs, long words, code-y strings) */
.botly-message,
.botly-bubble-text {
  max-width: 100%;
  overflow-wrap: anywhere;  /* modern, preferred */
  word-break: break-word;   /* fallback for older engines */
  hyphens: auto;
}

/* Links can be extremely long — allow aggressive breaking */
.botly-bubble-text a {
  word-break: break-all;
}

/* 5) Media scales to bubble width */
.botly-bubble-text img,
.botly-bubble-text video,
.botly-bubble-text iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 6) Composer: prevent the input from forcing the row wider */
.botly-input { min-width: 0; }
.botly-input input {
  min-width: 0;            /* critical in flex layouts */
  flex: 1 1 auto;
}

/* 7) Extra safety on very small screens */
@media (max-width: 480px) {
  #botly-widget {
    width: 100vw;
    left: 0; right: 0;     /* avoid sub-pixel overflow */
  }
}

