/* One gap between page sections and cards; children do not add margins to it. */
:root{--page-section-gap:12px}
body[data-home-layout="compact"]{--home-section-gap:var(--page-section-gap)}
body .page.active{
 display:flex;flex-direction:column;gap:var(--page-section-gap)
}
body .page:is(#page-home,#page-news,#page-spaces,#page-tokencheck,#page-messages,#page-profile,#page-launchpad)>*{
 margin-block:0!important;min-width:0
}
body .page>div:empty{display:none!important}

/* Nested page layouts keep the same spacing when navigating into a Space,
   switching news views or opening a member's profile. */
body :is(#spaceDirectory,#officialSpaceView,#memberProfile,#publicProfilePage,#newsListing):not([hidden]){
 display:flex;flex-direction:column;gap:var(--page-section-gap)
}
body .page :is(#spaceDirectory,#officialSpaceView,#memberProfile,#publicProfilePage,#newsListing)>*{
 margin-block:0!important;min-width:0
}
body :is(#spaceDirectory,#officialSpaceView,#memberProfile,#publicProfilePage,#newsListing)>div:empty{
 display:none!important
}
body #officialSpaceView>#backToSpaces{align-self:flex-start}
body #spaceDirectory :is(#yourSpaces,#officialSpacesSection,#communitySection),
body #officialSpaceView #spaceHighlights,
body #page-launchpad :is(#launchTrendingSection,#launchFeaturedSection,#allLaunches){
 display:flex;flex-direction:column;gap:var(--page-section-gap)
}
body #spaceDirectory :is(#yourSpaces,#officialSpacesSection,#communitySection)>*,
body #officialSpaceView #spaceHighlights>*,
body #page-launchpad :is(#launchTrendingSection,#launchFeaturedSection,#allLaunches)>*{
 margin-block:0!important
}

/* Collection gaps apply to posts and news as well as other card grids. */
body :is(#feed,#newsList,#homeNews,#sharedPost,#launchList,#launchFeatured,
 #messagesList){display:grid;gap:var(--page-section-gap)!important}
body :is(#feed,#newsList,#homeNews,#sharedPost,#launchList,#launchFeatured,
 #messagesList,#spaceHighlightItems)>*{margin-block:0!important;min-width:0}
body :is(.space-grid,.community-grid,.news-grid,.showcase,.profile-stats-grid,
 .charts-workspace,.analytics-metrics,.market-cards,.nft-grid){gap:var(--page-section-gap)!important}
body #spaceDirectory #yourSpacesRail,body #page-launchpad .launch-trending,
body #officialSpaceView #spaceHighlightItems{
 gap:var(--page-section-gap)!important
}
body .news-filters{padding-bottom:0}

/* Three complete watchlist cards still fit, with the shared 12px card gap. */
body .growth-hub .growth-dashboard{gap:var(--page-section-gap)!important}
body .growth-hub .growth-coin{
 flex-basis:calc((100% - var(--page-section-gap) * 2) / 3)!important
}
