/* Balanced Pages (Space Race Agency, SFM 2026-11-18). Scoped to html.sfm-bal (added by balance.js), so nothing changes if the script fails. */

/* Boxes moved out of a too-tall sidebar: an even row under the main content */
html.sfm-bal .sfm-bal-row{display:grid;gap:16px;align-items:start;margin:0 0 var(--theme-widget-spacing,15px);container-type:inline-size}
html.sfm-bal .sfm-bal-row>.generic_layout_container{margin:0!important;min-width:0;box-sizing:border-box;border-radius:var(--theme-widget-radius);background:var(--theme-list-background-color);padding:.9375rem}
@container (max-width:560px){html.sfm-bal .sfm-bal-row{grid-template-columns:1fr!important}}
html.sfm-bal .bd-main>.sfm-bal-row>.bd-box{margin:0!important}
/* a business sidebar taller than the screen can't be sticky (its bottom would never show) */
html.sfm-bal .bd-cols:has(>.bd-main>.sfm-bal-row)>.bd-side{position:static}

/* Empty tabs and empty boxes never show */
html.sfm-bal .sfm-bal-empty{display:none!important}
html.sfm-bal .layout_left .theiaStickySidebar>.generic_layout_container:has(>h3:only-child),
html.sfm-bal .layout_right .theiaStickySidebar>.generic_layout_container:has(>h3:only-child){display:none!important}

/* Owner-only "Add to your profile" list */
html.sfm-bal .sfm-bal-todo{text-align:left}
html.sfm-bal .sfm-bal-todo h3{margin:0 0 6px;text-wrap:balance}
html.sfm-bal .sfm-bal-todo p{margin:0 0 10px;opacity:.8;text-wrap:pretty}
html.sfm-bal .sfm-bal-todo ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:8px;margin:0;padding:0;list-style:none}
html.sfm-bal .sfm-bal-todo li a{display:block;padding:10px 14px;border-radius:8px;border:1px solid var(--sp-accent,#4c9aff);color:var(--sp-accent,#4c9aff);font-weight:600;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.sfm-bal .sfm-bal-todo li a::before{content:"+ "}
html.sfm-bal .sfm-bal-todo li a:hover{background:var(--sp-accent,#4c9aff);color:#fff}

/* Thin profiles: one compact centered column (cover, name, then the work, then the facts) */
@media (min-width:768px){
  html.sfm-thin .layout_page_user_profile_index>.layout_top,
  html.sfm-thin .layout_page_user_profile_index>.layout_main{/* SFM 2026-11-24 full width: thin profiles no longer 900px */}
  /* SFM 2026-11-23 no-jump: the facts column shows UNDER the main column from the first paint (no late move) */
  html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left{order:2;width:100%!important;max-width:none!important;flex:1 1 100%;padding:0 10px!important;box-sizing:border-box}
  html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left>.theiaStickySidebar{position:static!important;transform:none!important;top:auto!important;width:auto!important;display:grid;gap:16px;margin:0 0 20px;padding:0!important}
  html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left>.theiaStickySidebar>.generic_layout_container{margin:0!important;min-width:0;box-sizing:border-box;border-radius:var(--theme-widget-radius);background:var(--theme-list-background-color);padding:.9375rem}
  html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left>.theiaStickySidebar>.generic_layout_container:empty{display:none!important}
  html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_middle{width:100%!important;max-width:none!important;flex:1 1 100%}
}
html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left:not(:has(.generic_layout_container)){display:none!important}
/* profile facts as an even grid of short items; the admin-only labels are noise for visitors */
html.sfm-thin .sfm-bal-facts .user_profile_info li.profile_type,
html.sfm-thin .sfm-bal-facts .user_profile_info li.profile_level,
html.sfm-thin .sfm-bal-facts .user_profile_info li.profile_updates{display:none!important}
html.sfm-thin .sfm-bal-facts{grid-template-columns:1fr!important}
/* the signed-in member's own Explore/Post links repeat the top menu; on a short profile they only add bulk */
html.sfm-thin .sfm-bal-facts>.layout_twitterclone_dashboard_links{display:none!important}
html.sfm-thin .sfm-bal-facts .user_profile_info ul{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 16px}
html.sfm-thin .sfm-bal-facts .user_profile_info ul[data-n="3"]{grid-template-columns:repeat(3,minmax(0,1fr))}
html.sfm-thin .sfm-bal-facts .user_profile_info ul[data-n="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}
html.sfm-thin .sfm-bal-facts .user_profile_info ul[data-n="1"]{grid-template-columns:1fr}
html.sfm-thin .sfm-bal-facts .user_profile_info li{margin:0!important;border:0!important;padding:0!important;min-width:0;align-items:flex-start}
html.sfm-thin .sfm-bal-facts .user_profile_info li>div{text-wrap:balance;overflow-wrap:anywhere}
@container (max-width:560px){
  html.sfm-thin .sfm-bal-facts .user_profile_info ul{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html.sfm-thin .sfm-bal-facts .user_profile_info ul[data-n="3"]{grid-template-columns:1fr!important}
  html.sfm-thin .sfm-bal-facts .user_profile_info ul[data-n="1"]{grid-template-columns:1fr!important}
}

/* Phones: one column, main content first (group/event pages keep Join/RSVP on top) */
@media (max-width:767px){
  html.sfm-bal body:not(#global_page_group-profile-index):not(#global_page_event-profile-index) #global_content .layout_main>.layout_middle{order:-1}
  html.sfm-bal .sfm-bal-row{grid-template-columns:1fr!important}
}

/* SFM 2026-11-23 no-jump: facts styled in place (left column under the main column) */
html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left .user_profile_info li.profile_type,html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left .user_profile_info li.profile_level,html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left .user_profile_info li.profile_updates{display:none!important}
html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left>.theiaStickySidebar>.layout_twitterclone_dashboard_links{display:none!important}
@media (min-width:768px){ html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left .user_profile_info ul{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none!important;gap:8px 16px} }
@media (max-width:767px){ html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left .user_profile_info ul{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px 16px} }
html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left .user_profile_info li{margin:0!important;border:0!important;padding:0!important;min-width:0;align-items:flex-start}
html.sfm-thin .layout_page_user_profile_index>.layout_main>.layout_left .user_profile_info li>div{text-wrap:balance;overflow-wrap:anywhere}
/* SFM 2026-11-24 phone: profile stats line wraps as whole items (no "7.1K / Friends" columns) */
@media (max-width:767px){.user_cover_info_stats{flex-wrap:wrap!important;justify-content:center!important;row-gap:4px}.user_cover_info_stats>div{white-space:nowrap;flex:0 0 auto!important}}
@media (max-width:767px){.user_cover_info_stats>div:first-child{flex:0 0 100%!important;text-align:center}.user_cover_info_stats>div:first-child+div::before{display:none!important}}
@media (max-width:767px){.user_cover_info_stats>div:first-child{display:flex!important;justify-content:center!important}}
/* SFM 2026-11-24 cover fit: tall/poster covers show whole, centered, on a soft blurred copy of themselves */
.user_cover_image.sfm-cover-fit{overflow:hidden;background:#111}
.user_cover_image.sfm-cover-fit::before{content:"";position:absolute;inset:-30px;background:var(--sfm-cov) center/cover no-repeat;filter:blur(28px) brightness(.55);z-index:0}
.user_cover_image.sfm-cover-fit img#user_cover_id{top:0!important;left:50%!important;height:100%!important;width:auto!important;max-width:none!important;transform:translateX(-50%);position:absolute!important;z-index:1;object-fit:contain}
