/* Chocolia Banderole Designer – Frontend-Editor
 * Palette: #c5306e (Marke), #fff, #000, #f5f5f5
 * Grundlage: Lid Designer v0.6.2 (eigene Klassen cbd-, nichts geteilt).
 */

.cbd-editor {
	margin: 18px 0;
	padding: 14px;
	container-type: inline-size;
	container-name: cbd;
	border: 1px solid #e3e3e3;
	border-radius: 0;
	background: #f5f5f5;
	--cbd-pink: #c5306e;
	--cbd-pink-dark: #9d2657;
	font-family: 'Quicksand', sans-serif;
	color: #000;
}
.cbd-editor button,
.cbd-editor input,
.cbd-editor select,
.cbd-editor h2,
.cbd-editor h3,
.cbd-editor p,
.cbd-editor label { font-family: 'Quicksand', sans-serif; }

/* Tabs (CPB | CBD) – Variablen hier erneut definieren, da der Stepper
   per JS AUS .cbd-editor herausgelöst wird und dessen Variablen sonst fehlen. */
.cbd-tabs,
.cbd-stepper {
	--cbd-pink: #c5306e;
	--cbd-pink-dark: #9d2657;
}
.cbd-tabs { margin: 16px 0; }
.cbd-tabpanes { }
.cbd-tabpane { }
.cbd-pane-pralinen { padding: 4px 0 0; }
/* Editor im Tab: oberen Außenabstand reduzieren */
.cbd-pane-banderole .cbd-editor { margin-top: 4px; }

/* Status-Stepper (zugleich Tab-Kopf) */
.cbd-stepper {
	display: flex;
	align-items: stretch;
	gap: 0;
	margin: 16px 0 20px;
	background: #fff;
	border: 1px solid #e0e0e0;
	position: relative;
}

.cbd-step.cbd-step-active {
	background-color: #c5306e;
}

.cbd-step { position: relative; transition: background .15s; }
.cbd-step:hover { background: #ddd; }

/* Aktiver Tab: pinker Hintergrund, weiße Schrift, Dreieck nach unten */
.cbd-step-active { background: var(--cbd-pink); }
.cbd-step-active:hover { background: var(--cbd-pink); }
.cbd-step.cbd-step-active .cbd-step-title,
.cbd-step.cbd-step-active .cbd-step-status,
.cbd-step.cbd-step-active .cbd-step-check { color: #fff; }
.cbd-step.cbd-step-active .cbd-step-num {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	border-color: #fff;
}
.cbd-step-active::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: -10px;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 10px solid var(--cbd-pink);
	z-index: 3;
}
.cbd-step {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: 'Quicksand', sans-serif;
	color: #000;
	touch-action: manipulation; /* iOS: kein Double-Tap-Zoom-Delay auf den Steps */
}
.cbd-step-num {
	flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center;
	width: 26px; height: 26px;
	background: #f5f5f5; color: #000;
	border: 1px solid #ccc; border-radius: 50%;
	font-weight: 700; font-size: 13px;
}
.cbd-step-body { display: flex; flex-direction: column; line-height: 1.25; }
.cbd-step-title { font-weight: 700; font-size: 14px; }
.cbd-step-status { font-size: 12px; color: #666; }
.cbd-step-check { margin-left: auto; color: var(--cbd-pink); display: none; }
.cbd-step-sep { width: 1px; background: #e0e0e0; }

.cbd-step-done .cbd-step-num { background: var(--cbd-pink); color: #fff; border-color: var(--cbd-pink); }
.cbd-step-done .cbd-step-status { color: var(--cbd-pink); font-weight: 700; }
.cbd-step-done .cbd-step-check { display: inline-flex; }

@media (max-width: 480px) {
	.cbd-step { padding: 8px 10px; gap: 7px; }
	.cbd-step-title { font-size: 13px; }
}

.cbd-editor-title {
	margin: 0 0 12px;
	padding: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: #000;
	border-bottom: 2px solid #e0e0e0;
}

/* Tipp über dem Mockup */
.cbd-tip {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 14px;
	padding: 9px 12px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-left: 3px solid var(--cbd-pink);
	font-size: 13px;
	color: #000;
}
.cbd-tip .cbd-ic { flex: 0 0 auto; margin-top: 1px; color: var(--cbd-pink); }

.cbd-ic { vertical-align: middle; }

/* Buttons – Marken-Stil: pink, weiß, eckig, Sweep-Hover */
.cbd-btn {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1;
	color: #fff;
	background: var(--cbd-pink);
	border: none;
	border-radius: 0;
	cursor: pointer;
}
.cbd-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--cbd-pink-dark);
	transform: translateX(-100%);
	transition: transform .3s ease;
	z-index: 0;
}
.cbd-btn:hover::before { transform: translateX(0); }
.cbd-btn > * { position: relative; z-index: 1; }
.cbd-btn:disabled { opacity: .5; cursor: not-allowed; }
.cbd-btn:disabled::before { display: none; }
.cbd-btn-danger { background: #000; }
.cbd-btn-danger::before { background: #333; }

/* Add-Buttons: volle Breite, zweigeteilt */
.cbd-toolbar-add { display: flex; gap: 10px; margin-bottom: 12px; }
.cbd-toolbar-add .cbd-btn { flex: 1 1 0; }

/* Eigenschaften des ausgewaehlten Elements – UNTER der Arbeitsflaeche.
   Ein- und Ausblenden darf die Flaeche nicht verschieben (v0.6.0). */
.cbd-props { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* Groessen-Regler (alle Elemente) + Zeilenhoehe (nur Text) */
.cbd-size-controls {
	display: flex;
	align-items: center;
	gap: 10px 18px;
	flex-wrap: wrap;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #e0e0e0;
}
.cbd-slider { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; }
.cbd-size-label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.cbd-size-range,
.cbd-lh-range { flex: 1 1 auto; min-width: 90px; accent-color: var(--cbd-pink); height: 28px; }
.cbd-size-value,
.cbd-lh-value { font-size: 13px; font-weight: 700; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Rueckmeldung, sobald das Motiv die Druckflaeche wirklich randlos deckt –
   der Prozentwert allein sagt das nicht, weil er sich auf die BREITE der
   Flaeche bezieht und ein Querformat breiter als 100 % werden muss. */
.cbd-size-controls.cbd-covers .cbd-size-value::after {
	content: ' · randlos';
	color: var(--cbd-pink);
	font-weight: 700;
	white-space: nowrap;
}
.cbd-size-fill {
	padding: 7px 12px; font-size: 13px; font-weight: 700; line-height: 1;
	color: #000; background: #fff; border: 1px solid #ccc; border-radius: 0; cursor: pointer;
	font-family: 'Quicksand', sans-serif;
}
.cbd-size-fill:hover { background: var(--cbd-pink); color: #fff; border-color: var(--cbd-pink); }

/* Textsteuerung */
.cbd-text-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 14px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid #e0e0e0;
}
.cbd-color-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* Hervorhebung (Kontur / Schatten / Flaeche) – eigene Zeile im Textblock */
.cbd-fx {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
	flex: 1 1 100%;
	padding-top: 10px; border-top: 1px solid #eee;
}
.cbd-fx-seg { display: inline-flex; border: 1px solid #ccc; }
.cbd-fx-btn {
	padding: 8px 11px; font-size: 13px; font-weight: 700; line-height: 1;
	font-family: 'Quicksand', sans-serif;
	color: #000; background: #fff; border: none; border-left: 1px solid #eee; border-radius: 0;
	cursor: pointer; touch-action: manipulation;
}
.cbd-fx-btn:first-child { border-left: none; }
.cbd-fx-btn:hover { background: #faf2f6; }
.cbd-fx-btn.cbd-active { background: var(--cbd-pink); color: #fff; }
.cbd-fx-opts { display: flex; align-items: center; gap: 10px 14px; flex: 1 1 260px; flex-wrap: wrap; }
.cbd-fx-amt-wrap { display: flex; align-items: center; gap: 8px; flex: 1 1 160px; font-size: 13px; }
.cbd-fx-amt { flex: 1 1 auto; min-width: 90px; accent-color: var(--cbd-pink); height: 28px; }

/* Textausrichtung */
.cbd-align { display: inline-flex; border: 1px solid #ccc; border-radius: 0; overflow: hidden; }
.cbd-align-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 34px; padding: 0;
	background: #fff; color: #000; border: none; border-left: 1px solid #eee; cursor: pointer;
}
.cbd-align-btn:first-child { border-left: none; }
.cbd-align-btn:hover { background: #faf2f6; }
.cbd-align-btn.cbd-active { background: var(--cbd-pink); color: #fff; }

/* Custom Font-Picker mit Schriftvorschau */
.cbd-fontpicker { position: relative; min-width: 200px; }
.cbd-fp-toggle {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	width: 100%; padding: 8px 10px; font-size: 16px;
	background: #fff; border: 1px solid #ccc; border-radius: 0; cursor: pointer; color: #000;
}
.cbd-fp-caret { color: #777; font-size: 12px; }
.cbd-fp-list {
	position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
	margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
	background: #fff; border: 1px solid #ccc;
	box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.cbd-fp-list li { padding: 8px 10px; font-size: 18px; cursor: pointer; color: #000; }
.cbd-fp-list li:hover { background: #f5f5f5; }

/* Mockup-Stage: Mockup als Bild-Layer, Canvas exakt ueber der Druckflaeche.
   Groessen/Positionen setzt editor.js (applyResponsive) – auf schmalen
   Screens wird auf die Druckflaeche gezoomt, damit sie die volle Breite hat. */
.cbd-stage-wrap { width: 100%; }
.cbd-stage {
	position: relative;
	display: block;
	width: 100%;
	box-sizing: border-box;
	min-height: 80px;
	line-height: 0;
	border: 1px solid #ddd;
	overflow: hidden;
	background: #fff;
}
.cbd-mockup-layer { position: absolute; left: 0; top: 0; width: 100%; }
.cbd-mockup-layer.cbd-no-mockup { background: transparent; }
.cbd-mockup {
	display: block; width: 100%; height: 100%;
	user-select: none; -webkit-user-select: none; -webkit-user-drag: none; pointer-events: none;
}
/* Druckflaeche: gestrichelter Rahmen = exakt das, was gedruckt wird.
   Bewusst ein border auf ::after statt eines outline – das Theme setzt
   "*, ::before, ::after { outline: 0 !important; }" und verschluckt jeden
   outline. Der Rahmen liegt 2 px AUSSERHALB der Flaeche, damit er keine
   druckbaren Pixel verdeckt. */
.cbd-canvas-holder { position: absolute; left: 0; top: 0; }
/* Eigenes Element statt ::after/outline: Der Canvas ist groesser als die
   Druckflaeche (Arbeitsrand fuer die Anfasser), der Rahmen muss also exakt
   auf der Flaeche sitzen – Position setzt editor.js in px. */
.cbd-print-frame {
	position: absolute;
	box-sizing: border-box;
	border: 2px dashed #c5306e;
	pointer-events: none;
	z-index: 2;
}
.cbd-stage canvas { display: block; }
.cbd-stage .canvas-container,
.cbd-stage .lower-canvas,
.cbd-stage .upper-canvas { border-radius: 0; }

/* Werkzeug oben links: „Schritt zurück“. (Ein zweiter Papierkorb fuer
   „Oberseite leeren“ stand hier bis v0.2.0 und war mit dem Papierkorb am
   markierten Objekt zu verwechseln – jetzt Textknopf im Panel.) */
.cbd-stage-tools {
	position: absolute; top: 8px; left: 8px; z-index: 20;
	display: flex; flex-direction: column; gap: 6px;
}
.cbd-tool-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; padding: 0;
	background: rgba(255,255,255,.94); color: #000;
	border: 1px solid #ccc; border-radius: 0; cursor: pointer; line-height: 0;
	box-shadow: 0 1px 4px rgba(0,0,0,.15);
	transition: background .15s, color .15s, border-color .15s;
	touch-action: manipulation;
}
.cbd-tool-btn:disabled { opacity: .45; cursor: not-allowed; }
/* „Oberseite leeren“: unauffaelliger Textknopf unter der Auflösungs-Anzeige */
.cbd-editor .cbd-overlay-reset {
	display: inline-flex; align-items: center; align-self: flex-start; width: auto; min-height: 0;
	margin: 10px 0 0; padding: 2px 0;
	background: none; border: 0; border-radius: 0; box-shadow: none;
	font-size: 13px; font-weight: 600; line-height: 1.3; letter-spacing: normal; text-transform: none;
	color: #8a8a8a; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.cbd-editor .cbd-overlay-reset:hover,
.cbd-editor .cbd-overlay-reset:focus-visible { background: none; color: #b32d2e; }
/* Schritt zurück = harmlos → Markenfarbe */
.cbd-overlay-undo { color: #000; }
.cbd-overlay-undo:hover { background: var(--cbd-pink); color: #fff; border-color: var(--cbd-pink); }

/* Overlay: Motiv speichern (oben rechts) */
.cbd-overlay-save {
	position: absolute; top: 8px; right: 8px; z-index: 20;
	display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 12px;
	background: var(--cbd-pink); color: #fff; border: none; border-radius: 0; cursor: pointer;
	font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 13px; line-height: 1;
	box-shadow: 0 2px 8px rgba(0,0,0,.18);
	overflow: hidden;
}
.cbd-overlay-save::before { content: ''; position: absolute; inset: 0; background: var(--cbd-pink-dark); transform: translateX(-100%); transition: transform .3s ease; z-index: 0; }
.cbd-overlay-save:hover::before { transform: translateX(0); }
.cbd-overlay-save > * { position: relative; z-index: 1; }

/* Gespeichert-Badge (bleibt nach Speichern, gleiche Position) */
.cbd-saved-badge {
	position: absolute; top: 8px; right: 8px; z-index: 20;
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px;
	background: var(--cbd-pink); color: #fff; border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* Ladeanzeige ueber der Arbeitsflaeche (Upload, Speichern, Vorlage laden) */
.cbd-busy {
	position: absolute; inset: 0; z-index: 30;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
	background: rgba(255,255,255,.72);
	line-height: 1.3; cursor: progress;
}
.cbd-spinner {
	width: 44px; height: 44px; box-sizing: border-box;
	border-radius: 50%;
	border: 4px solid rgba(197,48,110,.18);
	border-top-color: var(--cbd-pink);
	animation: cbd-spin .8s linear infinite;
}
.cbd-busy-text {
	padding: 6px 12px; font-size: 14px; font-weight: 700; color: #000;
	background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
@keyframes cbd-spin { to { transform: rotate(360deg); } }
.cbd-editor.cbd-is-busy .cbd-props { opacity: .55; pointer-events: none; }

/* Toast (momentane Bestätigung) */
.cbd-toast {
	position: absolute; left: 50%; top: 50%; z-index: 25;
	transform: translate(-50%, -50%) scale(.9);
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 18px; font-size: 15px; font-weight: 700; line-height: 1;
	color: #fff; background: var(--cbd-pink);
	box-shadow: 0 6px 22px rgba(0,0,0,.25);
	opacity: 0; transition: opacity .2s, transform .2s;
}
.cbd-toast.cbd-toast-in { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Auflösungs-Ampel – als gut sichtbarer Chip */
.cbd-resolution {
	display: inline-flex; align-items: center; gap: 9px;
	margin: 14px 0 8px; padding: 8px 14px;
	font-size: 14px; font-weight: 600; color: #000;
	background: #fff; border: 1px solid #e0e0e0; border-radius: 999px;
}
.cbd-amp { width: 16px; height: 16px; border-radius: 50%; background: #bbb; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

/* Speichern-Status unter dem Mockup */
.cbd-savestate {
	margin: 4px 0 10px; padding: 8px 12px;
	font-size: 13px; font-weight: 600; border-radius: 4px;
}
.cbd-ss-ok   { background: #edf7ed; color: #14622f; border: 1px solid #1a9d4b; }
.cbd-ss-warn { background: #fff7e6; color: #7a5300; border: 1px solid #e2b203; }
.cbd-ss-bad  { background: #fcebea; color: #8a1f20; border: 1px solid #d63638; }

/* Deaktivierter Save-Overlay-Button */
.cbd-overlay-save.cbd-disabled,
.cbd-overlay-save:disabled {
	background: #b8b8b8; cursor: not-allowed; box-shadow: none;
}
.cbd-overlay-save.cbd-disabled::before,
.cbd-overlay-save:disabled::before { display: none; }
.cbd-amp-idle   { background: #bbb; }
.cbd-amp-green  { background: #1a9d4b; }
.cbd-amp-yellow { background: #e2b203; }
.cbd-amp-red    { background: #d63638; }

/* Dezenter Hinweis-Chip unter dem Warenkorb-Button (außerhalb von .cbd-editor → literale Farben) */
.cbd-cart-hint {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 100%;
	width: 100%;
	box-sizing: border-box;
	margin: 10px 0 0;
	padding: 9px 12px;
	font-size: 13px;
	line-height: 1.4;
	color: #7a5300;
	background: #fff7e6;
	border: 1px solid #f0d9a6;
	border-radius: 8px;
}
.cbd-cart-hint-ic { display: inline-flex; flex: 0 0 auto; color: #e2b203; }
.cbd-cart-hint .cbd-cart-hint-lead { color: #6b6b6b; font-weight: 600; }
.cbd-cart-hint a { color: #c5306e; text-decoration: underline; cursor: pointer; font-weight: 600; }
.cbd-cart-hint a:hover { color: #9d2657; }

/* Modals */
.cbd-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; }
.cbd-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.cbd-modal-dialog {
	position: relative; z-index: 1; width: min(520px, 92vw);
	max-height: 88vh; overflow-y: auto;
	background: #fff; border-radius: 0; padding: 22px;
	box-shadow: 0 16px 48px rgba(0,0,0,.3);
	font-family: 'Quicksand', sans-serif; color: #000;
}
.cbd-modal-title { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: #000; }
.cbd-modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.cbd-rights { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: #000; }
.cbd-rights input { margin-top: 3px; flex: 0 0 auto; }
.cbd-rights.cbd-error { color: var(--cbd-pink); }
/* box-shadow statt outline – siehe Theme-Reset oben, ein outline kaeme nie an. */
.cbd-rights.cbd-error input { box-shadow: 0 0 0 2px var(--cbd-pink); }

@media (max-width: 600px) {
	.cbd-size-controls { gap: 8px; padding: 8px 10px; }
	/* Jeder Regler eine eigene Zeile, Beschriftung und Wert daneben */
	.cbd-slider { flex: 1 1 100%; }
	.cbd-slider .cbd-size-label { min-width: 86px; }   /* Regler beginnen buendig */
	.cbd-size-fill { margin-left: auto; }
	.cbd-fx-seg { flex: 1 1 100%; }
	.cbd-fx-btn { flex: 1 1 0; padding: 10px 4px; }
	/* Buehne randlos: die Arbeitsflaeche bekommt die volle Kartenbreite */
	.cbd-editor { padding: 14px; }

	/* Hinzufügen-Buttons nebeneinander lassen – spart Höhe über der Arbeitsfläche */
	.cbd-toolbar-add { flex-direction: row; gap: 8px; }
	.cbd-toolbar-add .cbd-btn { padding: 11px 8px; font-size: 13px; gap: 6px; line-height: 1.2; }
	.cbd-fontpicker { min-width: 160px; }
	.cbd-overlay-save-label { display: none; }
	.cbd-tool-btn { width: 40px; height: 40px; }
	.cbd-editor-title { font-size: 19px; margin-bottom: 10px; padding-bottom: 8px; }
	.cbd-tip { font-size: 12.5px; padding: 8px 10px; margin-bottom: 10px; }
}

/* ===================================================================
 * Banderole v0.2.0 – kompaktes Layout
 *  Reiter Hinten · Oben · Vorne, darunter zweispaltig (ab 760 px Editorbreite):
 *  links die Buehne, rechts 3D-Ansicht + Werkzeuge + Speichern.
 *  Schmaler: eine Spalte, 3D als Miniatur in der Buehnen-Ecke.
 * ================================================================= */

/* --- Reiter --- */
.cbd-faces {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
	margin: 0 0 12px;
}
.cbd-face-tab {
	position: relative;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	padding: 8px 6px 7px;
	background: #fff; color: #000;
	border: 1px solid #e0e0e0; border-radius: 0;
	cursor: pointer; touch-action: manipulation;
	font-family: 'Quicksand', sans-serif; line-height: 1.15;
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.cbd-face-tab:hover { border-color: #d7a3b9; }
.cbd-face-tab.cbd-active {
	border-color: var(--cbd-pink);
	box-shadow: inset 0 -3px 0 var(--cbd-pink);
	background: #fdf4f8;
}
.cbd-face-ic { display: block; width: 52px; height: 37px; }
.cbd-fi polygon { stroke: #fff; stroke-width: .9; stroke-linejoin: round; }
.cbd-fi-side { fill: #2b2b2b; }
.cbd-fi-band { fill: #dedede; }
.cbd-fi-hi   { fill: var(--cbd-pink); }
.cbd-face-tab:not(.cbd-active) .cbd-fi-hi { fill: #dc93b1; }
.cbd-face-label { font-size: 14px; font-weight: 700; }
.cbd-face-state { font-size: 11px; font-weight: 600; color: #8a8a8a; min-height: 13px; }
.cbd-face-tab.cbd-has-content .cbd-face-state { color: #1a7f37; }

/* --- Layout --- */
.cbd-layout { display: block; }
.cbd-col-stage { position: relative; min-width: 0; }
.cbd-col-stage > .cbd-panel-strip { margin-top: 10px; }
.cbd-col-side  { min-width: 0; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

@container cbd (min-width: 760px) {
	.cbd-layout {
		display: grid;
		grid-template-columns: minmax(0, 1.32fr) minmax(280px, 1fr);
		gap: 14px;
		align-items: start;
	}
	.cbd-col-side { margin-top: 0; }
	.cbd-p3d-thumb { display: none !important; }
}
@container cbd (max-width: 759.98px) {
	.cbd-col-side .cbd-p3d { display: none; }
}

/* --- Buehne --- */
.cbd-stage-area { position: relative; }
.cbd-stage { background: #fbfbfa; border-color: #e3e3e3; }
.cbd-mockup-layer.cbd-has-mockup { background: #fff; }
.cbd-mockup-layer .cbd-mockup { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
/* Kante der Banderole (links/rechts Schnitt, oben/unten Falz) */
.cbd-print-frame { border: 2px dashed #c5306e; }
/* Anschnitt: wird abgeschnitten -> aufgehellt */
.cbd-bleed { position: absolute; z-index: 2; pointer-events: none; background: rgba(255,255,255,.6); }
/* Hinweise „Hinten“/„Vorne“ an der Oberseite. Die genaue Lage setzt das JS
   (Kante der Flaeche); die Werte hier sind nur die Grundstellung. */
.cbd-edge-chip {
	position: absolute; z-index: 3; transform: translateX(-50%); left: 50%;
	padding: 2px 9px; font-size: 11px; font-weight: 700; line-height: 16px; letter-spacing: .03em;
	color: #6b6b6b; background: rgba(255,255,255,.92); border: 1px solid #e3e3e3; border-radius: 9px;
	pointer-events: none; white-space: nowrap;
}
.cbd-edge-back  { top: 6px; }
.cbd-edge-front { bottom: 6px; }
.cbd-edge-back::before  { content: '▲ '; font-size: 8px; vertical-align: 1px; }
.cbd-edge-front::before { content: '▼ '; font-size: 8px; vertical-align: 1px; }

.cbd-stage-strip {
	line-height: 0; border: 1px solid #e3e3e3; background: #fbfbfa; overflow: hidden; cursor: text;
}
.cbd-strip-stage { display: block; width: 100%; height: auto; }

.cbd-hint { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.4; color: #555; }

/* Ladeanzeige ueber der ganzen Buehne */
.cbd-stage-area .cbd-busy { position: absolute; inset: 0; z-index: 30; }

/* --- 3D-Ansicht --- */
.cbd-p3d {
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	padding: 8px 8px 10px; background: #fff; border: 1px solid #e3e3e3;
}
.cbd-p3d-canvas, .cbd-p3d-big { display: block; max-width: 100%; }
.cbd-p3d-switch { display: inline-flex; border: 1px solid #ccc; }
.cbd-p3d-btn {
	padding: 7px 16px; font-size: 13px; font-weight: 700; line-height: 1;
	font-family: 'Quicksand', sans-serif; color: #000; background: #fff;
	border: none; border-left: 1px solid #eee; border-radius: 0; cursor: pointer; touch-action: manipulation;
}
.cbd-p3d-btn:first-child { border-left: none; }
.cbd-p3d-btn:hover { background: #faf2f6; }
.cbd-p3d-btn.cbd-active { background: var(--cbd-pink); color: #fff; }

/* Miniatur in der Buehnen-Ecke (Handy) */
.cbd-p3d-thumb {
	position: absolute; right: 8px; bottom: 8px; z-index: 25;
	width: 104px; padding: 0; line-height: 0;
	background: #fff; border: 1px solid #ddd; border-radius: 6px; overflow: hidden;
	box-shadow: 0 3px 12px rgba(0,0,0,.2); cursor: zoom-in; touch-action: manipulation;
}
.cbd-p3d-thumb-canvas { display: block; width: 100%; }
.cbd-p3d-thumb-label {
	position: absolute; left: 4px; top: 4px; padding: 2px 5px;
	font-size: 10px; font-weight: 700; line-height: 1; color: #fff; background: var(--cbd-pink); border-radius: 3px;
}
.cbd-modal-3d-dialog { width: min(820px, 96vw); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cbd-modal-close {
	position: absolute; right: 6px; top: 4px; z-index: 2;
	width: 36px; height: 36px; padding: 0; font-size: 26px; line-height: 1;
	background: transparent; color: #000; border: none; cursor: pointer;
}

/* --- Werkzeuge --- */
.cbd-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #fff; border: 1px solid #e3e3e3; }
.cbd-panel .cbd-toolbar-add { margin: 0; }
.cbd-panel .cbd-props { margin: 0; }
.cbd-panel .cbd-size-controls,
.cbd-panel .cbd-text-controls { border-color: #ececec; background: #fafafa; }
.cbd-panel .cbd-resolution { margin: 0; align-self: flex-start; }
.cbd-strip-text-label { display: flex; flex-direction: column; gap: 4px; }
.cbd-strip-text {
	width: 100%; box-sizing: border-box; min-height: 58px; resize: vertical;
	padding: 8px 10px; font-size: 16px; line-height: 1.35;
	font-family: 'Quicksand', sans-serif; color: #000;
	background: #fff; border: 1px solid #ccc; border-radius: 0;
}
.cbd-strip-text:focus { border-color: var(--cbd-pink); box-shadow: 0 0 0 1px var(--cbd-pink); }
.cbd-strip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cbd-strip-row .cbd-fontpicker { flex: 1 1 180px; min-width: 0; }
.cbd-strip-size-wrap { flex: 1 1 160px; }
.cbd-strip-size { flex: 1 1 auto; min-width: 80px; accent-color: var(--cbd-pink); height: 28px; }

/* Farbfelder */
.cbd-colorrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.cbd-colorrow > .cbd-size-label { min-width: 86px; }
.cbd-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cbd-sw {
	position: relative; box-sizing: border-box;
	display: inline-flex; align-items: center; justify-content: center; gap: 5px;
	min-width: 28px; height: 28px; padding: 0;
	border: 1px solid rgba(0,0,0,.18); border-radius: 50%; cursor: pointer;
	background: #fff; touch-action: manipulation;
	font-family: 'Quicksand', sans-serif; font-size: 12px; font-weight: 700; color: #000; line-height: 1;
}
.cbd-sw.cbd-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cbd-pink); }
.cbd-sw-photo::after {
	content: ''; position: absolute; right: -2px; bottom: -2px;
	width: 9px; height: 9px; border-radius: 50%;
	background: var(--cbd-pink); border: 2px solid #fff;
}
.cbd-sw-auto { border-radius: 14px; padding: 0 10px 0 4px; background: #fff; }
.cbd-sw-dot { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.cbd-sw-custom { background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); overflow: hidden; }
.cbd-sw-custom input[type="color"] {
	position: absolute; inset: 0; width: 100%; height: 100%;
	opacity: 0; cursor: pointer; border: 0; padding: 0;
}

/* --- Speichern --- */
.cbd-savebar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.cbd-btn-save { width: 100%; padding: 15px 18px; font-size: 15px; }
.cbd-btn-save.cbd-disabled { opacity: .5; cursor: not-allowed; }
.cbd-btn-save.cbd-disabled::before { display: none; }
.cbd-savebar .cbd-savestate { margin: 0; }
.cbd-ss-pop { animation: cbd-pop .6s ease; }
@keyframes cbd-pop { 0% { transform: scale(.96); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }

@media (max-width: 600px) {
	.cbd-editor { padding: 10px; }
	.cbd-stage-wrap.cbd-stage-top { margin-left: -10px; margin-right: -10px; width: auto; }
	.cbd-stage-strip { margin-left: -10px; margin-right: -10px; }
	.cbd-faces { gap: 6px; }
	.cbd-face-tab { padding: 6px 4px; }
	.cbd-face-ic { width: 44px; height: 31px; }
	.cbd-colorrow > .cbd-size-label { min-width: 0; flex: 1 1 100%; }
	.cbd-sw { min-width: 34px; height: 34px; }
	.cbd-sw-auto { border-radius: 17px; }
	.cbd-p3d-thumb { width: 92px; }
}
