/* Mini chat suporte — visual aprimorado, canto direito */
.vita-support-chat {
  position: fixed;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(96px, calc(84px + env(safe-area-inset-bottom)));
  width: min(300px, calc(100vw - 20px));
  height: min(380px, calc(100vh - 130px));
  background: linear-gradient(180deg, #1a0d32 0%, #0d0618 100%);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08);
  z-index: 12060;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.vita-support-chat.is-open {
  display: flex;
  animation: vitaChatIn .22s ease;
}
@keyframes vitaChatIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.vita-support-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  background: linear-gradient(105deg, #4c1d95 0%, #7c3aed 55%, #2aabee 140%);
}
.vita-support-chat-head-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.vita-support-chat-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
  overflow: hidden;
}
.vita-support-chat-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.vita-support-chat-avatar i {
  position: relative;
  z-index: 0;
}
.vita-support-chat-head .vita-online-dot.is-typing {
  animation: vitaDotPulse 1s ease infinite;
}
@keyframes vitaDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.vita-support-chat-head strong {
  display: block;
  font-size: 13px;
  letter-spacing: .2px;
}
.vita-support-chat-head small {
  display: block;
  font-size: 10px;
  opacity: .9;
  margin-top: 1px;
}
.vita-support-chat-head .vita-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 4px;
  box-shadow: 0 0 0 2px rgba(74,222,128,.25);
}
.vita-support-chat-head button {
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}
.vita-support-chat-msgs {
  flex: 1;
  overflow: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(42,171,238,.12), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(124,58,237,.18), transparent 35%),
    #0d0618;
}
.vita-support-chat-empty {
  margin: auto;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  padding: 16px;
  line-height: 1.45;
}
.vita-support-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
  align-self: flex-start;
}
.vita-support-msg.is-user {
  align-self: flex-end;
  align-items: flex-end;
}
.vita-support-msg.is-admin {
  align-items: flex-start;
}
.vita-support-msg-top {
  display: flex;
  align-items: center;
  gap: 7px;
}
.vita-support-msg.is-user .vita-support-msg-top {
  flex-direction: row-reverse;
}
.vita-support-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
}
.vita-support-msg.is-user .vita-support-msg-avatar {
  background: linear-gradient(145deg, #5b21b6, #2AABEE);
  padding: 5px;
  box-sizing: border-box;
}
.vita-support-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vita-support-msg.is-user .vita-support-msg-avatar img {
  object-fit: contain;
}
.vita-support-msg-name {
  font-size: 11px;
  font-weight: 700;
  opacity: .88;
  letter-spacing: .2px;
  line-height: 1;
}
.vita-support-bubble {
  max-width: 100%;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  margin-left: 37px;
}
.vita-support-msg.is-user .vita-support-bubble {
  margin-left: 0;
  margin-right: 37px;
}
.vita-support-bubble time {
  display: block;
  font-size: 9px;
  opacity: .65;
  margin-top: 4px;
}
.vita-support-bubble.is-user {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border-bottom-right-radius: 5px;
}
.vita-support-bubble.is-admin {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.08);
  border-bottom-left-radius: 5px;
}
.vita-support-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.08);
  margin-left: 37px;
}
.vita-support-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  animation: vitaTypingDot 1.1s ease infinite;
}
.vita-support-typing span:nth-child(2) { animation-delay: .15s; }
.vita-support-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes vitaTypingDot {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-3px); opacity: 1; }
}
.vita-support-name-gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.vita-support-name-hint {
  margin: 0 0 0 37px;
  font-size: 11px;
  color: rgba(255,255,255,.5);
}
.vita-support-chat-form {
  display: flex;
  gap: 7px;
  padding: 9px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(22,11,40,.95);
}
.vita-support-chat-form input {
  flex: 1;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.vita-support-chat-form input:focus {
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 0 0 3px rgba(124,58,237,.18);
}
.vita-support-chat-form input::placeholder {
  color: rgba(255,255,255,.42);
}
.vita-support-chat-form button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2AABEE, #7c3aed);
  color: #fff;
  min-width: 42px;
  height: 40px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(42,171,238,.25);
}

body.vita-clone .vita-support-chat,
body.home-ref .vita-support-chat,
body.has-ref-header .vita-support-chat {
  right: max(6px, calc(50% - var(--phone-half, 210px) + 6px));
  left: auto;
  width: 280px;
  height: 360px;
}
@media (max-width: 515px) {
  body.vita-clone .vita-support-chat,
  body.home-ref .vita-support-chat,
  body.has-ref-header .vita-support-chat {
    right: 8px;
    left: auto;
    width: min(290px, calc(100vw - 16px));
    height: min(360px, calc(100vh - 120px));
  }
}

/* FABs: normal = 1 ícone; hover/touch = 2 lado a lado (mais à direita) */
.vita-fab-stack {
  position: fixed;
  right: max(6px, calc(50% - 248px + 6px));
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  width: 96px;
  height: 96px;
  z-index: 10001;
  transition: width .28s ease, right .28s ease;
}
.vita-fab-stack.is-expanded {
  width: 192px;
  right: max(4px, calc(50% - 248px + 2px));
}
.vita-fab-stack .vita-tg-fab,
.vita-fab-stack .vita-chat-fab {
  position: absolute;
  top: 0;
  width: 96px;
  margin: 0;
  right: auto;
  bottom: auto;
  opacity: 0;
  pointer-events: none;
  transform: scale(.9);
  transition: opacity .35s ease, transform .35s ease, left .28s ease;
  left: 0;
}
.vita-fab-stack .vita-tg-fab.is-visible,
.vita-fab-stack .vita-chat-fab.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
/* Expandido: Chat à esquerda (primeiro), Telegram à direita */
.vita-fab-stack.is-expanded .vita-tg-fab,
.vita-fab-stack.is-expanded .vita-chat-fab {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.vita-fab-stack.is-expanded .vita-chat-fab {
  left: 0;
}
.vita-fab-stack.is-expanded .vita-tg-fab {
  left: 96px;
}
.vita-chat-fab {
  text-decoration: none;
  color: #fff;
  text-align: center;
  background: transparent;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.45));
  cursor: pointer;
  border: 0;
  padding: 0;
  display: block;
}
.vita-chat-fab img {
  width: 88px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  image-rendering: auto;
}
.vita-fab-stack .vita-tg-fab img,
.vita-fab-stack .vita-chat-fab img {
  width: 88px;
  height: auto;
  object-fit: contain;
}
.vita-chat-fab-fallback {
  display: none;
  width: 56px;
  height: 56px;
  margin: 8px auto 0;
  border-radius: 16px;
  background: linear-gradient(145deg, #2AABEE, #1a8bc7);
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
}
.vita-chat-fab img[style*="display: none"] + .vita-chat-fab-fallback {
  display: flex;
}
