:root {
  --share-bg: #fff;
  --share-shadow: 0 18px 50px rgba(16, 24, 40, .13);
}

/*
 * Sharer Plus icon button
 * Visual size follows overtrue/share.js closely:
 * 32px circle / 1px brand border / ~20px brand logo.
 */
.share-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: -4px;
}

.share-btn {
  --brand: #666;
  --logo: none;
  appearance: none;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 4px;
  padding: 0;
  border: 1px solid var(--brand);
  border-radius: 50%;
  outline: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
  transition: background-color .22s ease, color .22s ease, transform .18s ease, box-shadow .18s ease;
}

.share-btn::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-image: var(--logo);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  transition: filter .18s ease, transform .18s ease;
}

.share-btn:hover,
.share-btn:focus-visible {
  background: var(--brand);
  color: #fff;
}

.share-btn:hover::before,
.share-btn:focus-visible::before {
  filter: brightness(0) invert(1);
}

.share-btn:hover { transform: translateY(-1px); }

.share-btn:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

.share-btn:active { transform: translateY(0) scale(.96); }

/* Slight optical adjustment for logos that visually fill the circle more. */
.share-btn[data-sharer="qzone"]::before,
.share-btn[data-sharer="reddit"]::before,
.share-btn[data-sharer="wechat"]::before { width: 19px; height: 19px; }

.share-btn[data-sharer="linkedin"]::before,
.share-btn[data-sharer="facebook"]::before { width: 18px; height: 18px; }

/* Toast */
.sharer-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 99999;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  padding: 11px 16px;
  background: #101828;
  color: #fff;
  font: 500 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: var(--share-shadow);
  transition: .2s ease;
}

.sharer-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* QR modal */
.sharer-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
}

.sharer-modal.is-open { visibility: visible; opacity: 1; }
.sharer-modal__backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .58); backdrop-filter: blur(3px); }
.sharer-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  padding: 26px;
  border-radius: 22px;
  background: #fff;
  color: #182230;
  text-align: center;
  box-shadow: 0 24px 90px rgba(16, 24, 40, .3);
  transform: scale(.97) translateY(8px);
  transition: transform .2s ease;
}
.sharer-modal.is-open .sharer-modal__dialog { transform: scale(1) translateY(0); }
.sharer-modal__dialog h3 { margin: 0 0 8px; font-size: 20px; }
.sharer-modal__dialog p { margin: 0 0 18px; color: #667085; font: 14px/1.65 system-ui, sans-serif; }
.sharer-modal__close {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: #344054;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.sharer-qr {
  width: 188px;
  min-height: 188px;
  margin: 0 auto 16px;
  padding: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 14px;
}
.sharer-qr img, .sharer-qr canvas { max-width: 100%; height: auto; }
.sharer-qr__fallback { color: #667085; font: 13px/1.6 system-ui, sans-serif; }
.sharer-copy-url {
  appearance: none;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: #344054;
  padding: 9px 14px;
  cursor: pointer;
  font: 600 13px/1 system-ui, sans-serif;
}
.sharer-copy-url:hover { background: #f9fafb; }
.sharer-modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .share-btn,
  .share-btn::before,
  .sharer-toast,
  .sharer-modal,
  .sharer-modal__dialog { transition: none; }
}
