/* --- sharing a public deck --------------------------------------------- */

/* A small round button riding on the "Public" label, in its colour. */
button.share-btn {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  margin-left: 2px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  anchor-name: --share-btn;
}

button.share-btn:hover:not(:disabled) {
  background: var(--accent-soft);
}

/* The popover lives in the top layer. Where anchor positioning exists it
   hangs under the button; elsewhere it keeps the browser's default and sits
   centred on screen, which still works. */
.share-pop {
  width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 16px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.16);
  opacity: 1;
  transform: none;
  transition:
    opacity 160ms ease-out,
    transform 160ms ease-out,
    overlay 160ms allow-discrete,
    display 160ms allow-discrete;
}

@starting-style {
  .share-pop:popover-open {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.share-pop:not(:popover-open) {
  opacity: 0;
  transform: translateY(-4px);
}

@supports (position-area: bottom) {
  .share-pop {
    position-anchor: --share-btn;
    position-area: bottom span-right;
    position-try-fallbacks: flip-inline, flip-block;
    margin-top: 8px;
    inset: auto;
  }
}

.share-pop-title {
  margin: 0 0 10px;
  font-weight: 600;
}

.share-row {
  display: flex;
  gap: 8px;
}

.share-row input {
  min-width: 0;
  font-size: 14px;
}

/* Wide enough for "Copied", so the button keeps its size when it says so. */
.share-row button.share-copy {
  flex-shrink: 0;
  min-width: 8.5em;
}

.share-pop-note {
  margin: 10px 0 0;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .share-pop {
    transition: none;
  }
}

.method-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.identities {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: var(--border-w) solid var(--line);
}

.identity:last-child {
  border-bottom: none;
}

.danger-zone {
  padding-top: 20px;
  border-top: var(--border-w) solid var(--line);
}

/* A note under a header: what of the page others see. */
.page-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 14px;
}

.page-note .ico {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent-text);
}

/* A copy's line: where it came from. */
.copied-from {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
