.cp34,
.cp34 * {
	box-sizing: border-box;
}

.cp34 {
	--cp34-blue: #00235e;
	--cp34-blue-2: #0b438a;
	--cp34-yellow: #ffb600;
	--cp34-focus: #005fcc;
	--cp34-ink: #17223b;
	--cp34-muted: #5c6578;
	--cp34-line: #dbe2ee;
	--cp34-soft: #f4f7fb;
	--cp34-good: #147a4b;
	--cp34-warn: #9a5b00;
	--cp34-error: #b42318;
	--cp34-radius: 24px;
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	color: var(--cp34-ink);
	font: inherit;
	line-height: 1.5;
}

.cp34 button,
.cp34 input,
.cp34 select {
	font: inherit;
}

.cp34 button,
.cp34 label,
.cp34 input[type="range"],
.cp34 select {
	cursor: pointer;
}

.cp34 button:focus-visible,
.cp34 input:focus-visible,
.cp34 select:focus-visible,
.cp34 summary:focus-visible,
.cp34__dropzone:focus-within,
.cp34__canvas:focus-visible {
	outline: 3px solid var(--cp34-focus);
	outline-offset: 3px;
}

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

.cp34__privacy {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 20px;
	padding: 13px 16px;
	border: 1px solid #bedecb;
	border-radius: 16px;
	background: #effaf4;
	color: #155b3b;
	font-size: 0.95rem;
}

.cp34__privacy-icon {
	display: inline-grid;
	flex: 0 0 23px;
	width: 23px;
	height: 23px;
	place-items: center;
	border-radius: 50%;
	background: var(--cp34-good);
	color: #fff;
	font-weight: 800;
	line-height: 1;
}

.cp34__notice {
	margin: 0 0 18px;
	padding: 14px 16px;
	border-radius: 14px;
}

.cp34__notice--error {
	border: 1px solid #f1b7b2;
	background: #fff2f0;
	color: #842018;
}

.cp34__sr-status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cp34__file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cp34__dropzone {
	display: flex;
	min-height: 310px;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 9px;
	padding: 32px 22px;
	border: 2px dashed #aebbd0;
	border-radius: var(--cp34-radius);
	background: linear-gradient(145deg, #fff 0%, #f4f7fb 100%);
	color: var(--cp34-ink);
	text-align: center;
	transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.cp34__dropzone:hover,
.cp34__dropzone.is-dragging {
	border-color: var(--cp34-blue-2);
	background: #edf4ff;
}

.cp34__dropzone.is-dragging {
	transform: scale(1.01);
}

.cp34__dropzone strong {
	margin: 0;
	color: var(--cp34-blue);
	font-size: clamp(1.25rem, 4vw, 1.55rem);
	font-weight: 800;
}

.cp34__dropzone > span:not(.cp34__upload-mark) {
	color: #39445b;
}

.cp34__dropzone small {
	max-width: 520px;
	color: var(--cp34-muted);
	font-size: 0.88rem;
}

.cp34__upload-mark {
	display: grid;
	width: 66px;
	height: 66px;
	margin-bottom: 4px;
	place-items: center;
	border-radius: 20px;
	background: var(--cp34-blue);
	color: #fff;
	box-shadow: 0 12px 24px rgba(0, 35, 94, 0.18);
}

.cp34__upload-mark svg {
	width: 31px;
	height: 31px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.cp34__workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
	gap: 22px;
	align-items: start;
}

.cp34__editor-card,
.cp34__result-card {
	border: 1px solid var(--cp34-line);
	border-radius: var(--cp34-radius);
	background: #fff;
	box-shadow: 0 16px 42px rgba(0, 35, 94, 0.08);
}

.cp34__editor-card {
	padding: clamp(18px, 3vw, 28px);
}

.cp34__result-card {
	position: sticky;
	top: 24px;
	padding: 24px;
}

.cp34__editor-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
}

.cp34__editor-heading h2,
.cp34__result-card h2 {
	margin: 0;
	color: var(--cp34-blue);
	font-size: 1.3rem;
	font-weight: 800;
	line-height: 1.25;
}

.cp34__editor-heading p {
	margin: 5px 0 0;
	color: var(--cp34-muted);
	font-size: 0.88rem;
	word-break: break-word;
}

.cp34__text-button {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 5px 2px;
	border: 0;
	background: transparent;
	color: var(--cp34-blue-2);
	font-weight: 750;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cp34__editor-grid {
	display: grid;
	grid-template-columns: minmax(230px, 360px) minmax(200px, 1fr);
	gap: clamp(20px, 4vw, 32px);
	align-items: start;
}

.cp34__canvas-wrap {
	position: relative;
	width: min(100%, 360px);
	margin: 0 auto;
	overflow: hidden;
	border-radius: 18px;
	background: #e9edf3;
	box-shadow: 0 0 0 1px rgba(0, 35, 94, 0.14), 0 16px 32px rgba(0, 35, 94, 0.12);
	aspect-ratio: 3 / 4;
}

.cp34__canvas {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
	user-select: none;
}

.cp34__head-guide {
	position: absolute;
	inset: 0;
	pointer-events: none;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.cp34__head-guide-shape {
	position: absolute;
	top: var(--cp34-guide-top, 12%);
	left: calc((100% - var(--cp34-guide-width, 52%)) / 2);
	width: var(--cp34-guide-width, 52%);
	height: var(--cp34-guide-height, 55%);
	overflow: visible;
}

.cp34__head-guide-shape path {
	fill: none;
	vector-effect: non-scaling-stroke;
}

.cp34__head-guide-shadow {
	stroke: rgba(0, 35, 94, 0.24);
	stroke-width: 2.8;
}

.cp34__head-guide-line {
	stroke: rgba(255, 255, 255, 0.9);
	stroke-width: 1.6;
	stroke-dasharray: 5 4;
	stroke-linecap: round;
}

.cp34__head-guide::after {
	position: absolute;
	top: var(--cp34-guide-eye-y, 37%);
	left: 18%;
	width: 64%;
	border-top: 1.5px dashed rgba(255, 255, 255, 0.96);
	filter: drop-shadow(0 1px 0 rgba(0, 35, 94, 0.42));
	content: "";
}

.cp34__head-guide span::before,
.cp34__head-guide span::after {
	position: absolute;
	left: 20%;
	width: 60%;
	border-top: 1px dashed rgba(255, 255, 255, 0.72);
	filter: drop-shadow(0 1px 0 rgba(0, 35, 94, 0.28));
	content: "";
}

.cp34__head-guide span::before {
	top: var(--cp34-guide-head-top-y, 9.5%);
}

.cp34__head-guide span::after {
	top: var(--cp34-guide-chin-y, 82%);
}


.cp34__scan-overlay {
	position: absolute;
	inset: 0;
	z-index: 4;
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,35,94,0.08));
	transition: opacity 160ms ease, visibility 160ms ease;
}

.cp34__scan-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

.cp34__scan-grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
	background-size: 24px 24px;
	mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
	opacity: 0.45;
}

.cp34__scan-line {
	position: absolute;
	top: 10%;
	left: 5%;
	width: 90%;
	height: 4px;
	border-radius: 999px;
	background: linear-gradient(90deg, transparent 0%, rgba(111,190,255,0.75) 12%, #fff 50%, rgba(111,190,255,0.75) 88%, transparent 100%);
	box-shadow: 0 0 9px rgba(255,255,255,0.95), 0 0 24px rgba(64,157,255,0.95), 0 0 46px rgba(64,157,255,0.45);
	opacity: 0;
}

.cp34__scan-overlay.is-active .cp34__scan-line {
	opacity: 1;
	animation: cp34-photo-scan 1.45s ease-in-out infinite;
}

.cp34__scan-chip {
	position: absolute;
	left: 50%;
	bottom: 14px;
	max-width: calc(100% - 28px);
	transform: translateX(-50%);
	padding: 8px 13px;
	border: 1px solid rgba(255,255,255,0.74);
	border-radius: 999px;
	background: rgba(0,35,94,0.82);
	color: #fff;
	box-shadow: 0 8px 24px rgba(0,35,94,0.26);
	font-size: 0.76rem;
	font-weight: 750;
	line-height: 1.25;
	text-align: center;
	white-space: normal;
}

@keyframes cp34-photo-scan {
	0% { top: 9%; opacity: 0.25; }
	12% { opacity: 1; }
	50% { top: 50%; opacity: 1; }
	88% { opacity: 1; }
	100% { top: 91%; opacity: 0.25; }
}

.cp34__canvas-help {
	margin: 11px 0 0;
	color: var(--cp34-muted);
	font-size: 0.86rem;
	text-align: center;
}

.cp34__controls {
	display: grid;
	gap: 20px;
}

.cp34__smart-card {
	display: grid;
	gap: 14px;
	padding: 14px;
	border: 1px solid #c8d9f2;
	border-radius: 15px;
	background: #f2f7ff;
}

.cp34__smart-heading {
	display: grid;
	grid-template-columns: 12px 1fr;
	gap: 10px;
	align-items: start;
}

.cp34__smart-heading > div {
	display: grid;
	gap: 2px;
}

.cp34__smart-heading strong {
	color: var(--cp34-blue);
	font-size: 0.93rem;
}

.cp34__smart-heading span:not(.cp34__ai-dot) {
	color: var(--cp34-muted);
	font-size: 0.8rem;
}

.cp34__smart-option {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(132px, 1.25fr);
	gap: 10px;
	align-items: center;
	color: var(--cp34-ink);
	font-size: 0.82rem;
	font-weight: 700;
}

.cp34__smart-option--compact {
	padding-left: 51px;
}

.cp34__smart-option select {
	width: 100%;
	min-width: 0;
	height: 40px;
	padding: 0 28px 0 10px;
	border: 1px solid #b8c5d8;
	border-radius: 10px;
	background-color: #fff;
	color: var(--cp34-ink);
}

.cp34__smart-option select:disabled {
	cursor: not-allowed;
	opacity: 0.58;
}

.cp34__contour-note {
	margin: -2px 0 0 51px;
	color: var(--cp34-muted);
	font-size: 0.72rem;
	font-weight: 650;
}

.cp34__ai-dot {
	width: 10px;
	height: 10px;
	margin-top: 6px;
	border-radius: 50%;
	background: #8793a7;
}

.cp34__ai-dot.is-working {
	background: var(--cp34-yellow);
	box-shadow: 0 0 0 0 rgba(255, 182, 0, 0.45);
	animation: cp34-pulse 1.2s infinite;
}

.cp34__ai-dot.is-good {
	background: var(--cp34-good);
}

.cp34__ai-dot.is-error {
	background: var(--cp34-error);
}

.cp34__toggle {
	display: inline-grid;
	min-height: 32px;
	grid-template-columns: 42px 1fr;
	gap: 9px;
	align-items: center;
	color: var(--cp34-ink);
	font-size: 0.86rem;
	font-weight: 700;
}

.cp34__toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

.cp34__toggle-control {
	position: relative;
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: #a7b0bf;
	transition: background 160ms ease;
}

.cp34__toggle-control::after {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	content: "";
	transition: transform 160ms ease;
}

.cp34__toggle input:checked + .cp34__toggle-control {
	background: var(--cp34-blue-2);
}

.cp34__toggle input:checked + .cp34__toggle-control::after {
	transform: translateX(18px);
}

.cp34__toggle input:focus-visible + .cp34__toggle-control {
	outline: 3px solid var(--cp34-focus);
	outline-offset: 3px;
}

.cp34__preset-fieldset {
	display: grid;
	min-width: 0;
	gap: 9px;
	padding: 0;
	border: 0;
	margin: 0;
}

.cp34__preset-fieldset legend {
	padding: 0;
	margin: 0 0 8px;
	color: var(--cp34-ink);
	font-size: 0.92rem;
	font-weight: 750;
}

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

.cp34__preset {
	position: relative;
	min-width: 0;
}

.cp34__preset input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

.cp34__preset > span {
	display: grid;
	min-height: 64px;
	align-content: center;
	gap: 1px;
	padding: 9px 10px;
	border: 1px solid #b8c5d8;
	border-radius: 13px;
	background: #fff;
	color: var(--cp34-blue);
	text-align: center;
	transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.cp34__preset small {
	color: var(--cp34-muted);
	font-size: 0.68rem;
	font-weight: 550;
	line-height: 1.25;
}

.cp34__preset input:checked + span {
	border-color: var(--cp34-blue-2);
	background: #edf4ff;
	box-shadow: inset 0 0 0 1px var(--cp34-blue-2);
}

.cp34__preset input:focus-visible + span {
	outline: 3px solid var(--cp34-focus);
	outline-offset: 3px;
}

.cp34__preset-note {
	margin: 0;
	color: var(--cp34-muted);
	font-size: 0.74rem;
}

.cp34.is-film .cp34__preset-note {
	color: #714500;
	font-weight: 650;
}

@keyframes cp34-pulse {
	70% {
		box-shadow: 0 0 0 7px rgba(255, 182, 0, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(255, 182, 0, 0);
	}
}

.cp34__control {
	display: grid;
	gap: 9px;
}

.cp34__control-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.92rem;
	font-weight: 700;
}

.cp34__control-label output {
	color: var(--cp34-muted);
	font-variant-numeric: tabular-nums;
	font-weight: 650;
}

.cp34 input[type="range"] {
	width: 100%;
	min-height: 28px;
	margin: 0;
	accent-color: var(--cp34-blue);
}

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

.cp34__secondary-button,
.cp34__primary-button {
	min-height: 46px;
	border-radius: 13px;
	font-weight: 760;
	transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.cp34__secondary-button {
	padding: 10px 12px;
	border: 1px solid #b8c5d8;
	background: #fff;
	color: var(--cp34-blue);
}

.cp34__secondary-button:hover {
	border-color: var(--cp34-blue-2);
	background: #f2f6fc;
}

.cp34__secondary-button--wide {
	width: 100%;
}

.cp34__adjustments {
	border-top: 1px solid var(--cp34-line);
	padding-top: 14px;
}

.cp34__adjustments summary {
	min-height: 40px;
	padding: 7px 2px;
	color: var(--cp34-blue);
	font-weight: 750;
}

.cp34__adjustments[open] summary {
	margin-bottom: 18px;
}

.cp34__adjustments .cp34__control + .cp34__control {
	margin-top: 16px;
}

.cp34__manual-adjustments {
	padding-bottom: 2px;
}

.cp34__manual-adjustments > * + * {
	margin-top: 16px;
}

.cp34__manual-note {
	margin: 0;
	color: var(--cp34-muted);
	font-size: 0.78rem;
	line-height: 1.45;
}

.cp34__developer-credit {
	margin: 18px 0 0;
	color: var(--cp34-muted);
	font-size: 0.72rem;
	line-height: 1.4;
	text-align: center;
}

.cp34__developer-credit a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.cp34__developer-credit a:hover {
	color: var(--cp34-blue-2);
}

.cp34__checks {
	display: grid;
	gap: 8px;
	padding: 0;
	margin: 14px 0 12px;
	list-style: none;
}

.cp34__check {
	display: grid;
	grid-template-columns: 24px 1fr;
	gap: 9px;
	align-items: start;
	margin: 0;
	padding: 9px 10px;
	border-radius: 11px;
	background: var(--cp34-soft);
	font-size: 0.84rem;
	line-height: 1.35;
}

.cp34__check-icon {
	display: grid;
	width: 21px;
	height: 21px;
	place-items: center;
	border-radius: 50%;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 850;
	line-height: 1;
}

.cp34__check--good .cp34__check-icon {
	background: var(--cp34-good);
}

.cp34__check--warn .cp34__check-icon {
	background: var(--cp34-warn);
}

.cp34__check--warn {
	background: #fff7e8;
	color: #714500;
}

.cp34__check--error .cp34__check-icon {
	background: var(--cp34-error);
}

.cp34__check--error {
	background: #fff2f0;
	color: #842018;
}

.cp34__check--pending .cp34__check-icon {
	background: #6e788a;
}

.cp34__hint {
	margin: 0 0 16px;
	color: var(--cp34-muted);
	font-size: 0.76rem;
	line-height: 1.4;
	transition: none !important;
	animation: none !important;
}

.cp34__download-block {
	display: grid;
	gap: 12px;
	padding-top: 18px;
	border-top: 1px solid var(--cp34-line);
}

.cp34__primary-button {
	display: grid;
	width: 100%;
	gap: 2px;
	padding: 13px 16px;
	border: 0;
	background: var(--cp34-blue);
	color: #fff;
	box-shadow: 0 10px 22px rgba(0, 35, 94, 0.18);
}

.cp34__primary-button small {
	color: #dce8ff;
	font-size: 0.76rem;
	font-weight: 550;
}

.cp34__primary-button:hover {
	background: #063579;
	box-shadow: 0 13px 25px rgba(0, 35, 94, 0.25);
	transform: translateY(-1px);
}

.cp34__primary-button:disabled,
.cp34__secondary-button:disabled {
	cursor: not-allowed;
	opacity: 0.65;
	transform: none;
}

.cp34.is-busy .cp34__primary-button:disabled,
.cp34.is-busy .cp34__secondary-button:disabled {
	cursor: wait;
}

.cp34__print-options {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(96px, 112px);
	gap: 10px;
	align-items: center;
	font-size: 0.86rem;
	font-weight: 700;
}

.cp34__print-options select {
	width: 100%;
	height: 42px;
	padding: 0 30px 0 12px;
	border: 1px solid #b8c5d8;
	border-radius: 11px;
	background-color: #fff;
	color: var(--cp34-ink);
}

@media (max-width: 900px) {
	.cp34__workspace {
		grid-template-columns: 1fr;
	}

	.cp34__result-card {
		position: static;
	}
}

@media (max-width: 650px) {
	.cp34 {
		--cp34-radius: 20px;
	}

	.cp34__privacy {
		gap: 9px;
		margin-bottom: 14px;
		padding: 11px 13px;
		font-size: 0.87rem;
	}

	.cp34__dropzone {
		min-height: 240px;
		padding: 24px 17px;
	}

	.cp34__workspace {
		gap: 16px;
	}

	.cp34__editor-card,
	.cp34__result-card {
		padding: 16px;
	}

	.cp34__editor-heading {
		align-items: center;
		margin-bottom: 16px;
	}

	.cp34__editor-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.cp34__canvas-wrap {
		width: min(100%, 300px);
		border-radius: 16px;
		box-shadow: 0 0 0 1px rgba(0, 35, 94, 0.14), 0 10px 24px rgba(0, 35, 94, 0.09);
	}

	.cp34__canvas-help {
		margin-top: 8px;
		font-size: 0.82rem;
	}

	.cp34__controls {
		gap: 14px;
	}

	.cp34__smart-card {
		gap: 11px;
		padding: 12px;
	}

	.cp34__preset-fieldset {
		gap: 7px;
	}

	.cp34__preset-fieldset legend {
		margin-bottom: 5px;
	}

	.cp34__preset > span {
		min-height: 56px;
		padding: 8px 9px;
	}

	.cp34__adjustments {
		padding-top: 10px;
	}

	.cp34__checks {
		gap: 6px;
		margin: 12px 0 10px;
	}

	.cp34__check {
		padding: 8px 9px;
	}

	.cp34__hint {
		margin-bottom: 12px;
	}

	.cp34__download-block {
		gap: 10px;
		padding-top: 14px;
	}

	.cp34__developer-credit {
		margin-top: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cp34 *,
	.cp34 *::before,
	.cp34 *::after {
		animation: none !important;
		scroll-behavior: auto !important;
		transition: none !important;
	}
}





.cp34__engine-debug {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	z-index: 6;
	padding: 7px 10px;
	border: 1px solid rgba(255,255,255,.72);
	border-radius: 10px;
	background: rgba(0,35,94,.86);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	pointer-events: none;
	box-shadow: 0 6px 18px rgba(0,35,94,.2);
}


.cp34__engine-debug-errors {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 72px;
	z-index: 7;
	max-height: 110px;
	overflow: auto;
	padding: 8px 10px;
	border: 1px solid rgba(255,255,255,.72);
	border-radius: 10px;
	background: rgba(122,28,28,.91);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.35;
	word-break: break-word;
	pointer-events: none;
	box-shadow: 0 6px 18px rgba(80,0,0,.22);
}


.cp34__toggle.is-disabled {
	cursor: not-allowed;
	opacity: 0.58;
}

.cp34__toggle.is-disabled .cp34__toggle-control {
	background: #a7b0bf;
}

.cp34__background-unavailable {
	margin: -4px 0 0 51px;
	padding: 8px 10px;
	border-radius: 9px;
	background: #fff7e8;
	color: #714500;
	font-size: 0.72rem;
	font-weight: 650;
	line-height: 1.45;
}

.cp34__background-unavailable[hidden] {
	display: none;
}
