/* ═══════════════════════════════════════════════════════════════
   TRIPY AI — Premium Chat UI v2
   ═══════════════════════════════════════════════════════════════ */

:root {
  --tai-1: #4f46e5;
  --tai-2: #7c3aed;
  --tai-3: #06b6d4;
  --tai-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 100%);
  --tai-grad-user: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
  --tai-text: #0f0f2d;
  --tai-muted: #64748b;
  --tai-border: rgba(99, 91, 255, 0.12);
  --tai-surface: #f6f7fe;
}

/* ── Launcher ─────────────────────────────────────────────── */
.tripy-ai-root {
  position: fixed;
  right: 18px;
  bottom: 30px;
  z-index: 10030;
}

.tripy-ai-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px 11px 11px;
  cursor: pointer;
  color: #fff;
  background: var(--tai-grad);
  box-shadow: 0 8px 28px rgba(99, 91, 255, 0.48), 0 2px 8px rgba(99, 91, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: taiLauncherPulse 3s ease-in-out infinite;
}

.tripy-ai-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(99, 91, 255, 0.56);
}

@keyframes taiLauncherPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(99, 91, 255, 0.48), 0 0 0 0 rgba(99, 91, 255, 0.0); }
  50%       { box-shadow: 0 8px 28px rgba(99, 91, 255, 0.48), 0 0 0 10px rgba(99, 91, 255, 0.0); }
}

.tripy-ai-launcher__badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.2);
  animation: taiOrbit 6s linear infinite;
}

@keyframes taiOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.tripy-ai-launcher__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.tripy-ai-launcher__text strong { font-size: 14px; font-weight: 700; }
.tripy-ai-launcher__text small  { font-size: 11px; opacity: 0.8; }

.tripy-ai-launcher__count {
  position: absolute;
  top: -5px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
}

/* ── Backdrop ─────────────────────────────────────────────── */
.tripy-ai-panel {
  position: fixed;
  inset: 0;
  z-index: 10031;
}

.tripy-ai-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 20, 0.55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

/* ── Panel Sheet ─────────────────────────────────────────── */
.tripy-ai-panel__sheet {
  position: absolute;
  right: 12px;
  bottom: 22px;
  width: 430px;
  max-width: calc(100% - 24px);   /* 100% of fixed parent, not 100vw */
  height: min(78vh, 780px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(99, 91, 255, 0.1);
  box-shadow: 0 40px 100px rgba(10, 10, 40, 0.36), 0 0 0 1px rgba(99, 91, 255, 0.06);
  animation: taiPanelIn 0.32s cubic-bezier(0.34, 1.46, 0.64, 1) both;
  box-sizing: border-box;
}


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

/* ── Header ──────────────────────────────────────────────── */
.tripy-ai-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #03770d 0%, #144938 55%, #1621b4 100%);
  position: relative;
  overflow: hidden;
}

.tripy-ai-panel__head::before {
  content: '';
  position: absolute;
  top: -50px; right: -30px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(99, 91, 255, 0.3) 0%, transparent 65%);
  pointer-events: none;
}

.tripy-ai-panel__head::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 10px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.22) 0%, transparent 65%);
  pointer-events: none;
}

.tripy-ai-panel__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.tripy-ai-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(99, 91, 255, 0.45), rgba(6, 182, 212, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.14);
  animation: taiIconGlow 2.4s ease-in-out infinite;
}

@keyframes taiIconGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 91, 255, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(99, 91, 255, 0.2); }
}

.tripy-ai-brand-name {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(90deg, #a78bfa 0%, #67e8f9 50%, #c4b5fd 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: taiShimmer 3s linear infinite;
}

@keyframes taiShimmer {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}

.tripy-ai-brand-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 1px;
}

.tripy-ai-online-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  animation: taiOnline 2s ease-in-out infinite;
  vertical-align: middle;
}

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

.tripy-ai-panel__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.tripy-ai-panel__ghost {
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.tripy-ai-panel__ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.tripy-ai-panel__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.tripy-ai-panel__close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Context: hidden in new design */
.tripy-ai-panel__context { display: none; }

/* ── Messages Area ───────────────────────────────────────── */
.tripy-ai-panel__messages {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--tai-surface);
  background-image:
    radial-gradient(ellipse at 8% 92%, rgba(99, 91, 255, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 92% 8%,  rgba(6, 182, 212, 0.05) 0%, transparent 55%);
  scroll-behavior: smooth;
  min-width: 0;
  width: 100%;
}


.tripy-ai-panel__messages::-webkit-scrollbar { width: 4px; }
.tripy-ai-panel__messages::-webkit-scrollbar-track { background: transparent; }
.tripy-ai-panel__messages::-webkit-scrollbar-thumb {
  background: rgba(99, 91, 255, 0.18);
  border-radius: 4px;
}

/* ── Message Bubbles ─────────────────────────────────────── */
.tripy-ai-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  min-width: 0;
  animation: taiMsgIn 0.26s ease both;
}

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

.tripy-ai-message--user      { align-self: flex-end;  align-items: flex-end; }
.tripy-ai-message--assistant { align-self: flex-start; align-items: flex-start; }

.tripy-ai-message__role {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tai-muted);
}

.tripy-ai-message--assistant .tripy-ai-message__role {
  background: var(--tai-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tripy-ai-message__body {
  padding: 12px 16px;
  border-radius: 20px;
  line-height: 1.6;
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  min-width: 0;
  max-width: 100%;
}

.tripy-ai-message__time {
  margin-top: 6px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--tai-muted);
}


.tripy-ai-message--assistant .tripy-ai-message__body {
  background: #fff;
  color: var(--tai-text);
  border: 1px solid rgba(99, 91, 255, 0.1);
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 14px rgba(99, 91, 255, 0.07);
}

.tripy-ai-message--user .tripy-ai-message__body {
  background: var(--tai-grad-user);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 18px rgba(99, 91, 255, 0.32);
}

/* Typing indicator dots */
.tripy-ai-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
}

.tripy-ai-typing-dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: taiDot 1.3s ease-in-out infinite;
}

.tripy-ai-typing-dots span:nth-child(1) { background: #a78bfa; animation-delay: 0s; }
.tripy-ai-typing-dots span:nth-child(2) { background: #818cf8; animation-delay: 0.18s; }
.tripy-ai-typing-dots span:nth-child(3) { background: #67e8f9; animation-delay: 0.36s; }

@keyframes taiDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40%            { transform: translateY(-8px); opacity: 1; }
}

/* Typewriter cursor */
.tripy-ai-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: var(--tai-1);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: taiCursor 0.8s step-end infinite;
}

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

/* ── Bottom Section ──────────────────────────────────────── */
.tripy-ai-panel__bottom {
  background: #fff;
  border-top: 1px solid rgba(99, 91, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}


/* File previews */
.tripy-ai-file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 0;
}

.tripy-ai-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(99,91,255,0.08), rgba(6,182,212,0.08));
  color: var(--tai-1);
  border: 1px solid rgba(99, 91, 255, 0.18);
  border-radius: 20px;
  padding: 4px 8px 4px 10px;
  font-size: 12px;
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tripy-ai-file-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.5;
  flex-shrink: 0;
  color: var(--tai-1);
  transition: opacity 0.15s;
}
.tripy-ai-file-remove:hover { opacity: 1; }

/* Thumbnail inside file chip (images) */
.tripy-ai-file-chip__thumb {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Uploading indicator inside chip */
.tripy-ai-file-uploading {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 2px;
}

/* ── Attachments inside user message bubble ─────────────────────── */
.tripy-ai-msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

/* Inline image in user bubble */
.tripy-ai-msg-image {
  max-width: 180px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255,255,255,0.15);
}

/* Non-image file chip inside user bubble */
.tripy-ai-msg-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  color: inherit;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chips — horizontal scrollable */
.tripy-ai-panel__chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 7px;
  padding: 10px 14px 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tripy-ai-panel__chips:empty { padding: 0; }
.tripy-ai-panel__chips::-webkit-scrollbar { display: none; }

.tripy-ai-chip {
  flex-shrink: 0;
  border: 1px solid rgba(99, 91, 255, 0.16);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tai-1);
  background: rgba(99, 91, 255, 0.04);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.17s ease;
}

.tripy-ai-chip:hover {
  background: var(--tai-grad-user);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.28);
}

/* Composer form */
.tripy-ai-panel__composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px 14px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}


.tripy-ai-composer-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  background: #f5f5fe;
  border: 1.5px solid rgba(99, 91, 255, 0.14);
  border-radius: 24px;
  padding: 6px 8px 6px 12px;
  gap: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 46px;
  box-sizing: border-box;
  overflow: hidden;
}


.tripy-ai-composer-inner:focus-within {
  border-color: rgba(99, 91, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.08);
}

.tripy-ai-panel__attach {
  order: 2;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 50%;
  padding: 0;
  transition: color 0.15s, background 0.15s;
  margin-bottom: 2px;
}

.tripy-ai-panel__attach:hover {
  color: var(--tai-1);
  background: rgba(99, 91, 255, 0.07);
}

.tripy-ai-panel__attach svg { display: block; }

.tripy-ai-panel__mic {
  order: 1;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #1858b0;
  border-radius: 50%;
  padding: 0;
  transition: color 0.15s, background 0.15s, transform 0.18s, box-shadow 0.18s;
  margin-bottom: 2px;
  animation: tripyMicIdle 2.4s ease-in-out infinite;
}

.tripy-ai-panel__mic:hover:not(:disabled) {
  color: var(--tai-1);
  background: rgba(99, 91, 255, 0.07);
}

.tripy-ai-panel__mic.is-listening {
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12);
  animation: tripyMicPulse 1.2s ease-in-out infinite;
}

.tripy-ai-panel__mic:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  animation: none;
}

.tripy-ai-panel__mic svg { display: block; }

.tripy-ai-panel__composer textarea {
  order: 3;
  flex: 1;
  resize: none;
  min-height: 24px;
  max-height: 96px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--tai-text);
  line-height: 1.55;
  padding: 3px 0;
  align-self: center;
}

.tripy-ai-panel__composer textarea::placeholder { color: #9ca3af; }

/* Send button */
.tripy-ai-send-btn {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--tai-grad);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  box-shadow: 0 4px 16px rgba(99, 91, 255, 0.38);
  padding: 0;
}

.tripy-ai-send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(99, 91, 255, 0.5);
}

.tripy-ai-send-btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.tripy-ai-send-btn svg { display: block; }

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

@keyframes tripyMicIdle {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 91, 255, 0.08);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(99, 91, 255, 0.08);
  }
}

/* ── Cards ───────────────────────────────────────────────── */
.tripy-ai-cards {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.tripy-ai-card {
  border: 1px solid rgba(99, 91, 255, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(99, 91, 255, 0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}
.tripy-ai-card:hover {
  box-shadow: 0 8px 32px rgba(99, 91, 255, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

/* Hero image */
.tripy-ai-card__img-wrap {
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
  position: relative;
}
.tripy-ai-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.tripy-ai-card:hover .tripy-ai-card__img {
  transform: scale(1.03);
}

/* No-image placeholder strip */
.tripy-ai-card:not(.tripy-ai-card--has-img) {
  border-top: 3px solid var(--tai-1, #635bff);
}

/* Content */
.tripy-ai-card__body-wrap {
  padding: 13px 15px 12px;
}

/* Discount row */
.tripy-ai-card__discount-row {
  margin-bottom: 5px;
}
.tripy-ai-card__discount {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(90deg, #ef4444, #f97316);
  border-radius: 20px;
  padding: 2px 8px;
  text-transform: uppercase;
}

.tripy-ai-card__title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  color: var(--tai-text, #0f172a);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tripy-ai-card__subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta row: rating + price side by side */
.tripy-ai-card__meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.tripy-ai-card__rating {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Price group */
.tripy-ai-card__price-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.tripy-ai-card__price {
  font-size: 13px;
  font-weight: 800;
  color: var(--tai-1, #635bff);
  white-space: nowrap;
}
.tripy-ai-card__orig-price {
  font-size: 11px;
  color: #94a3b8;
  text-decoration: line-through;
  white-space: nowrap;
}

/* Badge pills */
.tripy-ai-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.tripy-ai-pill--badge {
  font-size: 10.5px;
  font-weight: 500;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Book button */
.tripy-ai-card__footer { margin-top: 4px; }
.tripy-ai-card__footer .tripy-ai-action {
  width: 100%;
  text-align: center;
  justify-content: center;
  background: linear-gradient(135deg, #635bff 0%, #4f46e5 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 12px;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.3);
}
.tripy-ai-card__footer .tripy-ai-action:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  box-shadow: 0 4px 14px rgba(99, 91, 255, 0.4);
  transform: translateY(-1px);
}

.tripy-ai-card__body {
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.tripy-ai-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tripy-ai-message__actions { margin-top: 10px; }

.tripy-ai-action {
  border: 1px solid rgba(99, 91, 255, 0.18);
  border-radius: 10px;
  padding: 9px 14px;
  background: rgba(99, 91, 255, 0.05);
  color: var(--tai-1);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.tripy-ai-action:hover {
  background: var(--tai-grad-user);
  color: #fff;
  border-color: transparent;
}

.tripy-ai-action--primary {
  background: var(--tai-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}

.tripy-ai-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(99, 91, 255, 0.08);
  color: var(--tai-1);
  border: 1px solid rgba(99, 91, 255, 0.12);
}

/* ── FAB positioning ─────────────────────────────────────── */
#tripy-web-service-fab {
    position: fixed;
    right: 20px;
    bottom: 101px;
    width: 55px;
    height: 55px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 17px;
    background: linear-gradient(180deg, #69ed09 0%, #0e5828 100%);
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.22);
    cursor: pointer;
    z-index: 10040;
}

#tripy-web-service-fab > span { display: block; transform: translateY(-1px); }

#tripy-web-service-menu {
  position: fixed;
  right: 28px;
  bottom: 192px;
  z-index: 10039;
  min-width: 220px;
}

.tripy-ai-panel { z-index: 10031; }
#tripy-web-service-fab { z-index: 10040; }
#tripy-web-service-menu { z-index: 10039; }

body.tripy-ai-open #tripy-web-service-fab,
body.tripy-ai-open #tripy-web-service-menu {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 767px) {
  .tripy-ai-root { right: 12px; bottom: 20px; }

  .tripy-ai-launcher {
    padding: 9px 14px 9px 10px;
    gap: 8px;
  }

  .tripy-ai-launcher__text small { display: none; }

  .tripy-ai-panel__sheet {
    right: 0; left: 0; bottom: 0; top: 10px;
    width: 100%;
    max-width: 100%;
    height: min(88vh, 820px);
    border-radius: 22px 22px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    box-sizing: border-box;
  }

  .tripy-ai-panel__composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px 30px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}


  .tripy-ai-message { max-width: 90%; }

  #tripy-web-service-fab  { right: 18px; bottom: 90px; width: 58px; height: 58px; border-radius: 20px; font-size: 32px; }
  #tripy-web-service-menu { right: 16px; bottom: 178px; min-width: min(82vw, 240px); }

  body[data-screen]:not([data-screen="home"]) #tripy-web-service-fab,
  body[data-screen]:not([data-screen="home"]) #tripy-web-service-menu,
  body[data-screen]:not([data-screen="home"]) .tripy-ai-root {
    display: none !important;
    pointer-events: none;
  }
}


/* ── New bubble reveal animation (replaces JS typewriter) ── */
@keyframes taiBubbleReveal {
  from { opacity: 0; transform: translateY(8px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}
.tai-bubble-new {
  animation: taiBubbleReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}


/* Tripy AI + menu integration — 2026-07-27 */

body.tripy-web-app-active
#tripy-web-agent-launcher {
  display: none !important;
}



/*
 * Tripy AI standalone premium launcher — 2026-07-27
 */

#tripy-ai-premium-launcher {
  position: fixed;
  right: 96px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 10030;

  display: inline-flex;
  align-items: center;
  gap: 12px;

  min-width: 224px;
  min-height: 66px;
  max-width: calc(100vw - 32px);

  padding: 9px 15px 9px 10px;

  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 22px;

  background:
    linear-gradient(
      135deg,
      rgba(8, 26, 62, 0.98) 0%,
      rgba(22, 82, 186, 0.98) 52%,
      rgba(108, 44, 210, 0.98) 100%
    );

  color: #ffffff;
  box-shadow:
    0 18px 46px rgba(6, 26, 73, 0.30),
    0 7px 20px rgba(41, 104, 221, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);

  cursor: pointer;
  overflow: hidden;
  isolation: isolate;

  font-family:
    "DM Sans",
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  transform: translateZ(0);
  animation:
    tripyAiLauncherFloat 4.6s ease-in-out infinite;

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

#tripy-ai-premium-launcher::before {
  content: "";
  position: absolute;
  inset: -35% auto -35% -45%;
  width: 46%;
  z-index: -1;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.28),
      transparent
    );

  transform: skewX(-18deg);
  animation:
    tripyAiLauncherShimmer 4.2s ease-in-out infinite;
}

#tripy-ai-premium-launcher::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -2;

  border-radius: 20px;

  background:
    radial-gradient(
      circle at 16% 20%,
      rgba(99, 230, 255, 0.24),
      transparent 34%
    );
}

#tripy-ai-premium-launcher:hover {
  transform:
    translateY(-4px)
    scale(1.025);

  box-shadow:
    0 22px 54px rgba(6, 26, 73, 0.36),
    0 10px 28px rgba(66, 93, 255, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.40);

  filter: saturate(1.08);
}

#tripy-ai-premium-launcher:active,
#tripy-ai-premium-launcher.is-activating {
  transform:
    translateY(-1px)
    scale(0.975);
}

#tripy-ai-premium-launcher:focus-visible {
  outline: 3px solid rgba(93, 231, 255, 0.82);
  outline-offset: 4px;
}

.tripy-ai-premium-launcher__orb {
  position: relative;
  flex: 0 0 48px;

  display: grid;
  place-items: center;

  width: 48px;
  height: 48px;
}

.tripy-ai-premium-launcher__ring {
  position: absolute;
  inset: -2px;

  border-radius: 50%;

  background:
    conic-gradient(
      from 0deg,
      #72f0ff,
      #9c71ff,
      #ffffff,
      #5ee3b6,
      #72f0ff
    );

  animation:
    tripyAiLauncherRing 5.5s linear infinite;

  -webkit-mask:
    radial-gradient(
      farthest-side,
      transparent calc(100% - 3px),
      #000 calc(100% - 2px)
    );

  mask:
    radial-gradient(
      farthest-side,
      transparent calc(100% - 3px),
      #000 calc(100% - 2px)
    );
}

.tripy-ai-premium-launcher__avatar {
  position: relative;
  z-index: 1;

  display: grid;
  place-items: center;

  width: 41px;
  height: 41px;

  border-radius: 50%;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.98),
      rgba(224, 240, 255, 0.94)
    );

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.92),
    0 5px 15px rgba(0, 0, 0, 0.22);
}

.tripy-ai-premium-launcher__avatar img {
  display: block;
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.tripy-ai-premium-launcher__status {
  position: absolute;
  right: 0;
  bottom: 1px;
  z-index: 3;

  width: 12px;
  height: 12px;

  border: 2px solid #173d83;
  border-radius: 50%;

  background: #38e676;

  box-shadow:
    0 0 0 3px rgba(56, 230, 118, 0.18),
    0 0 13px rgba(56, 230, 118, 0.90);

  animation:
    tripyAiStatusPulse 2.2s ease-out infinite;
}

.tripy-ai-premium-launcher__copy {
  position: relative;
  z-index: 2;

  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;

  min-width: 0;
  text-align: left;
}

.tripy-ai-premium-launcher__copy strong {
  display: block;

  font-size: 17px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;

  color: #ffffff;
}

.tripy-ai-premium-launcher__copy small {
  display: block;
  margin-top: 4px;

  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;

  color: rgba(232, 244, 255, 0.84);
}

.tripy-ai-premium-launcher__spark {
  position: relative;
  z-index: 2;

  display: grid;
  place-items: center;

  width: 24px;
  height: 24px;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;

  font-size: 13px;

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);

  animation:
    tripyAiSparkPulse 2.7s ease-in-out infinite;
}


/*
 * Keep the complete assistant conversation vertically scrollable.
 */

#tripy-web-agent-panel {
  max-height:
    min(
      780px,
      calc(100dvh - 92px)
    );
}

#tripy-web-agent-messages {
  overflow-x: hidden !important;
  overflow-y: auto !important;

  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

#tripy-web-agent-messages::-webkit-scrollbar {
  width: 8px;
}

#tripy-web-agent-messages::-webkit-scrollbar-track {
  background: transparent;
}

#tripy-web-agent-messages::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;

  background:
    linear-gradient(
      #93a6c8,
      #5e75a2
    );

  background-clip: padding-box;
}


@keyframes tripyAiLauncherFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes tripyAiLauncherShimmer {
  0%,
  58% {
    transform:
      translateX(-160%)
      skewX(-18deg);
  }

  78%,
  100% {
    transform:
      translateX(520%)
      skewX(-18deg);
  }
}

@keyframes tripyAiLauncherRing {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tripyAiStatusPulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(56, 230, 118, 0.55),
      0 0 12px rgba(56, 230, 118, 0.82);
  }

  75%,
  100% {
    box-shadow:
      0 0 0 9px rgba(56, 230, 118, 0),
      0 0 14px rgba(56, 230, 118, 0.72);
  }
}

@keyframes tripyAiSparkPulse {
  0%,
  100% {
    transform: rotate(-8deg) scale(1);
    opacity: 0.82;
  }

  50% {
    transform: rotate(8deg) scale(1.14);
    opacity: 1;
  }
}


@media (max-width: 640px) {
  #tripy-ai-premium-launcher {
    right: 76px;
    bottom:
      calc(
        14px +
        env(safe-area-inset-bottom, 0px)
      );

    max-width: calc(100vw - 92px);

    min-width: 190px;
    min-height: 60px;

    padding:
      8px
      13px
      8px
      9px;

    border-radius: 20px;
  }

  .tripy-ai-premium-launcher__orb {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .tripy-ai-premium-launcher__avatar {
    width: 37px;
    height: 37px;
  }

  .tripy-ai-premium-launcher__avatar img {
    width: 26px;
    height: 26px;
  }

  .tripy-ai-premium-launcher__copy strong {
    font-size: 16px;
  }

  .tripy-ai-premium-launcher__copy small {
    font-size: 10px;
  }

  #tripy-web-agent-panel {
    max-height:
      calc(
        100dvh -
        env(safe-area-inset-top, 0px) -
        16px
      );
  }
}


@media (prefers-reduced-motion: reduce) {
  #tripy-ai-premium-launcher,
  #tripy-ai-premium-launcher::before,
  .tripy-ai-premium-launcher__ring,
  .tripy-ai-premium-launcher__status,
  .tripy-ai-premium-launcher__spark {
    animation: none !important;
  }

  #tripy-web-agent-messages {
    scroll-behavior: auto;
  }
}


/*
 * Tripy AI Executive Chat stability — 2026-07-27
 */

body.tripy-ai-open #tripy-ai-premium-launcher {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;

  transform:
    translateY(12px)
    scale(0.96) !important;
}

.tripy-ai-panel {
  position: fixed;
  inset: 0;

  width: 100vw;
  height: 100dvh;
  max-width: none;

  overflow: hidden;
  box-sizing: border-box;
}

.tripy-ai-panel__sheet {
  right:
    max(
      12px,
      env(safe-area-inset-right, 0px)
    );

  bottom:
    max(
      18px,
      env(safe-area-inset-bottom, 0px)
    );

  width:
    min(
      430px,
      calc(
        100vw -
        24px -
        env(safe-area-inset-left, 0px) -
        env(safe-area-inset-right, 0px)
      )
    );

  max-width:
    calc(
      100vw -
      24px -
      env(safe-area-inset-left, 0px) -
      env(safe-area-inset-right, 0px)
    );

  max-height:
    calc(
      100dvh -
      36px -
      env(safe-area-inset-top, 0px) -
      env(safe-area-inset-bottom, 0px)
    );

  box-sizing: border-box;
}

.tripy-ai-panel__head,
.tripy-ai-panel__messages,
.tripy-ai-panel__bottom,
.tripy-ai-panel__composer {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tripy-ai-panel__head {
  gap: 10px;
}

.tripy-ai-panel__brand {
  flex: 1 1 auto;
  min-width: 0;
}

.tripy-ai-panel__actions--split,
.tripy-ai-right-slot {
  min-width: 0;
}

.tripy-ai-right-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.tripy-ai-panel__close,
.tripy-ai-top-chip {
  flex: 0 0 auto;
}

.tripy-ai-panel__messages {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

.tripy-ai-message {
  max-width: min(85%, 100%);
  min-width: 0;
}

.tripy-ai-message--user {
  margin-left: auto;
}

.tripy-ai-message__body,
.tripy-ai-message__role,
.tripy-ai-message__time {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  .tripy-ai-panel__sheet {
    inset:
      max(
        8px,
        env(safe-area-inset-top, 0px)
      )
      0
      0
      0;

    width: 100vw;
    max-width: 100vw;
    height: auto;
    max-height: none;

    border-radius: 22px 22px 0 0;
  }

  .tripy-ai-panel__head {
    padding-right:
      max(
        12px,
        env(safe-area-inset-right, 0px)
      );
  }

  .tripy-ai-panel__composer {
    padding-bottom:
      max(
        16px,
        calc(
          env(safe-area-inset-bottom, 0px) +
          10px
        )
      );
  }
}


/*
 * Tripy AI Executive launcher alignment and bottom edge
 * — 2026-07-27
 */

/*
 * Cover the complete visible browser viewport, including the
 * bottom edge.
 */
.tripy-ai-panel,
.tripy-ai-panel__backdrop {
  width: 100vw !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
}

.tripy-ai-panel__backdrop {
  position: fixed !important;
  inset: 0 !important;
}

/*
 * Keep the existing panel height, but anchor its bottom edge
 * directly to the browser viewport.
 */
.tripy-ai-panel__sheet {
  bottom: 0 !important;
  max-height: 100dvh !important;
  border-radius: 26px 26px 0 0 !important;
}

/*
 * Align the right edge of Tripy AI with the green services +
 * button and keep it directly below that button.
 */
#tripy-ai-premium-launcher {
  right: 18px !important;
  bottom:
    max(
      18px,
      env(safe-area-inset-bottom, 0px)
    ) !important;
  left: auto !important;
}

@media (max-width: 767px) {
  .tripy-ai-panel__sheet {
    bottom: 0 !important;
    border-radius: 22px 22px 0 0 !important;
  }

  #tripy-ai-premium-launcher {
    right: 12px !important;
    bottom:
      max(
        12px,
        env(safe-area-inset-bottom, 0px)
      ) !important;
    left: auto !important;
  }
}


/*
 * Tripy AI compact hover launcher — 2026-07-27
 *
 * Default:
 * - circular logo button
 *
 * Hover/focus:
 * - expands toward the left
 * - reveals text and trailing content
 *
 * Mobile:
 * - launcher is completely hidden below 768px
 */

#tripy-ai-premium-launcher {
  position: fixed !important;

  right:
    max(
      18px,
      env(safe-area-inset-right, 0px)
    ) !important;

  bottom:
    max(
      18px,
      env(safe-area-inset-bottom, 0px)
    ) !important;

  left: auto !important;

  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  height: 58px !important;
  min-height: 58px !important;

  padding: 6px !important;
  gap: 10px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;

  border-radius: 999px !important;
  overflow: hidden !important;

  transform-origin: right center !important;
  white-space: nowrap !important;

  transition:
    width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms ease,
    box-shadow 220ms ease !important;
}

/*
 * The first child is the circular Tripy AI logo/status unit.
 * Keep it permanently visible and centred.
 */
#tripy-ai-premium-launcher > :first-child {
  flex: 0 0 46px !important;

  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;

  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;

  margin: 0 !important;
  transform: none !important;
}

/*
 * Hide text, subtitle, unread content and the trailing icon
 * until hover or keyboard focus.
 */
#tripy-ai-premium-launcher > :not(:first-child) {
  flex: 0 0 auto;

  max-width: 0;
  margin: 0 !important;

  opacity: 0;
  visibility: hidden;
  overflow: hidden;

  transform: translateX(12px);
  pointer-events: none;

  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/*
 * Expand leftwards because the right edge remains fixed.
 */
#tripy-ai-premium-launcher:hover,
#tripy-ai-premium-launcher:focus-visible,
#tripy-ai-premium-launcher:focus-within {
  width: 278px !important;
  min-width: 278px !important;
  max-width: min(278px, calc(100vw - 36px)) !important;

  padding:
    6px
    14px
    6px
    6px !important;

  transform: translateY(-2px) !important;
}

/*
 * Reveal all secondary launcher content smoothly.
 */
#tripy-ai-premium-launcher:hover > :not(:first-child),
#tripy-ai-premium-launcher:focus-visible > :not(:first-child),
#tripy-ai-premium-launcher:focus-within > :not(:first-child) {
  max-width: 190px;

  opacity: 1;
  visibility: visible;

  transform: translateX(0);
  pointer-events: auto;
}

/*
 * Let the text container reveal itself without wrapping.
 */
#tripy-ai-premium-launcher .tripy-ai-launcher__text {
  min-width: 0;
  white-space: nowrap;
}

#tripy-ai-premium-launcher .tripy-ai-launcher__text strong,
#tripy-ai-premium-launcher .tripy-ai-launcher__text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * Hide this standalone launcher on phones.
 * Tablets begin at 768px and continue to display it.
 */
@media (max-width: 767px) {
  #tripy-ai-premium-launcher {
    display: none !important;
  }
}

/*
 * Avoid unnecessary animation for users who prefer reduced
 * motion while preserving the compact/expanded behaviour.
 */
@media (prefers-reduced-motion: reduce) {
  #tripy-ai-premium-launcher,
  #tripy-ai-premium-launcher > :not(:first-child) {
    transition-duration: 1ms !important;
    animation: none !important;
  }
}
