/* NEXUS — ZuluWorks AI Concierge
   Holographic chat surface. All selectors are .nx-* prefixed and scoped to the
   widget so nothing here can leak into the host page.
   Palette: charcoal navy #07141b, glass #0d2029, electric cyan #40ddec,
   metallic gold #eec477, pale text #f4fbfd. */

.nx-root {
  --nx-bg: #07141b;
  --nx-surface: #0d2029;
  --nx-cyan: #40ddec;
  --nx-gold: #eec477;
  --nx-text: #f4fbfd;
  --nx-muted: #b4cad0;
  --nx-line: rgba(64, 221, 236, .32);
  --nx-gold-line: rgba(238, 196, 119, .45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--nx-text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.nx-root * { box-sizing: border-box; }
.nx-root button { font: inherit; cursor: pointer; }
.nx-root textarea { font: inherit; }
.nx-root :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------------------------------------------------------------- launcher */
.nx-launcher {
  position: fixed;
  z-index: 2147483646;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--nx-gold-line);
  border-radius: 999px;
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(64, 221, 236, .18), transparent 60%),
    linear-gradient(150deg, #0a202b, #020b10 70%);
  box-shadow:
    0 0 0 5px rgba(64, 221, 236, .05),
    0 10px 34px rgba(0, 0, 0, .55),
    0 0 30px rgba(64, 221, 236, .28),
    inset 0 0 16px rgba(64, 221, 236, .12);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.nx-launcher:hover,
.nx-launcher[aria-expanded="true"] {
  transform: translateY(-2px);
  border-color: var(--nx-cyan);
  box-shadow:
    0 0 0 6px rgba(64, 221, 236, .09),
    0 14px 40px rgba(0, 0, 0, .6),
    0 0 40px rgba(64, 221, 236, .42),
    inset 0 0 18px rgba(64, 221, 236, .2);
}
.nx-launcher-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nx-gold);
  opacity: 0;
  transition: max-width .3s ease, opacity .2s ease, padding .3s ease;
}
.nx-launcher:hover .nx-launcher-label,
.nx-launcher:focus-visible .nx-launcher-label { max-width: 130px; opacity: 1; padding: 0 14px 0 4px; }

/* the orbital mark */
.nx-orb {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: #ffe2ab;
  text-shadow: 0 0 10px rgba(238, 196, 119, .55);
  background:
    radial-gradient(circle at 50% 42%, rgba(64, 221, 236, .40), rgba(4, 22, 30, .96) 68%),
    #04161e;
  border: 1.5px solid #d2a85a;
  box-shadow:
    inset 0 0 14px rgba(39, 217, 235, .38),
    0 0 0 3px rgba(30, 214, 228, .16);
}
.nx-orb::before,
.nx-orb::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.nx-orb::before {
  inset: -8px;
  border: 1px dashed rgba(65, 221, 237, .55);
  animation: nx-spin 18s linear infinite;
}
.nx-orb::after {
  inset: -13px;
  border: 1px solid transparent;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(238, 196, 119, .75) 78%, transparent 88%) border-box;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: nx-spin 9s linear infinite reverse;
}
.nx-orb-glyph { position: relative; z-index: 1; line-height: 1; transform: translateY(-1px); }

/* ------------------------------------------------------------------- panel */
.nx-panel {
  position: fixed;
  z-index: 2147483647;
  right: 22px;
  bottom: 88px;
  width: min(420px, calc(100vw - 28px));
  height: min(680px, calc(100dvh - 112px));
  min-height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(74, 217, 233, .55);
  border-radius: 20px;
  color: var(--nx-text);
  background:
    radial-gradient(120% 80% at 22% 0%, rgba(35, 160, 180, .18), transparent 58%),
    linear-gradient(158deg, rgba(9, 33, 43, .93), rgba(4, 14, 21, .96));
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, .78),
    0 0 34px rgba(50, 211, 231, .18),
    inset 0 0 0 1px rgba(239, 188, 93, .14);
  transform-origin: 34px calc(100% + 40px);
  animation: nx-in .32s cubic-bezier(.22, .9, .3, 1) both;
}
.nx-panel[hidden] { display: none !important; }

/* corner brackets + circuit texture */
.nx-frame { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.nx-frame::before,
.nx-frame::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--nx-gold);
  opacity: .55;
}
.nx-frame::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.nx-frame::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.nx-circuit {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    repeating-linear-gradient(90deg, rgba(64, 221, 236, .07) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(64, 221, 236, .05) 0 1px, transparent 1px 46px);
  -webkit-mask: radial-gradient(120% 60% at 50% 0%, #000 0 36%, transparent 78%);
  mask: radial-gradient(120% 60% at 50% 0%, #000 0 36%, transparent 78%);
}

/* -------------------------------------------------------------------- head */
.nx-head {
  position: relative;
  z-index: 3;
  padding: 15px 14px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(83, 198, 213, .26);
  background: linear-gradient(96deg, rgba(2, 13, 18, .82), rgba(8, 36, 46, .34));
}
.nx-globe {
  position: absolute;
  inset: -34% -6% -40% 32%;
  z-index: -1;
  background: url("/nexus/africa-holo.svg") center/contain no-repeat;
  opacity: .5;
  pointer-events: none;
  -webkit-mask: radial-gradient(64% 74% at 66% 42%, #000 34%, transparent 76%);
  mask: radial-gradient(64% 74% at 66% 42%, #000 34%, transparent 76%);
}
.nx-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--nx-cyan), var(--nx-gold), transparent);
  opacity: .65;
}
.nx-mark {
  flex: none;
  height: 46px;
  width: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--nx-gold);
  border: 1px solid var(--nx-gold);
  background: radial-gradient(circle at 50% 45%, rgba(64, 221, 236, .26), rgba(3, 18, 24, .9) 70%);
  box-shadow: 0 0 0 4px rgba(58, 211, 227, .10), 0 0 18px rgba(58, 211, 227, .32);
}
.nx-head-text { min-width: 0; }
.nx-title {
  margin: 0;
  font-size: 19px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--nx-gold);
}
.nx-subtitle {
  margin-top: 6px;
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--nx-cyan);
  white-space: nowrap;
}
.nx-head-actions { margin-left: auto; display: flex; gap: 6px; align-self: flex-start; }
.nx-icon-btn {
  height: 30px;
  min-width: 30px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 9px;
  border: 1px solid rgba(85, 192, 209, .34);
  background: rgba(14, 50, 58, .8);
  color: #e6fbff;
  font-size: 15px;
  line-height: 1;
}
.nx-icon-btn:hover { border-color: var(--nx-cyan); color: #fff; }

/* presence line */
.nx-presence {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 11px;
  letter-spacing: .02em;
  color: #bdd3d7;
  background: rgba(9, 35, 45, .45);
  border-bottom: 1px solid rgba(64, 221, 236, .10);
}
.nx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #71eabd;
  box-shadow: 0 0 8px #71eabd;
  flex: none;
}
.nx-presence[data-state="offline"] .nx-dot { background: #e8b968; box-shadow: 0 0 8px #e8b968; }

/* ------------------------------------------------------------------ scroll */
.nx-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 15px 15px 6px;
  scrollbar-width: thin;
  scrollbar-color: #2d6d76 transparent;
}
.nx-scroll::-webkit-scrollbar { width: 8px; }
.nx-scroll::-webkit-scrollbar-thumb { background: #2d6d76; border-radius: 8px; }
.nx-messages { display: flex; flex-direction: column; gap: 12px; }

/* welcome */
.nx-welcome { padding: 2px 2px 4px; }
.nx-welcome h2 {
  margin: 0 0 7px;
  font-size: 16.5px;
  line-height: 1.25;
  font-weight: 650;
  color: var(--nx-text);
}
.nx-welcome p { margin: 0; font-size: 12.8px; color: #c3d6da; }

/* quick prompts */
.nx-quick-title {
  margin: 15px 0 8px;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nx-cyan);
}
.nx-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nx-quick-btn {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 62px;
  padding: 10px 10px 10px 9px;
  text-align: left;
  font-size: 11.8px;
  line-height: 1.32;
  color: #e4f8f9;
  border: 1px solid rgba(59, 184, 203, .42);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(15, 46, 55, .82), rgba(4, 19, 25, .96));
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.nx-quick-btn:hover {
  border-color: var(--nx-gold);
  box-shadow: 0 0 14px rgba(63, 214, 233, .16);
  transform: translateY(-1px);
}
.nx-quick-btn svg { flex: none; width: 15px; height: 15px; color: var(--nx-cyan); margin-top: 1px; }
.nx-quick-btn span { flex: 1; }

/* messages */
.nx-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: nx-fade .22s ease both;
}
.nx-msg.assistant {
  align-self: flex-start;
  background: rgba(18, 57, 70, .74);
  border: 1px solid rgba(71, 193, 211, .30);
  border-top-left-radius: 4px;
}
.nx-msg.user {
  align-self: flex-end;
  background: rgba(117, 83, 32, .34);
  border: 1px solid rgba(232, 185, 104, .42);
  border-top-right-radius: 4px;
  color: #fff6e6;
}
.nx-who {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--nx-cyan);
}
.nx-msg.user .nx-who { color: var(--nx-gold); }
.nx-msg-note { font-size: 11px; color: #a9c2c7; }

/* suggestion chips + assessment CTA */
.nx-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nx-chip {
  padding: 6px 10px;
  font-size: 11.5px;
  color: #dff7fa;
  border: 1px solid rgba(64, 221, 236, .38);
  border-radius: 999px;
  background: rgba(10, 38, 47, .8);
}
.nx-chip:hover { border-color: var(--nx-cyan); background: rgba(16, 60, 72, .9); }
.nx-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #0a2028;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(140deg, #ffe3a2, #cf9c4a);
  box-shadow: 0 6px 20px rgba(207, 156, 74, .22);
}
.nx-cta:hover { filter: brightness(1.06); }

/* Unconstrained SVG was rendering ~93px tall and stretching the button. */
.nx-cta svg { width: 14px; height: 14px; flex: 0 0 14px; }

/* typing */
.nx-typing { display: none; align-items: center; gap: 5px; padding: 4px 2px 8px; }
.nx-typing.on { display: flex; }
.nx-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nx-cyan);
  opacity: .35;
  animation: nx-blink 1.3s infinite;
}
.nx-typing i:nth-child(2) { animation-delay: .18s; }
.nx-typing i:nth-child(3) { animation-delay: .36s; }
.nx-typing span { margin-left: 6px; font-size: 11px; color: #a9c2c7; }

/* ------------------------------------------------------------- lead capture */
.nx-capture {
  position: relative;
  z-index: 2;
  margin: 10px 15px 2px;
  padding: 12px;
  border: 1px solid rgba(238, 196, 119, .42);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(46, 36, 16, .55), rgba(6, 24, 31, .9));
}
.nx-capture[hidden] { display: none; }
.nx-turnstile { min-height: 0; margin: 0 0 4px; }
.nx-turnstile:empty { display: none; }
.nx-capture h3 { margin: 0 0 4px; font-size: 12.5px; color: var(--nx-gold); letter-spacing: .04em; }
.nx-capture p { margin: 0 0 10px; font-size: 11.5px; color: #c6d8db; }
.nx-field { margin-bottom: 8px; }
.nx-field label { display: block; margin-bottom: 3px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #a9c2c7; }
.nx-field input {
  width: 100%;
  padding: 8px 9px;
  font: inherit;
  font-size: 12.5px;
  color: #fff;
  border: 1px solid rgba(64, 221, 236, .34);
  border-radius: 8px;
  background: #061720;
}
.nx-field input:focus { outline: none; border-color: var(--nx-cyan); }
.nx-consent { display: flex; gap: 7px; align-items: flex-start; margin: 4px 0 9px; font-size: 11px; color: #c6d8db; }
.nx-consent input { margin-top: 2px; accent-color: #40ddec; flex: none; }
.nx-consent a { color: var(--nx-cyan); }
.nx-capture-actions { display: flex; gap: 8px; align-items: center; }
.nx-capture-msg { font-size: 11px; color: #a9c2c7; }
.nx-capture-msg[data-state="error"] { color: #ffc2a8; }
.nx-capture-msg[data-state="ok"] { color: #8ff0c4; }

/* ------------------------------------------------------------------ compose */
.nx-input-wrap {
  position: relative;
  z-index: 2;
  padding: 10px 13px 8px;
  border-top: 1px solid rgba(58, 195, 212, .22);
  background: rgba(0, 11, 16, .55);
}
.nx-compose {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(64, 221, 236, .55);
  border-radius: 14px;
  background: #061720;
  box-shadow: 0 0 16px rgba(41, 202, 219, .10);
}
.nx-compose:focus-within { border-color: var(--nx-cyan); box-shadow: 0 0 20px rgba(41, 202, 219, .22); }
.nx-compose textarea {
  flex: 1;
  min-height: 34px;
  max-height: 108px;
  padding: 7px 6px;
  border: 0;
  outline: 0;
  resize: none;
  color: #fff;
  background: transparent;
  font-size: 13px;
  line-height: 1.4;
}
.nx-compose textarea::placeholder { color: #9bbbc1; }
.nx-send {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #09222a;
  background: linear-gradient(140deg, #ffe3a2, #ba893d);
}
.nx-send:disabled { opacity: .45; cursor: not-allowed; }
.nx-send svg { width: 17px; height: 17px; }
.nx-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px 0;
  font-size: 10px;
  color: #9ab7ba;
}
.nx-foot .nx-shield { width: 12px; height: 12px; color: var(--nx-cyan); flex: none; }
.nx-foot a { color: #a9d9df; }
.nx-foot button.nx-clear {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b9e6ea;
  text-decoration: underline;
  font-size: 10px;
}

/* ---------------------------------------------------------------- animations */
@keyframes nx-spin { to { transform: rotate(360deg); } }
@keyframes nx-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes nx-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes nx-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@keyframes nx-scan {
  0% { transform: translateY(-120%); }
  100% { transform: translateY(760%); }
}
.nx-panel.is-open .nx-scanline {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  height: 58px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(64, 221, 236, .07), transparent);
  animation: nx-scan 7s linear infinite;
}

/* ------------------------------------------------------------------- mobile */
@media (max-width: 600px) {
  .nx-launcher { right: 14px; left: auto; bottom: max(14px, env(safe-area-inset-bottom)); }
  .nx-launcher-label { display: none; }
  .nx-panel {
    inset: 0;
    /* width:auto + both edges pinned fills the viewport exactly; 100vw can
       overshoot by a scrollbar and leave a strip down the side. */
    width: auto;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    border-radius: 0;
    border: 0;
    /* Full-screen on a phone: the blur costs frames and reveals nothing. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(160deg, rgba(9, 33, 43, .99), rgba(4, 14, 21, .995));
  }
  .nx-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .nx-head-actions { align-self: center; }
  .nx-title { font-size: 17px; }
  .nx-subtitle { font-size: 9px; letter-spacing: .14em; }
  .nx-quick { grid-template-columns: 1fr; }
  .nx-quick-btn { min-height: 46px; align-items: center; }
  .nx-input-wrap { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .nx-scroll { padding: 14px 14px 6px; }
  .nx-capture { margin-inline: 14px; }
}

@media (max-height: 560px) {
  .nx-welcome h2 { font-size: 15px; }
  .nx-quick-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-orb::before,
  .nx-orb::after,
  .nx-panel.is-open .nx-scanline,
  .nx-typing i { animation: none !important; }
  .nx-panel,
  .nx-msg { animation: none !important; }
  .nx-launcher { transition: none; }
}
