/* ── Penelope Bot – WhatsApp style ───────────────────────────────────── */

#pb-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  height: 50px;
  border-radius: 50px;
  background: #25d366;
  border: none;
  cursor: pointer;
  z-index: 9100;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px 0 14px;
  transition: transform .2s, box-shadow .2s;
}
#pb-btn-label {
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
#pb-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.7);
}
#pb-btn svg { display: block; pointer-events: none; }

/* ── Panel ────────────────────────────────────────────────────────────── */

#pb-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 340px;
  max-height: 520px;
  background: #efeae2;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 9100;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.85);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), opacity .15s ease;
}
#pb-panel.pb-open {
  transform: scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ───────────────────────────────────────────────────────────── */

#pb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #075e54;
  flex-shrink: 0;
}
#pb-head-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#pb-head-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  flex-shrink: 0;
}
#pb-head-name {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
#pb-head-name span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,.75);
}
#pb-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-size: 20px;
  transition: color .15s;
}
#pb-close:hover { color: #fff; }

/* ── Messages ─────────────────────────────────────────────────────────── */

#pb-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9b99a' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
#pb-msgs::-webkit-scrollbar { width: 4px; }
#pb-msgs::-webkit-scrollbar-track { background: transparent; }
#pb-msgs::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 2px; }

.pb-msg {
  max-width: 82%;
  padding: 7px 10px 8px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.pb-msg.pb-bot {
  background: #fff;
  color: #111;
  border-top-left-radius: 2px;
  align-self: flex-start;
}
.pb-msg.pb-user {
  background: #dcf8c6;
  color: #111;
  border-top-right-radius: 2px;
  align-self: flex-end;
}

.pb-link {
  color: #075e54;
  text-decoration: underline;
  word-break: break-all;
}
.pb-link:hover { color: #128c7e; }

.pb-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25d366;
  color: #fff !important;
  text-decoration: none !important;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  box-shadow: 0 2px 8px rgba(37,211,102,.35);
  transition: background .15s, box-shadow .15s;
  word-break: normal;
}
.pb-wa-btn:hover { background: #1ebe5d; box-shadow: 0 3px 12px rgba(37,211,102,.5); }
.pb-wa-btn i { font-size: 16px; }

.pb-ev-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #111;
  color: #fff !important;
  text-decoration: none !important;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  border: 1px solid rgba(255,0,128,.45);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: background .15s, border-color .15s;
  word-break: normal;
}
.pb-ev-btn:hover { background: #ff0080; border-color: #ff0080; }
.pb-ev-btn i { font-size: 14px; color: #ff0080; transition: color .15s; }
.pb-ev-btn:hover i { color: #fff; }

/* typing indicator */
.pb-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border-top-left-radius: 2px;
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.pb-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaa;
  animation: pb-bounce .9s infinite ease-in-out;
}
.pb-typing span:nth-child(2) { animation-delay: .15s; }
.pb-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes pb-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Input ────────────────────────────────────────────────────────────── */

#pb-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f0f0f0;
  flex-shrink: 0;
}
#pb-input {
  flex: 1;
  background: #fff;
  border: none;
  border-radius: 20px;
  color: #111;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 9px 14px;
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}
#pb-input::placeholder { color: #999; }
#pb-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #075e54;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
#pb-send:hover { background: #128c7e; }
#pb-send:disabled { background: #ccc; cursor: default; }
#pb-send svg { pointer-events: none; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  #pb-panel { right: 8px; left: 8px; width: auto; bottom: 90px; }
  #pb-btn   { right: 16px; bottom: 20px; }
}
