/*
 * Make the civic assistant easier to discover without replacing Chatbase's
 * own accessible button or chat controls.
 */
#chatbase-bubble-button {
  width: 60px !important;
  height: 60px !important;
  border: 2px solid rgba(255, 255, 255, 0.92) !important;
  box-shadow:
    0 10px 28px rgba(17, 24, 39, 0.28),
    0 0 0 3px rgba(247, 166, 0, 0.2) !important;
}

#chatbase-bubble-button:focus-visible {
  outline: 3px solid #f7a600 !important;
  outline-offset: 4px !important;
}

.amkeni-chat-nudge {
  position: fixed;
  z-index: 2147483646;
  width: max-content;
  max-width: min(280px, calc(100vw - 96px));
  padding: 11px 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 12px 30px rgba(17, 24, 39, 0.16),
    0 2px 8px rgba(17, 24, 39, 0.08);
  color: #171717;
  cursor: pointer;
  font-family: Cabin, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -100%) translateY(8px) scale(0.96);
  transform-origin: bottom center;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.amkeni-chat-pulse {
  position: fixed;
  z-index: 2147483645;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.amkeni-chat-pulse::before,
.amkeni-chat-pulse::after {
  position: absolute;
  inset: -2px;
  border: 3px solid rgba(247, 166, 0, 0.72);
  border-radius: inherit;
  content: "";
  opacity: 0;
}

.amkeni-chat-pulse.is-beating::before {
  animation: amkeni-chat-pulse-ring 1.45s ease-out;
}

.amkeni-chat-pulse.is-beating::after {
  animation: amkeni-chat-pulse-ring 1.45s ease-out 220ms;
}

.amkeni-chat-nudge::after {
  position: absolute;
  bottom: -6px;
  left: var(--amkeni-nudge-pointer-x, 50%);
  width: 12px;
  height: 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.1);
  border-right: 1px solid rgba(17, 24, 39, 0.1);
  background: #ffffff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.amkeni-chat-nudge.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -100%) translateY(0) scale(1);
}

.amkeni-chat-nudge:hover {
  background: #fff9e9;
}

.amkeni-chat-nudge:focus-visible {
  outline: 3px solid #f7a600;
  outline-offset: 3px;
}

html[data-theme="dark"] .amkeni-chat-nudge,
body.dark-mode .amkeni-chat-nudge {
  border-color: rgba(255, 255, 255, 0.16);
  background: #171717;
  color: #ffffff;
}

html[data-theme="dark"] .amkeni-chat-nudge::after,
body.dark-mode .amkeni-chat-nudge::after {
  border-color: rgba(255, 255, 255, 0.16);
  background: #171717;
}

html[data-theme="dark"] .amkeni-chat-nudge:hover,
body.dark-mode .amkeni-chat-nudge:hover {
  background: #252525;
}

@keyframes amkeni-chat-pulse-ring {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  12% {
    opacity: 0.82;
  }
  100% {
    opacity: 0;
    transform: scale(1.72);
  }
}

@media (max-width: 575.98px) {
  #chatbase-bubble-button {
    width: 56px !important;
    height: 56px !important;
  }

  .amkeni-chat-nudge {
    max-width: calc(100vw - 92px);
    padding: 10px 14px;
    font-size: 14px;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .amkeni-chat-pulse.is-beating::before,
  .amkeni-chat-pulse.is-beating::after {
    animation: none;
  }

  .amkeni-chat-nudge {
    transition: none;
  }
}
