* {
	box-sizing: border-box;
}

:root {
	--radius-large: 12px;
	--radius-medium: 8px;
	--radius-small: 5px;
}

body {
	margin: 0;
	padding: 0;
	background: #f5f5f3;
	color: #1f1f1f;
	font-family: Arial, sans-serif;
}

.print-page {
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: 24px;
}

.print-header {
	background: #ffffff;
	border: 1px solid #e7e7e2;
	border-radius: 24px;
	padding: 26px;
	margin-bottom: 20px;
	box-shadow: 0 18px 45px rgba(0,0,0,0.04);
}

.print-label {
	font-size: 12px;
	color: #8a8a82;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	margin-bottom: 8px;
}

.print-header h1 {
	margin: 0 0 8px 0;
	font-size: 34px;
	line-height: 1.1;
	letter-spacing: -1px;
}

.print-header p {
	margin: 0;
	color: #777;
	font-size: 15px;
	line-height: 1.5;
}

.print-grid {
	display: grid;
	grid-template-columns: 430px 1fr;
	gap: 20px;
	align-items: start;
}

.print-panel,
.print-preview-panel {
	background: #ffffff;
	border: 1px solid #e7e7e2;
	border-radius: 24px;
	padding: 20px;
	box-shadow: 0 18px 45px rgba(0,0,0,0.04);
}

.print-section {
	border-bottom: 1px solid #eeeeea;
	padding-bottom: 20px;
	margin-bottom: 20px;
}

.print-section:last-child {
	border-bottom: 0;
	padding-bottom: 0;
	margin-bottom: 0;
}

.print-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.print-section-title {
	font-size: 13px;
	color: #777;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 12px;
}

.print-select {
	width: 100%;
	height: 46px;
	border: 1px solid #deded8;
	border-radius: 14px;
	padding: 0 14px;
	font-size: 15px;
	background: #fafafa;
	color: #222;
}

.print-help {
	color: #8a8a82;
	font-size: 13px;
	line-height: 1.4;
	margin-top: 10px;
}

.upload-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 150px;
	border: 1px dashed #cfcfc8;
	border-radius: 20px;
	background: #fafaf8;
	cursor: pointer;
	transition: 0.2s ease;
	text-align: center;
	padding: 20px;
}

.upload-drop:hover,
.upload-drop.is-dragover {
	background: #f1f1ed;
	border-color: #999;
}

.upload-drop input {
	display: none;
}

.upload-title {
	font-size: 15px;
	font-weight: bold;
	color: #333;
}

.upload-subtitle {
	font-size: 13px;
	color: #8a8a82;
}

.upload-status {
	font-size: 13px;
	color: #777;
	margin-top: 10px;
	min-height: 18px;
}

.uploads-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.upload-card {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 12px;
	background: #fafaf8;
	border: 1px solid #ecece7;
	border-radius: 18px;
	padding: 10px;
}

.upload-preview {
	width: 110px;
	height: 110px;
	border-radius: 14px;
	border: 1px solid #ddd;
	background: repeating-linear-gradient(
		45deg,
		#9a9a9a,
		#9a9a9a 10px,
		#8f8f8f 10px,
		#8f8f8f 20px
	);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.upload-preview img {
	max-width: 100%;
	max-height: 100%;
	display: block;
}

.upload-meta {
	min-width: 0;
}

.upload-name {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 4px;
}

.upload-info {
	font-size: 12px;
	color: #888;
	margin-bottom: 10px;
}

.upload-controls {
	display: grid;
	grid-template-columns: 1fr 1fr 34px;
	gap: 8px;
	align-items: end;
}

.input-group label {
	display: block;
	font-size: 11px;
	color: #888;
	margin-bottom: 4px;
}

.input-group input {
	width: 100%;
	height: 36px;
	border: 1px solid #deded8;
	border-radius: 11px;
	padding: 0 9px;
	font-size: 14px;
	background: #fff;
}

.delete-upload {
	width: 34px;
	height: 36px;
	border: 0;
	border-radius: 11px;
	background: #eeeeea;
	color: #555;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
}

.delete-upload:hover {
	background: #e2e2dc;
	color: #111;
}

.print-button {
	height: 42px;
	border: 0;
	border-radius: 14px;
	padding: 0 18px;
	font-size: 14px;
	font-weight: bold;
	cursor: pointer;
	transition: 0.2s ease;
}

.print-button-dark {
	background: #190;
	color: #fff;
}

.print-button-dark:hover {
	background: #1b0;
}

.result-card {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 12px;
	margin-bottom: 18px;
	align-items: stretch;
}

.result-card > div {
	background: #fafaf8;
	border: 1px solid #ecece7;
	border-radius: var(--radius-medium);
	padding: 18px;
}

.result-card .print-next-actions {
	display: flex;
	padding: 0;
}

.result-card .print-next-actions .print-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 100%;
	height: auto;
	padding: 18px 22px;
	font-size: 20px;
	font-weight: bold;
	text-align: center;
	text-decoration: none;
	border-radius: var(--radius-medium);
}

.result-label {
	font-size: 12px;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 6px;
}

.result-value {
	font-size: 28px;
	font-weight: bold;
	letter-spacing: -1px;
}

.print-loader {
	position: fixed;
	inset: 0;
	background: rgba(245,245,243,0.72);
	backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.print-loader.is-active {
	display: flex;
}

.loader-box {
	background: #fff;
	border: 1px solid #e7e7e2;
	border-radius: 22px;
	padding: 24px;
	min-width: 190px;
	text-align: center;
	box-shadow: 0 18px 45px rgba(0,0,0,0.08);
}

.loader-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #e4e4df;
	border-top-color: #111;
	border-radius: 50%;
	margin: 0 auto 12px auto;
	animation: spin 0.8s linear infinite;
}

.loader-text {
	font-size: 13px;
	color: #777;
}

.print-header,
.print-panel,
.print-preview-panel {
	border-radius: var(--radius-large);
}

.upload-drop,
.result-card > div,
.upload-card {
	border-radius: var(--radius-medium);
}

.print-select,
.print-button,
.input-group input,
.delete-upload,
.upload-preview {
	border-radius: var(--radius-small);
}

.upload-drop-disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.upload-controls-size {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.quantity-stepper {
	display: grid;
	grid-template-columns: 36px 52px 36px;
	gap: 6px;
}

.quantity-stepper input {
	width: 52px;
	text-align: center;
}

.quantity-stepper button {
	height: 36px;
	border: 1px solid #deded8;
	background: #eeeeea;
	border-radius: 9px;
	font-size: 16px;
	cursor: pointer;
}

.upload-size-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.upload-action-row {
	display: grid;
	grid-template-columns: 170px 60px;
	gap: 12px;
	align-items: end;
}

.upload-delete-wrap {
	display: flex;
	justify-content: flex-end;
}

.upload-reference-row {
	margin-bottom: 12px;
}

.item-reference {
	width: 100%;
	height: 36px;
	border: 1px solid #deded8;
	border-radius: 11px;
	padding: 0 9px;
	font-size: 14px;
	background: #fff;
}

.film-wrap {
	background: #fafaf8;
	border: 1px solid #ecece7;
	border-radius: var(--radius-medium);
	padding: 16px;
}

.film-topline {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.film-title {
	font-size: 15px;
	font-weight: bold;
}

.film-note,
.film-width {
	font-size: 12px;
	color: #888;
	margin-top: 3px;
}

.film-stage {
	position: relative;
	display: grid;
	grid-template-columns: 58px 1fr;
	grid-template-rows: 34px 1fr;
	height: 70vh;
	min-height: 520px;
	overflow: auto;
	background: #f2f2ef;
	border: 1px solid #deded8;
	border-radius: var(--radius-small);
}

.film-ruler-x {
	grid-column: 2;
	grid-row: 1;
	position: sticky;
	top: 0;
	z-index: 10;
	height: 34px;
	background: #f2f2ef;
	border-bottom: 1px solid #d8d8d2;
	overflow: hidden;
}

.film-ruler-y {
	grid-column: 1;
	grid-row: 2;
	position: sticky;
	left: 0;
	z-index: 10;
	width: 58px;
	background: #f2f2ef;
	border-right: 1px solid #d8d8d2;
	overflow: hidden;
}

.film-scroll {
	grid-column: 2;
	grid-row: 2;
	overflow: visible;
	padding: 0;
}

.film-preview {
	position: relative;
	border: 2px solid #666;
	border-radius: 4px;
	overflow: visible;
	background: #ececea;
}

.film-item {
	position: absolute;
	border: 1px dashed rgba(80,80,80,0.45);
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 2px;
}

.film-item img {
	display: block;
	object-fit: contain;
}

.ruler-tick-x {
	position: absolute;
	top: 0;
	height: 34px;
	border-left: 1px solid #aaa;
	font-size: 10px;
	color: #777;
	padding-left: 3px;
	padding-top: 10px;
	white-space: nowrap;
}

.ruler-tick-y {
	position: absolute;
	right: 0;
	width: 58px;
	border-top: 1px solid #aaa;
	font-size: 10px;
	color: #777;
	padding-top: 2px;
	padding-right: 5px;
	text-align: right;
}

.film-empty {
	position: absolute;
	left: 20px;
	top: 20px;
	color: #666;
	font-size: 14px;
	background: rgba(255,255,255,0.65);
	border-radius: var(--radius-small);
	padding: 10px 14px;
}

.film-end-label {
	position: absolute;
	top: 6px;
	background: #333;
	color: #fff;
	font-size: 11px;
	padding: 3px 6px;
	border-radius: 3px;
	z-index: 5;
	pointer-events: none;
}

.film-image-normal {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: fill;
	background: transparent;
}

.film-image-rotated {
	position: absolute;
	left: 50%;
	top: 50%;
	display: block;
	object-fit: fill;
	background: transparent;
	transform: translate(-50%, -50%) rotate(90deg);
	transform-origin: center center;
	max-width: none;
	max-height: none;
}

.result-sub {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	font-weight: normal;
	color: #888;
	letter-spacing: 0;
}

/* DECAL-LÄGE */

.film-preview-decal {
	border: 1px dashed rgba(0,0,0,0.55);
	background:
		linear-gradient(45deg, #e1e1e1 25%, transparent 25%),
		linear-gradient(-45deg, #e1e1e1 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e1e1e1 75%),
		linear-gradient(-45deg, transparent 75%, #e1e1e1 75%);
	background-size: 18px 18px;
	background-position: 0 0, 0 9px, 9px -9px, -9px 0;
	background-color: #f4f4f4;
}

.film-preview-decal:before,
.film-preview-decal:after {
	content: "";
	position: absolute;
	width: 9px;
	height: 9px;
	border-radius: 999px;
	background: #111;
	z-index: 15;
}

.film-preview-decal:before {
	left: -5px;
	top: -5px;
}

.film-preview-decal:after {
	right: -5px;
	bottom: -5px;
}

.decal-preview-item {
	inset: 0;
	border: 0;
	background: transparent;
	padding: 2px;
}

.decal-preview-item img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.decal-size-badge {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	background: #111;
	color: #fff;
	border-radius: 8px;
	padding: 10px 12px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.18);
	pointer-events: none;
}

.decal-size-badge span {
	display: block;
	font-size: 11px;
	font-weight: normal;
	color: rgba(255,255,255,0.75);
	margin-bottom: 3px;
}

.decal-size-badge strong {
	display: block;
	font-size: 18px;
	line-height: 1;
}

.decal-ruler-tick {
	border-color: #b8b8b2;
	color: transparent;
}

.decal-ruler-tick-major {
	border-color: #333;
	color: #444;
	font-size: 12px;
	font-weight: 500;
}

.film-stage-decal {
	grid-template-columns: 130px 1fr;
	grid-template-rows: 58px 1fr;
	height: auto;
	min-height: 620px;
	padding: 42px 42px 64px 42px;
	background: #ffffff;
	border-radius: 14px;
}

.film-stage-decal .film-ruler-x,
.film-stage-decal .film-ruler-y {
	background: transparent;
	border: 0;
	overflow: visible;
}

.film-stage-decal .film-ruler-x {
	margin-left: -45px;
}

.film-stage-decal .film-scroll {
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;

	padding: 0 90px 90px 0;
	margin-left: -45px;
}

.film-stage-decal .ruler-tick-x {
	height: 7px;
	padding: 0;
	border-left-color: #bdbdb8;
	opacity: 1;
	font-size: 0;
}

.film-stage-decal .ruler-tick-y {
	width: 7px;
	padding: 0;
	border-top-color: #bdbdb8;
	opacity: 1;
	font-size: 0;
}

.film-stage-decal .decal-ruler-tick-major {
	border-color: #111;
	color: #222;
	font-size: 12px;
	font-weight: 500;
	opacity: 1;
}

.film-stage-decal .ruler-tick-x.decal-ruler-tick-major {
	height: 20px;
	transform: translateY(-18px);
	padding-left: 5px;
}

.film-stage-decal .ruler-tick-y.decal-ruler-tick-major {
	width: 52px;
	transform: translateX(-26px);
	padding-right: 8px;
	text-align: right;
}

.film-stage-decal .decal-size-badge {
	top: auto;
	right: 0;
	bottom: -72px;
	transform: none;
}

.decal-size-badge,
.decal-size-badge span,
.decal-size-badge strong {
	color: #ffffff;
}

.decal-size-badge span {
	color: rgba(255,255,255,0.75);
}

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

@media (max-width: 950px) {
	.print-page {
		padding: 12px;
	}

	.print-grid {
		grid-template-columns: 1fr;
	}

	.print-header {
		border-radius: 18px;
		padding: 20px;
	}

	.print-header h1 {
		font-size: 28px;
	}

	.print-panel,
	.print-preview-panel {
		border-radius: 18px;
		padding: 16px;
	}

	.result-card {
		grid-template-columns: 1fr;
	}
}