/**
 * Best Free PDF Tools - Background Remover (BG Remover) Workspace Styles.
 * Follows BFPT design tokens and Stripe/Linear editorial aesthetic.
 */

.bfpt-tool-workspace-container:has(.bfpt-bgr-wrapper) {
	max-width: 1260px !important;
}

.bfpt-bgr-wrapper {
	width: 100%;
	max-width: 1260px;
	margin: 0 auto;
	font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
	color: var(--c-ink, #171717);
	box-sizing: border-box;
}

/* 1. Model Selector Header */
.bfpt-bgr-models {
	margin-bottom: 24px;
}

.bfpt-bgr-models__title {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--c-ink, #171717);
	margin: 0 0 4px 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.bfpt-bgr-models__hint {
	font-size: 0.8125rem;
	color: var(--c-muted, #5A5A64);
	margin: 0 0 14px 0;
}

.bfpt-bgr-models__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

@media (max-width: 768px) {
	.bfpt-bgr-models__grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
}

.bfpt-bgr-model-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 14px 16px;
	border-radius: 14px;
	background: #FFFFFF;
	border: 1.5px solid var(--c-bdr, #E3E3E8);
	cursor: pointer;
	text-align: left;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	user-select: none;
}

.bfpt-bgr-model-card:hover {
	border-color: rgba(229, 50, 45, 0.5);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px -4px rgba(23, 23, 23, 0.08);
}

.bfpt-bgr-model-card.is-selected {
	border-color: #E5322D;
	background: #FFFBFB;
	box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.15), 0 8px 24px -4px rgba(229, 50, 45, 0.12);
}

.bfpt-bgr-model-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.bfpt-bgr-model-card__name {
	font-size: 1rem;
	font-weight: 600;
	color: var(--c-ink, #171717);
	display: flex;
	align-items: center;
	gap: 6px;
}

.bfpt-bgr-model-card.is-selected .bfpt-bgr-model-card__name {
	color: #E5322D;
}

.bfpt-bgr-model-card__tag {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px 7px;
	border-radius: 9999px;
	background: #EEF2FF;
	color: #2E4BC4;
}

.bfpt-bgr-model-card.is-selected .bfpt-bgr-model-card__tag {
	background: #FFE5E1;
	color: #C92722;
}

.bfpt-bgr-model-card__desc {
	font-size: 0.775rem;
	line-height: 1.4;
	color: var(--c-muted, #5A5A64);
	margin: 0;
	flex-grow: 1;
}

.bfpt-bgr-model-card__check {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #E5322D;
	color: #FFFFFF;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 12px;
}

.bfpt-bgr-model-card.is-selected .bfpt-bgr-model-card__check {
	display: flex;
}

/* 2. Main Stage Dropzone */
.bfpt-bgr-stage {
	background: #FFFFFF;
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 20px;
	padding: 32px 24px;
	box-shadow: 0 12px 32px -4px rgba(23, 23, 23, 0.06);
	transition: all 0.2s ease;
}

.bfpt-bgr-dropzone {
	border: 2px dashed rgba(53, 111, 168, 0.35);
	border-radius: 16px;
	padding: 48px 24px;
	text-align: center;
	background: rgba(235, 244, 252, 0.35);
	cursor: pointer;
	transition: all 0.2s ease;
}

.bfpt-bgr-dropzone:hover,
.bfpt-bgr-dropzone.is-dragover {
	border-color: #E5322D;
	background: rgba(255, 241, 239, 0.6);
	transform: scale(1.005);
}

.bfpt-bgr-dropzone__icon-circle {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #FFFFFF;
	border: 1px solid rgba(53, 111, 168, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px auto;
	box-shadow: 0 8px 16px -2px rgba(23, 23, 23, 0.06);
	color: #E5322D;
}

.bfpt-bgr-dropzone__heading {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--c-ink, #171717);
	margin: 0 0 6px 0;
}

.bfpt-bgr-dropzone__sub {
	font-size: 0.9375rem;
	color: var(--c-muted, #5A5A64);
	margin: 0 0 20px 0;
}

.bfpt-bgr-dropzone__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #E5322D;
	color: #FFFFFF;
	padding: 13px 28px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	border: none;
	box-shadow: 0 4px 14px -2px rgba(229, 50, 45, 0.35);
	transition: all 0.15s ease;
}

.bfpt-bgr-dropzone__btn:hover {
	background: #C92722;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px -2px rgba(229, 50, 45, 0.45);
}

.bfpt-bgr-dropzone__security {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 0.8125rem;
	color: var(--c-muted, #5A5A64);
	margin-top: 24px;
}

/* 3. Processing State */
.bfpt-bgr-processing {
	text-align: center;
	padding: 56px 20px;
}

.bfpt-bgr-spinner {
	width: 52px;
	height: 52px;
	border: 3.5px solid rgba(229, 50, 45, 0.2);
	border-top-color: #E5322D;
	border-radius: 50%;
	margin: 0 auto 20px auto;
	animation: bfpt-bgr-spin 0.85s linear infinite;
}

@keyframes bfpt-bgr-spin {
	to { transform: rotate(360deg); }
}

.bfpt-bgr-processing__title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 8px 0;
	color: var(--c-ink, #171717);
}

.bfpt-bgr-processing__status {
	font-size: 0.875rem;
	color: var(--c-muted, #5A5A64);
	margin: 0 0 20px 0;
}

.bfpt-bgr-progress-bar {
	width: 100%;
	max-width: 420px;
	height: 8px;
	background: var(--c-bdr, #E3E3E8);
	border-radius: 9999px;
	margin: 0 auto;
	overflow: hidden;
}

.bfpt-bgr-progress-fill {
	height: 100%;
	width: 30%;
	background: #E5322D;
	border-radius: 9999px;
	transition: width 0.3s ease;
}

/* 4. Results Workspace & Two-Column Advanced Editor */
.bfpt-bgr-result {
	display: flex;
	flex-direction: column;
	gap: 18px;
	width: 100%;
}

.bfpt-bgr-editor-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 350px;
	gap: 24px;
	align-items: start;
	width: 100%;
}

/* Left Column: Image Workspace (~68%) */
.bfpt-bgr-main-col {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	position: sticky;
	top: 80px;
}

/* Right Column: Controls Panel (~32%, independent scroll, min-width 320px) */
.bfpt-bgr-side-col {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 320px;
	position: sticky;
	top: 80px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 6px;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.bfpt-bgr-side-col::-webkit-scrollbar {
	width: 6px;
}

.bfpt-bgr-side-col::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, 0.18);
	border-radius: 9999px;
}

.bfpt-bgr-side-col::-webkit-scrollbar-track {
	background: transparent;
}

/* Canvas Topbar (Quick View, Mode, Zoom, and Resolution) */
.bfpt-bgr-canvas-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	padding: 8px 14px;
	background: #FFFFFF;
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bfpt-bgr-canvas-tools-group {
	display: flex;
	align-items: center;
	gap: 6px;
}

.bfpt-bgr-dims-badge {
	font-size: 11px;
	font-family: monospace;
	font-weight: 600;
	color: var(--c-muted, #5A5A64);
	background: #F1F5F9;
	padding: 4px 8px;
	border-radius: 6px;
	border: 1px solid var(--c-bdr, #E3E3E8);
}

.bfpt-bgr-canvas-hints {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	font-size: 11px;
	color: var(--c-muted, #5A5A64);
	padding: 2px 4px;
	flex-wrap: wrap;
}

.bfpt-bgr-canvas-hints kbd {
	background: #F1F5F9;
	border: 1px solid #CBD5E1;
	border-radius: 4px;
	padding: 1px 5px;
	font-family: monospace;
	font-size: 10px;
	color: var(--c-ink, #171717);
}

/* Right Panel Cards & Components */
.bfpt-bgr-panel-card {
	background: #FFFFFF;
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 14px;
	padding: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: all 0.2s ease;
}

.bfpt-bgr-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bfpt-bgr-card-title {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--c-ink, #171717);
}

.bfpt-bgr-model-badge {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px 8px;
	border-radius: 9999px;
	background: #FFE5E1;
	color: #C92722;
}

.bfpt-bgr-sub-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--c-muted, #5A5A64);
}

.bfpt-bgr-model-switch-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bfpt-bgr-label-small {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--c-muted, #5A5A64);
}

.bfpt-bgr-select {
	width: 100%;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1.5px solid var(--c-bdr, #E3E3E8);
	background: #F8FAFC;
	color: var(--c-ink, #171717);
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bfpt-bgr-select:focus {
	border-color: #E5322D;
	box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.15);
	background: #FFFFFF;
}

.bfpt-bgr-image-actions-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-top: 4px;
}

.bfpt-bgr-replace-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 7px 12px;
	border-radius: 10px;
	border: 1px solid var(--c-bdr, #E3E3E8);
	background: #FFFFFF;
	color: var(--c-ink, #171717);
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	flex: 1;
}

.bfpt-bgr-replace-btn:hover {
	background: #F8FAFC;
	border-color: #CBD5E1;
}

.bfpt-bgr-btn-ghost-sm {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: transparent;
	border: none;
	color: var(--c-muted, #5A5A64);
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	padding: 7px 10px;
	border-radius: 8px;
	transition: color 0.15s ease;
}

.bfpt-bgr-btn-ghost-sm:hover {
	color: var(--c-ink, #171717);
	text-decoration: underline;
}

.bfpt-bgr-brush-modes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.bfpt-bgr-mode-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 10px;
	border: 1.5px solid var(--c-bdr, #E3E3E8);
	background: #FFFFFF;
	color: var(--c-ink, #171717);
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.bfpt-bgr-mode-btn .material-symbols-rounded {
	font-size: 18px;
}

.bfpt-bgr-mode-btn:hover {
	background: #F8FAFC;
	border-color: #CBD5E1;
}

.bfpt-bgr-mode-btn.is-active {
	background: #E5322D;
	color: #FFFFFF;
	border-color: #E5322D;
	box-shadow: 0 2px 8px rgba(229, 50, 45, 0.25);
}

.bfpt-bgr-brush-sliders {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bfpt-bgr-bg-swatches {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.bfpt-bgr-effect-subcard {
	border: 1.5px solid var(--c-bdr, #E3E3E8);
	border-radius: 12px;
	padding: 12px;
	background: #F8FAFC;
	transition: all 0.15s ease;
}

.bfpt-bgr-effect-subcard.is-enabled {
	border-color: #356FA8;
	background: #F4F8FC;
	box-shadow: 0 2px 8px rgba(53, 111, 168, 0.08);
}

.bfpt-bgr-export-card {
	background: #FFFFFF;
	border-top: 2px solid #E5322D;
}

/* Legacy Editor Toolbar (retained for backward compatibility) */
.bfpt-bgr-editor-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	padding: 8px 12px;
	background: #FFFFFF;
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bfpt-bgr-tool-group {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.bfpt-bgr-tool-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 10px;
	border: 1px solid var(--c-bdr, #E3E3E8);
	background: #FFFFFF;
	color: var(--c-ink, #171717);
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
	user-select: none;
}

.bfpt-bgr-tool-btn .material-symbols-rounded {
	font-size: 18px;
}

.bfpt-bgr-tool-btn:hover {
	background: #F8FAFC;
	border-color: #CBD5E1;
	color: var(--c-ink, #171717);
}

.bfpt-bgr-tool-btn.is-active {
	background: #E5322D;
	color: #FFFFFF;
	border-color: #E5322D;
	box-shadow: 0 2px 8px rgba(229, 50, 45, 0.25);
}

.bfpt-bgr-history-group {
	display: flex;
	align-items: center;
	gap: 4px;
}

.bfpt-bgr-history-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	border: 1px solid var(--c-bdr, #E3E3E8);
	background: #FFFFFF;
	color: var(--c-ink, #171717);
	cursor: pointer;
	transition: all 0.15s ease;
}

.bfpt-bgr-history-btn .material-symbols-rounded {
	font-size: 18px;
}

.bfpt-bgr-history-btn:hover:not(:disabled) {
	background: #F1F5F9;
	border-color: #CBD5E1;
}

.bfpt-bgr-history-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

.bfpt-bgr-zoom-group {
	display: flex;
	align-items: center;
	gap: 2px;
	background: #F8FAFC;
	border: 1px solid var(--c-bdr, #E3E3E8);
	padding: 2px 4px;
	border-radius: 10px;
}

.bfpt-bgr-zoom-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: none;
	background: transparent;
	border-radius: 7px;
	color: var(--c-ink, #171717);
	cursor: pointer;
	transition: background 0.12s ease;
}

.bfpt-bgr-zoom-btn .material-symbols-rounded {
	font-size: 18px;
}

.bfpt-bgr-zoom-btn:hover {
	background: #E2E8F0;
}

.bfpt-bgr-zoom-label {
	min-width: 48px;
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	font-family: monospace;
	color: var(--c-ink, #171717);
	padding: 0 4px;
}

/* Brush Parameters Bar */
.bfpt-bgr-brush-bar {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 10px 16px;
	background: #F8FAFC;
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 12px;
	flex-wrap: wrap;
}

.bfpt-bgr-brush-bar.is-hidden {
	display: none !important;
}

.bfpt-bgr-slider-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 180px;
}

.bfpt-bgr-slider-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--c-ink, #171717);
	white-space: nowrap;
	margin: 0;
}

.bfpt-bgr-slider-row input[type="range"] {
	flex: 1;
	accent-color: #E5322D;
	height: 6px;
	border-radius: 3px;
	cursor: pointer;
}

.bfpt-bgr-slider-val {
	font-size: 12px;
	font-family: monospace;
	font-weight: 600;
	color: var(--c-muted, #5A5A64);
	min-width: 44px;
	text-align: right;
}

.bfpt-bgr-brush-chip {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #FFFFFF;
	border: 1px solid var(--c-bdr, #E3E3E8);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.bfpt-bgr-brush-chip__dot {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #E5322D;
	transition: filter 0.15s ease;
}

/* Interactive Canvas Viewport Stage */
.bfpt-bgr-canvas-container {
	position: relative;
	width: 100%;
	height: 560px;
	min-height: 440px;
	max-height: 720px;
	border-radius: 16px;
	overflow: hidden;
	display: block;
	background-color: #F8FAFC;
	border: 1px solid var(--c-bdr, #E3E3E8);
	user-select: none;
	touch-action: none;
}

/* Transparent checkerboard */
.bfpt-bgr-canvas-container.bg-checkerboard {
	background-color: #FFFFFF;
	background-image: 
		linear-gradient(45deg, #E2E8F0 25%, transparent 25%), 
		linear-gradient(-45deg, #E2E8F0 25%, transparent 25%), 
		linear-gradient(45deg, transparent 75%, #E2E8F0 75%), 
		linear-gradient(-45deg, transparent 75%, #E2E8F0 75%);
	background-size: 18px 18px;
	background-position: 0 0, 0 9px, 9px -9px, -9px 0px;
}

/* Pan & Zoom Transform Surface: Strict top-left origin, absolute coordinates */
.bfpt-bgr-transform-surface {
	position: absolute;
	top: 0;
	left: 0;
	transform-origin: 0 0;
	display: block;
	box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	overflow: visible;
	will-change: transform;
}

.bfpt-bgr-transform-surface canvas {
	display: block;
	max-width: none;
	max-height: none;
}

/* Split Comparison Overlay & Handle */
.bfpt-bgr-split-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 5;
	opacity: 0;
	transition: opacity 0.15s ease;
	overflow: hidden;
}

.bfpt-bgr-split-overlay.is-active {
	opacity: 1;
}

.bfpt-bgr-split-overlay img {
	display: block;
	max-width: none;
	max-height: none;
	pointer-events: none;
}

.bfpt-bgr-split-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #FFFFFF;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
	z-index: 10;
	cursor: ew-resize;
	display: none;
	align-items: center;
	justify-content: center;
	transform: translateX(-50%);
	touch-action: none;
}

/* Expanded touch hitbox for effortless finger dragging on touchscreens */
.bfpt-bgr-split-handle::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: -22px;
	width: 46px;
	pointer-events: auto;
}

.bfpt-bgr-split-handle.is-active {
	display: flex;
}

.bfpt-bgr-split-handle__btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #FFFFFF;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
	border: 2px solid #E5322D;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #E5322D;
	font-size: 14px;
	font-weight: bold;
	cursor: ew-resize;
	user-select: none;
}

/* Brush Cursor Preview */
.bfpt-bgr-cursor {
	position: absolute;
	border-radius: 50%;
	border: 1.5px solid rgba(229, 50, 45, 0.9);
	background: rgba(229, 50, 45, 0.15);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), 0 0 6px rgba(0, 0, 0, 0.2);
	pointer-events: none;
	transform: translate(-50%, -50%);
	z-index: 50;
	display: none;
}

/* Studio Panels & Creative Effects */
.bfpt-bgr-studio-panels {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Background Customization Controls */
.bfpt-bgr-customizer {
	background: rgba(235, 244, 252, 0.45);
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 16px;
	padding: 16px 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.bfpt-bgr-bg-options {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.bfpt-bgr-bg-label {
	font-size: 0.875rem;
	font-weight: 600;
	margin-right: 6px;
	color: var(--c-ink, #171717);
}

.bfpt-bgr-swatch {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid #FFFFFF;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	position: relative;
}

.bfpt-bgr-swatch:hover {
	transform: scale(1.1);
}

.bfpt-bgr-swatch.is-active {
	box-shadow: 0 0 0 2.5px #E5322D, 0 3px 8px rgba(229, 50, 45, 0.3);
}

.bfpt-bgr-swatch--checker {
	background-color: #FFFFFF;
	background-image: 
		linear-gradient(45deg, #CBD5E1 25%, transparent 25%), 
		linear-gradient(-45deg, #CBD5E1 25%, transparent 25%), 
		linear-gradient(45deg, transparent 75%, #CBD5E1 75%), 
		linear-gradient(-45deg, transparent 75%, #CBD5E1 75%);
	background-size: 8px 8px;
	background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.bfpt-bgr-swatch--color-picker {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
}

.bfpt-bgr-swatch--color-picker input[type="color"] {
	position: absolute;
	top: -10px;
	left: -10px;
	width: 60px;
	height: 60px;
	opacity: 0;
	cursor: pointer;
}

.bfpt-bgr-swatch--blur {
	background: #94A3B8;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #FFFFFF;
	font-size: 14px;
}

/* 2. Creative Effects (Background Blur & Shadow) */
.bfpt-bgr-effects-card {
	background: #FFFFFF;
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 16px;
	padding: 18px 20px;
}

.bfpt-bgr-effects-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--c-bdr, #E3E3E8);
}

.bfpt-bgr-effects-header__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--c-ink, #171717);
}

.bfpt-bgr-effects-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.bfpt-bgr-effect-box {
	border: 1.5px solid var(--c-bdr, #E3E3E8);
	border-radius: 14px;
	padding: 14px 16px;
	background: #F8FAFC;
	transition: all 0.2s ease;
}

.bfpt-bgr-effect-box.is-enabled {
	border-color: #356FA8;
	background: #F4F8FC;
	box-shadow: 0 4px 12px rgba(53, 111, 168, 0.08);
}

.bfpt-bgr-effect-toggle-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
}

.bfpt-bgr-effect-name {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--c-ink, #171717);
}

.bfpt-bgr-effect-desc {
	font-size: 0.75rem;
	color: var(--c-muted, #5A5A64);
	margin: 8px 0 0 0;
	line-height: 1.4;
}

/* Switch Toggle */
.bfpt-bgr-toggle {
	position: relative;
	display: inline-block;
	width: 38px;
	height: 22px;
	flex-shrink: 0;
}

.bfpt-bgr-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.bfpt-bgr-toggle__slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #CBD5E1;
	transition: .2s;
	border-radius: 22px;
}

.bfpt-bgr-toggle__slider:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .2s;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bfpt-bgr-toggle input:checked + .bfpt-bgr-toggle__slider {
	background-color: #356FA8;
}

.bfpt-bgr-toggle input:focus-visible + .bfpt-bgr-toggle__slider {
	outline: 2px solid #356FA8;
	outline-offset: 2px;
}

.bfpt-bgr-toggle input:checked + .bfpt-bgr-toggle__slider:before {
	transform: translateX(16px);
}

.bfpt-bgr-shadow-controls {
	display: flex;
	flex-direction: column;
	gap: 8px;
	transition: opacity 0.2s ease;
}

.bfpt-bgr-shadow-controls.is-disabled {
	opacity: 0.45;
	pointer-events: none;
}

/* Result Action Buttons */
.bfpt-bgr-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.bfpt-bgr-btn-primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #E5322D;
	color: #FFFFFF;
	padding: 13px 26px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 14px -2px rgba(229, 50, 45, 0.4);
	transition: all 0.15s ease;
}

.bfpt-bgr-btn-primary:hover {
	background: #C92722;
	color: #FFFFFF;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px -2px rgba(229, 50, 45, 0.45);
}

.bfpt-bgr-btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #FFFFFF;
	color: var(--c-ink, #171717);
	border: 1px solid var(--c-bdr, #E3E3E8);
	padding: 12px 20px;
	border-radius: 12px;
	font-weight: 600;
	font-size: 0.9375rem;
	cursor: pointer;
	transition: all 0.15s ease;
}

.bfpt-bgr-btn-secondary:hover {
	background: #F8FAFC;
	border-color: #CBD5E1;
	transform: translateY(-1px);
}

.bfpt-bgr-btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: var(--c-muted, #5A5A64);
	border: none;
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	margin-left: auto;
	transition: color 0.15s ease;
}

.bfpt-bgr-btn-ghost:hover {
	color: var(--c-ink, #171717);
	text-decoration: underline;
}

/* Dark Mode Overrides */
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-stage,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-model-card {
	background: #1E293B;
	border-color: rgba(255, 255, 255, 0.1);
	color: #F0F6FC;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-dropzone {
	background: rgba(30, 41, 59, 0.6);
	border-color: rgba(255, 255, 255, 0.15);
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-customizer {
	background: rgba(30, 41, 59, 0.8);
	border-color: rgba(255, 255, 255, 0.1);
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-btn-secondary {
	background: #1E293B;
	color: #F0F6FC;
	border-color: rgba(255, 255, 255, 0.15);
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-editor-toolbar,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-effects-card {
	background: #1E293B;
	border-color: rgba(255, 255, 255, 0.1);
	color: #F0F6FC;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-tool-btn,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-history-btn,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-brush-bar,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-zoom-group {
	background: #0F172A;
	border-color: rgba(255, 255, 255, 0.1);
	color: #F0F6FC;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-tool-btn:hover,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-history-btn:hover:not(:disabled) {
	background: #1E293B;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-tool-btn.is-active {
	background: #E5322D;
	color: #FFFFFF;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-effect-box,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-effect-subcard {
	background: #0F172A;
	border-color: rgba(255, 255, 255, 0.1);
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-effect-box.is-enabled,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-effect-subcard.is-enabled {
	border-color: #356FA8;
	background: rgba(53, 111, 168, 0.15);
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-panel-card,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-canvas-topbar {
	background: #1E293B;
	border-color: rgba(255, 255, 255, 0.1);
	color: #F0F6FC;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-card-title,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-label-small {
	color: #F0F6FC;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-select {
	background: #0F172A;
	border-color: rgba(255, 255, 255, 0.15);
	color: #F0F6FC;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-replace-btn,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-mode-btn {
	background: #0F172A;
	border-color: rgba(255, 255, 255, 0.12);
	color: #F0F6FC;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-replace-btn:hover,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-mode-btn:hover {
	background: #1E293B;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-mode-btn.is-active {
	background: #E5322D;
	color: #FFFFFF;
	border-color: #E5322D;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-dims-badge,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-canvas-hints kbd {
	background: #0F172A;
	border-color: rgba(255, 255, 255, 0.12);
	color: #94A3B8;
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-brush-chip {
	background: #0F172A;
	border-color: rgba(255, 255, 255, 0.1);
}

:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-export-card {
	background: #1E293B;
	border-top-color: #E5322D;
}

/* Tablet & Mobile Responsiveness */
@media (max-width: 1024px) {
	.bfpt-bgr-editor-layout {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	.bfpt-bgr-main-col {
		position: static;
	}
	.bfpt-bgr-side-col {
		position: static;
		max-height: none;
		overflow-y: visible;
		min-width: 0;
		padding-right: 0;
	}
	.bfpt-bgr-canvas-container {
		height: 440px;
	}
}

/* Mobile Segmented Navigation Tabs */
.bfpt-bgr-mobile-nav {
	display: none;
}

@media (max-width: 768px) {
	.bfpt-bgr-mobile-nav {
		display: flex;
		gap: 6px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding: 4px 2px 10px 2px;
		margin-bottom: 14px;
		scrollbar-width: none;
		position: sticky;
		top: 0;
		background: var(--c-surf, #FFFFFF);
		z-index: 20;
		border-bottom: 1px solid var(--c-bdr, #E3E3E8);
	}
	.bfpt-bgr-mobile-nav::-webkit-scrollbar {
		display: none;
	}
	.bfpt-bgr-mobile-tab {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 8px 14px;
		border-radius: 9999px;
		background: var(--c-surf-s, #F0F0F2);
		border: 1px solid var(--c-bdr, #E3E3E8);
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--c-muted, #5A5A64);
		cursor: pointer;
		min-height: 40px;
		transition: all 140ms ease;
	}
	.bfpt-bgr-mobile-tab.is-active {
		background: var(--c-pri, #C92722);
		color: #FFFFFF;
		border-color: var(--c-pri, #C92722);
		box-shadow: 0 2px 6px rgba(201, 39, 34, 0.25);
	}
	.bfpt-bgr-mobile-tab .material-symbols-rounded {
		font-size: 17px;
	}
	.bfpt-bgr-split-handle__btn {
		width: 44px;
		height: 44px;
	}
	.bfpt-bgr-editor-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.bfpt-bgr-tool-group {
		justify-content: center;
	}
	.bfpt-bgr-tool-btn {
		padding: 6px 10px;
		font-size: 0.75rem;
		min-height: 44px;
	}
	.bfpt-bgr-mode-btn {
		min-height: 44px;
	}
	.bfpt-bgr-history-group {
		justify-content: center;
	}
	.bfpt-bgr-history-btn {
		min-width: 44px;
		min-height: 44px;
	}
	.bfpt-bgr-zoom-group {
		justify-content: center;
	}
	.bfpt-bgr-zoom-btn {
		min-width: 40px;
		min-height: 40px;
	}
	.bfpt-bgr-effects-grid {
		grid-template-columns: 1fr;
	}
	.bfpt-bgr-canvas-container {
		height: 380px;
		min-height: 280px;
	}
	.bfpt-bgr-panel-card {
		padding: 14px;
	}
	.bfpt-bgr-canvas-topbar {
		padding: 8px 10px;
		gap: 8px;
	}
}

@media (max-width: 480px) {
	.bfpt-bgr-tool-btn__text {
		display: none;
	}
	.bfpt-bgr-tool-btn {
		padding: 6px 8px;
		min-width: 42px;
	}
	.bfpt-bgr-brush-bar {
		gap: 12px;
		padding: 8px 12px;
	}
	.bfpt-bgr-slider-row {
		min-width: 100%;
	}
	.bfpt-bgr-canvas-container {
		height: 320px;
		min-height: 260px;
	}
	.bfpt-bgr-canvas-hints {
		display: none;
	}
	.bfpt-bgr-swatch {
		width: 42px;
		height: 42px;
	}
}

/* 5. Focused Fullscreen Editor Mode */
.bfpt-bgr-wrapper.is-focused-fullscreen,
:fullscreen .bfpt-bgr-wrapper,
:-webkit-full-screen .bfpt-bgr-wrapper {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	height: 100dvh !important;
	max-width: 100vw !important;
	max-height: 100dvh !important;
	z-index: 999999 !important;
	background: #F8FAFC !important;
	padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)) !important;
	box-sizing: border-box !important;
	overflow: hidden !important;
	display: flex !important;
	flex-direction: column !important;
}

body.bfpt-bgr-fullscreen-locked {
	overflow: hidden !important;
}

.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-models,
:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-models,
:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-models {
	display: none !important;
}

.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-stage,
:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-stage,
:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-stage {
	height: 100% !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	display: flex !important;
	flex-direction: column !important;
	flex: 1 !important;
	min-height: 0 !important;
}

.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-result,
:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-result,
:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-result {
	height: 100% !important;
	display: flex !important;
	flex-direction: column !important;
	flex: 1 !important;
	min-height: 0 !important;
	gap: 12px !important;
}

.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-editor-layout,
:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-editor-layout,
:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-editor-layout {
	height: 100% !important;
	flex: 1 !important;
	min-height: 0 !important;
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 350px !important;
	gap: 20px !important;
	align-items: stretch !important;
}

.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-main-col,
:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-main-col,
:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-main-col {
	height: 100% !important;
	display: flex !important;
	flex-direction: column !important;
	flex: 1 !important;
	min-height: 0 !important;
	position: sticky !important;
	top: 0 !important;
	gap: 10px !important;
}

.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-canvas-container,
:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-canvas-container,
:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-canvas-container {
	height: 100% !important;
	flex: 1 !important;
	min-height: 0 !important;
	max-height: none !important;
}

.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-side-col,
:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-side-col,
:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-side-col {
	height: 100% !important;
	max-height: 100% !important;
	overflow-y: auto !important;
	position: sticky !important;
	top: 0 !important;
	padding-right: 6px !important;
}

#bfpt-bgr-fullscreen-btn.is-active {
	background: #E5322D;
	color: #FFFFFF;
	border-color: #E5322D;
	box-shadow: 0 2px 8px rgba(229, 50, 45, 0.25);
}

/* Dark mode in focused fullscreen */
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode) .bfpt-bgr-wrapper.is-focused-fullscreen,
:is([data-theme="dark"], [data-color-mode="dark"], body.dark-mode):fullscreen .bfpt-bgr-wrapper {
	background: #0F172A !important;
}

@media (max-width: 1024px) {
	.bfpt-bgr-wrapper.is-focused-fullscreen,
	:fullscreen .bfpt-bgr-wrapper,
	:-webkit-full-screen .bfpt-bgr-wrapper {
		padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)) !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch !important;
		display: block !important;
	}
	.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-editor-layout,
	:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-editor-layout,
	:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-editor-layout {
		grid-template-columns: 1fr !important;
		height: auto !important;
		min-height: auto !important;
		gap: 16px !important;
		display: flex !important;
		flex-direction: column !important;
	}
	.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-main-col,
	:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-main-col,
	:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-main-col {
		position: relative !important;
		top: auto !important;
		height: auto !important;
		min-height: auto !important;
		flex: none !important;
		width: 100% !important;
		z-index: 1 !important;
	}
	.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-canvas-container,
	:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-canvas-container,
	:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-canvas-container {
		height: clamp(280px, 46vh, 460px) !important;
		min-height: 260px !important;
		max-height: 52vh !important;
		flex: none !important;
		width: 100% !important;
		position: relative !important;
		z-index: 1 !important;
	}
	.bfpt-bgr-wrapper.is-focused-fullscreen .bfpt-bgr-side-col,
	:fullscreen .bfpt-bgr-wrapper .bfpt-bgr-side-col,
	:-webkit-full-screen .bfpt-bgr-wrapper .bfpt-bgr-side-col {
		position: relative !important;
		top: auto !important;
		height: auto !important;
		max-height: none !important;
		flex: none !important;
		width: 100% !important;
		overflow-y: visible !important;
		padding-right: 0 !important;
		z-index: 1 !important;
	}
}

/* ==========================================================================
   Photoshop-Style Interactive Shadow Editor & Direct Manipulation Gizmo
   ========================================================================== */

/* 1. On-Canvas Shadow Gizmo Overlay */
.bfpt-bgr-shadow-gizmo {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 15;
}

.bfpt-bgr-shadow-gizmo.is-hidden {
	display: none !important;
}

.bfpt-bgr-gizmo-svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: visible;
}

.bfpt-bgr-gizmo-poly {
	fill: rgba(91, 124, 250, 0.08);
	stroke: #5B7CFA;
	stroke-width: calc(1.5px / var(--bgr-zoom, 1));
	stroke-dasharray: calc(4px / var(--bgr-zoom, 1)) calc(3px / var(--bgr-zoom, 1));
	pointer-events: auto;
	cursor: move;
}

.bfpt-bgr-gizmo-rot-stem {
	stroke: #5B7CFA;
	stroke-width: calc(1.5px / var(--bgr-zoom, 1));
}

/* Selection Handles (scale inversely with zoom so they remain 12px on screen) */
.bfpt-bgr-gizmo-handle {
	position: absolute;
	width: 12px;
	height: 12px;
	background: #FFFFFF;
	border: 2px solid #5B7CFA;
	border-radius: 2px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	transform: translate(-50%, -50%) scale(calc(1 / var(--bgr-zoom, 1)));
	transform-origin: center center;
	pointer-events: auto;
	z-index: 20;
	cursor: pointer;
	touch-action: none;
}

.bfpt-bgr-gizmo-handle::after {
	content: '';
	position: absolute;
	inset: -8px;
	pointer-events: auto;
}

@media (max-width: 768px), (pointer: coarse) {
	.bfpt-bgr-gizmo-handle::after {
		inset: -14px; /* Generous 40-44px touch hitbox on mobile */
	}
}

.bfpt-bgr-gizmo-handle:hover,
.bfpt-bgr-gizmo-handle.is-active {
	background: #5B7CFA;
	border-color: #FFFFFF;
	transform: translate(-50%, -50%) scale(calc(1.35 / var(--bgr-zoom, 1)));
}

/* Corner Handles: Diagonal Resizing */
.bfpt-bgr-gizmo-handle--tl,
.bfpt-bgr-gizmo-handle--br {
	cursor: nwse-resize;
}

.bfpt-bgr-gizmo-handle--tr,
.bfpt-bgr-gizmo-handle--bl {
	cursor: nesw-resize;
}

/* Edge Handles: Directional Stretch */
.bfpt-bgr-gizmo-handle--t,
.bfpt-bgr-gizmo-handle--b {
	cursor: ns-resize;
}

.bfpt-bgr-gizmo-handle--r,
.bfpt-bgr-gizmo-handle--l {
	cursor: ew-resize;
}

/* Rotation Handle: Circular, distinct styling */
.bfpt-bgr-gizmo-handle--rot {
	border-radius: 50%;
	background: #5B7CFA;
	border-color: #FFFFFF;
	cursor: grab;
	box-shadow: 0 2px 6px rgba(91, 124, 250, 0.4);
}

.bfpt-bgr-gizmo-handle--rot:active {
	cursor: grabbing;
	background: #2E4BC4;
}

/* Center Pivot Indicator */
.bfpt-bgr-gizmo-pivot {
	position: absolute;
	width: 8px;
	height: 8px;
	background: #5B7CFA;
	border: 1.5px solid #FFFFFF;
	border-radius: 50%;
	box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
	transform: translate(-50%, -50%) scale(calc(1 / var(--bgr-zoom, 1)));
	transform-origin: center center;
	pointer-events: none;
	z-index: 18;
}

/* 2. Side Panel Shadow Controls & Subgroups */
.bfpt-bgr-shadow-quick-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

.bfpt-bgr-chip-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 7px;
	border: 1px solid var(--c-bdr, #E3E3E8);
	background: #FFFFFF;
	color: var(--c-muted, #5A5A64);
	cursor: pointer;
	transition: all 0.15s ease;
}

.bfpt-bgr-chip-btn .material-symbols-rounded {
	font-size: 16px;
}

.bfpt-bgr-chip-btn:hover {
	background: #F1F5F9;
	color: var(--c-ink, #171717);
	border-color: #CBD5E1;
}

.bfpt-bgr-chip-btn.is-active {
	background: #EEF2FF;
	color: #2E4BC4;
	border-color: #AEC4FF;
}

.bfpt-bgr-shadow-mode-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 8px 12px;
	margin-top: 8px;
	background: #FFFFFF;
	border: 1.5px solid #5B7CFA;
	color: #2E4BC4;
	border-radius: 9px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.bfpt-bgr-shadow-mode-cta .material-symbols-rounded {
	font-size: 18px;
}

.bfpt-bgr-shadow-mode-cta:hover {
	background: #EEF2FF;
	border-color: #2E4BC4;
}

.bfpt-bgr-shadow-mode-cta.is-active {
	background: #5B7CFA;
	color: #FFFFFF;
	border-color: #5B7CFA;
	box-shadow: 0 2px 8px rgba(91, 124, 250, 0.3);
}

.bfpt-bgr-control-subgroup {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid var(--c-bdr, #E3E3E8);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bfpt-bgr-subgroup-title {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--c-muted, #5A5A64);
	margin-bottom: 2px;
}

.bfpt-bgr-color-picker-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bfpt-bgr-color-picker-wrap input[type="color"] {
	width: 32px;
	height: 28px;
	padding: 0;
	border: 1px solid var(--c-bdr, #E3E3E8);
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
}

.bfpt-bgr-color-hex {
	font-size: 12px;
	font-family: monospace;
	font-weight: 600;
	color: var(--c-ink, #171717);
}

.bfpt-bgr-shadow-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px dashed var(--c-bdr, #E3E3E8);
}
