.share-dialog {
  --sheet-ink: #172422;
  --sheet-muted: #505a51;
  --sheet-rule: #bcb9ac;
  --sheet-paper: #f3ede0;
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(790px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--sheet-paper);
  color: var(--sheet-ink);
  border: 1px solid #192723;
  border-radius: 3px;
  box-shadow: 0 18px 60px #090f0e55;
  font-family: var(--body);
  color-scheme: light;
}
html:has(.share-dialog[open]) { overflow: hidden; }
.share-dialog::backdrop { background: #0b1615c9; }
.share-panel { position: relative; padding: clamp(17px, 3.4vw, 30px); }
.share-panel h2 {
  margin: 0 40px 8px 0;
  font: 800 clamp(38px, 6vw, 59px)/.95 var(--display);
  letter-spacing: -.032em;
}
.share-panel h2 span { color: #aa431c; }
.share-close {
  position: absolute;
  right: clamp(10px, 3vw, 24px);
  top: clamp(10px, 3vw, 23px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--sheet-ink);
  background: none;
  border: 0;
}
.share-close:hover { background: #dedacb; }
#share-description { max-width: 61ch; margin: 0 0 17px; color: var(--sheet-muted); font-size: 16px; line-height: 1.4; }
#share-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 120 / 63;
  background: #1b302e;
  transition: opacity .14s;
}
#share-art[aria-busy="true"] { opacity: .68; }
.postcard-controls { margin: 10px 0 14px; }
.postcard-roll, .share-actions :is(a, button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sheet-ink);
  font: 700 14px/1.25 var(--body);
  cursor: pointer;
}
.postcard-roll { width: 100%; gap: 8px; background: #ffa96f; border-radius: 2px; font-size: 16px; }
.postcard-roll:hover { background: #ffbb8d; }
.share-actions :is(a, button):not(#share-download):hover { text-decoration: underline; text-underline-offset: 4px; }
.share-dialog :is(a, button, #share-url):focus-visible { outline: 2px solid #a4421f; outline-offset: 2px; }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; border-top: 1px solid var(--sheet-rule); padding-top: 14px; }
.share-actions #share-download { color: #fff6e6; background: var(--sheet-ink); padding: 0 17px; border-radius: 2px; }
.share-actions #share-download:hover:not(:disabled) { background: #314239; }
.share-actions button:disabled { opacity: .5; cursor: wait; }
#share-manual { display: grid; gap: 5px; margin: 15px 0 3px; font-size: 14px; }
#share-manual[hidden] { display: none; }
#share-url { width: 100%; padding: 9px; border: 1px solid var(--sheet-rule); background: #fff8e9; color: var(--sheet-ink); font: inherit; }
#share-status { margin: 0; color: var(--sheet-muted); font-size: 13px; line-height: 1.4; }
#share-status:not(:empty) { margin-top: 10px; }
@media (max-width: 520px) {
  .share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
  .share-actions #share-download { grid-column: 1/-1; }
}
@media (max-width: 410px) {
  .share-dialog { width: calc(100% - 12px); max-height: calc(100dvh - 12px); }
}
@media (max-height: 540px) and (min-width: 650px) {
  .share-dialog { width: min(780px, calc(100% - 18px)); max-height: calc(100dvh - 12px); }
  .share-panel { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 18px; padding: 15px 18px; }
  .share-panel h2 { grid-column: 1; font-size: 37px; }
  #share-description { grid-column: 1; margin-bottom: 10px; font-size: 13px; }
  #share-art { grid-column: 1; }
  .postcard-controls { grid-column: 2; grid-row: 2; margin: 0 0 10px; }
  .share-actions { grid-column: 2; grid-row: 3; align-content: start; align-self: start; padding-top: 10px; column-gap: 14px; }
  .share-actions #share-download { width: 100%; }
  #share-manual, #share-status { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { #share-art { transition: none; } }
