/* Zhenya AI orb — shared CRM + tpk-vesta.ru */

.vst-zhenya-orb,
.pw-ai-orb {
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
  background: radial-gradient(circle at 42% 36%, #1a4a7a 0%, #0c2a52 46%, #061428 78%);
  box-shadow:
    0 0 0 1px rgba(88, 158, 210, 0.24) inset,
    0 4px 16px rgba(6, 36, 81, 0.28),
    var(--vst-zhenya-orb-glow, 0 0 22px rgba(88, 158, 210, 0.28));
  transition: box-shadow 2.2s ease, filter 2.2s ease;
}

/* Реакции — только свечение, размер круга не меняется */
.vst-zhenya-orb[data-vst-zhenya-orb-mood="active"],
.vst-zhenya-orb[data-pw-ai-orb-mood="active"],
.pw-ai-orb[data-pw-ai-orb-mood="active"] {
  box-shadow:
    0 0 0 1px rgba(42, 90, 158, 0.26) inset,
    0 4px 16px rgba(6, 36, 81, 0.24),
    0 0 24px rgba(88, 158, 210, 0.38);
}

.vst-zhenya-orb[data-vst-zhenya-orb-mood="speaking"],
.vst-zhenya-orb[data-pw-ai-orb-mood="speaking"],
.pw-ai-orb[data-pw-ai-orb-mood="speaking"] {
  box-shadow:
    0 0 0 1px rgba(255, 183, 0, 0.22) inset,
    0 4px 16px rgba(6, 36, 81, 0.24),
    0 0 28px rgba(255, 183, 0, 0.42);
}

.vst-zhenya-orb[data-vst-zhenya-orb-mood="error"],
.vst-zhenya-orb[data-pw-ai-orb-mood="error"],
.pw-ai-orb[data-pw-ai-orb-mood="error"] {
  box-shadow:
    0 0 0 1px rgba(24, 60, 115, 0.2) inset,
    0 4px 14px rgba(6, 36, 81, 0.2),
    0 0 12px rgba(24, 60, 115, 0.2);
  filter: brightness(0.88);
}

.vst-zhenya-orb--xs {
  width: 16px;
  height: 16px;
}

.vst-zhenya-orb--sm {
  width: 28px;
  height: 28px;
}

.vst-zhenya-orb--md {
  width: 36px;
  height: 36px;
}

.vst-zhenya-orb--lg {
  width: min(100%, 199px);
  aspect-ratio: 1 / 1;
  height: auto;
}

.vst-zhenya-orb__canvas,
.pw-ai-orb__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* CSS-only mini orb (buttons, dynamic invoice icons) */
.vst-zhenya-orb--static {
  background:
    radial-gradient(ellipse 80% 45% at 50% 52%, rgba(255, 183, 0, 0.62) 0%, rgba(255, 183, 0, 0) 55%),
    radial-gradient(ellipse 70% 40% at 42% 48%, rgba(88, 158, 210, 0.58) 0%, rgba(88, 158, 210, 0) 50%),
    radial-gradient(circle at 50% 50%, #1a4a7a 0%, #061428 72%);
  animation: vst-zhenya-orb-static-pulse 3.6s ease-in-out infinite;
}

.vst-zhenya-orb--static[data-vst-zhenya-orb-mood="active"] {
  animation-duration: 1.8s;
}

.vst-zhenya-orb--static[data-vst-zhenya-orb-mood="speaking"] {
  box-shadow:
    0 0 0 1px rgba(255, 183, 0, 0.2) inset,
    0 0 14px rgba(255, 183, 0, 0.42);
}

@keyframes vst-zhenya-orb-static-pulse {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vst-zhenya-orb,
  .pw-ai-orb {
    transition: none;
    filter: none !important;
  }

  .vst-zhenya-orb--static {
    animation: none;
  }
}

/* Assistant page — large orb in sidebar */
.asst-page .asst-avatar.vst-zhenya-orb {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* Topbar */
#default-navbar .nav-jenya .jenya-avatar {
  border-radius: 50%;
}

#default-navbar .nav-jenya .jenya-avatar .vst-zhenya-orb {
  width: 100%;
  height: 100%;
}

/* Tab trigger avatar */
.project-jenya-assistant__avatar.vst-zhenya-orb {
  border: 2px solid rgba(7, 36, 81, 0.18);
  box-shadow: 0 1px 4px rgba(7, 36, 81, 0.1);
  transition: box-shadow 0.18s ease;
}

#project-tabs.project-tabs-with-assistant:hover .project-jenya-assistant__avatar,
#project-tabs.project-tabs-with-assistant:focus-within .project-jenya-assistant__avatar,
#lead-view-tabs.lead-tabs-with-assistant:hover .project-jenya-assistant__avatar,
#lead-view-tabs.lead-tabs-with-assistant:focus-within .project-jenya-assistant__avatar,
#lead-project-view-tabs.lead-tabs-with-assistant:hover .project-jenya-assistant__avatar,
#lead-project-view-tabs.lead-tabs-with-assistant:focus-within .project-jenya-assistant__avatar,
#claim-view-tabs.lead-tabs-with-assistant:hover .project-jenya-assistant__avatar,
#claim-view-tabs.lead-tabs-with-assistant:focus-within .project-jenya-assistant__avatar,
.kb-article-view-header.lead-tabs-with-assistant:hover .project-jenya-assistant__avatar,
.kb-article-view-header.lead-tabs-with-assistant:focus-within .project-jenya-assistant__avatar {
  box-shadow: 0 3px 10px rgba(7, 36, 81, 0.18);
}

/* Project description toolbar */
.project-description-assistant-avatar.vst-zhenya-orb,
.lead-stage1-info-card .project-description-assistant-avatar.vst-zhenya-orb {
  width: 1.75rem;
  height: 1.75rem;
}

/* Invoice AI magic inline icon */
.ai-magic-icon.vst-zhenya-orb {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  width: 24px;
  height: 24px;
}

#recognize-pdf-btn .vst-zhenya-orb {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}
