/* CT Guide chatbot */
.ct-chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.ct-chat__toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--navy), var(--purple));
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 12px 40px rgba(160, 112, 221, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s var(--ease);
}
.ct-chat__toggle:hover { transform: scale(1.06); }
.ct-chat__toggle-icon { pointer-events: none; }
.ct-chat__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  animation: ctPulse 2.5s ease-out infinite;
  pointer-events: none;
}
.ct-chat.is-open .ct-chat__pulse { display: none; }
@keyframes ctPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}
.ct-chat__panel {
  display: none;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100dvh - 6rem));
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(160, 112, 221, 0.25);
  border: 1px solid rgba(160, 112, 221, 0.35);
  flex-direction: column;
  overflow: hidden;
  order: -1;
}
.ct-chat__panel.is-open { display: flex; }
.ct-chat__head {
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--ink), var(--navy));
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.ct-chat__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--display);
}
.ct-chat__head-text { flex: 1; }
.ct-chat__head-text h3 {
  font-size: 0.9rem;
  margin: 0;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ct-chat__status {
  font-size: 0.58rem;
  color: #7dffa8;
  font-family: var(--sans);
  font-weight: 600;
}
.ct-chat__head-text p { margin: 0; font-size: 0.68rem; opacity: 0.85; }
.ct-chat__head-actions { display: flex; gap: 0.3rem; }
.ct-chat__clear, .ct-chat__close {
  min-width: 30px;
  min-height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
}
.ct-chat__close { font-size: 0.95rem; }
.ct-chat__quick {
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem;
  background: var(--lavender);
}
.ct-chat__quick-btn {
  flex: 1;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.4rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(108,107,181,0.12);
  color: var(--navy);
  text-decoration: none;
}
.ct-chat__quick-btn--gold { background: var(--gold); border-color: transparent; color: var(--ink); }
.ct-chat__topics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
  padding: 0.55rem;
  border-bottom: 1px solid rgba(108,107,181,0.08);
}
.ct-chat__topics.is-hidden { display: none; }
.ct-chat__topic {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(108,107,181,0.12);
  background: var(--cream);
  cursor: pointer;
  text-align: left;
}
.ct-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--cream, #faf9fc);
  font-size: 0.85rem;
}
.ct-chat__msg { max-width: 92%; padding: 0.6rem 0.8rem; border-radius: 12px; }
.ct-chat__msg p { margin: 0; white-space: pre-line; line-height: 1.5; color: #e8e4f8; }
.ct-chat__msg--bot { align-self: flex-start; background: rgba(108,107,181,0.2); border: 1px solid rgba(160,112,221,0.3); }
.ct-chat__msg--user { align-self: flex-end; background: linear-gradient(135deg, #6c6bb5, #a070dd); color: #fff; }
.ct-chat__time { display: block; font-size: 0.6rem; opacity: 0.5; margin-top: 0.25rem; }
.ct-chat__link { display: block; margin-top: 0.4rem; font-weight: 700; font-size: 0.78rem; }
.ct-chat__typing {
  display: flex;
  gap: 4px;
  padding: 0.55rem 0.8rem;
  background: #fff;
  border-radius: 12px;
  align-self: flex-start;
}
.ct-chat__typing[hidden] { display: none; }
.ct-chat__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  animation: ctDot 1.2s infinite;
}
.ct-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.ct-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ctDot {
  0%, 80%, 100% { opacity: 0.4; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.ct-chat__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.45rem 0.75rem; }
.ct-chat__chip {
  font-size: 0.65rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--navy);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}
.ct-chat__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem;
  border-top: 1px solid rgba(108,107,181,0.1);
}
.ct-chat__input {
  flex: 1;
  border: 1px solid rgba(108,107,181,0.2);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-family: var(--sans);
}
.ct-chat__send {
  border: none;
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
