/* Common page share sheet — used by all public template pages */
.pa-share-fab,
.pa-share-dialog,
.pa-share-dialog *,
.pa-share-dialog *::before,
.pa-share-dialog *::after {
  box-sizing: border-box;
}

.pa-share-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 60;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pa-share-fab:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.pa-share-fab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.pa-share-fab svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.pa-share-dialog {
  position: fixed;
  left: 0.875rem;
  right: 0.875rem;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  margin: 0 auto;
  border: 0;
  padding: 0;
  width: auto;
  max-width: 24rem;
  max-height: min(92vh, 36rem);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 1.5rem;
  background: #fff;
  color: #151821;
  box-shadow:
    0 28px 64px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(15, 23, 42, 0.05);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-overflow-scrolling: touch;
}

.pa-share-dialog:not([open]) {
  display: none;
}

.pa-share-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pa-share-panel {
  padding: 1.35rem 1.25rem 1.4rem;
  overflow: hidden;
  max-width: 100%;
}

.pa-share-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.pa-share-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b93a3;
}

.pa-share-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #12151c;
}

.pa-share-close {
  width: 2.15rem;
  height: 2.15rem;
  flex-shrink: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #f1f3f7;
  color: #5b6472;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.pa-share-close:hover {
  background: #e5e8ef;
  color: #111827;
}

.pa-share-close svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* Copy row */
.pa-share-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-height: 3.35rem;
  margin: 0 0 1.2rem;
  padding: 0.45rem 0.45rem 0.45rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 1.15rem;
  background: #f3f5f8;
  color: inherit;
  overflow: hidden;
}

.pa-share-row-url {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-share-row-copy {
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  margin: 0;
  border: 0;
  border-radius: 0.9rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #151821;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pa-share-row-copy:hover {
  background: #0f1218;
}

.pa-share-row-copy.is-copied {
  background: #15803d;
}

.pa-share-row-copy svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.pa-share-row-copy.is-copied .pa-share-row-copy-icon {
  display: none;
}

.pa-share-row-copy:not(.is-copied) .pa-share-row-check-icon {
  display: none;
}

.pa-share-row-copy.is-copied .pa-share-row-check-icon {
  display: block;
}

.pa-share-section-label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b93a3;
}

.pa-share-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  border-radius: 1.15rem;
  background: #f5f7fb;
  border: 1px solid rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.pa-share-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  padding: 0.85rem 0.4rem;
  border-radius: 1rem;
  border: 1px solid transparent;
  background: #fff;
  color: #374151;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pa-share-platform:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  color: #111827;
}

.pa-share-platform span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.15rem;
}

.pa-share-platform-icon {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
  flex-shrink: 0;
}

.pa-share-platform-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.pa-share-report {
  display: block;
  margin: 1.15rem 0 0;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #e11d48;
  text-decoration: none;
}

.pa-share-report:hover {
  color: #be123c;
  text-decoration: underline;
}

@media (max-width: 380px) {
  .pa-share-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pa-share-panel {
    padding: 1.2rem 1rem 1.25rem;
  }

  .pa-share-row {
    padding-left: 0.85rem;
  }
}

@media print {
  .pa-share-fab,
  .pa-share-dialog {
    display: none !important;
  }
}
