/* Aktify charter: recreation of the animated roofing text conversation from aktify.com's hero. */
.panel:nth-child(even) { background: none; }
.panel:nth-child(odd):not(:first-child) { background: linear-gradient(180deg, #060607, #000); }
.chat-panel .wrap { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.chat-lede { margin: 0; max-width: 66ch; text-align: left; font-size: clamp(16px, 1.6vw, 18px); line-height: 1.65; color: var(--body); }
.chat-tile { position: relative; margin: 0 auto; width: 100%; max-width: 640px; aspect-ratio: 640 / 560; }
.chat-tile[data-mode="compact"] { max-width: 340px; aspect-ratio: 300 / 640; height: min(680px, calc(100svh - 190px)); min-height: 440px; width: auto; }
.chat-stage { position: absolute; left: 50%; top: 50%; width: 640px; height: 560px; transform: translate(-50%, -50%) scale(var(--s, 1)); }
.chat-tile[data-mode="compact"] .chat-stage { width: 300px; height: 640px; }


.chat-phone, .chat-card { text-align: left; }
/* iPhone chrome: titanium band, black bezel, side buttons, and a light source behind it for the dark page */
.chat-device {
  position: absolute; left: 184px; top: 12px; width: 268px; height: 532px; border-radius: 46px; box-sizing: content-box; z-index: 1;
  background: linear-gradient(145deg, #8e8e93 0%, #3a3a3f 22%, #1c1c1e 50%, #4a4a50 78%, #9a9aa0 100%);
  padding: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 36px 0 rgba(255, 255, 255, 0.12), 0 0 110px 14px rgba(190, 215, 255, 0.08), 0 0 180px 30px rgba(250, 0, 82, 0.05);
}
.chat-device::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 520px; height: 640px; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.1) 0%, rgba(190, 215, 255, 0.04) 55%, transparent 100%);
}
.chat-btn { position: absolute; width: 3px; background: linear-gradient(#6b6b70, #2c2c2e); border-radius: 2px; }
.chat-btn.b-action { left: -3px; top: 74px; height: 22px; }
.chat-btn.b-up { left: -3px; top: 112px; height: 40px; }
.chat-btn.b-down { left: -3px; top: 162px; height: 40px; }
.chat-btn.b-power { right: -3px; top: 132px; height: 64px; }
.chat-phone {
  position: relative; width: 256px; height: 520px; box-sizing: content-box;
  border: 6px solid #000; border-radius: 44px; background: #000; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
}
.chat-home { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); width: 92px; height: 4px; border-radius: 2px; background: #111; z-index: 2; }
.chat-notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 80px; height: 22px; background: #000; border-radius: 999px; z-index: 2; }
.chat-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px 2px; background: #f2f2f7; color: #000; font-size: 10px; font-weight: 600; }
.chat-status svg { width: 12px; height: 12px; margin-left: 2px; }
.chat-head { background: #f2f2f7; padding: 2px 12px 6px; }
.chat-back { display: flex; align-items: center; gap: 2px; color: #007aff; font-size: 10px; }
.chat-back svg { width: 14px; height: 14px; }
.chat-contact { display: flex; flex-direction: column; align-items: center; margin-top: 2px; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(#d1d5db, #9ca3af); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.chat-name { margin: 2px 0 0; color: #000; font-size: 10px; font-weight: 600; }
.chat-msgs { height: calc(100% - 130px); background: #fff; padding: 8px 10px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.chat-row { display: flex; animation: chatIn 0.35s forwards; }
.chat-row.lead { justify-content: flex-end; }
.chat-bubble { padding: 6px 12px; max-width: 82%; font-size: 11px; line-height: 1.625; border-radius: 16px; border-bottom-left-radius: 6px; background: #e9e9eb; color: #000; }
.chat-row.lead .chat-bubble { background: #007aff; color: #fff; border-radius: 16px; border-bottom-right-radius: 6px; }
.chat-row.confirmed .chat-bubble { background: #d1fae5; color: #065f46; }
.chat-row.typing .chat-bubble { display: flex; gap: 2px; align-items: center; height: 28px; padding: 8px 12px; }
.chat-dot { width: 4px; height: 4px; border-radius: 50%; background: #8e8e93; animation: chatWave 1.2s ease-in-out infinite; }
.chat-row.lead .chat-dot { background: rgba(255, 255, 255, 0.7); }
.chat-dot:nth-child(2) { animation-delay: 160ms; }
.chat-dot:nth-child(3) { animation-delay: 320ms; }
.chat-input { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 6px 10px 16px; background: #fff; border-top: 1px solid #e5e7eb; }
.chat-input span { flex: 1; background: #f2f2f7; border-radius: 999px; padding: 4px 10px; font-size: 9px; color: #9ca3af; }
.chat-input svg { width: 16px; height: 16px; color: #007aff; }

.chat-card {
  position: absolute; z-index: 3; background: #fff; border: 1px solid #f3f4f6; border-radius: 12px; padding: 10px 14px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  display: flex; align-items: center; gap: 10px; opacity: 0; translate: 0 12px; transition: opacity 0.5s ease, translate 0.5s ease;
  font-family: Inter, system-ui, sans-serif; white-space: nowrap;
}
.chat-card b { display: block; font-size: 12px; font-weight: 600; color: #111827; line-height: 1.3; }
.chat-card small { display: block; font-size: 10px; color: #9ca3af; line-height: 1.3; }
.chat-card i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.chat-card i svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.chat-card.booked { left: 28px; top: 38px; }
.chat-card.booked i { background: #d1fae5; color: #059669; }
.chat-card.transfer { left: 429px; top: 118px; }
.chat-card.transfer i { background: #dbeafe; color: #2563eb; }

@keyframes chatIn { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes chatWave { 0%, 60%, 100% { opacity: 0.4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* The callouts build in on cue from chat.js; without it they just show */
.chat-card.show, html:not(.js) .chat-card { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  .chat-row { animation: none; opacity: 1; }
  .chat-card { transition: none; }
  .chat-dot { animation: none; opacity: 0.7; }
}

.chat-card.stat { left: 45px; top: 437px; gap: 12px; }
.chat-card.stat b { font-size: 24px; font-weight: 700; color: #0a0a0a; }
.chat-card.stat small { font-size: 10px; white-space: normal; line-height: 1.2; }
.chat-tile[data-mode="compact"] .chat-card.stat { display: none; }

/* Narrow screens: no room beside the phone, so the cards tuck over its top and bottom edges */
.chat-tile[data-mode="compact"] .chat-device { left: 16px; top: 54px; }
.chat-tile[data-mode="compact"] .chat-card.booked { left: 0; top: 4px; }
.chat-tile[data-mode="compact"] .chat-card.transfer { left: auto; right: 0; top: auto; bottom: 2px; }

/* Paragraph typing: an invisible ghost holds the final footprint so nothing shifts while the visible layer types over it */
.chat-lede[data-typing] { position: relative; }
.chat-lede .ghost { visibility: hidden; }
.chat-lede .typed { position: absolute; inset: 0; }
