#supportChatRoot{
  position:fixed;
  inset:auto 0 0 auto;
  z-index:250;
  font-family:'Golos Text',Inter,Arial,sans-serif;
  color:#f6f2ff;
  pointer-events:none;
}
#supportChatRoot:not(.is-ready){
  display:none;
}
#supportChatBubble,
#supportChatPanel{
  pointer-events:auto;
}
#supportChatBubble{
  position:fixed;
  right:24px;
  bottom:24px;
  width:58px;
  height:58px;
  border:1px solid rgba(91,213,255,.52);
  border-radius:50%;
  background:radial-gradient(circle at 30% 24%, rgba(255,73,184,.9), rgba(124,92,255,.88) 38%, rgba(12,10,20,.96) 72%);
  box-shadow:0 12px 34px rgba(0,0,0,.42),0 0 26px rgba(48,224,238,.28);
  color:#fff;
  cursor:pointer;
  display:grid;
  place-items:center;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
#supportChatBubble:hover{
  transform:translateY(-2px);
  border-color:rgba(255,73,184,.75);
  box-shadow:0 16px 40px rgba(0,0,0,.48),0 0 30px rgba(255,73,184,.22);
}
#supportChatBubble svg{
  width:28px;
  height:28px;
}

#supportChatPanel{
  position:fixed;
  right:24px;
  bottom:92px;
  width:min(378px,calc(100vw - 32px));
  height:min(560px,calc(100vh - 120px));
  display:none;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(124,92,255,.42);
  border-radius:18px;
  background:linear-gradient(145deg,rgba(18,14,31,.98),rgba(33,19,55,.98));
  box-shadow:0 24px 60px rgba(0,0,0,.5),0 0 38px rgba(124,92,255,.22);
}
#supportChatRoot.is-open #supportChatPanel{
  display:flex;
}

/* ---------- Header ---------- */
.support-chat-head{
  position:relative;
  flex:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.02);
}
.support-chat-head::after{
  content:'';
  position:absolute;
  left:0;right:0;bottom:-1px;
  height:2px;
  background:linear-gradient(90deg,#35e8f5,#7c5cff,#ff4fb4,#35e8f5);
  background-size:200% 100%;
  animation:supportChatShimmer 3.5s linear infinite;
}
@keyframes supportChatShimmer{
  0%{background-position:0% 50%}
  100%{background-position:200% 50%}
}
@keyframes supportChatPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(52,211,153,.55)}
  70%{box-shadow:0 0 0 6px rgba(52,211,153,0)}
}
@media (prefers-reduced-motion: reduce){
  .support-chat-head::after{animation:none}
  .support-chat-online-dot{animation:none}
}
.support-chat-title{
  display:grid;
  gap:2px;
}
.support-chat-title b{
  font-family:'Unbounded',sans-serif;
  font-size:14px;
  line-height:1.2;
  display:flex;
  align-items:center;
  gap:7px;
}
.support-chat-online-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#34d399;
  animation:supportChatPulse 2s infinite;
  flex:none;
}
.support-chat-title span{
  color:#a99fc4;
  font-size:11px;
}
.support-chat-close{
  width:30px;
  height:30px;
  flex:none;
  border:1px solid rgba(255,255,255,.12);
  border-radius:9px;
  background:rgba(255,255,255,.04);
  color:#d9d2f2;
  cursor:pointer;
  font-size:18px;
  line-height:1;
}
.support-chat-close:hover{
  border-color:rgba(255,73,184,.42);
  color:#fff;
}

/* ---------- Messages ---------- */
.support-chat-messages{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow-y:auto;
  padding:14px;
  scrollbar-width:thin;
  scrollbar-color:rgba(124,92,255,.55) transparent;
}
.support-chat-messages::-webkit-scrollbar{
  width:6px;
}
.support-chat-messages::-webkit-scrollbar-track{
  background:transparent;
}
.support-chat-messages::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg,#35e8f5,#7c5cff);
  border-radius:999px;
}

.support-chat-row{
  display:flex;
  gap:8px;
  max-width:88%;
}
.support-chat-row.user{
  align-self:flex-end;
  flex-direction:row-reverse;
}
.support-chat-avatar{
  width:24px;
  height:24px;
  flex:none;
  border-radius:7px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  background:linear-gradient(135deg,#35e8f5,#7c5cff);
}
.support-chat-avatar.mod{
  background:linear-gradient(135deg,#e3b341,#c98a1f);
}
.support-chat-row.user .support-chat-avatar{
  background:linear-gradient(135deg,#7c5cff,#ff4fb4);
}
.support-chat-bubble{
  padding:9px 11px;
  border-radius:12px;
  font-size:12.5px;
  line-height:1.45;
  color:#f8f5ff;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(53,232,245,.18);
  overflow-wrap:anywhere;
}
.support-chat-row.user .support-chat-bubble{
  background:linear-gradient(135deg,rgba(124,92,255,.5),rgba(255,79,180,.28));
  border-color:rgba(124,92,255,.35);
}
.support-chat-row.mod .support-chat-bubble{
  border-color:rgba(227,179,65,.35);
  background:rgba(227,179,65,.08);
}
.support-chat-time{
  display:block;
  margin-top:3px;
  font-family:'IBM Plex Mono',Consolas,monospace;
  font-size:9px;
  color:#8d84b8;
}
.support-chat-system{
  align-self:center;
  font-size:10.5px;
  color:#8d84b8;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  padding:5px 10px;
  border-radius:999px;
}

.support-chat-attachment{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:6px;
  padding:6px 9px;
  border-radius:8px;
  border:1px solid rgba(53,232,245,.28);
  background:rgba(53,232,245,.08);
  color:#9be9f0;
  font-size:11px;
  text-decoration:none;
}
.support-chat-attachment:hover{
  border-color:rgba(53,232,245,.55);
}

/* ---------- Status ---------- */
.support-chat-status{
  flex:none;
  min-height:16px;
  padding:0 14px;
  color:#a99fc4;
  font-size:11px;
}
.support-chat-status.is-error{
  color:#ff9aaa;
}
.support-chat-status:empty{
  padding:0;
  min-height:0;
}

/* ---------- Attachment preview chip ---------- */
.support-chat-attach-preview{
  display:none;
  align-items:center;
  gap:8px;
  margin:0 12px 8px;
  padding:6px 8px;
  border-radius:10px;
  border:1px solid rgba(53,232,245,.3);
  background:rgba(53,232,245,.08);
  font-size:11px;
  color:#9be9f0;
}
.support-chat-attach-preview.is-visible{
  display:flex;
}
.support-chat-attach-preview .support-chat-attach-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.support-chat-attach-preview button{
  margin-left:auto;
  border:none;
  background:transparent;
  color:#8d84b8;
  cursor:pointer;
  font-size:14px;
  flex:none;
}
.support-chat-attach-preview button:hover{
  color:#ff9aaa;
}

/* ---------- Input row ---------- */
.support-chat-form{
  flex:none;
  padding:8px 12px 10px;
}
.support-chat-inputwrap{
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(124,92,255,.35);
  border-radius:16px;
  background:#0c0915;
  padding:5px 5px 5px 4px;
  transition:border-color .2s ease,box-shadow .2s ease;
}
.support-chat-inputwrap:focus-within{
  border-color:rgba(53,232,245,.75);
  box-shadow:0 0 0 3px rgba(53,232,245,.12);
}
.support-chat-attach{
  width:32px;
  height:32px;
  flex:none;
  border-radius:50%;
  border:1px solid rgba(53,232,245,.52);
  background:
    radial-gradient(circle at 35% 28%,rgba(255,255,255,.22),transparent 32%),
    linear-gradient(135deg,rgba(53,232,245,.1),rgba(124,92,255,.16));
  color:#dffcff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 0 14px rgba(53,232,245,.18),inset 0 0 12px rgba(124,92,255,.12);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,color .18s ease,background .18s ease;
}
.support-chat-attach:hover{
  color:#fff;
  border-color:rgba(255,73,184,.76);
  background:
    radial-gradient(circle at 35% 28%,rgba(255,255,255,.28),transparent 34%),
    linear-gradient(135deg,rgba(53,232,245,.16),rgba(255,73,184,.18));
  box-shadow:0 0 18px rgba(53,232,245,.26),0 0 18px rgba(255,73,184,.12),inset 0 0 14px rgba(124,92,255,.18);
  transform:translateY(-1px);
}
.support-chat-attach.has-file{
  color:#eafffb;
  border-color:rgba(52,211,153,.72);
  box-shadow:0 0 18px rgba(52,211,153,.26),inset 0 0 14px rgba(53,232,245,.14);
}
.support-chat-attach:disabled{
  cursor:default;
  opacity:.55;
  transform:none;
  box-shadow:inset 0 0 10px rgba(124,92,255,.1);
}
.support-chat-attach svg{
  display:block;
  transform:translateX(1px);
}
.support-chat-input{
  flex:1;
  min-width:0;
  border:none;
  background:transparent;
  color:#fff;
  font:inherit;
  font-size:13px;
  padding:8px 2px;
}
.support-chat-input::placeholder{
  color:rgba(218,210,244,.42);
}
.support-chat-input:focus{
  outline:none;
}
.support-chat-send{
  width:32px;
  height:32px;
  flex:none;
  border-radius:50%;
  border:1px solid rgba(53,232,245,.68);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#35e8f5,#7c5cff);
  color:#fff;
  box-shadow:0 0 18px rgba(53,232,245,.34),0 0 16px rgba(124,92,255,.2),inset 0 1px 0 rgba(255,255,255,.22);
  transition:transform .18s ease,filter .18s ease,box-shadow .18s ease,border-color .18s ease;
  animation:supportChatButtonGlow 3.4s ease-in-out infinite;
}
.support-chat-send:hover{
  filter:brightness(1.1);
  border-color:rgba(255,73,184,.76);
  box-shadow:0 0 22px rgba(53,232,245,.42),0 0 20px rgba(255,73,184,.18),inset 0 1px 0 rgba(255,255,255,.28);
  transform:translateY(-1px);
}
.support-chat-send:disabled{
  cursor:default;
  opacity:.55;
  filter:none;
  transform:none;
  animation:none;
}
.support-chat-send svg{
  display:block;
  transform:translateY(-1px);
}

@keyframes supportChatButtonGlow{
  0%,100%{box-shadow:0 0 16px rgba(53,232,245,.28),0 0 14px rgba(124,92,255,.16),inset 0 1px 0 rgba(255,255,255,.2);}
  50%{box-shadow:0 0 22px rgba(53,232,245,.42),0 0 20px rgba(255,73,184,.18),inset 0 1px 0 rgba(255,255,255,.26);}
}

@media (max-width:640px){
  #supportChatBubble{
    right:16px;
    bottom:16px;
  }
  #supportChatPanel{
    right:16px;
    bottom:84px;
    width:calc(100vw - 32px);
    height:min(70vh,520px);
  }
}
