/* ============================================================
   VASTROX live chat — premium widget + admin console + bell (v4)
   Dark electric-blue, glassmorphism, fully self-contained.
   ============================================================ */
:root {
  --vxc-accent: #4d8bff; --vxc-accent2: #2f6bff; --vxc-cyan: #22d3ee;
  --vxc-grad: #003efd;
  --vxc-surface: #0c1322; --vxc-surface2: #111a2c;
  --vxc-text: #eef3fb; --vxc-text2: #c2cee2; --vxc-text3: #93a3bf; --vxc-muted: #74849f;
  --vxc-border: rgba(140,170,220,.14); --vxc-border2: rgba(140,170,220,.22);
}

/* ---------- launcher ---------- */
#vxChatWidget { position: fixed; right: clamp(14px,3vw,26px); bottom: clamp(14px,3vw,26px); z-index: 1200; font-family: 'Inter', system-ui, sans-serif; }
/* keep clear of the staff inline-editor toolbar (#vx-toolbar, bottom-right) */
#vxChatWidget.vx-has-editor, body:has(#vx-toolbar) #vxChatWidget { bottom: 96px; }
.vxchat-fab {
  position: relative; width: 62px; height: 62px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--vxc-grad);
  box-shadow: 0 12px 30px -8px rgba(47,107,255,.75), 0 0 0 1px rgba(255,255,255,.12), 0 0 40px -10px rgba(47,107,255,.6);
  display: grid; place-items: center; color: #fff;
  transition: transform .22s cubic-bezier(.2,.9,.3,1.3), box-shadow .22s ease;
  animation: vxcFabIn .5s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes vxcFabIn { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.vxchat-fab::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(47,107,255,.5); animation: vxcRing 2.8s ease-out infinite; }
@keyframes vxcRing { 0% { box-shadow: 0 0 0 0 rgba(47,107,255,.5); } 70%,100% { box-shadow: 0 0 0 16px rgba(47,107,255,0); } }
.vxchat-fab:hover { transform: translateY(-3px) scale(1.05); }
.vxchat-fab svg { width: 27px; height: 27px; transition: transform .25s ease; }
.vxchat-fab .vxchat-ico-close { display: none; }
#vxChatWidget.is-open .vxchat-fab { animation: none; }
#vxChatWidget.is-open .vxchat-fab::after { display: none; }
#vxChatWidget.is-open .vxchat-fab .vxchat-ico-open { display: none; }
#vxChatWidget.is-open .vxchat-fab .vxchat-ico-close { display: block; }
.vxchat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: #ff4d6d; color: #fff; font-size: 11px; font-weight: 800;
  display: none; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--vxc-surface);
  animation: vxcPop .3s ease;
}
@keyframes vxcPop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- panel ---------- */
.vxchat-panel {
  position: absolute; right: 0; bottom: 78px;
  width: min(384px, calc(100vw - 24px)); height: min(620px, calc(100vh - 120px));
  background: linear-gradient(180deg, rgba(14,22,38,.98), rgba(7,11,20,.99));
  border: 1px solid var(--vxc-border2); border-radius: 22px; overflow: hidden;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 90px -34px rgba(0,0,0,.92), 0 0 70px -26px rgba(47,107,255,.55), 0 0 0 1px rgba(255,255,255,.03);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(20px) scale(.97); transform-origin: bottom right; pointer-events: none;
  transition: opacity .26s ease, transform .26s cubic-bezier(.2,.9,.3,1.15);
}
#vxChatWidget.is-open .vxchat-panel { opacity: 1; transform: none; pointer-events: auto; }

.vxchat-head {
  position: relative; padding: 18px 18px 20px; color: #fff;
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(109,93,252,.5), transparent 55%),
    radial-gradient(120% 130% at 100% 0%, rgba(34,211,238,.28), transparent 55%),
    var(--vxc-grad);
}
.vxchat-head::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.09) 1px, transparent 0); background-size: 16px 16px; opacity: .5; }
.vxchat-head-top { position: relative; display: flex; align-items: center; gap: 12px; z-index: 1; }
.vxchat-avatar { position: relative; width: 44px; height: 44px; border-radius: 14px; flex: none; background: rgba(255,255,255,.16); display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.vxchat-avatar .on { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2.5px var(--vxc-accent2), 0 0 8px #22c55e; }
.vxchat-head h4 { margin: 0; font-size: 16px; font-weight: 750; font-family: 'Plus Jakarta Sans', sans-serif; }
.vxchat-head p { margin: 3px 0 0; font-size: 12.5px; opacity: .92; display: flex; align-items: center; gap: 6px; }
.vxchat-head p .dot { width: 7px; height: 7px; border-radius: 50%; background: #5ef08f; box-shadow: 0 0 8px #5ef08f; }
.vxchat-close { position: relative; z-index: 1; margin-left: auto; width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.16); border: 0; color: #fff; cursor: pointer; font-size: 18px; line-height: 1; display: grid; place-items: center; transition: background .15s ease; }
.vxchat-close:hover { background: rgba(255,255,255,.28); }
.vxchat-head .vxchat-tag { position: relative; z-index: 1; margin-top: 14px; font-size: 12.5px; line-height: 1.5; opacity: .95; }

.vxchat-body {
  flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 2px;
  background: radial-gradient(120% 60% at 50% 0%, rgba(47,107,255,.05), transparent 60%);
  scrollbar-width: thin; scrollbar-color: rgba(140,170,220,.25) transparent;
}
.vxchat-body::-webkit-scrollbar { width: 7px; }
.vxchat-body::-webkit-scrollbar-thumb { background: rgba(140,170,220,.22); border-radius: 4px; }

/* date separator */
.vxc-day { align-self: center; margin: 12px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--vxc-muted); background: rgba(140,170,220,.1); padding: 4px 12px; border-radius: 999px; }

/* message rows */
.vxc-msg { display: flex; gap: 9px; max-width: 90%; margin-top: 9px; }
.vxc-msg.is-me { align-self: flex-end; flex-direction: row-reverse; }
.vxc-msg.is-staff { align-self: flex-start; }
.vxc-msg.grouped { margin-top: 2px; }
.vxc-ava { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; align-self: flex-end; }
.vxc-msg.is-staff .vxc-ava { background: var(--vxc-grad); box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
.vxc-msg.is-me .vxc-ava { background: var(--vxc-surface2); color: var(--vxc-text2); border: 1px solid var(--vxc-border2); }
.vxc-msg.grouped .vxc-ava { visibility: hidden; height: 0; }
.vxc-col { display: flex; flex-direction: column; min-width: 0; }
.vxc-msg.is-me .vxc-col { align-items: flex-end; }
.vxc-bubble { padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.18); animation: vxcMsgIn .26s cubic-bezier(.2,.9,.3,1.1); }
@keyframes vxcMsgIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.vxc-msg.is-me .vxc-bubble { background: var(--vxc-grad); color: #fff; border-bottom-right-radius: 5px; }
.vxc-msg.is-staff .vxc-bubble { background: var(--vxc-surface2); color: var(--vxc-text); border: 1px solid var(--vxc-border); border-bottom-left-radius: 5px; }
.vxc-meta { font-size: 10.5px; color: var(--vxc-muted); margin-top: 3px; padding: 0 4px; }

/* typing indicator */
.vxc-typing { display: none; align-items: center; gap: 9px; align-self: flex-start; margin: 6px 0 2px; }
.vxc-typing.show { display: flex; }
.vxc-typing .vxc-ava { background: var(--vxc-grad); }
.vxc-typing .bub { background: var(--vxc-surface2); border: 1px solid var(--vxc-border); border-radius: 16px; border-bottom-left-radius: 5px; padding: 12px 14px; display: flex; gap: 4px; }
.vxc-typing .bub i { width: 7px; height: 7px; border-radius: 50%; background: var(--vxc-text3); animation: vxcBlink 1.3s infinite both; }
.vxc-typing .bub i:nth-child(2) { animation-delay: .2s; } .vxc-typing .bub i:nth-child(3) { animation-delay: .4s; }
@keyframes vxcBlink { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* pre-chat greeting + quick replies */
.vxc-greet { padding: 18px 8px 6px; text-align: center; color: var(--vxc-text3); font-size: 13.5px; line-height: 1.6; }
.vxc-greet b { color: var(--vxc-text); display: block; font-size: 15px; margin-bottom: 4px; font-family: 'Plus Jakarta Sans', sans-serif; }
.vxc-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 12px 6px 4px; }
.vxc-chip { background: rgba(47,107,255,.12); border: 1px solid rgba(47,107,255,.32); color: #bcd2ff; border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; transition: all .15s ease; }
.vxc-chip:hover { background: rgba(47,107,255,.24); transform: translateY(-1px); }

/* composer */
.vxchat-form { padding: 11px 12px; border-top: 1px solid var(--vxc-border); display: flex; gap: 9px; align-items: flex-end; background: rgba(6,9,15,.55); }
.vxchat-form textarea {
  flex: 1; resize: none; max-height: 110px; background: var(--vxc-surface); color: var(--vxc-text);
  border: 1px solid var(--vxc-border2); border-radius: 14px; padding: 11px 13px; font-size: 14px; font-family: inherit; line-height: 1.4; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.vxchat-form textarea:focus { border-color: var(--vxc-accent); box-shadow: 0 0 0 4px rgba(47,107,255,.2); }
.vxchat-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 14px; cursor: pointer; background: var(--vxc-grad); color: #fff; display: grid; place-items: center; transition: transform .15s ease, filter .15s ease; box-shadow: 0 6px 16px -6px rgba(47,107,255,.7); }
.vxchat-send:hover { transform: translateY(-1px) scale(1.04); filter: brightness(1.08); }
.vxchat-send:disabled { opacity: .45; cursor: default; transform: none; }
.vxchat-send svg { width: 19px; height: 19px; }
.vxchat-foot { text-align: center; font-size: 10.5px; color: var(--vxc-muted); padding: 0 0 8px; background: rgba(6,9,15,.55); }
.vxchat-foot b { color: var(--vxc-text3); font-weight: 700; }

@media (max-width: 480px) {
  #vxChatWidget { right: 0; bottom: 0; }
  .vxchat-panel { width: 100vw; height: 100vh; height: 100dvh; bottom: 0; right: 0; border-radius: 0; }
  #vxChatWidget.is-open .vxchat-fab { display: none; }
}

/* ============================================================
   Admin / staff console (premium)
   ============================================================ */
.vx-chat-console {
  display: grid; grid-template-columns: 320px 1fr 292px; gap: 0;
  height: calc(100vh - 200px); min-height: 540px;
  background: linear-gradient(180deg, rgba(14,22,38,.55), var(--vxc-surface));
  border: 1px solid var(--vxc-border2); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 70px -34px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.02);
}
/* subtle glow so the empty thread isn't a flat void */
.vxcc-thread { background: radial-gradient(90% 55% at 50% -5%, rgba(47,107,255,.07), transparent 62%); }
.vxcc-list { border-right: 1px solid var(--vxc-border); display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(8,12,23,.6), rgba(8,12,23,.9)); }
.vxcc-list-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--vxc-border); }
.vxcc-list-head h3 { margin: 0 0 12px; font-size: 15px; color: var(--vxc-text); font-weight: 750; display: flex; align-items: center; gap: 8px; }
.vxcc-list-head h3 .cnt { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--vxc-muted); background: rgba(140,170,220,.1); padding: 2px 9px; border-radius: 999px; }
.vxcc-search { position: relative; }
.vxcc-search input { width: 100%; box-sizing: border-box; height: 38px; padding: 0 12px 0 34px; background: var(--vxc-surface); color: var(--vxc-text); border: 1px solid var(--vxc-border2); border-radius: 10px; outline: none; font-size: 13.5px; }
.vxcc-search input:focus { border-color: var(--vxc-accent); }
.vxcc-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--vxc-muted); }
.vxcc-tabs { display: flex; gap: 6px; margin-top: 10px; }
.vxcc-tab { flex: 1; text-align: center; font-size: 12px; font-weight: 650; color: var(--vxc-text3); background: rgba(140,170,220,.07); border: 1px solid var(--vxc-border); border-radius: 8px; padding: 6px; cursor: pointer; }
.vxcc-tab.active { background: rgba(47,107,255,.16); border-color: rgba(47,107,255,.4); color: #bcd2ff; }
.vxcc-list-items { flex: 1; overflow-y: auto; }
.vxcc-list-items:empty::after, .vxcc-list-items .vxcc-none { display: block; content: "No conversations"; color: var(--vxc-muted); font-size: 13px; padding: 22px; text-align: center; }

.vxcc-item { position: relative; width: 100%; text-align: left; border: 0; cursor: pointer; background: transparent; border-bottom: 1px solid rgba(140,170,220,.07); padding: 13px 16px; display: flex; gap: 11px; align-items: center; transition: background .14s ease; }
.vxcc-item:hover { background: rgba(47,107,255,.07); }
.vxcc-item.is-active { background: rgba(47,107,255,.14); box-shadow: inset 3px 0 0 var(--vxc-accent); }
.vxcc-item-ava { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--vxc-grad); }
.vxcc-item-ava.guest { background: linear-gradient(135deg, #64748b, #475569); }
.vxcc-item-main { min-width: 0; flex: 1; }
.vxcc-item-row { display: flex; align-items: center; gap: 6px; }
.vxcc-item-name { font-size: 14px; font-weight: 650; color: var(--vxc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vxcc-item-time { margin-left: auto; font-size: 10.5px; color: var(--vxc-muted); flex: none; }
.vxcc-item-prev { font-size: 12.5px; color: var(--vxc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.vxcc-item .gbadge { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #cbd5e1; background: rgba(148,163,184,.18); border-radius: 4px; padding: 1px 5px; }
.vxcc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--vxc-accent); box-shadow: 0 0 8px var(--vxc-accent); flex: none; display: none; }
.vxcc-item.has-unread .vxcc-dot { display: block; }
.vxcc-item.has-unread .vxcc-item-name { color: #fff; }
.vxcc-item.has-unread .vxcc-item-prev { color: var(--vxc-text2); font-weight: 600; }

.vxcc-thread { display: flex; flex-direction: column; min-width: 0; }
.vxcc-thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--vxc-border); background: linear-gradient(135deg, rgba(47,107,255,.1), transparent 65%); }
.vxcc-thread-head .vxcc-item-ava { width: 38px; height: 38px; }
.vxcc-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--vxc-text); }
.vxcc-sub { font-size: 12.5px; color: var(--vxc-text3); }
.vxcc-body { flex: 1; overflow-y: auto; padding: 18px 20px 6px; display: flex; flex-direction: column; gap: 2px; }
.vxcc-placeholder { margin: auto; text-align: center; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--vxc-text3); }
.vxcc-placeholder b { color: var(--vxc-text); font-size: 16px; font-family: 'Plus Jakarta Sans', sans-serif; }
.vxcc-placeholder span { font-size: 13.5px; line-height: 1.6; }
.vxcc-empty-ico { width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 10px; background: radial-gradient(circle at 30% 25%, rgba(47,107,255,.28), rgba(47,107,255,.08)); border: 1px solid var(--vxc-border2); color: #8fb4ff; box-shadow: 0 0 36px -10px rgba(47,107,255,.6); }
.vxcc-empty-ico svg { width: 30px; height: 30px; }
.vxcc-msg { display: flex; gap: 9px; max-width: 74%; margin-top: 9px; }
.vxcc-msg.is-staff { align-self: flex-end; flex-direction: row-reverse; }
.vxcc-msg.is-client { align-self: flex-start; }
.vxcc-msg.grouped { margin-top: 2px; }
.vxcc-ava { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; align-self: flex-end; }
.vxcc-msg.is-staff .vxcc-ava { background: var(--vxc-grad); }
.vxcc-msg.is-client .vxcc-ava { background: linear-gradient(135deg, #64748b, #475569); }
.vxcc-msg.grouped .vxcc-ava { visibility: hidden; }
.vxcc-col { display: flex; flex-direction: column; }
.vxcc-msg.is-staff .vxcc-col { align-items: flex-end; }
.vxcc-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.vxcc-msg.is-staff .vxcc-bubble { background: var(--vxc-grad); color: #fff; border-bottom-right-radius: 5px; }
.vxcc-msg.is-client .vxcc-bubble { background: var(--vxc-surface2); color: var(--vxc-text); border: 1px solid var(--vxc-border); border-bottom-left-radius: 5px; }
.vxcc-meta { font-size: 10.5px; color: var(--vxc-muted); margin-top: 3px; padding: 0 4px; }
.vxcc-typing { display: none; align-items: center; gap: 8px; align-self: flex-start; margin: 6px 0; color: var(--vxc-text3); font-size: 12.5px; }
.vxcc-typing.show { display: flex; }
.vxcc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--vxc-text3); display: inline-block; animation: vxcBlink 1.3s infinite both; }
.vxcc-typing i:nth-child(2){animation-delay:.2s} .vxcc-typing i:nth-child(3){animation-delay:.4s}

.vxcc-compose { border-top: 1px solid var(--vxc-border); background: rgba(6,9,15,.4); padding: 10px 16px 14px; }
.vxcc-canned { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.vxcc-canned button { font-size: 12px; color: var(--vxc-text3); background: rgba(140,170,220,.08); border: 1px solid var(--vxc-border); border-radius: 999px; padding: 5px 11px; cursor: pointer; transition: all .14s ease; }
.vxcc-canned button:hover { background: rgba(47,107,255,.16); color: #bcd2ff; border-color: rgba(47,107,255,.3); }
.vxcc-form { display: none; gap: 10px; align-items: flex-end; }
.vxcc-form.is-ready { display: flex; }
.vxcc-form textarea { flex: 1; resize: none; max-height: 140px; background: var(--vxc-surface); color: var(--vxc-text); border: 1px solid var(--vxc-border2); border-radius: 12px; padding: 11px 13px; font-size: 14px; font-family: inherit; line-height: 1.4; outline: none; }
.vxcc-form textarea:focus { border-color: var(--vxc-accent); box-shadow: 0 0 0 4px rgba(47,107,255,.2); }
.vxcc-form button.send { flex: none; height: 44px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer; background: var(--vxc-grad); color: #fff; font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.vxcc-form button.send:hover { filter: brightness(1.08); }

@media (max-width: 1200px) {
  .vx-chat-console { grid-template-columns: 300px 1fr; }
  .vxcc-details { display: none; }
}
@media (max-width: 860px) {
  .vx-chat-console { grid-template-columns: 1fr; height: auto; }
  .vxcc-list { max-height: 260px; }
  .vxcc-thread { height: 62vh; }
}

/* ============================================================
   Notification bell (topbar)
   ============================================================ */
.vx-bell { position: relative; }
.vx-bell-btn { position: relative; }
.vx-bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; background: #ff4d6d; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 1; display: none; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--vxc-surface); }
@keyframes vxBellRing { 0%,100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-5deg); } }
.vx-bell.vx-bell-ring .vx-bell-btn [data-icon] { display: inline-flex; animation: vxBellRing .8s ease; transform-origin: 50% 4px; }
.vx-bell-panel { position: absolute; right: 0; top: calc(100% + 12px); width: min(360px, calc(100vw - 28px)); background: linear-gradient(180deg, rgba(14,22,38,.99), rgba(8,12,23,.99)); border: 1px solid var(--vxc-border2); border-radius: 16px; overflow: hidden; box-shadow: 0 40px 90px -40px rgba(0,0,0,.9), 0 0 50px -22px rgba(47,107,255,.45); opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .16s ease, transform .16s ease; z-index: 1300; }
.vx-bell.is-open .vx-bell-panel { opacity: 1; transform: none; pointer-events: auto; }
.vx-bell-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--vxc-border); }
.vx-bell-head span { font-size: 14px; font-weight: 700; color: var(--vxc-text); }
.vx-bell-readall { background: none; border: 0; cursor: pointer; font-size: 12px; color: var(--vxc-accent); font-weight: 600; padding: 4px 6px; border-radius: 7px; }
.vx-bell-readall:hover { background: rgba(47,107,255,.12); }
.vx-bell-list { max-height: 380px; overflow-y: auto; }
.vx-bell-empty { padding: 32px 18px; text-align: center; color: var(--vxc-muted); font-size: 13.5px; }
.vx-bell-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid rgba(140,170,220,.06); text-decoration: none; transition: background .14s ease; position: relative; }
.vx-bell-item:hover { background: rgba(47,107,255,.07); }
.vx-bell-item.unread { background: rgba(47,107,255,.1); }
.vx-bell-item.unread::before { content: ""; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--vxc-accent); box-shadow: 0 0 8px var(--vxc-accent); }
.vx-bell-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--vxc-accent); background: rgba(47,107,255,.14); border: 1px solid var(--vxc-border); }
.vx-bell-ico svg { width: 17px; height: 17px; }
.vx-bell-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vx-bell-txt b { font-size: 13.5px; color: var(--vxc-text); font-weight: 650; line-height: 1.3; }
.vx-bell-txt small { font-size: 12.5px; color: var(--vxc-text3); line-height: 1.35; word-break: break-word; }
.vx-bell-txt time { font-size: 11px; color: var(--vxc-muted); margin-top: 1px; }

/* ============================================================
   v9 — widget polish: tidy header, bottom-anchored messages, no self-avatar
   ============================================================ */
.vxchat-head-top > div:not(.vxchat-avatar) { min-width: 0; flex: 1; }
.vxchat-head h4, .vxchat-head p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vxchat-avatar { width: 42px; height: 42px; flex: none; }
/* your own outgoing messages don't need an avatar (cleaner, iMessage-style) */
.vxc-msg.is-me .vxc-ava { display: none; }
.vxc-msg.is-me { max-width: 82%; }

/* textured body so the conversation area never reads as a flat black void */
.vxchat-body {
  background:
    radial-gradient(110% 42% at 50% 0%, rgba(47,107,255,.10), transparent 60%),
    radial-gradient(rgba(140,170,220,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(180deg, #0a1020, #070b14);
}

/* persistent "home" intro at the top of every conversation */
.vxc-home { text-align: center; padding: 20px 16px 4px; animation: vxcMsgIn .3s ease; }
.vxc-home-ava { position: relative; width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 12px; display: grid; place-items: center; font-weight: 800; font-size: 23px; color: #fff; background: var(--vxc-grad); box-shadow: 0 14px 32px -10px rgba(47,107,255,.75); }
.vxc-home-ava .on { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px var(--vxc-surface), 0 0 8px #22c55e; }
.vxc-home-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 750; font-size: 17px; color: var(--vxc-text); }
.vxc-home-sub { font-size: 13px; color: var(--vxc-text3); line-height: 1.55; margin: 6px auto 0; max-width: 270px; }
.vxc-chips.home { justify-content: center; padding: 16px 6px 8px; gap: 8px; }
.vxc-chips.home .vxc-chip { background: rgba(140,170,220,.08); border-color: var(--vxc-border2); color: var(--vxc-text2); }
.vxc-chips.home .vxc-chip:hover { background: rgba(47,107,255,.18); border-color: rgba(47,107,255,.4); color: #cfe0ff; }

/* ============================================================
   v5 — attachments, bot, game, CSAT, presence
   ============================================================ */
/* header game button + away state */
.vxchat-game { position: relative; z-index: 1; width: 32px; height: 32px; border: 0; border-radius: 10px; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; font-size: 15px; display: grid; place-items: center; margin-left: auto; transition: background .15s ease; }
.vxchat-game + .vxchat-close { margin-left: 6px; }
.vxchat-game:hover { background: rgba(255,255,255,.3); }
#vxChatWidget.is-away .vxchat-head p .dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
#vxChatWidget.is-away .vxchat-avatar .on { background: #f59e0b; box-shadow: 0 0 0 2.5px var(--vxc-accent2), 0 0 8px #f59e0b; }

/* attach buttons */
.vxchat-attach, .vxcc-attach { flex: none; width: 42px; height: 42px; border: 1px solid var(--vxc-border2); border-radius: 13px; background: var(--vxc-surface); color: var(--vxc-text3); cursor: pointer; display: grid; place-items: center; transition: all .15s ease; }
.vxchat-attach:hover, .vxcc-attach:hover { color: var(--vxc-accent); border-color: var(--vxc-accent); }
.vxchat-attach.busy { opacity: .5; pointer-events: none; }
.vxchat-attach svg, .vxcc-attach svg { width: 18px; height: 18px; }

/* attachment bubbles */
.vxc-bubble.has-att, .vxcc-bubble.has-att { padding: 4px; background: rgba(140,170,220,.06) !important; border: 1px solid var(--vxc-border) !important; }
.vxc-img, .vxcc-img { display: block; max-width: 220px; max-height: 220px; border-radius: 11px; }
.vxc-file, .vxcc-file { display: inline-block; padding: 8px 12px; color: #bcd2ff; font-size: 13px; text-decoration: none; }
.vxc-file:hover, .vxcc-file:hover { text-decoration: underline; }

/* bot bubble + chips */
.vxc-msg.is-bot .vxc-ava { background: linear-gradient(135deg, #6d5dfc, #22d3ee); }
.vxc-msg.is-bot .vxc-bubble { background: rgba(109,93,252,.12); border-color: rgba(109,93,252,.3); }
.vxc-msg .vxc-bubble a { color: #bcd2ff; }
.vxc-chips.bot { justify-content: flex-start; padding: 8px 0 4px 39px; }

/* mini-game */
.vxchat-body { position: relative; }
.vxc-gamewrap { position: absolute; inset: 0; z-index: 6; overflow: hidden; background: #070b16; }
.vxc-gamewrap canvas { display: block; width: 100%; height: 100%; }
.vxc-game-x { position: absolute; top: 10px; right: 10px; z-index: 7; background: rgba(6,9,15,.72); border: 1px solid var(--vxc-border2); color: var(--vxc-text2); border-radius: 9px; padding: 7px 13px; font-size: 12.5px; cursor: pointer; backdrop-filter: blur(4px); }
.vxc-game-x:hover { background: rgba(255,255,255,.16); color: #fff; }

/* CSAT */
.vxc-csat { align-self: center; text-align: center; margin: 14px 0; background: var(--vxc-surface2); border: 1px solid var(--vxc-border); border-radius: 14px; padding: 14px 18px; max-width: 88%; }
.vxc-csat .t { font-size: 13.5px; color: var(--vxc-text); margin-bottom: 8px; }
.vxc-stars { display: flex; gap: 4px; justify-content: center; }
.vxc-star { background: none; border: 0; font-size: 26px; color: #3a4663; cursor: pointer; transition: color .12s ease, transform .12s ease; line-height: 1; }
.vxc-star:hover, .vxc-star:hover ~ .vxc-star { color: #3a4663; }
.vxc-stars:hover .vxc-star { color: #fbbf24; }
.vxc-stars .vxc-star:hover ~ .vxc-star { color: #3a4663; }

/* admin head actions + online + attachment previews */
.vxcc-head-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.vxcc-online { font-size: 12px; font-weight: 650; color: var(--vxc-muted); }
.vxcc-online::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 7px; vertical-align: middle; }
.vxcc-online.on { color: #5ef08f; }
.vxcc-placeholder .big[data-icon] svg { width: 36px; height: 36px; color: var(--vxc-accent); }
/* hide the native file input — the paperclip is the trigger */
.vxcc-file, .vxchat-file { display: none !important; }

/* status pill in the thread header */
.vxcc-status-pill { flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.vxcc-status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vxcc-status-pill.open { background: rgba(34,197,94,.12); color: #5ef08f; }
.vxcc-status-pill.closed { background: rgba(140,170,220,.12); color: var(--vxc-text3); }
.vxcc-head-info { flex: 1; min-width: 0; }

/* customer details panel */
.vxcc-details { border-left: 1px solid var(--vxc-border); background: linear-gradient(180deg, rgba(8,12,23,.7), rgba(8,12,23,.95)); padding: 22px 18px; overflow-y: auto; }
.vxcc-det-empty { color: var(--vxc-muted); font-size: 13px; text-align: center; margin-top: 40px; }
.vxcc-det { text-align: center; }
.vxcc-det-ava { width: 72px; height: 72px; border-radius: 22px; margin: 4px auto 14px; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: #fff; background: var(--vxc-grad); box-shadow: 0 12px 30px -12px rgba(47,107,255,.7); }
.vxcc-det-ava.guest { background: linear-gradient(135deg, #64748b, #475569); }
.vxcc-det-name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 750; font-size: 18px; color: var(--vxc-text); }
.vxcc-det-tags { display: flex; gap: 6px; justify-content: center; margin: 8px 0 18px; flex-wrap: wrap; }
.vxcc-det-tags span { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; }
.vxcc-det-tags .t-guest { background: rgba(148,163,184,.18); color: #cbd5e1; }
.vxcc-det-tags .t-client { background: rgba(47,107,255,.16); color: #bcd2ff; }
.vxcc-det-meta { text-align: left; margin: 0 0 18px; border-top: 1px solid var(--vxc-border); }
.vxcc-det-meta > div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--vxc-border); }
.vxcc-det-meta dt { color: var(--vxc-muted); font-size: 12.5px; }
.vxcc-det-meta dd { color: var(--vxc-text2); font-size: 12.5px; margin: 0; text-align: right; word-break: break-word; max-width: 160px; }
.vxcc-close { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.32); color: #fca5a5; border-radius: 11px; padding: 11px; font-size: 13px; font-weight: 650; cursor: pointer; transition: background .15s ease; }
.vxcc-close:hover { background: rgba(239,68,68,.2); }
.vxcc-close svg { width: 15px; height: 15px; }
.vxcc-bubble.has-att { padding: 4px; }

/* ---- Public-site header notification bell (reuses .vx-bell-* panel styles) ---- */
.vx-hdr-bell { display: inline-flex; align-items: center; }
.vx-hdr-bell .vx-bell-btn { width: 40px; height: 40px; border-radius: 11px; display: inline-grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: var(--text, #e7ecf5); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
/* Logged-in site header: slightly tighter cluster + 40px icon buttons so the nav never crowds the logo */
.site-header .header-actions { gap: 9px; }
.site-header .header-actions .vx-sys-btn { width: 40px; height: 40px; }
.vx-hdr-bell .vx-bell-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.2); }
.vx-hdr-bell .vx-bell-btn svg { width: 19px; height: 19px; }
.vx-hdr-bell .vx-bell-count { box-shadow: 0 0 0 2px var(--bg, #0a0e1a); }
.vx-bell-empty svg { display: block; width: 26px; height: 26px; margin: 0 auto 8px; opacity: .4; }

/* ---- Admin server-status widget (topbar + site header) ---- */
.vx-sys{position:relative;display:inline-flex;align-items:center}
.vx-sys-btn{position:relative;width:42px;height:42px;border-radius:12px;display:inline-grid;place-items:center;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.12);color:var(--text,#e7ecf5);cursor:pointer;transition:background .15s ease,border-color .15s ease}
.vx-sys-btn:hover{background:rgba(255,255,255,.11);border-color:rgba(255,255,255,.2)}
.vx-sys-btn svg{width:19px;height:19px}
.vx-sys-pulse{position:absolute;top:7px;right:7px;width:7px;height:7px;border-radius:50%;background:#34d399;animation:vxSysPulse 2s infinite}
.vx-sys.warn .vx-sys-pulse{background:#f87171}
@keyframes vxSysPulse{0%{box-shadow:0 0 0 0 rgba(52,211,153,.5)}70%{box-shadow:0 0 0 6px rgba(52,211,153,0)}100%{box-shadow:0 0 0 0 rgba(52,211,153,0)}}
.vx-sys-panel{position:absolute;right:0;top:calc(100% + 12px);width:320px;max-width:calc(100vw - 28px);background:linear-gradient(180deg,#0f1626,#0b1018);border:1px solid rgba(255,255,255,.12);border-radius:16px;box-shadow:0 40px 90px -40px rgba(0,0,0,.9);opacity:0;transform:translateY(-8px) scale(.98);pointer-events:none;transition:opacity .16s ease,transform .16s ease;z-index:1300;overflow:hidden;color:#e7ecf5}
.vx-sys.open .vx-sys-panel{opacity:1;transform:none;pointer-events:auto}
.vx-sys-head{display:flex;align-items:center;gap:9px;padding:13px 16px;font-weight:800;font-size:14px;border-bottom:1px solid rgba(255,255,255,.08)}
.vx-sys-head svg{width:16px;height:16px;opacity:.7}
.vx-sys-host{margin-left:auto;font-size:11.5px;font-weight:600;color:#8b95ad;font-family:ui-monospace,Menlo,Consolas,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:130px}
.vx-sys-body{padding:14px 16px;display:flex;flex-direction:column;gap:13px}
.vx-sys-msg{text-align:center;color:#8b95ad;font-size:13px;padding:16px 0}
.vx-sys-rh{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;margin-bottom:6px}
.vx-sys-rh svg{width:15px;height:15px;color:#8aa0ff}.vx-sys-rh b{margin-left:auto;font-weight:800;font-size:13px}
.vx-sys-bar{height:8px;border-radius:99px;background:rgba(255,255,255,.09);overflow:hidden}
.vx-sys-bar i{display:block;height:100%;border-radius:99px;transition:width .5s ease}
.vx-sys-sub{font-size:11.5px;color:#8b95ad;margin-top:5px}
.vx-sys-up{display:flex;align-items:center;gap:7px;font-size:12px;color:#8b95ad;padding-top:11px;border-top:1px solid rgba(255,255,255,.07)}
.vx-sys-up svg{width:14px;height:14px}
.vx-sys-foot{display:flex;align-items:center;gap:8px;padding:12px 16px;border-top:1px solid rgba(255,255,255,.08);font-size:13px;font-weight:700;color:#7dd3fc;text-decoration:none}
.vx-sys-foot:hover{background:rgba(125,211,252,.08)}.vx-sys-foot svg{width:15px;height:15px}

/* ---- Public-site header Quick-Mail button ---- */
.vx-hm { position: relative; display: inline-flex; align-items: center; }
.vx-hm-btn { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: var(--text, #e7ecf5); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.vx-hm-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.2); }
.vx-hm-btn svg { width: 19px; height: 19px; }
.vx-hm-panel { position: absolute; right: 0; top: calc(100% + 12px); width: 320px; max-width: calc(100vw - 28px); background: linear-gradient(180deg,#0f1626,#0b1018); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; box-shadow: 0 40px 90px -40px rgba(0,0,0,.9); opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .16s ease, transform .16s ease; z-index: 1300; overflow: hidden; color: #e7ecf5; padding: 7px; }
.vx-hm.open .vx-hm-panel { opacity: 1; transform: none; pointer-events: auto; }
.vx-hm-head { display: flex; align-items: center; gap: 9px; padding: 9px 11px 11px; font-weight: 800; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 6px; }
.vx-hm-head svg { width: 16px; height: 16px; opacity: .7; }
.vx-hm-search { display: flex; align-items: center; gap: 8px; margin: 0 4px 7px; padding: 0 11px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; }
.vx-hm-search svg { width: 15px; height: 15px; opacity: .5; }
.vx-hm-search input { flex: 1; background: transparent; border: 0; outline: none; color: inherit; height: 36px; font-size: 13.5px; font-family: inherit; }
.vx-hm-search input:focus, .vx-hm-search input:focus-visible { box-shadow: none !important; outline: none !important; }
.vx-hm-search:focus-within { border-color: rgba(99,102,241,.6); box-shadow: 0 0 0 3px rgba(99,102,241,.09); }
.vx-hm-list { max-height: 230px; overflow-y: auto; margin-bottom: 4px; }
.vx-hm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: inherit; }
.vx-hm-item:hover { background: rgba(99,102,241,.14); }
.vx-hm-av { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #8aa0ff; background: rgba(99,102,241,.16); }
.vx-hm-em { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-hm-msg { padding: 16px; text-align: center; color: #8b95ad; font-size: 12.5px; }
.vx-hm-link { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 11px; color: inherit; text-decoration: none; font-size: 13.5px; font-weight: 600; }
.vx-hm-link:hover { background: rgba(255,255,255,.05); }
.vx-hm-link svg { width: 16px; height: 16px; opacity: .7; }

/* ---- Admin live-visitors widget ---- */
.vx-vis { position: relative; display: inline-flex; align-items: center; }
.vx-vis-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: var(--text, #e7ecf5); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.vx-vis-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.2); }
.vx-vis-btn svg { width: 19px; height: 19px; }
.vx-vis-pulse { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: #6b7280; }
.vx-vis.on .vx-vis-pulse { background: #4ade80; animation: vxVisPulse 2s infinite; }
@keyframes vxVisPulse { 0%{box-shadow:0 0 0 0 rgba(74,222,128,.5)} 70%{box-shadow:0 0 0 6px rgba(74,222,128,0)} 100%{box-shadow:0 0 0 0 rgba(74,222,128,0)} }
.vx-vis-panel { position: absolute; right: 0; top: calc(100% + 12px); width: 312px; max-width: calc(100vw - 28px); background: linear-gradient(180deg,#0f1626,#0b1018); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; box-shadow: 0 40px 90px -40px rgba(0,0,0,.9); opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .16s ease, transform .16s ease; z-index: 1300; overflow: hidden; color: #e7ecf5; }
.vx-vis.open .vx-vis-panel { opacity: 1; transform: none; pointer-events: auto; }
.vx-vis-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px; font-weight: 800; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.vx-vis-head svg { width: 16px; height: 16px; opacity: .7; }
.vx-vis-count { padding: 16px 16px 12px; display: flex; align-items: baseline; gap: 9px; }
.vx-vis-count b { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: #4ade80; line-height: 1; }
.vx-vis-count span { font-size: 12.5px; color: #8b95ad; }
.vx-vis-geo { padding: 4px 16px 12px; }
.vx-vis-st { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #7b859b; margin: 10px 0 7px; }
.vx-vis-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.vx-vis-lbl { font-size: 12.5px; color: #cdd5e6; min-width: 34px; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-vis-track { flex: 1; height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.vx-vis-track i { display: block; height: 100%; border-radius: 99px; background: #003efd; }
.vx-vis-row b { font-size: 12.5px; font-weight: 800; min-width: 16px; text-align: right; }
.vx-vis-msg { padding: 14px; text-align: center; color: #8b95ad; font-size: 12.5px; }
.vx-vis-foot { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #8b95ad; }
.vx-vis-foot svg { width: 14px; height: 14px; }
