.pkk-calculator {
	--pkk-border: #d8ddd5;
	--pkk-text: #1f2923;
	--pkk-muted: #68746d;
	--pkk-surface: #f6f7f2;
	--pkk-accent: #2f6f5e;
	color: var(--pkk-text);
	font-family: inherit;
	margin: 32px 0;
}

.pkk-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
}

.pkk-tab {
	appearance: none;
	background: #fff;
	border: 1px solid var(--pkk-border);
	border-radius: 6px;
	color: var(--pkk-text);
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	padding: 12px 16px;
}

.pkk-tab.is-active {
	background: var(--pkk-accent);
	border-color: var(--pkk-accent);
	color: #fff;
}

.pkk-panel {
	display: none;
}

.pkk-panel.is-active {
	display: block;
}

.pkk-layout {
	align-items: stretch;
	display: grid;
	gap: 28px;
	grid-template-columns: minmax(280px, 1fr) minmax(320px, 460px);
}

.pkk-preview-column,
.pkk-form {
	background: #fff;
	border: 1px solid var(--pkk-border);
	border-radius: 8px;
}

.pkk-preview-column {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 18px;
}

.pkk-preview-frame {
	aspect-ratio: 4 / 3;
	background: #fbfaf6;
	border-radius: 6px;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.pkk-image-preview {
	--pkk-preview-secondary: #aeb4ba;
	--pkk-preview-wall: #f5f1e8;
	align-items: center;
	background: var(--pkk-preview-wall);
	display: flex;
	height: 100%;
	justify-content: center;
	padding: 0;
	width: 100%;
}

.pkk-image-preview-stage {
	align-items: center;
	background: var(--pkk-preview-wall);
	display: flex;
	height: 100%;
	justify-content: center;
	overflow: hidden;
	position: relative;
	width: 100%;
}

.pkk-image-preview-stage::before {
	background:
		linear-gradient(90deg, var(--pkk-preview-secondary) 0 11%, transparent 11% 89%, var(--pkk-preview-secondary) 89% 100%),
		linear-gradient(180deg, rgba(255, 255, 255, .36), rgba(31, 41, 35, .04));
	content: "";
	inset: 0;
	opacity: .34;
	pointer-events: none;
	position: absolute;
	z-index: 1;
}

.pkk-image-preview-img {
	display: block;
	height: 100%;
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
	position: relative;
	width: 100%;
	z-index: 2;
}

.pkk-color-controls {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pkk-custom-picker {
	display: grid;
	gap: 10px;
	position: relative;
}

.pkk-custom-picker-label,
.pkk-field label {
	color: var(--pkk-text);
	font-weight: 700;
}

.pkk-custom-picker-trigger {
	align-items: center;
	appearance: none;
	background: #fff;
	border: 1px solid var(--pkk-border);
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	height: 46px;
	justify-content: center;
	padding: 0;
	width: 54px;
}

.pkk-custom-picker-trigger[aria-expanded="true"] {
	border-color: var(--pkk-accent);
	box-shadow: 0 0 0 1px var(--pkk-accent);
}

.pkk-custom-picker-chip,
.pkk-custom-picker-swatch {
	background: var(--pkk-picker-color);
	background-image: var(--pkk-picker-image);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	border: 1px solid rgba(31, 41, 35, .18);
	border-radius: 4px;
	display: block;
	height: 36px;
	width: 36px;
}

.pkk-custom-picker-chip.is-image,
.pkk-custom-picker-swatch.is-image {
	border-radius: 2px;
}

.pkk-custom-picker-panel {
	background: #fff;
	border: 1px solid var(--pkk-border);
	border-radius: 8px;
	box-shadow: 0 18px 36px rgba(31, 41, 35, .12);
	left: 0;
	padding: 10px;
	position: absolute;
	top: calc(100% + 8px);
	width: 220px;
	z-index: 20;
}

.pkk-custom-picker-grid {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pkk-custom-picker-option {
	align-items: center;
	appearance: none;
	background: #fff;
	border: 1px solid var(--pkk-border);
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	height: 46px;
	justify-content: center;
	padding: 0;
	width: 100%;
}

.pkk-custom-picker-option:hover,
.pkk-custom-picker-option:focus,
.pkk-custom-picker-option.is-active {
	border-color: var(--pkk-accent);
	box-shadow: 0 0 0 1px var(--pkk-accent);
	outline: none;
}

.pkk-custom-picker-option.is-active .pkk-custom-picker-swatch {
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--pkk-accent);
}

.pkk-form {
	display: grid;
	gap: 16px;
	padding: 24px;
}

.pkk-form-header h2 {
	font-size: clamp(24px, 3vw, 34px);
	line-height: 1.1;
	margin: 0;
}

.pkk-field,
.pkk-field-grid {
	display: grid;
	gap: 8px;
}

.pkk-field-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pkk-field input[type="number"],
.pkk-field input[type="file"],
.pkk-field select {
	background: #fff;
	border: 1px solid var(--pkk-border);
	border-radius: 6px;
	color: var(--pkk-text);
	font: inherit;
	min-height: 46px;
	padding: 10px 12px;
	width: 100%;
}

.pkk-unit-input {
	align-items: center;
	border: 1px solid var(--pkk-border);
	border-radius: 6px;
	display: flex;
	overflow: hidden;
}

.pkk-unit-input input {
	border: 0 !important;
	min-width: 0;
}

.pkk-unit-input span {
	background: var(--pkk-surface);
	border-left: 1px solid var(--pkk-border);
	color: var(--pkk-muted);
	padding: 13px 12px;
}

.pkk-help {
	color: var(--pkk-muted);
	font-size: 14px;
	line-height: 1.45;
	margin: 0;
}

.pkk-result {
	background: var(--pkk-surface);
	border-radius: 8px;
	display: grid;
	gap: 4px;
	padding: 16px;
}

.pkk-result span {
	color: var(--pkk-muted);
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
}

.pkk-result strong {
	font-size: clamp(26px, 4vw, 38px);
	line-height: 1.05;
}

.pkk-result small {
	color: var(--pkk-muted);
	line-height: 1.35;
}

.pkk-submit {
	appearance: none;
	background: var(--pkk-accent);
	border: 0;
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 800;
	min-height: 50px;
	padding: 13px 18px;
	width: 100%;
}

.pkk-submit:hover,
.pkk-submit:focus {
	background: #265a4d;
}

@media (max-width: 780px) {
	.pkk-layout {
		grid-template-columns: 1fr;
	}

	.pkk-field-grid,
	.pkk-color-controls {
		grid-template-columns: 1fr;
	}

	.pkk-custom-picker-panel {
		width: 100%;
	}
}
