:root {
	--global-layer-primary: #642077;
	--global-layer-primary-rgb: 100, 32, 119;
	/* Comma-separated channels so this expands to rgba(100, 32, 119, 0.08) */
	--global-layer-bg: rgba(var(--global-layer-primary-rgb), 0.08);
}

/**
 * Undo the Content tab's collapsed icon rail: give the sidebar nav its full width and its labels
 * back, and drop the layers list it was making room for. Used where that list is not shown —
 * narrow viewports, and a global layer's own screen, which has a single layer to begin with.
 */
@mixin mkl-pc-sidebar-nav-expanded {
	.mkl-pc-admin-ui__sidebar-mid {
		flex-direction: column;
		align-items: stretch;
	}
	.mkl-pc-admin-ui__nav-wrap--primary {
		flex: 1 1 auto;
		width: 100%;
		max-width: none;
		align-self: stretch;
		position: relative;
		top: auto;
	}
	.mkl-pc-admin-ui__nav .mkl-pc-admin-ui__nav-item {
		justify-content: flex-start;
		padding-left: 2px;
		padding-right: 8px;
		.mkl-pc-admin-ui__nav-item-text {
			position: static;
			width: auto;
			height: auto;
			padding: 0;
			margin: 0;
			overflow: visible;
			clip: auto;
			white-space: nowrap;
			border: 0;
		}
		.mkl-pc-admin-ui__nav-item-chevron {
			display: flex;
		}
		&::after {
			content: none;
			display: none;
		}
	}
	.mkl-pc-admin-ui__sidebar-layers {
		display: none !important;
	}
}

#woocommerce-product-data .panel .wc-metaboxes-wrapper {
	width: 100%;
}

#woocommerce-product-data .start_button_container {
	border-top: 1px solid #eee;
	padding-top: 20px !important;
	padding-bottom: 20px !important;
	@media (min-width: 900px) {
		padding-left: 162px!important;
	}
}

// Variations hold their own configurations: each one is edited from its row in Variations.
// A class rather than .hide(), which WooCommerce undoes whenever it re-shows .show_if_variable.
#woocommerce-product-data.mkl-pc-configured-per-variation #mkl_pc_configurator_product_data .start_button_container {
	display: none !important;
}

#woocommerce-product-data .notice.configurator-type-change-warning {
    margin: 0px 15px;
}

.wc-pc-tabs,
.wc-pc-tabs-sub {
	margin: 0;
	width: 20%;
	float: left;
	line-height: 1em;
	padding: 0 0 10px;
	position: relative;
	background-color: #fafafa;
	border-right: 1px solid #eee;
	box-sizing: border-box;	
	li {
		margin: 0;
		padding: 0;
		display: block;
		position: relative;
		a {
			margin: 0;
			padding: 10px;
			display: block;
			box-shadow: none;
			text-decoration: none;
			line-height: 20px!important;
			border-bottom: 1px solid #eee;
		}
		&.active a{
			color: #555;
			position: relative;
			background-color: #eee;
		}
	}
}

ul.wc-pc-tabs-sub,
.image-selectors {
	display: none;

}



/*
 * Product Configurator — admin modal (`admin.scss`)
 *
 * Sections (approximate): WC product metabox tweaks → Modal shell (.mkl-pc-admin-ui) → Reusable admin
 * dialog (.mkl-pc-admin-dialog) → Sidebar + canvas
 * → Structures / Forms → Lists & toolbars → Content tab placeholders → Import-export → Globals / misc.
 */

$modal-spacing: 16px; // 16px 24px
$light-border-color: #dddddd;
$very-light-bg-color: #fcfcfc;
$light-bg-color: #f3f3f3;
$text-color: #23282d;

$left-col-width: 328px;
$pc-admin-nav-rail: 56px;

$tablet-left-col-width: 270px;

$pc-admin-sidebar-bg: #1e1e1e;
$pc-admin-sidebar-fg: #e0e0e0;
$pc-admin-sidebar-fg-mutted: #949494;
$pc-admin-sidebar-muted: #a0a5aa;
$pc-admin-canvas-chrome: #dcdcde;

/* --------------------------------------------------------------------------
 * Shared UI — loading indicator (migration overlay, sidebar save, etc.)
 * -------------------------------------------------------------------------- */

@keyframes mkl-pc-spinner-rotate {
	to {
		transform: rotate(360deg);
	}
}

.mkl-pc-spinner {
	display: inline-block;
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	box-sizing: border-box;
	border: 3px solid #c3c4c7;
	border-top-color: var(--wp-admin-theme-color, #007cba);
	border-radius: 50%;
	animation: mkl-pc-spinner-rotate 0.8s linear infinite;
	vertical-align: middle;
}

.mkl-pc-spinner--sm {
	width: 20px;
	height: 20px;
	border-width: 2px;
}

.mkl-pc-migration-overlay__spinner.mkl-pc-spinner {
	display: block;
	margin: 0 auto 16px;
}

.mkl-pc-migration-overlay.is-complete .mkl-pc-migration-overlay__spinner {
	display: none;
}

body.pc-modal-opened {
	overflow: hidden;
}
.pc-modal-backdrop {
	z-index: 149000 !important;
}
html .mkl-pc-admin-ui.pc-modal {
	z-index: 150000 !important;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	max-width: 100vw;
	max-height: 100vh;
	background: $pc-admin-canvas-chrome;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
	box-sizing: border-box;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.4;

	.hidden {
		display: none;
	}
	.delete:not(.button-primary) {
		color: #a00;
	}
	.form-details .actions-container button + button {
		margin-left: 6px;
	}
	.button-primary.delete {
		background: #DB3434;
		border-color: #a00;
		text-shadow: 0 -1px 1px #a00, 1px 0 1px #a00, 0 1px 1px #a00, -1px 0 1px #a00;
		box-shadow: 0 1px 0 #a00;
		&:hover,
		&:focus {
			background: lighten(#DB3434, 7);
			border-color: #DB3434;
			box-shadow: 0 1px 0 #DB3434;
		}
		&:active {
			background: lighten(#DB3434, 7);
			border-color: #DB3434;
			box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
			transform: translateY(1px);
			outline: none;
		}
	}
	
	&.wp-core-ui .button-link {
		border-color: transparent;
	}

	.notice-container {
		z-index: 100000;
		position: absolute;
		bottom: 10px;
		left: 10px;
	}
	.pc-notice {
		padding: 15px;
		min-width: 200px;
		max-width: 300px;
		border-radius: 8px;
		background: #000000e3;
		color: #fff;
		a {
			color: #fff;
		}
	}
	.pc-notice + .pc-notice {
		margin-top: 8px;
	}
	.pc-notice .dashicons {
		font-size: 30px;
		width: 30px;
		height: 30px;
		margin-right: 10px;
		vertical-align: middle;
	}
	.pc-notice.notice-success .dashicons {
		color: #00a32a;
	}
	.pc-notice.notice-error {
		max-width: 420px;
		.dashicons {
			color: #d63638;
		}
	}
	.pc-notice.notice-warning .dashicons {
		color: #dba617;
	}

	@media ( max-width: 900px ) {
		@media ( prefers-reduced-motion: no-preference ) {
			.mkl-pc-admin-ui__content.content.mkl-pc-mobile-stack--animating,
			.mkl-pc-admin-ui__content.structure.mkl-pc-mobile-stack--animating {
				transition: opacity 0.18s ease;
				// opacity: 0.88;
				// translate: translateY(-100%);
			}
		}
	}

	.mkl-pc-admin-ui__body {
		flex: 1;
		min-height: 0;
		position: relative;
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	.mkl-pc-admin-ui__main {
		flex: 1;
		display: grid;
		grid-template-columns: minmax(0, $left-col-width) minmax(0, 1fr);
		grid-template-rows: 1fr;
		min-height: 0;
		min-width: 0;
		background: $pc-admin-sidebar-bg;

		.mkl-pc-admin-ui__sidebar-mobile-scrim {
			display: none;
		}

		@media ( max-width: 900px ) {
			display: block;
			position: relative;
			height: 100%;

			&:has( .mkl-pc-admin-ui__sidebar.mkl-pc-admin-ui__sidebar--open ) .mkl-pc-admin-ui__sidebar-mobile-scrim,
			&:has( .mkl-pc-admin-ui__nav.visible ) .mkl-pc-admin-ui__sidebar-mobile-scrim {
				display: block;
				position: fixed;
				inset: 0;
				z-index: 200000;
				margin: 0;
				padding: 0;
				border: 0;
				border-radius: 0;
				background: rgba(0, 0, 0, 0.35);
				cursor: pointer;
				-webkit-appearance: none;
				appearance: none;
			}
		}
		> .mkl-pc-admin-ui__sidebar {
			display: flex;
			flex-direction: column;
			grid-column: 1;
			grid-row: 1;
			min-height: 0;
			border-right: 1px solid #2c2c2c;
			background: $pc-admin-sidebar-bg;
			color: $pc-admin-sidebar-fg;
			.mkl-pc-admin-ui__sidebar-top {
				flex: 0 0 auto;
				padding: 12px 14px 35px;
			}

			button.mkl-pc-admin-ui__product-icon-back-button {
				flex: 0 0 auto;
				align-self: flex-start;
				width: 40px;
				min-width: 40px;
				height: 40px;
				padding: 2px;
				border-radius: 6px;
				line-height: 1;
				background: transparent;
				border: none;
				display: inline-flex;
				align-items: center;
				justify-content: center;
			}
			
			svg.edit-site-site-icon__icon {
				max-width: 100%;
				max-height: 36px;
				height: auto;
			}
			
			svg.edit-site-site-icon__icon path {
				fill: #FFF;
			}
			
			.mkl-pc-admin-ui__product-name--container {
				display: flex;
				align-items: center;
				gap: 12px;
				min-width: 0;
			}

			.mkl-pc-admin-ui__product-heading {
				flex: 1 1 auto;
				min-width: 0;
				display: flex;
				flex-direction: column;
				align-items: stretch;
				gap: 4px;
			}
			
			.mkl-pc-admin-ui__product-name {
				display: block;
				color: $pc-admin-sidebar-fg;
				font-size: 15px;
				font-weight: 500;
				line-height: 1.35;
				text-decoration: none;
				position: relative;
				text-overflow: ellipsis;
				white-space: nowrap;
				overflow: hidden;
				padding-right: 20px;
				
				&::after {
					content: "↗";
					font-weight: 400;
					opacity: 0;
					position: absolute;
					right: 0;
					transition: opacity 0.12s ease;
				}

				&:hover,
				&:focus {
					color: #fff;
					&::after {
						opacity: 1;
					}
				}
			}
			.mkl-pc-admin-ui__back-to-product {
				display: inline-flex;
				align-items: center;
				gap: 10px;
				margin-top: 30px;
				padding: 0;
				padding-left: 16px;
				border: 0;
				background: transparent;
				color: $pc-admin-sidebar-muted;
				font-size: 14px;
				cursor: pointer;
				&:hover,
				&:focus {
					color: #fff;
				}
			}
			.mkl-pc-admin-ui__back-chevron {
				height: 20px;
				width: 20px;
				&::before {
					font: normal 20px/1 dashicons;
					content: "\f341";
					line-height: 1;
				}
			}

			.mkl-pc-admin-ui__sidebar-focus {
				margin-top: 18px;
				align-items: center;
				gap: 10px;
				.mkl-pc-sidebar-focus__back {
					display: inline-flex;
					align-items: center;
					gap: 10px;
					padding: 0;
					margin: 0;
					border: 0;
					background: transparent;
					color: $pc-admin-sidebar-muted;
					font-size: 14px;
					line-height: 1;
					cursor: pointer;
					&:hover,
					&:focus {
						color: #fff;
					}
				}
				.mkl-pc-sidebar-focus__title {
					font-size: 18px;
					font-weight: 600;
					color: #fff;
					line-height: 1.25;
					margin: 0 0 3px;
					padding-left: 2px;
				}
				.mkl-pc-sidebar-focus__help {
					margin: 0;
					font-size: 12px;
					line-height: 1.45;
					color: $pc-admin-sidebar-muted;
					padding-left: 2px;
					max-width: 100%;
				}
			}
			.mkl-pc-admin-ui__sidebar-3d-sections {
				display: none;
			}
			.mkl-pc-admin-ui__sidebar-mid {
				flex: 1 1 auto;
				display: flex;
				flex-direction: column;
				min-height: 0;
				min-width: 0;
				/* Single scroll: full menu, or (content mode) nav rail + layer list together */
				overflow-y: auto;
				overflow-x: visible;
				-webkit-overflow-scrolling: touch;
				/* Match wp block editor (e.g. .block-editor-block-contextual-toolbar .block-editor-block-toolbar) */
				scrollbar-width: thin;
				scrollbar-gutter: stable both-edges;
				scrollbar-color: #e0e0e0 transparent;

				&::-webkit-scrollbar-track {
					background-color: transparent;
				}
				&::-webkit-scrollbar-thumb {
					background-color: #e0e0e0;
					border-radius: 8px;
					border: 3px solid transparent;
					background-clip: padding-box;
				}
				&:hover,
				&:focus,
				&:focus-within {
					scrollbar-color: #949494 transparent;
				}
				&:hover::-webkit-scrollbar-thumb,
				&:focus::-webkit-scrollbar-thumb,
				&:focus-within::-webkit-scrollbar-thumb {
					background-color: #949494;
				}
			}
			@media (hover: none) {
				.mkl-pc-admin-ui__sidebar-mid {
					scrollbar-color: #949494 transparent;
				}
			}
			.mkl-pc-admin-ui__nav-wrap {
				flex: 1 1 auto;
				min-height: 0;
				min-width: 0;
				overflow: visible;
				padding: 0 10px 0 12px;
				width: 100%;
				box-sizing: border-box;
				transition: width 0.28s ease, flex-basis 0.28s ease, padding 0.28s ease;
				&:hover, 
				&:focus-within {
					& + .mkl-pc-admin-ui__sidebar-layers {
						opacity: 0.2 !important;
						transition: opacity 0.28s ease;
						filter: blur(3px);
					}
				}
			}
			.mkl-pc-admin-ui__sidebar-layers {
				display: none;
				flex: 1 1 auto;
				flex-direction: column;
				min-width: 0;
				min-height: 0;
				height: 100%;
				border-left: 1px solid #2c2c2c;
				overflow: visible;
				padding: 10px 8px 8px 8px;
				box-sizing: border-box;
			}
			.mkl-pc-admin-ui__sidebar-layers-heading {
				margin: 0 0 6px;
				padding: 4px 2px 10px 8px;
				font-size: 15px;
				font-weight: 600;
				color: #fff;
				line-height: 1.3;
			}
			.mkl-pc-admin-ui__sidebar-layers-list {
				flex: 0 0 auto;
				min-height: 0;
				overflow: visible;
			}
			.mkl-pc-admin-ui__sidebar-footer {
				flex: 0 0 auto;
				padding: 10px 16px 16px;
				border-top: 1px solid #2c2c2c;
			}
			.mkl-pc-sidebar-save__content {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				gap: 8px;
			}
			.mkl-pc-sidebar-save__icon.dashicons {
				width: 20px;
				height: 20px;
				font-size: 20px;
				line-height: 1;
				flex-shrink: 0;
				margin-top: 1px;
			}
			.mkl-pc-sidebar-save__spinner {
				display: none;
			}
			.mkl-pc-admin-ui__sidebar-primary-save.is-loading .mkl-pc-sidebar-save__spinner {
				display: inline-block;
			}
			.mkl-pc-admin-ui__sidebar-primary-save.is-loading .mkl-pc-sidebar-save__icon {
				display: none !important;
			}
			/* Lighter ring on dark sidebar “saving” state */
			.mkl-pc-admin-ui__sidebar-primary-save.is-loading .mkl-pc-spinner--sm {
				border-color: rgba(255, 255, 255, 0.28);
				border-top-color: #fff;
			}
			.mkl-pc-admin-ui__sidebar-primary-save[aria-disabled="false"] .mkl-pc-sidebar-save__icon.dashicons {
				color: inherit;
			}
			.mkl-pc-admin-ui__sidebar-primary-save {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				text-align: center;
				margin: 0;
				text-shadow: none !important;
				box-shadow: none !important;
				&.disabled,
				&[aria-disabled="true"] {
					opacity: 1;
					cursor: default;
					background: rgba(255, 255, 255, 0.14) !important;
					border-color: transparent !important;
					color: #949494 !important;
				}
				&[aria-disabled="true"] .mkl-pc-sidebar-save__icon.dashicons-saved {
					// color: #68de7c;
				}
				&[aria-disabled="true"]:focus-visible {
					outline: 2px solid #72aee6;
					outline-offset: 2px;
				}
				&[aria-disabled="false"]:hover,
				&[aria-disabled="false"]:focus {
					background: #f0f0f0 !important;
					border-color: #f0f0f0 !important;
					color: #000 !important;
				}
			}
			.mkl-pc-admin-ui__sidebar-footer:not(.saving) {
				.mkl-pc-admin-ui__sidebar-primary-save[aria-disabled="true"]:not(.is-loading) {
					justify-content: start;
					background: transparent !important;
				}
			}
			@media ( max-width: 900px ) {
				position: fixed;
				z-index: 200001;
				top: 0;
				bottom: 0;
				left: 0;
				width: min( 340px, 92vw );
				grid-column: auto;
				grid-row: auto;
				transform: translateX(-100%);
				transition: transform 0.2s ease, box-shadow 0.2s ease;
				box-shadow: 2px 0 20px rgba(0, 0, 0, 0);
				will-change: transform, box-shadow;
				&:has( .mkl-pc-admin-ui__nav.visible ),
				&.mkl-pc-admin-ui__sidebar--open {
					transform: translateX(0);
					box-shadow: 2px 0 20px rgba(0, 0, 0, 0.35);
				}
			}
		}
		> .mkl-pc-admin-ui__state {
			grid-column: 2;
			grid-row: 1;
			min-width: 0;
			min-height: 0;
			display: flex;
			flex-direction: column;
			background: transparent;
			margin: 16px 16px 16px 0;
			overflow: hidden;
			@media ( max-width: 900px ) {
				margin: 0;
				border-radius: 0;
				width: 100%;
				height: 100%;
			}
			> .state {
				flex: 1;
				min-height: 0;
				min-width: 0;
				display: flex;
				flex-direction: column;
				&.home {
					overflow: auto;
					-webkit-overflow-scrolling: touch;
				}
			}
		}
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.structure ),
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.conditional ),
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.settings-3d ) {
			// background: $pc-admin-canvas-chrome;
			box-shadow: none;
		}
		> .mkl-pc-admin-ui__state:has( .state.home ),
		> .mkl-pc-admin-ui__state:has( .state.image-order-state ),
		> .mkl-pc-admin-ui__state:has( .font-library-app ),
		> .mkl-pc-admin-ui__state:has( .state.conditional_placeholder ),
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.content > .no-data ),
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.price-bulk-edit ),
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.import-export ) {
			background: #FFF;
			box-shadow: none;
			@media ( min-width: 900px ) {
				border-radius: 8px;
			}
		}
		/* Message-only panes — the Conditional logic add-on upsell and the Content
		   tab before layers/angles exist. They have no chrome of their own, so
		   without a light surface they render dark text on the dark canvas. */
		> .mkl-pc-admin-ui__state:has( .state.conditional_placeholder ),
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.content > .no-data ) {
			overflow: auto;
			.tab_content,
			.no-data {
				max-width: 640px;
				padding: 1.6em;
				color: #1d2327;
				p {
					margin: 0 0 1em;
					font-size: 13px;
					line-height: 1.6;
				}
				p:last-child {
					margin-bottom: 0;
				}
			}
		}
		> .mkl-pc-admin-ui__state:has( .mkl-pc-admin-ui__content.content ) {
			// background: $pc-admin-canvas-chrome;
			> .state.content-state {
				min-height: 0;
				display: flex;
				flex-direction: column;
				flex: 1;
			}
		}
		&.mkl-pc-admin-ui--content-mode {
			> .mkl-pc-admin-ui__sidebar {
				.mkl-pc-admin-ui__sidebar-mid {
					flex-direction: row;
					align-items: flex-start;
					border-top: 1px solid #2c2c2c;
				}
				.mkl-pc-admin-ui__nav-wrap--primary {
					flex: 0 0 $pc-admin-nav-rail;
					width: $pc-admin-nav-rail;
					max-width: $pc-admin-nav-rail;
					min-width: 0;
					padding: 0 4px;
					padding-top: 3px;
					display: flex;
					flex-direction: column;
					align-self: flex-start;
					min-height: 0;
					overflow: visible;
					position: sticky;
					top: 0;
					z-index: 2;
				}
				.mkl-pc-admin-ui__nav {
					box-sizing: border-box;
					flex: 0 0 auto;
					width: 100%;
					max-width: 100%;
					overflow: visible;
				}
				.mkl-pc-admin-ui__nav .mkl-pc-admin-ui__nav-item {
					justify-content: center;
					padding-left: 8px;
					padding-right: 8px;
					min-width: 0;
					.mkl-pc-admin-ui__nav-item-text {
						position: absolute;
						width: 1px;
						height: 1px;
						padding: 0;
						margin: -1px;
						overflow: hidden;
						clip: rect(0, 0, 0, 0);
						white-space: nowrap;
						border: 0;
					}
					.mkl-pc-admin-ui__nav-item-chevron {
						display: none;
					}
					/* CSS-only label on hover/focus when collapsed */
					&::after {
						content: attr(data-mkl-hint);
						position: absolute;
						left: calc(100% + 8px);
						top: 50%;
						transform: translateY(-50%);
						padding: 6px 10px;
						background: #2c3338;
						color: #fff;
						font-size: 12px;
						font-weight: 500;
						line-height: 1.2;
						white-space: nowrap;
						border-radius: 4px;
						box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
						opacity: 0;
						pointer-events: none;
						z-index: 30;
						transition: opacity 0.12s ease;
					}
					&:hover::after,
					&:focus-visible::after {
						opacity: 1;
					}
				}
				.mkl-pc-admin-ui__nav .mkl-pc-admin-ui__nav-separator,
				.mkl-pc-admin-ui__nav .separator {
					margin-left: 4px;
					margin-right: 4px;
					max-width: 100%;
					box-sizing: border-box;
				}
				.mkl-pc-admin-ui__sidebar-layers {
					display: flex;
					flex: 1 1 auto;
					min-width: 0;
					animation: mkl-pc-sidebar-layers-in 0.32s ease forwards;
				}
				.mkl-pc-admin-ui__sidebar-layers-list {
					ul.layers {
						margin: 0;
						padding: 0;
						list-style: none;
					}
					li button.layer {
						display: flex;
						align-items: center;
						gap: 8px;
						padding: 8px 10px;
						margin: 0 0 2px;
						border: 0;
						border-radius: 6px;
						color: $pc-admin-sidebar-fg-mutted;
						text-decoration: none;
						background: transparent;
						text-align: left;
						&:hover,
						&:focus {
							color: #fff;
							background: rgba(255, 255, 255, 0.06);
						}
					}
					li.active button.layer {
						background: rgba(255, 255, 255, 0.12);
						color: #fff;
					}
					span.number-of-choices {
						margin-left: auto;
						background: rgba(255, 255, 255, 0.12);
						color: $pc-admin-sidebar-fg;
					}
				}
				@media ( max-width: 900px ) {
					@include mkl-pc-sidebar-nav-expanded;
				}
			}
		}
	}

	&.is-global-layer-focus {
		.mkl-pc-admin-ui__main > .mkl-pc-admin-ui__sidebar {
			.mkl-pc-admin-ui__back-to-product {
				display: none !important;
			}
			.mkl-pc-admin-ui__sidebar-focus {
				display: flex;
			}
			.mkl-pc-admin-ui__nav-wrap {
				display: none !important;
			}
			.mkl-pc-admin-ui__sidebar-layers,
			.mkl-pc-admin-ui__sidebar-3d-sections {
				display: none !important;
			}
		}
		.mkl-pc-admin-ui__header .mkl-pc-admin-ui__menu-toggle,
		.structure-content {
			display: none !important;
		}
		.mkl-pc-admin-ui__sidebar-mid {
			overflow: hidden !important;
			transform: translateX(-100%);
		}
	}

	// Editing a global layer on its own screen: the post holds exactly one layer, so nothing on
	// these screens gets to pick, add, duplicate or delete a layer. Choices are untouched — they
	// are the part of the layer this screen exists to edit.
	&.is-global-layer-standalone {
		// Only the layer form loses its actions; the choice form keeps Duplicate and Delete.
		.layer-form > .form-details > header .actions-container {
			.delete-item,
			.duplicate-item,
			.prompt-delete {
				display: none !important;
			}
		}
		// The Content screen's layer picker has one entry: hide it, and the ways back to it.
		.mkl-pc-content-main-layer-panel,
		.mkl-pc-mobile-content-toolbar--layers-back {
			display: none !important;
		}
		// Content mode collapses the nav to an icon rail to make room for that list; without it
		// the rail would just leave the sidebar empty.
		.mkl-pc-admin-ui__main > .mkl-pc-admin-ui__sidebar {
			@include mkl-pc-sidebar-nav-expanded;
		}
	}

	// Layer details: the structure screen's card styling, but with the form as the only column.
	// It borrows .structure for that styling, so the width cap and the narrow-view slide stack —
	// both of which assume a list column to slide away from — have to be undone here.
	.mkl-pc-admin-ui__content.structure.layer-details {
		> .mkl-pc-admin-layout__column-track > .pc-sidebar {
			max-width: none;
		}
		@media ( max-width: 900px ) {
			> .mkl-pc-admin-layout__column-track > .mkl-pc-admin-layout__column {
				position: relative;
				transform: none;
			}
		}
	}

	&.is-settings-3d-focus {
		.mkl-pc-admin-ui__main > .mkl-pc-admin-ui__sidebar {
			// button.mkl-pc-admin-ui__product-icon-back-button {
			// 	display: none !important;
			// }
			.mkl-pc-admin-ui__back-to-product {
				display: none !important;
			}
			.mkl-pc-admin-ui__sidebar-focus {
				display: flex;
			}
			.mkl-pc-admin-ui__nav-wrap {
				display: none !important;
			}
			.mkl-pc-admin-ui__sidebar-layers {
				display: none !important;
			}
			.mkl-pc-admin-ui__sidebar-mid {
				flex-direction: column;
				align-items: stretch;
			}
			.mkl-pc-admin-ui__sidebar-3d-sections {
				display: flex !important;
				flex: 1 1 auto;
				flex-direction: column;
				min-height: 0;
				min-width: 0;
				overflow-y: auto;
				padding: 8px 12px 12px;
				.mkl-pc-admin-ui__nav.pc-3d-section-tabs--sidebar {
					padding: 4px 0 12px;
					.mkl-pc-admin-ui__nav-item.pc-3d-section-tab {
						.mkl-pc-admin-ui__nav-item-icon .pc-admin-icon svg {
							width: 20px;
							height: 20px;
							display: block;
							filter: invert(1);
							opacity: 0.85;
						}
						&.active .mkl-pc-admin-ui__nav-item-icon .pc-admin-icon svg,
						&:hover .mkl-pc-admin-ui__nav-item-icon .pc-admin-icon svg,
						&:focus-visible .mkl-pc-admin-ui__nav-item-icon .pc-admin-icon svg {
							filter: none;
							opacity: 1;
						}
					}
				}
			}
		}
	}

	.mkl-pc-admin-ui__nav {
		margin: 0;
		padding: 4px 0 12px;
		.mkl-pc-admin-ui__nav-separator,
		.separator {
			height: 1px;
			margin: 13px 4px 8px 2px;
			background: transparent;
			pointer-events: none;
		}
		.mkl-pc-admin-ui__nav-item {
			display: flex;
			align-items: center;
			gap: 5px;
			margin: 0 0 1px;
			padding: 0 8px 0 2px;
			min-height: 32px;
			width: 100%;
			max-width: 100%;
			box-sizing: border-box;
			color: $pc-admin-sidebar-fg-mutted;
			text-decoration: none;
			border: 0;
			box-shadow: none;
			font-family: inherit;
			font-size: 13px;
			text-align: left;
			-webkit-appearance: none;
			appearance: none;
			line-height: 1.35;
			font-weight: 400;
			background: transparent;
			cursor: pointer;
			position: relative;
			border-radius: 4px;
			.mkl-pc-admin-ui__nav-item-icon {
				flex: 0 0 36px;
				width: 36px;
				height: 24px;
				display: flex;
				align-items: center;
				justify-content: center;
				.pc-admin-icon {
					display: inline-flex;
					align-items: center;
					justify-content: center;
				}
				.pc-admin-icon svg {
					width: 18px;
					height: 18px;
					display: block;
					opacity: 0.92;
					fill: currentColor;
				}
				.dashicons {
					width: 18px;
					height: 18px;
					font-size: 18px;
					line-height: 1;
					opacity: 0.92;
				}
			}
			.mkl-pc-admin-ui__nav-item-text {
				flex: 1 1 auto;
				min-width: 0;
				text-align: left;
			}
			.mkl-pc-admin-ui__nav-item-chevron {
				flex: 0 0 20px;
				width: 20px;
				height: 20px;
				display: flex;
				align-items: center;
				justify-content: center;
			}
			&:hover,
			&:focus {
				color: #fff;
				background: rgba(255, 255, 255, 0.045);
			}
			&.active {
				background: rgba(255, 255, 255, 0.08);
				color: #fff;
				font-weight: 500;
				.mkl-pc-admin-ui__nav-item-chevron::before {
					font: normal 12px/1 dashicons;
					display: block;
					color: $pc-admin-sidebar-muted;
					content: "\f345";
				}
			}
		}
	}

	.mkl-pc-admin-ui__header {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 8px;
		padding: 0 50px 0 16px;
		min-height: 52px;
		border-bottom: 1px solid $light-border-color;
		background: #fff;
		flex: 0 0 auto;

		@media ( min-width: 900px ) {
			display: none;
		}

		h1 {
			flex: 1;
			margin: 0;
			font-size: 1.1em;
			font-weight: 600;
			padding: 12px 0;
			line-height: 1.3;
		}
		.mkl-pc-admin-ui__menu-toggle {
			display: none;
			@media ( max-width: 900px ) {
				display: inline-block;
				align-items: center;
			}
		}
		.description { 
			display: block;
			padding-left: $modal-spacing;
			width: 100%;
			flex-basis: 100%;
			padding-bottom: 8px;
			@media(max-width: 900px) {
				display: none;
			}
		} 
	}

	.mkl-pc-admin-ui__close {
		position: absolute;
		top: 0;
		right: 0;
		width: 50px;
		height: 50px;
		margin: 0;
		padding: 0;
		border: 0;
		background: transparent;
		color: #787c82;
		cursor: pointer;
		z-index: 6;
		display: flex;
		align-items: center;
		justify-content: center;
		&:hover,
		&:focus {
			color: #1d2327;
			background: rgba(0, 0, 0, 0.04);
		}
	}
	.mkl-pc-admin-ui__close-icon {
		display: block;
		width: 20px;
		height: 20px;
		&::before {
			font: normal 20px/1 dashicons;
			content: "\f158";
		}
	}

	/*
	 * Shared admin layout hooks (Structure, Content, Conditional): markup adds
	 * .mkl-pc-admin-layout on the section root with --two-column or --three-column;
	 * .mkl-pc-admin-layout__toolbar on mobile back rows; .mkl-pc-admin-layout__column
	 * with --list / --detail (two-column) or --layers / --choices / --detail (content).
	 * Legacy class names (.structure-content, .choice-details, …) stay for existing CSS/JS.
	 */

	.mkl-pc-admin-layout__column-track {
		display: contents;
	}

	@media ( max-width: 900px ) {
		.mkl-pc-admin-layout__column-track {
			display: block;
			flex: 1 1 auto;
			min-height: 0;
			position: relative;
			overflow: hidden;
			align-self: stretch;
			width: 100%;
		}

		.mkl-pc-admin-layout__column-track > .mkl-pc-admin-layout__column {
			position: absolute;
			left: 0;
			top: 0;
			right: 0;
			bottom: 0;
			width: 100%;
			box-sizing: border-box;
			margin: 0;
			overflow-x: hidden;
			overflow-y: auto;
			-webkit-overflow-scrolling: touch;
			flex: none;
			transform: translateX(-100%);
			transition: transform 0.22s ease;
			will-change: transform;
			z-index: 1;
		}

		@media ( prefers-reduced-motion: reduce ) {
			.mkl-pc-admin-layout__column-track > .mkl-pc-admin-layout__column {
				transition: none;
			}
		}

		.mkl-pc-admin-layout__column-track > .mkl-pc-admin-layout__column.current {
			transform: translateX(0);
			z-index: 2;
		}

		.mkl-pc-admin-layout__column-track > .mkl-pc-admin-layout__column.current ~ .mkl-pc-admin-layout__column {
			transform: translateX(100%);
		}
	}

	.mkl-pc-admin-ui__content {
		flex: 1;
		min-height: 0;
		position: relative;
		transition: transform 0.18s ease;
		will-change: transform;
		.mkl-list {
			padding-bottom: 32px;
		}

		&.structure {
			display: flex;
			flex-direction: row;
			align-items: stretch;
			gap: 16px;
			box-sizing: border-box;
			flex: 1 1 0%;
			min-height: 0;
			min-width: 0;
			align-self: stretch;
			overflow: hidden;

			> .mkl-pc-mobile-structure-toolbar {
				display: none;
			}

			> .mkl-pc-admin-layout__column-track > .structure-content,
			> .mkl-pc-admin-layout__column-track > .pc-sidebar {
				background: #fff;
				border: 1px solid $light-border-color;
				border-radius: 8px;
				box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
				flex: 1 1 0%;
				min-width: 0;
				min-height: 0;
				overflow-x: hidden;
				overflow-y: auto;
				-webkit-overflow-scrolling: touch;
				box-sizing: border-box;
				&:empty {
					opacity: .2;
				}
			}
			> .mkl-pc-admin-layout__column-track > .structure-content {
				max-width: min(420px, 50%);
				display: flex;
				flex-direction: column;
				position: relative;
				flex: 1 1 0%;
				.structure-toolbar {
					flex: 0 0 auto;
				}
				.floating-add {
					flex: 0 0 auto;
				}
				.mkl-list {
					flex: 1;
					position: relative;
					width: 100%;
					min-height: 0;
					overflow: visible;
					overflow-y: auto;
				}
			}
			> .mkl-pc-admin-layout__column-track > .pc-sidebar {
				position: relative;
				width: auto;
				flex: 1 1 0%;
				padding: 0;
				z-index: 1;
			}
			@media ( max-width: 900px ) {
				flex-direction: column;
				align-items: stretch;
				gap: 10px;
				margin-top: 10px;
				flex: 1 1 auto;

				> .mkl-pc-mobile-structure-toolbar {
					display: none;
					flex: 0 0 auto;
					align-items: center;
					padding: 8px 10px;
					background: #fff;
					border: 1px solid $light-border-color;
					border-radius: 8px;
					box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
					box-sizing: border-box;

					.mkl-pc-mobile-back-to-structure-list {
						display: inline-flex;
						align-items: center;
						gap: 4px;
						padding: 4px 0;
						text-decoration: none;

						.mkl-pc-mobile-back-to-structure-list__icon {
							line-height: 1;
						}
					}
				}

				/* Empty detail column hidden; :has() works with .pc-sidebar nested in the track */
				// &:not( :has( .pc-sidebar .layer-form ) ):not( :has( .pc-sidebar .condition-details ) ) > .mkl-pc-admin-layout__column-track > .pc-sidebar {
				// 	display: none;
				// }

				&:not( :has( .pc-sidebar .layer-form ) ):not( :has( .pc-sidebar .condition-details ) ) > .mkl-pc-admin-layout__column-track > .structure-content {
					flex: 1 1 auto;
					max-width: none;
					min-height: 0;
				}

				&:has( .pc-sidebar .layer-form ) > .mkl-pc-mobile-structure-toolbar,
				&:has( .pc-sidebar .condition-details ) > .mkl-pc-mobile-structure-toolbar {
					display: flex;
				}

				> .mkl-pc-admin-layout__column-track > .structure-content.mkl-pc-admin-layout__column,
				> .mkl-pc-admin-layout__column-track > .pc-sidebar.mkl-pc-admin-layout__column {
					position: absolute;
					left: 0;
					top: 0;
					right: 0;
					bottom: 0;
					width: 100%;
					max-width: none;
					flex: none;
				}
			}
		}

		&.settings-3d {
			display: flex;
			flex-direction: row;
			align-items: stretch;
			gap: 16px;
			box-sizing: border-box;
			flex: 1 1 0%;
			min-height: 0;
			min-width: 0;
			align-self: stretch;
			overflow: hidden;

			> .mkl-pc-admin-layout__column-track > .pc-3d-settings-column-settings,
			> .mkl-pc-admin-layout__column-track > .pc-3d-settings-column-preview {
				background: #fff;
				border: 1px solid $light-border-color;
				border-radius: 8px;
				box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
				flex: 1 1 0%;
				min-width: 0;
				min-height: 0;
				overflow-x: hidden;
				overflow-y: auto;
				-webkit-overflow-scrolling: touch;
				box-sizing: border-box;
			}

			> .mkl-pc-admin-layout__column-track > .pc-3d-settings-column-settings {
				max-width: min(420px, 50%);
				display: flex;
				flex-direction: column;
				position: relative;
				flex: 1 1 0%;
			}

			> .mkl-pc-admin-layout__column-track > .pc-3d-settings-column-preview {
				position: relative;
				width: auto;
				flex: 1 1 0%;
				padding: 0;
				z-index: 1;
				display: flex;
				flex-direction: column;
			}

			@media ( max-width: 900px ) {
				flex-direction: column;
				align-items: stretch;
				gap: 10px;
				margin-top: 0;
				flex: 1 1 auto;
				overflow: visible;

				> .mkl-pc-admin-layout__column-track {
					display: flex;
					flex-direction: column;
					flex: 1 1 auto;
					min-height: 0;
					position: relative;
					overflow: visible;
					width: 100%;
					align-self: stretch;
				}

				> .mkl-pc-admin-layout__column-track > .mkl-pc-admin-layout__column {
					position: relative;
					left: auto;
					top: auto;
					right: auto;
					bottom: auto;
					width: 100% !important;
					max-width: none !important;
					flex: 1 1 auto;
					min-height: 0;
					transform: none !important;
					transition: none;
				}

				> .mkl-pc-admin-layout__column-track > .pc-3d-settings-column-settings {
					flex: 0 1 auto;
					max-height: min(55vh, 520px);
				}

				> .mkl-pc-admin-layout__column-track > .pc-3d-settings-column-preview {
					flex: 1 1 36vh;
					min-height: 220px;
				}
			}
		}

		.form-details {
			> h2, h3 {
				padding: 16px;
				margin: 0;
			}
			.multiple-edit--action h3 {
				padding-left: 0;
			}
		}

	}

	.multiple-edit--action {
		border-bottom: 1px solid #e8e8e8;
		padding: 16px;
		> h3, .form-details h3 {
			padding: 0;
			padding-bottom: 16px;
		}
		.order {
			display: flex;
			flex-direction: column;
			width: 50px;
		}
		.order .button {
			margin-bottom: 3px;
		}
		.order .button i.dashicons {
			transform: translateY(4px);
		}
	}	
	.loading-screen {
		display: none;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 200;
		background-color: #000000c7;
	}

	.pc-sidebar {
		.section-fields {
			display: none;
		}
		.setting-section.is-opened {
			padding-bottom: 30px;
		}
		.setting-section.is-opened .section-fields {
			display: grid;
			grid-template-columns: repeat(2, minmax(0px, 1fr));
			gap: calc(16px) calc(8px);
			margin-top: -1px;
			@media(max-width: 960px) {
				grid-template-columns: repeat(1, minmax(0px, 1fr));
			}
		}
		.components-panel__body-toggle.components-button {
			background: linear-gradient(180deg, #FFF, transparent);
			box-sizing: border-box;
		}
		.setting-section:not(.is-opened) {
			.components-panel__body-toggle.components-button .components-panel__arrow {
				transform: translateY(-50%) rotate(180deg);
			}
		}
		.setting {
			grid-column: 1 / -1;
			&.col-half {
				grid-column: span 1;
			}

			&.separator::before {
				content: '';
				display: block;
				height: 1px;
				border-bottom: 1px dashed #CCC;
			}

			label.name:not(.components-checkbox-control__label),
			span.name {
				font-size: 11px;
				font-weight: 500;
				line-height: 1.4;
				text-transform: uppercase;
				display: inline-block;
				margin-bottom: 8px;
				padding: 0px;
			}
			// Flags:
			.name > img {
				display: inline-block;
				margin-left: 6px;			
			}

			> select,
			> input[type="text"],
			> input[type="number"],
			> input[type="date"],
			> textarea,
			> .name + span {
				box-sizing: border-box;
				width: 100%;
				max-width: none;
			}
			> .name + span {
				text-align: left;
				span {
					text-align: left;
					margin-right: 5px;
					padding-top: 0;					
				}
			}
			
			.selection {
				padding: 0 9px;
				border: 1px solid #00000014;
				display: inline-flex;
				align-items: center;
				min-height: 40px;
				border-radius: 3px;
			}



			// &.setting-section {
			// 	> h4 {
			// 		margin: 0;
			// 		margin-left: -16px;
			// 		margin-right: -16px;
			// 		margin-bottom: 10px;
			// 		padding: 1em;
			// 		border-bottom: 1px solid #CCC;
			// 		border-top: 1px solid #CCC;
			// 		background: #FFF;
			// 	}
			// }

			.mkl-pc-image-select {
				display: grid;
				grid-template-columns: repeat(5, minmax(0px, 1fr));
				gap: calc(16px) calc(8px);
				padding-bottom: 20px;
				@media(max-width: 1024px) {
					grid-template-columns: repeat(4, minmax(0px, 1fr));
				}
				@media(max-width: 780px) {
					grid-template-columns: repeat(2, minmax(0px, 1fr));
				}
			}
			
			.mkl-pc-image-select--item {
				display: flex;
				width: 100%;
				border-radius: 3px;

				&:focus-within {
					box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color);	
				}
				label {
					display: flex;
					flex-direction: column;
					padding: 20px 10px;
					text-align: center;
					box-shadow: 0 0 0 1px inset #CCC;
					border-radius: 5px;
					height: 100%;
					width: 100%;
					justify-content: center;
					align-items: center;
					box-sizing: border-box;
					svg, img {
						max-width: 100%;
						margin-bottom: 10px;
					}
				}
				
				input {
					width: 0;
					height: 0;
					appearance: none;
					border: none;
					opacity: 0;
					overflow: hidden;
					position: absolute;
				}
				
				input:checked + label {
					box-shadow: 0 0 0 2px inset var( --wp-admin-theme-color, #007cba );
				}
				input:focus + label {
					box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color), 0 0 0 2px inset var( --wp-admin-theme-color, #007cba );
				}
			}

		}

		header {
			display: flex;
			h2 {
				flex: 1;
				margin: 0;
				padding: 16px;
			}
		}
		.actions-container {
			padding: 16px;
		}
	}
	
	p.help {
		clear: both;
		color: var(--wc-subtext, #5F5F5F);
		max-width: 450px;
		@media (min-width: 900px) {
			padding: 0;
			padding-bottom: 1em;
			margin-bottom: 0;
		}
	}

	.loading-placeholder {
		display: inline-block;
		width: 60%;
		height: 10px;
		background: linear-gradient(45deg, #00000012, #00000008, #00000010);
		margin-left: 20px;
		margin-bottom: 9px;
	}
	.loading-placeholder:nth-child(1) {
		width: 65%;
	}
	
	.loading-placeholder:nth-child(3) {
		width: 75%;
	}
	.loading-placeholder:nth-child(4) {
		width: 72%;
	}
	.no-data {
		padding: 5px 20px;
	}
}

html .pc-modal-container {
	&.loading {
		.loading-screen {
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
		}
		.mkl-pc-editor-load--busy {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			gap: 12px;
		}
	}
	&.load-error {
		.loading-screen {
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			padding: 24px;
			box-sizing: border-box;
		}
		.mkl-pc-editor-load--busy {
			display: none !important;
		}
		.mkl-pc-editor-load--error {
			display: block !important;
			max-width: 420px;
			text-align: center;
		}
		.mkl-pc-editor-load__message {
			margin: 0 0 16px;
			color: #fff;
			font-size: 15px;
			line-height: 1.5;
		}
		.mkl-pc-editor-load__actions {
			display: flex;
			gap: 8px;
			justify-content: center;
			flex-wrap: wrap;
		}
		.mkl-pc-editor-load__retry,
		.mkl-pc-editor-load__close {
			margin-top: 4px;
		}
		.mkl-pc-admin-ui__close {
			z-index: 210;
			color: #f0f0f1;
			&:hover,
			&:focus {
				color: #fff;
				background: rgba(255, 255, 255, 0.08);
			}
		}
	}
	.success {
		color: #41B841;
	}
	.state.home {
		.mkl-pc-admin-ui__content {
			flex: 1 0 auto;
			min-height: 100%;
			height: auto;
			overflow: visible;
		}
		.tab_content {
			min-height: 100%;
			height: auto;
			padding: 0;
			@media ( min-width: 800px ) {
				display: flex;
			}
			.instructions {
				overflow: visible;
				padding: 30px;
				flex: 1;
				.instructions-header {
					display: flex;
					align-items: center;
					gap: 20px;
					margin-bottom: 20px;
				}
				.instructions-header__thumbnail {
					width: 80px;
					height: 80px;
					border-radius: 4px;
					overflow: hidden;
					border: 1px solid #CCC;
					background: #f6f6f6;
					box-sizing: border-box;
					img {
						width: 100%;
						height: 100%;
						object-fit: cover;
					}
				}
				.notice {
					margin-left: 0;
					margin-right: 0;
				}
				@media ( min-width: 800px ) {
					width: calc( 100% - 400px );
				}
			}
			.mkl-home-section {
				margin-bottom: 30px;
			}
			.more {
				padding: 20px;
				@media ( max-width: 800px ) {
					border-top: 1px solid $light-border-color;
				}
				@media ( min-width: 800px ) {
					background: $very-light-bg-color;
					border-left: 1px solid $light-border-color;
				}
			}	
		}
		
	}
	.mkl-pc-setting--warning {
		padding: 10px;
		background: #fffbf0;
		border: 1px solid #efe8df;
		border-radius: 3px;
		button + button {
			margin-left: 6px;
		}
	}
	.pc-gltf-load-error {
		margin-top: 8px;
	}

	.setting span.name.required_info {
		display: none;
	}

	.setting.required_info {
		margin-left: 34%;
		width: auto;
	}
	.mkl-pc-image-settings {
		width: 100%;
		padding: 16px;
		box-sizing: border-box;
	}

	/* Color picker settings */
	.setting > .wp-picker-container {
		position: relative;
		display: block;
		width: 100%;

		.wp-picker-input-wrap {
			display: flex !important;
			width: 100%;
		}
		.wp-picker-input-wrap label {
			display: block;
			width: 100%;
		}
		input.components-select-control__input.color-hex.wp-color-picker {
			width: 100%;
			padding-left: 40px;
		}
		span.wp-color-result-text {
			display: none;
		}
		.wp-color-result.button {
			position: absolute;
		}
	}
}

.pc-modal-opened .pc-modal-container span.select2-container,
.pc-modal-opened .pc-modal-container ~ span.select2-container {
	z-index: 1500000;
}

.pc-3d-settings {
	.pc-3d-tree {
		margin-top: 8px;
		max-height: 260px;
		overflow: auto;
		padding: 8px 10px;
		border-radius: 4px;
		background: #fff;
		box-shadow: inset 0 0 0 1px #e0e0e0;
	}

	.pc-3d-tree-list {
		margin: 0;
		padding-left: 0;
		list-style: none;
		font-size: 13px;
		line-height: 1.4;
		color: #1d2327;
	}

	.pc-3d-tree-item {
		position: relative;
		margin: 0;
		padding: 2px 0 2px 18px;
	}

	.pc-3d-tree-item::before {
		content: '';
		position: absolute;
		left: 7px;
		top: 0;
		bottom: -2px;
		border-left: 1px solid #dcdcde;
	}

	.pc-3d-tree-item::after {
		content: '';
		position: absolute;
		left: 7px;
		top: 11px;
		width: 10px;
		border-top: 1px solid #dcdcde;
	}

	.pc-3d-tree-item:last-child::before {
		bottom: 11px;
	}

	.pc-3d-tree-item > ul {
		margin: 0;
		padding-left: 14px;
		list-style: none;
	}

	.pc-3d-tree-item--root {
		font-weight: 500;
	}

	.pc-3d-tree-visible {
		margin-right: 6px;
	}

	.pc-3d-tree-label {
		vertical-align: middle;
	}

	.pc-3d-tree-item--has-children {
		padding-left: 22px;
		> .pc-3d-tree-toggle {
			position: absolute;
			left: 0;
			top: 3px;
			width: 14px;
			height: 14px;
			padding: 0;
			margin: 0;
			border: 0;
			background: #FFF;
			border: 1px solid #EEE;
			border-radius: 3px;
			z-index: 2;
			cursor: pointer;
		}
		> .pc-3d-tree-toggle::before {
			content: '▾';
			font-size: 14px;
			line-height: 14px;
			color: #50575e;
			transform: translateY(-1px);
		}
		&.is-collapsed {
			> ul {
				display: none;
			}
			> .pc-3d-tree-toggle::before {
				content: '▸';
			}
		}
	}
}

.mkl-list-item {
	border-bottom: 1px solid #f0f0f0;
	position: relative;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	transition: transform 0.2s;

	/* Fallback: plain row button only when not using the layer/choice list shell */
	&:not(.layer):not(.choice):not(.condition) button {
		position: relative;
		border: none;
		padding: $modal-spacing;
		padding-left: 36px;
		text-align: left;
		background: transparent;
		box-sizing: border-box;
		width: 100%;
		cursor: pointer;

		&:hover {
			color: var(--wp-admin-theme-color, #0073aa);
			background-color: rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.04);

			h3 {
				color: var(--wp-admin-theme-color, #0073aa);
			}
		}
	}

	/* Structure / choices / conditions: drag handle + overlay hit target + body content */
	&.layer,
	&.choice,
	&.condition {
		> .mkl-pc-admin-list-row__inner {
			position: relative;
			display: flex;
			align-items: stretch;
			min-height: 48px;
			padding-right: $modal-spacing;
			padding-left: 36px;
			box-sizing: border-box;
		}

		.mkl-pc-admin-list-row__hit {
			position: absolute;
			inset: 0;
			inset-inline-start: 36px;
			z-index: 1;
			margin: 0;
			padding: 0 !important;
			width: auto !important;
			border: 0;
			border-radius: 0;
			background: transparent;
			cursor: pointer;
			text-align: left;
			-webkit-appearance: none;
			appearance: none;
		}

		.mkl-pc-admin-list-row__body {
			position: relative;
			z-index: 2;
			flex: 1 1 auto;
			min-width: 0;
			display: flex;
			align-items: center;
			padding: 12px 0;
			pointer-events: none;
		}

		&:hover > .mkl-pc-admin-list-row__inner {
			background-color: rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.04);
		}
	}

	&.layer {
		.mkl-pc-admin-list-row__label {
			display: flex;
			flex: 1;
			align-items: center;
			gap: 10px;
			min-width: 0;
		}

		.layer-item--image {
			flex: 0 0 auto;
			width: 40px;
			height: 40px;
			border-radius: 6px;
			overflow: hidden;
			background: #f0f0f1;
			border: 1px solid #dcdcde;
			box-sizing: border-box;

			&:empty {
				background: #f6f7f7;
				border-style: dashed;
			}
		}

		.layer-item--image .layer-img {
			display: block;
			width: 100%;
			height: 100%;
			object-fit: cover;
		}

		.layer-label-container {
			margin: 0;
			font-weight: 500;
			font-size: 15px;
			line-height: 1.4;
			color: #1e1e1e;
			flex: 1 1 auto;
			min-width: 0;

			display: flex;
			flex-direction: column;
			gap: 6px;
		
			.layer-label--extras {
				font-size: 12px;
				font-weight: normal;
				opacity: 0.7;
				display: flex;
				align-items: center;
				gap: 8px;

				.layer-label--extras-item.layer-label--extras-item--type {
					display: inline-flex;
					gap: 6px;
					align-items: center;
				}
				svg {
					fill: currentColor;
				}
			}

			.layer-label--type-icon.dashicons {
				width: 16px;
				height: 16px;
				font-size: 16px;
				line-height: 1;
				flex: 0 0 auto;
				opacity: 0.5;
			}

			.layer-label--type-icon.pc-admin-icon {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				flex: 0 0 auto;
				opacity: 0.5;
			}

			.layer-label--type-icon.pc-admin-icon svg {
				width: 24px;
				height: 24px;
				display: block;
			}

			.mkl-pc--global {
				display: inline-flex;
				align-items: center;
				gap: 4px;
				vertical-align: middle;
				color: var(--global-layer-primary, #3858e9);
			}

			.mkl-pc--global-icon.dashicons {
				width: 14px;
				height: 14px;
				font-size: 14px;
				line-height: 1;
				opacity: 0.95;
				color: var(--global-layer-primary, #3858e9);
			}
		}

		&:hover > .mkl-pc-admin-list-row__inner .layer-label-container {
			color: var(--wp-admin-theme-color, #0073aa);
		}
	}

	&.choice {
		.choice-label-container {
			margin: 0;
			font-weight: 500;
			font-size: 15px;
			line-height: 1.4;
			color: #1e1e1e;
			flex: 1 1 auto;
			min-width: 0;
		}

		&:hover > .mkl-pc-admin-list-row__inner .choice-label-container {
			color: var(--wp-admin-theme-color, #0073aa);
		}
	}

	&.condition {
		.mkl-pc-admin-list-row__body h3 {
			color: #1e1e1e;
		}

		&:hover .mkl-pc-admin-list-row__body h3 {
			color: var(--wp-admin-theme-color, #0073aa);
		}
	}

	/* Content sidebar: layer row is a single button; keep thumbnail on the right */
	button.mkl-list-item.layer .icon .layer-img {
		position: absolute;
		right: 10px;
		max-height: 80%;
		max-width: 40px;
		top: 50%;
		transform: translateY(-50%);
	}

	.sort {
		width: 24px;
		height: 24px;
		position: absolute;
		z-index: 30;
		left: 6px;
		top: 50%;
		transform: translateY(-50%);
		vertical-align: middle;
		margin-right: 0.5em;
		color: #a0a5aa;
		cursor: grab;
		text-align: center;

		svg {
			opacity: 0;
		}

		&:hover {
			svg {
				fill: var(--wp-admin-theme-color, #0073aa);
			}
		}
	}

	&:not(.layer):not(.choice):not(.condition) > .sort {
		top: 14px;
	}

	&.layer > .mkl-pc-admin-list-row__inner > .sort,
	&.choice > .mkl-pc-admin-list-row__inner > .sort,
	&.condition > .mkl-pc-admin-list-row__inner > .sort {
		top: 50%;
		transform: translateY(-50%);
	}

	.group-list {
		margin: 0.7em;
		border: 1px solid #e4e4e4;
		border-radius: 8px;
		transition: box-shadow 0.2s;

		.mkl-list-item:first-child {
			> button {
				border-radius: 8px 8px 0 0;
			}

			&.layer .mkl-pc-admin-list-row__inner,
			&.choice .mkl-pc-admin-list-row__inner {
				border-radius: 8px 8px 0 0;
			}
		}

		.mkl-list-item:last-child {
			border-bottom: none;

			&:not(.is-group) > button {
				border-radius: 0 0 8px 8px;
			}

			&.layer:not(.is-group) .mkl-pc-admin-list-row__inner,
			&.choice:not(.is-group) .mkl-pc-admin-list-row__inner {
				border-radius: 0 0 8px 8px;
			}
		}

		&:empty {
			padding: 14px;
			border: 2px dashed #ccc;
		}
	}

	&:hover {
		> .mkl-pc-admin-list-row__inner > .sort svg,
		> .sort svg {
			opacity: 1;
		}

		> .group-list {
			box-shadow: 0 2px 16px #0000001c;
		}
	}

	&.active {
		position: relative;

		&.is-group {
			outline: 2px solid var(--wp-admin-theme-color, #0073aa);
			border-radius: 8px;
		}

		&:not(.layer):not(.choice):not(.condition) > button {
			background-color: rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.08);
			color: #1e1e1e;

			h3 {
				color: #1e1e1e;
			}
		}

		&.layer > .mkl-pc-admin-list-row__inner,
		&.choice > .mkl-pc-admin-list-row__inner,
		&.condition > .mkl-pc-admin-list-row__inner {
			background-color: rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.08);
		}

		&.layer .layer-label-container,
		&.choice .choice-label-container,
		&.condition .mkl-pc-admin-list-row__body h3 {
			color: #1e1e1e;
		}

	}

	&.ui-sortable-helper {
		background: rgba(255, 255, 255, 0.75);
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
		transform: scale(0.9);
	}

	h3 {
		margin: 0;
		font-weight: 500;
		font-size: 15px;
		display: flex;
		justify-content: space-between;
	}

	span.number-of-choices {
		display: inline-block;
		padding: 0 5px;
		margin-left: 9px;
		background: #efefef;
		border-radius: 4px;
	}
}

/**
 * The Image order screen.
 *
 * A stack, not a list: both ends are labelled, because "the top of the list" is
 * exactly the thing that gets read the wrong way round. Rows carry no thumbnail
 * and no layer type - this screen arranges layers rather than editing them, and
 * on a product with a hundred and fifty of them row height is scrolling.
 */
.mkl-pc-admin-ui__content.image-order {
	overflow: auto;
	padding: 16px;
	box-sizing: border-box;
}

/* -------------------------------------------------------- two-column body */

.mkl-pc-image-order__body {
	display: flex;
	align-items: flex-start;
	gap: 20px;
}

.mkl-pc-image-order__main {
	flex: 1 1 auto;
	min-width: 0;
}

.mkl-pc-image-order__preview {
	flex: 0 0 340px;
	position: sticky;
	top: 0;
	max-width: 340px;
}

/* ----------------------------------------------------------------- preview */

.mkl-pc-preview__inner {
	display: flex;
	flex-direction: column-reverse;
	gap: 8px;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: #fff;
	padding: 10px;
	box-sizing: border-box;
}

.mkl-pc-preview__side {
	min-width: 0;
}

.mkl-pc-preview__angles {
	margin-bottom: 8px;

	.mkl-pc-preview__angle-select {
		width: 100%;
		max-width: 100%;
		font-size: 12px;
		min-height: 30px;
	}
}

.mkl-pc-preview__canvas-wrap {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	width: 100%;
	min-height: 0;
}

.mkl-pc-preview__canvas {
	/* Scaled by whichever axis runs out first, so a tall product on a short screen
	   is made smaller rather than cut off. `width`/`height` auto keeps the canvas at
	   its own aspect, so either maximum can bite without distorting it.
	   The height cap is set from measurement in fit_canvas(): a percentage here
	   would resolve against a parent whose height is capped rather than definite,
	   which makes it no cap at all. */
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	border-radius: 4px;
	/* A checkerboard, because layer images are transparent and most of what they
	   draw is white or near-white. On a plain white panel half the stack would be
	   invisible. */
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #eaeaea 25%, transparent 25%, transparent 75%, #eaeaea 75%),
		linear-gradient(45deg, #eaeaea 25%, transparent 25%, transparent 75%, #eaeaea 75%);
	background-size: 16px 16px;
	background-position: 0 0, 8px 8px;
}

/* Visibility is WP's own .spinner / .spinner.is-active; this only places it. */
.mkl-pc-preview__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -10px 0 0 -10px;
	float: none;
}

.mkl-pc-preview__status {
	margin: 8px 0 0;
	min-height: 1.4em;
	font-size: 11px;
	line-height: 1.4;
	color: #646970;
}

.mkl-pc-preview__retry {
	font-size: 11px;

	&[hidden] {
		display: none;
	}
}

.mkl-pc-image-order__header {
	margin-bottom: 16px;

	h1 {
		margin: 0;
		font-size: 1.1em;
		font-weight: 600;
		line-height: 1.3;
		color: $text-color;
	}

	@media ( max-width: 900px ) {
		h1 {
			display: none;
		}
	}
}

.mkl-pc-image-order__intro {
	margin: 6px 0 0;
	max-width: 60ch;
	font-size: 13px;
	line-height: 1.6;
	color: #646970;
}

.mkl-pc-image-order__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 12px;
}

// "Order for [view]": what the list is editing.
.mkl-pc-order-view {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #646970;

	&[hidden] {
		display: none;
	}

	.mkl-pc-order-view__select {
		min-height: 30px;
		font-weight: 600;
		color: #1d2327;
	}
}

.mkl-pc-order-state {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	font-size: 13px;
	color: #646970;

	.mkl-pc-order-state__dot {
		flex: 0 0 auto;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: #c3c4c7;
	}

	&.is-custom {
		color: #1d2327;

		.mkl-pc-order-state__dot {
			background: var(--wp-admin-theme-color, #2271b1);
		}
	}
}

// The actions that apply, in one menu (the look of the Layers screen's "More actions").
.mkl-pc-order-menu {
	position: relative;
	margin-left: auto;

	&[hidden] {
		display: none;
	}

	.mkl-pc-order-menu__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 30px;
		min-height: 30px;
		padding: 0;

		svg {
			fill: currentColor;
		}
	}

	.mkl-pc-order-menu__list {
		position: absolute;
		top: calc(100% + 4px);
		right: 0;
		min-width: 260px;
		max-width: min(340px, 92vw);
		padding: 6px 0;
		background: #fff;
		border: 1px solid #dcdcde;
		border-radius: 4px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
		z-index: 30;
		box-sizing: border-box;

		&[hidden] {
			display: none;
		}
	}

	.mkl-pc-order-menu__item {
		display: block;
		width: 100%;
		margin: 0;
		padding: 8px 14px;
		font-size: 13px;
		line-height: 1.4;
		text-align: left;
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		cursor: pointer;
		color: #1d2327;

		&[hidden] {
			display: none;
		}

		&:hover,
		&:focus {
			background: #f6f7f7;
			color: var(--wp-admin-theme-color, #2271b1);
			outline: none;
		}

		&:focus-visible {
			box-shadow: inset 0 0 0 2px var(--wp-admin-theme-color, #2271b1);
		}
	}

	.mkl-pc-order-menu__label,
	.mkl-pc-order-menu__hint {
		display: block;
	}

	.mkl-pc-order-menu__hint {
		margin-top: 2px;
		font-size: 12px;
		color: #646970;
	}

	.mkl-pc-order-menu__sep {
		display: block;
		height: 1px;
		margin: 6px 0;
		background: #dcdcde;

		&[hidden] {
			display: none;
		}
	}
}

// What else shares the order on screen.
.mkl-pc-image-order__scope {
	margin: -4px 0 12px;
	font-size: 12px;
	color: #646970;

	&[hidden] {
		display: none;
	}
}

/* ------------------------------------------------------------------ filter */

.mkl-pc-image-order__filter {
	position: relative;
	margin-bottom: 8px;

	&::before {
		content: '\f179';
		font-family: dashicons;
		font-size: 18px;
		line-height: 1;
		color: #787c82;
		position: absolute;
		left: 7px;
		top: 50%;
		transform: translateY(-50%);
	}

	.mkl-pc-image-order__filter-input {
		width: 100%;
		box-sizing: border-box;
		min-height: 32px;
		padding-left: 30px;
		font-size: 13px;
	}
}

.mkl-pc-image-order__filter-note {
	display: none;
	margin: 0 0 12px;
	padding: 8px 12px;
	max-width: none;
	font-size: 12px;
	line-height: 1.5;
	color: #646970;
	background: #f6f7f7;
	border-left: 3px solid #c3c4c7;
	border-radius: 0 4px 4px 0;
}

.mkl-pc-image-order--filtering .mkl-pc-image-order__filter-note {
	display: block;
}

.mkl-pc-image-order__no-results {
	margin: 12px 0 0;
	padding: 20px 14px;
	color: #646970;
	text-align: center;
}

/* --------------------------------------------------------------- selection */

.mkl-pc-image-order__selection {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	margin-bottom: 8px;
	padding: 8px 12px;
	background: rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.06);
	border: 1px solid rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.25);
	border-radius: 4px;

	&[hidden] {
		display: none;
	}
}

.mkl-pc-image-order__selection-count {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.mkl-pc-image-order__selection-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;

	.mkl-pc-bulk {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 4px;
		min-height: 30px;

		.dashicons {
			width: 18px;
			height: 18px;
			font-size: 18px;
			line-height: 18px;
		}
	}

	/* One control that names the action it will take, rather than a Hide and a
	   Show sitting next to each other with one of them always inert. */
	.mkl-pc-bulk--visibility {
		.mkl-pc-bulk__label--show { display: none; }

		&.is-showing {
			.mkl-pc-bulk__label--hide { display: none; }
			.mkl-pc-bulk__label--show { display: inline; }
		}
	}
}

/* The preview earns its own column only when there is room for both. Below that
   it moves above the stack - source order puts it second, so it has to be pulled
   back - and turns into a wide, short strip: still sticky, so a reorder stays
   visible, but not eating the screen the list needs. */
@media ( max-width: 1100px ) {
	.mkl-pc-image-order__body {
		display: flex;
		flex-direction: column;
		gap: 0;
	}

	.mkl-pc-image-order__main {
		width: 100%;
	}

	.mkl-pc-image-order__preview {
		order: -1;
		flex: 0 0 auto;
		max-width: none;
		width: 100%;
		margin-bottom: 12px;
		z-index: 2;
	}

	.mkl-pc-preview__inner {
		display: flex;
		flex-direction: row;
		align-items: flex-start;
		gap: 12px;
		background: #fff;
	}

	.mkl-pc-preview__canvas-wrap {
		flex: 0 0 auto;
		width: 132px;
	}

	.mkl-pc-preview__side {
		flex: 1 1 auto;
		min-width: 0;
	}

	.mkl-pc-preview__angles {
		margin-bottom: 6px;
	}

	.mkl-pc-preview__status {
		margin-top: 0;
	}
}

/* On a phone the strip is a big share of the viewport, and pinning it there puts
   it over the list rather than beside it. It scrolls away with the page instead. */
@media ( max-width: 900px ) {
	.mkl-pc-image-order__preview {
		position: static;
		top: auto;
	}
}

/* ------------------------------------------------------------------- stack */

.mkl-pc-stack {
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.mkl-pc-stack-edge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #646970;
	background: #f6f7f7;

	&::after {
		content: '';
		flex: 1 1 auto;
		height: 1px;
		background: linear-gradient(to right, #dcdcde, rgba(220, 220, 222, 0));
	}
}

.mkl-pc-stack-edge--front {
	border-bottom: 1px solid #dcdcde;

	.mkl-pc-stack-edge__label {
		color: var(--wp-admin-theme-color, #2271b1);
	}
}

.mkl-pc-stack-edge--back {
	border-top: 1px solid #dcdcde;
}

/* The generic list padding would open a gap above the "Back" edge. */
.mkl-pc-admin-ui__content .mkl-pc-stack__list {
	padding-bottom: 0;
}

.mkl-pc-stack__list:empty {
	display: none;
}

/* sortable('disable') also adds ui-state-disabled, which the jQuery UI theme
   fades out. The list is still being read while it is filtered. */
.mkl-pc-stack__list.ui-state-disabled {
	opacity: 1;
	filter: none;
}

.mkl-pc-stack-item {
	background: #fff;

	&.layer > .mkl-pc-admin-list-row__inner {
		display: flex;
		align-items: center;
		gap: 10px;
		min-height: 0;
		padding: 4px 12px 4px 30px;
	}

	&:last-child {
		border-bottom: none;
	}

	&.is-selected {
		background: rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.06);
	}

	&.mkl-pc-stack-item--moved {
		background-color: rgba(var(--wp-admin-theme-color--rgb, rgb(0, 115, 170)), 0.16);
		transition: background-color 0.4s ease-out;
	}
}

.mkl-pc-stack-item__select {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	margin: 0;

	input[type="checkbox"] {
		margin: 0;
	}
}

.mkl-pc-stack-item__name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	line-height: 1.4;
	color: #1d2327;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mkl-pc-stack-pos {
	flex: 0 0 auto;

	.mkl-pc-stack-pos__input {
		width: 58px;
		min-height: 28px;
		padding: 0 4px;
		font-size: 12px;
		text-align: center;
	}
}

.mkl-pc-stack-move {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 2px;
}

.mkl-pc-image-order__conditions {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin: 0 0 8px;
	padding: 8px 12px;
	font-size: 12px;
	line-height: 1.5;
	color: #50575e;
	background: #f6f7f7;
	border-left: 3px solid var(--wp-admin-theme-color, #2271b1);
	border-radius: 0 4px 4px 0;

	&[hidden] { display: none; }

	.dashicons {
		flex: 0 0 auto;
		width: 16px;
		height: 16px;
		font-size: 16px;
		line-height: 16px;
		color: var(--wp-admin-theme-color, #2271b1);
	}

	&.is-pending .mkl-pc-conditions-show-all { display: none; }

	.mkl-pc-conditions-show-all {
		flex: 0 0 auto;
		margin-left: auto;
		font-size: 12px;
	}
}

/* Off because the rules say a customer would not see it here - distinct from a
   row somebody switched off to look underneath. */
.mkl-pc-stack-item.is-hidden-by-conditions .mkl-pc-stack-item__name::after {
	content: '\f504';
	font-family: dashicons;
	font-size: 14px;
	line-height: 1;
	vertical-align: -2px;
	margin-left: 6px;
	color: var(--wp-admin-theme-color, #2271b1);
	text-decoration: none;
}

/* Switched off in the preview only - the layer still ships, it is just not drawn
   here while you look at what sits under it. */
.mkl-pc-stack-item.is-preview-hidden .mkl-pc-stack-item__name {
	color: #8c929b;
	text-decoration: line-through;
	text-decoration-color: #c3c4c7;
}

.mkl-pc-stack-item.is-preview-hidden .mkl-pc-stack-vis {
	color: var(--wp-admin-theme-color, #2271b1);
}

.mkl-pc-stack-move__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	color: #50575e;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;

	.dashicons {
		width: 18px;
		height: 18px;
		font-size: 18px;
		line-height: 18px;
	}

	&:hover:not( [disabled] ) {
		color: var(--wp-admin-theme-color, #2271b1);
		border-color: #dcdcde;
		background: #f6f7f7;
	}

	&:focus-visible {
		outline: 2px solid var(--wp-admin-theme-color, #2271b1);
		outline-offset: 1px;
	}

	&[disabled] {
		color: #c3c4c7;
		cursor: default;
	}
}

/* Dragging moves a layer past its neighbours; with rows hidden they are not the
   neighbours the screen is showing. */
.mkl-pc-image-order--filtering .mkl-pc-stack-item > .mkl-pc-admin-list-row__inner > .sort {
	visibility: hidden;
}

/* ------------------------------------------------------------ empty states */

.mkl-pc-image-order__empty {
	display: none;
	margin: 0;
	padding: 24px 14px;
	color: #646970;
	text-align: center;
	border: 1px dashed #dcdcde;
	border-radius: 8px;
}

.mkl-pc-image-order--empty {
	.mkl-pc-stack,
	.mkl-pc-image-order__bar,
	.mkl-pc-image-order__scope,
	.mkl-pc-image-order__filter,
	.mkl-pc-image-order__selection {
		display: none;
	}

	.mkl-pc-image-order__empty {
		display: block;
	}
}

/* ------------------------------------------------------- desktop: inner scroll */

/**
 * With room for two columns, the screen holds still and the stack scrolls inside
 * it. Scrolling the whole panel took the filter, the selection bar and both end
 * labels off screen - and those are the things you navigate a long stack with,
 * so they are exactly what should not move.
 *
 * The stack shrinks rather than grows: `0 1 auto` keeps a short list compact
 * instead of stretching an mostly-empty bordered box down the page, and lets a
 * long one give way to the scroller.
 */
@media ( min-width: 1101px ) {
	.mkl-pc-admin-ui__content.image-order {
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	.mkl-pc-image-order__body {
		align-items: stretch;
		flex: 1 1 auto;
		min-height: 0;
		min-width: 690px;
	}

	.mkl-pc-image-order__main {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	/* Stretching the column is what bounds the preview's height; without it
	   `max-height: 100%` on the canvas resolves against nothing and a tall product
	   overflows the panel, which no longer scrolls. */
	.mkl-pc-image-order__preview {
		align-self: stretch;
		min-height: 0;
	}

	.mkl-pc-preview__inner {
		max-height: 100%;
		/* column-reverse runs bottom-up, so packing at main-end is what puts the
		   group at the top of a column taller than its content. */
		justify-content: flex-end;
		min-height: 0;
	}

	.mkl-pc-preview__canvas-wrap {
		flex: 0 1 auto;
	}

	.mkl-pc-stack {
		display: flex;
		flex-direction: column;
		flex: 0 1 auto;
		min-height: 0;
	}

	.mkl-pc-stack-edge {
		flex: 0 0 auto;
	}

	.mkl-pc-stack__list {
		flex: 1 1 auto;
		min-height: 0;
		overflow-y: auto;
	}
}

.mkl-list-item__placeholder {
    background: #EFEFEF;
    border: 2px dashed #CCC;
}

.mkl-list .mkl-list-item.mkl-list-item--filtered-out,
ul.layers > li.mkl-list-item--filtered-out {
	display: none !important;
}

.mkl-pc-admin-ui__sidebar-layers-filter {
	padding: 0 0 25px;
	box-sizing: border-box;

	.mkl-pc-list-filter-input {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	/* Dark sidebar: search field matches block-editor / dark rail inputs */
	.mkl-pc-list-filter-input--sidebar-layers {
		margin: 0;
		min-height: 32px;
		padding: 6px 10px 6px 10px;
		font-size: 13px;
		line-height: 1.4;
		color: $pc-admin-sidebar-fg;
		background: #2c2c2c;
		border: 1px solid rgba(255, 255, 255, 0.12);
		border-radius: 4px;
		box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
		-webkit-appearance: none;
		appearance: none;

		&::placeholder {
			color: $pc-admin-sidebar-fg-mutted;
			opacity: 1;
		}

		&:hover {
			color: $pc-admin-sidebar-fg;
			border-color: rgba(255, 255, 255, 0.2);
			background: #333;
		}

		&:focus {
			color: $pc-admin-sidebar-fg;
			background: #262626;
			border-color: var(--wp-admin-theme-color, #3858e9);
			box-shadow:
				0 0 0 1px var(--wp-admin-theme-color, #3858e9),
				inset 0 1px 2px rgba(0, 0, 0, 0.35);
			outline: none;
		}
	}
}

.structure-toolbar.pc-objects3d-toolbar {
	// Anchor the add menu below the toggle; avoid flex align-items:center + abspos top:auto
	// static-position rules that vertically center a tall menu with the short button.
	.structure-toolbar__primary {
		position: relative;
		align-items: flex-start;
	}

	.pc-3d-add-toggle {
		position: static;
		transform: none;
	}
	.pc-3d-add-menu {
		margin-top: 10px;
		border: 1px solid rgb(187, 185, 185);
		z-index: 20;
		background: #FFF;
		padding: 15px;
		overflow: auto;
		@media( min-width: 900px ){
			border-radius: 4px;
			box-shadow: 0 4px 15px #00000009;
			position: absolute;
			top: 100%;
			left: 0;
			right: auto;
			margin-top: 8px;
			width: max-content;
			max-width: min( 360px, calc( 100vw - 32px ) );
			max-height: calc(100vh - 330Px);
		}

		&.hidden {
			display: none;
		}
	}
	.pc-3d-add-section {
		margin-bottom: 10px;
		h4 {
			margin: 0 0 8px;
			font-size: 12px;
			font-weight: 600;
		}
	}
	.pc-3d-add-grid {
		display: grid;
		grid-template-columns: repeat(3, 100px);
		gap: 6px;
	}
	.pc-3d-add-tile.button {
		position: relative;
		transform: none;
		width: 100%;
		min-height: 60px;
		height: auto;
		margin: 0;
		top: 0;
		left: 0;

		padding: 15px 8px;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 8px;
		line-height: 1.1;

		background: transparent;
		border: none;
		cursor: pointer;
		color: initial;
		font-size: 14px;
		&::after {
			content: '';
			background-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
			opacity: 0;
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
		}
		&:hover, &:focus {
			color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
			&::after {
				opacity: 0.04;
			}
		}
	}
	.pc-3d-add-tile {
		.dashicons, svg {
			font-size: 24px;
			width: 24px;
			height: 24px;
			margin-bottom: 4px;
			path {
				fill: currentColor;
			}
		}
	}
	.pc-3d-add-tile-label {
		font-size: 10px;
		text-align: center;
		white-space: normal;
	}
	.pc-3d-premium-objects-notice {
		.addon-setting-info {
			padding: 8px 10px;
		}
		.pc-3d-add-grid {
			margin: 8px 0 4px;
		}
	}
	.pc-3d-add-tile--teaser {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 6px;
		min-height: 60px;
		padding: 10px 8px;
		box-sizing: border-box;
		color: #1d2327;
		background: #f6f7f7;
		border-radius: 2px;
		cursor: default;
	}
}

.structure-toolbar {
	position: sticky;
	top: 0;
	z-index: 3;
	padding: 12px 14px;
	
	border-bottom: 1px solid #dcdcde;
	background: #fff;
	border-radius: 8px 8px 0 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	flex-wrap: nowrap;
	gap: 0;
	box-sizing: border-box;

	.structure-toolbar__primary {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 8px 12px;
		width: 100%;
		box-sizing: border-box;

		h1 {
			flex: 0 1 auto;
			margin: 0;
			font-size: 1.1em;
			font-weight: 600;
			line-height: 1.3;
			color: $text-color;
			min-width: 0;
		}
	}

	.structure-toolbar__add {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
		gap: 8px;
		flex: 1 1 200px;
		min-width: 0;

		h4 {
			flex: 1 1 200px;
			max-width: min(320px, 100%);
			margin: 0;
			min-width: 0;
			position: relative;

			input {
				width: 100%;
				box-sizing: border-box;
			}
		}

		button.add-layer,
		.button.add-layer,
		.button-primary {
			position: static;
			transform: none;
			align-self: center;
			flex: 0 0 auto;
			white-space: nowrap;
			@media (max-width: 900px) {
				height: auto;
				padding-left: 10px;
				padding-right: 10px;
				line-height: 1;

				span {
					position: absolute;
					clip: rect(0 0 0 0);
					overflow: hidden;
					width: 1px;
					height: 1px;
					border: 0;
					margin: -1px;
					padding: 0;
					white-space: nowrap;
					pointer-events: none;
				}

				&::before {
					content: '\f132';
					font-family: 'dashicons';
					font-size: 1.3em;
					padding-top: 2px;
					display: inline-block;
				}
			}
		}
	}

	.structure-toolbar__filter {
		flex: none;
		display: flex;
		align-items: center;
		gap: 8px;
		width: 100%;
		min-width: 0;
		box-sizing: border-box;
		margin-top: 10px;
		padding-top: 10px;
		border-top: 1px solid #dcdcde;
		position: relative;

		&::before {
			content: '\f179';
			font-family: dashicons;
			font-size: 18px;
			line-height: 1;
			color: #787c82;
			flex: 0 0 auto;
			position: absolute;
			left: 7px;
		}

		.mkl-pc-list-filter-input {
			flex: 1 1 auto;
			min-width: 0;
			width: 100%;
			max-width: 100%;
			box-sizing: border-box;
			min-height: 32px;
			padding-left: 30px;
			font-size: 12px;
		}
	}

	.mkl-pc-toolbar-dropdown {
		position: relative;
		flex: 0 0 auto;
		align-self: center;

		.mkl-pc-toolbar-more {
			min-width: 26px;
			padding-left: 0;
			padding-right: 0;
			display: inline-flex;
			align-items: center;
			justify-content: center;
			border: none;
		}

		.mkl-pc-toolbar-dropdown__menu[hidden] {
			display: none !important;
		}

		.mkl-pc-toolbar-dropdown__menu {
			position: absolute;
			top: calc(100% + 4px);
			right: 0;
			left: auto;
			min-width: 248px;
			max-width: min(320px, 92vw);
			margin: 0;
			padding: 6px 0;
			background: #fff;
			border: 1px solid #dcdcde;
			border-radius: 4px;
			box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
			z-index: 30;
			box-sizing: border-box;
		}

		.mkl-pc-toolbar-dropdown__sep {
			display: block;
			height: 1px;
			margin: 6px 0;
			padding: 0;
			background: #dcdcde;
			border: 0;
		}

		.mkl-pc-toolbar-dropdown__label {
			padding: 8px 14px 4px;
			font-size: 11px;
			font-weight: 600;
			text-transform: uppercase;
			letter-spacing: 0.02em;
			color: #646970;
			line-height: 1.3;
		}

		.mkl-pc-toolbar-dropdown__group {
			padding-bottom: 4px;
		}

		.mkl-pc-toolbar-dropdown__item {
			display: block;
			width: 100%;
			margin: 0;
			padding: 8px 14px;
			font-size: 13px;
			line-height: 1.4;
			text-align: left;
			border: 0;
			border-radius: 0;
			background: transparent;
			box-shadow: none;
			cursor: pointer;
			color: #1d2327;
			position: relative;

			&:hover,
			&:focus {
				background: #f6f7f7;
				color: var(--wp-admin-theme-color, #2271b1);
			}

			&.mkl-pc-toolbar-dropdown__item--choice {
				padding-left: 36px;

				&.mkl-pc-toolbar-dropdown__item--active::before {
					content: '\f147';
					font-family: dashicons;
					font-size: 18px;
					line-height: 1;
					position: absolute;
					left: 10px;
					top: 50%;
					transform: translateY(-50%);
					color: var(--wp-admin-theme-color, #2271b1);
				}
			}
		}
	}

	&.structure-toolbar--choices .structure-toolbar__primary h1 {
		flex: 0 0 auto;
	}
}

.form-details {
	.notice {
		margin-left: 0;
		margin-right: 0;
		margin-bottom: 10px;
	}
}

.mkl-pc-badge {
	display: inline-block;
	font-size: 10px;
	text-transform: uppercase;
	font-weight: normal;
	line-height: 1;
	vertical-align: middle;
	padding: 4px;
	border-radius: 4px;
	background: var(--mkl_pc-badge-background);
	color: #FFF;
}

.form-details label.euler-axis input[type="number"] {
    max-width: 80px;
}

.mkl-pc-setting--euler {
    display: flex;
    gap: 8px;
}

span.euler-axis-label {
    display: block;
    padding: 0 7px;
}

label.euler-axis {
    display: flex;
    align-items: center;
    background: #EEE;
    border-radius: 3px;
}
/*
 * Content tab — choices columns. Base rules below; canonical layout under .mkl-pc-admin-ui--content-mode.
 */
.content-col {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	box-sizing: border-box;
	overflow: auto;
}

/* Legacy two-step panel slide (choices list vs detail); superseded where --content-mode sets grid */
.content-choices-list {
	width: $left-col-width + 45;
	padding-left: 45px;
	visibility: hidden;
	transform: translateX(300px);
	transition: transform 0.2s, visibility 0.2s;
	overflow: hidden;
	background: $very-light-bg-color;
	border-right: 1px solid $light-border-color;
	z-index: 2;
	@media(max-width: 900px) {
		width: $tablet-left-col-width; 
	}
	
	.mkl-choice-list-inner {
		height: 100%;
		overflow: auto;
		.structure-toolbar {
			position: sticky;
			top: 0;
			z-index: 3;
		}
		.paste {
			position: sticky;
			bottom: 0;
			background: #ffffff;
			padding: 5px;
			text-align: center;
		}
	}

}

.choice-details {
	visibility: hidden;
	right: 0;
	left: 344px;
	background: #F8F8F8;
	width: auto;

	@media(max-width: 900px) {
		left: $tablet-left-col-width - 1;
	}


	.options {
		& + .options {
			border-top: 1px solid $light-border-color;
		}
		.view {
			.pictures {
				padding: 5px; 
				@media ( min-width: 750px ) {
					> h4 {
						width: 120px;
						float: left;
						text-align: right;
						padding-right: $modal-spacing;
					}
				}
				.picture {
					display: block;
					float: left;
					margin-right: 6px;
					position: relative;
					
					img, & > span {
						display: block;
					}

					a {
						text-decoration: none;
					}
					
				}			
				img {
					padding: 2px; 
					border: 1px solid $light-border-color;
					height: auto;
					max-width: 80px;
				}
			}
		}
	}
}
.mkl-pc-setting--container {
	width: 100%;
}

// Layer form, Mask section: one row per view (views/layer-masks.js)
.mkl-pc-layer-masks__list {
	display: grid;
	gap: 12px;
}
.mkl-pc-layer-mask {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	&__view {
		flex: 1 1 100%;
		font-weight: 500;
		overflow-wrap: anywhere;
	}
	&__picture {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 64px;
		height: 64px;
		padding: 2px;
		border: 1px solid $light-border-color;
		border-radius: 2px;
		cursor: pointer;
		// A checkerboard, so the mask's transparent parts read as transparent
		background: repeating-conic-gradient( #dcdcde 0% 25%, #fff 0% 50% ) 50% / 12px 12px;
		img {
			display: block;
			max-width: 100%;
			max-height: 100%;
		}
		&:disabled {
			cursor: default;
		}
	}
	&__details {
		display: flex;
		flex-direction: column;
		flex: 1 1 0;
		min-width: 0;
	}
	&__file {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	&__size {
		color: #757575;
		font-size: 12px;
	}
	&__warning {
		flex: 1 1 100%;
		margin: 0;
	}
	// A tile, its caption under it (the `compact` option).
	&--compact {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: center;
		gap: 4px;
		.mkl-pc-layer-mask__picture {
			width: 72px;
			height: 72px;
		}
		.mkl-pc-layer-mask__caption {
			color: #646970;
			font-size: 12px;
		}
		.mkl-pc-layer-mask__warning {
			flex: 0 0 auto;
			max-width: 160px;
			font-size: 12px;
		}
	}
	&__tile {
		position: relative;
		display: block;
	}
	&__remove {
		position: absolute;
		top: -6px;
		right: -6px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 20px;
		height: 20px;
		padding: 0;
		border: 1px solid $light-border-color;
		border-radius: 50%;
		background: #fff;
		color: #50575e;
		cursor: pointer;
		.dashicons {
			width: 16px;
			height: 16px;
			font-size: 16px;
		}
		&:hover,
		&:focus-visible {
			color: #b32d2e;
			border-color: #b32d2e;
		}
	}
}
.mkl-pc-admin-ui--content-mode {
	.mkl-pc-admin-ui__content.content {
		position: relative;
		display: grid;
		grid-template-columns: minmax(0, 380px) minmax(0, 1.12fr);
		gap: 10px;
		min-height: 0;
		flex: 1;
		width: 100%;
		box-sizing: border-box;
		align-content: stretch;

		> .mkl-pc-mobile-content-toolbar--choices-back,
		> .mkl-pc-mobile-content-toolbar--layers-back {
			display: none;
		}

		> .mkl-pc-admin-layout__column-track > .mkl-pc-content-main-layer-panel {
			display: none;
		}
		.content-choices-list,
		.content-choice.choice-details {
			position: relative;
			left: auto;
			right: auto;
			top: auto;
			bottom: auto;
			width: auto;
			max-height: none;
			min-height: 0;
			transform: none;
			transition: none;
		}
		.content-choices-list {
			visibility: visible;
			padding: 0;
			background: #fff;
			border: 1px solid $light-border-color;
			box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
			overflow: auto;
			@media (min-width: 900px) {
				border-radius: 8px;
			}
		}
		.content-choice.choice-details {
			visibility: visible;
			left: auto;
			background: #fff;
			border: 1px solid $light-border-color;
			border-radius: 8px;
		}

		.choice-details:has(> .choice-form),
		.choice-details:has(> .layer-form) {
			> .mkl-pc-content-placeholder {
				display: none;
			}
		}
		.mkl-pc-content-placeholder {
			margin: 0;
			padding: 12px 14px;
			color: #646970;
			font-size: 13px;
			line-height: 1.45;

			display: flex;
			height: 100%;
			justify-content: center;
			align-items: center;
			box-sizing: border-box;
		}

		@media ( max-width: 900px ) {
			display: flex;
			flex-direction: column;
			gap: 10px;
			min-height: 0;
			margin-top: 10px;

			> .mkl-pc-admin-layout__column-track {
				flex: 1 1 auto;
				min-height: 0;
			}

			> .mkl-pc-mobile-content-toolbar--choices-back,
			> .mkl-pc-mobile-content-toolbar--layers-back {
				display: none;
				flex: 0 0 auto;
				align-items: center;
				padding: 8px 10px;
				background: #fff;
				border: 1px solid $light-border-color;
				border-radius: 8px;
				box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
				box-sizing: border-box;

				.mkl-pc-mobile-back-to-choices-list,
				.mkl-pc-mobile-back-to-layers {
					display: inline-flex;
					align-items: center;
					gap: 4px;
					padding: 4px 0;
					text-decoration: none;
				}

				.mkl-pc-mobile-back-to-choices-list__icon,
				.mkl-pc-mobile-back-to-layers__icon {
					line-height: 1;
				}
			}

			> .mkl-pc-admin-layout__column-track > .mkl-pc-content-main-layer-panel {
				display: flex;
				flex-direction: column;
				flex: 1 1 auto;
				min-height: 0;
				background: #fff;
				border: 1px solid $light-border-color;
				border-radius: 8px;
				box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
				box-sizing: border-box;
				overflow: hidden;

				.mkl-pc-content-main-layer-panel__heading {
					margin: 0;
					padding: 12px 14px 8px;
					font-size: 14px;
					font-weight: 600;
					border-bottom: 1px solid $light-border-color;
					flex: 0 0 auto;
				}

				.mkl-pc-content-main-layer-panel__filter {
					padding: 8px 10px;
					border-bottom: 1px solid $light-border-color;
					flex: 0 0 auto;
				}

				.mkl-pc-content-main-layers-list {
					flex: 1 1 auto;
					min-height: 0;
					overflow: auto;
					-webkit-overflow-scrolling: touch;
					padding: 6px 8px 10px;

					ul.layers {
						margin: 0;
						padding: 0;
						list-style: none;
					}

					li {
						margin: 0 0 6px;
						padding: 0;

						&:last-child {
							margin-bottom: 0;
						}
					}

					li button.layer {
						width: 100%;
						max-width: 100%;
						box-sizing: border-box;
						display: flex;
						align-items: center;
						gap: 8px;
						flex-wrap: wrap;
						padding: 10px 12px;
						margin: 0;
						border: 1px solid $light-border-color;
						border-radius: 6px;
						background: #f6f7f7;
						color: $text-color;
						font-family: inherit;
						font-size: 13px;
						line-height: 1.35;
						font-weight: 400;
						text-align: left;
						text-decoration: none;
						cursor: pointer;
						box-shadow: none;
						-webkit-appearance: none;
						appearance: none;
						transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;

						&:hover {
							background: #fff;
							border-color: #c3c4c7;
						}

						&:focus {
							outline: none;
							background: #fff;
							border-color: var(--wp-admin-theme-color, #2271b1);
							box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #2271b1);
						}

						&:focus:not(:focus-visible) {
							box-shadow: none;
						}

						&:focus-visible {
							box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.25);
						}
					}

					li.active button.layer {
						background: #fff;
						border-color: var(--wp-admin-theme-color, #2271b1);
						box-shadow: inset 3px 0 0 var(--wp-admin-theme-color, #2271b1);
						font-weight: 500;
					}

					.name {
						flex: 1 1 auto;
						min-width: 0;
						word-break: break-word;
					}

					span.number-of-choices {
						margin-left: auto;
						flex-shrink: 0;
						min-width: 1.5em;
						padding: 2px 8px;
						border-radius: 10px;
						font-size: 11px;
						font-weight: 600;
						line-height: 1.35;
						text-align: center;
						background: #dcdcde;
						color: #1d2327;
					}

					li.active span.number-of-choices {
						background: rgba(34, 113, 177, 0.12);
						color: #1d2327;
					}
				}
			}

			.content-choices-list,
			.content-choice.choice-details {
				width: 100%;
				min-height: 0;
			}

			&:not( :has( .content-choice.choice-details .choice-form ) ):not( :has( .content-choice.choice-details .layer-form ) ):not( [data-mkl-pc-content-stack="choice_detail"] ) {
				> .mkl-pc-admin-layout__column-track > .content-choice.choice-details {
					display: none;
				}
			}

			&:has( .content-choice.choice-details .choice-form ),
			&:has( .content-choice.choice-details .layer-form ),
			&[data-mkl-pc-content-stack="choice_detail"] {
				> .mkl-pc-mobile-content-toolbar--choices-back {
					display: flex;
				}

				> .mkl-pc-mobile-content-toolbar--layers-back {
					display: none !important;
				}
			}

			&[data-mkl-pc-content-stack="choices"] > .mkl-pc-mobile-content-toolbar--layers-back {
				display: flex;
			}

			> .mkl-pc-admin-layout__column-track > .mkl-pc-content-main-layer-panel.mkl-pc-admin-layout__column,
			> .mkl-pc-admin-layout__column-track > .content-choices-list.mkl-pc-admin-layout__column,
			> .mkl-pc-admin-layout__column-track > .content-choice.choice-details.mkl-pc-admin-layout__column {
				position: absolute;
				left: 0;
				top: 0;
				right: 0;
				bottom: 0;
				width: 100%;
				max-width: none;
				flex: none;
			}
		}
	}

	/* Empty-state (left column): .content-state wraps .mkl-pc-admin-ui__content, not vice versa */
	.state.content-state.show-choices .mkl-pc-admin-ui__content.content .content-choices-list > .mkl-pc-content-placeholder {
		display: none;
	}
}
.tab_content {
	padding: 1.6em;
}

.mkl-pc-product-selector--container {
    position: fixed;
    z-index: 160001;
    top: 0;
    left: 0;
    width: 100%;
	height: 100%;
	
	&::before {
		content: '';
		display: block;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: #000;
		opacity: 0.4;
	}
	
	.mkl-pc-product-selector {
		position: absolute;
		width: 100%;
		max-width: 650px;
		padding: 1em;
		background: #FFF;
		box-shadow: 0 5px 15px rgba(0, 0, 0, .19);
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}
}

.mkl-pc-3d-object-selector--container {
	position: fixed;
	z-index: 160001;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;

	&::before {
		content: '';
		display: block;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: #000;
		opacity: 0.4;
	}

	.mkl-pc-3d-object-selector {
		position: absolute;
		width: 100%;
		max-width: 480px;
		max-height: 80vh;
		padding: 1em;
		background: #fff;
		box-shadow: 0 5px 15px rgba(0, 0, 0, 0.19);
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		display: flex;
		flex-direction: column;

		h3 {
			margin-top: 0;
		}

		.mkl-pc-3d-object-selector--filter {
			margin: 0 0 0.5em;
		}

		.mkl-pc-3d-object-selector--filter-input {
			width: 100%;
			padding: 4px 8px;
		}

		.mkl-pc-3d-object-selector--tree-container {
			flex: 1;
			min-height: 200px;
			max-height: 40vh;
			overflow: auto;
			border: 1px solid #c3c4c7;
			padding: 4px;
			margin-bottom: 1em;
		}

		.mkl-pc-3d-object-selector--tree {
			list-style: none;
			margin: 0;
			padding: 0;
		}

		.mkl-pc-3d-object-selector--item {
			cursor: pointer;
			padding: 4px 8px;
			margin: 2px 0;
			border-radius: 2px;

			&:hover {
				background: #f0f0f1;
			}

			&.selected {
				background: #2271b1;
				color: #fff;
			}
		}

		// One heading per model when a picker lists every model.
		.mkl-pc-3d-object-selector--subheader {
			padding: 10px 8px 4px;
			font-weight: 600;
			text-transform: uppercase;
			font-size: 11px;
			color: #50575e;

			&:first-child {
				padding-top: 4px;
			}
		}

		.mkl-pc-3d-object-selector--item-model {
			font-style: italic;
		}

		.mkl-pc-3d-object-selector--show-all {
			margin: 0 0 8px;
		}

		.mkl-pc-3d-object-selector--actions {
			display: flex;
			gap: 8px;
		}
	}
}

.mkl-pc-admin-ui__content.import-export {

	.import-export-content {
		display: flex;
		width: 100%;
		height: 100%;
		> div {
			flex: 1;
			text-align: center;
			padding-top: 3em;
			&.export {
				border-left: 1px solid $light-border-color;
			}
		}
	}

	.importer-action-content {
		display: none;
	}

	.importer-header {
		border-bottom: 1px solid $light-border-color;
		display: flex;
		// WP 7 fix
		button .dashicons {
			line-height: 1;
		}
		ol {
			display: flex;
			width: 100%;
			margin: 0;
			padding: 0;
			border-left: 2px solid #fff;
			li {
				flex: 1;
				display: block;
				list-style-type: none;
				text-align: center;
				padding: 10px;
				margin: 0;

				&.active {
					border-bottom: 4px solid var(--wp-admin-theme-color, #2171b1);
					background: #EFEFEF;
				}
			}
		}
		
	}

	.importer .form label {
		display: block;
		padding-bottom: .5em;
	}
	
	.selector-container {
		.selector {
			display: flex;
			border: 1px solid $light-border-color;
			border-radius: 0.6em;
			ul {
				flex: 1;
				margin: 0;
				padding: 0;

				&.selected {
					border-left: 1px solid $light-border-color;
				}

				li a {
					display: block;
					text-decoration: none;
					padding: .7em;
					border-bottom: 1px solid;
				}
			}
			
		}
		
	}
	

	// -------

	.importer--upload,
	.importer--complete {
		padding: 10px 20px;
	}
	
	.preview-content {
		position: absolute;
		top: 43px;
		width: calc(100% - 250px);
		left: 250px;
		display: flex;
		bottom: 0;
	}
	
	.preview-content--collection {
		width: calc(100% / 3);
		border-left: 1px solid #EFEFEF;
		padding: 10px;
		height: 100%;
		overflow: auto;
		box-sizing: border-box;
	}
	
	.preview-action {
		width: 250px;
		box-sizing: border-box;		
		padding: 10px;
		padding-left: 20px;
	}
}

.state.showing-tool .mkl-pc-admin-ui__content.import-export {
	.import-export-content {
		display: none;
	}

	.importer-action-content {
		display: block;
	}
}

#order_line_items {
	.user-uploads {
		margin-bottom: 10px;
		padding-bottom: 10px;
		padding-top: 10px;
		border-bottom: 1px solid #f1f1f7;
		border-top: 1px solid #f1f1f7;
		margin-top: 10px;
		h4 {
			margin: 0;
		}
	}
}

.add-on-placeholder {
    label { display: none !important; }
}

a.mkl-pc-link--external::before {
    content: '';
    font-family: dashicons;
    font-size: 18px;
    vertical-align: middle;
}

.addon-setting-info {
    padding: 5px 5px 5px 20px;
    border: 1px solid #c0cbc5;
    border-left: 4px solid #73ce99;
	p {
		margin: 5px 0;
	}	
}

.pc-3d-ar-discovery,
.pc-3d-postprocessing-discovery {
	display: flex;
	flex-direction: column;
	gap: 0.25em;

	&__icon {
		display: inline-flex;
		width: 2rem;
		height: 2rem;
		color: var(--wp-admin-theme-color, #007cba);

		svg {
			width: 100%;
			height: 100%;
		}
	}
}

/* Floating add button */
.floating-add {
    position: absolute;
    top: 0;
    width: 100%;
    left: 0;
    z-index: 10;	
	&::before {
		content: '';
		width: 100%;
		height: 2px;
		display: block;
		background: var(--wp-admin-theme-color, #007cba);
		visibility: hidden;
		opacity: 0;
		transition: .2s all;
	}
	
	button.mkl-floating-add-item {
		transition: .2s all;
		display: block;
		position: absolute;
		visibility: hidden;
		opacity: 0;
		top: 50%;
		left: 50%;
		transform: translateY(-50%) translateX(-50%);
		border: 1px solid var(--wp-admin-theme-color, #007cba);
		background: var(--wp-admin-theme-color, #007cba);
		color: #FFF;
		line-height: 28px;
		height: 28px;
		width: 28px;
		padding: 0;
		i {
			border-radius: 3px;
			line-height: 28px;
			height: 28px;
		}
	}
	&.showing {
		&::before {
			visibility: visible;
			opacity: 1;	
		}
		button.mkl-floating-add-item {
			visibility: visible;
			opacity: 1;	
		}
	}
}

.pc-sidebar .setting .field-repeater {
	
	border: 1px solid #CCC;

	button {
		&.remove-option span {
			display: none;
		}
		
		&.add-option {
			margin: 10px;
		}
	}
	
	min-width: 0;

	// Reorder arrows | fields | remove. Fields stack in the middle column so a row
	// with several visible fields (e.g. Choice > Actions) never outgrows the sidebar.
	.field-repeater--option {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr) auto;
		align-items: start;
		padding: 8px;
		border-bottom: 1px solid #e0e0e0;
		gap: 6px 4px;

		> *:not(.order):not(.remove-option) {
			grid-column: 2;
			min-width: 0;
		}

		label {
			display: block;
			input {
				float: none;
			}
			input[type="text"], input[type="number"], select {
				display: block;
				box-sizing: border-box;
				width: 100%;
				max-width: 100%;
			}
		}
		.pc-attachment-link {
			display: block;
			overflow-wrap: anywhere;
		}
		.pc-anchor-list,
		.pc-object-choice {
			display: block;
			margin-bottom: 4px;
			overflow-wrap: anywhere;
		}
		// .button sets its own display, which beats the attribute.
		[hidden] {
			display: none !important;
		}
		.remove-option {
			grid-column: 3;
			grid-row: 1;
			border: none;
			i.dashicons {
				line-height: 1;
				transform: translateY(-3px);
				& + span {
					display: none;
				}
			} 
		}		
		.order {
			grid-column: 1;
			grid-row: 1;
			display: flex;
			flex-direction: column;
			margin-right: 3px;
			button.button {
				border: none;
				padding-right: 3px;
				padding-left: 3px;
				font-size: 10px;
				line-height: 1;
				height: auto;
				min-height: 20px;
				.dashicons {
					font-size: 14px;
					width: 14px;
					height: 14px;
					line-height: 1;
				}
			}
			
		}
	}
	
}

.mkl-pc-global-configurator--banner {
	display: none;
	align-items: center;
	gap: 6px;
	margin-top: 0;
	padding: 0;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.78);
}
.global-configurator-icon {
	width: 28px;
	height: 28px;
	font-size: 28px;
	line-height: 1;
	display: none;
}

.mkl-pc-global-configurator--banner-link,
.mkl-pc-global-configurator--banner-plain {
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
}

.mkl-pc-global-configurator--banner-link {
	text-decoration: none;

	&:hover,
	&:focus {
		color: #fff;
		text-decoration: underline;
	}
}

.mkl-pc-global-configurator--banner-plain {
	cursor: default;
}

/* Global mode: compact banner under sidebar title */
.pc-modal-container.mkl-pc-configurator-is-global .mkl-pc-global-configurator--banner {
	display: flex;
}

.pc-modal-container.mkl-pc-configurator-is-global .global-configurator-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

.pc-modal-container.mkl-pc-configurator-is-global .edit-site-site-icon__icon {
	display: none;
}

.pc-modal-container.mkl-pc-configurator-is-global .mkl-pc-admin-ui__body {
	min-height: 0;
}

@keyframes mkl-pc-sidebar-layers-in {
	0% {
		opacity: 0;
		transform: translateX(20px);
	}
	100% {
		opacity: 1;
		transform: translateX(0);
	}
}
/* global layers */

/*
 * Reusable admin dialog — tmpl-mkl-pc-admin-dialog, PC.views.admin_dialog (views/admin-dialog.js).
 * Separate from the main configurator shell (.mkl-pc-admin-ui.pc-modal).
 */
html .mkl-pc-admin-dialog-mount {
	position: fixed;
	inset: 0;
	z-index: 150000;
	box-sizing: border-box;
}

.mkl-pc-admin-dialog {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
		max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	box-sizing: border-box;
	font-size: 13px;
	line-height: 1.4;
	color: #1d2327;

	&__backdrop {
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		cursor: pointer;
	}

	&__panel {
		position: relative;
		z-index: 1;
		display: flex;
		flex-direction: column;
		width: min(100%, 560px);
		max-height: min(90vh, 720px);
		background: #fff;
		border-radius: 8px;
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
		overflow: hidden;
		box-sizing: border-box;
	}

	&__header {
		flex: 0 0 auto;
		position: relative;
		min-height: 48px;
		padding: 12px 48px 12px 16px;
		border-bottom: 1px solid $light-border-color;
		box-sizing: border-box;
	}

	&__title {
		margin: 0;
		font-size: 1.15em;
		font-weight: 600;
		line-height: 1.35;
		padding-right: 8px;
	}

	&__close {
		position: absolute;
		top: 8px;
		right: 8px;
		width: 40px;
		height: 40px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 4px;
		background: transparent;
		color: #787c82;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 2;
		&:hover,
		&:focus {
			color: #1d2327;
			background: rgba(0, 0, 0, 0.06);
		}
	}

	&__close-icon {
		display: block;
		width: 20px;
		height: 20px;
		&::before {
			font: normal 20px/1 dashicons;
			content: "\f158";
		}
	}

	&__body {
		flex: 1;
		min-height: 0;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
	}

	&__footer-actions {
		flex: 0 0 auto;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
		gap: 8px;
		padding: 12px 16px;
		border-top: 1px solid $light-border-color;
		background: #f6f7f7;
		box-sizing: border-box;
	}
}

/*
 * Zone editor (views/zone-editor.js): a zone drawn on a view's image.
 */
.mkl-pc-admin-dialog--zone-editor {
	--zone-editor-height: min(94vh, 1000px);
	.mkl-pc-admin-dialog__panel {
		width: min(100%, 1400px);
		height: var(--zone-editor-height);
		max-height: var(--zone-editor-height);
	}
	// The picture on the left, taking the room; the settings in a column on the right.
	.mkl-pc-zone-editor {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 280px;
		grid-template-rows: minmax(0, 1fr) auto;
		flex: 1;
		min-height: 0;
		.mkl-pc-admin-dialog__footer-actions {
			grid-column: 1 / -1;
		}
		// Apart from Done and Cancel, on the left.
		.mkl-pc-zone-editor__remove {
			margin-right: auto;
		}
	}
	.mkl-pc-zone-editor__toolbar {
		display: flex;
		flex-direction: column;
		gap: 12px;
		padding: 16px;
		border-left: 1px solid $light-border-color;
		overflow-y: auto;
		.description {
			margin: 0;
		}
	}
	.mkl-pc-zone-editor__view {
		margin: 0;
		font-weight: 600;
		font-size: 14px;
	}
	.mkl-pc-zone-editor__image-picker {
		margin-top: auto;
		padding-top: 12px;
		border-top: 1px solid $light-border-color;
	}
	.mkl-pc-zone-editor__image-name {
		margin: 6px 0 0;
		color: #646970;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.mkl-pc-zone-editor__fields {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}
	.mkl-pc-zone-editor__field {
		display: flex;
		flex-direction: column;
		gap: 2px;
		font-size: 11px;
		color: #646970;
		input {
			width: 100%;
		}
	}
	.mkl-pc-zone-editor__viewport {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 0;
		overflow: auto;
		padding: 16px;
		background: #f0f0f1;
	}
	.mkl-pc-zone-editor__empty {
		margin: 40px auto;
		text-align: center;
		color: #646970;
	}
	// One checkerboard, behind the image only: layer images are transparent.
	.mkl-pc-zone-editor__stage {
		display: none;
		position: relative;
		width: fit-content;
		max-width: 100%;
		margin: auto;
		user-select: none;
		touch-action: none;
		background-color: #fff;
		background-image:
			linear-gradient(45deg, #eaeaea 25%, transparent 25%, transparent 75%, #eaeaea 75%),
			linear-gradient(45deg, #eaeaea 25%, transparent 25%, transparent 75%, #eaeaea 75%);
		background-size: 16px 16px;
		background-position: 0 0, 8px 8px;
	}
	&.has-image {
		.mkl-pc-zone-editor__empty {
			display: none;
		}
		.mkl-pc-zone-editor__stage {
			display: block;
		}
	}
	.mkl-pc-zone-editor__picture {
		display: block;
		max-width: 100%;
		// The dialog's height, less its header, footer and the viewport's padding.
		max-height: calc(var(--zone-editor-height) - 150px);
		height: auto;
	}
	// The view's default configuration (the Image order preview), over the reference
	// image's box; the image stays for the size.
	.mkl-pc-zone-editor__background {
		display: none;
		position: absolute;
		inset: 0;
		pointer-events: none;
		.mkl-pc-preview,
		.mkl-pc-preview__inner,
		.mkl-pc-preview__canvas-wrap {
			width: 100%;
			height: 100%;
			margin: 0;
			padding: 0;
			// The stage's checkerboard shows through.
			background: none;
			border: 0;
			box-shadow: none;
		}
		.mkl-pc-preview__canvas {
			display: block;
			width: 100% !important;
			height: 100% !important;
			max-width: none;
			max-height: none !important;
			// The stage has the checkerboard.
			background: none;
			border-radius: 0;
		}
		.mkl-pc-preview__side {
			display: none;
		}
	}
	&.has-background {
		.mkl-pc-zone-editor__picture {
			visibility: hidden;
		}
		.mkl-pc-zone-editor__background {
			display: block;
		}
	}
	// The mask, shown faintly: where the zone's content can show.
	.mkl-pc-zone-editor__mask {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: contain;
		opacity: 0.35;
		pointer-events: none;
	}
	.mkl-pc-zone-editor__zone {
		position: absolute;
		box-sizing: border-box;
		transform-origin: 50% 0;
		border: 2px solid var(--global-layer-primary, #642077);
		background: rgba(100, 32, 119, 0.12);
		cursor: move;
		&:focus-visible {
			outline: 2px solid #2271b1;
			outline-offset: 2px;
		}
	}
	// The zone's whole box, border included: an absolute child starts inside the border, and a
	// preview drawn there (text overlay's text) was off by the border's width.
	.mkl-pc-zone-editor__inner {
		position: absolute;
		inset: -2px;
		overflow: hidden;
		pointer-events: none;
	}
	.mkl-pc-zone-editor__handle {
		position: absolute;
		width: 12px;
		height: 12px;
		margin: -6px 0 0 -6px;
		box-sizing: border-box;
		border: 2px solid var(--global-layer-primary, #642077);
		background: #fff;
		border-radius: 2px;
		&--nw { left: 0; top: 0; cursor: nwse-resize; }
		&--n { left: 50%; top: 0; cursor: ns-resize; }
		&--ne { left: 100%; top: 0; cursor: nesw-resize; }
		&--e { left: 100%; top: 50%; cursor: ew-resize; }
		&--se { left: 100%; top: 100%; cursor: nwse-resize; }
		&--s { left: 50%; top: 100%; cursor: ns-resize; }
		&--sw { left: 0; top: 100%; cursor: nesw-resize; }
		&--w { left: 0; top: 50%; cursor: ew-resize; }
	}
	&.is-dragging {
		cursor: grabbing;
	}
	@media (max-width: 782px) {
		--zone-editor-height: 94vh;
		.mkl-pc-zone-editor {
			grid-template-columns: minmax(0, 1fr);
			grid-template-rows: minmax(0, 1fr) auto auto;
		}
		.mkl-pc-zone-editor__toolbar {
			border-left: 0;
			border-top: 1px solid $light-border-color;
			max-height: 40vh;
		}
		.mkl-pc-zone-editor__picture {
			max-height: calc(var(--zone-editor-height) * 0.5);
		}
	}
}

.mkl-pc-admin-dialog--import-global-layer {
	.mkl-pc-import-global-layer {
		display: flex;
		flex-direction: column;
		flex: 1;
		min-height: 0;
		max-height: min(55vh, 480px);
	}

	.mkl-pc-import-global-layer__toolbar {
		flex: 0 0 auto;
		padding: 12px 16px 10px;
		border-bottom: 1px solid $light-border-color;
		box-sizing: border-box;

		.global-layers-filter {
			width: 100%;
			max-width: 100%;
			box-sizing: border-box;
		}
	}

	.global-layers-list {
		flex: 1;
		min-height: 120px;
		overflow: auto;
		padding: 12px 16px;
		box-sizing: border-box;

		> p {
			margin: 1em 0;
			color: #646970;

			&.error {
				color: #b32d2e;
			}
		}

		.mkl-pc-spinner {
			display: block;
			margin: 24px auto;
		}
	}

	.global-layer-item {
		label {
			display: flex;
			align-items: flex-start;
			gap: 12px;
			padding: 12px 14px;
			margin: 0 0 10px;
			border: 1px solid $light-border-color;
			border-radius: 6px;
			cursor: pointer;
			box-sizing: border-box;
			transition: border-color 0.12s ease, background 0.12s ease;

			&:hover {
				border-color: var(--wp-admin-theme-color, #2271b1);
				background: #f6f7f7;
			}
		}

		input[type="radio"] {
			margin-top: 4px;
		}

		.layer-info {
			flex: 1;
			min-width: 0;
		}

		h4 {
			margin: 0 0 6px;
			font-size: 13px;
			font-weight: 600;
			line-height: 1.35;
		}

		.admin-label {
			font-weight: 400;
			opacity: 0.85;
		}

		.layer-thumbnail {
			display: block;
			max-width: 56px;
			height: auto;
			margin-top: 4px;
			border-radius: 4px;
			border: 1px solid #dcdcde;
		}

		.layer-type {
			display: block;
			margin-top: 4px;
			font-size: 12px;
			color: #646970;
		}

		.layer-capabilities {
			display: flex;
			flex-wrap: wrap;
			gap: 4px;
			margin-top: 6px;
		}

		// Dimmed, not hidden: a layer that paints nothing here can still carry prices, SKUs and
		// form data, so it stays selectable - it just should not be the obvious pick.
		&.is-incompatible label {
			opacity: 0.75;
		}
	}

	.mkl-pc-import-global-layer__warning {
		flex: 0 0 auto;
		margin: 0 16px 12px;

		p {
			margin: 8px 0;
		}
	}
}

// Capability tags: what a global layer can actually render. Shared by the import dialog and the
// Global Layers list table, so they live outside the dialog's scope.
.mkl-pc-capability-tag {
	display: inline-block;
	padding: 1px 7px;
	border: 1px solid transparent;
	border-radius: 9px;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.6;
	white-space: nowrap;

	&--2d {
		border-color: #c3d9ed;
		background: #eef5fb;
		color: #1d4b75;
	}

	&--3d {
		border-color: #cfc7e8;
		background: #f2eefb;
		color: #4b3b7a;
	}

	&--none {
		border-color: #dcdcde;
		background: #f6f7f7;
		color: #646970;
	}

	&--mismatch {
		border-color: #f0c48a;
		background: #fcf3e7;
		color: #8a5700;
	}
}

.mkl-pc-badge--global {
	--mkl_pc-badge-background: var(--global-layer-primary);
	display: inline-flex;
	align-items: center;
	gap: 4px;

	.dashicons {
		width: 12px;
		height: 12px;
		font-size: 12px;
		line-height: 1;
	}
}

.mkl-pc-global-layer-heading {
    margin: 6px;
    padding: 6px;
    display: flex;
    align-items: center;
    background: var(--global-layer-bg);
    border-radius: 6px;
	justify-content: space-between;
	h4 {
		color: var(--global-layer-primary);
		margin: 0;
		padding: 10px;
	}
}

// The layer form of a linked layer locks field by field instead (`.is-locked`, below).
html .pc-modal .pc-sidebar .is-global-locked:not(.layer-form) .setting-section.is-opened {
    position: relative;
}
html .pc-modal .pc-sidebar .is-global-locked:not(.layer-form) .setting-section.is-opened::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: #ffffff6e;
}

.is-global-locked.is-global-layer .mkl-pc-image-settings {
    pointer-events: none;
    cursor: no-drop;
}

/*
 * Linked global layers lock field by field (docs/global-layer-overrides-spec.md): the form marks
 * each locked field `.is-locked` (layer_form.update_global_lock_state(), layer_overrides), so an
 * overridden field and every override switch stay usable.
 */
.layer-form.is-global .is-locked {
	cursor: no-drop;
	> :not(.mkl-pc-override-switch):not(h2) {
		pointer-events: none;
		opacity: 0.6;
	}
}
.layer-form.is-global {
	// A bar in the margin, outside the field's box: overriding a field moves nothing.
	.setting.is-overridden,
	.mkl-pc-image-settings.is-overridden {
		position: relative;
		&::before {
			content: '';
			position: absolute;
			top: 0;
			bottom: 0;
			left: -8px;
			width: 3px;
			border-radius: 2px;
			background: var(--global-layer-primary, #642077);
		}
	}
}
// The switch sits in the field's top-right corner, on the label line.
.layer-form .has-override-switch {
	position: relative;
	> label.name,
	> h2 {
		padding-right: 30px;
	}
	&.is-overridden > label.name,
	&.is-overridden > h2 {
		padding-right: 120px;
	}
}
.mkl-pc-override-switch {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 6px;
}
.mkl-pc-override-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: none;
	color: #757575;
	cursor: pointer;
	.dashicons {
		width: 16px;
		height: 16px;
		font-size: 16px;
	}
	&:hover,
	&:focus-visible {
		color: var(--global-layer-primary, #642077);
		background: var(--global-layer-bg, #f3ecff);
	}
	&:focus-visible {
		outline: 2px solid var(--global-layer-primary, #642077);
		outline-offset: 1px;
	}
	.is-overridden > .mkl-pc-override-switch & {
		color: var(--global-layer-primary, #642077);
	}
}
.mkl-pc-override-badge {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	background: var(--global-layer-bg, #f3ecff);
	color: var(--global-layer-primary, #642077);
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}
// Half-width fields: the coloured border says it, the badge would cover the label.
.layer-form .col-half.is-overridden {
	.mkl-pc-override-badge {
		display: none;
	}
	> label.name {
		padding-right: 30px;
	}
}
.mkl-pc-override-hint {
	margin: 6px 0 0;
	font-size: 12px;
	color: #996800;
}
.mkl-pc-global-layer-links {
	display: inline-block;
	font-size: 12px;
	color: var(--global-layer-primary, #7b2ff7);
}

.layer-form.is-saving {
	position: relative;
	pointer-events: none;
	opacity: 0.65;
}

.mkl-choice-list-inner.is-saving-global-choices {
	position: relative;
	pointer-events: none;
	opacity: 0.65;
}

.is-global-locked.is-global-layer .actions-container button.delete-item, 
.is-global-locked.is-global-layer .actions-container button.duplicate-item {
    display: none;
}

.is-global-layer .content-col {
    top: 45px;
}

.is-global-layer .global-actions-container + .structure-toolbar__primary {
    margin-top: 10px;
}

.global-actions-container {
    height: 45px;
    background: var(--global-layer-bg);
	color: var(--global-layer-primary);
    align-items: center;
    padding-left: 10px;
    padding-right: 10px;
    gap: 5px;
	justify-content: center;
	border-radius: 6px;

	display: none;
	h3 {
		color: var(--global-layer-primary);
		font-size: 14px;
	}
}
.is-global-layer .global-actions-container {
	display: flex;
}
.is-global-locked .global-actions-container {
	.cancel-edit-choices, span.dashicons-unlock {
		display: none;
	}
}
.is-global-layer:not(.is-global-locked) .global-actions-container {
	.edit-choices, span.dashicons-lock {
		display: none;
	}
}

@keyframes mkl-slide-down {
    0% {
        transform: translateY(-25px) scaleY( 0 );
        opacity: 0;
    }
    100% {
        transform: translateY(0) scaleY( 1 );
        opacity: 1;
    }
}

.layer.mkl-list-item.active.just-added {
    animation: mkl-slide-down .2s;
}

.pc-3d-settings {
	.pc-3d-settings-column-settings {
		display: flex;
		flex-direction: column;
		min-width: 0;
		min-height: 0;
		overflow: hidden;
		padding: 0;
	}
	.pc-3d-sections-layout {
		display: flex;
		flex-direction: column;
		flex: 1;
		min-height: 100%;
		min-height: 0;
	}
	.pc-3d-settings-column-preview {
		min-width: 0;
		display: flex;
		flex-direction: column;
	}
	.pc-3d-section-panel {
		display: none;
		&.active {
			display: block;
		}
		&[hidden] {
			display: none !important;
		}
	}
	.pc-3d-settings-sections {
		margin-top: 0;
		padding: 0;
		flex: 1;
		min-width: 0;
		min-height: 0;
		overflow-y: auto;
	}
	.pc-3d-settings-section {
		margin-bottom: 1.5em;
		border-bottom: 1px solid #ddd;
		padding-bottom: 1em;
		.components-panel__body-toggle {
			display: inline-flex;
			align-items: center;
			gap: 8px;
		}
		.pc-3d-settings-section-icon {
			width: 16px;
			height: 16px;
			flex: 0 0 16px;
			opacity: 0.9;
		}
		&:last-child {
			border-bottom: 0;
		}
		h4 {
			margin: 0 0 0.75em;
			font-size: 1em;
		}
		.pc-3d-setting-group {
			margin-bottom: 2em;
			padding-top: 2em;
			border-top: 1px solid #CCC;
			h5 {
				margin: 0.5em 0 0.25em;
				font-size: 0.95em;
			}
		}
		// Environment > Lights: filled by _render_lights_panel in 3d-preview-view.js.
		.pc-3d-lights-list {
			margin: 0 0 1em;
			padding: 0;
			list-style: none;
			border: 1px solid #dcdcde;
			border-radius: 4px;
			li {
				margin: 0;
				& + li {
					border-top: 1px solid #f0f0f1;
				}
			}
		}
		.pc-3d-lights-list__item {
			display: flex;
			align-items: center;
			gap: 8px;
			width: 100%;
			padding: 6px 10px;
			border: 0;
			background: transparent;
			color: #1d2327;
			font: inherit;
			text-align: left;
			cursor: pointer;
			// .is-hovered also comes from hovering the light in the preview.
			&:hover,
			&.is-hovered {
				background: #f6f7f7;
			}
			&:focus-visible {
				outline: 2px solid var(--wp-admin-theme-color, #2271b1);
				outline-offset: -2px;
			}
			&.is-selected {
				background: #f0f6fc;
				box-shadow: inset 3px 0 0 var(--wp-admin-theme-color, #2271b1);
				font-weight: 600;
			}
		}
		.pc-3d-lights-list__swatch {
			flex: none;
			width: 12px;
			height: 12px;
			border-radius: 50%;
			box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
		}
		.pc-3d-lights-list__name {
			flex: 1;
			min-width: 0;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
		.pc-3d-lights-list__type {
			flex: none;
			color: #646970;
			font-size: 0.9em;
			font-weight: 400;
		}
		.pc-3d-light-settings {
			padding-left: 12px;
			border-left: 2px solid #dcdcde;
			input[type="range"] {
				vertical-align: middle;
			}
		}
		.pc-3d-light-position {
			display: inline-flex;
			gap: 4px;
			input {
				width: 5.5em;
			}
		}
		.pc-3d-light-settings__more {
			margin-top: 0.5em;
		}
		// Disclosure groups: a feature toggle plus the settings it owns.
		// Behaviour lives in assets/admin/js/views/3d/3d-field-groups.js.
		.pc-3d-field-group {
			margin: 0 0 1.25em;

			> .field-row {
				margin-bottom: 0.25em;

				> label {
					font-weight: 600;
				}
			}
		}
		.pc-3d-field-group__hint,
		.pc-3d-option-help {
			display: block;
			margin: 0 0 0.5em 1.5em;
			font-size: .9em;
			opacity: .7;
		}
		.pc-3d-option-help {
			margin-left: 0;
			font-style: italic;

			&:empty {
				display: none;
			}
		}
		.pc-3d-field-group__body {
			display: none;
			margin-left: 0.5em;
			padding-left: 1em;
			border-left: 2px solid #DCDCDE;

			> .field-row:last-child {
				margin-bottom: 0.5em;
			}
		}
		.pc-3d-field-group.is-open > .pc-3d-field-group__body {
			display: block;
		}
		.field-row {
			margin: 0.5em 0 1em;
			label {
				display: block;
				margin-bottom: 0.25em;
			}
			select, input[type="number"], input[type="color"] {
				margin-right: 0.5em;
			}
			input[type="range"] {
				vertical-align: middle;
				max-width: 200px;
			}
			.description {
				display: block;
				font-size: .9em;
				opacity: .7;
			}
		}
		.pc-3d-value-display {
			display: inline-block;
			min-width: 2.5em;
			margin-left: 0.25em;
		}
		.pc-3d-angle-actions {
			display: flex;
			flex-wrap: wrap;
			gap: 8px;
			margin: 0 0 0.5em;
			.button {
				flex: 1 1 0;
				justify-content: center;
				text-align: center;
				white-space: nowrap;
			}
		}
		.pc-3d-angle-save-note {
			margin: 0 0 1em;
			font-size: .9em;
			opacity: .7;
		}
		.pc-3d-import-cameras-status {
			margin: -0.25em 0 1em;
			padding: 0.5em 0.75em;
			background: #edfaef;
			border-left: 4px solid #00a32a;
			.dashicons {
				color: #00a32a;
				vertical-align: text-bottom;
			}
		}
		.pc-3d-lights-list {
			margin-top: 0.5em;
		}
		.pc-3d-light-item {
			margin: 0.5em 0;
			padding: 0.5em;
			background: #f5f5f5;
			border-radius: 3px;
			label, select, input {
				margin-right: 0.5em;
			}
			input[type="color"] {
				width: 2em;
				height: 1.5em;
				padding: 0;
				vertical-align: middle;
			}
		}
	}
}

.pc-3d-settings .pc-3d-preview {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 350px;
	.pc-3d-preview--canvas-container {
		flex: 1;
		min-height: 350px;
		position: relative;
	}
	.pc-3d-preview--canvas-container canvas {
		width: 100%;
		height: 100%;
		display: block;
		position: absolute;
		top: 0;
		left: 0;
	}
	.pc-3d-preview-loading {
		position: absolute;
		inset: 0;
		z-index: 10;
		display: flex;
		align-items: center;
		justify-content: center;
		background: rgba(255, 255, 255, 0.88);
		transition: opacity 0.2s ease;
		&.is-hidden {
			pointer-events: none;
			opacity: 0;
		}
		.pc-3d-preview-loading-steps {
			margin: 0;
			padding: 0;
			list-style: none;
			text-align: left;
			font-size: 13px;
			color: #1d2327;
		}
		.pc-3d-preview-loading-step {
			display: flex;
			align-items: center;
			gap: 8px;
			padding: 4px 0;
			.spinner {
				float: none;
				margin: 0;
				display: inline-block;
			}
		}
	}
	.pc-3d-preview-error {
		position: absolute;
		left: 12px;
		right: 12px;
		top: 12px;
		z-index: 11;
		padding: 10px 12px;
		background: #fcf9e8;
		border: 1px solid #dba617;
		border-radius: 4px;
		color: #1d2327;
		font-size: 13px;
		line-height: 1.4;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
		pointer-events: none;
		.pc-3d-preview-error__heading {
			margin: 0 0 6px;
			font-weight: 600;
		}
		.pc-3d-preview-error__list {
			margin: 0;
			padding-left: 1.2em;
		}
	}
	// The angle on show: how it frames, what it turns around, and whether the
	// camera has moved since. Top left, clear of the light gizmo bottom left.
	.pc-3d-view-overlay {
		position: absolute;
		left: 12px;
		top: 12px;
		z-index: 5;
		max-width: calc(100% - 24px);
		padding: 6px 10px;
		background: rgba(255, 255, 255, 0.85);
		border-radius: 4px;
		color: #50575e;
		font-size: 12px;
		line-height: 1.5;
		pointer-events: none;
		.pc-3d-view-overlay__head {
			display: flex;
			flex-wrap: wrap;
			align-items: baseline;
			gap: 4px 8px;
			strong {
				color: #1d2327;
			}
		}
		.pc-3d-view-overlay__state {
			padding: 0 6px;
			border-radius: 2px;
			background: #edfaef;
			color: #00702a;
		}
		&.is-moved .pc-3d-view-overlay__state {
			background: #fcf9e8;
			color: #8a5b00;
		}
		dl {
			display: grid;
			grid-template-columns: auto 1fr;
			gap: 0 8px;
			margin: 2px 0 0;
		}
		dt {
			color: #646970;
		}
		dd {
			margin: 0;
			color: #1d2327;
		}
	}
	// Light gizmo: a hint while nothing is selected, the selection's controls while something is.
	.pc-3d-light-edit {
		position: absolute;
		left: 12px;
		bottom: 12px;
		z-index: 5;
		max-width: calc(100% - 24px);
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 6px 8px;
		padding: 4px 10px;
		background: rgba(255, 255, 255, 0.85);
		border-radius: 4px;
		color: #50575e;
		font-size: 12px;
		line-height: 1.5;
		pointer-events: none;
		&.is-active {
			padding: 6px 8px 6px 10px;
			background: rgba(255, 255, 255, 0.95);
			box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
			color: #1d2327;
			pointer-events: auto;
		}
		.pc-3d-light-edit__modes {
			display: inline-flex;
			gap: 2px;
		}
		.button.is-pressed {
			background: #1d2327;
			border-color: #1d2327;
			color: #fff;
		}
		.pc-3d-light-edit__note {
			flex-basis: 100%;
			color: #50575e;
		}
	}
}

.pc-3d-settings .pc-3d-tree-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
	font-size: 13px;
	color: #1d2327;
	.spinner {
		float: none;
		margin: 0;
	}
}

.pc-3d-settings .pc-3d-tree-message {
	margin: 0;
	padding: 10px 0;
	font-size: 13px;
	color: #646970;
}
/* 3D object type is shown in the row label (dashicon + text), same pattern as layer types. */

@import 'select2';

// Layer/choice "Position on anchors"
.mkl-pc--anchor-placement {
	// .button and the follow labels set their own display, which beats the attribute.
	[hidden] {
		display: none !important;
	}
	.mkl-pc--anchor-list {
		margin-bottom: 6px;
		overflow-wrap: anywhere;
	}
	.mkl-pc--anchor-follow {
		display: block;
		margin-top: 8px;
	}
}

// The settings' checkboxes copy the block editor's markup (settings/abstract.php), where React only
// adds the tick when checked; ours is always there. WordPress 7.2 colours the tick with `color`, so
// it is drawn in currentColor, and hidden here while unchecked.
.components-checkbox-control__input:not(:checked) ~ svg.components-checkbox-control__checked {
	display: none;
}

// An add-on's own settings in the zone editor's side column (text overlay's text settings).
.mkl-pc-zone-editor__settings {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid #dcdcde;

	&:empty {
		display: none;
	}
}
