/* ═══ Share component (sh-) — inc/share.php · assets/js/parts/share.js ═══ */
.sh{position:relative;display:inline-flex}
.sh-btn{gap:8px}
.sh>.sh-btn{flex:1 1 auto}
/* host-page fits */
.dr-page .ld-actions>.sh>.sh-btn{width:100%}
.sc-postpage>.sh{float:right;margin:-6px 0 0 12px}
.fm-thread-meta .sh-btn{margin:-6px 0}

/* Popover (portalled to <body> by JS, positioned under the button) */
.sh-pop{position:absolute;z-index:1120;width:360px;max-width:calc(100vw - 24px);background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--sh-3);padding:14px 14px 12px;
  opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right;transition:opacity .12s,transform .12s}
.sh-pop.show{opacity:1;transform:none}
.sh-pop[hidden]{display:none}
.sh-grab{display:none}
.sh-head{display:flex;align-items:flex-start;gap:10px;margin:0 0 12px}
.sh-ttl{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.sh-ttl b{font:700 18px/1.2 var(--display);color:var(--ink)}
.sh-ttl span{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}
.sh-x{flex:none;width:34px;height:34px;border-radius:50%;border:0;background:var(--paper);color:var(--ink-2);cursor:pointer;display:grid;place-items:center;font-size:15px}
.sh-x:hover{background:var(--paper-2);color:var(--ink)}

.sh-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.sh-it{display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 2px;border:0;background:none;border-radius:14px;color:var(--ink);font:inherit;cursor:pointer;text-align:center;text-decoration:none;min-width:0}
.sh-it[hidden]{display:none}
.sh-it:hover{background:var(--paper);color:var(--ink)}
.sh-it:focus-visible{outline:3px solid var(--lime);outline-offset:0}
.sh-ico{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--c);color:#fff;font-size:21px;transition:transform .12s,box-shadow .12s;box-shadow:0 4px 12px -6px var(--c)}
.sh-it:hover .sh-ico{transform:translateY(-1px);box-shadow:0 8px 18px -8px var(--c)}
.sh-it b{font-size:12.5px;font-weight:600;line-height:1.2;color:var(--ink-2);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sh-native .sh-ico,.sh-copy .sh-ico{background:var(--paper-2);color:var(--forest);box-shadow:none}
.sh-it.sh-done .sh-ico{background:var(--leaf);color:#fff}
.sh-it.sh-done b{color:var(--leaf-2)}

.sh-link{display:flex;gap:8px;align-items:center;margin-top:12px;padding:6px 6px 6px 14px;border:1px solid var(--line);border-radius:999px;background:var(--paper)}
.sh-link input{flex:1;min-width:0;border:0;background:none;font-size:13.5px;color:var(--ink-2);outline:none;padding:0;text-overflow:ellipsis}
.sh-link .btn{flex:none;min-height:34px}
.sh-link .btn.sh-done{background:var(--leaf)}
.sh-note{display:flex;gap:10px;align-items:center;margin-top:10px;padding:10px 12px;border-radius:14px;background:var(--mint);color:var(--forest);font-size:13px;line-height:1.35;text-decoration:none}
.sh-note:hover{color:var(--forest-2);background:#CDF7DB}
.sh-note i{font-size:16px;color:var(--leaf-2)}

/* Inline row of icons */
.sh-inline{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.sh-inline .sh-it{position:relative;padding:0;border-radius:50%;gap:4px}
.sh-inline .sh-it:hover{background:none}
.sh-inline .sh-ico{width:40px;height:40px;font-size:18px}
.sh-inline .sh-it b{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.sh-inline.sh-labels{display:grid;grid-template-columns:repeat(auto-fill,minmax(74px,1fr));gap:10px 6px}
.sh-inline.sh-labels .sh-it{border-radius:14px;padding:6px 2px}
.sh-inline.sh-labels .sh-it b{position:static;width:auto;height:auto;clip:auto;font-size:12.5px}
.sh-inline.sh-labels .sh-ico{width:50px;height:50px;font-size:21px}
[data-share-slot]{min-width:0}

/* Scrim (phones/tablets) */
.sh-scrim{position:fixed;inset:0;z-index:1150;background:rgba(10,22,14,.45);opacity:0;transition:opacity .25s}
.sh-scrim.show{opacity:1}
.sh-scrim[hidden]{display:none}

/* ≤1020px: bottom sheet (matches the app shell's .sheet) */
@media (max-width:1020px){
  body.sh-open{overflow:hidden}
  .sh-pop.sh-sheet{position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;max-width:none;z-index:1170;max-height:86vh;max-height:86dvh;overflow-y:auto;overscroll-behavior:contain;
    border:0;border-radius:26px 26px 0 0;padding:0 18px calc(22px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px -20px rgba(0,0,0,.35);
    opacity:1;transform:translateY(100%);transition:transform .3s cubic-bezier(.2,.9,.25,1)}
  .sh-pop.sh-sheet.show{transform:none}
  .sh-pop.sh-sheet.dragging{transition:none}
  .sh-sheet .sh-grab{display:flex;justify-content:center;position:sticky;top:0;z-index:2;padding:10px 0 12px;margin:0 -18px;background:#fff;cursor:grab;touch-action:none}
  .sh-sheet .sh-grab span{width:40px;height:5px;border-radius:5px;background:#D9D4C5}
  .sh-sheet .sh-head{margin-bottom:14px}
  .sh-sheet .sh-ttl b{font-size:22px}
  .sh-sheet .sh-grid{gap:10px 4px}
  .sh-sheet .sh-ico{width:54px;height:54px;font-size:23px}
  .sh-sheet .sh-link{margin-top:16px;padding:6px 6px 6px 16px}
  .sh-sheet .sh-link .btn{min-height:40px}
}
@media (min-width:560px) and (max-width:1020px){
  .sh-pop.sh-sheet{left:50%;right:auto;width:520px;margin-left:-260px}
}
@media (max-width:760px){.dr-page .ld-actions>.sh{flex:1 1 0;min-width:68px}}
@media (prefers-reduced-motion:reduce){.sh-pop,.sh-pop.sh-sheet,.sh-scrim{transition:none}}
