.aec-bpb-wrap,
.aec-bpb-frontend-wrap {
	max-width: 100%;
}

.aec-bpb-wrap *,
.aec-bpb-frontend-wrap * {
	box-sizing: border-box;
}

.aec-bpb-layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 20px;
	align-items: start;
	max-width: 100%;
}

.aec-bpb-sidebar {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.aec-bpb-main {
	grid-column: 2;
	grid-row: 1;
}

.aec-bpb-actions {
	grid-column: 2;
	grid-row: 2;
}

.aec-bpb-sidebar-card,
.aec-bpb-panel,
.aec-bpb-repeatable-card,
.aec-bpb-group {
	background: #fff;
	border: 1px solid #1a1a1a;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.aec-bpb-sidebar-card,
.aec-bpb-panel,
.aec-bpb-group {
	padding: 16px;
}

.aec-bpb-sidebar-nav,
.aec-bpb-sticky {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.aec-bpb-nav-button.is-active {
	background: #fff !important;
	color: #111 !important;
	border-color: #111 !important;
}

.aec-bpb-sticky {
	position: sticky;
	top: 32px;
}

.aec-bpb-main {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.aec-bpb-panel {
	display: none;
}

.aec-bpb-panel.is-active {
	display: block;
}

.aec-bpb-fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.aec-bpb-fields--two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aec-bpb-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	color: #111;
}

.aec-bpb-field input[type="text"],
.aec-bpb-field input[type="email"],
.aec-bpb-field input[type="url"],
.aec-bpb-field input[type="date"],
.aec-bpb-field input[type="number"],
.aec-bpb-field select,
.aec-bpb-field textarea {
	width: 100%;
	max-width: 100%;
	background: #f3f3f3 !important;
	border: 1px solid #1a1a1a !important;
	color: #111 !important;
	border-radius: 6px !important;
	padding: 10px 12px !important;
	min-height: 42px;
}

.aec-bpb-field .wp-editor-wrap,
.aec-bpb-field .wp-editor-container,
.aec-bpb-field .mce-tinymce {
	max-width: 100%;
}

.aec-bpb-field .wp-editor-area {
	width: 100% !important;
}

.aec-bpb-field .wp-editor-container textarea,
.aec-bpb-field .mce-edit-area iframe {
	background: #fff !important;
}

.aec-bpb-field-checkbox label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
}

.aec-bpb-progress-bar {
	height: 10px;
	background: #d7d7d7;
	border-radius: 999px;
	overflow: hidden;
	margin: 10px 0 8px;
}

.aec-bpb-progress-bar span {
	display: block;
	height: 100%;
	background: #111;
}

.aec-bpb-progress-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.aec-bpb-repeatable-card {
	padding: 14px;
	margin-bottom: 12px;
	background: #fff;
}

.aec-bpb-repeatable-card > .aec-bpb-fields,
.aec-bpb-repeatable-card .aec-bpb-fields--two {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
}

.aec-bpb-repeatable-card .aec-bpb-field,
.aec-bpb-repeatable-card .aec-bpb-group,
.aec-bpb-repeatable-card .aec-bpb-simple-repeater,
.aec-bpb-repeatable-card .aec-bpb-complex-repeater {
	width: 100%;
	max-width: 100%;
}

.aec-bpb-repeatable-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.aec-bpb-repeatable-controls {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.aec-bpb-repeatable-section,
.aec-bpb-complex-repeater,
.aec-bpb-simple-repeater {
	width: 100%;
}

.aec-bpb-repeatable-items,
.aec-bpb-complex-repeater-items,
.aec-bpb-simple-repeater-items {
	width: 100%;
}

.aec-bpb-repeatable-card .aec-bpb-fields,
.aec-bpb-panel .aec-bpb-fields,
.aec-bpb-group .aec-bpb-fields {
	width: 100%;
}

.aec-bpb-simple-repeater-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	margin-bottom: 10px;
	align-items: start;
}

.aec-bpb-media-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 8px;
}

.aec-bpb-media-preview img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #dcdcde;
}

.aec-bpb-file-pill {
	display: inline-flex;
	padding: 8px 10px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 999px;
}

.aec-bpb-save-state {
	margin-top: 0;
	color: #50575e;
}

.aec-bpb-panel-pager {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
	padding-top: 12px;
	border-top: 1px solid #d7d7d7;
}

.aec-bpb-builder .button,
.aec-bpb-builder button,
.aec-bpb-front-shell .button,
.aec-bpb-front-shell button {
	background: #111 !important;
	border: 1px solid #111 !important;
	color: #fff !important;
	border-radius: 6px !important;
	padding: 7px 12px !important;
	font-size: 13px !important;
	line-height: 1.2 !important;
	min-height: 36px !important;
	height: auto !important;
	box-shadow: none !important;
	text-shadow: none !important;
	white-space: normal;
	word-break: break-word;
}

.aec-bpb-builder .wp-editor-tabs .button,
.aec-bpb-builder .wp-switch-editor,
.aec-bpb-front-shell .wp-editor-tabs .button,
.aec-bpb-front-shell .wp-switch-editor {
	background: #111 !important;
	color: #fff !important;
	border: 1px solid #111 !important;
	min-height: 28px !important;
	padding: 4px 10px !important;
	font-size: 12px !important;
}

.aec-bpb-builder .quicktags-toolbar input,
.aec-bpb-front-shell .quicktags-toolbar input {
	background: #111 !important;
	color: #fff !important;
	border: 1px solid #111 !important;
	min-height: 28px !important;
	padding: 4px 8px !important;
	font-size: 12px !important;
}

.aec-bpb-builder .wp-editor-wrap,
.aec-bpb-front-shell .wp-editor-wrap {
	background: #fff;
}

.aec-bpb-builder .mce-toolbar-grp,
.aec-bpb-builder .mce-top-part::before,
.aec-bpb-front-shell .mce-toolbar-grp,
.aec-bpb-front-shell .mce-top-part::before {
	background: #111 !important;
	border-color: #111 !important;
}

.aec-bpb-builder .mce-btn,
.aec-bpb-builder .mce-btn-group:not(:first-child),
.aec-bpb-front-shell .mce-btn,
.aec-bpb-front-shell .mce-btn-group:not(:first-child) {
	border-color: #111 !important;
}

.aec-bpb-builder .mce-btn button,
.aec-bpb-front-shell .mce-btn button {
	background: #111 !important;
	color: #fff !important;
	padding: 2px 6px !important;
	height: 28px !important;
	line-height: 1 !important;
}

.aec-bpb-builder .mce-ico,
.aec-bpb-front-shell .mce-ico {
	color: #fff !important;
}

.aec-bpb-builder .mce-btn:hover button,
.aec-bpb-builder .mce-btn.mce-active button,
.aec-bpb-front-shell .mce-btn:hover button,
.aec-bpb-front-shell .mce-btn.mce-active button {
	background: #2a2a2a !important;
}

.aec-bpb-builder .button-link,
.aec-bpb-builder .button-link-delete,
.aec-bpb-front-shell .button-link,
.aec-bpb-front-shell .button-link-delete {
	background: transparent !important;
	border: 0 !important;
	color: #111 !important;
	padding: 0 !important;
	min-height: auto !important;
}

.aec-bpb-builder .button:hover,
.aec-bpb-builder button:hover,
.aec-bpb-front-shell .button:hover,
.aec-bpb-front-shell button:hover {
	background: #2a2a2a !important;
	border-color: #2a2a2a !important;
}

.aec-bpb-front-shell {
	margin: 24px 0;
}

.aec-bpb-front-header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 16px;
}

/* Front-end (remote render) is embedded inside theme markup, so we must
 * strongly scope our overrides to the module container.
 */
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls,
.aec-bpb-front-controls {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 12px !important;
	align-items: center !important;
}

/* Ensure the direct items don’t get forced by theme/global CSS */
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls > *,
.aec-bpb-front-controls > * {
	margin: 0 !important;
	flex: 0 0 auto !important;
}

/* Buttons/links: keep them inline-flex so they don’t stack unpredictably */
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls a.button,
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls button,
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls .button,
.aec-bpb-front-controls a.button,
.aec-bpb-front-controls button,
.aec-bpb-front-controls .button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	white-space: nowrap !important;
}

/* Import form must stay flex (so file input + submit button don’t collapse) */
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls form.aec-bpb-inline-import,
.aec-bpb-front-controls form.aec-bpb-inline-import {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	gap: 8px !important;
	margin: 0 !important;
}

/* Plan select base styling */
.aec-bpb-plan-select {
	background: #f3f3f3 !important;
	border: 1px solid #111 !important;
	color: #111 !important;
	border-radius: 6px !important;
	padding: 10px 12px !important;
}

/* Keep the plan select from becoming a full-width block that forces awkward wrapping */
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls .aec-bpb-plan-select,
.maxconnect-remote-view-aec-business-plan-builder .aec-bpb-front-controls select.aec-bpb-plan-select,
.aec-bpb-front-controls .aec-bpb-plan-select,
.aec-bpb-front-controls select.aec-bpb-plan-select {
	flex: 0 1 520px !important;
	width: auto !important;
	max-width: 520px !important;
	margin: 0 !important;
}

.aec-bpb-inline-import {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0;
}

.aec-bpb-front-notice {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid #111;
	background: #f4f4f4;
	border-radius: 8px;
}

.aec-bpb-import-box {
	margin: 0 0 20px;
	padding: 16px;
	border: 1px solid #1a1a1a;
	border-radius: 8px;
	background: #fff;
}

.aec-bpb-import-box form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.aec-bpb-import-box input[type="file"] {
	max-width: 100%;
}

.wp-admin .aec-bpb-wrap {
	position: relative;
	padding-bottom: 40px;
}

.wp-admin .aec-bpb-wrap::after {
	content: "";
	display: block;
	clear: both;
}

.wp-admin .aec-bpb-layout {
	grid-template-columns: 220px minmax(0, 1fr) !important;
}

.wp-admin .aec-bpb-actions {
	grid-column: 2 !important;
}

.wp-admin .aec-bpb-actions .aec-bpb-sticky {
	position: static;
}

.wp-admin .aec-bpb-sidebar {
	position: sticky;
	top: 32px;
	align-self: start;
}

.wp-admin .aec-bpb-panel,
.wp-admin .aec-bpb-sidebar-card,
.wp-admin .aec-bpb-repeatable-card,
.wp-admin .aec-bpb-group {
	max-width: 100%;
	overflow: hidden;
}

@media (max-width: 1400px) {
	.wp-admin .aec-bpb-layout {
		grid-template-columns: 1fr;
	}

	.wp-admin .aec-bpb-actions,
	.wp-admin .aec-bpb-sidebar {
		grid-column: auto;
	}

	.wp-admin .aec-bpb-sidebar {
		position: static;
	}
}

@media (max-width: 1200px) {
	.aec-bpb-layout {
		grid-template-columns: 1fr;
	}

	.aec-bpb-sidebar,
	.aec-bpb-main,
	.aec-bpb-actions {
		grid-column: auto;
		grid-row: auto;
	}
}

@media (max-width: 782px) {
	.aec-bpb-layout,
	.aec-bpb-fields--two,
	.aec-bpb-simple-repeater-row {
		grid-template-columns: 1fr;
	}

	.aec-bpb-sticky {
		position: static;
	}
}

/* ==========================================================
   MaxConnect/User Connector hard isolation overrides
   Keep BPB stable when shortcode is rendered remotely.
   ========================================================== */
/* BPB critical CSS: keeps the builder usable when rendered through MaxConnect remote connector. */
.aec-bpb-front-shell,
.aec-bpb-frontend-wrap,
.aec-bpb-wrap,
.aec-bpb-builder{
	color:#111!important;
	font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif!important;
	font-size:13px!important;
	line-height:1.4!important;
	letter-spacing:0!important;
	text-transform:none!important;
	word-spacing:0!important;
}
.aec-bpb-front-shell *,
.aec-bpb-front-shell *::before,
.aec-bpb-front-shell *::after,
.aec-bpb-frontend-wrap *,
.aec-bpb-frontend-wrap *::before,
.aec-bpb-frontend-wrap *::after,
.aec-bpb-wrap *,
.aec-bpb-wrap *::before,
.aec-bpb-wrap *::after{
	box-sizing:border-box!important;
}
.aec-bpb-front-shell{margin:24px 0!important;width:100%!important;max-width:100%!important}
.aec-bpb-frontend-wrap,.aec-bpb-wrap{width:100%!important;max-width:100%!important}
.aec-bpb-builder{display:block!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
.aec-bpb-builder .aec-bpb-layout{display:grid!important;grid-template-columns:260px minmax(0,1fr)!important;gap:20px!important;align-items:start!important;width:100%!important;max-width:100%!important}
.aec-bpb-builder .aec-bpb-sidebar{grid-column:1!important;grid-row:1 / span 2!important;min-width:0!important;position:sticky!important;top:32px!important;align-self:start!important;display:block!important}
.aec-bpb-builder .aec-bpb-main{grid-column:2!important;grid-row:1!important;min-width:0!important;display:flex!important;flex-direction:column!important;gap:18px!important;width:100%!important;max-width:100%!important}
.aec-bpb-builder .aec-bpb-actions{grid-column:2!important;grid-row:2!important;min-width:0!important;width:100%!important;max-width:100%!important}
.aec-bpb-builder .aec-bpb-sidebar-card,
.aec-bpb-builder .aec-bpb-panel,
.aec-bpb-builder .aec-bpb-repeatable-card,
.aec-bpb-builder .aec-bpb-group,
.aec-bpb-front-shell .aec-bpb-front-header,
.aec-bpb-front-shell .aec-bpb-import-box,
.aec-bpb-front-shell .aec-bpb-front-plan{
	background:#fff!important;border:1px solid #111!important;border-radius:8px!important;box-shadow:0 8px 24px rgba(0,0,0,.06)!important;color:#111!important;max-width:100%!important;overflow:visible!important
}
.aec-bpb-builder .aec-bpb-sidebar-card,
.aec-bpb-builder .aec-bpb-panel,
.aec-bpb-builder .aec-bpb-group,
.aec-bpb-front-shell .aec-bpb-front-header,
.aec-bpb-front-shell .aec-bpb-import-box{padding:16px!important}
.aec-bpb-builder .aec-bpb-sidebar-nav,
.aec-bpb-builder .aec-bpb-sticky{display:flex!important;flex-direction:column!important;gap:8px!important;width:100%!important}
.aec-bpb-builder .aec-bpb-panel{display:none!important}
.aec-bpb-builder .aec-bpb-panel.is-active{display:block!important;width:100%!important;max-width:100%!important}
.aec-bpb-builder .aec-bpb-fields{display:grid!important;grid-template-columns:1fr!important;gap:16px!important;width:100%!important;max-width:100%!important}
.aec-bpb-builder .aec-bpb-fields--two{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.aec-bpb-builder .aec-bpb-repeatable-card>.aec-bpb-fields,
.aec-bpb-builder .aec-bpb-repeatable-card .aec-bpb-fields--two{display:flex!important;flex-direction:column!important;gap:16px!important;width:100%!important}
.aec-bpb-builder .aec-bpb-field,
.aec-bpb-builder .aec-bpb-simple-repeater,
.aec-bpb-builder .aec-bpb-complex-repeater,
.aec-bpb-builder .aec-bpb-repeatable-section,
.aec-bpb-builder .aec-bpb-repeatable-items,
.aec-bpb-builder .aec-bpb-complex-repeater-items,
.aec-bpb-builder .aec-bpb-simple-repeater-items{width:100%!important;max-width:100%!important;min-width:0!important}
.aec-bpb-builder .aec-bpb-field label{display:block!important;font-weight:600!important;margin:0 0 6px!important;color:#111!important;font-size:13px!important;line-height:1.4!important;text-transform:none!important;letter-spacing:0!important}
.aec-bpb-builder input[type=text],
.aec-bpb-builder input[type=email],
.aec-bpb-builder input[type=url],
.aec-bpb-builder input[type=date],
.aec-bpb-builder input[type=number],
.aec-bpb-builder select,
.aec-bpb-builder textarea,
.aec-bpb-front-shell input[type=file],
.aec-bpb-front-shell select{
	width:100%!important;max-width:100%!important;background:#f3f3f3!important;border:1px solid #111!important;color:#111!important;border-radius:6px!important;padding:10px 12px!important;min-height:42px!important;box-shadow:none!important;font-size:13px!important;line-height:1.4!important
}
.aec-bpb-builder .button,
.aec-bpb-builder button,
.aec-bpb-front-shell .button,
.aec-bpb-front-shell button{
	display:inline-flex!important;align-items:center!important;justify-content:center!important;background:#111!important;border:1px solid #111!important;color:#fff!important;border-radius:6px!important;padding:7px 12px!important;font-size:13px!important;line-height:1.2!important;min-height:36px!important;height:auto!important;box-shadow:none!important;text-shadow:none!important;text-decoration:none!important;white-space:normal!important;word-break:normal!important;cursor:pointer!important
}
.aec-bpb-builder .aec-bpb-sidebar-nav .aec-bpb-nav-button,
.aec-bpb-builder .aec-bpb-sidebar-nav .button.aec-bpb-nav-button,
.aec-bpb-builder .aec-bpb-sidebar-nav .button-secondary.aec-bpb-nav-button{
	display:flex!important;width:100%!important;max-width:100%!important;justify-content:flex-start!important;text-align:left!important;margin:0!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;min-height:36px!important
}
.aec-bpb-builder .button:hover,
.aec-bpb-builder button:hover,
.aec-bpb-front-shell .button:hover,
.aec-bpb-front-shell button:hover{background:#2a2a2a!important;border-color:#2a2a2a!important;color:#fff!important}
.aec-bpb-builder .aec-bpb-nav-button.is-active{background:#fff!important;color:#111!important;border-color:#111!important}
.aec-bpb-builder .button-link,
.aec-bpb-builder .button-link-delete,
.aec-bpb-front-shell .button-link,
.aec-bpb-front-shell .button-link-delete{display:inline-flex!important;background:transparent!important;border:0!important;color:#111!important;padding:0!important;min-height:auto!important;box-shadow:none!important;text-decoration:underline!important}
.aec-bpb-builder .aec-bpb-panel-pager{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:12px!important;margin-top:20px!important;padding-top:12px!important;border-top:1px solid #d7d7d7!important}
.aec-bpb-builder .aec-bpb-simple-repeater-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important;margin-bottom:10px!important;align-items:start!important;width:100%!important}
.aec-bpb-front-shell .aec-bpb-front-controls,
.aec-bpb-front-shell .aec-bpb-inline-import{display:flex!important;flex-wrap:wrap!important;gap:12px!important;align-items:center!important;margin:0!important}
.aec-bpb-builder .wp-editor-wrap,.aec-bpb-front-shell .wp-editor-wrap{background:#fff!important;max-width:100%!important}
.aec-bpb-builder .mce-toolbar-grp,.aec-bpb-builder .mce-top-part::before,.aec-bpb-builder .wp-editor-tabs .button,.aec-bpb-builder .wp-switch-editor,.aec-bpb-builder .quicktags-toolbar input,.aec-bpb-builder .mce-btn button{background:#111!important;border-color:#111!important;color:#fff!important}
.aec-bpb-builder .mce-ico{color:#fff!important}
@media (max-width:960px){.aec-bpb-builder .aec-bpb-layout{grid-template-columns:1fr!important}.aec-bpb-builder .aec-bpb-sidebar,.aec-bpb-builder .aec-bpb-main,.aec-bpb-builder .aec-bpb-actions{grid-column:auto!important;grid-row:auto!important;position:static!important}.aec-bpb-builder .aec-bpb-fields--two,.aec-bpb-builder .aec-bpb-simple-repeater-row{grid-template-columns:1fr!important}}
