/* ========== Right floating contact bar — premium gold ========== */
.fs-floatbar {
  --fs-fb-size: 72px;
  --fs-fb-gap: 18px;
  position: fixed;
  right: 22px;
  z-index: 1100;
  width: var(--fs-fb-size);
  pointer-events: none;
}

.fs-floatbar--rb {
  bottom: max(148px, calc(env(safe-area-inset-bottom, 0px) + 140px));
}

.fs-floatbar--rm {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.fs-floatbar__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--fs-fb-gap);
  pointer-events: auto;
}

.fs-floatbar__item {
  position: relative;
  margin: 0;
}

.fs-floatbar__item.is-hidden {
  display: none;
}

.fs-floatbar__btn {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: var(--fs-fb-size);
  height: var(--fs-fb-size);
  padding: 8px 6px 10px;
  box-sizing: border-box;
  border-radius: 14px;
  color: var(--fs-accent, #e8c96a) !important;
  background:
    linear-gradient(165deg, rgba(40, 36, 28, 0.92) 0%, rgba(18, 20, 26, 0.94) 100%);
  border: 1px solid rgba(232, 201, 106, 0.42);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(247, 229, 163, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none !important;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease,
    background 0.22s ease;
  overflow: hidden;
}

.fs-floatbar__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 80% at 50% 0%, rgba(247, 229, 163, 0.16), transparent 55%);
  pointer-events: none;
  opacity: 0.85;
}

.fs-floatbar__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.fs-floatbar__icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.fs-floatbar__label {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-floatbar__item.is-hot .fs-floatbar__btn,
.fs-floatbar__item:hover .fs-floatbar__btn,
.fs-floatbar__btn:hover,
.fs-floatbar__btn:focus-visible {
  color: #1a1408 !important;
  background: linear-gradient(180deg, #f7e5a3 0%, #e8c96a 48%, #c19549 100%);
  border-color: #e8c96a;
  box-shadow:
    0 12px 28px rgba(193, 149, 73, 0.38),
    0 0 0 1px rgba(247, 229, 163, 0.25);
  transform: translateY(-2px);
  outline: none;
}

.fs-floatbar__item.is-hot .fs-floatbar__btn::before,
.fs-floatbar__item:hover .fs-floatbar__btn::before,
.fs-floatbar__btn:hover::before {
  opacity: 0;
}

.fs-floatbar__item--totop .fs-floatbar__btn {
  color: #1a1408 !important;
  background: linear-gradient(180deg, #f7e5a3 0%, #e8c96a 48%, #c19549 100%);
  border-color: #c19549;
}

.fs-floatbar__item--totop .fs-floatbar__btn:hover {
  filter: brightness(1.05);
}

/* ----- Hover card ----- */
.fs-floatbar__panel {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: calc(100% + 18px);
  transform: translateY(-50%) translateX(10px);
  padding: 0;
  margin: 0;
  width: 212px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

/* Invisible bridge: gap between button and card */
.fs-floatbar__panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 22px;
}

.fs-floatbar__card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 16px;
  text-align: center;
  color: var(--fs-text, #eef0f4);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(247, 229, 163, 0.14), transparent 55%),
    linear-gradient(165deg, rgba(32, 28, 22, 0.98) 0%, rgba(14, 16, 22, 0.98) 100%);
  border: 1px solid rgba(232, 201, 106, 0.4);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(247, 229, 163, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.fs-floatbar__card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -7px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  background: linear-gradient(135deg, transparent 50%, rgba(18, 16, 14, 0.98) 50%);
  border-right: 1px solid rgba(232, 201, 106, 0.4);
  border-bottom: 1px solid rgba(232, 201, 106, 0.4);
  transform: rotate(-45deg);
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
}

.fs-floatbar__eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247, 229, 163, 0.72);
}

.fs-floatbar__qr {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  padding: 10px;
  width: 168px;
  height: 168px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(232, 201, 106, 0.28),
    0 8px 20px rgba(0, 0, 0, 0.25);
}

.fs-floatbar__qr img {
  display: block;
  width: 148px;
  height: 148px;
  margin: 0;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
}

/* Art QR (already has dark bg) — flush frame, no white mat */
.fs-floatbar__qr--art {
  padding: 0;
  width: 168px;
  height: 168px;
  background: #1a1d24;
  overflow: hidden;
}

.fs-floatbar__qr--art img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  background: transparent;
}

.fs-floatbar__id {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f7e5a3;
  word-break: break-all;
}

.fs-floatbar__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  margin: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7e5a3 0%, #e8c96a 48%, #c19549 100%);
  color: #1a1408 !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(193, 149, 73, 0.28);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.fs-floatbar__action:hover,
.fs-floatbar__copy.is-done {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.fs-floatbar__item.is-hot .fs-floatbar__panel,
.fs-floatbar__item:focus-within .fs-floatbar__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* QQ panel uses same QR card as WeChat */
.fs-floatbar__item--qq .fs-floatbar__id {
  font-size: 15px;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .fs-floatbar--desktop-only {
    display: none !important;
  }

  .fs-floatbar {
    --fs-fb-size: 70px;
    --fs-fb-gap: 12px;
    right: 10px;
    bottom: max(110px, calc(env(safe-area-inset-bottom, 0px) + 100px));
  }

  .fs-floatbar--rm {
    top: auto;
    transform: none;
  }

  .fs-floatbar__list {
    position: relative;
    z-index: 1103;
  }

  .fs-floatbar__btn {
    overflow: visible;
    height: auto;
    min-height: 64px;
    padding: 8px 4px 9px;
  }

  .fs-floatbar__icon {
    width: 24px;
    height: 24px;
  }

  .fs-floatbar__icon svg {
    width: 22px;
    height: 22px;
  }

  .fs-floatbar__label {
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }

  .fs-floatbar__panel {
    display: none;
  }

  /* Mobile: only is-open shows panel (ignore hover is-hot) */
  .fs-floatbar__item.is-hot .fs-floatbar__panel {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .fs-floatbar__item--qq.is-open .fs-floatbar__panel,
  .fs-floatbar__item--wechat.is-open .fs-floatbar__panel {
    display: block;
    position: fixed;
    top: auto;
    bottom: max(160px, calc(env(safe-area-inset-bottom, 0px) + 140px));
    left: 16px;
    right: 16px;
    width: auto;
    max-width: 280px;
    margin: 0 auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1102;
  }

  .fs-floatbar__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1101;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }

  .fs-floatbar.is-panel-open .fs-floatbar__backdrop {
    display: block;
  }

  .fs-floatbar__panel::before,
  .fs-floatbar__card::after {
    display: none;
  }
}
