@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --fasta-blue: #01a9e6;
  --fasta-blue-dark: #0187b8;
  --fasta-blue-light: #e6f7fd;
  --fasta-green: rgb(105, 190, 33);
  --fasta-green-dark: #5a9e1a;
  --fasta-green-light: #f0fae6;
  --fasta-white: #ffffff;
  --fasta-text: #1a1a2e;
  --fasta-muted: #6b7a99;
  --fasta-border: #d4eef9;
  --fasta-bg: #f4fbff;
}

/* ── Launcher wrapper ── */

/* ── Tooltip — default (greeting) ── */

/* Tail pointing right toward the chat icon */

/* ── Tooltip — reminder variant (green) ── */


@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Launcher button ── */

/* ── Chat window ── */
/* Mobile-first: full-screen */
.chat-window {
  position: fixed;
  inset: 0;
  width: 100%;
  /* fallback for browsers without dvh */
  height: 100%;
  height: 100dvh;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  animation: chatSlideUp 0.25s ease;
}

/* Tablet and up: bubble positioned bottom-right */
@media (min-width: 640px) {
  .chat-window {
    inset: auto;
    bottom: 96px;
    right: 28px;
    width: 380px;
    height: 560px;
    border-radius: 18px;
    box-shadow:
      0 24px 80px rgba(1, 169, 230, 0.22),
      0 8px 32px rgba(0, 0, 0, 0.1);
  }
}

@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Header ── */
.chat-header {
  background: linear-gradient(135deg, #01c4f5 0%, #01a8d4 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  /* Respect status bar / notch */
  padding-top: max(14px, env(safe-area-inset-top));
}

@media (min-width: 640px) {
  .chat-header {
    padding-top: 14px;
  }
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  /* border-radius: 10px; */
  /* background: rgba(255, 255, 255, 0.15); */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-header-avatar img {
  width: 120%;
  height: 120%;
  object-fit: contain;
  padding: 4px;
}

.chat-header-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  font-family: 'IBM Plex Sans', sans-serif;
}

.chat-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  font-family: 'IBM Plex Sans', sans-serif;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9dcc52;
  flex-shrink: 0;

  /* background: #9dcc52;
  flex-shrink: 0;
  box-shadow: 0 0px 4px rgba(255, 255, 255, 0.3); */
}

.status-dot.offline {
  background: rgba(255, 255, 255, 0.3);
}

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

.chat-header-minimize {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: rgba(255, 255, 255, 0.85);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  touch-action: manipulation;
}

.chat-header-minimize:hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (min-width: 640px) {
  .chat-header-minimize {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
}

.chat-header-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: rgba(255, 255, 255, 0.85);
  /* 44px touch target on mobile */
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  touch-action: manipulation;
}

@media (min-width: 640px) {
  .chat-header-close {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
}

.chat-header-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Context bar ── */
.chat-context-bar {
  background: #e6f7fd;
  border-bottom: 1px solid #b8e4f7;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #01c4f5 0%, #01a8d4 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(1, 169, 230, 0.3);
}

/* ── Messages ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f4fbff;
  /* Prevent overscroll from affecting parent page on mobile */
  overscroll-behavior: contain;
}

@media (min-width: 640px) {
  .chat-messages {
    padding: 16px 14px;
  }
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #b8e4f7;
  border-radius: 4px;
}

/* Links inside bubbles: keep visible against the coloured backgrounds */

/* ── Tool chips ── */

/* ── Typing indicator ── */

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ── Quick replies ── */

/* ── Input area ── */
.chat-input-area {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #d4eef9;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  /* Push above home bar on iOS */
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
  .chat-input-area {
    padding-bottom: 10px;
  }
}

.chat-input-area textarea {
  flex: 1;
  border: 1px solid #d4eef9;
  border-radius: 10px;
  padding: 9px 13px;
  /* 16px prevents iOS auto-zoom on focus */
  font-size: 16px;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #1a1a2e;
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 120px;
  background: #f4fbff;
  -webkit-appearance: none;
}

@media (min-width: 640px) {
  .chat-input-area textarea {
    font-size: 13.5px;
    max-height: 100px;
  }
}

.chat-input-area textarea:focus {
  border-color: #01a9e6;
  background: #fff;
}

.chat-input-area textarea::placeholder {
  color: #b0b8cc;
}

.chat-send-btn {
  /* 44px minimum touch target */
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #01c4f5 0%, #01a8d4 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(1, 169, 230, 0.35);
}

@media (min-width: 640px) {
  .chat-send-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, #00b8e8 0%, #0099c5 100%);
}

.chat-send-btn:active {
  transform: scale(0.93);
}

.chat-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}


/* ── Footer ── */
.chat-footer {
  text-align: center;
  padding: 6px;
  background: #fff;
  font-size: 10px;
  color: #b0b8cc;
  font-family: 'IBM Plex Mono', monospace;
  border-top: 1px solid #d4eef9;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.chat-footer img {
  height: 16px;
  vertical-align: middle;
  opacity: 0.6;
}