/* Second batch: collab posts, remix credit, downloads, the app-only sheet, the reels rail counts. */

/* Header: "author and jo" / "author and 2 others" (+ popover), stacked avatars. */
.post-authors { position: relative; display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.post-authors > .username-row { min-width: 0; }
.post-authors-and { color: var(--text-primary); font-weight: 400; flex: none; }
.post-authors-more { font: inherit; font-weight: 600; color: var(--text-primary); background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.post-authors-more:hover { color: var(--text-secondary); }
.authors-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px; max-width: 300px; padding: 6px; display: grid; gap: 2px; }
.authors-pop-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--text-primary); }
.authors-pop-row:hover { background: var(--bg-raised); }
.authors-pop-text { display: grid; min-width: 0; line-height: 1.25; font-size: 14px; }
.authors-pop-text .t-meta { font-size: 13px; }
.avatar-stack { position: relative; flex: none; width: var(--s); height: var(--s); }
.avatar-stack .avatar { position: absolute; --size: calc(var(--s) * 0.72); }
.avatar-stack .avatar:first-child { left: 0; top: 0; }
.avatar-stack .avatar + .avatar { right: 0; bottom: 0; box-shadow: 0 0 0 2px var(--bg-base); border-radius: 50%; }
.pw-head .avatar-stack .avatar + .avatar, .post-card .avatar-stack .avatar + .avatar { box-shadow: 0 0 0 2px var(--bg-base); }
.reel-author .post-authors-and, .reel-author .post-authors-more { color: #fff; }

/* "Remix of @name · Green screen" / "Original deleted". */
.remix-credit { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: 2px 0 6px; font-size: 13px; color: var(--text-secondary); }
.remix-credit strong { color: var(--text-primary); font-weight: 600; }
a.remix-credit:hover strong { text-decoration: underline; }
.remix-credit .icon { width: 14px; height: 14px; flex: none; }
.remix-credit.is-gone { font-style: normal; opacity: 0.8; }
.pw-foot .remix-credit { margin: 4px 16px 0; }
.reel-overlay .remix-credit { color: rgba(255, 255, 255, 0.85); margin: 0 0 6px; }
.reel-overlay .remix-credit strong { color: #fff; }

/* Feed: a single photo / video opens the post window. */
.post-card .post-media[data-pw-open] { cursor: pointer; }

/* Reels rail: five compact counts (like, comment, repost, share, save). */
.reel-rail { gap: 14px; }
.reel-count { font-size: 12px; line-height: 14px; min-height: 0; }
.reel-count:empty { display: none; }
.reel-action { gap: 2px; }

/* Download pill ("Preparing video…"), above the toasts. */
.dl-pills { position: fixed; left: 50%; bottom: 84px; z-index: 121; transform: translateX(-50%); display: grid; gap: 6px; pointer-events: none; }
.dl-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: var(--bg-raised); color: var(--text-primary); box-shadow: var(--shadow-sheet); font-size: 14px; font-weight: 600; animation: toast-in 200ms var(--ease-sheet) both; }
.dl-pill .spinner { width: 16px; height: 16px; }
@media (max-width: 767px) { .dl-pills { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 72px); } }
@media (min-width: 768px) { .is-signed-in .dl-pills { left: calc(50% + var(--sidebar-w) / 2); } }

/* "Available in the app" sheet. */
.app-sheet-body { display: grid; justify-items: center; gap: 8px; padding: 24px 24px 20px; text-align: center; }
.app-sheet-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raised); color: var(--text-primary); margin-bottom: 4px; }
.app-sheet-title { font-size: 18px; font-weight: 600; }
.app-sheet-body .btn { width: 100%; margin-top: 4px; }
.app-sheet-cta .icon { width: 18px; height: 18px; }
.app-sheet-note { display: inline-flex; align-items: center; gap: 6px; }

/* Composer + Edit post: collaborator chips and search. */
.collab-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.collab-chips .chip { padding-left: 4px; gap: 6px; color: var(--text-primary); }
.collab-chips .chip > span { color: var(--text-primary); font-weight: 600; }
.collab-chips .chip > .t-meta { font-weight: 400; color: var(--text-secondary); }
.collab-chips .chip .avatar, .chip-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.cm-row.cm-collab { display: grid; gap: 10px; align-items: start; padding: 12px 16px; }
.cm-collab-head { display: flex; align-items: center; gap: 12px; }
.cm-collab-field { position: relative; }
.cm-collab-field .input { width: 100%; }
.cm-places.cm-collab-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 6; margin: 0; padding: 4px 0; list-style: none; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); box-shadow: var(--shadow-sheet); }
.cm-places.cm-collab-results .cm-user { display: flex; padding: 8px 12px; }
.cm-collab > .t-meta { font-size: 13px; }
.ep-collabs { display: grid; gap: 10px; }
.ep-places .collab-result { display: flex; flex-direction: row; align-items: center; gap: 10px; width: 100%; text-align: left; }
.collab-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-subtle); border-radius: 12px; }
.collab-result > span { display: grid; line-height: 1.25; }
.ep-toggles { display: grid; gap: 4px; }
.ep-toggles .cm-setting { display: flex; align-items: center; gap: 12px; }
.ep-toggles .cm-setting p { margin: 0; }

/* Manage collaborators dialog. */
.collab-note { padding: 0 16px 8px; margin: 0; font-size: 13px; }
.collab-search { padding: 8px 16px; }

/* Notifications: collab invite actions. */
.activity-actions { display: inline-flex; gap: 8px; flex: none; }
.activity-state { flex: none; font-size: 13px; color: var(--text-secondary); }
@media (max-width: 560px) {
  .activity-row.is-collab-invite:has(.activity-actions) { flex-wrap: wrap; row-gap: 8px; }
  .activity-row.is-collab-invite .activity-text { flex-basis: calc(100% - 56px); }
  .activity-row.is-collab-invite .activity-actions { margin-left: 56px; }
  .activity-row.is-collab-invite .activity-actions .btn { min-width: 96px; }
}

/* Composer "People": Tag people vs Invite collaborators, each with a one-line explanation. */
.cm-people { flex: none; display: grid; gap: 2px; margin: 12px 0 0; padding: 4px; min-width: 0; border: 1px solid var(--border-subtle); border-radius: 12px; }
.cm-people-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-primary); text-align: left; cursor: pointer; font: inherit; }
.cm-people-row:hover { background: var(--bg-raised); }
.cm-people-row > .icon:last-child { color: var(--text-secondary); flex: none; }
.cm-people-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raised); }
.cm-people-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.cm-people-title { font-weight: 600; font-size: 15px; }
.cm-people-desc { font-size: 13px; color: var(--text-secondary); }
.cm-people-count { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-flash); color: var(--on-flash); font-size: 12px; font-weight: 600; }
.cm-people-chips { padding: 2px 10px 8px 58px; min-width: 0; }
.cm-people-chips .chip, .cm-chips.collab-chips .chip { max-width: 100%; white-space: normal; border-radius: 12px; padding-top: 4px; padding-bottom: 4px; }
.collab-chips .chip > .t-meta { font-size: 12px; line-height: 16px; }
@media (max-width: 560px) { .cm-people-chips { padding-left: 10px; } }
.cm-people-chips .chip, .cm-chips.collab-chips .chip { height: auto; min-height: 32px; flex-wrap: wrap; row-gap: 0; }
.cm-tag-vs-collab { margin: 0 0 8px; }

/* Post header: pending invites (author / invitee only), the "Collab" badge, the invitee banner. */
.post-authors-pending { color: var(--text-secondary); font-weight: 400; display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.post-authors-pending .username-row, .post-authors-pending .username { color: var(--text-secondary); }
.post-authors-pending-label { white-space: nowrap; font-size: 13px; }
.collab-badge { display: inline-flex; align-items: center; gap: 3px; flex: none; height: 18px; padding: 0 6px; border: 0; border-radius: 9px; background: var(--bg-raised); color: var(--text-primary); font: inherit; font-size: 11px; font-weight: 600; line-height: 18px; cursor: pointer; }
.collab-badge .icon { width: 12px; height: 12px; }
.collab-badge:hover { background: var(--border-subtle); }
.reel-author .collab-badge { background: rgba(255, 255, 255, 0.2); color: #fff; }
.reel-author .post-authors-pending, .reel-author .post-authors-pending .username { color: rgba(255, 255, 255, 0.75); }
.authors-pop-manage { display: flex; justify-content: center; padding: 6px 8px 2px; border-top: 1px solid var(--border-subtle); margin-top: 4px; }
.collab-banner { display: flex; align-items: center; gap: 10px; margin: 0 16px 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-raised); font-size: 14px; color: var(--text-primary); }
.collab-banner > .icon { flex: none; color: var(--text-secondary); }
.collab-banner-text { flex: 1; min-width: 0; line-height: 1.3; }
.collab-banner-actions { display: inline-flex; gap: 8px; flex: none; }
.pw-panel .collab-banner { margin: 8px 16px; }
@media (max-width: 480px) { .collab-banner { flex-wrap: wrap; } .collab-banner-actions { width: 100%; } .collab-banner-actions .btn { flex: 1; } }

/* Grid tiles: accepted collab posts. */
.tile-collab { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); color: #fff; pointer-events: none; }
.tile-collab .icon { width: 14px; height: 14px; }
/* Collab headers wrap instead of truncating both names ("alex and amelia · Invite pending" on phones). */
.post-head-line:has(.post-authors-pending, .collab-badge) { flex-wrap: wrap; row-gap: 2px; }
.post-authors:has(.post-authors-pending, .collab-badge) { flex-wrap: wrap; row-gap: 2px; max-width: 100%; }
.post-authors-pending .username-row { min-width: 0; }
.post-authors-pending-label.is-button { font: inherit; font-size: 13px; color: var(--text-secondary); background: none; border: 0; padding: 0; cursor: pointer; }
.post-authors-pending-label.is-button:hover { text-decoration: underline; color: var(--text-primary); }
