/* ── AI Chat Widget ── */
#pmn-chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 1001; font-family: 'Inter', system-ui, sans-serif; }

#pmn-chat-toggle {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff; box-shadow: 0 4px 20px rgba(22,163,74,0.45);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: transform 0.2s, box-shadow 0.2s;
}
#pmn-chat-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(22,163,74,0.6); }
.pmn-chat-badge {
  position: absolute; top: -2px; right: -2px;
  background: #2563eb; color: #fff; font-size: 0.6rem; font-weight: 800;
  padding: 2px 5px; border-radius: 10px; letter-spacing: 0.02em;
}

#pmn-chat-box {
  position: absolute; bottom: 72px; right: 0;
  width: 360px; background: #fff;
  border-radius: 20px; box-shadow: 0 8px 48px rgba(0,0,0,0.18);
  overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid #e2e8f0;
}
#pmn-chat-box[hidden] { display: none; }

.pmn-chat-header {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); color: #fff;
}
.pmn-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
}
.pmn-chat-name { font-weight: 700; font-size: 0.95rem; }
.pmn-chat-status { font-size: 0.75rem; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.pmn-online-dot { width: 7px; height: 7px; border-radius: 50%; background: #86efac; display: inline-block; }
#pmn-chat-close { margin-left: auto; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; }
#pmn-chat-close:hover { opacity: 1; }

.pmn-chat-messages { flex: 1; overflow-y: auto; padding: 16px; max-height: 340px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.pmn-msg { max-width: 85%; }
.pmn-msg p { padding: 10px 14px; border-radius: 14px; font-size: 0.88rem; line-height: 1.55; margin: 0; word-wrap: break-word; }
.pmn-msg-bot p { background: #f1f5f9; color: #1e293b; border-radius: 4px 14px 14px 14px; }
.pmn-msg-user { align-self: flex-end; }
.pmn-msg-user p { background: #16a34a; color: #fff; border-radius: 14px 14px 4px 14px; }

/* Typing indicator */
.pmn-typing { display: flex; gap: 5px; align-items: center; padding: 10px 14px; background: #f1f5f9; border-radius: 4px 14px 14px 14px; width: fit-content; }
.pmn-typing span { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: pmn-bounce 1.2s infinite; }
.pmn-typing span:nth-child(2) { animation-delay: 0.2s; }
.pmn-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pmn-bounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }

.pmn-chat-input-wrap { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
#pmn-chat-input {
  flex: 1; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 24px;
  font-size: 0.88rem; outline: none; background: #fff; transition: border-color 0.2s;
}
#pmn-chat-input:focus { border-color: #16a34a; }
#pmn-chat-send {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: #16a34a;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.2s;
}
#pmn-chat-send:hover { background: #15803d; }
.pmn-chat-footer { text-align: center; font-size: 0.72rem; color: #94a3b8; padding: 8px; border-top: 1px solid #e2e8f0; }
.pmn-chat-footer a { color: #16a34a; text-decoration: none; }

@media(max-width:420px) {
  #pmn-chat-box { width: calc(100vw - 24px); right: -16px; }
}
