/* Sharing (share.js): one icon button everywhere + a small popover. Self-contained: every colour has a fallback,
   so it renders the same over any app.css generation. No inline styles are needed (CSP style-src 'self'). */
.share-btn{flex:none;position:relative;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;border-radius:50%;
  width:44px;height:44px;min-height:44px;background:var(--surface,#fff);border:1.5px solid var(--line-strong,#9ca3af);color:var(--brand-brown,#592100);
  transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.share-btn[hidden]{display:none}
.share-btn .icon,.share-btn svg{width:22px;height:22px;pointer-events:none}
.share-btn:hover{background:var(--brand-cream,#fff4e5);border-color:var(--brand-brown,#592100)}
.share-btn:focus-visible{outline:none;box-shadow:var(--ring,0 0 0 3px rgba(29,78,216,.35))}
.share-btn[aria-expanded=true]{background:var(--brand-cream,#fff4e5);border-color:var(--brand-brown,#592100)}
.share-btn[disabled]{opacity:.4;cursor:default}
@media (hover:hover) and (prefers-reduced-motion:no-preference){.share-btn:not([disabled]):hover{transform:scale(1.06)}}

.share-btn--lg{width:60px;height:60px;min-height:60px;border-width:2px;border-color:var(--brand-brown,#592100)}
.share-btn--lg svg{width:28px;height:28px}

/* player bar (dark) */
.share-btn--player{width:48px;height:48px;min-height:48px;background:transparent;border:2px solid var(--on-dark-muted,#f5e6d6);color:var(--on-dark-muted,#f5e6d6)}
.share-btn--player:hover{background:var(--on-dark-hover,rgba(255,255,255,.12));color:var(--on-dark,#fff);border-color:var(--on-dark-muted,#f5e6d6)}
.share-btn--player[aria-expanded=true]{background:var(--on-dark-hover,rgba(255,255,255,.12));border-color:var(--on-dark-muted,#f5e6d6)}
@media (max-width:640px){.share-btn--player{width:44px;height:44px;min-height:44px}}

/* song share: quiet ghost icon at the end of a now-playing line (36px visible, 44px hit area) */
.share-btn--np{width:36px;height:36px;min-height:36px;border-color:transparent;background:transparent;color:inherit;opacity:.8;margin-block:-8px}
.share-btn--np::after{content:"";position:absolute;inset:-4px}
.share-btn--np svg{width:20px;height:20px}
.share-btn--np:hover{opacity:1;background:var(--brand-cream,#fff4e5);border-color:transparent}
.np > .share-btn--np{margin-block:0;align-self:center;color:var(--brand-brown,#592100)}
.player__nprow{display:flex;align-items:center;gap:.35rem;min-width:0;max-width:100%}
.player__nprow .player__np{flex:0 1 auto;min-width:0}
.player .share-btn--np{color:var(--on-dark-muted,#f5e6d6)}
.player .share-btn--np:hover{background:var(--on-dark-hover,rgba(255,255,255,.12));color:var(--on-dark,#fff)}

/* pop-out window */
.share-btn--popout{width:48px;height:48px;min-height:48px}

/* ---------- popover ---------- */
.share-pop{position:fixed;z-index:90;left:0;top:0;width:min(300px,calc(100vw - 16px));box-sizing:border-box;padding:.5rem;
  background:var(--surface,#fff);color:var(--ink,#111827);border:1px solid var(--line,#d1d5db);border-radius:16px;
  box-shadow:var(--shadow-lg,0 8px 24px rgba(0,0,0,.18));opacity:0;transform:translateY(4px);transition:opacity .14s ease,transform .14s ease}
.share-pop[data-side=above]{transform:translateY(-4px)}
.share-pop.is-open{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){.share-pop{transition:none}}
.share-pop__head{padding:.65rem .75rem .6rem;border-bottom:1px solid var(--line-soft,#f1ece6);margin-bottom:.35rem}
.share-pop__title{margin:0;font-size:.78rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--brand-brown,#592100)}
.share-pop__sub{margin:.2rem 0 0;font-size:.95rem;font-weight:600;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.share-pop__list{display:flex;flex-direction:column}
.share-pop__row{display:flex;align-items:center;gap:.85rem;width:100%;min-height:48px;box-sizing:border-box;padding:.35rem .75rem;border:0;border-radius:10px;
  background:transparent;color:inherit;font:inherit;font-size:1rem;font-weight:600;text-align:left;text-decoration:none;cursor:pointer}
.share-pop__row:hover{background:var(--brand-cream,#fff4e5)}
.share-pop__row:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--focus,#1d4ed8);background:var(--brand-cream,#fff4e5)}
.share-pop__ico{flex:none;display:inline-flex;width:24px;height:24px;color:var(--brand-brown,#592100)}
.share-pop__svg{width:24px;height:24px}
.share-pop__label{flex:1;min-width:0}
.share-pop__row.is-done{color:var(--success,#166534)}
.share-pop__row.is-done .share-pop__ico{color:inherit}
.share-pop__field{display:block;width:calc(100% - .5rem);margin:.35rem .25rem .25rem;box-sizing:border-box;min-height:44px;padding:.4rem .6rem;border:1.5px solid var(--field-border,#6b7280);border-radius:10px;font:inherit;font-size:.85rem;color:inherit;background:var(--surface-2,#f9fafb)}
.share-pop__field[hidden]{display:none}
@media (forced-colors:active){.share-btn,.share-pop{border:2px solid ButtonText}.share-pop__row:focus-visible{outline:2px solid Highlight}}

/* narrow phones: the bar is tight. Tighter gaps; while a song is shown, its share button (which also carries the station link)
   stands in for the station share button, so the title and song keep room. */
@media (max-width:640px){.player__inner{gap:.5rem}}
@media (max-width:520px){.player__inner:has(#player-share-song:not([hidden])) #player-share{display:none}}

/* pop-out window: [station share] [play] [song share]; the song slot keeps its space so nothing shifts when a song appears */
.popout__controls{display:flex;align-items:center;justify-content:center;gap:1.1rem}
.popout__controls .share-btn--np{width:48px;height:48px;min-height:48px;margin:0;opacity:.9;color:var(--primary,#592100)}
.popout__controls .share-btn--np svg{width:24px;height:24px}
.popout__controls .share-btn--np:hover{background:var(--primary-soft,#fff4e5)}
.popout__controls .share-btn--np[hidden]{display:inline-flex;visibility:hidden}
