.judy-assistant {
  position: absolute;
  right: 52px;
  top: 0;
  width: 280px;
  height: 420px;
  z-index: 99999;
  pointer-events: none;
  will-change: top;

  --judy-video-scale: 1;
  --judy-video-position-x: 50%;
  --judy-video-position-y: 100%;
}

.judy-assistant__bubble {
  position: absolute;
  right: 172px;
  bottom: 168px;
  max-width: 220px;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #333;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  white-space: normal;
  word-break: break-word;
}

.judy-assistant__bubble::after {
  content: '';
  position: absolute;
  right: -7px;
  bottom: 18px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(45deg);
}

.judy-assistant__figure {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 220px;
  height: 380px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: center bottom;
  animation: judyFloat 3.8s ease-in-out infinite;
  transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.18));
  overflow: hidden;
}

.judy-assistant__figure:focus {
  outline: none;
}

.judy-assistant__img,
.judy-assistant__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.judy-assistant__img {
  object-fit: contain;
  object-position: center bottom;
  opacity: 1;
  visibility: visible;
}

.judy-assistant__video {
  object-fit: cover;
  object-position: var(--judy-video-position-x) var(--judy-video-position-y);
  opacity: 0;
  visibility: hidden;
  background: transparent;
  transform-origin: center bottom;
  transform: scale(var(--judy-video-scale));
}

.judy-assistant.is-video .judy-assistant__img {
  opacity: 0;
  visibility: hidden;
}

.judy-assistant.is-video .judy-assistant__video {
  opacity: 1;
  visibility: visible;
}

.judy-assistant.is-speaking .judy-assistant__bubble,
.judy-assistant:hover .judy-assistant__bubble {
  opacity: 1;
  transform: translateY(0);
}

.judy-assistant.is-chat-open .judy-assistant__bubble {
  opacity: 0 !important;
  visibility: hidden;
  transform: translateY(8px);
}

.judy-assistant.is-speaking .judy-assistant__figure,
.judy-assistant:hover .judy-assistant__figure {
  animation: none;
  transform: translateY(-4px) scale(1.01);
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.24));
}

@keyframes judyFloat {
  0% {
    transform: translateY(0) rotate(-0.6deg);
  }
  50% {
    transform: translateY(-8px) rotate(0deg);
  }
  100% {
    transform: translateY(0) rotate(-0.6deg);
  }
}

@media screen and (max-width: 992px) {
  .judy-assistant {
    display: none !important;
  }
}