/* Share panel (assets/share.js), on the server browser and the server pages. Same tokens as both. */
.share-dialog {
  --s-void: #040506; --s-base: #08090B; --s-panel: #0D0F12; --s-raise: #14171B; --s-line: #1D2126; --s-line-hi: #2E343C;
  --s-text: #D9DEE5; --s-dim: #7F8894; --s-ice: #A8DBFF;
  width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto;
  border: 1px solid var(--s-line-hi); background: var(--s-base); color: var(--s-text);
  font: 400 13px/1.45 "JetBrains Mono", ui-monospace, monospace; box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
}
.share-dialog::backdrop { background: rgba(4, 5, 6, .74); backdrop-filter: blur(6px); }
.share-dialog[open] { animation: share-in .18s ease-out; }
@keyframes share-in { from { opacity: 0; transform: translateY(10px); } }
.share-dialog svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.share-dialog :focus-visible { outline: 1px solid var(--s-ice); outline-offset: 2px; }
.share-in { padding: 20px 22px 22px; }

.share-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.share-head h2 { margin: 0; font: 400 11px Aldrich, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--s-dim); }
.share-name { margin: 5px 0 0; font: 400 21px/1.25 Aldrich, sans-serif; color: #fff; overflow-wrap: anywhere; }
.share-x { width: 34px; height: 34px; display: grid; place-items: center; flex: none; padding: 0; background: none; border: 1px solid var(--s-line); color: var(--s-dim); cursor: pointer; transition: color .15s, border-color .15s; }
.share-x:hover { color: #fff; border-color: var(--s-line-hi); }

.share-controls { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.share-seg { display: inline-flex; border: 1px solid var(--s-line); }
.share-seg[hidden] { display: none; }
.share-seg button { height: 30px; padding: 0 14px; color: var(--s-dim); font: 400 12px "JetBrains Mono", monospace; background: none; border: 0; cursor: pointer; transition: color .15s, background .15s; }
.share-seg button + button { border-left: 1px solid var(--s-line); }
.share-seg button:hover { color: #fff; }
.share-seg button[aria-pressed="true"] { color: var(--s-void); background: var(--s-ice); }

.share-preview { position: relative; display: grid; place-items: center; min-height: 80px; margin: 0 0 16px; background: var(--s-panel); border: 1px solid var(--s-line); }
.share-preview img { display: block; width: 100%; height: auto; transition: opacity .2s; }
.share-preview.is-banner { padding: 22px 14px; }
.share-preview.is-banner img { width: auto; max-width: 100%; }
.share-preview.loading img { opacity: .3; }
.share-preview.failed img { visibility: hidden; }
.share-preview figcaption { position: absolute; color: var(--s-dim); }

.share-fields { display: grid; gap: 10px; }
.share-field label { display: block; margin-bottom: 5px; color: var(--s-dim); font-size: 11.5px; }
.share-field div { display: flex; }
.share-field input { flex: 1; min-width: 0; height: 36px; padding: 0 11px; background: var(--s-void); border: 1px solid var(--s-line-hi); border-right: 0; border-radius: 0; color: var(--s-text); font: 400 12px "JetBrains Mono", monospace; }
.share-field input:focus { outline: none; border-color: var(--s-ice); }
.share-copy, .share-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; border: 1px solid var(--s-line-hi); background: var(--s-panel); color: var(--s-text); font: 400 12px Aldrich, sans-serif; letter-spacing: .03em; text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.share-copy { height: 36px; padding: 0 14px; min-width: 104px; justify-content: center; }
.share-copy:hover, .share-btn:hover { background: var(--s-raise); }
.share-copy.done { color: var(--s-void); background: var(--s-ice); border-color: var(--s-ice); }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.share-btn { height: 38px; padding: 0 16px; font-size: 12.5px; }
.share-btn[hidden] { display: none; }
.share-btn.go { background: var(--s-ice); border-color: var(--s-ice); color: var(--s-void); }

@media (max-width: 560px) {
  .share-dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-width: 1px 0 0; }
  .share-in { padding: 16px; }
  .share-name { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .share-dialog[open] { animation: none; }
}
