#embeddedMessagingFrame.minimized,
#embeddedMessagingFrame.initial {
  display: none !important;
}

.embedded-messaging > #embeddedMessagingFrame.maximized {
  bottom: 104px !important;
  right: 16px !important;
  max-height: calc(100dvh - 120px) !important;
}

@media (max-width: 639px) {
  .embedded-messaging > #embeddedMessagingFrame.maximized {
    bottom: 0 !important;
    right: 0 !important;
    max-height: 100dvh !important;
  }

  body.rush-chat-open #rushChat {
    display: none;
  }
}

.embeddedMessagingLiveRegion {
  height: 0 !important;
}

/* While a session is being cleared the old conversation must never be seen.
       visibility (not display) so Salesforce can still talk to its own frame. */
html.af-hide-chat #embeddedMessagingFrame,
html.af-hide-chat .embedded-messaging,
html.af-hide-chat #embeddedMessagingConversationButton {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Page-owned launcher */
#rushChat {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483000;
  font-family: Arial, Helvetica, sans-serif;
}

#rushChatButton {
  position: relative;
  display: block;
  width: 80px;
  height: 80px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  background: #5feea2;
  box-shadow: 0 32px 40px rgba(0, 0, 0, 0.16);
  -webkit-tap-highlight-color: transparent;
}

#rushChatButton:focus-visible {
  outline: 2px solid #006332;
  outline-offset: 2px;
}

#rushChatButton .rush-chat-avatar,
#rushChatButton .rush-chat-chevron {
  position: absolute;
  inset: 0;
  width: 80px;
  height: 80px;
  transition: opacity 0.25s ease;
}

#rushChatButton .rush-chat-avatar {
  display: block;
  object-fit: contain;
  opacity: 1;
}

#rushChatButton .rush-chat-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: #006332;
}

#rushChatButton .rush-chat-chevron svg {
  width: 40px;
  height: 40px;
  fill: currentColor;
}

#rushChat.open #rushChatButton .rush-chat-avatar {
  opacity: 0;
}

#rushChat.open #rushChatButton .rush-chat-chevron {
  opacity: 1;
}

#rushChatTeaser {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  max-width: calc(100vw - 48px);
  padding: 14px 18px;
  background: #fff;
  color: #333;
  font-size: 16px;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  cursor: pointer;
}

#rushChatTeaser[hidden] {
  display: none;
}

#rushChatTeaserClose {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e6e6e6;
  color: #666;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}

#rushChatTeaserClose:hover {
  background: #d5d5d5;
  color: #000;
}

@media (max-width: 480px) {
  #rushChatTeaser {
    white-space: normal;
  }
}

/* Idle warning modal */
.afmodal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2147483647;
  background: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  overscroll-behavior: contain;
}

.afmodal-content {
  position: relative;
  width: min(560px, 90vw);
  padding: 20px;
  border: 1px solid #888;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  text-align: center;
  font-family: inherit !important;
}

.afclose {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 28px;
  line-height: 1;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  padding: 10px 14px;
  margin: -10px -14px;
  touch-action: manipulation;
}

.afclose:hover {
  color: #000;
}

.afmodal-actions {
  margin-top: 16px;
  text-align: center;
}

.afbtn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  min-height: 44px;
  touch-action: manipulation;
}

.afbtn-primary {
  background: #006332;
  color: #fff;
}

.afbtn-primary:hover {
  background: #005728;
}

#afwarningTitle {
  color: inherit !important;
  font-family: inherit !important;
  font-size: 16px;
  line-height: 1.5;
}
