.inv360-wa {
  position: fixed;
  z-index: 99990;
  right: 18px;
  bottom: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.inv360-wa-bubble {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  animation: inv360-wa-attention 2.4s ease-in-out infinite;
}

.inv360-wa-bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45);
  animation: inv360-wa-ring 2.4s ease-out infinite;
  pointer-events: none;
}

.inv360-wa.is-open .inv360-wa-bubble,
.inv360-wa.is-open .inv360-wa-bubble::before {
  animation: none;
}

.inv360-wa-bubble:hover {
  background: #1ebe57;
}

.inv360-wa-bubble svg {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.inv360-wa-bubble-label {
  display: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.inv360-wa-bubble--pill,
.inv360-wa-bubble--pill-text {
  width: auto;
  min-height: 52px;
  height: 52px;
  padding: 0 18px 0 16px;
  border-radius: 999px;
  gap: 10px;
}

.inv360-wa-bubble--pill svg {
  width: 26px;
  height: 26px;
}

.inv360-wa-bubble--pill .inv360-wa-bubble-label,
.inv360-wa-bubble--pill-text .inv360-wa-bubble-label {
  display: inline;
}

.inv360-wa-bubble--pill-text {
  padding: 0 22px;
}

@keyframes inv360-wa-attention {
  0%,
  70%,
  100% {
    transform: translateY(0) scale(1);
  }
  78% {
    transform: translateY(-4px) scale(1.04);
  }
  86% {
    transform: translateY(0) scale(1);
  }
  92% {
    transform: translateY(-2px) scale(1.02);
  }
}

@keyframes inv360-wa-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    opacity: 1;
  }
  70%,
  100% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inv360-wa-bubble,
  .inv360-wa-bubble::before {
    animation: none;
  }
}

.inv360-wa-panel {
  display: none;
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(340px, calc(100vw - 24px));
  height: min(460px, calc(100vh - 110px));
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: #efeae2;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.inv360-wa.is-open .inv360-wa-panel {
  display: flex;
}

.inv360-wa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: #075e54;
  color: #fff;
}

.inv360-wa-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.inv360-wa-avatar,
.inv360-wa-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.2);
}

.inv360-wa-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.inv360-wa-meta {
  min-width: 0;
  flex: 1;
}

.inv360-wa-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv360-wa-status {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

.inv360-wa-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 16px;
  background-color: #e5ddd5;
  background-image: var(--inv360-wa-chat-bg, url(chat-bg.jpg));
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.inv360-wa-msg {
  position: relative;
  max-width: 82%;
  margin: 0 0 8px;
  padding: 6px 8px 4px 9px;
  border-radius: 7.5px;
  border-top-left-radius: 0;
  background: #fff;
  color: #111b21;
  font-size: 14.2px;
  line-height: 1.4;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  white-space: pre-wrap;
  word-break: break-word;
}

.inv360-wa-msg::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0;
  width: 8px;
  height: 13px;
  background: #fff;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.inv360-wa-time {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #667781;
  text-align: right;
}

.inv360-wa-typing {
  display: none;
  width: 54px;
  padding: 10px 12px;
  border-radius: 7.5px;
  border-top-left-radius: 0;
  background: #fff;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.inv360-wa-typing.is-on {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.inv360-wa-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa3a8;
  animation: inv360-wa-dot 1.1s infinite ease-in-out;
}

.inv360-wa-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.inv360-wa-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes inv360-wa-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.inv360-wa-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px 8px 8px;
  background: #f0f2f5;
}

.inv360-wa-input {
  flex: 1;
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 21px;
  background: #fff;
  color: #111b21;
  font: inherit;
  font-size: 15px;
  line-height: 42px;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.inv360-wa-input::placeholder {
  color: #8696a0;
}

.inv360-wa-input:focus {
  outline: none;
}

.inv360-wa-send {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inv360-wa-send:hover {
  background: #1ebe57;
}

.inv360-wa-send svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

@media (max-width: 480px) {
  .inv360-wa {
    right: 12px;
    bottom: 12px;
  }

  .inv360-wa-bubble--pill .inv360-wa-bubble-label,
  .inv360-wa-bubble--pill-text .inv360-wa-bubble-label {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
