.myugc-chat-trigger {
  --chat-size: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  width: var(--chat-size);
  height: var(--chat-size);
  margin: 0;
  padding: 0;
  border: 1.5px solid rgba(247, 239, 255, 0.72);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 58%, #5b21b6 100%);
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.45);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.myugc-chat-trigger:hover,
.myugc-chat-trigger[aria-expanded="true"] {
  background: linear-gradient(135deg, #9b70ff 0%, #7c3aed 60%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.62);
}

.myugc-chat-trigger:focus-visible {
  outline: 2px solid #d9baff;
  outline-offset: 3px;
}

.myugc-chat-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.myugc-chat-trigger[aria-busy="true"] > *,
.myugc-chat-trigger[data-chat-error] > * {
  visibility: hidden;
}

.myugc-chat-trigger[aria-busy="true"]::after,
.myugc-chat-trigger[data-chat-error]::after {
  position: absolute;
  pointer-events: none;
}

.myugc-chat-trigger[aria-busy="true"]::after {
  content: "";
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: myugc-chat-spin 0.8s linear infinite;
}

.myugc-chat-trigger[data-chat-error]::after {
  content: "!";
  font-weight: 700;
}

@keyframes myugc-chat-spin {
  to { transform: rotate(360deg); }
}

@keyframes myugc-chat-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.55), 0 4px 16px rgba(109, 40, 217, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(167, 139, 250, 0), 0 6px 20px rgba(139, 92, 246, 0.58);
  }
}

@keyframes myugc-chat-bob {
  0%, 78%, 100% { transform: translateY(0) rotate(0deg); }
  84% { transform: translateY(-2px) rotate(-8deg); }
  90% { transform: translateY(0) rotate(6deg); }
  95% { transform: translateY(-1px) rotate(-3deg); }
}

@keyframes myugc-chat-dot-ping {
  0% { transform: scale(1); opacity: 0.9; }
  75%, 100% { transform: scale(2.4); opacity: 0; }
}

@keyframes myugc-chat-shimmer {
  0%, 72% { transform: translateX(-140%) skewX(-18deg); }
  100% { transform: translateX(260%) skewX(-18deg); }
}

/* Lively animated "Ask me" pill trigger in header at every viewport width */
html body #landing-header .myugc-header-chat[data-myugc-chat],
.myugc-chat-trigger.myugc-legacy-header-chat {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  width: auto;
  height: 40px;
  padding: 0 14px 0 11px;
  border-width: 1.5px;
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  animation: myugc-chat-pulse 2.8s ease-in-out infinite;
}

html body #landing-header .myugc-header-chat[data-myugc-chat]::before,
.myugc-chat-trigger.myugc-legacy-header-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
  animation: myugc-chat-shimmer 4.6s ease-in-out infinite;
}

html body #landing-header .myugc-header-chat[data-myugc-chat][aria-expanded="true"],
.myugc-chat-trigger.myugc-legacy-header-chat[aria-expanded="true"] {
  animation: none;
}

.myugc-chat-trigger .myugc-chat-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.myugc-chat-trigger .myugc-chat-icon-wrap svg {
  width: 18px;
  height: 18px;
  animation: myugc-chat-bob 3.6s ease-in-out infinite;
}

.myugc-chat-trigger .myugc-chat-dot {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 1.5px #6d28d9;
}

.myugc-chat-trigger .myugc-chat-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #34d399;
  animation: myugc-chat-dot-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.myugc-chat-trigger .myugc-chat-text {
  position: relative;
  z-index: 1;
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .myugc-chat-trigger[aria-busy="true"]::after,
  html body #landing-header .myugc-header-chat[data-myugc-chat],
  .myugc-chat-trigger.myugc-legacy-header-chat,
  html body #landing-header .myugc-header-chat[data-myugc-chat]::before,
  .myugc-chat-trigger.myugc-legacy-header-chat::before,
  .myugc-chat-trigger .myugc-chat-icon-wrap svg,
  .myugc-chat-trigger .myugc-chat-dot::after {
    animation: none !important;
  }
}

.myugc-legacy-chat-header {
  display: flex;
  justify-content: flex-end;
  padding: 8px clamp(12px, 4vw, 32px);
}

.myugc-floating-chat,
#airep24-web-widget .ar24-launcher,
#airep24-web-widget button.ar24-compact {
  display: none !important;
}

@media (max-width: 700px) {
  html body #landing-header .myugc-header-chat[data-myugc-chat],
  .myugc-chat-trigger.myugc-legacy-header-chat {
    height: 38px;
    padding: 0 10px 0 9px;
    gap: 5px;
    font-size: 12px;
  }
  .myugc-chat-trigger .myugc-chat-icon-wrap svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 390px) {
  html body #landing-header .myugc-header-chat[data-myugc-chat],
  .myugc-chat-trigger.myugc-legacy-header-chat {
    padding: 0 8px 0 7px;
    font-size: 11px;
  }
}

/* Anchor opened assistant cleanly to the RIGHT edge of the viewport, with avatar snug against the chat panel */
#airep24-web-widget[data-myugc-chat-positioned] {
  top: var(--myugc-chat-top, 76px) !important;
  right: var(--myugc-chat-right, 16px) !important;
  bottom: auto !important;
  left: auto !important;
  width: min(500px, calc(100vw - var(--myugc-chat-right, 16px) - 10px)) !important;
}
#airep24-web-widget[data-myugc-chat-positioned] .ar24-shell:not([hidden]) {
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: flex-start !important;
  gap: 0 !important;
  inline-size: 100%;
}
#airep24-web-widget[data-myugc-chat-positioned] .ar24-avatar-stage {
  display: flex !important;
  order: -1;
  flex: 0 0 clamp(60px, 12vw, 126px);
  block-size: clamp(114px, 24vw, 248px);
  margin: 0 -22px 0 0 !important;
  position: relative;
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 700px) {
  #airep24-web-widget[data-myugc-chat-positioned] .ar24-avatar-stage {
    margin-right: -12px !important;
  }
}
#airep24-web-widget[data-myugc-chat-positioned] .ar24-avatar-stage :is(img, canvas) {
  max-inline-size: 100%;
  max-block-size: 100%;
  object-fit: contain;
}
#airep24-web-widget[data-myugc-chat-positioned] .ar24-panel {
  flex: 1 1 0 !important;
  min-inline-size: 0;
  max-block-size: max(160px, calc(100dvh - var(--myugc-chat-top, 76px) - 12px)) !important;
}
