/* ─── NEXERX CHATBOT (shared across all pages) ─── */
#nx-chat-btn {
  position: fixed; bottom: 32px; right: 32px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--bronze); border: none; cursor: pointer;
  z-index: 500; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(11,31,58,0.35);
  transition: background 0.2s, transform 0.2s;
}
#nx-chat-btn:hover { background: var(--bronze-light); transform: scale(1.06); }
#nx-chat-btn .ico-close { display: none; }
#nx-chat-btn::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--bronze); opacity: 0;
  animation: nxPulse 2.6s ease-out 1.2s infinite;
}
@keyframes nxPulse { 0%{transform:scale(1);opacity:0.6} 100%{transform:scale(1.55);opacity:0} }
#nx-chat-win {
  position: fixed; bottom: 104px; right: 32px;
  width: 360px; max-height: 560px;
  background: #0B1F3A; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; display: flex; flex-direction: column;
  z-index: 499; box-shadow: 0 16px 56px rgba(0,0,0,0.45);
  transform: translateY(16px) scale(0.97); opacity: 0;
  pointer-events: none; transition: transform 0.25s ease, opacity 0.25s ease;
}
#nx-chat-win.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
.nx-head {
  background: var(--bronze); padding: 14px 18px;
  border-radius: 4px 4px 0 0; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.nx-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1rem; font-weight: 600; color: #fff; flex-shrink: 0;
}
.nx-head-text { flex: 1; }
.nx-head-name { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.05em; color: #fff; }
.nx-head-status { font-size: 0.6rem; color: rgba(255,255,255,0.6); letter-spacing: 0.06em; }
.nx-online-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.7); flex-shrink: 0;
}
.nx-msgs {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nx-msgs::-webkit-scrollbar { width: 4px; }
.nx-msgs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.nx-bubble {
  max-width: 88%; padding: 10px 13px; border-radius: 3px;
  font-size: 0.8rem; line-height: 1.55; animation: nxFadeIn 0.2s ease;
}
@keyframes nxFadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.nx-bubble.bot {
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.88);
  align-self: flex-start; border-bottom-left-radius: 0;
}
.nx-bubble.user {
  background: var(--bronze); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 0;
}
.nx-bubble a { color: var(--accent); text-decoration: underline; }
.nx-bubble.success {
  background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.25);
  color: rgba(255,255,255,0.9); align-self: flex-start; border-bottom-left-radius: 0;
}
.nx-typing {
  display: flex; gap: 4px; align-items: center; padding: 10px 13px;
  background: rgba(255,255,255,0.07); align-self: flex-start;
  border-radius: 3px; border-bottom-left-radius: 0;
}
.nx-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.4);
  animation: nxDot 1.1s ease-in-out infinite;
}
.nx-typing span:nth-child(2){animation-delay:0.18s}
.nx-typing span:nth-child(3){animation-delay:0.36s}
@keyframes nxDot{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}
.nx-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; flex-shrink: 0; }
.nx-chip {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7); font-size: 0.68rem; letter-spacing: 0.04em;
  padding: 8px 12px; border-radius: 2px; cursor: pointer; min-height: 36px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: var(--font-sans); display: flex; align-items: center;
}
.nx-chip:hover,.nx-chip:active { background: var(--bronze); color: #fff; border-color: var(--bronze); }
.nx-input-row { display: flex; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.nx-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-family: var(--font-sans); font-size: 0.82rem; padding: 14px;
}
.nx-input::placeholder { color: rgba(255,255,255,0.28); }
.nx-send {
  background: none; border: none; cursor: pointer; padding: 0 16px;
  color: rgba(255,255,255,0.4); transition: color 0.2s;
  display: flex; align-items: center; min-width: 48px; justify-content: center;
}
.nx-send:hover,.nx-send:active { color: var(--accent); }
.nx-send svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* Mobile */
@media (max-width: 600px) {
  #nx-chat-btn {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 16px; width: 54px; height: 54px;
  }
  #nx-chat-win {
    right: 0; left: 0; bottom: 0;
    width: 100%; max-height: 85svh;
    border-radius: 14px 14px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
  }
  #nx-chat-win.open { transform: translateY(0); opacity: 1; }
  .nx-head { border-radius: 14px 14px 0 0; padding: 16px 20px; }
  .nx-chip { font-size: 0.72rem; padding: 9px 14px; min-height: 40px; }
  .nx-input { font-size: 0.88rem; padding: 16px 14px; }
  .nx-bubble { font-size: 0.84rem; }
}
