/* The share panel (#277, js/share-sheet.ts) on the big screen and on the phone page: the picture,
   the link and Copy link / Save picture. Its colours are both pages' tokens.css (#403). */
.share-panel {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: max(0.6em, var(--safe-top, 0px)) max(0.6em, var(--safe-bottom, 0px));
  padding-inline: max(0.6em, var(--safe-start, 0px)) max(0.6em, var(--safe-end, 0px));
}

.share-panel[hidden],
.share-panel.hidden {
  display: none;
}

.share-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}

.share-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  width: min(52em, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1em 1.2em 1.2em;
  /* Black, no edge and no shadow (A · Console, #415); more contrast: the white edge. The phone page
     has no shape tokens: the fallbacks are the big screen's sizes at its base. */
  border: 2px solid transparent;
  border-radius: var(--r-l, 1.15rem);
  background: var(--bg);
  color: var(--ui-text);
}

.high-contrast .share-box {
  border-color: var(--ui-text);
}

@media (prefers-contrast: more) {
  .share-box {
    border-color: var(--ui-text);
  }
}

.share-box h2 {
  margin: 0;
  font-size: 1.4em;
  font-weight: 900;
}

.share-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.share-preview {
  flex: 1 1 14em;
  min-width: 0;
  max-width: min(100%, 60vh);
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--r-m, 0.7rem);
  background: var(--ui-raised);
}

.share-side {
  flex: 1 1 14em;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.share-text {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.share-link {
  margin: 0;
  overflow-wrap: anywhere;
  user-select: all;
  font-size: max(var(--fs-small, 14px), 0.85em);
  opacity: 0.85;
}

.share-status {
  margin: 0;
  min-height: 1.3em;
  font-size: max(var(--fs-small, 14px), 0.85em);
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-top: 0.4em;
}

.share-actions button {
  width: 100%;
  min-height: var(--touch-min, 56px);
  margin: 0;
}

/* The results' Share button: its arrow next to the word. */
.share-btn svg {
  width: 1em;
  height: 1em;
  margin-inline-end: 0.35em;
  vertical-align: -0.12em;
}
