/* =========================================================
   NEXERA ASSISTANT — chatbot widget
   ========================================================= */
.nxc { --nxc-r: 24px; position: fixed; right: 24px; bottom: 24px; z-index: 960; font-family: var(--f-display); color: var(--t-light); transition: transform .6s var(--ease); }
.nxc.is-raised { transform: translateY(-96px); }
body:has(.mmenu.is-open) .nxc { opacity: 0; pointer-events: none; }
.nxc .ic { width: 18px; height: 18px; }

/* Launcher */
.nxc-launcher {
  position: relative; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; margin-left: auto;
  background: radial-gradient(circle at 30% 25%, #8ff3e3, var(--glow) 45%, #1bb3a0);
  box-shadow: 0 18px 40px -12px rgba(79, 227, 208, .6), 0 0 0 1px rgba(255, 255, 255, .25) inset;
  transition: transform .5s var(--ease), box-shadow .5s;
}
.nxc-launcher:hover { transform: scale(1.07); box-shadow: 0 22px 50px -10px rgba(79, 227, 208, .75), 0 0 0 1px rgba(255, 255, 255, .3) inset; }
.nxc-launcher::before, .nxc-launcher::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--glow); animation: nxc-ring 2.6s var(--ease) infinite; pointer-events: none; }
.nxc-launcher::after { animation-delay: 1.3s; }
.nxc.is-open .nxc-launcher::before, .nxc.is-open .nxc-launcher::after { animation: none; opacity: 0; }
@keyframes nxc-ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }
.nxc-launcher.is-pop { animation: nxc-pop .8s var(--ease); }
@keyframes nxc-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.nxc-launcher__logo, .nxc-launcher__x { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .5s var(--ease), opacity .35s; }
.nxc-launcher__logo::before { content: ""; width: 30px; height: 31px; background: url("../img/logo-mark-dark.png") center / contain no-repeat; }
.nxc-launcher__x { color: var(--ink); opacity: 0; transform: rotate(-90deg); }
.nxc-launcher__x .ic { width: 26px; height: 26px; stroke-width: 2.2; transform: rotate(45deg); }
.nxc.is-open .nxc-launcher__logo { opacity: 0; transform: rotate(90deg) scale(.6); }
.nxc.is-open .nxc-launcher__x { opacity: 1; transform: none; }
.nxc-badge { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ff5a5f; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--ink); }

/* Teaser (mobile greeting bubble) */
.nxc-teaser {
  position: absolute; right: 0; bottom: 82px; width: min(280px, calc(100vw - 48px)); padding: 16px 40px 16px 18px; border-radius: 18px 18px 6px 18px;
  background: var(--white); color: var(--t-dark); box-shadow: 0 24px 50px -16px rgba(4, 18, 21, .45); animation: nxc-in .6s var(--ease);
}
.nxc-teaser__body { display: grid; gap: 4px; cursor: pointer; font-size: 14px; line-height: 1.45; }
.nxc-teaser__body b { font-size: 15px; }
.nxc-teaser__x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--t-muted); }
.nxc-teaser__x .ic { transform: rotate(45deg); width: 16px; height: 16px; }

/* Panel */
.nxc-panel {
  position: absolute; right: 0; bottom: 84px; width: 400px; height: min(640px, calc(100vh - 130px)); height: min(640px, calc(100dvh - 130px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--nxc-r);
  background: linear-gradient(180deg, #08232a 0%, var(--ink-2) 38%);
  border: 1px solid rgba(159, 245, 232, .16);
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .2);
  transform-origin: bottom right; transform: translateY(16px) scale(.92); opacity: 0; visibility: hidden;
  transition: transform .55s var(--ease), opacity .35s, visibility 0s .55s;
}
.nxc.is-open .nxc-panel { transform: none; opacity: 1; visibility: visible; transition: transform .55s var(--ease), opacity .35s, visibility 0s; }

.nxc-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; border-bottom: 1px solid var(--line-d); background: radial-gradient(120% 140% at 0% 0%, rgba(79, 227, 208, .18), transparent 60%); }
.nxc-avatar, .nxc-msg__av { position: relative; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--deep)); border: 1px solid rgba(159, 245, 232, .3); }
.nxc-avatar { width: 44px; height: 44px; }
.nxc-avatar i, .nxc-msg__av i { width: 55%; height: 55%; background: url("../img/logo-mark-glow.png") center / contain no-repeat; }
.nxc-avatar::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #3ddc84; border: 2px solid #08232a; }
.nxc-head__t { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.nxc-head__t b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.nxc-head__t span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t-light-muted); }
.nxc-online { width: 6px; height: 6px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .2); }
.nxc-icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--t-light-muted); transition: background-color .3s, color .3s; }
.nxc-icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--white); }
.nxc-close .ic { transform: rotate(45deg); width: 22px; height: 22px; }

.nxc-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.nxc-msgs { display: grid; gap: 12px; }
.nxc-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.nxc-msg.is-new { animation: nxc-in .5s var(--ease) both; }
@keyframes nxc-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.nxc-msg__av { width: 28px; height: 28px; }
.nxc-bubble { padding: 12px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.55; max-width: 84%; overflow-wrap: anywhere; }
.nxc-msg--bot .nxc-bubble { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .07); border-bottom-left-radius: 6px; color: var(--t-light); }
.nxc-msg--user { justify-content: flex-end; }
.nxc-msg--user .nxc-bubble { background: var(--glow); color: var(--ink); border-bottom-right-radius: 6px; font-weight: 500; }
.nxc-bubble p + p, .nxc-bubble p + ul, .nxc-bubble ul + p, .nxc-bubble b + p, .nxc-bubble p + .nxc-cards, .nxc-bubble ul + .nxc-cta, .nxc-bubble p + .nxc-cta, .nxc-bubble .nxc-summary + p, .nxc-bubble p + .nxc-summary { margin-top: 8px; }
.nxc-bubble ul { display: grid; gap: 6px; padding-left: 0; }
.nxc-bubble li { position: relative; padding-left: 16px; }
.nxc-bubble li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--glow); }
.nxc-bubble li .ic { display: inline-block; vertical-align: -3px; width: 15px; height: 15px; color: var(--glow); margin-right: 4px; }
.nxc-bubble p .ic { display: inline-block; vertical-align: -3px; width: 16px; height: 16px; color: var(--glow); }
.nxc-bubble li:has(> .ic:first-child) { padding-left: 0; }
.nxc-bubble li:has(> .ic:first-child)::before { display: none; }
.nxc-bubble a:not(.nxc-cta):not(.nxc-card) { color: var(--glow); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(79, 227, 208, .4); }
.nxc-dim { color: var(--t-light-muted); font-size: 12.5px; }
.nxc-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 14px; border-radius: 100px; border: 1px solid rgba(79, 227, 208, .45); color: var(--glow); font-size: 13.5px; font-weight: 600; transition: background-color .3s, color .3s; }
.nxc-cta .ic { width: 15px; height: 15px; }
.nxc-cta:hover { background: var(--glow); color: var(--ink); }
.nxc-cta--solid { background: var(--glow); color: var(--ink); }
.nxc-cta--solid:hover { background: var(--white); }

.nxc-cards { display: grid; gap: 6px; margin-top: 10px; }
.nxc-card { display: grid; grid-template-columns: 34px 1fr 16px; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); font-size: 13.5px; font-weight: 500; line-height: 1.3; transition: background-color .3s, border-color .3s; }
.nxc-card:hover { background: rgba(79, 227, 208, .1); border-color: rgba(79, 227, 208, .35); }
.nxc-card__ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(79, 227, 208, .12); color: var(--glow); }
.nxc-card__go { width: 15px !important; height: 15px !important; color: var(--t-light-muted); }

.nxc-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); font-size: 13.5px; }
.nxc-summary span { color: var(--t-light-muted); }
.nxc-summary b { font-weight: 500; overflow-wrap: anywhere; }

.nxc-typing .nxc-bubble { display: inline-flex; gap: 5px; padding: 14px 16px; }
.nxc-typing .nxc-bubble span { width: 7px; height: 7px; border-radius: 50%; background: var(--glow); animation: nxc-dot 1.2s infinite ease-in-out; }
.nxc-typing .nxc-bubble span:nth-child(2) { animation-delay: .15s; }
.nxc-typing .nxc-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes nxc-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

.nxc-chips { display: flex; gap: 8px; padding: 8px 16px 10px; overflow-x: auto; scrollbar-width: none; flex-wrap: wrap; max-height: 152px; overflow-y: auto; }
.nxc-chips::-webkit-scrollbar { display: none; }
.nxc-chip { padding: 8px 13px; border-radius: 100px; border: 1px solid rgba(79, 227, 208, .35); color: var(--glow-2); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background-color .3s, color .3s, border-color .3s, transform .4s var(--ease); animation: nxc-in .45s var(--ease) both; }
.nxc-chip:nth-child(2) { animation-delay: .04s; } .nxc-chip:nth-child(3) { animation-delay: .08s; } .nxc-chip:nth-child(4) { animation-delay: .12s; } .nxc-chip:nth-child(5) { animation-delay: .16s; } .nxc-chip:nth-child(6) { animation-delay: .2s; }
.nxc-chip:hover { background: var(--glow); color: var(--ink); border-color: var(--glow); transform: translateY(-1px); }

.nxc-input { display: flex; gap: 8px; align-items: center; margin: 4px 12px 8px; padding: 6px 6px 6px 16px; border-radius: 100px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); transition: border-color .3s, background-color .3s; }
.nxc-input:focus-within { border-color: rgba(79, 227, 208, .55); background: rgba(255, 255, 255, .08); }
.nxc-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--white); font-size: 15px; padding: 8px 0; }
.nxc-input input::placeholder { color: rgba(226, 240, 238, .45); }
.nxc-input button { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--glow); color: var(--ink); transition: transform .4s var(--ease), background-color .3s; }
.nxc-input button:hover { transform: scale(1.08); background: var(--white); }
.nxc-foot { text-align: center; font-size: 11.5px; color: rgba(226, 240, 238, .45); padding: 0 12px 12px; }
.nxc-foot a { color: var(--glow); }

/* Mobile */
@media (max-width: 560px) {
  .nxc { right: 16px; bottom: 16px; }
  .nxc-launcher { width: 58px; height: 58px; }
  .nxc-launcher__logo::before { width: 26px; height: 27px; }
  .nxc-panel { position: fixed; left: 10px; right: 10px; bottom: 86px; width: auto; height: calc(100dvh - 112px); max-height: 680px; }
  .nxc-teaser { bottom: 72px; }
  .nxc-bubble { font-size: 14px; max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  .nxc-launcher::before, .nxc-launcher::after { animation: none; opacity: 0; }
}

@media print { .nxc { display: none !important; } }
