.customer-support {
  --support-size: 54px;
  --support-gap: 12px;
  --support-edge: max(16px, env(safe-area-inset-right));
  position: fixed;
  z-index: 25;
  top: 50%;
  right: var(--support-edge);
  transform: translateY(-50%);
}

.customer-support__button {
  display: block;
  box-sizing: border-box;
  width: var(--support-size);
  height: var(--support-size);
  padding: 0;
  border: 1px solid #ffffff4d;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 4px 16px #0005;
  cursor: pointer;
}

.customer-support__button img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.customer-support__button[aria-expanded="true"] {
  border-color: #ffffffa6;
}

.customer-support__button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.customer-support__panel {
  position: absolute;
  top: 50%;
  right: calc(100% + var(--support-gap));
  transform: translateY(-50%);
  width: min(224px, calc(100vw - var(--support-size) - var(--support-gap) - var(--support-edge) - 12px));
  visibility: hidden;
  pointer-events: none;
  filter: drop-shadow(0 12px 24px #0006);
}

/* Keep the panel open across the gap between the image and the trigger. */
.customer-support__panel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: var(--support-gap);
}

.customer-support__surface {
  box-sizing: border-box;
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 15px 16px 16px;
  color: inherit;
  background: var(--surface, #101419);
  border: 1px solid var(--line, #ffffff24);
  border-radius: 16px;
  clip-path: inset(40% 0 40% 100% round 16px);
  opacity: 0;
}

.customer-support__button[aria-expanded="true"] + .customer-support__panel {
  visibility: visible;
  pointer-events: auto;
}

.customer-support__button[aria-expanded="true"] + .customer-support__panel .customer-support__surface {
  clip-path: inset(0 0 0 0 round 16px);
  opacity: 1;
}

.customer-support__hint {
  margin: 0;
  text-align: center;
  color: var(--muted, #aeb5bd);
  font-size: 13px;
  line-height: 1.5;
}

/* Match Figma: 53 px padding and 50 px corner radius in the 608 px QR frame. */
.customer-support__qr {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: min(184px, 100%, max(96px, calc(100vh - 112px)));
  background: #000;
  border-radius: 8.22%;
}

.customer-support__qr img {
  display: block;
  width: 82.57%;
  height: auto;
  margin: 0;
}

@media (max-width: 600px) {
  .customer-support {
    --support-size: 48px;
    --support-gap: 9px;
    --support-edge: max(10px, env(safe-area-inset-right));
  }

  .customer-support__panel {
    max-width: 204px;
  }

  .customer-support__qr {
    width: min(164px, 100%, max(96px, calc(100vh - 112px)));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .customer-support__panel {
    transition: visibility 0s linear 220ms;
  }

  .customer-support__surface {
    transition: clip-path 220ms cubic-bezier(.45, 0, .65, 1), opacity 170ms ease 35ms;
  }

  .customer-support__button[aria-expanded="true"] + .customer-support__panel {
    transition-delay: 0s;
  }

  .customer-support__button[aria-expanded="true"] + .customer-support__panel .customer-support__surface {
    transition: clip-path 420ms cubic-bezier(.2, .75, .22, 1), opacity 160ms ease;
  }
}
