/* Social publishing surfaces. Kept scoped so account dashboards retain their layout. */
body.social-feed-open { --sf-bg: #fff; --sf-ink: #161616; --sf-muted: #737373; --sf-line: #e8e8e8; --sf-soft: #f5f5f5; --sf-accent: #2878c7; background: var(--sf-bg) !important; }
body.social-feed-open[data-theme="dark"] { --sf-bg: #101010; --sf-ink: #eee; --sf-muted: #999; --sf-line: #292929; --sf-soft: #1c1c1c; --sf-accent: #71b3ef; }
body.social-feed-open .content { padding: 0 !important; background: var(--sf-bg); }
body.social-feed-open .topbar { display: none !important; }
body.social-feed-open #moduleSection { margin: 0 !important; padding: 0 0 112px !important; }
.sf-page, .sf-blog-page { color: var(--sf-ink); background: var(--sf-bg); font-size: 14px; line-height: 1.45; letter-spacing: 0; min-width: 0; }
.sf-page *, .sf-blog-page *, .sf-post-dialog *, .sf-reels-dialog * { box-sizing: border-box; }
.sf-page button, .sf-blog-page button, .sf-post button { font: inherit; color: inherit; cursor: pointer; }
.sf-page button:disabled, .sf-blog-page button:disabled, .sf-post button:disabled { opacity: .45; cursor: wait; }
.sf-page button:focus-visible, .sf-blog-page button:focus-visible, .sf-post button:focus-visible { outline: 2px solid var(--sf-accent, #2878c7); outline-offset: 3px; }
.sf-page svg, .sf-blog-page svg, .sf-post svg { width: 24px; height: 24px; flex-shrink: 0; }
.sf-top { position: sticky; top: 0; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 66px; padding: 0 max(24px, calc((100% - 980px) / 2)); border-bottom: 1px solid var(--sf-line); background: var(--sf-bg); }
.sf-wordmark { padding: 0; border: 0; background: none; font-family: Georgia, serif !important; font-size: 29px !important; font-style: italic !important; font-weight: 700 !important; }
.sf-top-actions { display: flex; align-items: center; gap: 12px; }
.sf-icon { width: 44px; height: 44px; padding: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; border: 0; background: none; color: inherit; border-radius: 5px; transition: opacity 150ms ease, background 150ms ease; }
.sf-icon:hover { opacity: .65; }
.sf-like.active { color: #ed4956; }
.sf-like.active svg, .sf-save.active svg { fill: currentColor; }
.sf-avatar { display: grid; place-items: center; width: 36px; height: 36px; min-width: 36px; flex: 0 0 36px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; overflow: hidden; }
.sf-initial { background: #e7efea; color: #3a6d50; font-size: 14px; font-weight: 600; }
.sf-profile-button { border: 0; padding: 5px; background: none; width: 44px; height: 44px; }
.sf-profile-button .sf-avatar { width: 30px; height: 30px; min-width: 30px; }
.sf-layout { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 280px); gap: 64px; max-width: 900px; margin: 0 auto; padding: 0 24px; }
.sf-stream { min-width: 0; }
.sf-tabs { display: flex; align-items: center; gap: 24px; height: 60px; border-bottom: 1px solid var(--sf-line); overflow-x: auto; scrollbar-width: none; }
.sf-tabs button { position: relative; flex: 0 0 auto; height: 100%; padding: 0; border: 0; background: none; color: var(--sf-muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.sf-tabs button[aria-selected="true"] { color: var(--sf-ink); }
.sf-tabs button[aria-selected="true"]::after { content: ''; position: absolute; height: 2px; left: 0; right: 0; bottom: 0; background: currentColor; }
.sf-authors { display: flex; gap: 18px; padding: 20px 0 12px; overflow-x: auto; scrollbar-width: none; }
.sf-authors button { flex: 0 0 66px; width: 66px; display: grid; justify-items: center; gap: 7px; border: 0; padding: 0; background: none; }
.sf-authors .sf-avatar { width: 60px; height: 60px; min-width: 60px; border: 1px solid var(--sf-line); font-size: 20px; }
.sf-authors button > span:last-child { font-size: 11px; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-post { min-width: 0; margin: 0 0 18px; border-bottom: 1px solid var(--sf-line, var(--line)); color: var(--sf-ink, var(--text)); background: var(--sf-bg, var(--panel)); }
.sf-author { display: flex; align-items: center; min-height: 64px; gap: 10px; padding: 10px 0; }
.sf-person { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.sf-author .sf-person { flex: 1; }
.sf-person > span:not(.sf-avatar) { display: grid; min-width: 0; gap: 1px; }
.sf-person strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-person small { color: var(--sf-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-follow { flex: 0 0 auto; min-height: 44px; padding: 6px 0; border: 0; color: var(--sf-accent, #2878c7) !important; background: none; font-size: 12px !important; font-weight: 600 !important; }
.sf-follow[aria-pressed="true"] { color: var(--sf-muted) !important; }
.sf-stage { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 3px; background: var(--sf-soft, #161616); touch-action: pan-y pinch-zoom; }
.sf-stage.is-video { background: #111; }
.sf-media { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-height: 0; min-width: 0; object-fit: contain; }
.sf-media-loading { position: absolute; top: calc(50% - 14px); left: calc(50% - 14px); width: 28px; height: 28px; border: 2px solid #aaa5; border-top-color: #aaa; border-radius: 50%; animation: sf-spin .8s linear infinite; pointer-events: none; }
.is-loaded > .sf-media-loading { display: none; }
.sf-media-error { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; background: var(--sf-soft, #222); color: var(--sf-muted, #aaa); }
.sf-media-error[hidden] { display: none; }
.sf-media-error button { padding: 8px 16px; background: var(--sf-bg, #333); border: 1px solid var(--sf-line, #444); border-radius: 5px; }
.sf-video-controls { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.sf-video-controls .sf-icon { pointer-events: auto; border-radius: 50%; color: #fff; background: #0007; width: 36px; height: 36px; flex-basis: 36px; padding: 9px; }
.sf-open-reel { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px; min-height: 36px; border: 0; border-radius: 5px; padding: 6px 10px; background: #0007; color: white !important; font-size: 12px !important; }
.sf-open-reel svg { width: 16px; height: 16px; }
.sf-actions { display: flex; align-items: center; margin: 3px -9px 0; }
.sf-actions .sf-save { margin-left: auto; }
.sf-post-details { padding: 0 0 14px; }
.sf-likes { display: block; margin: 0 0 5px; font-size: 13px; font-weight: 600; }
.sf-caption { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.sf-caption strong { font-weight: 600; }
.sf-caption [data-sf-caption] { white-space: pre-line; }
.sf-caption:has(.sf-expand):not(.expanded) [data-sf-caption] { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-text { padding: 0; border: 0; background: none; text-align: left; color: var(--sf-muted, var(--muted)) !important; font-size: 13px !important; }
.sf-expand { margin-left: 4px; min-height: 30px; }
.sf-comments-link { display: block; min-height: 32px; margin-top: 3px; }
.sf-post time { display: block; color: var(--sf-muted, var(--muted)); font-size: 10px; text-transform: uppercase; }
.sf-heart-burst { position: absolute; pointer-events: none; opacity: 0; color: #fff; filter: drop-shadow(0 2px 8px #0004); }
.sf-heart-burst svg { width: 86px; height: 86px; fill: currentColor; }
.show-heart .sf-heart-burst { animation: sf-heart 700ms ease both; }
.sf-sidebar { padding-top: 32px; align-self: start; position: sticky; top: 66px; }
.sf-sidebar-self, .sf-suggestion { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.sf-sidebar h3 { font-size: 13px; color: var(--sf-muted); margin: 28px 0 18px; font-weight: 600; }
.sf-copyright { font-size: 11px; color: var(--sf-muted); margin-top: 30px; }
.sf-empty { display: grid; justify-items: center; text-align: center; align-content: center; min-height: 310px; padding: 32px 16px; }
.sf-empty > svg { width: 48px; height: 48px; padding: 10px; border: 1px solid currentColor; border-radius: 50%; }
.sf-empty h3 { font-size: 20px; margin: 18px 0 5px; }
.sf-empty p { color: var(--sf-muted); font-size: 14px; margin: 0 0 16px; }
.sf-primary, .sf-secondary { padding: 9px 16px; min-height: 38px; border: 0; border-radius: 6px; font-weight: 600 !important; font-size: 13px !important; }
.sf-primary { color: white !important; background: #2878c7; }
.sf-secondary { background: var(--sf-soft); }
.sf-load-more { display: block; margin: 15px auto 30px; background: none; color: var(--sf-accent) !important; border: 0; min-height: 44px; }
.sf-blog-page { max-width: 930px; margin: 0 auto; }
.sf-blog-page .sf-top { padding: 0 18px; }
.sf-blog-title { flex: 1; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-profile-header { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 35px; padding: 36px 36px 30px; }
.sf-avatar.sf-avatar-large { width: 136px; height: 136px; min-width: 136px; font-size: 44px; justify-self: center; }
.sf-profile-info { min-width: 0; }
.sf-profile-info h2 { font-size: 22px; font-weight: 400; margin: 0 0 16px; overflow-wrap: anywhere; }
.sf-profile-stats { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 18px; font-size: 14px; }
.sf-profile-info > strong { display: block; font-size: 14px; }
.sf-profile-info p { white-space: pre-line; overflow-wrap: anywhere; margin: 5px 0; }
.sf-profile-info small { color: var(--sf-muted); font-size: 12px; }
.sf-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sf-grid-heading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; border-top: 1px solid var(--sf-line); font-size: 12px; font-weight: 600; }
.sf-grid-heading svg { width: 16px; height: 16px; }
.sf-profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.sf-profile-grid > button { position: relative; padding: 0; border: 0; aspect-ratio: 3 / 4; overflow: hidden; background: var(--sf-soft); }
.sf-profile-grid img, .sf-profile-grid video { width: 100%; height: 100%; display: block; object-fit: cover; }
.sf-grid-video { position: absolute; top: 8px; right: 8px; color: white; filter: drop-shadow(0 1px 3px #0008); }
.sf-grid-stats { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: white; background: #0005; opacity: 0; transition: opacity 150ms; }
.sf-profile-grid > button:hover .sf-grid-stats, .sf-profile-grid > button:focus-visible .sf-grid-stats { opacity: 1; }
.sf-post-dialog, .sf-reels-dialog { --sf-bg: var(--panel); --sf-ink: var(--text); --sf-muted: var(--muted); --sf-line: var(--line); --sf-soft: var(--panel-soft); --sf-accent: #2878c7; }
.modal.sf-post-dialog { width: min(560px, calc(100vw - 24px)); }
.modal.sf-post-dialog .modal-body { padding: 0 16px; }
.sf-reels-page .sf-layout { grid-template-columns: minmax(0, 1fr); max-width: 590px; }
.sf-reels-page .sf-sidebar { display: none; }
.sf-reels-list { height: calc(100dvh - 240px); min-height: 300px; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; scrollbar-width: none; }
.sf-reel { position: relative; height: 100%; min-height: 300px; margin: 0; border: 0; border-radius: 6px; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; background: #080808; color: #fff; }
.sf-reel .sf-stage { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-radius: 0; }
.sf-reel .sf-media { object-fit: contain; }
.sf-reel .sf-author { position: absolute; bottom: 90px; left: 16px; right: 68px; z-index: 2; padding: 0; min-height: 44px; text-shadow: 0 1px 3px #000; }
.sf-reel .sf-person small { display: none; }
.sf-reel .sf-follow { color: #fff !important; border: 1px solid #fff8; min-height: 30px; border-radius: 4px; padding: 3px 7px; }
.sf-reel .sf-post-bottom { position: absolute; bottom: 0; left: 0; right: 0; pointer-events: none; background: linear-gradient(transparent, #000a); padding-top: 100px; }
.sf-reel .sf-actions { position: absolute; right: 8px; bottom: 100px; display: grid; gap: 14px; pointer-events: auto; }
.sf-reel .sf-actions .sf-icon { display: grid; justify-items: center; height: auto; padding: 4px; color: #fff; filter: drop-shadow(0 1px 4px #000); }
.sf-reel .sf-actions .sf-like.active { color: #ff4d68; }
.sf-reel .sf-icon > span { font-size: 12px; }
.sf-reel .sf-actions .sf-save { margin: 0; }
.sf-reel .sf-post-details { padding: 0 72px 42px 16px; min-height: 85px; pointer-events: auto; }
.sf-reel .sf-likes, .sf-reel .sf-comments-link, .sf-reel time, .sf-reel .sf-caption > strong { display: none; }
.sf-reel .sf-caption { font-size: 13px; max-height: 44px; overflow-y: auto; }
.sf-reel .sf-caption.expanded { max-height: 100px; }
.sf-reel .sf-text { color: #ddd !important; }
.sf-reel .sf-video-controls { top: 12px; bottom: auto; z-index: 3; }
.sf-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; border: 0; appearance: none; }
.sf-progress::-webkit-progress-bar { background: #ffffff30; }
.sf-progress::-webkit-progress-value { background: #fff; }
.sf-progress::-moz-progress-bar { background: #fff; }
.modal.sf-reels-dialog { width: min(470px, calc(100vw - 16px)); }
.modal.sf-reels-dialog .modal-body { padding: 0; overflow: hidden; }
.sf-reels-dialog .sf-reels-list { height: min(72dvh, 760px); }
.sf-upload-preview { width: 100%; height: 280px; background: #111; border-radius: 6px; overflow: hidden; }
.sf-upload-preview[hidden] { display: none; }
.sf-upload-preview img, .sf-upload-preview video { display: block; width: 100%; height: 100%; object-fit: contain; }
.modal.social-comments-dialog { width: min(520px, calc(100vw - 20px)); }
.social-comment-form { display: flex; width: 100%; align-items: center; gap: 8px; }
.social-comment-form input { flex: 1; min-width: 0; }
.sf-comment-send { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 0; background: none; color: #2878c7; cursor: pointer; }
.sf-comment-send svg { width: 24px; height: 24px; }
.sf-stage .sf-video-controls { inset: 0; display: block; }
.sf-video-controls [data-sf-play] { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; padding: 14px; opacity: .9; }
.sf-stage.is-playing [data-sf-play] { opacity: .15; }
.sf-stage [data-sf-play]:hover, .sf-stage [data-sf-play]:focus-visible { opacity: .9; }
.sf-video-controls [data-sf-mute] { position: absolute; right: 12px; bottom: 12px; }
.sf-reel .sf-actions { bottom: 82px; gap: 12px; }
.sf-reel .sf-author { bottom: 74px; }
.sf-reel:has(.sf-promotion) .sf-author { bottom: 120px; }
.sf-reel .sf-post-details { padding-bottom: 18px; min-height: 64px; }
.sf-promotion { display: flex; align-items: center; gap: 8px; border: 1px solid var(--sf-line); border-radius: 5px; padding: 7px 10px; background: var(--sf-soft); margin-top: 8px; min-height: 36px; max-width: 100%; text-align: left; font-size: 12px !important; overflow-wrap: anywhere; }
.sf-reel .sf-promotion { color: #fff; border-color: #ffffff40; background: #ffffff20; max-height: 40px; overflow: hidden; }
.sf-share-targets { display: grid; gap: 16px; }
.sf-share-list { max-height: 45dvh; overflow-y: auto; }
.sf-share-list label { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sf-share-list label[hidden] { display: none; }
.sf-share-list input { width: 20px; height: 20px; flex: 0 0 20px; }
.sf-share-list span { display: grid; min-width: 0; }
.sf-share-list small { color: var(--muted); }
@keyframes sf-spin { to { transform: rotate(360deg); } }
@keyframes sf-heart { 0% { opacity: 0; transform: scale(.5); } 25%, 65% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1); } }
@media (max-width: 1050px) { .sf-layout { grid-template-columns: minmax(0, 500px); max-width: 548px; } .sf-sidebar { display: none; } }
@media (max-width: 720px) {
  body.social-feed-open #moduleSection { padding-bottom: var(--mobile-bottom-nav-height, 78px) !important; }
  .sf-top { height: 56px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .sf-wordmark { font-size: 27px !important; }
  .sf-top-actions { gap: 3px; }
  .sf-layout, .sf-reels-page .sf-layout { display: block; padding: 0; max-width: 100%; }
  .sf-tabs { height: 47px; padding: 0 16px; gap: 22px; }
  .sf-tabs button { font-size: 13px; }
  .sf-authors { padding: 15px 12px 8px; gap: 14px; }
  .sf-post { margin-bottom: 10px; }
  .sf-author { padding: 9px 12px; min-height: 60px; }
  .sf-stage { border-radius: 0; }
  .sf-post-bottom { padding: 0 12px; }
  .sf-post-details { padding-bottom: 12px; }
  .sf-profile-header { grid-template-columns: 76px minmax(0, 1fr); padding: 22px 14px; gap: 18px; }
  .sf-avatar.sf-avatar-large { width: 76px; height: 76px; min-width: 76px; font-size: 26px; }
  .sf-profile-info h2 { font-size: 18px; margin-bottom: 12px; }
  .sf-profile-stats { font-size: 12px; gap: 16px; margin-bottom: 12px; }
  .sf-profile-actions { margin-left: -94px; margin-top: 18px; }
  .sf-profile-grid { gap: 2px; }
  .sf-grid-stats { display: none; }
  .sf-reels-list { height: calc(100svh - 103px - var(--mobile-bottom-nav-height, 78px)); }
  .sf-reel { border-radius: 0; }
  .sf-reel .sf-post-bottom { padding: 100px 0 0; }
  .sf-reel .sf-author { padding: 0; }
  .modal.sf-post-dialog { width: calc(100vw - 16px); }
  .modal.sf-post-dialog .modal-body { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { .sf-page *, .sf-blog-page *, .sf-post * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition: none !important; } }
