/* Shared original QR display; do not crop, square, or resample the source JPEG. */
.wechat-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  background: #fff;
  color: #092a36;
}

.wechat-dialog .wechat-dialog-card {
  display: block;
  padding: 0;
  background: #fff;
  text-align: center;
}

.wechat-dialog-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px 24px;
  background: #fff;
  border-bottom: 1px solid #d6e0e3;
}

.wechat-dialog .wechat-dialog-heading h2 {
  min-width: 0;
  margin: 0;
  color: #092a36;
  text-align: left;
  font-size: 23px;
  line-height: 1.4;
}

.wechat-dialog .dialog-close {
  position: static;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 1px solid #d6e0e3;
  background: #fff;
  color: #092a36;
  font-size: 28px;
  line-height: 1;
}

.wechat-dialog .dialog-close:hover {
  background: #edf4f5;
}

.wechat-dialog .dialog-close:focus-visible,
[data-open-wechat]:focus-visible {
  outline: 3px solid #247f9e;
  outline-offset: 3px;
}

.wechat-dialog-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 24px;
}

.wechat-dialog .wechat-dialog-content p {
  max-width: 32ch;
  margin: 0;
  color: #3e5a65;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: normal;
}

.wechat-dialog img.wechat-qr-original,
.migration-contact-card img.wechat-qr-original,
img.wechat-qr-original {
  display: block;
  width: min(100%, 320px);
  max-width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 888 / 1137;
  object-fit: contain;
  border: 0;
  -webkit-touch-callout: default;
  user-select: auto;
}

.migration-contact-card img.wechat-qr-original {
  width: min(100%, 280px);
  margin: 20px auto 0;
}

@media (max-width: 400px) {
  .wechat-dialog-heading {
    gap: 8px;
    padding: 12px 12px 12px 16px;
  }

  .wechat-dialog .wechat-dialog-heading h2 {
    font-size: 21px;
  }

  .wechat-dialog-content {
    padding: 16px;
  }
}
