/* Theme-integrated tool pages: remove white gap before theme footer */

.cpb-tools-theme-main {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

.cpb-tool-theme-embedded {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

.cpb-tool-theme-embedded .advisory-section {
	margin-bottom: 0 !important;
}

.cpb-tool-theme-embedded .site-footer {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
	height: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
}

.cpb-tool-theme-embedded > p:empty,
.cpb-tool-theme-embedded .advisory-section + p:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	height: 0 !important;
}

/* Common theme wrappers add bottom padding under page content */
main:has(.cpb-tools-theme-main),
#primary:has(.cpb-tools-theme-main),
#content:has(.cpb-tools-theme-main),
.site-main:has(.cpb-tools-theme-main),
.entry-content:has(.cpb-tools-theme-main),
.page-content:has(.cpb-tools-theme-main),
main:has(.cpb-tool-theme-embedded),
#primary:has(.cpb-tool-theme-embedded),
#content:has(.cpb-tool-theme-embedded),
.site-main:has(.cpb-tool-theme-embedded),
.entry-content:has(.cpb-tool-theme-embedded),
.page-content:has(.cpb-tool-theme-embedded) {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

/* Theme footer often has top margin after page content */
body:has(.cpb-tools-theme-main) footer,
body:has(.cpb-tool-theme-embedded) footer,
body:has(.cpb-tools-theme-main) #colophon,
body:has(.cpb-tool-theme-embedded) #colophon {
	margin-top: 0 !important;
}
