.ts-chat{position:fixed;right:22px;bottom:22px;z-index:480;font-family:var(--ui)}

/* ── Launcher ───────────────────────────────────────────────────────────── */
.ts-chat-launch{
  width:58px;height:58px;border-radius:50%;border:none;cursor:pointer;
  display:grid;place-items:center;position:relative;margin-left:auto;
  background:var(--navy);color:#fff;
  box-shadow:0 14px 34px -12px rgba(2,8,20,.8),0 0 0 1px rgba(60,148,221,.55);
  transition:filter .25s var(--ease);
}
.ts-chat-launch:hover{filter:brightness(1.08)}
.ts-chat-launch svg{width:26px;height:26px;grid-area:1/1;transition:opacity .2s,transform .3s var(--ease)}
.ts-ic-close{opacity:0;transform:rotate(-90deg) scale(.7)}
.ts-chat.is-open .ts-ic-chat{opacity:0;transform:rotate(90deg) scale(.7)}
.ts-chat.is-open .ts-ic-close{opacity:1;transform:none}
/* A single attention ping shortly after load, then never again — a launcher
   that pulses forever is noise the reader learns to ignore. */
.ts-chat-launch::after{
  content:'';position:absolute;inset:0;border-radius:50%;pointer-events:none;
  border:2px solid var(--accent);opacity:0;
  animation:tsPing 2.6s var(--ease) 2.4s 3;
}
.ts-chat.is-open .ts-chat-launch::after{animation:none}
@keyframes tsPing{
  0%{opacity:.7;transform:scale(1)}
  70%,100%{opacity:0;transform:scale(1.65)}
}

/* ── Panel ──────────────────────────────────────────────────────────────── */
.ts-chat-panel{
  position:absolute;right:0;bottom:72px;width:min(372px,calc(100vw - 32px));
  display:flex;flex-direction:column;max-height:min(560px,calc(100vh - 120px));
  border-radius:18px;overflow:hidden;
  background:rgba(6,11,20,.97);border:1px solid rgba(52,63,88,.9);
  -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
  box-shadow:0 34px 80px -30px rgba(0,0,0,.95);
  opacity:0;transform:translateY(12px) scale(.98);transform-origin:100% 100%;
  transition:opacity .22s var(--ease),transform .22s var(--ease);
}
.ts-chat.is-open .ts-chat-panel{opacity:1;transform:none}

.ts-chat-head{
  display:flex;align-items:center;gap:11px;padding:14px 14px 13px;
  border-bottom:1px solid rgba(52,63,88,.7);background:rgba(2,8,20,.6);
}
.ts-chat-head img{border-radius:8px;flex:none;width:32px;height:32px}
.ts-chat-name{font-family:var(--display);font-weight:700;font-size:15px;color:#fff;line-height:1.2}
.ts-chat-status{
  display:flex;align-items:center;gap:6px;
  font-size:11.5px;line-height:1.4;color:var(--muted);letter-spacing:.02em;
}
.ts-chat-status i{width:6px;height:6px;border-radius:50%;background:#3DDC6E;flex:none}
.ts-chat-x{
  margin-left:auto;width:30px;height:30px;border-radius:9px;border:none;cursor:pointer;
  background:transparent;color:var(--muted);display:grid;place-items:center;transition:.2s;
}
.ts-chat-x:hover{background:rgba(52,63,88,.45);color:#fff}
.ts-chat-x svg{width:17px;height:17px}

/* ── Messages ───────────────────────────────────────────────────────────── */
.ts-chat-log{flex:1;overflow-y:auto;padding:16px 14px 6px;display:flex;flex-direction:column;gap:10px}
.ts-msg{max-width:88%;padding:11px 14px;border-radius:14px;font-size:14px;line-height:1.6}
.ts-msg p + p{margin-top:6px}
.ts-msg-bot{
  align-self:flex-start;background:rgba(20,31,50,.95);
  border:1px solid rgba(52,63,88,.7);color:rgba(255,255,255,.9);
  border-bottom-left-radius:5px;
}
.ts-msg-me{
  align-self:flex-end;background:var(--navy);color:#fff;
  font-weight:600;border-bottom-right-radius:5px;
}
.ts-msg-sub{color:var(--muted);font-size:12.5px}

/* ── Typing indicator ─────────────────────────────────────────────────────
   Three dots in a bot bubble while the reply is composed. Staggered rather
   than synchronised, so it reads as typing rather than as a loading spinner. */
.ts-msg-typing{padding:14px 16px}
.ts-dots{display:flex;align-items:center;gap:5px}
.ts-dots i{
  width:7px;height:7px;border-radius:50%;background:var(--muted);
  animation:tsType 1.25s var(--ease) infinite;
}
.ts-dots i:nth-child(2){animation-delay:.16s}
.ts-dots i:nth-child(3){animation-delay:.32s}
@keyframes tsType{
  0%,60%,100%{opacity:.32;transform:translateY(0)}
  30%{opacity:1;transform:translateY(-4px)}
}
.ts-msg-cta{
  display:inline-flex;align-items:center;gap:6px;margin-top:9px;
  font-size:12.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--accent);
  border-bottom:1px solid rgba(60,148,221,.35);padding-bottom:2px;
}
.ts-msg-cta:hover{border-bottom-color:var(--accent)}
.ts-msg-cta svg{width:13px;height:13px}

/* ── Chips ──────────────────────────────────────────────────────────────── */
.ts-chat-chips{display:flex;flex-wrap:wrap;gap:7px;padding:12px 14px 4px;justify-content:flex-end}
.ts-chip{
  border:1px solid rgba(52,63,88,.9);background:rgba(2,8,20,.7);color:rgba(255,255,255,.86);
  border-radius:999px;padding:8px 14px;font-size:13px;line-height:1.3;cursor:pointer;
  font-family:var(--ui);text-align:left;transition:.22s var(--ease);
}
.ts-chip:hover{border-color:rgba(60,148,221,.65);color:#fff;background:rgba(20,31,50,.95)}
.ts-chip-go{background:var(--navy);color:#fff;font-weight:700;border-color:var(--light-navy)}

.ts-chat-foot{
  padding:10px 14px 13px;font-size:11.5px;line-height:1.5;color:var(--muted);
  border-top:1px solid rgba(52,63,88,.5);margin-top:8px;
}
.ts-chat-foot a{color:var(--accent);border-bottom:1px solid rgba(60,148,221,.35)}

@media (max-width:560px){
  .ts-chat{right:14px;bottom:14px}
  .ts-chat-launch{width:52px;height:52px}
  .ts-chat-panel{bottom:64px;max-height:calc(100vh - 100px)}
}
@media (prefers-reduced-motion:reduce){
  .ts-chat-launch::after{animation:none}
  .ts-chat-panel,.ts-chat-launch,.ts-chat-launch svg,.ts-chip{transition:none}
  /* The beat still happens, but the dots hold still rather than bouncing. */
  .ts-dots i{animation:none;opacity:.55}
}

