/* The Share modal (src/player/share.js): centered over a dark backdrop, the
   menus' greys (timeline.css .tl-menu); a bottom sheet on phones. */
.share-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(5, 5, 6, 0.72); backdrop-filter: blur(3px); animation: sh-fade 0.15s ease-out; }
.share-backdrop[hidden] { display: none; }
@keyframes sh-fade { from { opacity: 0; } }
@keyframes sh-rise { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.share-panel { --sh-bg: #1c1c1e; --sh-edge: #333336; --sh-hi: #2e2e33; --sh-field: #141416; --sh-dim: #8a8a8e; width: min(640px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; gap: 12px; padding: 0 24px 24px; overflow-y: auto; overscroll-behavior: contain; color: #e2e2e2; font-size: 12.5px; letter-spacing: 0.02em; background: var(--sh-bg); border: 1px solid var(--sh-edge); border-radius: 14px; box-shadow: 0 1px 0 #ffffff0d inset, 0 24px 80px #000c, 0 4px 16px #0008; animation: sh-rise 0.18s cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { .share-backdrop, .share-panel { animation: none; } }
.share-panel [hidden] { display: none !important; }
.share-panel button, .share-panel input, .share-panel textarea { font: inherit; letter-spacing: inherit; }
.share-panel :focus-visible { outline: 1px solid #8a8a90; outline-offset: 1px; }

.sh-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; margin: 0 -24px 4px; padding: 0 12px 0 18px; background: var(--sh-bg); border-bottom: 1px solid var(--sh-edge); }
.sh-close { display: grid; place-items: center; width: 32px; height: 32px; margin-left: auto; padding: 0; color: var(--sh-dim); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.sh-close:hover { color: #fff; background: var(--sh-hi); }
.sh-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* Tabs: underlined, like the top bar's view tabs. */
.sh-tabs { display: flex; gap: 4px; }
.sh-tab { position: relative; padding: 16px 8px 14px; color: var(--sh-dim); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; background: none; border: 0; cursor: pointer; }
.sh-tab:hover { color: #d0d0d0; }
.sh-tab[aria-selected='true'] { color: #fff; }
.sh-tab[aria-selected='true']::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--ui-accent-strong); border-radius: 1px; }
.sh-page { display: flex; flex-direction: column; gap: 10px; }

.sh-label { margin-top: 6px; color: #7a7a7e; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.sh-meta { color: var(--sh-dim); font-size: 11.5px; }
.sh-note { color: var(--sh-dim); font-size: 11.5px; line-height: 1.45; overflow-wrap: anywhere; }
.sh-note:empty { display: none; }
.sh-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* What's shared: the scene's still, its name, the version. */
.sh-head { display: flex; align-items: center; gap: 16px; }
.sh-thumb { flex: none; width: 160px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--sh-field); border-radius: 4px; }
.sh-thumb.tall { width: 60px; aspect-ratio: 9 / 16; }
.sh-head-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sh-head-text b { overflow: hidden; color: #fff; font-size: 16px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

/* Start at: a segmented choice. */
.sh-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-chip { padding: 7px 13px; color: #c8c8cc; font-size: 12px; background: none; border: 1px solid var(--sh-edge); border-radius: 999px; cursor: pointer; }
.sh-chip:hover { background: var(--sh-hi); }
.sh-chip[aria-checked='true'] { color: var(--ui-ink); background: var(--ui-accent); border-color: var(--ui-accent); }

.sh-url-row { display: flex; gap: 8px; }
.sh-url { flex: 1; min-width: 0; padding: 0 12px; height: 38px; color: #d6d6da; font-size: 12px; background: var(--sh-field); border: 1px solid var(--sh-edge); border-radius: 6px; }
.sh-msg { resize: vertical; min-height: 56px; padding: 9px 12px; color: #e8e8e8; font-family: 'DM Sans Variable', sans-serif; font-size: 14px; line-height: 1.4; letter-spacing: 0; background: var(--sh-field); border: 1px solid var(--sh-edge); border-radius: 6px; }
.sh-msg::placeholder { color: #5e5e62; }
.sh-caption { min-height: 104px; font-size: 13.5px; }

.sh-btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; color: #e2e2e2; font-size: 12px; text-decoration: none; white-space: nowrap; background: #26262a; border: 1px solid #3a3a3e; border-radius: 6px; cursor: pointer; }
.sh-btn:hover { color: #fff; background: #303035; }
.sh-btn.primary { color: var(--ui-ink); font-weight: 700; background: var(--ui-accent-strong); border-color: var(--ui-accent-strong); }
.sh-btn.primary:hover { background: #fff; }
.sh-btn:disabled, .sh-btn[aria-disabled='true'] { color: #5e5e62; background: #1f1f22; border-color: var(--sh-edge); cursor: default; }

/* Dev server only: dashed, like the top bar's Dev chip. */
.sh-dev { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 6px; padding: 9px 12px; border: 1px dashed #4a4a4e; border-radius: 6px; }
.sh-dev-tag { color: #7a7a7e; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.sh-link { padding: 2px 0; color: #c8c8cc; font-size: 12px; background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: #55555a; text-underline-offset: 3px; }
.sh-link:hover { color: #fff; text-decoration-color: currentColor; }
.sh-link:disabled { color: #5e5e62; cursor: default; text-decoration: none; }

/* Social: a card per kind of post, its frame shape drawn. */
.sh-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 12px 12px 11px; color: #d6d6da; text-align: left; background: none; border: 1px solid var(--sh-edge); border-radius: 8px; cursor: pointer; }
.sh-card:hover { background: var(--sh-hi); }
.sh-card[aria-checked='true'] { color: #fff; background: var(--sh-hi); border-color: var(--ui-accent); }
.sh-card b { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.sh-card small { color: var(--sh-dim); font-size: 11px; line-height: 1.35; }
.sh-shape { order: -1; height: 28px; border: 1.5px solid currentColor; border-radius: 3px; opacity: 0.7; }
.sh-shape.tall { width: 16px; }
.sh-shape.wide { width: 50px; height: 28px; }

.sh-detail { display: flex; gap: 18px; margin-top: 6px; }
.sh-cover { flex: none; width: 280px; aspect-ratio: 16 / 9; align-self: flex-start; object-fit: cover; background: var(--sh-field); border-radius: 6px; }
.sh-cover.tall { width: 150px; aspect-ratio: 9 / 16; }
.sh-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.sh-side .sh-btn { align-self: stretch; }

.sh-mine { display: flex; flex-direction: column; gap: 10px; }
.sh-mine:empty { display: none; }
.sh-mine p { margin: 6px 0 0; padding-top: 14px; color: #b8b8bc; font-size: 12px; line-height: 1.45; border-top: 1px solid var(--sh-edge); }

/* Phones: a sheet from the bottom, full width. */
@media (max-width: 640px) {
  .share-backdrop { place-items: end stretch; padding: 0; }
  .share-panel { width: auto; max-height: 88vh; padding: 0 16px max(16px, env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
  .sh-top { margin: 0 -16px 4px; padding: 0 6px 0 10px; }
  .sh-thumb { width: 104px; }
  .sh-cards { grid-template-columns: 1fr; }
  .sh-card { flex-direction: row; align-items: center; gap: 12px; }
  .sh-card small { margin-left: auto; }
  .sh-detail { flex-direction: column; }
  .sh-cover { width: 100%; }
  .sh-cover.tall { width: 140px; }
}
