/* Customer assistant widget — shared by primesearch.site and swifttech.com.ng.
   Everything is scoped under #as-root; the accent colour comes from --as-accent. */
#as-root { --as-accent: #00A651; --as-accent-dark: #006b4e; --as-ink: #1f2937; --as-muted: #6b7280; --as-line: #e5e9f0; --as-bg: #f6f8fb;
  position: fixed; right: 20px; bottom: 20px; z-index: 9990; font-family: inherit; font-size: 14px; line-height: 1.45; color: var(--as-ink); }
#as-root *, #as-root *::before, #as-root *::after { box-sizing: border-box; }

#as-launch { width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--as-accent) 0%, var(--as-accent-dark) 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,.22); display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .18s ease, box-shadow .18s ease; }
#as-launch:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 28px rgba(0,0,0,.26); }
#as-launch:focus-visible { outline: 3px solid rgba(0,0,0,.35); outline-offset: 3px; }
#as-launch svg { width: 30px; height: 30px; }
#as-launch .as-dot { position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
#as-root.as-open #as-launch { display: none; }

#as-hint { position: absolute; right: 70px; bottom: 12px; white-space: nowrap; background: #fff; color: var(--as-ink); border: 1px solid var(--as-line);
  border-radius: 12px; padding: 8px 12px; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.12); cursor: pointer; animation: as-pop .25s ease; }
#as-hint b { color: var(--as-accent); }
#as-root.as-open #as-hint { display: none; }

#as-panel { display: none; width: 380px; height: min(620px, calc(100vh - 40px)); background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.25); flex-direction: column; animation: as-pop .2s ease; }
#as-root.as-open #as-panel { display: flex; }
@keyframes as-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.as-head { background: linear-gradient(135deg, var(--as-accent) 0%, var(--as-accent-dark) 100%); color: #fff; padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 11px; }
.as-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex: none; }
.as-avatar svg { width: 24px; height: 24px; }
.as-title { flex: 1; min-width: 0; }
.as-title strong { display: block; font-size: 15.5px; }
.as-title span { font-size: 12px; opacity: .9; }
.as-title span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #86efac; margin-right: 5px; vertical-align: 1px; }
.as-hbtn { background: rgba(255,255,255,.15); border: none; color: #fff; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.as-hbtn:hover { background: rgba(255,255,255,.28); }
.as-hbtn svg { width: 17px; height: 17px; }

.as-msgs { position: relative; flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--as-bg); scroll-behavior: smooth; }
.as-row { display: flex; margin-bottom: 10px; gap: 8px; align-items: flex-end; }
.as-row.as-user { justify-content: flex-end; }
.as-mini { width: 26px; height: 26px; border-radius: 50%; background: var(--as-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.as-mini svg { width: 16px; height: 16px; }
.as-bubble { max-width: 82%; padding: 9px 13px; border-radius: 15px; word-wrap: break-word; overflow-wrap: anywhere; }
.as-bot .as-bubble { background: #fff; border: 1px solid var(--as-line); border-bottom-left-radius: 4px; }
.as-user .as-bubble { background: var(--as-accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.as-bubble p { margin: 0 0 7px; } .as-bubble p:last-child { margin-bottom: 0; }
.as-bubble ul, .as-bubble ol { margin: 4px 0 7px; padding-left: 18px; } .as-bubble li { margin: 2px 0; }
.as-bubble a { color: var(--as-accent); font-weight: 600; text-decoration: underline; }
.as-bubble code { background: #f1f5f9; border-radius: 4px; padding: 0 4px; font-size: 13px; }
.as-bubble .as-note { display: block; font-size: 11px; color: var(--as-muted); margin-top: 6px; }
.as-error .as-bubble { border-color: #fecaca; background: #fef2f2; }

.as-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.as-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: as-blink 1.2s infinite; }
.as-typing i:nth-child(2) { animation-delay: .2s; } .as-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes as-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.as-chips { display: flex; gap: 6px; padding: 8px 12px 4px; overflow-x: auto; background: #fff; border-top: 1px solid var(--as-line); scrollbar-width: none; }
.as-chips::-webkit-scrollbar { display: none; }
.as-chip { flex: none; border: 1.5px solid var(--as-accent); color: var(--as-accent); background: #fff; border-radius: 20px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.as-chip:hover { background: var(--as-accent); color: #fff; }
.as-chip:disabled { opacity: .5; cursor: default; }

.as-form { display: flex; gap: 8px; padding: 8px 12px 6px; background: #fff; align-items: flex-end; }
.as-form textarea { flex: 1; resize: none; border: 1.5px solid #dfe3ea; border-radius: 13px; padding: 9px 12px; font: inherit; font-size: 14px; min-height: 42px; max-height: 120px; color: var(--as-ink); background: #fff; }
.as-form textarea:focus { outline: none; border-color: var(--as-accent); box-shadow: 0 0 0 3px rgba(0,166,81,.12); box-shadow: 0 0 0 3px color-mix(in srgb, var(--as-accent) 15%, transparent); }
.as-send { width: 42px; height: 42px; flex: none; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--as-accent) 0%, var(--as-accent-dark) 100%); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.as-send:disabled { opacity: .55; cursor: default; }
.as-send svg { width: 19px; height: 19px; }
.as-foot { font-size: 10.5px; color: var(--as-muted); text-align: center; padding: 0 12px 9px; background: #fff; }

.as-card { flex: 1; max-width: 88%; background: #fff; border: 1.5px solid var(--as-accent); border-radius: 15px; border-bottom-left-radius: 4px; padding: 12px 13px; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.as-card-title { font-weight: 700; font-size: 14.5px; margin-bottom: 8px; color: var(--as-ink); }
.as-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed #eef1f5; }
.as-kv span { color: var(--as-muted); } .as-kv b { text-align: right; font-weight: 600; word-break: break-word; }
.as-kv.as-price b { color: var(--as-accent); font-size: 14.5px; }
.as-kv.as-low b, .as-warn { color: #b42318; }
.as-warn { font-size: 12.5px; margin: 8px 0 0; }
.as-card-body { margin-top: 10px; }
.as-consent { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; line-height: 1.4; color: var(--as-muted); margin-bottom: 9px; cursor: pointer; }
.as-consent input { margin-top: 2px; accent-color: var(--as-accent); flex: none; }
.as-pin-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.as-pin { width: 100%; border: 1.5px solid #dfe3ea; border-radius: 10px; padding: 8px 12px; font-size: 18px; letter-spacing: 8px; text-align: center; font-family: inherit; }
.as-pin:focus { outline: none; border-color: var(--as-accent); }
.as-card-err { color: #b42318; font-size: 12.5px; min-height: 4px; margin: 5px 0 0; }
.as-card-btns { display: flex; gap: 8px; margin-top: 8px; }
.as-card-btns button { flex: 1; border-radius: 10px; padding: 9px 8px; font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.as-btn-cancel { background: #fff; border: 1.5px solid #dfe3ea; color: var(--as-ink); }
.as-btn-ok { border: none; color: #fff; background: linear-gradient(135deg, var(--as-accent) 0%, var(--as-accent-dark) 100%); }
.as-card-btns button:disabled { opacity: .55; cursor: default; }
.as-badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 20px; padding: 3px 10px; background: #f1f5f9; color: var(--as-muted); }
.as-badge.as-done { background: #e8f8ef; color: #067647; }
.as-badge.as-failed { background: #fef3f2; color: #b42318; }

@media (max-width: 520px) {
  #as-root { right: 14px; bottom: 14px; }
  #as-root.as-open { right: 0; bottom: 0; left: 0; top: 0; }
  #as-panel { width: 100vw; height: 100%; border-radius: 0; }
  #as-hint { display: none; }
}
@media print { #as-root { display: none !important; } }
