/* Singh Pages Assistant chat widget */
.sp-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99990;
  font-family: Inter, system-ui, sans-serif;
}

.sp-chat__toggle {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.sp-chat__toggle:hover { transform: scale(1.05); }
.sp-chat__toggle svg { width: 26px; height: 26px; }

/* Use class toggle — [hidden] loses to display:flex in some browsers */
.sp-chat__panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sp-chat__panel.is-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.sp-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
}

.sp-chat__brand { display: flex; gap: 10px; align-items: center; }
.sp-chat__brand strong { display: block; font-size: 15px; }
.sp-chat__brand small { opacity: 0.85; font-size: 12px; }
.sp-chat__icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.sp-chat__close {
  background: rgba(255,255,255,0.15);
  border: none; color: #fff; width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-size: 20px; line-height: 1;
}

.sp-chat__status {
  padding: 8px 16px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 6px;
}

.sp-chat__dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
}

.sp-chat__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f1f5f9;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sp-chat__messages::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sp-chat__msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.sp-chat__msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.sp-chat__msg--user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}

.sp-chat__chips {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sp-chat__chips::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sp-chat__chip {
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  color: #334155;
}

.sp-chat__chip:hover { border-color: #2563eb; color: #2563eb; }

.sp-chat__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.sp-chat__form input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.sp-chat__form input:focus { border-color: #2563eb; }

.sp-chat__form button {
  width: 42px; height: 42px;
  border: none; border-radius: 12px;
  background: #2563eb; color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.sp-chat__form button svg { width: 18px; height: 18px; }

.sp-chat__toggle.is-open {
  transform: scale(0.96);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

@media (max-width: 640px) {
  .sp-chat {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .sp-chat__toggle {
    position: fixed;
    right: 12px;
    bottom: 12px;
    width: 54px;
    height: 54px;
  }

  .sp-chat__panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 78px;
    width: auto;
    height: min(72vh, 560px);
    border-radius: 16px;
  }

  .sp-chat__head { padding: 14px; }
  .sp-chat__brand strong { font-size: 14px; }
  .sp-chat__form input { font-size: 16px; }
}
