.share-popup-overlay {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.share-popup-overlay[hidden] {
  display: none !important;
}

.share-popup-overlay *,
.share-popup-overlay *::before,
.share-popup-overlay *::after {
  box-sizing: border-box;
}

.share-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.share-popup-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.share-popup-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.92);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.share-popup-close:hover {
  background: rgba(40, 40, 40, 0.98);
}

.share-popup-close:focus-visible {
  outline: 2px solid #2189ff;
  outline-offset: 2px;
}

.share-popup-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: min(92vh, 900px);
  scrollbar-width: thin;
  scrollbar-color: var(--text-white, #fff) #171717;
}

.share-popup-scroll::-webkit-scrollbar {
  width: 10px;
}

.share-popup-scroll::-webkit-scrollbar-track {
  background: #171717;
  border-radius: 0 8px 8px 0;
}

.share-popup-scroll::-webkit-scrollbar-thumb {
  background: var(--text-white, #fff);
  border-radius: 0;
  border: 2px solid #171717;
  background-clip: padding-box;
}

.share-popup-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #171717;
  background-clip: padding-box;
}

.share-popup-root {
  --surface: #171717;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.18);
  --hashtag-blue: #2189ff;
  --btn-max: 320px;

  margin: 0;
  min-height: 0;
  background-color: var(--surface);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  text-align: center;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.share-popup-root .page-bg {
  min-height: 0;
  background-color: var(--surface);
}

.share-popup-root .wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 2.5rem;
}

.share-popup-root .intro {
  margin: 0 auto 2rem;
  line-height: 1.2;
}

.share-popup-root .intro-headline {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}

.share-popup-root .intro-sub {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 1.1625rem;
  line-height: 1.15;
}

.share-popup-root .intro-body {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.share-popup-root .how-to-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 400;
}

.share-popup-root .how-to-list {
  margin: 0 0 2.5rem;
  padding-left: 0;
  text-align: center;
  list-style-position: inside;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.9375rem;
}

.share-popup-root .how-to-list li {
  margin-bottom: 0.35rem;
}

.share-popup-root .hashtag {
  color: var(--hashtag-blue);
  font-weight: 600;
}

.share-popup-root .gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-bottom: 2rem;
  align-items: start;
}

@media (max-width: 540px) {
  .share-popup-root .gallery {
    grid-template-columns: 1fr;
  }
}

.share-popup-root .gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.share-popup-root .gallery-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.share-popup-root .gallery-img {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  vertical-align: middle;
}

.share-popup-root .cta {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.share-popup-root .actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.share-popup-root .btn {
  display: block;
  width: 100%;
  max-width: var(--btn-max);
  margin: 0;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    opacity 0.15s ease,
    transform 0.1s ease;
}

.share-popup-root .btn:active {
  transform: scale(0.98);
}

.share-popup-root .btn--primary {
  background-color: #ffffff;
  color: var(--surface);
  border-color: #ffffff;
}

.share-popup-root .btn--secondary {
  background-color: transparent;
  color: var(--text);
  border-color: var(--text);
}

.share-popup-root .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.share-popup-root .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.share-popup-root .toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.875rem;
  z-index: 10060;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.share-popup-root .toast--visible {
  opacity: 1;
  pointer-events: auto;
}
