.tsd {
	--tsd-ink: #171717;
	--tsd-muted: #6b7280;
	--tsd-line: #dfe3e8;
	--tsd-accent: #e24b43;
	--tsd-panel: #f6f7f9;
	clear: both;
	margin: 2rem 0;
	border: 1px solid var(--tsd-line);
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	color: var(--tsd-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.tsd *, .tsd *::before, .tsd *::after { box-sizing: border-box; }
.tsd__header {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--tsd-line);
}
.tsd__header h2 { margin: .15rem 0 0; font-size: 1.45rem; }
.tsd__eyebrow { color: var(--tsd-accent); font-weight: 700; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.tsd button, .tsd input, .tsd select { font: inherit; }
.tsd button { cursor: pointer; }
.tsd button:disabled { cursor: not-allowed; opacity: .4; }
.tsd__reset { border: 0; background: none; color: var(--tsd-muted); text-decoration: underline; }
.tsd__layout { display: grid; grid-template-columns: minmax(210px, 260px) minmax(320px, 1fr); min-height: 590px; }
.tsd__tools { padding: 1.25rem; background: var(--tsd-panel); border-right: 1px solid var(--tsd-line); }
.tsd__tool-group { padding-bottom: 1.15rem; margin-bottom: 1.15rem; border-bottom: 1px solid var(--tsd-line); }
.tsd__tool-group > label { display: block; margin-bottom: .55rem; font-weight: 700; font-size: .9rem; }
.tsd__input-row { display: flex; gap: .45rem; }
.tsd input[type="text"], .tsd select {
	width: 100%; min-width: 0; height: 40px; padding: 0 .7rem;
	border: 1px solid #c8ced6; border-radius: 7px; background: #fff;
}
.tsd input[type="file"] { width: 100%; font-size: .8rem; }
.tsd small { display: block; margin-top: .45rem; color: var(--tsd-muted); line-height: 1.35; }
.tsd__primary { border: 0; border-radius: 7px; padding: 0 .85rem; background: var(--tsd-ink); color: #fff; font-weight: 700; }
.tsd__format-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: .4rem; margin-top: .55rem; }
.tsd__format-row input, .tsd__format-row button {
	width: 100%; height: 36px; padding: 4px; border: 1px solid #c8ced6; border-radius: 6px; background: #fff;
}
.tsd__format-row button.is-active { background: var(--tsd-ink); color: #fff; }
.tsd__layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.tsd__layer-actions button { padding: .55rem .35rem; border: 1px solid #c8ced6; border-radius: 6px; background: #fff; font-size: .78rem; }
.tsd__layer-actions .tsd__danger { grid-column: 1 / -1; color: #b42318; }
.tsd__status { min-height: 1.3em; color: var(--tsd-muted); font-size: .8rem; }
.tsd__workspace { min-width: 0; padding: 1rem; background: #eceef2; }
.tsd__hint { margin: 0 0 .75rem; text-align: center; color: var(--tsd-muted); font-size: .8rem; }
.tsd__stage-wrap { display: flex; justify-content: center; overflow: hidden; }
.tsd__stage { position: relative; width: min(100%, 520px); aspect-ratio: 1 / 1; background: #fff; box-shadow: 0 8px 30px rgba(23,23,23,.08); user-select: none; touch-action: none; }
.tsd__product-image { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.tsd__print-area {
	position: absolute; left: 29%; top: 25%; width: 42%; height: 52%;
	border: 2px dashed rgba(60,64,67,.45); overflow: hidden; touch-action: none;
}
.tsd__print-area::before {
	content: "PRINT AREA"; position: absolute; right: 4px; bottom: 2px; z-index: 0;
	color: rgba(60,64,67,.4); font-size: 8px; letter-spacing: .08em; pointer-events: none;
}
.tsd-layer {
	position: absolute; left: 50%; top: 50%; z-index: 2; min-width: 36px;
	transform-origin: center; cursor: move; touch-action: none;
}
.tsd-layer__content { display: block; width: 100%; pointer-events: none; white-space: nowrap; text-align: center; line-height: 1.08; }
.tsd-layer--image .tsd-layer__content { height: auto; }
.tsd-layer.is-selected { outline: 1px dashed var(--tsd-accent); }
.tsd-layer__handle {
	display: none; position: absolute; width: 18px; height: 18px; z-index: 4;
	border: 2px solid #fff; border-radius: 50%; background: var(--tsd-accent);
	box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.tsd-layer.is-selected .tsd-layer__handle { display: block; }
.tsd-layer__handle--resize { right: -10px; bottom: -10px; cursor: nwse-resize; }
.tsd-layer__handle--rotate { left: 50%; top: -28px; transform: translateX(-50%); cursor: grab; background: #25282d; }
.tsd-layer__handle--rotate::after { content: ""; position: absolute; left: 7px; top: 16px; height: 10px; border-left: 1px solid #25282d; }
@media (max-width: 720px) {
	.tsd__layout { grid-template-columns: 1fr; }
	.tsd__tools { border-right: 0; border-bottom: 1px solid var(--tsd-line); }
	.tsd__workspace { padding: .7rem; }
}

/* Saved design previews: cart, order details, emails and admin orders. */
.tsd-flat-preview {
	display: inline-block; width: 150px; height: auto; max-width: 100%; margin-top: 8px;
	border: 1px solid #e1e4e8; border-radius: 6px; background: #fff;
}
.tsd-flat-preview--cart { width: 100px; margin-top: 0; }
.tsd-flat-preview--checkout { width: 90px; }
.tsd-flat-preview--order, .tsd-flat-preview--admin { width: 180px; }
.tsd-preview {
	position: relative; display: inline-block; width: 150px; max-width: 100%;
	aspect-ratio: 1 / 1; overflow: hidden; background: #fff; vertical-align: middle;
	border: 1px solid #e1e4e8; border-radius: 6px; container-type: inline-size;
}
.tsd-preview--cart { width: 100px; }
.tsd-preview--checkout { width: 90px; margin-top: 8px; }
.tsd-preview--order, .tsd-preview--admin { width: 180px; margin-top: 10px; }
.tsd-preview__product {
	display: block !important; position: absolute !important; inset: 0 !important;
	width: 100% !important; height: 100% !important; object-fit: contain !important;
	margin: 0 !important; padding: 0 !important; max-width: none !important;
}
.tsd-preview__print-area {
	position: absolute; left: 29%; top: 25%; width: 42%; height: 52%;
	overflow: hidden;
}
.tsd-preview__layer {
	position: absolute !important; display: block !important; transform-origin: center !important;
	margin: 0 !important; padding: 0 !important; max-width: none !important;
}
.tsd-preview__layer--image { height: auto !important; }
.tsd-preview__layer--text {
	line-height: 1.08 !important; text-align: center !important; white-space: nowrap !important;
}
