.kcfg {
	--k-ink: var(--wp--preset--color--ink, #243d56);
	--k-ink-hover: var(--wp--preset--color--ink-hover, #172f47);
	--k-brand: var(--wp--preset--color--brand, #7893ac);
	--k-pale: var(--wp--preset--color--pale, #e8eef3);
	--k-base: var(--wp--preset--color--base, #faf8f5);
	--k-surface: var(--wp--preset--color--surface, #fff);
	--k-muted: var(--wp--preset--color--muted, #5e6d7b);
	--k-line: var(--wp--preset--color--line, #d8dfe5);
	--k-focus: var(--wp--preset--color--focus, #446d92);
	--k-ok: var(--wp--preset--color--success, #2c654d);
	--k-ok-bg: var(--wp--preset--color--success-surface, #edf5ef);
	--k-warn: var(--wp--preset--color--warning, #805a17);
	--k-warn-bg: var(--wp--preset--color--warning-surface, #fbf3e5);
	--k-err: var(--wp--preset--color--error, #a33b36);
	--k-err-bg: var(--wp--preset--color--error-surface, #f9ecea);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
	gap: 32px;
	align-items: start;
	margin-block: 24px 48px;
	color: var(--k-ink);
	font-variant-numeric: tabular-nums;
}

.kcfg [hidden] {
	display: none !important;
}

.kcfg label,
.kcfg p {
	margin-block: 0;
}

.kcfg__stage {
	position: sticky;
	top: 24px;
	display: grid;
	gap: 16px;
	min-width: 0;
}

.kcfg__canvas {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: 16px;
	background: var(--k-pale);
	display: grid;
	place-items: center;
	overflow: hidden;
	padding: 32px;
}

.kcfg__shape,
.kcfg__art {
	position: absolute;
	inset: 32px;
	display: grid;
	place-items: center;
	min-width: 0;
	min-height: 0;
}

.kcfg__art {
	container-type: size;
}

.kcfg__shape svg {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.kcfg__label {
	fill: var(--k-surface);
	stroke: var(--k-ink);
	stroke-width: 1.5;
	vector-effect: non-scaling-stroke;
	filter: drop-shadow(0 6px 16px rgba(36, 61, 86, 0.12));
}

.kcfg__label--clear {
	fill: rgba(255, 255, 255, 0.45);
}

.kcfg__safe {
	fill: none;
	stroke: var(--k-brand);
	stroke-width: 1;
	stroke-dasharray: 4 4;
	vector-effect: non-scaling-stroke;
}

.kcfg__dim line {
	stroke: var(--k-muted);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.kcfg__dim text {
	fill: var(--k-muted);
	font-family: var(--wp--preset--font-family--manrope, sans-serif);
	font-weight: 600;
}

.kcfg__frame {
	position: relative;
	max-width: 100%;
	max-height: 100%;
	line-height: 0;
	background: repeating-conic-gradient(#eef1f4 0% 25%, #fff 0% 50%) 50% / 16px 16px;
	box-shadow: 0 6px 16px rgba(36, 61, 86, 0.12);
}

.kcfg__frame img {
	display: block;
	max-width: 100%;
	max-height: 100cqh;
	width: auto;
	height: auto;
}

.kcfg__frame svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.kcfg__cut {
	fill: none;
	stroke: #e5007d;
	stroke-width: 2;
	stroke-dasharray: 6 4;
	vector-effect: non-scaling-stroke;
}

.kcfg__caption {
	margin: 0;
	color: var(--k-muted);
	font-size: 0.875rem;
	text-align: center;
}

.kcfg__report {
	border: 1px solid var(--k-line);
	border-radius: 12px;
	background: var(--k-surface);
	padding: 16px 20px;
}

.kcfg__report-title {
	margin: 0 0 8px;
	font-size: 1rem;
	font-weight: 600;
}

.kcfg__checks {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
	font-size: 0.875rem;
	line-height: 1.5;
}

.kcfg__checks li {
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 8px;
	align-items: start;
}

.kcfg__checks li::before {
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font-size: 0.75rem;
	font-weight: 700;
}

.kcfg__checks .is-ok::before,
.kcfg__checks .is-info::before {
	content: "✓";
	color: var(--k-ok);
	background: var(--k-ok-bg);
}

.kcfg__checks .is-warning::before {
	content: "!";
	color: var(--k-warn);
	background: var(--k-warn-bg);
}

.kcfg__checks .is-danger {
	color: var(--k-err);
}

.kcfg__checks .is-danger::before {
	content: "✕";
	color: var(--k-err);
	background: var(--k-err-bg);
}

.kcfg__panel {
	display: grid;
	gap: 8px;
	min-width: 0;
}

.kcfg__step {
	padding: 20px 0;
	border-bottom: 1px solid var(--k-line);
}

.kcfg__step:first-child {
	padding-top: 0;
}

.kcfg__step-title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
}

.kcfg__num {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--k-pale);
	color: var(--k-ink);
	font-size: 0.8125rem;
	font-weight: 700;
}

.kcfg__shapes {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.kcfg__option {
	position: relative;
	display: grid;
	gap: 6px;
	padding: 12px;
	border: 1px solid var(--k-line);
	border-radius: 10px;
	background: var(--k-surface);
	color: var(--k-ink);
	cursor: pointer;
	text-align: left;
	font: inherit;
	transition: border-color 0.15s, background-color 0.15s;
}

.kcfg__option:hover {
	border-color: var(--k-brand);
}

.kcfg__option[aria-checked="true"] {
	background: var(--k-pale);
	border-color: var(--k-ink);
	box-shadow: inset 0 0 0 1px var(--k-ink);
}

.kcfg__option[aria-checked="true"]::after {
	content: "✓";
	position: absolute;
	top: 8px;
	right: 8px;
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--k-ink);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
}

.kcfg__option:focus-visible {
	outline: 3px solid var(--k-focus);
	outline-offset: 3px;
}

.kcfg__shape-option {
	justify-items: center;
	text-align: center;
	padding: 14px 6px 10px;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
}

.kcfg__shape-option svg {
	width: 36px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
}

.kcfg__materials {
	display: grid;
	gap: 8px;
}

.kcfg__material {
	grid-template-columns: 44px 1fr;
	align-items: center;
	column-gap: 14px;
	padding-right: 36px;
}

.kcfg__swatch {
	grid-row: span 2;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	border: 1px solid var(--k-line);
}

.kcfg__swatch--paper-matte {
	background: #f4f1ea;
}

.kcfg__swatch--paper-gloss {
	background: linear-gradient(135deg, #ffffff 0%, #f1f3f5 45%, #ffffff 55%, #e9edf1 100%);
}

.kcfg__swatch--pp-white {
	background: linear-gradient(160deg, #ffffff 0%, #f6f8fa 100%);
	box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px var(--k-line);
}

.kcfg__swatch--pp-clear {
	background: repeating-conic-gradient(#e3e8ed 0% 25%, #fff 0% 50%) 50% / 10px 10px;
}

.kcfg__material-name {
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1.35;
}

.kcfg__material-hint {
	color: var(--k-muted);
	font-size: 0.8125rem;
	line-height: 1.45;
}

.kcfg__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.kcfg__row:has([data-height-field][hidden]) {
	grid-template-columns: minmax(0, 1fr);
}

.kcfg__field {
	display: grid;
	gap: 6px;
}

.kcfg__field label {
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--k-ink);
}

.kcfg__unit {
	display: flex;
	align-items: center;
	border: 1px solid var(--k-line);
	border-radius: 8px;
	background: var(--k-surface);
	min-height: 44px;
	overflow: hidden;
}

.kcfg__unit:focus-within {
	outline: 3px solid var(--k-focus);
	outline-offset: 3px;
}

.kcfg__unit input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 10px 12px;
	font: inherit;
	font-variant-numeric: tabular-nums;
	color: var(--k-ink);
	outline: none;
}

.kcfg__unit span {
	padding: 0 12px;
	color: var(--k-muted);
	font-size: 0.875rem;
}

.kcfg__unit.is-invalid {
	border-color: var(--k-err);
}

.kcfg__radius,
.kcfg__qty {
	margin-top: 16px;
	max-width: 220px;
}

.kcfg__help {
	margin-top: 8px !important;
	color: var(--k-muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.kcfg__field-error {
	margin-top: 8px !important;
	color: var(--k-err);
	font-size: 0.8125rem;
}

.kcfg__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kcfg__chip {
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--k-line);
	border-radius: 8px;
	background: var(--k-surface);
	color: var(--k-ink);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}

.kcfg__chip:hover {
	border-color: var(--k-brand);
}

.kcfg__chip[aria-pressed="true"] {
	background: var(--k-pale);
	border-color: var(--k-ink);
	box-shadow: inset 0 0 0 1px var(--k-ink);
}

.kcfg__drop {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 6px;
	padding: 24px 16px;
	border: 1.5px dashed var(--k-brand);
	border-radius: 12px;
	background: var(--k-surface);
	text-align: center;
	cursor: pointer;
}

.kcfg__drop:hover,
.kcfg__drop.is-over {
	background: var(--k-pale);
	border-color: var(--k-ink);
}

.kcfg__drop:focus-within {
	outline: 3px solid var(--k-focus);
	outline-offset: 3px;
}

.kcfg__drop input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.kcfg__drop-icon {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: var(--k-ink);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.kcfg__drop-title {
	font-weight: 600;
}

.kcfg__drop-help {
	color: var(--k-muted);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.kcfg__status {
	margin-top: 12px !important;
	font-size: 0.875rem;
	min-height: 1.4em;
}

.kcfg.is-uploading .kcfg__status::before {
	content: "";
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	margin-right: 0.5em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -0.12em;
	animation: kcfg-spin 0.8s linear infinite;
}

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

.kcfg__summary {
	display: grid;
	gap: 12px;
	margin-top: 8px;
	padding: 20px;
	border: 1px solid var(--k-line);
	border-radius: 16px;
	background: var(--k-surface);
	box-shadow: 0 1px 2px rgba(36, 61, 86, 0.06), 0 8px 24px rgba(36, 61, 86, 0.08);
}

.kcfg__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	min-height: 2.5rem;
}

.kcfg__total {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.kcfg__vat {
	color: var(--k-muted);
	font-size: 0.875rem;
}

.kcfg.is-loading .kcfg__price {
	opacity: 0.45;
}

.kcfg__facts {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 4px;
	font-size: 0.875rem;
	color: var(--k-muted);
}

.kcfg__facts strong {
	color: var(--k-ink);
	font-weight: 600;
}

.kcfg__problem {
	margin: 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: var(--k-err-bg);
	color: var(--k-err);
	font-size: 0.875rem;
}

.kcfg__approve {
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 10px;
	align-items: start;
	font-size: 0.875rem;
	line-height: 1.5;
	cursor: pointer;
}

.kcfg__approve input {
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--k-ink);
}

.kcfg__approve:has(input:disabled) {
	color: var(--k-muted);
	cursor: not-allowed;
}

.kcfg__add {
	width: 100%;
	min-height: 48px;
	cursor: pointer;
}

.kcfg__add:disabled {
	background: var(--k-line);
	color: var(--k-muted);
	cursor: not-allowed;
}

.kaleb-price-note {
	color: var(--wp--preset--color--muted, #5e6d7b);
	font-size: 0.9375rem;
}

@media (max-width: 1100px) {
	.kcfg {
		grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
		gap: 24px;
	}
}

@media (max-width: 800px) {
	.kcfg {
		grid-template-columns: minmax(0, 1fr);
	}

	.kcfg__stage {
		position: static;
	}

	.kcfg__canvas {
		aspect-ratio: 3 / 2;
		padding: 20px;
	}

	.kcfg__shape,
	.kcfg__art {
		inset: 20px;
	}
}

@media (max-width: 480px) {
	.kcfg__shapes {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.kcfg__total {
		font-size: 1.75rem;
	}

	.kcfg__summary {
		padding: 16px;
		border-radius: 12px;
	}
}

.kcfg__create {
	display: grid;
	grid-template-columns: 28px 1fr;
	gap: 12px;
	align-items: center;
	width: 100%;
	padding: 16px;
	border: 1px solid var(--k-ink);
	border-radius: 12px;
	background: var(--k-surface);
	color: var(--k-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.kcfg__create:hover {
	background: var(--k-pale);
}

.kcfg__create:disabled {
	opacity: 0.6;
	cursor: progress;
}

.kcfg__create svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.kcfg__create-text {
	display: grid;
	gap: 2px;
}

.kcfg__create-text span {
	color: var(--k-muted);
	font-size: 0.8125rem;
}

.kcfg__or {
	margin: 12px 0 !important;
	text-align: center;
	color: var(--k-muted);
	font-size: 0.8125rem;
}

.kcfg__create + .kcfg__create {
	margin-top: 8px;
}

.kcfg__create--translate {
	border-color: var(--k-brand);
	background: var(--k-pale);
}

.kcfg__template {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px;
	border: 1px solid var(--k-line);
	border-radius: 14px;
	background: var(--k-pale);
}

.kcfg__template[hidden] {
	display: none;
}

.kcfg__template img {
	flex: none;
	width: 96px;
	height: 72px;
	object-fit: contain;
}

.kcfg__template-text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.kcfg__template-label,
.kcfg__template-help {
	font-size: 0.8125rem;
	color: var(--k-muted);
}

.kcfg__template-name {
	font-weight: 700;
	color: var(--k-ink);
}

.kcfg__template-links {
	font-size: 0.875rem;
}

.kcfg__template-links a,
.kcfg__gallery {
	color: var(--k-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.kcfg__gallery {
	display: block;
	margin-top: 10px;
	font-size: 0.9375rem;
}
