/**
 * 게스트 웹 앱 다운로드 FAB — 상담 FAB·채널톡 아래(엄지 자리)
 * PC: 채널톡 아래 + 가운데 QR 모달. 토큰: wooseok-design / wh-tokens.css
 */
html.wh-wehome-app .wh-appdl,
html.wh-wehome-app.wh-webview-embedded .wh-appdl,
body:has(.mobile_search_overlay.active) .wh-appdl,
body:has(.mobile_search_overlay.closing) .wh-appdl,
html.ec2-saving-active .wh-appdl,
body:has(#account-info-modal.is-open) .wh-appdl,
html.wh-acc-modal-open .wh-appdl,
html.wh-air-panel-open .wh-appdl,
html.wh-appdl-messenger .wh-appdl,
body.ch-messenger-open .wh-appdl,
html:has(#wh-air-panel.is-open) .wh-appdl {
  display: none !important;
}

html:has(#wh-appdl) {
  --wh-appdl-size: 120px;
  --wh-appdl-gap: var(--wh-space-md, 16px);
}

.wh-appdl {
  position: fixed;
  z-index: 12045;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  width: var(--wh-appdl-size);
  height: var(--wh-appdl-size);
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: center bottom;
  transition:
    opacity var(--wh-motion-fast, 180ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    visibility 0s linear var(--wh-motion-fast, 180ms);
}

.wh-appdl.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--wh-motion-fast, 180ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    visibility 0s linear 0s;
  animation: wh-appdl-hop 4.5s var(--wh-ease-spring, cubic-bezier(0.34, 1.28, 0.64, 1)) infinite;
}

.wh-appdl.is-on:has(.wh-appdl__link:active) {
  animation: none;
  transform: scale(var(--wh-scale-press, 0.96));
}

html:has(#ch-plugin) .wh-appdl {
  bottom: calc(160px + env(safe-area-inset-bottom, 0px));
}

html.wh-air-solo-launcher .wh-appdl,
html.wh-air-solo-launcher:has(#ch-plugin) .wh-appdl,
html.wh-air-solo-launcher:has(#ch-plugin):has(#wh-air-fab) .wh-appdl {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

html:has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]) .wh-appdl {
  bottom: calc(var(--rm-bottom-h, 180px) + 12px);
}

html:has(#ch-plugin):has(#rm-wrap .rm-bottom):not(.wh-air-solo-launcher):not([class*="force-desktop-ui"]) .wh-appdl {
  bottom: calc(var(--rm-bottom-h, 180px) + 80px);
}

html.wh-air-solo-launcher:has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]) .wh-appdl,
html.wh-air-solo-launcher:has(#ch-plugin):has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]) .wh-appdl,
html.wh-air-solo-launcher:has(#ch-plugin):has(#wh-air-fab):has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]) .wh-appdl {
  bottom: calc(var(--rm-bottom-h, 180px) + 12px);
}

/* 앱 다운로드가 아래를 차지하면 상담 FAB·말풍선은 그 위 */
html:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab {
  bottom: calc(88px + var(--wh-appdl-size) + var(--wh-appdl-gap) + env(safe-area-inset-bottom, 0px));
}

html:has(#ch-plugin):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab,
body:has(#ch-plugin) html:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab {
  bottom: calc(160px + var(--wh-appdl-size) + var(--wh-appdl-gap) + env(safe-area-inset-bottom, 0px));
}

html.wh-air-solo-launcher:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab,
html.wh-air-solo-launcher:has(#ch-plugin):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab,
body:has(#ch-plugin) html.wh-air-solo-launcher:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab {
  bottom: calc(88px + var(--wh-appdl-size) + var(--wh-appdl-gap) + env(safe-area-inset-bottom, 0px));
}

html:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip,
html:has(#ch-plugin):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip,
body:has(#ch-plugin) html:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip {
  bottom: calc(88px + var(--wh-appdl-size) + var(--wh-appdl-gap) + var(--wh-air-size, 56px) + 14px + env(safe-area-inset-bottom, 0px));
}

html:has(#ch-plugin):has(#wh-appdl.is-on):not(.wh-air-solo-launcher):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip,
body:has(#ch-plugin) html:has(#wh-appdl.is-on):not(.wh-air-solo-launcher):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip {
  bottom: calc(160px + var(--wh-appdl-size) + var(--wh-appdl-gap) + var(--wh-air-size, 56px) + 14px + env(safe-area-inset-bottom, 0px));
}

html.wh-air-solo-launcher:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip,
html.wh-air-solo-launcher:has(#ch-plugin):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip,
body:has(#ch-plugin) html.wh-air-solo-launcher:has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip {
  bottom: calc(88px + var(--wh-appdl-size) + var(--wh-appdl-gap) + var(--wh-air-size, 56px) + 14px + env(safe-area-inset-bottom, 0px));
}

html:has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab,
html.wh-air-solo-launcher:has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab,
html.wh-air-solo-launcher:has(#ch-plugin):has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab {
  bottom: calc(var(--rm-bottom-h, 180px) + 12px + var(--wh-appdl-size) + var(--wh-appdl-gap)) !important;
}

html:has(#ch-plugin):has(#rm-wrap .rm-bottom):not(.wh-air-solo-launcher):not([class*="force-desktop-ui"]):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-fab {
  bottom: calc(var(--rm-bottom-h, 180px) + 80px + var(--wh-appdl-size) + var(--wh-appdl-gap)) !important;
}

html:has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip,
html.wh-air-solo-launcher:has(#rm-wrap .rm-bottom):not([class*="force-desktop-ui"]):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip {
  bottom: calc(var(--rm-bottom-h, 180px) + 12px + var(--wh-appdl-size) + var(--wh-appdl-gap) + var(--wh-air-size, 56px) + 14px) !important;
}

html:has(#ch-plugin):has(#rm-wrap .rm-bottom):not(.wh-air-solo-launcher):not([class*="force-desktop-ui"]):has(#wh-appdl.is-on):not(.wh-appdl-messenger):not(.wh-air-panel-open) .wh-air-tip {
  bottom: calc(var(--rm-bottom-h, 180px) + 80px + var(--wh-appdl-size) + var(--wh-appdl-gap) + var(--wh-air-size, 56px) + 14px) !important;
}

.wh-appdl__link {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--wh-radius-md, 20px);
  overflow: hidden;
  box-shadow: var(--wh-shadow-listing, 0 0 0 1px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.1));
  -webkit-tap-highlight-color: transparent;
}

.wh-appdl__link:focus-visible {
  outline: 2px solid var(--wh-focus-ring, #681dc7);
  outline-offset: 2px;
}

.wh-appdl__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wh-appdl__close {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 1;
  width: var(--wh-touch-min, 44px);
  height: var(--wh-touch-min, 44px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--wh-tx, #1A1A1A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.wh-appdl__close-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--wh-card, #fff);
  box-shadow: var(--wh-shadow-listing, 0 0 0 1px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.1));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wh-appdl__close:focus-visible {
  outline: 2px solid var(--wh-focus-ring, #681dc7);
  outline-offset: 2px;
}

.wh-appdl__close:active .wh-appdl__close-mark {
  transform: scale(var(--wh-scale-press, 0.96));
}

@keyframes wh-appdl-hop {
  0%,
  70%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  76% {
    transform: translate3d(0, -8px, 0);
  }
  84% {
    transform: translate3d(0, 0, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
  96% {
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wh-appdl.is-on {
    animation: none;
  }
}

html.wh-reduce-motion .wh-appdl.is-on {
  animation: none;
}

/* PC: 우하단 코너(24px). :has(#id) 모바일 규칙(88px)보다 ID 특이도를 맞춰 이김 */
html[class*="force-desktop-ui"] .wh-appdl,
html[class*="force-desktop-ui"]:has(#ch-plugin) .wh-appdl,
html[class*="force-desktop-ui"]:has(#ch-plugin):has(#wh-air-fab) .wh-appdl,
html.wh-air-solo-launcher[class*="force-desktop-ui"] .wh-appdl,
html.wh-air-solo-launcher[class*="force-desktop-ui"]:has(#ch-plugin) .wh-appdl,
html.wh-air-solo-launcher[class*="force-desktop-ui"]:has(#ch-plugin):has(#wh-air-fab) .wh-appdl {
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

html.wh-appdl-pc-on:not(.wh-appdl-messenger):not(.wh-appdl-qr-open) #ch-plugin-entry {
  bottom: calc(24px + var(--wh-appdl-size) + var(--wh-appdl-gap)) !important;
}

html.wh-appdl-pc-on[class*="force-desktop-ui"]:has(#ch-plugin):not(.wh-appdl-messenger):not(.wh-air-panel-open):not(.wh-appdl-qr-open) .wh-air-fab {
  bottom: calc(24px + var(--wh-appdl-size) + var(--wh-appdl-gap) + 60px + 14px + env(safe-area-inset-bottom, 0px)) !important;
}

html.wh-appdl-pc-on[class*="force-desktop-ui"]:has(#ch-plugin):not(.wh-appdl-messenger):not(.wh-air-panel-open):not(.wh-appdl-qr-open) .wh-air-tip {
  bottom: calc(24px + var(--wh-appdl-size) + var(--wh-appdl-gap) + 60px + 14px + 60px + 14px + env(safe-area-inset-bottom, 0px)) !important;
}

html.wh-air-solo-launcher.wh-appdl-pc-on[class*="force-desktop-ui"]:not(.wh-appdl-messenger):not(.wh-air-panel-open):not(.wh-appdl-qr-open) .wh-air-fab,
html.wh-air-solo-launcher.wh-appdl-pc-on[class*="force-desktop-ui"]:has(#ch-plugin):not(.wh-appdl-messenger):not(.wh-air-panel-open):not(.wh-appdl-qr-open) .wh-air-fab {
  bottom: calc(24px + var(--wh-appdl-size) + var(--wh-appdl-gap) + env(safe-area-inset-bottom, 0px)) !important;
}

html.wh-air-solo-launcher.wh-appdl-pc-on[class*="force-desktop-ui"]:not(.wh-appdl-messenger):not(.wh-air-panel-open):not(.wh-appdl-qr-open) .wh-air-tip,
html.wh-air-solo-launcher.wh-appdl-pc-on[class*="force-desktop-ui"]:has(#ch-plugin):not(.wh-appdl-messenger):not(.wh-air-panel-open):not(.wh-appdl-qr-open) .wh-air-tip {
  bottom: calc(24px + var(--wh-appdl-size) + var(--wh-appdl-gap) + 60px + 14px + env(safe-area-inset-bottom, 0px)) !important;
}

html:not([class*="force-desktop-ui"]) .wh-appdl-qr {
  display: none !important;
}

html.wh-appdl-qr-open {
  overflow: hidden;
}

html.wh-appdl-qr-open .wh-appdl.is-on {
  animation: none;
}

.wh-appdl-qr[hidden] {
  display: none !important;
}

.wh-appdl-qr {
  position: fixed;
  inset: 0;
  z-index: 20000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wh-space-xl, 24px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--wh-motion-slow, 380ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    visibility 0s linear var(--wh-motion-slow, 380ms);
}

.wh-appdl-qr.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--wh-motion-slow, 380ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    visibility 0s linear 0s;
}

.wh-appdl-qr__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(0 0 0 / 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.wh-appdl-qr__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 400px);
  margin: 0;
  padding: var(--wh-inset-xl, 32px) var(--wh-inset-lg, 24px) var(--wh-space-2xl, 28px);
  border-radius: var(--wh-radius-md, 20px);
  background: var(--wh-card, #fff);
  box-shadow: var(--wh-shadow-listing, 0 0 0 1px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.1));
  text-align: center;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition:
    transform var(--wh-motion-sheet, 480ms) var(--wh-ease-spring, cubic-bezier(0.34, 1.28, 0.64, 1)),
    opacity var(--wh-motion-slow, 380ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}

.wh-appdl-qr.is-on .wh-appdl-qr__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition-delay: 40ms;
}

.wh-appdl-qr__close {
  position: absolute;
  top: var(--wh-space-xs, 8px);
  right: var(--wh-space-xs, 8px);
  width: var(--wh-touch-min, 44px);
  height: var(--wh-touch-min, 44px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--wh-radius-sharp, 10px);
  background: transparent;
  color: var(--wh-tx, #1A1A1A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wh-appdl-qr__close:focus-visible {
  outline: 2px solid var(--wh-focus-ring, #681dc7);
  outline-offset: 2px;
}

.wh-appdl-qr__title {
  margin: 0 0 var(--wh-space-sm, 12px);
  padding: 0 var(--wh-space-2xl, 28px);
  font-family: var(--wh-ff-display, SUIT, sans-serif);
  font-size: var(--wh-text-section, 1.375rem);
  font-weight: 800;
  line-height: var(--wh-lh-tight, 1.14);
  letter-spacing: var(--wh-tracking-title, -0.03em);
  color: var(--wh-tx, #1A1A1A);
}

.wh-appdl-qr__lead {
  margin: 0 0 var(--wh-space-sm, 12px);
  font-family: var(--wh-ff, Pretendard, sans-serif);
  font-size: var(--wh-text-base, 1rem);
  font-weight: 500;
  line-height: var(--wh-lh-body, 1.5);
  letter-spacing: var(--wh-tracking-body, -0.02em);
  color: var(--wh-tx2, #4A4A4A);
}

.wh-appdl-qr__perk {
  margin: 0 0 var(--wh-space-xs, 8px);
  font-family: var(--wh-ff, Pretendard, sans-serif);
  font-size: var(--wh-text-base, 1rem);
  font-weight: 700;
  line-height: var(--wh-lh-body, 1.5);
  letter-spacing: var(--wh-tracking-body, -0.02em);
  color: var(--wh-tx, #1A1A1A);
}

.wh-appdl-qr__once {
  margin: 0 0 var(--wh-space-xl, 24px);
  font-family: var(--wh-ff, Pretendard, sans-serif);
  font-size: var(--wh-text-sm, 0.875rem);
  font-weight: 500;
  line-height: var(--wh-lh-body, 1.5);
  letter-spacing: var(--wh-tracking-body, -0.02em);
  color: var(--wh-tx3, #6B6B6B);
}

.wh-appdl-qr__plate {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 252px;
  max-width: 100%;
  margin: 0 auto;
  padding: var(--wh-space-md, 16px);
  border-radius: var(--wh-radius-xs, 12px);
  background: var(--wh-card, #fff);
  border: 1px solid var(--wh-bd-hairline, #E5E5E5);
}

.wh-appdl-qr__img {
  display: block;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

.wh-appdl-qr__url {
  margin: var(--wh-space-md, 16px) 0 0;
  font-family: var(--wh-ff, Pretendard, sans-serif);
  font-size: var(--wh-text-sm, 0.875rem);
  font-weight: 500;
  line-height: var(--wh-lh-body, 1.5);
  color: var(--wh-tx3, #6B6B6B);
}

@media (prefers-reduced-motion: reduce) {
  .wh-appdl-qr,
  .wh-appdl-qr.is-on,
  .wh-appdl-qr__dialog,
  .wh-appdl-qr.is-on .wh-appdl-qr__dialog {
    transition: none;
  }
  .wh-appdl-qr__dialog,
  .wh-appdl-qr.is-on .wh-appdl-qr__dialog {
    transform: none;
  }
}

html.wh-reduce-motion .wh-appdl-qr,
html.wh-reduce-motion .wh-appdl-qr.is-on,
html.wh-reduce-motion .wh-appdl-qr__dialog,
html.wh-reduce-motion .wh-appdl-qr.is-on .wh-appdl-qr__dialog {
  transition: none;
}
html.wh-reduce-motion .wh-appdl-qr__dialog,
html.wh-reduce-motion .wh-appdl-qr.is-on .wh-appdl-qr__dialog {
  transform: none;
}
