/* hanse-designer – Editor. Aufbau und Tokens aus dem Modulon-Designer übernommen und angepasst (Apple-HIG-nah, hell/dunkel). */

.hd {
	--bg: #FFFFFF;
	--bg2: #F5F5F7;
	--bg3: #E8E8ED;
	--label: #1D1D1F;
	--label2: #6E6E73;
	--label3: #86868B;
	--sep: rgba(60, 60, 67, .14);
	--accent: #0071E3;
	--accent-press: #0062C4;
	--accent-soft: rgba(0, 113, 227, .1);
	--danger: #D70015;
	--warn: #B25000;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
	--ease: cubic-bezier(.2, .8, .2, 1);
	--head: var(--hd-top, 64px);
	--hd-accent: var(--accent); --hd-bg2: var(--bg2); --hd-bg3: var(--bg3); --hd-label: var(--label); --hd-label2: var(--label2);
	font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
	color: var(--label);
	-webkit-font-smoothing: antialiased;
	display: grid;
	grid-template-columns: 76px 328px minmax(0, 1fr) 296px;
	grid-template-rows: 56px minmax(0, 1fr) 88px;
	grid-template-areas:
		"tabs top top top"
		"tabs panel stage insp"
		"tabs panel buy buy";
	height: calc(100vh - var(--head));
	height: calc(100dvh - var(--head));
	background: var(--bg2);
	overflow: hidden;
}

@media (prefers-color-scheme: dark) {
	.hd {
		--bg: #1C1C1E;
		--bg2: #000000;
		--bg3: #2C2C2E;
		--label: #F5F5F7;
		--label2: #98989D;
		--label3: #8E8E93;
		--sep: rgba(84, 84, 88, .55);
		--accent: #2997FF;
		--accent-press: #0A84FF;
		--accent-soft: rgba(41, 151, 255, .16);
		--danger: #FF453A;
		--warn: #FF9F0A;
		--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .4);
	}
}

.hd *, .hd *::before, .hd *::after { box-sizing: border-box; }
.hd button { font: inherit; color: inherit; cursor: pointer; }
.hd button:disabled { cursor: default; opacity: .35; }
.hd :focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; border-radius: 8px; }
.hd h2 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.hd h3 { font-size: 13px; font-weight: 600; color: var(--label2); text-transform: none; letter-spacing: 0; margin: 24px 0 8px; }
.hd svg { flex: none; }
.hd-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kopfleiste ---------- */

.hd-top {
	grid-area: top;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 0 16px 0 24px;
	background: var(--bg);
	border-bottom: .5px solid var(--sep);
	min-width: 0;
}
.hd-top-left { display: flex; flex-direction: column; flex: 0 1 auto; min-width: 96px; max-width: 240px; } /* Label „Vorlage“ bleibt sichtbar, auch neben dem Seitenumschalter (Kalender: 13 Seiten) */
.hd-top-label { font-size: 11px; color: var(--label3); }
.hd-top-left strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-top-right { display: flex; align-items: center; gap: 4px; }
.hd-sep { width: 1px; height: 20px; background: var(--sep); margin: 0 8px; }
.hd-zoom-label { border: 0; background: none; min-width: 56px; height: 36px; border-radius: 8px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--label2); }
.hd-zoom-label:hover { background: var(--bg2); }

.hd-side {
	display: inline-flex; padding: 2px; border-radius: 9px; background: var(--bg3);
	min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; /* viele Seiten (Kalender: 13) scrollen waagerecht */
	flex: 0 1 auto; position: relative; z-index: 0;
}
.hd-top > .hd-side { margin-right: auto; }
.hd-top-right { flex: none; }
.hd-side::-webkit-scrollbar { display: none; }
.hd-side button { flex: none; }
.hd-side button {
	border: 0; background: none; height: 32px; padding: 0 16px; border-radius: 7px; font-size: 13px; font-weight: 500;
	transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.hd-side button[aria-pressed="true"] { background: var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }

.hd-ibtn {
	display: inline-grid; place-items: center;
	width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--label);
	transition: background .15s var(--ease);
}
.hd-ibtn:hover:not(:disabled) { background: var(--bg2); }
.hd-ibtn:active:not(:disabled) { background: var(--bg3); }
.hd-ibtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.hd-ibtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Tabs ---------- */

.hd-tabs {
	grid-area: tabs;
	display: flex; flex-direction: column; gap: 4px; padding: 12px 8px;
	background: var(--bg);
	border-right: .5px solid var(--sep);
}
.hd-tabs button {
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	border: 0; background: none; padding: 10px 0; border-radius: 10px; color: var(--label2); font-size: 11px; font-weight: 500;
	transition: background .15s var(--ease), color .15s var(--ease);
}
.hd-tabs button svg { width: 22px; height: 22px; }
.hd-tabs button:hover { background: var(--bg2); color: var(--label); }
.hd-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }

/* ---------- Seitenleiste ---------- */

.hd-panel {
	grid-area: panel;
	background: var(--bg);
	border-right: .5px solid var(--sep);
	overflow-y: auto; overscroll-behavior: contain;
	padding: 20px 20px 32px;
}
.hd-pane-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.hd-pane-close { display: none; margin-left: auto; }
.hd-count { color: var(--label3); font-size: 13px; }
.hd-lead { color: var(--label2); margin: 0 0 8px; font-size: 13px; }
.hd-empty { color: var(--label2); text-align: center; padding: 32px 0; }

.hd-search {
	display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--bg2); color: var(--label3);
}
.hd-search input { flex: 1; border: 0; background: none; font: inherit; color: var(--label); outline: none; min-width: 0; }
.hd-search:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }

.hd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.hd-chip {
	border: 0; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--bg2); font-size: 13px; font-weight: 500;
	transition: background .15s var(--ease), color .15s var(--ease);
}
.hd-chip:hover { background: var(--bg3); }
.hd-chip[aria-pressed="true"] { background: var(--label); color: var(--bg); }

.hd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.hd-design { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.hd-design[hidden] { display: none; }
.hd-design-img {
	display: block; aspect-ratio: 85 / 55; border-radius: 8px; overflow: hidden; background: var(--bg2);
	box-shadow: 0 0 0 .5px var(--sep), 0 2px 6px rgba(0, 0, 0, .06);
	transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.hd-design-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hd-design:hover .hd-design-img { transform: translateY(-2px); box-shadow: 0 0 0 .5px var(--sep), 0 8px 18px rgba(0, 0, 0, .1); }
.hd-design[aria-current="true"] .hd-design-img { box-shadow: 0 0 0 2.5px var(--accent), 0 6px 14px rgba(0, 0, 0, .1); }
.hd-design-name { font-size: 12px; color: var(--label2); padding-left: 2px; }
.hd-design[aria-current="true"] .hd-design-name { color: var(--accent); font-weight: 600; }

/* Inhalt */
.hd-fields { display: flex; flex-direction: column; gap: 12px; }
.hd-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.hd-field input, .hd-num input, .hd-select select {
	width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--label);
	background: var(--bg2); border: 1px solid transparent; border-radius: 10px;
	transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.hd-field input:hover { background: var(--bg3); }
.hd-field input:focus, .hd-num input:focus, .hd-select select:focus { outline: none; background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hd-field input[aria-invalid="true"] { border-color: var(--danger); }
.hd-field-error { color: var(--danger); font-size: 12px; margin: 4px 0 0; }

.hd-link-danger { border: 0; background: none; color: var(--danger); font-size: 13px; padding: 8px 0; min-height: 44px; }

/* Elemente */
.hd-add-text { display: flex; flex-direction: column; gap: 8px; }
.hd-add-text button {
	border: 0; background: var(--bg2); border-radius: 10px; padding: 12px 14px; text-align: left; min-height: 44px;
	transition: background .15s var(--ease);
}
.hd-add-text button:hover, .hd-shapes button:hover, .hd-icon-btn:hover { background: var(--bg3); }
.hd-add-heading { font-size: 22px !important; font-weight: 700; letter-spacing: -.01em; }
.hd-add-body { font-size: 15px !important; }
.hd-add-label { font-size: 12px !important; font-weight: 600; letter-spacing: .2em; color: var(--accent) !important; }
.hd-shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hd-shapes button { border: 0; background: var(--bg2); border-radius: 10px; aspect-ratio: 1.4; display: grid; place-items: center; transition: background .15s var(--ease); }
.hd-shapes svg { width: 40px; height: 40px; fill: var(--label); }
.hd-shapes svg .o { fill: none; stroke: var(--label); stroke-width: 2.5; }
.hd-icons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.hd-icon-btn { border: 0; background: var(--bg2); border-radius: 10px; aspect-ratio: 1; display: grid; place-items: center; min-height: 44px; transition: background .15s var(--ease); }
.hd-wide { width: 100%; display: flex !important; align-items: center; justify-content: center; gap: 8px; }

/* Stil */
.hd-palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hd-palette {
	display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border: 0; background: var(--bg2); border-radius: 10px; padding: 8px 10px; min-height: 44px; font-size: 13px; text-align: left;
	box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow .15s var(--ease), background .15s var(--ease);
}
.hd-palette:hover { background: var(--bg3); }
.hd-palette[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 600; }
.hd-palette-sw { display: flex; }
.hd-palette-sw i { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--bg2); margin-left: -5px; }
.hd-palette-sw i:first-child { margin-left: 0; box-shadow: 0 0 0 1.5px var(--bg2), inset 0 0 0 .5px var(--sep); }
.hd-fontpairs { display: flex; flex-direction: column; gap: 8px; }
.hd-fontpair {
	display: flex; align-items: center; gap: 14px; border: 0; background: var(--bg2); border-radius: 10px; padding: 10px 12px; text-align: left;
	box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow .15s var(--ease), background .15s var(--ease);
}
.hd-fontpair:hover { background: var(--bg3); }
.hd-fontpair[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.hd-fontpair-head { font-size: 28px; width: 44px; text-align: center; }
.hd-fontpair-meta { display: flex; flex-direction: column; }
.hd-fontpair-meta strong { font-size: 14px; font-weight: 600; }
.hd-fontpair-meta small { font-size: 12px; color: var(--label2); }

/* ---------- Bühne ---------- */

.hd-stage {
	grid-area: stage;
	position: relative;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
	overflow: auto; padding: 24px;
	background:
		radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--bg) 70%, transparent), transparent 70%),
		var(--bg2);
}
.hd-card {
	--r: 2px;
	position: relative; flex: none;
	border-radius: var(--r);
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .28), 0 12px 24px -12px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06);
	opacity: 0; transform: translateY(12px) scale(.98);
	transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.hd.is-ready .hd-card { opacity: 1; transform: none; }
.hd-card .canvas-container { border-radius: var(--r); }
.hd-card.is-flip { animation: hd-flip .45s var(--ease); }
@keyframes hd-flip { 0% { transform: perspective(1400px) rotateY(0); } 45% { transform: perspective(1400px) rotateY(88deg); } 55% { transform: perspective(1400px) rotateY(-88deg); } 100% { transform: perspective(1400px) rotateY(0); } }
.hd-stage.is-over::after {
	content: ""; position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 20px; background: var(--accent-soft); pointer-events: none;
}
.hd-drop-hint { position: absolute; bottom: 24px; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .2s var(--ease); pointer-events: none; }
.hd-stage.is-over .hd-drop-hint { opacity: 1; transform: none; }

.hd-status {
	display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 560px;
	font-size: 12px; color: var(--label2); text-align: center;
}
.hd-dots { display: inline-flex; }
.hd-dots i { width: 12px; height: 12px; border-radius: 50%; margin-left: -3px; box-shadow: 0 0 0 1.5px var(--bg2), inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.hd-dots i:first-child { margin-left: 0; }
.hd-status-hint { flex-basis: 100%; color: var(--label3); }
.hd-status.is-warn .hd-status-hint:first-of-type { color: var(--warn); }

/* ---------- Inspektor ---------- */

.hd-inspector {
	grid-area: insp;
	background: var(--bg);
	border-left: .5px solid var(--sep);
	overflow-y: auto; overscroll-behavior: contain;
	padding: 16px 16px 32px;
}
.hd-insp-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.hd-insp-head strong { font-size: 17px; font-weight: 600; }
.hd-insp-close { display: none; }
.hd-group { padding: 14px 0; border-bottom: .5px solid var(--sep); }
.hd-group:last-of-type { border-bottom: 0; }
.hd-group h3 { margin: 0 0 10px; }
.hd-row { display: flex; gap: 2px; flex-wrap: wrap; }
.hd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.hd-group > .hd-grid2:first-child { margin-top: 0; }
.hd-num { position: relative; display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--label2); }
.hd-num input { height: 34px; padding: 0 30px 0 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.hd-num em { position: absolute; right: 10px; bottom: 9px; font-style: normal; font-size: 11px; color: var(--label3); pointer-events: none; }
.hd-select { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--label2); }
.hd-select select { height: 34px; font-size: 13px; padding: 0 8px; appearance: auto; }
.hd-range { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--label2); margin-top: 8px; }
.hd-range input { width: 100%; accent-color: var(--accent); }
.hd-note, .hd-meta { font-size: 12px; color: var(--label2); margin: 10px 0 0; }
.hd-meta { margin: 0; }
.hd-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.hd-sw {
	position: relative; width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; background: var(--c);
	box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2);
	transition: transform .15s var(--ease);
}
.hd-sw::before { content: ""; position: absolute; inset: -8px; }
.hd-sw:hover { transform: scale(1.1); }
.hd-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.hd-sw-custom { background: conic-gradient(#FF3B30, #FF9500, #FFCC00, #34C759, #00C7BE, #0071E3, #AF52DE, #FF2D55, #FF3B30); cursor: pointer; overflow: hidden; }
.hd-sw-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.hd-switch { display: flex; align-items: center; gap: 10px; font-size: 13px; min-height: 36px; cursor: pointer; }
.hd-switch input {
	appearance: none; flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--bg3); position: relative; cursor: pointer; margin: 0;
	transition: background .2s var(--ease);
}
.hd-switch input::after {
	content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: transform .2s var(--ease);
}
.hd-switch input:checked { background: #34C759; }
.hd-switch input:checked::after { transform: translateX(16px); }
.hd-actions { display: flex; align-items: center; gap: 4px; padding-top: 16px; }
.hd-danger {
	margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--danger); font-weight: 500;
}
.hd-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.hd-danger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hd-tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--label2); }
.hd kbd { font: 600 11px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; display: inline-block; padding: 3px 5px; border-radius: 5px; background: var(--bg2); border: .5px solid var(--sep); color: var(--label); margin-right: 2px; }
.hd-secondary {
	border: 0; background: var(--bg2); color: var(--accent); font-weight: 500; border-radius: 10px; min-height: 40px; padding: 0 14px;
	transition: background .15s var(--ease);
}
.hd-secondary:hover { background: var(--bg3); }

/* ---------- Kaufleiste ---------- */

.hd-buy {
	grid-area: buy;
	display: flex; align-items: center; justify-content: flex-end; gap: 24px;
	padding: 0 24px;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
	border-top: .5px solid var(--sep);
}
.hd-qty { display: inline-flex; align-items: center; background: var(--bg2); border-radius: 10px; }
.hd-qty button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; border-radius: 10px; }
.hd-qty button:hover { background: var(--bg3); }
.hd-qty input { width: 48px; height: 44px; border: 0; background: none; text-align: center; font: 600 17px/1 inherit; font-family: inherit; color: var(--label); -moz-appearance: textfield; }
.hd-qty input::-webkit-outer-spin-button, .hd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.hd-price { display: flex; flex-direction: column; align-items: flex-end; }
.hd-price strong { font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hd-price small { font-size: 12px; color: var(--label2); }
.hd-primary {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	min-width: 200px; height: 48px; padding: 0 28px; border: 0; border-radius: 999px;
	background: var(--accent); color: #fff !important; font-size: 17px; font-weight: 600;
	transition: background .15s var(--ease), transform .15s var(--ease);
}
.hd-primary:hover { background: var(--accent-press); }
.hd-primary:active { transform: scale(.98); }
.hd-primary.is-loading span { opacity: .8; }
.hd-primary.is-loading::before {
	content: ""; width: 16px; height: 16px; margin-right: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
	animation: hd-spin .8s linear infinite;
}
@keyframes hd-spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */

.hd-toast {
	position: fixed; left: 50%; bottom: 104px; z-index: 100;
	display: flex; align-items: center; gap: 16px;
	max-width: calc(100vw - 32px);
	padding: 12px 18px; border-radius: 14px;
	background: rgba(29, 29, 31, .92); color: #fff; font-size: 14px;
	backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
	transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.hd-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.hd-toast.is-error { background: rgba(215, 0, 21, .95); }
.hd-toast button { border: 0; background: none; color: #64D2FF; font-weight: 600; padding: 4px 0; }

/* ---------- Mittlere Breite ---------- */

@media (max-width: 1240px) {
	.hd { grid-template-columns: 72px 280px minmax(0, 1fr) 260px; }
}

/* ---------- Handy & Tablet hochkant ---------- */

@media (max-width: 899px) {
	.hd {
		display: flex; flex-direction: column;
		height: calc(100dvh - var(--head));
		position: relative;
	}
	.hd-top { order: 1; padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
	.hd-top-left { display: none; }
	.hd-top-right .hd-sep, .hd-zoom-label, #hd-zoom-in, #hd-zoom-out { display: none; }
	.hd-stage { order: 2; flex: 1; padding: 12px; gap: 12px; min-height: 0; }
	.hd-status-hint { display: none; }
	.hd-tabs {
		order: 3; flex-direction: row; justify-content: space-around; padding: 4px 8px;
		border-right: 0; border-top: .5px solid var(--sep);
	}
	.hd-tabs button { flex: 1; padding: 6px 0; }
	.hd-tabs button[aria-selected="true"] { background: none; }
	.hd:not(.has-pane) .hd-tabs button[aria-selected="true"] { color: var(--label2); }
	.hd-buy { order: 4; gap: 12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); justify-content: space-between; }
	.hd-price { align-items: flex-start; order: -1; }
	.hd-price strong { font-size: 17px; }
	.hd-qty { display: none; }
	.hd-primary { min-width: 0; flex: 1; max-width: 240px; height: 44px; font-size: 16px; }

	.hd-panel, .hd-inspector {
		position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
		max-height: 72%; border: 0; border-radius: 16px 16px 0 0;
		box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
		transform: translateY(105%); transition: transform .3s var(--ease);
		padding-bottom: calc(24px + env(safe-area-inset-bottom));
	}
	.hd-panel::before, .hd-inspector::before {
		content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--bg3); margin: -8px auto 12px;
	}
	.hd.has-pane .hd-panel { transform: none; }
	.hd.has-selection:not(.has-pane) .hd-inspector { transform: none; max-height: 52%; }
	.hd-pane-close, .hd-insp-close { display: inline-grid; }
	.hd-grid { grid-template-columns: 1fr 1fr; }
	.hd-toast { bottom: 140px; }
}

@media (prefers-reduced-motion: reduce) {
	.hd *, .hd *::before, .hd *::after { transition-duration: .01ms !important; animation: none !important; }
	.hd-card { opacity: 1; transform: none; }
}


/* =====================================================================
   Ergänzungen für Poster: Kopfleiste, Prüfzeile, Fotofelder, Dialoge
   ===================================================================== */
.hd.is-loading { display: grid; place-items: center; }
.hd-fatal { padding: 32px; text-align: center; color: var(--label2); }
.hd-btn3d { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; margin-left: 4px; border: 0; border-radius: 999px; background: var(--bg3); font-size: 13px; font-weight: 600; transition: background .15s var(--ease); }
.hd-btn3d:hover { background: var(--accent-soft); color: var(--accent); }
.hd-btn3d svg { width: 18px; height: 18px; }
.hd-card.is-flip { animation: hd-flip .45s var(--ease); }
@keyframes hd-flip { 0% { transform: perspective(1400px) rotateY(0); } 45% { transform: perspective(1400px) rotateY(88deg); } 55% { transform: perspective(1400px) rotateY(-88deg); } 100% { transform: perspective(1400px) rotateY(0); } }
.hd-card { box-shadow: 0 40px 70px -28px rgba(0, 0, 0, .35), 0 14px 28px -14px rgba(0, 0, 0, .16), 0 0 0 .5px rgba(0, 0, 0, .08); }
.hd-checkbar { display: flex; justify-content: center; font-size: 13px; color: var(--label2); min-height: 28px; max-width: 640px; }
.hd-checkbar > span, .hd-checkbtn { display: inline-flex; align-items: center; gap: 8px; }
.hd-checkbar svg { width: 18px; height: 18px; color: #1F9D55; }
.hd-checkbar.is-warn svg { color: var(--warn); } .hd-checkbar.is-bad svg { color: var(--danger); }
.hd-checkbtn { border: 0; background: var(--bg); padding: 6px 12px; min-height: 36px; border-radius: 999px; box-shadow: 0 0 0 .5px var(--sep); text-align: left; font-size: 13px; }
.hd-checkbar.is-warn .hd-checkbtn { box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 55%, transparent); }
.hd-checkbar.is-bad .hd-checkbtn { box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.hd-checkbtn em { font-style: normal; color: var(--label3); }
.hd-checkbar .hd-checkbtn svg { flex: none; }

/* Seitenleiste */
.hd-panel h3 { margin-top: 20px; }
.hd-subhead { font-size: 12px; font-weight: 600; color: var(--label2); margin: 16px 0 6px; }
.hd-emptystate { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; border-radius: var(--radius); background: var(--bg2); text-align: center; color: var(--label2); }
.hd-emptystate strong { color: var(--label); font-size: 14px; }
.hd-emptystate p { margin: 0 0 8px; font-size: 13px; }
.hd-emptystate-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--accent); }
.hd-field { margin-bottom: 12px; }
.hd-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.hd-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 15px; color: var(--label); background: var(--bg2); border: 1px solid transparent; border-radius: 10px; resize: vertical; line-height: 1.35; }
.hd-field textarea:hover { background: var(--bg3); }
.hd-field textarea:focus { outline: none; background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hd-slot { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius); background: var(--bg2); margin-bottom: 8px; }
.hd-slot-thumb { width: 56px; height: 56px; border-radius: 8px; background: var(--bg3) center / cover no-repeat; box-shadow: inset 0 0 0 .5px var(--sep); }
.hd-slot-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-slot-main small { color: var(--label2); font-size: 12px; }
.hd-dpi { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hd-dpi-gut { background: color-mix(in srgb, #1F9D55 16%, transparent); color: #1A7F46; }
.hd-dpi-gelb { background: color-mix(in srgb, #E5A400 22%, transparent); color: #8A5B00; }
.hd-dpi-rot { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.hd-dpilist { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.hd-dpilist li { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: 8px; }
.hd-dpilist li.is-cur { background: var(--bg2); font-weight: 600; }
.hd-add-text { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hd-add-text button { min-height: 52px; }
.hd-add-script { font-family: "Great Vibes", cursive; font-size: 22px !important; }
.hd-shapes { grid-template-columns: repeat(3, 1fr); }
.hd-icons { grid-template-columns: repeat(4, 1fr); }
.hd-icon-btn { padding: 8px; color: var(--label); }
.hd-icon-btn svg { width: 100%; height: 100%; max-height: 44px; }
.hd-wide { width: 100%; display: flex !important; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.hd-wide svg { width: 20px; height: 20px; }
.hd-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-chiprow .hd-chip[aria-checked="true"] { background: var(--label); color: var(--bg); }
.hd-design-img { aspect-ratio: var(--hd-ar, 3 / 4); border-radius: 6px; }
.hd.is-wide .hd-grid { grid-template-columns: 1fr; }
/* durchsichtige Produkte (Sticker): Schachbrett hinter Miniaturen und Arbeitsfläche */
.hd.is-transparent .hd-design-img, .hd.is-transparent .hd-card { background-color: #fff; background-image: linear-gradient(45deg, #ececf0 25%, transparent 25%, transparent 75%, #ececf0 75%), linear-gradient(45deg, #ececf0 25%, transparent 25%, transparent 75%, #ececf0 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.hd.is-transparent .hd-card { background-color: #fff; }
.hd.is-transparent .hd-design-img svg { background: none; }
.hd-design-img svg { display: block; width: 100%; height: 100%; }
.hd-design-img { background: var(--bg3); }
.hd-switch { margin: 4px 0; }
.hd-layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hd-layer { display: flex; align-items: center; border-radius: 10px; }
.hd-layer.is-active { background: var(--accent-soft); }
.hd-layer.is-hidden .hd-layer-main { opacity: .45; }
.hd-layer-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0 8px; min-height: 44px; text-align: left; border-radius: 10px; font-size: 14px; }
.hd-layer-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-layer .hd-ibtn { width: 32px; height: 44px; }
.hd-sw-none { background: linear-gradient(135deg, transparent 46%, var(--danger) 47%, var(--danger) 53%, transparent 54%), var(--bg) !important; box-shadow: inset 0 0 0 1px var(--sep); }
.hd-sw-none[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.hd-ibtn[aria-pressed="true"] svg { stroke-width: 2.2; }
.hd-meta { font-size: 13px; color: var(--label2); margin: 0 0 6px; }
.hd-lead { color: var(--label2); margin: 0 0 8px; font-size: 13px; }

/* Kaufleiste */
.hd-buy { gap: 20px; }
.hd-sizes { display: flex; gap: 6px; margin-right: auto; }
.hd-size { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; min-height: 52px; padding: 4px 12px; border: 0; border-radius: 12px; background: var(--bg2); line-height: 1.25; transition: background .15s var(--ease), box-shadow .15s var(--ease); }
.hd-size strong { font-size: 14px; font-weight: 600; }
.hd-size small { font-size: 12px; color: var(--label2); }
.hd-size:hover { background: var(--bg3); }
.hd-sizes.is-single .hd-size { cursor: default; }
.hd-variant-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label2); }
.hd-variant-box[hidden] { display: none; }
.hd-variant-sel { min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--bg2); color: var(--label); font: inherit; font-size: 14px; max-width: 260px; }
.hd-size[aria-checked="true"] { background: var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.hd-buy-info { display: flex; align-items: center; gap: 16px; }
.hd-closed { position: absolute; left: 0; right: 0; bottom: 92px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 12px; background: var(--bg); box-shadow: var(--shadow); font-size: 13px; color: var(--label2); z-index: 5; }
.hd-primary:disabled { opacity: .45; cursor: default; }

/* Dialoge */
.hd-modal-bg { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: hd-fade .2s var(--ease); }
.hd-modal { width: min(520px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 18px; background: var(--bg); color: var(--label); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: hd-pop .25s var(--ease); overflow: hidden; }
.hd-modal-wide { width: min(980px, 100%); }
.hd-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 24px; }
.hd-modal-head h2 { font-size: 20px; }
.hd-modal-body { padding: 8px 24px 24px; overflow-y: auto; }
.hd-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.hd-check { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0; font-size: 14px; line-height: 1.45; cursor: pointer; }
.hd-check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.hd-note a, .hd-link { color: var(--accent); }
.hd-link { border: 0; background: none; padding: 4px 8px; min-height: 36px; font-size: 13px; }
.hd-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hd-checklist li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: start; font-size: 14px; }
.hd-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--warn); }
.hd-checklist .is-rot .hd-dot { background: var(--danger); }
.hd-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.hd-review-pic { position: relative; display: grid; place-items: center; background: var(--bg2); border-radius: 14px; padding: 16px; min-height: 300px; }
.hd-review-img { display: block; max-width: 100%; max-height: calc(100dvh - 190px); width: auto; height: auto; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .35), 0 0 0 .5px rgba(0, 0, 0, .1); }
.hd-review-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--label2); font-size: 13px; }
.hd-review-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; }
.hd-review-facts dt { color: var(--label2); } .hd-review-facts dd { margin: 0; font-weight: 600; }
.hd-review-hint { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px; color: var(--label2); }
.hd-review-hint svg { width: 18px; height: 18px; flex: none; color: var(--warn); }
.hd-review-hint.is-rot svg { color: var(--danger); }
.hd-3d { padding-bottom: 16px; }
.hd-3d-holder { height: min(62vh, 640px); min-height: 360px; }
.hd-spin { display: inline-block; width: 16px; height: 16px; margin-right: 8px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: hd-spin .8s linear infinite; vertical-align: -3px; }
.hd-review-load .hd-spin { border-color: var(--bg3); border-top-color: var(--accent); margin: 0; }
@keyframes hd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hd-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.hd-modal .hd-primary { min-width: 0; height: 44px; font-size: 16px; padding: 0 22px; }
.hd-modal .hd-secondary { min-height: 44px; }
.hd-primary.is-loading::before { content: ""; width: 16px; height: 16px; margin-right: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: hd-spin .8s linear infinite; }
.hd-top-right { flex-wrap: nowrap; }
.hd-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1240px) { .hd { grid-template-columns: 72px 288px minmax(0, 1fr) 264px; } .hd-btn3d span { display: none; } .hd-btn3d { width: 36px; padding: 0; justify-content: center; } }
@media (max-width: 899px) {
  .hd-review { grid-template-columns: 1fr; gap: 12px; }
  .hd-modal-body { padding: 8px 16px 20px; }
  .hd-review-img { max-height: 36dvh; }
  .hd-sizes { margin-right: 0; flex: 1; }
  .hd-size { min-width: 0; flex: 1; padding: 4px 6px; }
  .hd-buy-info { display: none; }
  .hd-variant-box span { display: none; }
  .hd-variant-sel { max-width: 150px; }
  .hd-buy { flex-wrap: wrap; height: auto; gap: 8px; padding-top: 8px; }
  .hd-buy .hd-primary { flex: 1 1 100%; max-width: none; }
  .hd-top-right .hd-sep { display: none; }
  .hd-top-right #hd-zoom-in, .hd-top-right #hd-zoom-out, .hd-zoom-label { display: none; }
  .hd-btn3d { margin-left: 0; }
  .hd-closed { bottom: 8px; position: static; box-shadow: none; padding: 0; width: auto; background: none; flex-basis: 100%; }
  .hd-checkbar { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .hd-modal, .hd-modal-bg { animation: none; } }

.hd-add-text { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hd-add-text button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-add-heading { font-size: 18px !important; } .hd-add-script { font-size: 20px !important; }
.hd-range { grid-template-columns: 112px 1fr; }
.hd-range span { white-space: nowrap; }

/* ---- Produkt-Reiter (Optionen, Felder, Varianten, Bogen, Kontur) ---- */
.hd-opt h3 { margin-top: 20px; }
.hd-opt-sw { display: flex; flex-wrap: wrap; gap: 10px; }
.hd-opt-cur { display: block; margin-top: 8px; font-size: 13px; color: var(--label2); }
.hd-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-seg button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--bg2); font-weight: 500; font-size: 14px; }
.hd-seg button:hover { background: var(--bg3); }
.hd-seg button[aria-checked="true"] { background: var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.hd-dist { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.hd-dist-cell { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--label2); text-align: center; }
.hd-dist-cell input, .hd-stepper input, .hd-field input, .hd-variant input, .hd-opt textarea { font: inherit; font-size: 15px; color: var(--label); background: var(--bg2); border: 0; border-radius: 10px; min-height: 44px; padding: 0 12px; width: 100%; }
.hd-dist-cell input, .hd-stepper input { text-align: center; }
.hd-opt textarea { padding: 10px 12px; resize: vertical; }
.hd-dist-total.is-bad { color: var(--danger); }
.hd-stepper { display: flex; align-items: center; gap: 8px; max-width: 200px; }
.hd-field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 13px; color: var(--label2); }
.hd-field small { font-size: 12px; }
.hd-variants { display: flex; flex-direction: column; gap: 8px; }
.hd-variant { display: grid; grid-template-columns: 1fr 1fr 64px 44px; gap: 6px; align-items: center; }
.hd-info { background: var(--bg2); border-radius: 12px; padding: 12px 14px; margin: 8px 0 4px; font-size: 13px; }
.hd-info summary { font-weight: 600; cursor: pointer; min-height: 24px; }
.hd-info ul { margin: 8px 0 0; padding-left: 18px; color: var(--label2); }
.hd-info li { margin: 6px 0; }
.hd-wide { width: 100%; margin: 4px 0 8px; }
.hd-bogen-row { display: flex; gap: 14px; align-items: flex-start; }
.hd-bogen-row svg { flex: none; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.hd-kontur-info dl { margin: 0 0 8px; }

/* Vereinfachte Ansicht (profile.simple): feste Gestaltung, nur Foto, Textfelder und Farbwelt */
.hd.is-simple .hd-inspector { display: none; }
.hd.is-simple .hd-stage { cursor: default; }
.hd-range { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; margin: 10px 0 4px; font-size: 13px; color: var(--label2); }
.hd-range input[type="range"] { grid-column: 1 / -1; width: 100%; min-height: 32px; accent-color: var(--accent); }
.hd-range output { font-variant-numeric: tabular-nums; text-align: right; }
.hd-note-rights { background: var(--bg2); border-radius: 12px; padding: 10px 12px; margin: 12px 0 4px; }
.hd-simple-info { margin: 16px 0 0; padding-left: 18px; font-size: 12px; color: var(--label2); }
.hd-simple-info li { margin: 6px 0; }
.hd.is-simple .hd-slot { grid-template-columns: 56px 1fr; }
.hd.is-simple .hd-slot > button { grid-column: 1 / -1; }
/* Mehrere Fotofelder (Meilensteinposter): Raster der Felder, aktives Feld blau, dpi als farbiger Punkt */
.hd-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.hd-slot-mini { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 0; border-radius: 12px; background: var(--bg2); color: var(--label); font: inherit; cursor: pointer; position: relative; min-height: 44px; }
.hd-slot-mini .hd-slot-thumb { width: 100%; height: auto; aspect-ratio: 1; }
.hd-slot-mini small { font-size: 11px; color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hd-slot-mini.is-current { box-shadow: inset 0 0 0 2px var(--accent); }
.hd-slot-mini.hd-dpi-gelb::after, .hd-slot-mini.hd-dpi-rot::after { content: ""; position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #FF9F0A; box-shadow: 0 0 0 2px var(--bg); }
.hd-slot-mini.hd-dpi-rot::after { background: #FF3B30; }
.hd-range > span { grid-row: 1; grid-column: 1; }
.hd-range > output { grid-row: 1; grid-column: 2; }
.hd-range > input { grid-row: 2; }
