/* SM Designer – Oberfläche nach CI-Regelwerk (13.11.2026). Mobil zuerst. */
.smd-noscroll,
.smd-noscroll body {
	overflow: hidden !important;
}

.smd-overlay {
	--smd-red: #B20000;
	--smd-anthrazit: #111111;
	--smd-text: #4A4A4A;
	--smd-muted: #595959;
	--smd-line: #D9D9D6;
	--smd-light: #F6F6F6;
	--smd-warm: #F4F3F1;
	--smd-ok: #1E7B34;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: #FFFFFF;
	color: var(--smd-text);
	font-family: 'Source Sans 3', system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

.smd-overlay *,
.smd-overlay *::before,
.smd-overlay *::after {
	box-sizing: border-box;
}

/* Theme-Vorgaben (z. B. Flatsome: Großbuchstaben, Ränder) für Knöpfe im Designer neutralisieren */
.smd-overlay button {
	margin: 0;
	letter-spacing: normal;
	text-transform: none;
}

.smd-overlay :focus-visible {
	outline: 2px solid var(--smd-red);
	outline-offset: 2px;
}

.smd-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px 8px 16px;
	border-bottom: 1px solid var(--smd-line);
}

.smd-logo {
	display: block;
	height: 44px;
	width: auto;
	object-fit: contain;
}

.smd-brand {
	font-weight: 600;
	color: var(--smd-anthrazit);
	white-space: nowrap;
}

.smd-title {
	flex: 1;
	padding-left: 12px;
	border-left: 1px solid var(--smd-line);
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--smd-anthrazit);
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.smd-close {
	min-width: 44px;
	min-height: 44px;
	border: 0;
	border-radius: 99px;
	background: transparent;
	color: var(--smd-anthrazit);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.smd-save {
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--smd-anthrazit);
	border-radius: 99px;
	background: #FFFFFF;
	color: var(--smd-anthrazit);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.smd-save .smd-icon {
	display: none;
}

.smd-save:hover {
	background: var(--smd-light);
}

/* Fertig: Vorschau prüfen und in den Warenkorb (Hauptknopf) */
.smd-cart {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 18px 0 14px;
	border: 0;
	border-radius: 99px;
	background: var(--smd-red);
	color: #FFFFFF;
	font: inherit;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.smd-cart .smd-icon {
	width: 22px;
	height: 22px;
	stroke: currentColor;
}

.smd-cart:hover {
	background: #8F0000;
}

.smd-cart-short {
	display: none;
}

/* Studio bearbeitet ein Design: kein Warenkorb */
.is-studio .smd-cart {
	display: none;
}

.smd-save:disabled,
.smd-cart:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Vorschau vor dem Warenkorb */
.smd-confirm .smd-confirm-img {
	width: auto;
	max-width: 100%;
	max-height: 58vh;
	margin: 8px auto;
	background: var(--smd-warm);
}

.smd-confirm-check {
	margin: 12px 0;
	padding: 12px;
	border: 1px solid var(--smd-line);
	border-radius: 8px;
	background: var(--smd-warm);
}

.smd-confirm-warn {
	margin: 4px 0;
	padding: 8px 12px;
	border-left: 4px solid #FFCE00;
	background: #FFF8D6;
	color: var(--smd-anthrazit);
}

.smd-fixlist {
	margin: 8px 0 16px 20px;
	padding: 0;
}

.smd-fixlist li {
	margin-bottom: 6px;
}

/* Produktseite: Designer-Varianten nur über „Jetzt gestalten“ (gesperrt wird zusätzlich auf dem Server) */
form.cart.smd-needs-design .single_add_to_cart_button,
body.smd-needs-design .wc-block-components-express-payment,
body.smd-needs-design .ppc-button-wrapper,
body.smd-needs-design #ppc-button-ppcp-gateway,
body.smd-needs-design #wc-stripe-payment-request-wrapper,
body.smd-needs-design #wc-stripe-express-checkout-element,
body.smd-needs-design .wcpay-payment-request-wrapper,
body.smd-needs-design #wcpay-express-checkout-element,
body.smd-needs-design #payment-request-button {
	display: none !important;
}

.smd-close:hover {
	background: var(--smd-light);
}

.smd-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.smd-main {
	order: 1;
	flex: 1;
	min-height: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	background: var(--smd-warm);
}

.smd-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	touch-action: none;
}

/* 1.1.0: Modell und Oberfläche wechseln (über der Fläche) */
.smd-variant {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 16px;
	width: 100%;
	padding: 6px 12px 0;
	box-sizing: border-box;
	font-size: 0.875rem;
}

.smd-variant-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.smd-variant-label {
	color: var(--smd-muted);
}

.smd-variant-model {
	max-width: 220px;
	min-height: 36px;
	padding: 4px 8px;
	border: 1px solid var(--smd-line);
	border-radius: 6px;
	background: #fff;
	color: var(--smd-anthrazit);
	font: inherit;
}

.smd-variant-surface {
	gap: 0;
}

.smd-variant-surface .smd-variant-label {
	margin-right: 6px;
}

.smd-seg {
	min-height: 36px;
	padding: 4px 12px;
	border: 1px solid var(--smd-anthrazit);
	background: #fff;
	color: var(--smd-anthrazit);
	font: inherit;
	cursor: pointer;
}

.smd-seg + .smd-seg {
	border-left: 0;
}

.smd-seg:first-of-type {
	border-radius: 6px 0 0 6px;
}

.smd-seg:last-of-type {
	border-radius: 0 6px 6px 0;
}

.smd-seg[aria-pressed="true"] {
	background: var(--smd-anthrazit);
	color: #fff;
}

/* Legende zu den Hilfslinien */
.smd-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 16px;
	margin: 0;
	padding: 4px 12px 0;
	list-style: none;
	font-size: 0.875rem;
	color: var(--smd-muted);
}

.smd-legend[hidden] {
	display: none;
}

.smd-legend li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.smd-legend li::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 0;
	border-top: 2px dashed var(--smd-anthrazit);
}

.smd-legend .smd-leg-safe::before {
	border-top-color: var(--smd-ok);
	border-top-style: dotted;
}

.smd-legend .smd-leg-edge::before {
	height: 12px;
	border: 0;
	background: rgba(17, 17, 17, 0.25);
}

.smd-status,
.smd-quality {
	margin: 0;
	padding: 4px 16px;
	font-size: 0.9375rem;
	color: var(--smd-muted);
	text-align: center;
	min-height: 1.6em;
}

.smd-quality {
	font-weight: 600;
}

.smd-quality.is-good { color: var(--smd-ok); }
.smd-quality.is-warn { color: #7A5A00; }
.smd-quality.is-bad  { color: var(--smd-red); }

.smd-q-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.4em;
	height: 1.4em;
	border-radius: 99px;
	color: #FFFFFF;
	font-size: 0.8em;
}

.is-good .smd-q-icon { background: var(--smd-ok); }
.is-warn .smd-q-icon { background: #7A5A00; }
.is-bad  .smd-q-icon { background: var(--smd-red); }

/* Panel: mobil als Leiste über den Werkzeugen, Desktop rechts. */
.smd-panel {
	order: 2;
	display: none;
	flex-direction: column;
	border-top: 1px solid var(--smd-line);
	max-height: 46vh;
	background: #FFFFFF;
}

.smd-panel.is-open {
	display: flex;
}

/* Kopf des Klappfensters: Zurück-Knopf + Titel (hell, rote Linie unten) */
.smd-panel-head {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	padding: 8px 12px;
	background: var(--smd-warm);
	border-bottom: 3px solid var(--smd-red);
	color: var(--smd-anthrazit);
}

.smd-overlay .smd-panel-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0;
	border: 2px solid var(--smd-anthrazit);
	border-radius: 99px;
	background: #FFFFFF;
	color: var(--smd-anthrazit);
	cursor: pointer;
}

.smd-overlay .smd-panel-back .smd-icon {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	stroke-width: 2.25;
}

.smd-overlay .smd-panel-back:hover {
	background: var(--smd-anthrazit);
	color: #FFFFFF;
}

.smd-panel-title {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	color: inherit;
}

.smd-panel-body {
	flex: 1 1 auto;
	overflow: auto;
	padding: 8px 16px 16px;
}

.smd-label {
	display: block;
	margin: 10px 0 4px;
	font-weight: 600;
	color: var(--smd-anthrazit);
}

.smd-input {
	width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--smd-line);
	border-radius: 0;
	font: inherit;
	color: var(--smd-anthrazit);
}

.smd-textarea {
	display: block;
	min-height: 44px;
	line-height: 1.35;
	resize: vertical;
}

.smd-panel input[type="range"] {
	width: 100%;
	min-height: 44px;
	accent-color: var(--smd-red);
}

.smd-help {
	margin: 8px 0;
	font-size: 0.9375rem;
	color: var(--smd-muted);
}

.smd-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.smd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 18px;
	border: 2px solid var(--smd-anthrazit);
	border-radius: 99px;
	background: #FFFFFF;
	color: var(--smd-anthrazit);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.smd-btn:hover,
.smd-btn[aria-pressed="true"] {
	background: var(--smd-anthrazit);
	color: #FFFFFF;
}

.smd-btn-primary {
	border-color: var(--smd-red);
	background: var(--smd-red);
	color: #FFFFFF;
}

.smd-btn-primary:hover {
	border-color: var(--smd-anthrazit);
	background: var(--smd-anthrazit);
	color: #FFFFFF;
}

.smd-btn-danger {
	border-color: var(--smd-red);
	color: var(--smd-red);
}

.smd-file {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.smd-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.smd-swatch,
.smd-color {
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--smd-line);
	border-radius: 99px;
	cursor: pointer;
	background: #FFFFFF;
}

.smd-color {
	-webkit-appearance: none;
	appearance: none;
	background: conic-gradient(#FF0000, #FFFF00, #00FF00, #00FFFF, #0000FF, #FF00FF, #FF0000);
	overflow: hidden;
}

.smd-color::-webkit-color-swatch-wrapper {
	padding: 0;
}

.smd-color::-webkit-color-swatch {
	border: 0;
	opacity: 0;
}

.smd-color::-moz-color-swatch {
	border: 0;
	opacity: 0;
}

.smd-swatch-none {
	background: linear-gradient(135deg, #FFFFFF 45%, var(--smd-red) 45%, var(--smd-red) 55%, #FFFFFF 55%);
}

/* Werkzeugleiste: Handy unten (Daumenbereich), ab 900 px links */
.smd-tools {
	order: 3;
	display: flex;
	gap: 4px;
	padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--smd-line);
	overflow-x: auto;
	background: #FFFFFF;
}

.smd-tool {
	flex: 1 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 64px;
	min-height: 52px;
	padding: 4px 8px;
	border: 0;
	border-radius: 12px;
	font-size: 0.8125rem;
	line-height: 1.2;
	background: transparent;
	color: var(--smd-anthrazit);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.smd-tool:hover {
	background: var(--smd-light);
}

.smd-icon {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Umschalter (Hilfslinien): an = Anthrazit-Rahmen, aus = blasser Text */
.smd-tool[aria-pressed="true"] {
	box-shadow: inset 0 0 0 2px var(--smd-anthrazit);
}

.smd-tool[aria-pressed="false"] {
	color: var(--smd-muted);
	font-weight: 400;
}

.smd-tool-print {
	color: var(--smd-muted);
	font-weight: 400;
}

/* Vorschau-Fenster */
.smd-modal {
	position: absolute;
	inset: 0;
	z-index: 20; /* über den Hinweisen (.smd-notes, z-index 5) */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: rgba(17, 17, 17, 0.6);
}

.smd-modal-box {
	width: min(960px, 100%);
	max-height: 100%;
	overflow: auto;
	padding: 12px 16px 16px;
	background: #FFFFFF;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.smd-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.smd-modal-head h3 {
	flex: 1;
}

.smd-modal-logo {
	display: block;
	height: 56px;
	width: auto;
}

.smd-modal-head h3 {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--smd-anthrazit);
}

.smd-preview-img,
.smd-print-img {
	display: block;
	width: 100%;
	height: auto;
	margin: 8px 0;
}

.smd-print-img {
	max-height: 70vh;
	width: auto;
	margin: 8px auto;
	background: repeating-conic-gradient(#EEE 0 25%, #FFF 0 50%) 0 0 / 20px 20px;
}

/* Handy: alle Werkzeuge in einer Reihe, Logo kleiner */
@media (max-width: 899px) {
	.smd-tool {
		flex: 1 1 0;
		min-width: 0;
		padding: 4px 2px;
		font-size: 0.75rem;
		line-height: 1.15;
		hyphens: manual;
	}

	/* Test-Druckdatei nur für Shop-Manager, am Handy nicht nötig */
	.smd-tool-print {
		display: none;
	}

	.smd-legend {
		font-size: 0.75rem;
	}

	.smd-variant {
		font-size: 0.8125rem;
		gap: 4px 10px;
		padding-top: 4px;
	}

	.smd-variant-model {
		max-width: 160px;
		min-height: 32px;
	}

	.smd-seg {
		min-height: 32px;
		padding: 2px 10px;
	}

	.smd-logo {
		height: 38px;
	}

	.smd-title {
		font-size: 0.875rem;
	}
}

/* Schmale Handys: Platz für Logo, Speichern und Schließen */
@media (max-width: 479px) {
	.smd-title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.smd-head {
		justify-content: space-between;
	}

	.smd-logo {
		margin-right: auto;
	}

	.smd-head {
		gap: 6px;
		padding-left: 10px;
		padding-right: 6px;
	}

	.smd-save {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 44px;
		padding: 0;
	}

	.smd-save .smd-icon {
		display: block;
	}

	.smd-save-label,
	.smd-title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.smd-logo {
		height: 34px;
	}

	.smd-overlay .smd-close {
		min-width: 40px;
	}

	.smd-cart {
		padding: 0 12px 0 10px;
	}

	.smd-cart-long {
		display: none;
	}

	.smd-cart-short {
		display: inline;
	}
}

/* Desktop / Tablet quer */
@media (min-width: 900px) {
	.smd-body {
		flex-direction: row;
	}

	/* Klappfenster direkt rechts neben der Werkzeugleiste */
	.smd-panel {
		order: 1;
		flex: 0 0 340px;
		width: 340px;
		max-height: none;
		border-top: 0;
		border-right: 1px solid var(--smd-line);
		box-shadow: 4px 0 12px rgba(0, 0, 0, 0.06);
	}

	.smd-main {
		order: 2;
	}

	.smd-tools {
		order: 0;
		flex: 0 0 104px;
		flex-direction: column;
		gap: 6px;
		padding: 12px 8px;
		border-top: 0;
		border-right: 1px solid var(--smd-line);
		overflow-x: hidden;
		overflow-y: auto;
	}

	.smd-tool {
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
		min-height: 64px;
		text-align: center;
	}
}

/* Ebenen-Liste: Name als eigene Zeile, darunter kleine Symbol-Knöpfe */
.smd-layers {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	border-top: 1px solid var(--smd-line);
}

.smd-layer {
	display: block;
	padding: 6px 4px 8px 8px;
	border-bottom: 1px solid var(--smd-line);
}

.smd-layer.is-active {
	box-shadow: inset 4px 0 0 var(--smd-red);
	background: var(--smd-light);
}

.smd-overlay .smd-layer-name {
	display: block;
	width: 100%;
	min-height: 32px;
	margin: 0;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: var(--smd-anthrazit);
	font: inherit;
	font-weight: 600;
	text-align: left;
	text-transform: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

.smd-layer.is-locked .smd-layer-name {
	color: var(--smd-muted);
}

.smd-layer-tools {
	display: flex;
	gap: 8px;
	padding: 2px 4px 0;
}

.smd-overlay .smd-layer-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-height: 36px;
	margin: 0;
	padding: 0;
	border: 1.5px solid var(--smd-line);
	border-radius: 99px;
	background: #FFFFFF;
	color: var(--smd-anthrazit);
	cursor: pointer;
}

.smd-overlay .smd-layer-btn .smd-icon {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	stroke-width: 2;
}

.smd-overlay .smd-layer-btn:hover:not([disabled]) {
	border-color: var(--smd-anthrazit);
}

.smd-overlay .smd-layer-btn[disabled] {
	opacity: 0.35;
	cursor: default;
}

.smd-overlay .smd-layer-btn.is-locked {
	border-color: var(--smd-anthrazit);
	background: var(--smd-anthrazit);
	color: #FFFFFF;
}

/* Start-Knopf auf der Produktseite */
.smd-start[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Gespeicherte Entwürfe auf der Produktseite (außerhalb des Designers) */
.smd-draftlist {
	margin: 12px 0;
	padding: 12px 16px;
	border: 1px solid #D9D9D6;
	border-radius: 4px;
	background: #F4F3F1;
	font-family: 'Source Sans 3', system-ui, sans-serif;
}

.smd-draftlist-title {
	margin: 0 0 6px;
	font-weight: 600;
	color: #111111;
}

.smd-draftlist-hint {
	margin: 0 0 8px;
	font-size: 0.875rem;
	color: #595959;
}

.smd-draftlist ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.smd-draftlist li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
}

.smd-draftlist .button {
	margin: 0;
}

/* Aktives Werkzeug */
.smd-tool.is-active {
	background: var(--smd-light);
	color: var(--smd-red);
	box-shadow: inset 3px 0 0 var(--smd-red);
}

@media (max-width: 899px) {
	.smd-tool.is-active {
		box-shadow: inset 0 3px 0 var(--smd-red);
	}
}

/* Rückgängig / Wiederherstellen in der Kopfzeile */
.smd-history {
	display: flex;
	gap: 2px;
	margin-left: auto;
}

.smd-hist {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 2px 8px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--smd-anthrazit);
	font: inherit;
	font-size: 0.75rem;
	line-height: 1.1;
	cursor: pointer;
}

.smd-hist:hover:not(:disabled) {
	background: var(--smd-light);
}

.smd-hist:disabled {
	color: #B5B5B5;
	cursor: default;
}

@media (max-width: 899px) {
	.smd-hist-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.smd-hist {
		min-width: 40px;
		padding: 2px;
	}
}

/* Hinweis: ganze Fläche füllen */
.smd-edge {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	max-width: 640px;
	margin: 6px 12px 0;
	padding: 8px 12px;
	border-left: 4px solid var(--smd-red);
	background: #FFFFFF;
	color: var(--smd-anthrazit);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
}

.smd-edge[hidden] {
	display: none;
}

.smd-edge-icon {
	flex: 0 0 22px;
	height: 22px;
	border-radius: 99px;
	background: var(--smd-red);
	color: #FFFFFF;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

.smd-edge.is-warn {
	background: #FBE9E9;
	color: var(--smd-red);
}

/* Text: Größe, Ausrichtung, Reiter, Farbpalette */
.smd-size {
	display: flex;
	align-items: center;
	gap: 6px;
}

.smd-size input[type="range"] {
	flex: 1 1 auto;
	min-width: 0;
}

.smd-step {
	flex: 0 0 44px;
	min-width: 44px;
	padding: 0;
	font-size: 1.25rem;
}

.smd-size-val {
	flex: 0 0 auto;
	min-width: 56px;
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--smd-anthrazit);
}

.smd-textfmt {
	margin-top: 10px;
}

.smd-icon-btn {
	min-width: 48px;
	padding: 0 10px;
}

.smd-icon-btn[aria-pressed="true"] {
	background: var(--smd-anthrazit);
	color: #FFFFFF;
}

.smd-bold {
	font-weight: 700;
	font-size: 1.125rem;
}

.smd-tabs {
	display: flex;
	margin: 14px 0 8px;
	border-bottom: 1px solid var(--smd-line);
}

.smd-tab {
	flex: 1 1 0;
	min-height: 44px;
	border: 0;
	border-bottom: 3px solid transparent;
	background: transparent;
	color: var(--smd-muted);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.smd-tab[aria-selected="true"] {
	border-bottom-color: var(--smd-red);
	color: var(--smd-anthrazit);
}

.smd-palette {
	display: grid;
	grid-template-columns: repeat(5, 44px);
	gap: 8px;
	justify-content: center;
}

.smd-swatch[aria-pressed="true"] {
	box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--smd-anthrazit);
}

/* Handy: Hinweise kompakt, damit die Hülle genug Platz behält */
@media (max-width: 899px) {
	.smd-edge,
	.smd-quality,
	.smd-status {
		font-size: 0.8125rem;
		line-height: 1.3;
		padding-top: 4px;
		padding-bottom: 4px;
	}

	.smd-edge {
		margin: 4px 8px 0;
	}

	.smd-status:empty {
		display: none;
	}

	.smd-overlay.has-panel .smd-legend,
	.smd-overlay.has-panel .smd-variant {
		display: none;
	}

	.smd-panel {
		max-height: 40vh;
	}

	.smd-panel-head {
		padding: 6px 12px;
	}
}

.smd-edge-fill {
	margin-left: auto;
	flex: 0 0 auto;
	min-height: 36px;
	padding: 4px 12px;
	border: 2px solid var(--smd-red);
	border-radius: 99px;
	background: #FFFFFF;
	color: var(--smd-red);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.smd-edge:not(.is-warn) .smd-edge-fill {
	display: none;
}

/* P3: Legende passend zu den Hilfslinien (nie nur Farbe, immer mit Text) */
.smd-legend .smd-leg-back::before {
	border-top-style: solid;
}

.smd-legend .smd-leg-safe::before {
	border-top-style: dashed;
}

.smd-legend .smd-leg-edge::before {
	background: rgba(17, 17, 17, 0.18);
}

.smd-legend .smd-leg-edge.is-bleed::before {
	background: repeating-linear-gradient(-45deg, rgba(17, 17, 17, 0.55) 0 2px, rgba(17, 17, 17, 0.12) 2px 5px);
}

.smd-legend .smd-leg-cut::before {
	height: 12px;
	border: 1.5px solid var(--smd-red);
	background: repeating-linear-gradient(-45deg, rgba(178, 0, 0, 0.6) 0 2px, transparent 2px 5px);
}

/* 0.20.1: Hinweise liegen über der Fläche und verändern ihre Größe nicht (kein Wackeln beim Ziehen) */
.smd-notes {
	position: absolute;
	bottom: 8px;
	left: 0;
	right: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
}

.smd-notes > * {
	pointer-events: auto;
	box-shadow: 0 2px 8px rgba(17, 17, 17, 0.12);
}

/* P3: Hinweis bei Regelverstoß (z. B. Text außerhalb des Sicherheitsbereichs) */
.smd-rules {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 8px 16px 0;
	padding: 8px 12px;
	border-left: 4px solid var(--smd-red);
	border-radius: 4px;
	background: #FDECEC;
	color: var(--smd-anthrazit);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
}

.smd-rules[hidden] {
	display: none;
}

.smd-rules-text {
	flex: 1 1 auto;
}

.smd-overlay .smd-rules-fix {
	flex: 0 0 auto;
	min-height: 36px;
	padding: 4px 12px;
	border: 2px solid var(--smd-red);
	border-radius: 99px;
	background: #FFFFFF;
	color: var(--smd-red);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.smd-overlay .smd-rules-fix[hidden] {
	display: none;
}

@media (max-width: 899px) {
	.smd-rules {
		margin: 4px 8px 0;
		padding: 6px 8px;
		font-size: 0.8125rem;
	}
}

/* M5: Designs (Vorlagen-Designs) */
.smd-overlay.is-template .smd-tool-background,
.smd-overlay.is-template .smd-tool-layers {
	display: none;
}

.smd-layouts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 8px 0 12px;
}

.smd-layouts > .smd-help,
.smd-layouts-cat {
	grid-column: 1 / -1;
}

.smd-layouts-cat {
	margin: 8px 0 0;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--smd-anthrazit);
}

.smd-layout {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.smd-overlay .smd-layout-pick {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	width: 100%;
	margin: 0;
	padding: 6px;
	border: 2px solid var(--smd-line);
	border-radius: 8px;
	background: #FFFFFF;
	color: var(--smd-anthrazit);
	font: inherit;
	cursor: pointer;
}

.smd-overlay .smd-layout-pick:hover {
	border-color: var(--smd-anthrazit);
}

.smd-layout.is-current .smd-layout-pick {
	border-color: var(--smd-red);
	box-shadow: 0 0 0 1px var(--smd-red);
}

.smd-layout-pick img,
.smd-layout-nothumb {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	border-radius: 4px;
	background: var(--smd-warm);
}

.smd-layout-nothumb {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
	font-weight: 700;
	color: var(--smd-muted);
}

.smd-layout-name {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 1.8.0: Aufpreis am Design */
.smd-layout-price {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--smd-muted);
	text-align: left;
}

.smd-confirm-price {
	font-weight: 600;
}

.smd-layout-badge {
	font-size: 0.75rem;
	color: var(--smd-red);
}

.smd-layout-badge.is-ok {
	color: var(--smd-ok);
}

.smd-overlay .smd-linkbtn {
	display: inline-block;
	margin: 4px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--smd-red);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	text-align: left;
	text-decoration: underline;
	cursor: pointer;
}

.smd-studio {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	margin-top: 12px;
	padding: 12px;
	border: 2px dashed var(--smd-line);
	border-radius: 8px;
	background: var(--smd-light);
}

.smd-studio .smd-input {
	width: 100%;
}

.smd-studio-title {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--smd-anthrazit);
}

.smd-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 600;
	color: var(--smd-anthrazit);
	cursor: pointer;
}

.smd-check input {
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	flex: 0 0 auto;
}

.smd-strong {
	font-weight: 700;
	color: var(--smd-anthrazit);
}

.smd-overlay .smd-input-num {
	width: 6em;
}

@media (min-width: 900px) {
	.smd-layouts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Sehr schmale Handys (320 px): Warenkorb nur als Symbol */
@media (max-width: 359px) {
	.smd-cart {
		padding: 0 12px;
	}

	.smd-cart-short {
		display: none !important;
	}
}

/* Handy: Vorschau kleiner, damit Haken und Knopf ohne Scrollen sichtbar sind */
@media (max-width: 899px) {
	.smd-confirm .smd-confirm-img {
		max-height: 40vh;
	}
}

/* ---------- Bibliothek: Grafiken und Hintergrundbilder (M6) ---------- */

.smd-overlay .smd-sub {
	margin: 12px 0 6px;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--smd-anthrazit);
}

.smd-lib-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 4px 0 10px;
}

.smd-overlay .smd-chip {
	margin: 0;
	padding: 4px 10px;
	border: 1px solid var(--smd-line);
	border-radius: 999px;
	background: #FFFFFF;
	color: var(--smd-anthrazit);
	font: inherit;
	font-size: 0.8125rem;
	line-height: 1.4;
	cursor: pointer;
}

.smd-overlay .smd-chip.is-active {
	border-color: var(--smd-anthrazit);
	background: var(--smd-anthrazit);
	color: #FFFFFF;
}

.smd-lib-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.smd-overlay .smd-lib-item {
	margin: 0;
	padding: 4px;
	border: 2px solid var(--smd-line);
	border-radius: 8px;
	background: var(--smd-warm);
	cursor: pointer;
}

.smd-overlay .smd-lib-item:hover,
.smd-overlay .smd-lib-item:focus-visible {
	border-color: var(--smd-anthrazit);
}

.smd-lib-item img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
}

@media (max-width: 479px) {
	.smd-lib-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* 0.14.0: Kunden-Felder (Vorgaben im Studio, Zähler beim Kunden) */
.smd-overlay .smd-fieldlist { margin: 4px 0 8px 18px; padding: 0; font-size: 13px; line-height: 1.5; }
.smd-overlay .smd-count { margin-top: 2px; font-size: 12px; color: #666; min-height: 1em; }
.smd-overlay .smd-studio-field .smd-check { display: flex; margin: 4px 0; }

/* 0.15.0: Fotofilter */
.smd-overlay .smd-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin: 4px 0 10px; }
.smd-overlay .smd-filter { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; border: 2px solid transparent; border-radius: 6px; background: #fff; color: #111111; font: inherit; font-size: 11px; line-height: 1.2; cursor: pointer; text-transform: none; letter-spacing: 0; min-height: 0; margin: 0; box-shadow: none; }
.smd-overlay .smd-filter img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; display: block; }
.smd-overlay .smd-filter[aria-pressed="true"] { border-color: #B20000; }
.smd-overlay .smd-filter:focus-visible { outline: 2px solid #B20000; outline-offset: 2px; }
.smd-overlay .smd-filter-amount[hidden] { display: none; }
.smd-overlay .smd-filter-amount input[type="range"] { flex: 1; }

/* 0.17.0: Logo als Link zum Shop */
.smd-overlay .smd-logo-link { display: inline-flex; align-items: center; line-height: 0; border-radius: 4px; }
.smd-overlay .smd-logo-link:focus-visible { outline: 2px solid #B20000; outline-offset: 3px; }

/* 0.19.0: Schriften, Kursiv, Bogen */
.smd-overlay .smd-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; margin: 4px 0 10px; }
.smd-overlay .smd-font { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 2px solid var(--smd-line, #ddd); border-radius: 6px; background: #fff; color: #111111; font-size: 18px; line-height: 1.15; cursor: pointer; text-transform: none; letter-spacing: 0; min-height: 0; margin: 0; box-shadow: none; text-align: left; }
.smd-overlay .smd-font-kind { font-family: 'Source Sans 3', sans-serif; font-size: 11px; color: #666; }
.smd-overlay .smd-font[aria-pressed="true"] { border-color: #B20000; }
.smd-overlay .smd-font:focus-visible { outline: 2px solid #B20000; outline-offset: 2px; }
.smd-overlay .smd-italic { font-style: italic; font-family: Georgia, serif; font-size: 1.125rem; }
.smd-overlay .smd-icon-btn:disabled, .smd-overlay .smd-tab:disabled { opacity: 0.35; cursor: not-allowed; }
.smd-overlay .smd-arc-reset { min-width: 64px; width: auto; padding: 0 12px; border-radius: 20px; font-size: 13px; }
/* 0.21.0: Schriftgruppen als Reiter */
.smd-overlay .smd-font-tabs { margin: 4px 0 8px; }
.smd-overlay .smd-font-tab { min-height: 40px; font-size: 0.875rem; padding: 0 4px; line-height: 1.2; }
/* B4 (0.21.0): Upload-Fehler bleibt sichtbar, mit zwei Knöpfen */
.smd-overlay .smd-upload-error { flex-wrap: wrap; }
.smd-overlay .smd-upload-error .smd-upload-remove { border-color: var(--smd-line); color: var(--smd-anthrazit); }

/* 1.2.0 (G8): Auswahl erlaubter Schriften und Farben je Textfeld */
.smd-choice-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 2px 10px;
	max-height: 220px;
	overflow-y: auto;
	padding: 6px 8px;
	border: 1px solid var(--smd-line);
	border-radius: 6px;
	background: #fff;
}

.smd-choice {
	font-size: 15px;
	min-height: 32px;
}

.smd-overlay .smd-swatch:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.smd-select {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 6px 10px;
	border: 1px solid var(--smd-line);
	border-radius: 6px;
	background: #fff;
	color: var(--smd-anthrazit);
	font-size: 17px;
}

/* 1.2.0 (N4): Foto in Form */
.smd-shapes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.smd-shape {
	width: 44px;
	height: 44px;
	padding: 7px;
	border: 1px solid var(--smd-line);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
}

.smd-shape svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: var(--smd-anthrazit);
}

.smd-shape img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: brightness(0); /* eigene Formen als Umriss wie die eingebauten */
	opacity: .9;
}

.smd-shape svg.is-none {
	fill: none;
	stroke: var(--smd-anthrazit);
	stroke-width: 6;
}

.smd-shape[aria-pressed="true"] {
	border-color: var(--smd-red);
	box-shadow: 0 0 0 2px var(--smd-red) inset;
}

.smd-shape[aria-pressed="true"] svg {
	fill: var(--smd-red);
}

.smd-shape[aria-pressed="true"] svg.is-none {
	fill: none;
	stroke: var(--smd-red);
}

/* 1.2.0 (G9): kurze Einführung */
.smd-help-btn {
	min-width: 40px;
	min-height: 40px;
	border: 1px solid var(--smd-line);
	border-radius: 99px;
	background: #fff;
	color: var(--smd-anthrazit);
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.smd-intro {
	margin: 12px 0 18px;
	padding: 0;
	list-style: none;
	counter-reset: smd-intro;
}

.smd-intro li {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 12px;
	font-size: 16px;
	line-height: 1.4;
}

.smd-intro-icon {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 99px;
	background: var(--smd-red);
	color: #fff;
}

.smd-intro-icon .smd-icon {
	width: 22px;
	height: 22px;
	stroke: currentColor;
}

.smd-intro-modal .smd-modal-box {
	max-width: 460px;
}

/* Handy: Platz in der Kopfzeile für „Schließen“; Einführung kommt beim ersten Öffnen von selbst */
@media (max-width: 479px) {
	.smd-help-btn {
		display: none;
	}
}
/* G7 (1.3.0): Schrift-Kachel zeigt den eigenen Text, „Mehr“-Fenster */
.smd-overlay .smd-font-sample { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }
.smd-overlay .smd-font-name { font-family: 'Source Sans 3', sans-serif; font-size: 11px; color: #666; }
.smd-overlay .smd-choice { display: flex; flex-direction: column; gap: 6px; }
.smd-overlay .smd-guides-opt { justify-content: flex-start; text-align: left; }
.smd-overlay .smd-guides-opt[aria-checked="true"] { border-color: #B20000; color: #B20000; font-weight: 600; }
.smd-overlay .smd-more-layers, .smd-overlay .smd-more-print { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-start; margin-bottom: 12px; }
.smd-overlay .smd-more-print { margin-top: 12px; }
.smd-overlay .smd-more-layers svg, .smd-overlay .smd-more-print svg { width: 20px; height: 20px; }
.smd-overlay .smd-font-meta { display: block; line-height: 1.2; }

/* 1.6.0 N9: Handy – Hülle groß, Bedienfeld klappt beim Bearbeiten weg, Hinweise klein über der Fläche */
.smd-panel-toggle {
	display: none;
}

@media (max-width: 899px) {
	.smd-overlay .smd-panel-toggle {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		margin: 0 0 0 auto;
		min-height: 40px;
		padding: 0 12px;
		border: 0;
		border-radius: 99px;
		background: transparent;
		color: var(--smd-anthrazit);
		font: inherit;
		font-size: 0.875rem;
		font-weight: 600;
		cursor: pointer;
	}

	.smd-panel-show {
		display: none;
	}

	.smd-overlay.is-peek .smd-panel-show {
		display: inline;
	}

	.smd-panel-chev {
		width: 10px;
		height: 10px;
		margin-top: -5px;
		border-right: 2.5px solid currentColor;
		border-bottom: 2.5px solid currentColor;
		transform: rotate(45deg);
	}

	.smd-overlay.is-peek .smd-panel-chev {
		margin-top: 5px;
		transform: rotate(-135deg);
	}

	/* Fläche oben verankern: klappt das Bedienfeld beim Antippen zu, wächst die Fläche nach unten,
	   die Zeichenfläche bleibt unter dem Finger stehen und wird erst nach dem Ziehen neu eingepasst. */
	.smd-stage {
		align-items: flex-start;
	}

	/* Zugeklappt: nur die Kopfzeile bleibt (Titel + „Einstellungen“) */
	.smd-overlay.is-peek .smd-panel-body {
		display: none;
	}

	.smd-overlay.is-peek .smd-panel-head {
		cursor: pointer;
	}

	/* Hinweise liegen klein oben über der Fläche statt darunter (die Fläche behält ihre Höhe) */
	.smd-main > .smd-quality,
	.smd-main > .smd-status {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		z-index: 4;
		max-width: calc(100% - 24px);
		min-height: 0;
		margin: 0;
		padding: 3px 10px;
		border-radius: 99px;
		background: rgba(255, 255, 255, 0.92);
		box-shadow: 0 1px 4px rgba(17, 17, 17, 0.12);
		font-size: 0.75rem;
		line-height: 1.3;
		pointer-events: none;
		box-sizing: border-box;
	}

	.smd-main > .smd-quality,
	.smd-main > .smd-status {
		top: calc(var(--smd-stage-top, 0px) + 6px);
	}

	.smd-main > .smd-quality:not([hidden]):not(.is-good) ~ .smd-status {
		top: calc(var(--smd-stage-top, 0px) + 34px);
	}

	/* 1.6.0 N10: Logo ist kein Link mehr; Abstand zu Rückgängig/Wiederholen */
	.smd-overlay .smd-logo-link {
		margin-right: 16px;
	}
}

/* N12 (1.7.0): Handy – weniger Hinweise, schmale Leiste für Modell und Oberfläche */
@media (max-width: 899px) {
	/* Qualität nur zeigen, wenn das Foto zu schwach ist */
	.smd-main > .smd-quality.is-good {
		display: none;
	}

	/* Beim Ziehen, Drehen und Zoomen sind die Hinweise weg, danach kommen sie wieder */
	.smd-overlay.is-busy .smd-main > .smd-quality,
	.smd-overlay.is-busy .smd-main > .smd-status,
	.smd-overlay.is-busy .smd-notes {
		visibility: hidden;
	}

	/* Modell links, Matt/Glänzend rechts, ohne Beschriftung, in einer Zeile */
	.smd-variant {
		flex-wrap: nowrap;
		justify-content: space-between;
		gap: 8px;
	}

	.smd-variant .smd-variant-label {
		display: none;
	}

	.smd-variant-item:not(.smd-variant-surface) {
		flex: 1 1 auto;
		min-width: 0;
	}

	.smd-variant-model {
		width: 100%;
		max-width: none;
		min-height: 30px;
		padding: 2px 6px;
	}

	.smd-variant-surface {
		flex: 0 0 auto;
	}

	.smd-variant .smd-seg {
		min-height: 30px;
		padding: 2px 8px;
		font-size: 0.75rem;
	}
}

/* N13 (1.7.1): vorhandene Texte/Fotos im Werkzeug-Fenster */
.smd-existing-title {
	margin: 14px 0 6px;
	color: var(--smd-muted);
	font-size: 0.875rem;
}

.smd-overlay .smd-layer-btn.smd-layer-del {
	color: #B20000;
}
