/* ============================================================
   CrossKit Chatbot — floating support widget
   Instant FAQ answers from a local knowledge base; anything else
   falls back to the existing /api/chat/message support endpoint
   (emails the team, replies within ~12h). No LLM cost.
   ============================================================ */

.ck-chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 9980;
  width: 56px; height: 56px; border: none; border-radius: 50%;
  background: var(--brand, #4f46e5);
  color: #fff; font-size: 22px; cursor: pointer;
  box-shadow: 0 12px 28px -10px rgba(79, 70, 229, 0.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ck-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(79, 70, 229, 0.5); }
.ck-chat-fab .ck-chat-dot {
  position: absolute; top: -2px; right: -2px; width: 12px; height: 12px;
  background: #25d366; border: 2px solid #fff; border-radius: 50%;
}

.ck-chat-panel {
  position: fixed; right: 22px; bottom: 90px; z-index: 9981;
  width: min(360px, calc(100vw - 32px)); height: min(520px, calc(100vh - 120px));
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.5);
  display: none; flex-direction: column;
}
.ck-chat-panel.show { display: flex; }

.ck-chat-head {
  background: var(--brand, #4f46e5);
  color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 10px;
}
.ck-chat-head .ck-chat-ava {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ck-chat-head .ck-chat-title { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.ck-chat-head .ck-chat-sub { font-size: .72rem; opacity: .85; }
.ck-chat-head .ck-chat-x {
  margin-left: auto; border: none; background: transparent; color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; opacity: .85;
}
.ck-chat-head .ck-chat-x:hover { opacity: 1; }

.ck-chat-body {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: #f8fafc;
}
.ck-chat-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.5; }
.ck-chat-msg.bot { background: #fff; border: 1px solid #e2e8f0; color: #334155; align-self: flex-start; border-bottom-left-radius: 4px; }
.ck-chat-msg.user { background: var(--brand, #4f46e5); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ck-chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 10px; background: #f8fafc; }
.ck-chat-chip {
  border: 1px solid #c7d2fe; background: #eef2ff; color: #4f46e5;
  font-size: .78rem; padding: 6px 11px; border-radius: 999px; cursor: pointer;
}
.ck-chat-chip:hover { background: #e0e7ff; }

.ck-chat-foot { border-top: 1px solid #eef2f7; padding: 12px; background: #fff; }
.ck-chat-email {
  width: 100%; box-sizing: border-box; border: 1px solid #e2e8f0; border-radius: 9px;
  padding: 9px 11px; font-size: .85rem; margin-bottom: 8px; outline: none;
}
.ck-chat-email:focus { border-color: var(--brand, #4f46e5); }
.ck-chat-inputrow { display: flex; gap: 8px; }
.ck-chat-input {
  flex: 1; box-sizing: border-box; border: 1px solid #e2e8f0; border-radius: 9px;
  padding: 9px 11px; font-size: .9rem; outline: none; resize: none; font-family: inherit;
}
.ck-chat-input:focus { border-color: var(--brand, #4f46e5); }
.ck-chat-send {
  border: none; background: var(--brand, #4f46e5);
  color: #fff; border-radius: 9px; padding: 0 16px; font-weight: 600; cursor: pointer; font-size: .9rem;
}
.ck-chat-send:hover { opacity: .92; }
.ck-chat-note { font-size: .7rem; color: #94a3b8; text-align: center; margin: 6px 0 0; }

@media (max-width: 768px) {
  .ck-chat-fab { right: 16px; bottom: 16px; }
  .ck-chat-panel { right: 12px; bottom: 80px; }
}
