/* ════════════════════════════════════════════════════════════════════
   Kupri Labs Research Assistant — styles
   Self-contained. Brand-matched (navy/blue/white).
   Performance: minimal, no animations beyond transform/opacity.
════════════════════════════════════════════════════════════════════ */

#kl-chat-bubble,
#kl-chat-panel,
#kl-chat-panel * {
  box-sizing: border-box;
}

#kl-chat-bubble {
  position: fixed;
  right: 18px;
  bottom: 84px; /* sit above the storefront sticky bar (~64px) */
  z-index: 1100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0f1f2e;
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 22px rgba(15, 31, 46, 0.32);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
#kl-chat-bubble:hover  { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 31, 46, 0.36); }
#kl-chat-bubble:active { transform: translateY(0); }
#kl-chat-bubble svg    { stroke: #ffffff; }
#kl-chat-bubble .kl-bubble-badge {
  position: absolute; top: -4px; right: -4px;
  background: #4a9ebb; color: #fff; font-size: 11px; font-weight: 600;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #ffffff;
}

#kl-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 1101;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border: 1px solid #dde8ee;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 31, 46, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: #1a2530;
}
#kl-chat-panel.open { display: flex; }

#kl-chat-header {
  padding: 14px 16px;
  background: #0f1f2e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
#kl-chat-header .kl-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.2px;
}
#kl-chat-header .kl-sub {
  font-size: 11px;
  color: #b8dcea;
  margin-top: 2px;
  font-weight: 400;
  letter-spacing: 0.4px;
}
#kl-chat-close {
  background: none; border: none; color: #ffffff; cursor: pointer;
  width: 32px; height: 32px; border-radius: 6px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
#kl-chat-close:hover { background: rgba(255,255,255,0.08); }

#kl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.kl-msg {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 8px;
  word-wrap: break-word;
  animation: kl-fade-in 0.12s ease-out;
}
@keyframes kl-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kl-msg.bot {
  background: #f5fafd;
  color: #1a2530;
  border: none;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.kl-msg.user {
  background: #0f1f2e;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.kl-msg.system {
  background: #fff5e6;
  color: #8a5a20;
  border: 1px solid #f6e3c4;
  font-size: 12.5px;
}
.kl-msg a { color: #4a9ebb; text-decoration: underline; }
.kl-msg.user a { color: #b8dcea; }

.kl-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 12px;
}
.kl-quick-btn {
  background: #ffffff;
  color: #4a9ebb;
  border: 1px solid #b8dcea;
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.kl-quick-btn:hover  { background: #e8f4f9; }
.kl-quick-btn:active { transform: scale(0.98); }

#kl-chat-input-wrap {
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #dde8ee;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
#kl-chat-input {
  flex: 1;
  border: 1px solid #dde8ee;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  color: #1a2530;
  background: #ffffff;
  transition: border-color 0.15s;
}
#kl-chat-input:focus { border-color: #4a9ebb; }
#kl-chat-send {
  background: #0f1f2e;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
#kl-chat-send:hover   { background: #1a2530; }
#kl-chat-send:active  { background: #4a9ebb; }
#kl-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

#kl-chat-disclaimer {
  font-size: 10px;
  color: #8a9baa;
  text-align: center;
  padding: 6px 12px 10px;
  background: #ffffff;
  line-height: 1.4;
  flex-shrink: 0;
}

/* ─── Mobile: full-width slide-up sheet ───────────────────────── */
@media (max-width: 480px) {
  #kl-chat-bubble {
    right: 14px;
    bottom: 80px;
    width: 52px;
    height: 52px;
  }
  #kl-chat-panel {
    right: 0; left: 0; bottom: 0;
    width: 100%; max-width: 100%;
    height: 88vh; max-height: 88vh;
    border-radius: 16px 16px 0 0;
    border-left: none; border-right: none; border-bottom: none;
  }
}

/* ─── Accessibility: respect reduced-motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #kl-chat-bubble { transition: none; }
  .kl-msg { animation: none; }
}
