/* ────────────────────────────────────────────────────────────
   KAPUR'S PG — ASSISTANT STYLES
   Peacock + marigold, matching the rest of the site.
   ──────────────────────────────────────────────────────────── */

.kpg-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 9998;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.85rem 1.3rem 0.85rem 1.05rem;
  border: none; border-radius: 100px; cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem; font-weight: 700; color: #10243D;
  background: linear-gradient(160deg, #FFC169 0%, #F5A73C 38%, #E8801C 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 10px 28px rgba(232,128,28,0.42);
  transition: transform 0.25s, box-shadow 0.25s, opacity 0.25s;
  animation: kpgPop 0.5s cubic-bezier(.16,.84,.44,1) 1.4s both;
}
.kpg-launcher:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 14px 34px rgba(232,128,28,0.5); }
.kpg-launcher.hidden { opacity: 0; pointer-events: none; transform: scale(0.85); }
.kpg-launch-icon { font-size: 1.15rem; line-height: 1; }
@keyframes kpgPop { from { opacity: 0; transform: translateY(20px) scale(0.9); } to { opacity: 1; transform: none; } }

/* A quiet pulse so it's noticed without nagging */
.kpg-launcher::after {
  content: ''; position: absolute; inset: 0; border-radius: 100px;
  border: 2px solid rgba(245,167,60,0.65);
  animation: kpgRing 2.6s ease-out infinite; pointer-events: none;
}
@keyframes kpgRing {
  0% { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(1.22); opacity: 0; }
}

.kpg-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 40px));
  display: none; flex-direction: column; overflow: hidden;
  background: #FFFBF3; border-radius: 18px;
  border: 1px solid rgba(16,36,61,0.10);
  box-shadow: 0 26px 70px rgba(16,36,61,0.30);
  font-family: 'Inter', system-ui, sans-serif;
}
.kpg-panel.active { display: flex; animation: kpgIn 0.32s cubic-bezier(.16,.84,.44,1); }
@keyframes kpgIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }

.kpg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.95rem 1.05rem;
  background: linear-gradient(150deg, #16324F 0%, #10243D 60%, #143A5E 100%);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #B8402C, #E8801C 35%, #F5A73C 65%, #C9A84C) 1;
  flex-shrink: 0;
}
.kpg-head-l { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.kpg-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(160deg, #FFC169, #E8801C);
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.kpg-title { font-size: 0.94rem; font-weight: 700; color: #FFFBF3; margin: 0; line-height: 1.3; }
.kpg-sub {
  font-size: 0.72rem; color: rgba(255,255,255,0.62); margin: 0.1rem 0 0;
  display: flex; align-items: center; gap: 0.35rem;
}
.kpg-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #86DBAE;
  box-shadow: 0 0 0 0 rgba(134,219,174,0.7); animation: kpgLive 2s infinite;
}
@keyframes kpgLive {
  0% { box-shadow: 0 0 0 0 rgba(134,219,174,0.6); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(134,219,174,0); }
}
.kpg-close {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 0.9rem; line-height: 1; flex-shrink: 0;
  transition: background 0.2s;
}
.kpg-close:hover { background: rgba(255,255,255,0.24); }

.kpg-log {
  flex: 1; overflow-y: auto; padding: 1.1rem 1rem 0.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  background:
    radial-gradient(ellipse 85% 30% at 50% 0%, rgba(245,167,60,0.10), transparent 60%),
    #FFFBF3;
  scrollbar-width: thin;
}
.kpg-log::-webkit-scrollbar { width: 5px; }
.kpg-log::-webkit-scrollbar-thumb { background: rgba(232,128,28,0.35); border-radius: 4px; }

.kpg-msg { display: flex; }
.kpg-msg.kpg-user { justify-content: flex-end; }
.kpg-bubble {
  max-width: 86%; padding: 0.72rem 0.9rem; border-radius: 14px;
  font-size: 0.87rem; line-height: 1.6; word-wrap: break-word;
  animation: kpgMsg 0.28s ease both;
}
@keyframes kpgMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kpg-bot .kpg-bubble {
  background: #FFFFFF; color: #16283C;
  border: 1px solid rgba(16,36,61,0.08);
  border-bottom-left-radius: 5px;
  box-shadow: 0 3px 12px rgba(16,36,61,0.06);
}
.kpg-bot .kpg-bubble b { color: #143A5E; }
.kpg-user .kpg-bubble {
  background: linear-gradient(160deg, #16324F, #10243D);
  color: #FFFBF3; border-bottom-right-radius: 5px;
}

.kpg-typing .kpg-bubble { display: flex; gap: 4px; padding: 0.85rem 0.95rem; }
.kpg-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #E8801C;
  animation: kpgBounce 1.3s infinite;
}
.kpg-typing span:nth-child(2) { animation-delay: 0.18s; }
.kpg-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes kpgBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.kpg-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.35rem 1rem 0.6rem; flex-shrink: 0;
}
.kpg-chip {
  background: rgba(245,167,60,0.13); border: 1px solid rgba(232,128,28,0.38);
  color: #A9540B; border-radius: 100px; cursor: pointer;
  font-family: inherit; font-size: 0.76rem; font-weight: 600;
  padding: 0.4rem 0.8rem; white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.kpg-chip:hover { background: rgba(245,167,60,0.26); transform: translateY(-1px); }

.kpg-input {
  display: flex; gap: 0.5rem; padding: 0.7rem 0.85rem;
  border-top: 1px solid rgba(16,36,61,0.09); background: #FFFDF9; flex-shrink: 0;
}
.kpg-input input {
  flex: 1; min-width: 0; padding: 0.7rem 0.9rem;
  border: 1.5px solid rgba(16,36,61,0.14); border-radius: 100px;
  background: #FFFFFF; color: #16283C;
  font-family: inherit; font-size: 0.86rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kpg-input input::placeholder { color: #98A6B5; }
.kpg-input input:focus { border-color: #E8801C; box-shadow: 0 0 0 3px rgba(245,167,60,0.2); }
.kpg-input button {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(160deg, #FFC169, #F5A73C 40%, #E8801C);
  color: #10243D; font-size: 1rem; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.18s;
}
.kpg-input button:hover { transform: scale(1.06); }

.kpg-foot {
  font-size: 0.7rem; color: #5C6D80; text-align: center;
  padding: 0 1rem 0.7rem; margin: 0; flex-shrink: 0;
}
.kpg-foot a { color: #A9540B; font-weight: 600; text-decoration: none; }
.kpg-foot a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .kpg-launcher { right: 14px; bottom: 14px; padding: 0.75rem 1.05rem 0.75rem 0.9rem; font-size: 0.82rem; }
  .kpg-panel {
    right: 8px; left: 8px; bottom: 8px; width: auto;
    height: min(78vh, calc(100vh - 16px));
  }
  .kpg-bubble { max-width: 90%; font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .kpg-launcher, .kpg-launcher::after, .kpg-dot, .kpg-typing span, .kpg-bubble, .kpg-panel.active {
    animation: none !important;
  }
}
