.bbt-overlay-front {
	--bbt-front-ink: #161a1c;
	--bbt-front-muted: #5b656b;
	--bbt-front-line: #e4e6e7;
	--bbt-front-soft: #f6f7f7;
	--bbt-front-panel: #ffffff;
	--bbt-front-accent: #f64c1f;
	--bbt-front-accent-soft: rgba(246, 76, 31, 0.1);
	display: block;
	width: 100%;
	margin-top: 0.5rem;
}

.bbt-overlay-front__error {
	color: #c0392b;
	font-size: 0.9em;
	margin: 0.75rem 0 0;
	padding: 0.75rem 0.9rem;
	border-radius: 10px;
	background: #fff5f5;
	border: 1px solid #f0c7c7;
}

.bbt-overlay-front__error[hidden],
.bbt-overlay-front__download[hidden],
.bbt-overlay-modal[hidden],
.bbt-overlay-modal__step[hidden],
.bbt-overlay-modal__actions[hidden],
.bbt-overlay-modal__actions .btn[hidden],
.bbt-overlay-crop__region[hidden] {
	display: none !important;
}

.bbt-overlay-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background:
		radial-gradient(circle at top, rgba(246, 76, 31, 0.18), transparent 42%),
		rgba(22, 26, 28, 0.62);
	backdrop-filter: blur(2px);
}

.bbt-overlay-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	background: var(--bbt-front-panel);
	border-radius: 18px;
	padding: 0;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.08),
		0 24px 64px rgba(22, 26, 28, 0.28);
	color: var(--bbt-front-ink);
}

.bbt-overlay-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.35rem 1.5rem 1.15rem;
	border-bottom: 1px solid var(--bbt-front-line);
	background:
		linear-gradient(135deg, rgba(246, 76, 31, 0.08), transparent 48%),
		#fff;
}

.bbt-overlay-modal__heading {
	min-width: 0;
	flex: 1 1 auto;
}

.bbt-overlay-modal__eyebrow {
	margin: 0 0 0.35rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--bbt-front-accent);
}

.bbt-overlay-modal__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin: 0;
	padding: 0;
	border: 1px solid var(--bbt-front-line);
	border-radius: 999px;
	background: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--bbt-front-ink);
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bbt-overlay-modal__close:hover {
	background: var(--bbt-front-soft);
	border-color: #cfd2d4;
}

.bbt-overlay-modal__main-title {
	margin: 0;
	font-size: 1.55rem;
	line-height: 1.25;
	font-weight: 700;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	word-break: break-word;
}

.bbt-overlay-modal__lede {
	margin: 0.45rem 0 0;
	color: var(--bbt-front-muted);
	font-size: 0.95rem;
	line-height: 1.45;
}

.bbt-overlay-modal__body {
	padding: 1.25rem 1.5rem 0.25rem;
}

.bbt-overlay-modal__section {
	margin: 0 0 1.15rem;
}

.bbt-overlay-modal__section-head {
	margin: 0 0 0.9rem;
}

.bbt-overlay-modal__step-badge {
	display: inline-flex;
	align-items: center;
	margin: 0 0 0.45rem;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: var(--bbt-front-accent-soft);
	color: var(--bbt-front-accent);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.bbt-overlay-modal__title {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

.bbt-overlay-modal__text,
.bbt-overlay-modal__hint {
	margin: 0;
	color: var(--bbt-front-muted);
	font-size: 0.92rem;
	line-height: 1.45;
}

.bbt-overlay-modal__contact {
	margin: 0 0 1.15rem;
	padding: 1rem;
	border-radius: 14px;
	border: 1px solid var(--bbt-front-line);
	background:
		linear-gradient(160deg, rgba(246, 76, 31, 0.05), transparent 50%),
		var(--bbt-front-soft);
}

.bbt-overlay-modal__contact .bbt-overlay-modal__section-head {
	margin-bottom: 0.85rem;
}

.bbt-overlay-modal__contact-field {
	display: block;
	margin: 0;
}

.bbt-overlay-contact-input {
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--bbt-front-line);
	border-radius: 12px;
	background: #fff;
	color: var(--bbt-front-ink, #161a1c);
	font-size: 0.95rem;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bbt-overlay-contact-input:focus {
	outline: none;
	border-color: #F64C1F;
	box-shadow: 0 0 0 3px rgba(246, 76, 31, 0.18);
}

.bbt-overlay-modal__brand-colors {
	margin: 0 0 1.15rem;
	padding: 1rem;
	border-radius: 14px;
	border: 1px solid var(--bbt-front-line);
	background:
		linear-gradient(160deg, rgba(246, 76, 31, 0.05), transparent 50%),
		var(--bbt-front-soft);
}

.bbt-overlay-modal__brand-colors .bbt-overlay-modal__section-head {
	margin-bottom: 0.85rem;
}

.bbt-overlay-modal__brand-swatches {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}

.bbt-overlay-modal__brand-color {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
	padding: 0.75rem;
	border-radius: 12px;
	background: #fff;
	border: 1px solid var(--bbt-front-line);
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.bbt-overlay-modal__brand-color:hover {
	border-color: #cfd2d4;
	box-shadow: 0 4px 14px rgba(22, 26, 28, 0.06);
	transform: translateY(-1px);
}

.bbt-overlay-modal__brand-chip {
	position: relative;
	flex: 0 0 auto;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgba(22, 26, 28, 0.12);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.bbt-overlay-modal__brand-chip input[type="color"] {
	position: absolute;
	inset: -4px;
	width: calc(100% + 8px);
	height: calc(100% + 8px);
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.bbt-overlay-modal__brand-meta {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.bbt-overlay-modal__brand-meta strong {
	font-size: 0.92rem;
	color: var(--bbt-front-ink);
}

.bbt-overlay-modal__brand-meta span {
	font-size: 0.78rem;
	color: var(--bbt-front-muted);
}

.bbt-overlay-modal__notice {
	margin: 0 0 1rem;
	padding: 0.9rem 1rem;
	background: #fff5f2;
	border: 1px solid rgba(246, 76, 31, 0.35);
	border-left: 4px solid var(--bbt-front-accent);
	border-radius: 10px;
	color: var(--bbt-front-ink);
	font-size: 0.92rem;
	line-height: 1.45;
	font-weight: 500;
}

.bbt-overlay-modal__hint {
	margin-top: 0.75rem;
}

.bbt-overlay-modal__preview {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	margin: 0;
	padding: 1.25rem;
	text-align: center;
	background:
		linear-gradient(135deg, rgba(246, 76, 31, 0.08), transparent 40%),
		repeating-linear-gradient(
			45deg,
			#f0eeed,
			#f0eeed 10px,
			#eae7e5 10px,
			#eae7e5 20px
		);
	border: 1px solid var(--bbt-front-line);
	border-radius: 14px;
}

.bbt-overlay-modal__preview img {
	max-width: 100%;
	max-height: 220px;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(22, 26, 28, 0.12);
	background: #fff;
}

.bbt-overlay-modal__preview-empty {
	margin: 0;
	padding: 1.5rem 1rem;
	color: var(--bbt-front-muted);
	font-size: 0.95rem;
	font-weight: 600;
}

.bbt-overlay-modal__preview-empty[hidden],
.bbt-overlay-modal__preview img[hidden] {
	display: none !important;
}

.bbt-overlay-modal__dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: 168px;
	padding: 1.25rem;
	border: 2px dashed #c9ccce;
	border-radius: 14px;
	cursor: pointer;
	text-align: center;
	background: var(--bbt-front-soft);
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.bbt-overlay-modal__dropzone:hover {
	border-color: var(--bbt-front-accent);
	background: #fff8f5;
}

.bbt-overlay-modal__dropzone.is-dragover {
	border-color: var(--bbt-front-accent);
	background: #fff5f2;
	transform: scale(1.01);
}

.bbt-overlay-modal__dropzone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin-bottom: 0.25rem;
	border-radius: 999px;
	background: var(--bbt-front-accent-soft);
	color: var(--bbt-front-accent);
	font-size: 1.15rem;
	font-weight: 700;
}

.bbt-overlay-modal__dropzone-label {
	font-size: 1rem;
	font-weight: 700;
	color: var(--bbt-front-ink);
}

.bbt-overlay-modal__dropzone-hint {
	font-size: 0.82rem;
	color: var(--bbt-front-muted);
}

.bbt-overlay-crop {
	width: 100%;
	overflow: auto;
	background:
		linear-gradient(135deg, rgba(22, 26, 28, 0.04), transparent),
		#f0f0f1;
	border: 1px solid var(--bbt-front-line);
	border-radius: 14px;
	padding: 0.75rem;
	text-align: center;
}

.bbt-overlay-crop__canvas {
	position: relative;
	display: inline-block;
	max-width: 100%;
	line-height: 0;
	user-select: none;
	cursor: crosshair;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(22, 26, 28, 0.1);
}

.bbt-overlay-crop__canvas img {
	display: block;
	max-width: 100%;
	max-height: 360px;
	width: auto;
	height: auto;
	pointer-events: none;
}

.bbt-overlay-crop__region {
	position: absolute;
	box-sizing: border-box;
	border: 2px solid var(--bbt-front-accent);
	background: rgba(246, 76, 31, 0.18);
	cursor: move;
	box-shadow: 0 0 0 9999px rgba(22, 26, 28, 0.28);
}

.bbt-overlay-crop__handle {
	position: absolute;
	width: 12px;
	height: 12px;
	background: #fff;
	border: 2px solid var(--bbt-front-accent);
	border-radius: 3px;
	box-sizing: border-box;
	box-shadow: 0 1px 3px rgba(22, 26, 28, 0.25);
}

.bbt-overlay-crop__handle--nw {
	top: -7px;
	left: -7px;
	cursor: nwse-resize;
}

.bbt-overlay-crop__handle--ne {
	top: -7px;
	right: -7px;
	cursor: nesw-resize;
}

.bbt-overlay-crop__handle--sw {
	bottom: -7px;
	left: -7px;
	cursor: nesw-resize;
}

.bbt-overlay-crop__handle--se {
	bottom: -7px;
	right: -7px;
	cursor: nwse-resize;
}

.bbt-overlay-modal__actions {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin-top: 0;
	padding: 1rem 1.5rem 1.35rem;
	border-top: 1px solid var(--bbt-front-line);
	background: #fff;
	position: sticky;
	bottom: 0;
}

.bbt-overlay-modal__actions .btn {
	min-height: 2.5rem;
	border-radius: 999px;
	padding-left: 1.1rem;
	padding-right: 1.1rem;
}

.bbt-overlay-modal__actions .btn:disabled,
.bbt-overlay-modal__actions .btn.is-disabled,
.bbt-overlay-modal__actions .btn[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
	box-shadow: none;
	filter: grayscale(0.25);
}

body.bbt-overlay-modal-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	.bbt-overlay-modal {
		padding: 0.5rem;
		align-items: flex-end;
	}

	.bbt-overlay-modal__dialog {
		max-height: calc(100vh - 1rem);
		border-radius: 18px 18px 12px 12px;
	}

	.bbt-overlay-modal__header,
	.bbt-overlay-modal__body,
	.bbt-overlay-modal__actions {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.bbt-overlay-modal__brand-swatches {
		grid-template-columns: 1fr;
	}

	.bbt-overlay-modal__actions {
		justify-content: stretch;
	}

	.bbt-overlay-modal__actions .btn {
		flex: 1 1 auto;
	}
}
