:root {
  --htt-chat-size: 56px;
  --htt-chat-gap: 20px;
}

a.htt-whatsapp-button {
  box-sizing: border-box;
  position: fixed;
  z-index: 9900;
  right: calc(var(--htt-chat-gap) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--htt-chat-gap) + max(env(safe-area-inset-bottom, 0px),
    var(--htt-consent-height, 0px) + var(--htt-rates-height, 0px)));
  width: var(--htt-chat-size);
  height: var(--htt-chat-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background: #128c4a;
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .22);
  text-decoration: none;
}

a.htt-whatsapp-button:hover,
a.htt-whatsapp-button:focus-visible {
  background: #0c763d;
  color: #fff;
}

a.htt-whatsapp-button:focus-visible {
  outline: 3px solid #163454;
  outline-offset: 3px;
}

.htt-whatsapp-button svg {
  display: block;
  width: 30px;
  height: 30px;
}

.htt-whatsapp-button__text {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  box-sizing: border-box;
  width: max-content;
  max-width: min(18rem, calc(100vw - var(--htt-chat-size) - 2 * var(--htt-chat-gap)
    - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 8px));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 5px 10px;
  border-radius: 5px;
  background: #fff;
  color: #1d2327;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.htt-consent-modal-open a.htt-whatsapp-button {
  display: none;
}

/* A tall notice remains scrollable even on a short landscape viewport. */
body:has(.htt-whatsapp-button) .htt-consent-banner {
  max-height: min(60vh, calc(100dvh - var(--htt-rates-height, 0px) - var(--htt-chat-size)
    - var(--htt-chat-gap) - env(safe-area-inset-top, 0px) - 4px));
}

@media (max-width: 650px) {
  :root {
    --htt-chat-size: 48px;
    --htt-chat-gap: 12px;
  }
}
