/* FCP guest chat — messenger style (parity with travelerChatDock / userLeadDetails) */
.fcp-chat-root {
  position: fixed;
  right: 16px;
  bottom: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: #050505;
}

/* Package detail: sit above fixed mobile price / Get Quotes bar */
.fcp-chat-root.fcp-chat-root--package-detail:not(.is-open) {
  bottom: 68px;
}

.fcp-chat-launcher {
  pointer-events: auto;
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 4px 16px 0;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: #0084ff;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 132, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, background 160ms ease;
  animation: fcpLauncherIn 420ms cubic-bezier(0.23, 1, 0.32, 1) both,
    fcpLauncherPulse 2.4s ease-in-out 1s infinite;
}

.fcp-chat-launcher:hover {
  background: #0073e6;
  transform: scale(1.06);
  animation-play-state: paused;
}

.fcp-chat-launcher:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.fcp-chat-launcher svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  position: relative;
  z-index: 1;
}

.fcp-chat-launcher::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(0, 132, 255, 0.28);
  animation: fcpLauncherRing 2.4s ease-out 1.2s infinite;
  pointer-events: none;
}

@keyframes fcpLauncherIn {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes fcpLauncherPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes fcpLauncherRing {
  0% {
    transform: scale(0.92);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* Floating greeting bubble above the launcher */
.fcp-chat-teaser {
  pointer-events: auto;
  position: relative;
  max-width: min(240px, calc(100vw - 88px));
  margin: 0 8px 4px 0;
  padding: 10px 34px 10px 14px;
  background: #fff;
  color: #050505;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  animation: fcpTeaserIn 480ms cubic-bezier(0.23, 1, 0.32, 1) 0.55s both,
    fcpTeaserFloat 3s ease-in-out 1.2s infinite;
}

.fcp-chat-teaser::after {
  content: '';
  position: absolute;
  right: 18px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.03);
  border-radius: 2px;
}

.fcp-chat-teaser-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #65676b;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fcp-chat-teaser-close:hover {
  background: #f0f2f5;
  color: #050505;
}

.fcp-chat-teaser.is-hidden,
.fcp-chat-root.is-open .fcp-chat-teaser {
  display: none !important;
}

@keyframes fcpTeaserIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fcpTeaserFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fcp-chat-launcher,
  .fcp-chat-launcher::before,
  .fcp-chat-teaser {
    animation: none !important;
  }
}

.fcp-chat-panel {
  pointer-events: auto;
  width: 328px;
  height: 455px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 96px);
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: fcpChatIn 180ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

.fcp-chat-panel.is-open {
  display: flex;
}

/* When open: dock panel flush to bottom; hide FAB so it isn't floating under the dock */
.fcp-chat-root.is-open {
  gap: 0;
}

.fcp-chat-root.is-open .fcp-chat-launcher {
  display: none;
}

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

.fcp-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e4e6eb;
  flex-shrink: 0;
}

.fcp-chat-header-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.fcp-chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.fcp-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e7f3ff;
  color: #0084ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}

.fcp-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fcp-chat-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #25d366;
  border: 2px solid #fff;
  border-radius: 50%;
}

.fcp-chat-header-copy {
  min-width: 0;
}

.fcp-chat-header-name {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fcp-chat-header-sub {
  margin: 0;
  font-size: 12px;
  color: #25d366;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fcp-chat-header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.fcp-chat-header-actions button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #65676b;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.fcp-chat-header-actions button:hover {
  background: #f0f2f5;
  color: #050505;
}

.fcp-chat-body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.fcp-chat-gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: auto 0;
  padding: 8px 4px 4px;
  width: 100%;
}

.fcp-chat-gate-intro {
  background: #fff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.42;
  color: #050505;
  margin-bottom: 4px;
  max-width: 92%;
}

.fcp-chat-gate label {
  font-size: 12px;
  color: #65676b;
  font-weight: 600;
}

.fcp-chat-gate input {
  width: 100%;
  border: 0 !important;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
  box-sizing: border-box;
  color: #050505;
  outline: none !important;
  appearance: none;
  -webkit-appearance: none;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-ring-color: transparent !important;
  --tw-ring-offset-width: 0 !important;
  --tw-ring-width: 0 !important;
}

.fcp-chat-gate input:focus,
.fcp-chat-gate input:focus-visible {
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
  border: 0 !important;
}

.fcp-chat-gate .fcp-chat-err {
  color: #f02849;
  font-size: 12px;
  min-height: 16px;
}

.fcp-chat-gate .fcp-chat-submit {
  appearance: none;
  border: 0;
  background: #0084ff;
  color: #fff;
  border-radius: 18px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 2px;
}

.fcp-chat-gate .fcp-chat-submit:hover {
  background: #0073e6;
}

.fcp-chat-gate .fcp-chat-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.fcp-chat-thread {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.fcp-chat-msgs {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.fcp-chat-empty {
  margin: auto;
  text-align: center;
  color: #65676b;
  font-size: 13px;
  padding: 24px;
}

.fcp-chat-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.fcp-chat-bubble-row.is-self {
  align-self: flex-end;
  align-items: flex-end;
}

.fcp-chat-bubble-row.is-peer {
  align-self: flex-start;
  align-items: flex-start;
}

.fcp-chat-bubble {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.42;
  word-break: break-word;
  white-space: pre-wrap;
}

.fcp-chat-bubble-row.is-self .fcp-chat-bubble {
  background: #0084ff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.fcp-chat-bubble-row.is-peer .fcp-chat-bubble {
  background: #fff;
  color: #050505;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.fcp-chat-time {
  font-size: 11px;
  color: #65676b;
  margin-top: 2px;
  padding: 0 4px;
}

.fcp-chat-bubble.is-media {
  padding: 4px;
  background: transparent !important;
  box-shadow: none !important;
  white-space: normal;
}

.fcp-chat-bubble-img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.fcp-chat-bubble-audio {
  width: 220px;
  max-width: 100%;
  height: 36px;
  outline: none;
}

.fcp-chat-composer {
  position: relative;
  display: none;
  flex-direction: column;
  padding: 6px 8px 10px;
  background: #fff;
  border-top: 1px solid #e4e6eb;
  flex-shrink: 0;
}

.fcp-chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
}

.fcp-chat-composer-row.is-hidden,
.fcp-chat-recording.is-hidden,
.fcp-chat-picker.is-hidden,
.fcp-chat-attach-menu.is-hidden,
.fcp-chat-like-icon.is-hidden,
.fcp-chat-send-icon.is-hidden {
  display: none !important;
}

.fcp-chat-tools {
  position: relative;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.fcp-chat-plus-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0084ff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.fcp-chat-plus-btn:hover {
  background: #f0f2f5;
}

.fcp-chat-plus-btn.is-open {
  background: #0084ff;
  color: #fff;
}

.fcp-chat-attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  min-width: 210px;
  padding: 8px 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.fcp-chat-attach-menu button {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #050505;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.fcp-chat-attach-menu button:hover {
  background: #f0f2f5;
}

.fcp-chat-attach-menu button span.icon {
  color: #0084ff;
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.fcp-chat-input-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: #f0f2f5;
  border-radius: 20px;
  padding: 0 4px 0 12px;
  min-height: 36px;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

.fcp-chat-input-pill:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

.fcp-chat-input-pill input,
.fcp-chat-input-pill input:focus,
.fcp-chat-input-pill input:focus-visible {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 8px 4px 8px 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.35;
  outline: none !important;
  box-shadow: none !important;
  color: #050505;
  appearance: none;
  -webkit-appearance: none;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-ring-color: transparent !important;
  --tw-ring-offset-width: 0 !important;
  --tw-ring-width: 0 !important;
}

.fcp-chat-emoji-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0084ff;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 17px;
  padding: 0;
}

.fcp-chat-emoji-btn:hover,
.fcp-chat-emoji-btn.is-active {
  background: rgba(0, 132, 255, 0.1);
}

.fcp-chat-send-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #0084ff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  font-size: 18px;
  margin-bottom: 1px;
}

.fcp-chat-send-btn:hover {
  background: #e7f3ff;
}

.fcp-chat-send-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.fcp-chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.fcp-chat-recording {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 4px;
  width: 100%;
}

.fcp-chat-recording-cancel,
.fcp-chat-recording-send {
  appearance: none;
  border: 0;
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.fcp-chat-recording-cancel {
  color: #e41e3f;
}

.fcp-chat-recording-send {
  color: #0084ff;
}

.fcp-chat-recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e41e3f;
  animation: fcpRecPulse 1s ease-in-out infinite;
}

@keyframes fcpRecPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.fcp-chat-recording-time {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fcp-chat-picker {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 6px);
  z-index: 30;
  max-height: 240px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.fcp-chat-picker.is-gif {
  max-height: 280px;
}

.fcp-chat-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  overflow-y: auto;
  max-height: 220px;
}

.fcp-chat-picker-grid.is-sticker {
  grid-template-columns: repeat(5, 1fr);
}

.fcp-chat-picker-grid button {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 8px;
  height: 34px;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fcp-chat-picker-grid.is-sticker button {
  height: 44px;
  font-size: 28px;
}

.fcp-chat-picker-grid button:hover {
  background: #f0f2f5;
}

.fcp-chat-gif-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0 0 10px;
  padding: 0 12px;
  background: #f0f2f5;
  border-radius: 999px;
}

.fcp-chat-gif-search input,
.fcp-chat-gif-search input:focus,
.fcp-chat-gif-search input:focus-visible {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 14px;
  color: #050505;
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
  --tw-ring-color: transparent !important;
}

.fcp-chat-gif-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.fcp-chat-gif-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.fcp-chat-gif-tiles img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  background: #f0f2f5;
}

.fcp-chat-gif-empty {
  text-align: center;
  color: #65676b;
  font-size: 13px;
  padding: 24px 8px;
}

/* Mobile: full-screen chat when open */
@media (max-width: 767px) {
  .fcp-chat-root {
    right: 12px;
  }

  .fcp-chat-root.fcp-chat-root--package-detail:not(.is-open) {
    bottom: max(68px, calc(56px + env(safe-area-inset-bottom)));
  }

  .fcp-chat-launcher {
    margin: 0 2px 12px 0;
  }

  .fcp-chat-root.is-open {
    inset: auto;
    right: 0;
    left: 0;
    top: 0;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    align-items: stretch;
    /* Avoid browser scroll-into-view pushing the fixed dock with the keyboard */
    transform: translateZ(0);
  }

  .fcp-chat-root.is-open .fcp-chat-panel,
  .fcp-chat-panel.is-open {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
  }

  html.fcp-chat-lock,
  html.fcp-chat-lock body {
    overflow: hidden !important;
    overscroll-behavior: none;
    height: 100%;
    position: relative;
  }

  html.fcp-chat-lock body {
    /* Stop Android/iOS from scrolling the page behind when the keyboard opens */
    touch-action: none;
  }

  .fcp-chat-header {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .fcp-chat-composer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}
