/* Nexus assistant */
.nx { position: fixed; right: 24px; bottom: 24px; z-index: 80; font-family: var(--text); }
.nx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nx-launch {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
  padding: 9px 20px 9px 9px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(7, 22, 48, 0.92); color: #fff; font: 600 15px/1 var(--display);
  box-shadow: 0 0 0 1.5px rgba(41, 155, 242, 0.55), 0 18px 40px -12px rgba(1, 98, 188, 0.75);
  backdrop-filter: blur(10px);
  transition: transform .2s ease, box-shadow .2s ease;
}
.nx-launch:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--sky), 0 22px 44px -12px rgba(1, 98, 188, 0.9); }
.nx-launch img { width: 38px; height: 38px; padding: 6px; border-radius: 50%; background: #fff; object-fit: contain; }
.nx[data-open="true"] .nx-launch { display: none; }

.nx-teaser {
  position: absolute; right: 0; bottom: 70px; width: 290px;
  padding: 16px 16px 14px; border-radius: 16px 16px 4px 16px;
  background: #fff; color: var(--ink); box-shadow: 0 24px 50px -18px rgba(7, 22, 48, 0.55);
  animation: nx-pop .4s cubic-bezier(.2, .9, .3, 1.2);
}
.nx-teaser[hidden] { display: none; }
.nx-teaser p { margin: 0 24px 12px 0; font-size: 15px; line-height: 1.45; }
.nx-teaser-go { border: 0; border-radius: 8px; padding: 10px 14px; background: var(--grad); color: #fff; font: 600 14px/1 var(--display); cursor: pointer; }
.nx-teaser-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
@keyframes nx-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

.nx-panel {
  width: min(410px, calc(100vw - 32px)); height: min(660px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px; color: var(--frost);
  background:
    linear-gradient(rgba(41, 155, 242, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(41, 155, 242, 0.05) 1px, transparent 1px) 0 0 / 28px 28px,
    #081a38;
  box-shadow: 0 0 0 1px rgba(220, 227, 236, 0.12), 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  animation: nx-pop .3s ease;
}
.nx-panel[hidden] { display: none; }
.nx-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: rgba(7, 22, 48, 0.9); border-bottom: 1px solid var(--line-dark); }
.nx-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; position: relative; }
.nx-avatar::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 2px #071630; }
.nx-title { display: grid; margin-right: auto; line-height: 1.25; }
.nx-title strong { font: 600 16px/1.2 var(--display); color: #fff; }
.nx-title span { font-size: 12.5px; color: rgba(220, 227, 236, 0.6); }
.nx-icon { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--frost); background: rgba(220, 227, 236, 0.08); cursor: pointer; text-decoration: none; }
.nx-icon:hover { background: rgba(220, 227, 236, 0.16); color: #fff; }

.nx-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.nx-msg { max-width: 86%; padding: 11px 14px; font-size: 15px; line-height: 1.5; border-radius: 16px; overflow-wrap: anywhere; }
.nx-msg p { margin: 0; }
.nx-msg p + p, .nx-msg p + ul, .nx-msg ul + p { margin-top: 8px; }
.nx-msg ul { margin: 0; padding-left: 18px; }
.nx-assistant { align-self: flex-start; background: #10305c; border-bottom-left-radius: 4px; color: #eef3f9; }
.nx-user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.nx-typing { display: flex; gap: 5px; padding: 15px 16px; }
.nx-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); animation: nx-dot 1.1s infinite ease-in-out; }
.nx-typing i:nth-child(2) { animation-delay: .15s; }
.nx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes nx-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.nx-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.nx-chip {
  border: 1.5px solid rgba(41, 155, 242, 0.55); background: rgba(41, 155, 242, 0.08); color: #fff;
  border-radius: 999px; padding: 8px 13px; font: 500 14px/1.2 var(--text); cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.nx-chip:hover { background: rgba(41, 155, 242, 0.25); border-color: var(--sky); }

.nx-card { align-self: stretch; border-radius: 16px; background: #0d2650; border: 1px solid rgba(41, 155, 242, 0.35); padding: 14px; display: grid; gap: 10px; }
.nx-card-head { margin: 0; display: grid; gap: 4px; font-size: 13.5px; color: rgba(220, 227, 236, 0.75); }
.nx-card-head strong { font: 600 15px/1.3 var(--display); color: #fff; }
.nx-lead label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: rgba(220, 227, 236, 0.8); }
.nx-lead input:not([type="checkbox"]) {
  font: 400 15px/1.3 var(--text); color: #fff; background: rgba(7, 22, 48, 0.7);
  border: 1px solid rgba(220, 227, 236, 0.2); border-radius: 9px; padding: 10px 12px;
}
.nx-lead input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(41, 155, 242, 0.25); }
.nx-lead [aria-invalid="true"] { border-color: #ff8a8a; }
.nx-lead .nx-check { grid-template-columns: 18px 1fr; gap: 9px; align-items: start; font-weight: 400; font-size: 11.5px; line-height: 1.45; color: rgba(220, 227, 236, 0.62); }
.nx-check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--sky); }
.nx-check a { color: var(--sky); }
.nx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.nx-submit { border: 0; border-radius: 10px; padding: 13px; background: var(--grad); color: #fff; font: 600 15px/1 var(--display); cursor: pointer; }
.nx-submit:disabled { opacity: .7; cursor: progress; }
.nx-err { margin: 0; font-size: 13px; color: #ffb3b3; }
.nx-err:empty { display: none; }
.nx-sent { grid-template-columns: auto 1fr; align-items: center; border-color: rgba(126, 226, 168, 0.45); background: rgba(126, 226, 168, 0.08); }
.nx-sent strong { color: #7ee2a8; font: 600 14px/1 var(--display); }
.nx-sent span { font-size: 13.5px; color: rgba(220, 227, 236, 0.75); text-align: right; }

.nx-input { display: flex; align-items: flex-end; gap: 8px; margin: 8px 12px 6px; padding: 6px 6px 6px 14px; border-radius: 16px; background: rgba(220, 227, 236, 0.07); border: 1px solid rgba(220, 227, 236, 0.14); }
.nx-input:focus-within { border-color: var(--sky); }
.nx-input textarea { flex: 1; resize: none; border: 0; background: none; color: #fff; font: 400 15px/1.4 var(--text); padding: 8px 0; max-height: 120px; outline: none; }
.nx-input textarea::placeholder { color: rgba(220, 227, 236, 0.45); }
.nx-input button { width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; }
.nx-input button:disabled { opacity: .5; }
.nx-foot { margin: 0; padding: 0 16px 12px; font-size: 11px; color: rgba(220, 227, 236, 0.45); text-align: center; }

.btn-ink { margin-top: 24px; background: var(--ink); box-shadow: 0 12px 28px -14px rgba(10, 27, 54, 0.6); }
.btn-ink:hover { box-shadow: 0 16px 32px -14px rgba(10, 27, 54, 0.75); }
.inline-link { color: var(--sky); }

@media (max-width: 720px) {
  .nx { right: 16px; bottom: 16px; }
  .nx-launch span { display: none; }
  .nx-launch { padding: 9px; }
  .nx[data-open="true"] { inset: 0; }
  .nx-panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .nx-teaser { width: min(290px, calc(100vw - 32px)); }
  .nx-input textarea { font-size: 16px; }
  .fab-call { left: 16px; right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-teaser, .nx-panel { animation: none; }
}
