/* Connect and member profiles share card visuals; page and composer layouts stay scoped. */
#page-social, .connect-card-surface {
    --soc-bg: #F6FBFF;
    --soc-surface: #FFFFFF;
    --soc-alt: #F1F5F9;
    --soc-ink: #222222;
    --soc-ink-2: #475569;
    --soc-muted: #64748B;
    --soc-border: #E0E0E0;
    --soc-accent: #0174B1;
    --soc-on-accent: #FFFFFF;
    --soc-art: #EEF4F9;
    --soc-skeleton: #E5EAF0;
    --soc-book-badge-bg: #E6F6EC;
    --soc-book-badge-fg: #14532D;
    --soc-book-badge-border: #B7E2C6;
    --soc-audio-badge-bg: #E0F2FE;
    --soc-audio-badge-fg: #075985;
    --soc-audio-badge-border: #BAE6FD;
    --soc-watch-badge-bg: #F1EBFD;
    --soc-watch-badge-fg: #4C1D95;
    --soc-watch-badge-border: #D9CBF8;
}
#page-social {
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(120px + var(--topnav-inset-top, 0px)) 24px 64px;
    background: var(--soc-bg);
    color: var(--soc-ink);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.dark-mode :is(#page-social, .connect-card-surface), html.dark-mode :is(#page-social, .connect-card-surface) {
    --soc-bg: #0F1620;
    --soc-surface: #1B2330;
    --soc-alt: #2E3A4A;
    --soc-ink: #F1F5F9;
    --soc-ink-2: #CBD3DC;
    --soc-muted: #94A3B2;
    --soc-border: #2E3A4A;
    --soc-accent: #00B4FF;
    --soc-on-accent: #0F1620;
    --soc-art: #141C27;
    --soc-skeleton: #2E3A4A;
    --soc-book-badge-bg: rgb(74 222 128 / 14%);
    --soc-book-badge-fg: #A7F3C0;
    --soc-book-badge-border: rgb(74 222 128 / 32%);
    --soc-audio-badge-bg: rgb(56 189 248 / 14%);
    --soc-audio-badge-fg: #BAE6FD;
    --soc-audio-badge-border: rgb(56 189 248 / 32%);
    --soc-watch-badge-bg: rgb(167 139 250 / 16%);
    --soc-watch-badge-fg: #D4C6FD;
    --soc-watch-badge-border: rgb(167 139 250 / 36%);
}
#page-social *, #page-social *::before, #page-social *::after { box-sizing: border-box; }
#page-social :is(a, button, textarea, input, [tabindex]):focus-visible { outline: 3px solid var(--soc-accent); outline-offset: 3px; }
#page-social button, #page-social input, #page-social textarea { font: inherit; }
#page-social a { text-underline-offset: 3px; }
#page-social .social-content { width: 100%; max-width: 1040px; margin: 0 auto; }
#page-social .social-header-section, #page-social .social-header-container { padding: 0; margin: 0; }
#page-social .social-header-content { text-align: left; }
#page-social .social-title { margin: 0; color: var(--soc-ink); font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
#page-social .social-subtitle { margin: 4px 0 0; color: var(--soc-ink-2); font-size: 16px; line-height: 1.5; }
#page-social .social-controls-section { margin-top: 16px; }
#page-social .social-feed-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--soc-border); border-radius: 10px; background: var(--soc-surface); }
#page-social .social-feed-tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 8px; background: transparent; color: var(--soc-ink-2); font-size: 15px; font-weight: 500; line-height: 1.2; cursor: pointer; }
#page-social .social-feed-tab.active { background: var(--soc-accent); color: var(--soc-on-accent); font-weight: 600; }
#page-social .social-feed-tab:not(.active):hover { background: var(--soc-alt); color: var(--soc-ink); }
#page-social .social-feed-section { margin-top: 16px; }
#page-social .social-feed-container { max-width: 720px; }
#page-social .social-compose-wrapper { margin-bottom: 16px; }
#page-social .social-compose-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--soc-border); border-radius: 14px; background: var(--soc-surface); box-shadow: 0 1px 2px rgb(2 6 23 / 5%); }
#page-social .social-compose-avatar { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; overflow: hidden; border: 1px solid var(--soc-border); border-radius: 50%; background: var(--soc-alt); color: var(--soc-muted); font-size: 14px; font-weight: 600; }
#page-social .social-compose-avatar img { width: 100%; height: 100%; object-fit: cover; }
#page-social .social-compose-input-wrapper { flex: 1; min-width: 0; min-height: 44px; padding: 10px 16px; border: 1px solid var(--soc-border); border-radius: 999px; background: var(--soc-bg); color: var(--soc-muted); text-align: left; font-size: 15px; line-height: 1.5; cursor: text; }
#page-social .social-compose-input-wrapper:hover { border-color: var(--soc-accent); }
#page-social .social-compose-expanded { flex: 1; min-width: 0; }
#page-social .social-compose-textarea { display: block; width: 100%; min-height: 112px; resize: vertical; padding: 12px 14px; border: 1px solid var(--soc-accent); border-radius: 10px; background: var(--soc-bg); color: var(--soc-ink); font-size: 15px; line-height: 1.5; }
#page-social .social-compose-textarea::placeholder { color: var(--soc-muted); }
#page-social .social-compose-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#page-social .social-compose-counter { margin-right: auto; color: var(--soc-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
#page-social .social-compose-cancel, #page-social .social-compose-btn, #page-social .social-feed-empty-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--soc-border); border-radius: 10px; background: var(--soc-surface); color: var(--soc-ink); font-size: 15px; font-weight: 600; line-height: 1.4; cursor: pointer; }
#page-social .social-compose-btn, #page-social .social-feed-empty-btn.primary { border-color: transparent; background: var(--soc-accent); color: var(--soc-on-accent); }
#page-social :is(.social-compose-btn, .social-compose-cancel, .social-feed-empty-btn):hover { filter: brightness(.95); }
#page-social button:disabled { opacity: .5; cursor: default; }
#page-social .social-feed-posts { display: flex; flex-direction: column; gap: 12px; }
#page-social .social-feed-post { min-width: 0; scroll-margin-top: var(--topnav-controls-top, 100px); }
#page-social .social-feed-post.highlighted { border-radius: 14px; outline: 3px solid var(--soc-accent); outline-offset: 3px; }

/* Reuse the current post card on Connect and member profiles. */
:is(#page-social, .connect-card-surface) .social-post-card { padding: 0; border: 1px solid var(--soc-border); border-radius: 14px; background: var(--soc-surface); color: var(--soc-ink); box-shadow: 0 1px 2px rgb(2 6 23 / 5%); }
:is(#page-social, .connect-card-surface) .social-post-card:hover { box-shadow: 0 1px 2px rgb(2 6 23 / 5%); }
:is(#page-social, .connect-card-surface) .social-post-header { gap: 12px; margin: 0; padding: 12px 8px 8px 16px; }
:is(#page-social, .connect-card-surface) .social-avatar { width: 40px; height: 40px; border: 1px solid var(--soc-border); background: var(--soc-alt); color: var(--soc-ink-2); font-size: 14px; }
:is(#page-social, .connect-card-surface) .social-post-meta { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
:is(#page-social, .connect-card-surface) .social-post-author { color: var(--soc-ink); font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
:is(#page-social, .connect-card-surface) .social-post-time { color: var(--soc-muted); font-size: 13px; line-height: 1.3; }
:is(#page-social, .connect-card-surface) .brm-trigger { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--soc-muted); }
:is(#page-social, .connect-card-surface) .brm-trigger:hover { background: var(--soc-alt); }
:is(#page-social, .connect-card-surface) .brm-popover { border-color: var(--soc-border); background: var(--soc-surface); }
:is(#page-social, .connect-card-surface) .brm-item { min-height: 44px; color: var(--soc-ink); }
:is(#page-social, .connect-card-surface) .brm-item:hover { background: var(--soc-alt); }
:is(#page-social, .connect-card-surface) .social-post-content { margin: 0; padding: 0 16px 12px; color: var(--soc-ink); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
:is(#page-social, .connect-card-surface) .social-post-usertext { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--soc-ink); font-size: 15px; line-height: 1.55; }
:is(#page-social, .connect-card-surface) .social-post-announcement { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
:is(#page-social, .connect-card-surface) .social-announcement-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; max-width: 100%; padding: 5px 12px 5px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: .06em; text-transform: uppercase; }
:is(#page-social, .connect-card-surface) .social-announcement-badge.book { background: var(--soc-book-badge-bg); color: var(--soc-book-badge-fg); border-color: var(--soc-book-badge-border); }
:is(#page-social, .connect-card-surface) .social-announcement-badge.audio { background: var(--soc-audio-badge-bg); color: var(--soc-audio-badge-fg); border-color: var(--soc-audio-badge-border); }
:is(#page-social, .connect-card-surface) .social-announcement-badge.watch { background: var(--soc-watch-badge-bg); color: var(--soc-watch-badge-fg); border-color: var(--soc-watch-badge-border); }
:is(#page-social, .connect-card-surface) .social-announcement-badge svg { flex: none; width: 16px; height: 16px; }
:is(#page-social, .connect-card-surface) .social-post-book-row.announcement, :is(#page-social, .connect-card-surface) .social-post-show-row { align-items: flex-start; gap: 20px; margin: 8px 0 4px; padding: 0; border: 0; border-radius: 0; background: transparent; }
:is(#page-social, .connect-card-surface) .social-post-book-row { gap: 12px; align-items: center; }
:is(#page-social, .connect-card-surface) .social-post-cover { display: block; flex: none; width: 72px; max-width: 30%; }
:is(#page-social, .connect-card-surface) .social-post-cover img, :is(#page-social, .connect-card-surface) .social-post-cover.small img, :is(#page-social, .connect-card-surface) .social-post-cover.large img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 4px; background: var(--soc-art); box-shadow: 0 2px 8px rgb(2 6 23 / 6%); }
:is(#page-social, .connect-card-surface) .announcement .social-post-cover { width: 120px; max-width: none; }
:is(#page-social, .connect-card-surface) .announcement .social-post-cover img { border-radius: 8px; box-shadow: 0 4px 12px rgb(2 6 23 / 12%); }
:is(#page-social, .connect-card-surface) .social-post-cover:hover img, :is(#page-social, .connect-card-surface) .social-post-show-art:hover img { transform: none; }
:is(#page-social, .connect-card-surface) .social-announcement-details { flex: 1; min-width: 0; gap: 4px; }
:is(#page-social, .connect-card-surface) .social-announcement-title { margin: 0; color: var(--soc-ink); font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
:is(#page-social, .connect-card-surface) .social-announcement-title a { color: var(--soc-ink); }
:is(#page-social, .connect-card-surface) .social-announcement-author { margin: 0; color: var(--soc-ink-2); font-size: 15px; font-weight: 500; line-height: 1.4; }
:is(#page-social, .connect-card-surface) .social-announcement-desc { display: -webkit-box; -webkit-line-clamp: 4; margin: 4px 0 0; color: var(--soc-ink); font-size: 15px; line-height: 1.5; }
:is(#page-social, .connect-card-surface) .social-post-cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
:is(#page-social, .connect-card-surface) .social-cta-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 10px 18px; border: 0; border-radius: 10px; background: var(--soc-accent); color: var(--soc-on-accent); font-size: 15px; font-weight: 600; line-height: 1.3; box-shadow: none; }
:is(#page-social, .connect-card-surface) .social-cta-btn:hover { filter: brightness(.95); transform: none; box-shadow: none; }
:is(#page-social, .connect-card-surface) .social-post-show-row { flex-wrap: wrap; }
:is(#page-social, .connect-card-surface) .social-post-show-art { width: 300px; max-width: 100%; }
:is(#page-social, .connect-card-surface) .social-post-show-art img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 10px; background: var(--soc-art); box-shadow: 0 4px 12px rgb(2 6 23 / 12%); }
:is(#page-social, .connect-card-surface) .social-post-show-row .social-announcement-details { min-width: min(220px, 100%); }
:is(#page-social, .connect-card-surface) .reading-book { padding: 12px; gap: 16px; border: 1px solid var(--soc-border); border-radius: 10px; }
:is(#page-social, .connect-card-surface) .social-reading-details { min-width: 0; }
:is(#page-social, .connect-card-surface) .social-reading-title { margin: 0; color: var(--soc-ink); font-size: 17px; font-weight: 700; line-height: 1.3; }
:is(#page-social, .connect-card-surface) .social-reading-title a { color: inherit; }
:is(#page-social, .connect-card-surface) .social-reading-author { margin: 4px 0 0; color: var(--soc-ink-2); font-size: 14px; line-height: 1.4; }
:is(#page-social, .connect-card-surface) .social-post-activity { gap: 8px; margin-bottom: 8px; }
:is(#page-social, .connect-card-surface) .social-activity-icon { width: 24px; height: 24px; border-radius: 0; background: transparent; color: var(--soc-muted); }
:is(#page-social, .connect-card-surface) .social-activity-icon svg { width: 18px; height: 18px; }
:is(#page-social, .connect-card-surface) .social-activity-text { color: var(--soc-ink-2); font-size: 14px; line-height: 1.5; }
:is(#page-social, .connect-card-surface) .social-book-link { color: var(--soc-accent); font-weight: 600; }
:is(#page-social, .connect-card-surface) .social-post-review, :is(#page-social, .connect-card-surface) .social-post-comment-text { padding: 12px; background: var(--soc-bg); color: var(--soc-ink); font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
:is(#page-social, .connect-card-surface) .social-post-actions { display: flex; gap: 0; margin: 0; padding: 4px 8px; border-top: 1px solid var(--soc-border); }
:is(#page-social, .connect-card-surface) .social-action-btn { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; padding: 8px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--soc-ink-2); font-size: 13px; font-weight: 500; line-height: 1.3; }
:is(#page-social, .connect-card-surface) .social-action-btn:hover { background: var(--soc-alt); color: var(--soc-accent); }
:is(#page-social, .connect-card-surface) .social-action-btn.liked { color: var(--soc-accent); }
:is(#page-social, .connect-card-surface) .social-action-btn svg { flex: none; width: 18px; height: 18px; }
:is(#page-social, .connect-card-surface) .social-action-btn .action-count { font-size: inherit; }
:is(#page-social, .connect-card-surface) .social-post-comments { padding: 12px 16px; border-top: 1px solid var(--soc-border); background: transparent; }
:is(#page-social, .connect-card-surface) .social-comment-form { display: flex; gap: 8px; align-items: center; }
:is(#page-social, .connect-card-surface) .social-comment-input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--soc-border); border-radius: 10px; background: var(--soc-bg); color: var(--soc-ink); font-size: 14px; }
:is(#page-social, .connect-card-surface) .social-comment-input::placeholder { color: var(--soc-muted); }
:is(#page-social, .connect-card-surface) .social-comment-submit { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: var(--soc-accent); color: var(--soc-on-accent); }
:is(#page-social, .connect-card-surface) .social-comment { gap: 8px; padding: 12px 0 0; border: 0; background: transparent; }
:is(#page-social, .connect-card-surface) .social-comment-content { min-width: 0; background: transparent; color: var(--soc-ink); }
:is(#page-social, .connect-card-surface) .social-comment-author { color: var(--soc-ink); font-size: 14px; }
:is(#page-social, .connect-card-surface) .social-comment-text { color: var(--soc-ink-2); overflow-wrap: anywhere; }
:is(#page-social, .connect-card-surface) .social-comment-time { color: var(--soc-muted); font-size: 12px; }
:is(#page-social, .connect-card-surface) .social-comment-avatar { width: 32px; height: 32px; background: var(--soc-alt); color: var(--soc-muted); }
:is(#page-social, .connect-card-surface) .social-comment.highlighted { outline: 2px solid var(--soc-accent); outline-offset: 2px; border-radius: 8px; }

/* Real data states. Failed pagination retains the loaded cards and its offset. */
#page-social .social-feed-empty, #page-social .social-feed-error { padding: 28px; border: 1px solid var(--soc-border); border-radius: 14px; background: var(--soc-surface); text-align: left; }
#page-social .social-feed-empty-icon { margin-bottom: 12px; }
#page-social .social-feed-empty-icon i, #page-social .social-feed-error > i { color: var(--soc-muted); font-size: 32px; }
#page-social .social-feed-empty-title, #page-social .social-feed-error h2 { margin: 12px 0 0; color: var(--soc-ink); font-size: 20px; font-weight: 700; line-height: 1.3; }
#page-social .social-feed-empty-description, #page-social .social-feed-error p, #page-social .social-feed-retry p { margin: 8px 0 20px; color: var(--soc-ink-2); font-size: 15px; line-height: 1.5; }
#page-social .social-feed-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#page-social .social-feed-empty-suggestions { margin-top: 20px; }
#page-social .social-feed-retry { margin-top: 16px; padding: 16px; border: 1px solid var(--soc-border); border-radius: 10px; background: var(--soc-surface); }
#page-social .social-feed-loading-more { display: flex; justify-content: center; gap: 8px; padding: 20px 0; color: var(--soc-muted); font-size: 14px; }
#page-social .social-feed-end { display: flex; align-items: center; gap: 12px; padding: 24px 0; }
#page-social .social-feed-end-line { flex: 1; height: 1px; background: var(--soc-border); }
#page-social .social-feed-end-text { color: var(--soc-muted); font-size: 13px; }
#page-social .social-feed-skeletons { display: grid; gap: 12px; }
#page-social .social-feed-skeleton { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--soc-border); border-radius: 14px; background: var(--soc-surface); }
#page-social .social-feed-skeleton span { display: block; height: 14px; width: 90%; border-radius: 4px; background: var(--soc-skeleton); }
#page-social .social-feed-skeleton > span:nth-child(3) { width: 70%; }
#page-social .social-feed-skeleton > span:last-child { width: 100%; height: 44px; margin-top: 8px; }
#page-social .social-skeleton-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
#page-social .social-skeleton-heading > span { flex: none; width: 40px; height: 40px; border-radius: 50%; }
#page-social .social-skeleton-heading > div { flex: 1; display: grid; gap: 8px; }
#page-social .social-skeleton-heading > div span { width: 40%; }
#page-social .social-skeleton-heading > div span:last-child { width: 24%; height: 12px; }
.social-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.connect-page-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 70vh; padding: calc(120px + var(--topnav-inset-top, 0px)) 24px 64px; background: #F6FBFF; color: #64748B; font: 15px/1.5 'Inter', system-ui, sans-serif; }
body.dark-mode .connect-page-loading { background: #0F1620; color: #94A3B2; }
.connect-page-loading-spinner, #page-social .social-feed-spinner { width: 32px; height: 32px; border: 3px solid #CBD3DC; border-top-color: #0174B1; border-radius: 50%; animation: social-spin .8s linear infinite; }
#page-social .social-feed-spinner.small { width: 20px; height: 20px; border-top-color: var(--soc-accent); }
@keyframes social-spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
    #page-social { padding: calc(104px + var(--topnav-inset-top, 0px)) 16px calc(112px + env(safe-area-inset-bottom, 0px)); }
    #page-social .social-title { font-size: 28px; }
    :is(#page-social, .connect-card-surface) .social-post-cover { width: 64px; }
    :is(#page-social, .connect-card-surface) .announcement .social-post-cover { width: 104px; }
    :is(#page-social, .connect-card-surface) .social-post-book-row.announcement { gap: 16px; }
    :is(#page-social, .connect-card-surface) .social-announcement-title { font-size: 18px; }
    #page-social .social-feed-empty, #page-social .social-feed-error { padding: 20px; }
    :is(#page-social, .connect-card-surface) .social-post-show-row { flex-direction: column; align-items: stretch; gap: 16px; }
    :is(#page-social, .connect-card-surface) .social-post-show-art { width: 100%; max-width: none; }
}
@media (max-width: 360px) {
    :is(#page-social, .connect-card-surface) .social-post-book-row.announcement { flex-wrap: wrap; }
    :is(#page-social, .connect-card-surface) .social-post-book-row.announcement .social-announcement-details { flex-basis: 140px; }
    :is(#page-social, .connect-card-surface) .social-action-btn { gap: 4px; font-size: 12px; }
    :is(#page-social, .connect-card-surface) .social-action-btn svg { width: 16px; height: 16px; }
    #page-social .social-compose-actions { gap: 6px; }
    #page-social .social-compose-cancel, #page-social .social-compose-btn { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    #page-social *, #page-social *::before, #page-social *::after, .connect-page-loading-spinner { animation: none !important; transition: none !important; }
}
