/* =========================================================================
   AI ASSISTANT WIDGET
   Loaded non-blocking (media="print" → all). Nothing renders until the
   script adds .wx-ready, so a stylesheet that arrives late never flashes.
   ========================================================================= */

#wx-chat{
  position:fixed;right:20px;bottom:20px;z-index:120;
  font-family:'Manrope',system-ui,sans-serif;
  display:none;
}
#wx-chat.wx-ready{display:block}

/* ── Launcher ───────────────────────────────────────────────────────── */
.wx-launch{
  display:flex;align-items:center;gap:11px;
  background:#0A0D14;color:#fff;border:none;cursor:pointer;
  padding:13px 20px 13px 15px;border-radius:999px;
  font-family:inherit;font-size:14.5px;font-weight:700;
  box-shadow:0 18px 40px -18px rgba(10,13,20,.7);
  transition:transform .3s cubic-bezier(.2,.8,.2,1),background .3s ease;
}
.wx-launch:hover{transform:translateY(-2px);background:#1D4ED8}
.wx-launch .wx-av{
  width:30px;height:30px;border-radius:50%;flex-shrink:0;
  background:linear-gradient(145deg,#1D4ED8,#2F5FD8);
  display:flex;align-items:center;justify-content:center;
  font-family:'Plus Jakarta Sans',sans-serif;font-weight:800;font-size:13px;
}
.wx-launch .wx-dot{
  width:7px;height:7px;border-radius:50%;background:#34D399;flex-shrink:0;
  animation:wxblink 2.4s infinite;
}
@keyframes wxblink{0%,100%{opacity:1}50%{opacity:.3}}

/* Nudge bubble — shown once per session, dismissible */
.wx-nudge{
  position:absolute;right:0;bottom:calc(100% + 12px);width:252px;
  background:#fff;border:1px solid #E6EBF3;border-radius:16px;padding:15px 17px;
  box-shadow:0 26px 54px -28px rgba(10,13,20,.5);
  font-size:13.6px;line-height:1.55;color:#4B5565;
  animation:wxUp .5s cubic-bezier(.2,.8,.2,1) both;
}
.wx-nudge b{display:block;color:#0A0D14;font-weight:800;font-size:14px;margin-bottom:4px;
  font-family:'Plus Jakarta Sans',sans-serif;letter-spacing:-.015em}
.wx-nudge-x{
  position:absolute;top:8px;right:8px;width:22px;height:22px;border-radius:50%;
  border:none;background:#F2F5FA;color:#7A8498;cursor:pointer;font-size:13px;line-height:1;
}
.wx-nudge-x:hover{background:#E6EBF3;color:#0A0D14}

/* ── Panel ──────────────────────────────────────────────────────────── */
.wx-panel{
  position:absolute;right:0;bottom:0;width:min(386px,calc(100vw - 32px));
  background:#fff;border:1px solid #E6EBF3;border-radius:22px;overflow:hidden;
  box-shadow:0 50px 100px -40px rgba(10,13,20,.6);
  display:flex;flex-direction:column;max-height:min(620px,calc(100vh - 110px));
  opacity:0;visibility:hidden;transform:translateY(18px) scale(.97);transform-origin:bottom right;
  transition:opacity .3s ease,transform .38s cubic-bezier(.2,.8,.2,1),visibility .38s;
}
#wx-chat.open .wx-panel{opacity:1;visibility:visible;transform:none}
#wx-chat.open .wx-launch{opacity:0;pointer-events:none;transform:scale(.9)}
#wx-chat.open .wx-nudge{display:none}

.wx-head{
  display:flex;align-items:center;gap:12px;padding:16px 18px;
  border-bottom:1px solid #EFF2F7;background:#fff;flex-shrink:0;
}
.wx-head .wx-av{
  width:38px;height:38px;border-radius:50%;flex-shrink:0;color:#fff;
  background:linear-gradient(145deg,#1D4ED8,#0A0D14);
  display:flex;align-items:center;justify-content:center;
  font-family:'Plus Jakarta Sans',sans-serif;font-weight:800;font-size:14px;
}
.wx-head .wx-who{flex:1;min-width:0}
.wx-head .wx-name{font-weight:700;font-size:14.5px;color:#0A0D14}
.wx-head .wx-state{font-size:12px;color:#15803D;font-weight:600;display:flex;align-items:center;gap:6px}
.wx-head .wx-state i{width:6px;height:6px;border-radius:50%;background:#15803D;display:block}
.wx-x{
  width:32px;height:32px;border-radius:50%;border:1px solid #E6EBF3;background:#fff;
  color:#4B5565;cursor:pointer;font-size:14px;line-height:1;flex-shrink:0;
}
.wx-x:hover{border-color:#0A0D14;color:#0A0D14}

.wx-log{
  flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:12px;
  background:#FAFBFE;scroll-behavior:smooth;min-height:230px;
}
.wx-row{display:flex;animation:wxUp .4s cubic-bezier(.2,.8,.2,1) both}
.wx-row.me{justify-content:flex-end}
.wx-bub{
  max-width:84%;padding:12px 16px;font-size:14.4px;line-height:1.6;
  border-radius:16px 16px 16px 4px;background:#fff;border:1px solid #E8EDF5;color:#0A0D14;
  overflow-wrap:anywhere;
}
.wx-row.me .wx-bub{
  border-radius:16px 16px 4px 16px;background:#1D4ED8;border-color:#1D4ED8;color:#fff;
}
.wx-bub a{color:#1D4ED8;font-weight:700;text-decoration:underline;text-underline-offset:2px}
.wx-row.me .wx-bub a{color:#fff}
.wx-bub p{margin:0 0 .7em}
.wx-bub p:last-child{margin:0}

.wx-typing{display:flex;gap:5px;padding:13px 17px;background:#fff;border:1px solid #E8EDF5;
  border-radius:16px 16px 16px 4px}
.wx-typing i{width:6px;height:6px;border-radius:50%;background:#8A94A6;display:block;
  animation:wxtype 1s infinite}
.wx-typing i:nth-child(2){animation-delay:.18s}
.wx-typing i:nth-child(3){animation-delay:.36s}
@keyframes wxtype{0%,100%{opacity:.3}50%{opacity:1}}
@keyframes wxUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* Starter chips */
.wx-chips{display:flex;flex-wrap:wrap;gap:7px;padding:0 18px 14px;background:#FAFBFE;flex-shrink:0}
.wx-chip{
  border:1px solid #E1E8F3;background:#fff;border-radius:999px;padding:8px 14px;
  font-family:inherit;font-size:12.8px;font-weight:700;color:#0A0D14;cursor:pointer;
  transition:border-color .25s,color .25s;
}
.wx-chip:hover{border-color:#1D4ED8;color:#1D4ED8}

/* Inline lead form, shown after a handover */
.wx-lead{padding:15px 18px;border-top:1px solid #EFF2F7;background:#EEF3FD;flex-shrink:0}
.wx-lead p{margin:0 0 10px;font-size:13px;line-height:1.55;color:#39414F;font-weight:600}
.wx-lead .wx-fields{display:grid;gap:8px}
.wx-lead input{
  width:100%;border:1px solid #DCE6FA;border-radius:10px;padding:11px 13px;
  font-family:inherit;font-size:14px;color:#0A0D14;background:#fff;outline:none;
}
.wx-lead input:focus{border-color:#1D4ED8;box-shadow:0 0 0 3px rgba(29,78,216,.12)}
.wx-lead button{
  border:none;background:#1D4ED8;color:#fff;border-radius:10px;padding:11px 16px;
  font-family:inherit;font-size:14px;font-weight:700;cursor:pointer;
}
.wx-lead button:hover{background:#0A0D14}

.wx-form{display:flex;gap:9px;align-items:flex-end;padding:13px 14px;
  border-top:1px solid #EFF2F7;background:#fff;flex-shrink:0}
.wx-form textarea{
  flex:1;min-width:0;border:1px solid #E6EBF3;border-radius:14px;padding:11px 14px;
  font-family:inherit;font-size:14.4px;line-height:1.5;color:#0A0D14;resize:none;
  outline:none;max-height:120px;background:#FAFBFE;
}
.wx-form textarea:focus{border-color:#1D4ED8;background:#fff}
.wx-send{
  width:42px;height:42px;border-radius:50%;border:none;flex-shrink:0;cursor:pointer;
  background:#1D4ED8;color:#fff;font-size:15px;display:flex;align-items:center;justify-content:center;
  transition:background .25s,transform .25s;
}
.wx-send:hover{background:#0A0D14;transform:scale(1.05)}
.wx-send:disabled{background:#C4CEDE;cursor:not-allowed;transform:none}

.wx-foot{padding:0 18px 12px;font-size:11.2px;color:#8A94A6;background:#fff;
  text-align:center;line-height:1.5;flex-shrink:0}
.wx-foot a{color:#8A94A6;text-decoration:underline}

@media (max-width:520px){
  #wx-chat{right:14px;bottom:14px;left:14px}
  .wx-panel{width:100%;max-height:calc(100vh - 92px)}
  .wx-launch{margin-left:auto}
  .wx-nudge{width:min(252px,100%)}
}
@media (prefers-reduced-motion:reduce){
  #wx-chat *{animation:none !important;transition-duration:.001ms !important}
}
@media print{#wx-chat{display:none !important}}
