.pf-share {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: inherit;
}

.pf-share__button,
.pf-share__option {
  appearance: none;
  border: 1px solid rgba(18, 24, 35, .16);
  background: #fff;
  color: #0a1220;
  border-radius: 999px;
  min-height: 42px;
  padding: .68rem 1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.pf-share__button:hover,
.pf-share__option:hover {
  transform: translateY(-1px);
  border-color: rgba(193, 145, 46, .65);
  background: #fffaf0;
}

.pf-share__button:focus-visible,
.pf-share__option:focus-visible {
  outline: 3px solid rgba(215, 167, 66, .28);
  outline-offset: 2px;
}

.pf-share__panel {
  position: absolute;
  /* Share UI is a modal-layer surface. It must sit above the persistent
     Mood player (z=50) and bottom navigation (z=40). */
  z-index: var(--bm-z-modal, 70);
  top: calc(100% + .65rem);
  right: 0;
  width: min(290px, calc(100vw - 2rem));
  padding: .65rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(18, 24, 35, .12);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(5, 10, 20, .16);
  backdrop-filter: blur(16px);
}

.pf-share__panel[hidden] {
  display: none !important;
}

.pf-share__option {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: .7rem .75rem;
  min-height: 40px;
  font-weight: 600;
}

@media (max-width: 560px) {
  .pf-share {
    width: 100%;
  }
  .pf-share__button {
    width: 100%;
  }
  .pf-share__panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    /* Default: clear the fixed mobile bottom nav. */
    bottom: calc(var(--bm-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px) + 1rem);
    top: auto;
    width: auto;
    grid-template-columns: 1fr 1fr;
    max-height: calc(100vh - var(--bm-bottom-nav-height, 64px) - env(safe-area-inset-bottom, 0px) - 2rem);
    max-height: calc(100dvh - var(--bm-bottom-nav-height, 64px) - env(safe-area-inset-bottom, 0px) - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* When a Mood is playing, the player sits above the bottom nav. Lift the
     share sheet above both fixed bars rather than allowing either to cover
     its action buttons. */
  body[data-player-active] .pf-share__panel {
    bottom: calc(var(--bm-player-height, 76px) + var(--bm-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px) + 1rem);
    max-height: calc(100vh - var(--bm-player-height, 76px) - var(--bm-bottom-nav-height, 64px) - env(safe-area-inset-bottom, 0px) - 2rem);
    max-height: calc(100dvh - var(--bm-player-height, 76px) - var(--bm-bottom-nav-height, 64px) - env(safe-area-inset-bottom, 0px) - 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-share__button,
  .pf-share__option {
    transition: none;
  }
}


/* Pages&Feelings premium dark-surface treatment */
.bm-content-hero .pf-share {
  margin-top: .25rem;
}

.bm-content-hero .pf-share__button {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: #f8f1e5;
}

.bm-content-hero .pf-share__button:hover {
  border-color: rgba(215, 167, 66, .72);
  background: rgba(215, 167, 66, .12);
}

.bm-content-hero .pf-share__panel {
  color: #0a1220;
}

/* v1.1.0.3 — installed-PWA/WebKit compositor guard. */
.pf-share__panel { z-index: 10000; }
@media (max-width: 560px) {
  body.pf-share-open #bm-player {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  body.pf-share-open[data-player-active] .pf-share__panel {
    bottom: calc(var(--bm-bottom-nav-height, 64px) + env(safe-area-inset-bottom, 0px) + 1rem);
    max-height: calc(100vh - var(--bm-bottom-nav-height, 64px) - env(safe-area-inset-bottom, 0px) - 2rem);
    max-height: calc(100dvh - var(--bm-bottom-nav-height, 64px) - env(safe-area-inset-bottom, 0px) - 2rem);
  }
}
