/* Nexonetics Assistant widget — all selectors are prefixed with .nx- so it can be embedded on any page. */
.nx-root {
  --nx-bg: #0a0a0f;
  --nx-surface: #14141b;
  --nx-surface-2: #1c1c25;
  --nx-border: rgba(255, 255, 255, 0.08);
  --nx-border-strong: rgba(255, 255, 255, 0.16);
  --nx-text: #ececf3;
  --nx-muted: #9b9bad;
  --nx-cyan: #22d3ee;
  --nx-blue: #3b82f6;
  --nx-purple: #9333ea;
  --nx-grad: linear-gradient(135deg, #22d3ee 0%, #3b82f6 55%, #9333ea 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--nx-text);
  -webkit-font-smoothing: antialiased;
}
.nx-root *, .nx-root *::before, .nx-root *::after { box-sizing: border-box; }
/* shield the widget from the host page's element styles */
.nx-root :where(p, ul, ol, li, dl, dt, dd) {
  color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; letter-spacing: inherit;
  text-align: left; border: 0; background: none;
}
.nx-root button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- launcher ---------- */
.nx-launcher {
  position: fixed; right: 104px; bottom: 24px; z-index: 2147483000;
  width: 62px; height: 62px; padding: 0; border-radius: 50%;
  border: 0; background: #000;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55), 0 10px 30px rgba(59, 130, 246, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nx-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 0 0 2px var(--nx-cyan), 0 14px 36px rgba(147, 51, 234, 0.4); }
.nx-launcher img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.nx-launcher-dot {
  position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%;
  background: #22c55e; border: 2px solid #000;
}
.nx-open .nx-launcher-dot { display: none; }

/* ---------- panel ---------- */
.nx-panel {
  position: fixed; right: 24px; bottom: 100px; z-index: 2147483000;
  width: 400px; height: min(680px, calc(100vh - 128px));
  display: flex; flex-direction: column;
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(34, 211, 238, 0.06);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(14px) scale(0.98); transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}
.nx-open .nx-panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity 0.2s ease, transform 0.22s ease, visibility 0s;
}

.nx-head {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px 14px 16px;
  background: linear-gradient(180deg, #111118, var(--nx-bg));
}
.nx-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--nx-grad); opacity: 0.55;
}
.nx-avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--nx-border-strong); flex: none; }
.nx-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nx-title strong { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; color: #fff; }
.nx-title span { font-size: 12px; color: var(--nx-muted); display: flex; align-items: center; gap: 6px; }
.nx-title i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }
.nx-icon {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--nx-muted);
  transition: background 0.15s, color 0.15s;
}
.nx-icon:hover { background: var(--nx-surface-2); color: #fff; }

/* ---------- messages ---------- */
.nx-log {
  position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 14px 10px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: #2a2a35 transparent;
}
.nx-msg { display: flex; animation: nx-in 0.22s ease both; }
.nx-user { justify-content: flex-end; }
.nx-bubble { max-width: 88%; padding: 11px 14px; border-radius: 16px; overflow-wrap: anywhere; }
.nx-bot .nx-bubble {
  background: var(--nx-surface); border: 1px solid var(--nx-border);
  border-bottom-left-radius: 5px;
}
.nx-user .nx-bubble {
  background: var(--nx-grad); color: #fff; font-weight: 500;
  border-bottom-right-radius: 5px;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.25);
}

.nx-bubble p { margin: 0 0 8px; }
.nx-bubble > :last-child { margin-bottom: 0; }
.nx-bubble .nx-h { font-weight: 650; font-size: 15px; color: #fff; margin-bottom: 6px; letter-spacing: -0.01em; }
.nx-bubble b, .nx-bubble strong { color: #fff; font-weight: 600; }
.nx-bubble a { color: var(--nx-cyan); text-decoration: none; border-bottom: 1px solid rgba(34, 211, 238, 0.35); }
.nx-bubble a:hover { border-bottom-color: var(--nx-cyan); }
.nx-bubble em { font-style: normal; color: var(--nx-muted); font-size: 12.5px; }

.nx-bubble ul { list-style: none; margin: 0 0 8px; padding: 0; }
.nx-bubble ul li { position: relative; padding-left: 16px; margin: 4px 0; }
.nx-bubble ul li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--nx-grad);
}
.nx-bubble ul.nx-plain li { padding-left: 0; }
.nx-bubble ul.nx-plain li::before { display: none; }

.nx-steps { list-style: none; margin: 4px 0 8px; padding: 0; counter-reset: nx-step; }
.nx-steps li { counter-increment: nx-step; position: relative; padding: 0 0 10px 36px; }
.nx-steps li::before {
  content: counter(nx-step); position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--nx-grad);
}
.nx-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 11.5px; top: 27px; bottom: 2px; width: 1px; background: var(--nx-border-strong);
}
.nx-steps b { display: block; }
.nx-steps span { color: var(--nx-muted); font-size: 13.5px; }

.nx-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.nx-pills span {
  font-size: 12px; line-height: 1; padding: 6px 9px; border-radius: 999px;
  color: #a5f3fc; background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.22);
}

.nx-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 4px 0 10px; }
.nx-kv dt { color: var(--nx-muted); font-size: 12.5px; padding-top: 1px; }
.nx-kv dd { margin: 0; }

.nx-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.nx-stats div { background: var(--nx-surface-2); border: 1px solid var(--nx-border); border-radius: 12px; padding: 10px 8px; text-align: center; }
.nx-stats b {
  display: block; font-size: 20px; font-weight: 700;
  background: var(--nx-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nx-stats span { font-size: 11.5px; color: var(--nx-muted); line-height: 1.3; display: block; }

.nx-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--nx-muted); }
.nx-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f87171; }
.nx-status.nx-on::before { background: #22c55e; }

.nx-cta { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid var(--nx-border); font-size: 13.5px; color: var(--nx-muted); }

/* clickable option rows inside a bot bubble */
.nx-options { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.nx-options button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 12px;
  background: var(--nx-surface-2); border: 1px solid var(--nx-border);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.nx-options button:hover { border-color: rgba(34, 211, 238, 0.5); background: #20202b; }
.nx-options span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nx-options strong { font-weight: 600; font-size: 14px; color: #fff; }
.nx-options small { font-size: 12px; color: var(--nx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-options i { font-style: normal; font-size: 20px; color: var(--nx-muted); line-height: 1; }

/* quick-reply chips */
.nx-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px; animation: nx-in 0.25s ease both; }
.nx-chips button {
  padding: 7px 13px; border-radius: 999px; font-size: 13px;
  background: transparent; border: 1px solid var(--nx-border-strong); color: var(--nx-text);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.nx-chips button:hover { border-color: var(--nx-cyan); color: #fff; background: rgba(34, 211, 238, 0.08); }

.nx-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.nx-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--nx-muted); animation: nx-blink 1.1s infinite ease-in-out; }
.nx-typing span:nth-child(2) { animation-delay: 0.15s; }
.nx-typing span:nth-child(3) { animation-delay: 0.3s; }

/* ---------- input ---------- */
.nx-form { display: flex; gap: 8px; padding: 10px 12px 14px; }
.nx-input {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px;
  font: inherit; color: var(--nx-text);
  background: var(--nx-surface); border: 1px solid var(--nx-border-strong); border-radius: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.nx-input::placeholder { color: #6e6e80; }
.nx-input:focus { border-color: rgba(34, 211, 238, 0.6); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12); }
.nx-send {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 14px; background: var(--nx-grad); color: #fff;
  transition: opacity 0.15s, transform 0.15s;
}
.nx-send:hover:not(:disabled) { transform: translateY(-1px); }
.nx-send:disabled { opacity: 0.35; cursor: default; }

.nx-root :focus-visible { outline: 2px solid var(--nx-cyan); outline-offset: 2px; }

@keyframes nx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes nx-blink { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 520px) {
  .nx-panel { right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .nx-open .nx-launcher { display: none; }
  .nx-launcher { right: 100px; bottom: 24px; }
  .nx-bubble { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-root *, .nx-panel { animation: none !important; transition: none !important; }
}
