/* Chat to support team — OS-level FAB. AI FABs stack above this reserved slot. */

#os {
  --ops-support-fab-size: 56px;
  --ops-support-fab-gap: 12px;
  --ops-support-fab-right: 20px;
  --ops-support-fab-bottom: calc(var(--taskbar-clearance, var(--taskbar-h, 48px)) + 16px);
  --ops-support-fab-clearance: calc(var(--ops-support-fab-size) + var(--ops-support-fab-gap));
}

.ops-support-fab {
  position: fixed;
  right: var(--ops-support-fab-right);
  bottom: var(--ops-support-fab-bottom);
  z-index: 10040;
  width: var(--ops-support-fab-size);
  height: var(--ops-support-fab-size);
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, #0ea5e9, #2563eb);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.42);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ops-support-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.5);
}

.ops-support-fab:active {
  transform: scale(0.96);
}

.ops-support-fab-icon {
  font-size: 26px;
  line-height: 1;
}

.ops-support-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  box-sizing: border-box;
  border: 2px solid var(--surface, #fff);
  display: none;
  align-items: center;
  justify-content: center;
}

.ops-support-fab.has-unread .ops-support-fab-badge {
  display: flex;
}

.ops-support-fab.has-unread {
  animation: ops-support-fab-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.38), 0 8px 24px rgba(37, 99, 235, 0.42);
}

@keyframes ops-support-fab-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.38), 0 8px 24px rgba(37, 99, 235, 0.42); }
  50% { box-shadow: 0 0 0 7px rgba(225, 29, 72, 0.12), 0 8px 24px rgba(37, 99, 235, 0.42); }
}

#os.shell-mobile .ops-support-fab {
  right: 16px;
  bottom: calc(var(--ios-tab-h, 49px) + 16px + var(--ops-support-fab-clearance));
  touch-action: manipulation;
}

/* Desktop: Ask BioStudio (when it is a float, not in the taskbar) sits above support. */
.os-ai-fab-float {
  bottom: calc(var(--taskbar-h, 48px) + 16px + var(--ops-support-fab-clearance, 68px));
}

/* Mobile: OS AI keeps the lowest-right slot; support is already stacked above it. */
#os.shell-mobile .os-ai-fab-float {
  bottom: calc(var(--ios-tab-h, 49px) + 16px) !important;
  right: 16px;
}

/* In-app AI FABs sit above the OS support overlay so neither covers the other.
   Studio AI is raised one extra diameter so it clears the support slot. */
#os:not(.shell-mobile) .studio-ai-fab {
  bottom: calc(20px + var(--studio-ai-fab-size, 48px) + var(--ops-support-fab-clearance, 68px));
}
#os:not(.shell-mobile) .eln-ai-fab,
#os:not(.shell-mobile) .org-ai-fab,
#os:not(.shell-mobile) .ad-ai-fab,
#os:not(.shell-mobile) .graph-studio-ai-fab,
#os:not(.shell-mobile) .ps-ai-fab,
#os:not(.shell-mobile) .rs-ai-fab,
#os:not(.shell-mobile) .xl-ai-fab {
  bottom: calc(20px + var(--ops-support-fab-clearance, 68px));
}

#os:not(.shell-mobile) .xl-ai-fab,
#os:not(.shell-mobile) .graph-studio-ai-fab {
  bottom: calc(44px + var(--ops-support-fab-clearance, 68px));
}

/* Viewport-fixed AI FABs (Flow / MSD append to document.body). */
.fs-ai-fab,
.msd-ai-fab {
  right: var(--ops-support-fab-right, 20px) !important;
  bottom: calc(var(--ops-support-fab-bottom, 64px) + var(--ops-support-fab-clearance, 68px)) !important;
  z-index: 10030 !important;
}

@media (prefers-reduced-motion: reduce) {
  .ops-support-fab.has-unread { animation: none; }
}
