/* Sharing a paper with an expiring link (app/share.js): the share dialog, "Your shared links" in the library,
   and the page behind a link (#/s/<token>). LockIn tokens from tokens.css: one accent, status colours only. */

/* ---------- the dialog ---------- */
.pd-share { width: min(468px, calc(100vw - 32px)); }
.pd-share .pd-dlg-head { padding-right: 12px; }
.sh-headtxt { flex: 1; min-width: 0; }
.sh-headtxt p { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sh-close { margin: -4px -2px 0 auto; }
.sh-body { display: grid; gap: 14px; }
.sh-field { display: grid; gap: 7px; }
.sh-lbl { font-size: 11px; font-weight: 750; letter-spacing: 1.2px; text-transform: uppercase; font-stretch: 87%; color: var(--muted); }

.sh-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--rail); }
.sh-seg label { position: relative; display: block; cursor: pointer; }
.sh-seg label + label { border-left: 1px solid var(--line-strong); }
.sh-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sh-seg span { display: flex; align-items: center; justify-content: center; height: 34px; padding: 0 8px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.sh-seg label:hover span { background: var(--hover); color: var(--text); }
.sh-seg input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.sh-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -4px; }
:root[data-theme="light"] .sh-seg input:focus-visible + span { outline-color: var(--accent-ink); }

.sh-files { display: grid; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--rail); overflow: hidden; }
.sh-file { display: grid; grid-template-columns: 18px minmax(0, 1fr) 18px; align-items: center; column-gap: 11px; padding: 8px 12px; cursor: pointer; }
.sh-file + .sh-file { border-top: 1px solid var(--line); }
.sh-file input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.sh-file input:disabled { cursor: default; }
.sh-fname { min-width: 0; }
.sh-fname b { display: block; font-size: 13px; font-weight: 700; }
.sh-fname small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-file > .i { width: 16px; height: 16px; color: var(--faint); }
.sh-file.off { cursor: default; }
.sh-file.off b, .sh-file.off small { color: var(--faint); }
.sh-file:has(input:checked:not(:disabled)) > .i { color: var(--accent); }
:root[data-theme="light"] .sh-file:has(input:checked:not(:disabled)) > .i { color: var(--text); }

.sh-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sh-points li { display: flex; gap: 9px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.sh-points .i { width: 15px; height: 15px; margin-top: 1px; color: var(--faint); }
.sh-p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sh-p.small { font-size: 12.5px; }
.sh-p b { color: var(--text-2); }
.sh-err { margin: 0; padding: 9px 11px; border: 1px solid var(--bad-line); border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad-text); font-size: 12.5px; font-weight: 600; line-height: 1.45; }

.sh-busy { display: grid; gap: 8px; padding: 4px 0 2px; }
.sh-plabel { font-size: 13px; font-weight: 650; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sh-pbar { width: 100%; height: 6px; }

.sh-linkrow { display: flex; gap: 8px; }
.sh-url { flex: 1; height: 36px; font: 600 12.5px var(--mono); color: var(--text); background: var(--rail); }
.sh-copy { height: 36px; min-width: 92px; }
.sh-exp { display: flex; gap: 9px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.sh-exp .i { width: 15px; height: 15px; margin-top: 2px; color: var(--faint); }
.sh-exp b { color: var(--text); }
.pd-share .pd-dlg-foot { align-items: center; flex-wrap: wrap; }
.sh-sp { flex: 1; }
.btn.sh-cancel { padding: 0 8px; margin-left: -8px; }
.btn.sh-cancel:hover { color: var(--bad); background: var(--bad-bg); }

/* ---------- your shared links (library side column) ---------- */
.hs-shares .sh-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hs-shares .sh-head .hs-h { margin: 0; }
.sh-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 750; display: inline-grid; place-items: center; }
.sh-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.sh-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px 28px; align-items: center; column-gap: 4px; padding: 8px 0; }
.sh-row + .sh-row { border-top: 1px solid var(--line); }
.sh-main { min-width: 0; padding-right: 4px; }
.sh-main b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.sh-main small { display: flex; align-items: center; gap: 8px; margin-top: 5px; min-width: 0; }
.sh-left { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 3px; flex: none;
  background: var(--rail); color: var(--text-2); font-size: 11px; font-weight: 750; white-space: nowrap; }
.sh-left .i { width: 12px; height: 12px; stroke-width: 2; color: var(--faint); }
.sh-left.soon { color: var(--warn-text); border-color: var(--warn-line); background: var(--warn-bg); }
.sh-left.soon .i { color: var(--warn-text); }
/* line 1: time left and when it was made; line 2: what the link carries (the side column is narrow) */
.sh-main small { flex-wrap: wrap; row-gap: 4px; }
.sh-made { flex: none; color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.sh-what { flex: 1 0 100%; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sh-x:hover:not(:disabled) { color: var(--bad); background: var(--bad-bg); }
.sh-empty { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.sh-empty b { color: var(--text-2); font-weight: 700; }
.sh-empty.bad { color: var(--bad-text); margin-top: 6px; }

/* ---------- the page behind a link ---------- */
.sh-page { padding: 56px 16px 64px; }
.sh-card { max-width: 580px; margin: 0 auto; display: grid; gap: 12px; justify-items: start; padding: 28px; background: var(--chrome); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.sh-card > * { max-width: 100%; }
.sh-card .eyebrow { color: var(--muted); }
.sh-card h1 { margin: 0; font-size: clamp(30px, 5.6vw, 42px); overflow-wrap: anywhere; }
.sh-card .skel { width: 100%; }
.sh-by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 14px; }
.sh-by b { font-weight: 800; }
.sh-by span { color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.sh-by span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.sh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-chips .tag { height: 24px; padding: 0 8px; font-size: 11.5px; }
.sh-card .sh-busy { width: 100%; margin-top: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--rail); }
.sh-note { display: flex; gap: 9px; margin: 0; color: var(--faint); font-size: 12.5px; line-height: 1.5; }
.sh-note .i { width: 15px; height: 15px; margin-top: 2px; }
.sh-lede { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; max-width: 52ch; }
.sh-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sh-bigic { width: 52px; height: 52px; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); margin-bottom: 4px; }
.sh-bigic .i { width: 26px; height: 26px; stroke-width: 1.9; }
.sh-bigic.expired, .sh-bigic.cancelled, .sh-bigic.missing, .sh-bigic.bad, .sh-bigic.offline, .sh-bigic.wait { background: var(--raised); border: 1px solid var(--line-strong); color: var(--warn); }
.sh-bigic.offline, .sh-bigic.wait { color: var(--muted); }
.sh-bigic.failed { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); }

/* where to go next when a link does not open: what PaperDesk is, and your recent papers */
.sh-more { width: 100%; display: grid; gap: 12px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.sh-about { display: flex; gap: 10px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sh-about .i { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }
.sh-about b { color: var(--text); font-weight: 750; }
.sh-feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sh-feats li { display: grid; align-content: start; gap: 3px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--rail); }
.sh-feats .i { width: 16px; height: 16px; margin-bottom: 4px; color: var(--accent); }
:root[data-theme="light"] .sh-feats .i { color: var(--text); }
.sh-feats b { font-size: 12.5px; font-weight: 750; line-height: 1.3; }
.sh-feats span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sh-rhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 2px; }
.sh-rhead a { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.sh-rhead a:hover { color: var(--text); }
.sh-recent { list-style: none; margin: -4px 0 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--rail); overflow: hidden; }
.sh-recent li + li { border-top: 1px solid var(--line); }
.sh-recent a { display: grid; grid-template-columns: 16px minmax(0, 1fr) 14px; align-items: center; column-gap: 11px; padding: 9px 12px; color: inherit; text-decoration: none; }
.sh-recent a:hover { background: var(--hover); }
.sh-recent a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sh-recent .i { width: 16px; height: 16px; color: var(--faint); }
.sh-recent a > .i:last-child { width: 14px; height: 14px; }
.sh-rmain { min-width: 0; }
.sh-rmain b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-rmain small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
  .sh-page { padding: 20px 16px 48px; }
  .sh-card { padding: 20px 16px; gap: 11px; }
  .sh-acts { width: 100%; }
  .sh-acts .btn { flex: 1 1 auto; }
  .sh-feats { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--rail); }
  .sh-feats li { grid-template-columns: 16px minmax(0, 1fr); column-gap: 11px; row-gap: 1px; border: 0; border-radius: 0; background: none; padding: 9px 12px; }
  .sh-feats li + li { border-top: 1px solid var(--line); }
  .sh-feats .i { grid-row: span 2; margin: 1px 0 0; }
  .pd-share .pd-dlg-head { padding: 16px 10px 0 16px; }
  .pd-share .pd-dlg-body { padding: 14px 16px 0; }
  .pd-share .pd-dlg-foot { padding: 16px; }
  .sh-seg span { padding: 0 4px; }
}
