/* =========================================================================
 * Customized Products v5 – product page CTA + dark-mode designer lightbox
 *
 *   ┌ Back · Undo Redo Flip Save My-designs · Shuffle ┐┌ Sidebar ─────────┐
 *   │ tip                      [+][−][100%][Fit]|[✋] ││ 1 Artwork      ▾ │
 *   │       product (drag = rotate, zoom / pan)       ││ 2 Colors       ▾ │
 *   │    ⟲ [Front][Right 3D][Back][Left 3D]           ││ 3 Options      ▾ │
 *   └─────────────────────────────────────────────────┘│ $ price  [Cart]  │
 *                                                      └──────────────────┘
 * Mobile: stage on top, sidebar below, sticky action bar.
 * ====================================================================== */

/* ---------- Product page call-to-action (inherits the theme) ---------- */

.cpsd-cta-wrap {
	width: 100%;
	flex-basis: 100%;
	margin: 0 0 1.25em;
}

.cpsd-cta-wrap [hidden] {
	display: none !important;
}

.cpsd-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 14px 24px;
	font: inherit;
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	background: linear-gradient(135deg, #0f172a, #1e293b);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 10px 22px -12px rgba(15, 23, 42, 0.8);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.cpsd-cta:hover,
.cpsd-cta:focus-visible {
	color: #fff;
	box-shadow: 0 0 0 2px #22d3ee, 0 14px 26px -12px rgba(8, 145, 178, 0.8);
	transform: translateY(-1px);
}

.cpsd-cta:focus-visible {
	outline: 3px solid #67e8f9;
	outline-offset: 2px;
}

.cpsd-cta__hint {
	margin: 0.5em 0 0;
	font-size: 0.875em;
	opacity: 0.75;
}

.cpsd-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
	padding: 10px;
	background: #f0fdfa;
	border: 1px solid #99f6e4;
	border-radius: 12px;
}

.cpsd-summary__img {
	flex: none;
	width: 64px;
	height: 64px;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
}

.cpsd-summary__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.9em;
}

.cpsd-summary__text strong {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #0f766e;
}

.cpsd-cart-thumb {
	object-fit: contain;
	background: #fff;
}

html.cpsd-lock-scroll,
html.cpsd-lock-scroll body {
	overflow: hidden !important;
}

/* ---------- Lightbox shell (dark) ---------- */

.cpsd-modal {
	--bg: #0b0f17;
	--stage: #111827;
	--panel: #151b26;
	--panel-2: #1c2431;
	--line: rgba(148, 163, 184, 0.16);
	--line-2: rgba(148, 163, 184, 0.28);
	--text: #e5e7eb;
	--muted: #94a3b8;
	--accent: #22d3ee;
	--accent-2: #06b6d4;
	--accent-ink: #042f37;
	--danger: #f87171;
	--ok: #34d399;
	--radius: 14px;
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	color: var(--text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	background: rgba(2, 6, 12, 0.82);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity 0.22s ease;
	color-scheme: dark;
}

.cpsd-modal.is-open {
	opacity: 1;
}

.cpsd-modal[hidden],
.cpsd-modal [hidden] {
	display: none !important;
}

.cpsd-modal *,
.cpsd-modal *::before,
.cpsd-modal *::after {
	box-sizing: border-box;
}

.cpsd-modal button {
	font: inherit;
	color: inherit;
	letter-spacing: normal;
	text-transform: none;
	-webkit-tap-highlight-color: transparent;
}

.cpsd-modal :focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.cpsd-icon {
	flex: none;
	display: block;
}

.cpsd-shell {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	width: 100%;
	height: 100%;
	margin: auto;
	background: var(--bg);
	transform: scale(0.985);
	transition: transform 0.22s ease;
}

.cpsd-modal.is-open .cpsd-shell {
	transform: none;
}

@media (min-width: 1100px) {
	.cpsd-shell {
		width: calc(100% - 48px);
		height: calc(100% - 48px);
		max-width: 1560px;
		overflow: hidden;
		border: 1px solid var(--line);
		border-radius: 20px;
		box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9);
	}
}

/* ---------- Stage column ---------- */

.cpsd-stagecol {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	background: radial-gradient(120% 90% at 50% 40%, #1f2937 0%, var(--stage) 55%, #0b0f17 100%);
}

.cpsd-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 64px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--line);
}

/* Breadcrumb: Home › Customizer › Product */
.cpsd-crumbs {
	min-width: 0;
}

.cpsd-crumbs ol {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	white-space: nowrap;
}

.cpsd-crumbs li {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.cpsd-crumbs li + li::before {
	content: "›";
	margin: 0 8px;
	color: var(--muted);
}

.cpsd-crumbs a,
.cpsd-crumbs button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 4px 6px;
	font: inherit;
	color: var(--muted);
	text-decoration: none;
	background: none;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.cpsd-crumbs a:hover,
.cpsd-crumbs button:hover {
	color: var(--text);
	background: rgba(148, 163, 184, 0.12);
}

.cpsd-crumbs [aria-current="page"] span {
	overflow: hidden;
	font-weight: 700;
	color: var(--text);
	text-overflow: ellipsis;
}

.cpsd-topbar__actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: 6px;
}

.cpsd-tgroup {
	display: inline-flex;
	padding: 2px;
	background: rgba(15, 23, 42, 0.7);
	border: 1px solid var(--line);
	border-radius: 999px;
}

.cpsd-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0 0 0 4px;
	padding: 0;
	color: var(--text);
	background: rgba(148, 163, 184, 0.12);
	border: 1px solid var(--line-2);
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.cpsd-close:hover {
	color: #fff;
	background: #ef4444;
	border-color: #ef4444;
	transform: rotate(90deg);
}

.cpsd-close:focus-visible,
.cpsd-tbtn:focus-visible,
.cpsd-crumbs a:focus-visible,
.cpsd-crumbs button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Micro-interactions: everything pressable gives a little. */
.cpsd-tbtn:active:not(:disabled),
.cpsd-btn:active:not(:disabled),
.cpsd-zbtn:active,
.cpsd-view-pill:active,
.cpsd-swatch:active,
.cpsd-card:active,
.cpsd-chip:active,
.cpsd-stepper__btn:active,
.cpsd-segbtn:active {
	transform: scale(0.95);
}

.cpsd-tbtn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 38px;
	margin: 0;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 600;
	background: transparent;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.cpsd-tbtn:hover:not(:disabled) {
	background: rgba(148, 163, 184, 0.14);
}

.cpsd-tbtn:disabled {
	opacity: 0.35;
	cursor: default;
}

.cpsd-tbtn--icon {
	padding: 8px 10px;
}

.cpsd-tbtn--icon span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.cpsd-tbtn--back {
	border: 1px solid var(--line-2);
}

.cpsd-tbtn--accent {
	color: var(--accent-ink);
	background: var(--accent);
}

.cpsd-tbtn--accent:hover:not(:disabled) {
	background: #67e8f9;
}

.cpsd-tbtn.is-spinning .cpsd-icon {
	animation: cpsd-spin 0.5s ease;
}

@keyframes cpsd-spin {
	from { transform: rotate(0); }
	to { transform: rotate(360deg); }
}

.cpsd-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	overflow: hidden;
	touch-action: none;
	perspective: 1600px;
}

.cpsd-flipper {
	position: absolute;
	inset: 0;
	transition: transform 0.18s ease-in, opacity 0.18s ease-in;
}

/* Turntable pill / keyboard switch: quick fade between angles. */
.cpsd-flipper.is-fading {
	opacity: 0;
	transition: opacity 0.14s ease-out;
}

.cpsd-flipper.is-flipping-out {
	opacity: 0.2;
	transform: rotateY(90deg);
}

.cpsd-flipper.is-flipping-in {
	transform: rotateY(-90deg);
	transition: none;
}

.cpsd-world,
.cpsd-stage .canvas-container {
	position: absolute !important;
	inset: 0;
}

.cpsd-world {
	pointer-events: none;
	overflow: hidden;
}

.cpsd-layer {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	max-width: none !important;
	height: auto;
	transform-origin: 0 0;
	pointer-events: none;
	user-select: none;
}

/* The mockup photo, multiplied over the color layer and the artwork. */
.cpsd-shading {
	mix-blend-mode: multiply;
	-webkit-user-drag: none;
}

.cpsd-stage .upper-canvas {
	outline: none;
}

.cpsd-stage.is-zoomed .upper-canvas {
	cursor: grab !important;
}

.cpsd-stage.is-pan-mode .upper-canvas {
	cursor: grab !important;
}

.cpsd-stage.is-panning .upper-canvas,
.cpsd-stage.is-orbiting .upper-canvas {
	cursor: grabbing !important;
}

/* ---------- Floating zoom HUD (top right) ---------- */

.cpsd-hud {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	background: rgba(15, 23, 42, 0.85);
	border: 1px solid var(--line);
	border-radius: 999px;
	box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.8);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.cpsd-hud__sep {
	width: 1px;
	height: 20px;
	margin: 0 3px;
	background: var(--line-2);
}

.cpsd-zbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 34px;
	margin: 0;
	padding: 0 8px;
	font-size: 13px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--text);
	background: transparent;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cpsd-zbtn:hover {
	background: rgba(148, 163, 184, 0.16);
}

.cpsd-zbtn:focus-visible,
.cpsd-view-pill:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}

.cpsd-zbtn.is-active {
	color: var(--accent-ink);
	background: var(--accent);
}

.cpsd-zoom-value {
	min-width: 58px;
}

/* ---------- Turntable angle pills (bottom center) ---------- */

.cpsd-views {
	position: absolute;
	left: 50%;
	bottom: 16px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 2px;
	max-width: calc(100% - 28px);
	padding: 4px;
	overflow-x: auto;
	background: rgba(15, 23, 42, 0.85);
	border: 1px solid var(--line);
	border-radius: 999px;
	box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.85);
	transform: translateX(-50%);
	scrollbar-width: none;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.cpsd-views::-webkit-scrollbar {
	display: none;
}

.cpsd-views__icon {
	display: inline-flex;
	flex: none;
	padding: 0 6px 0 8px;
	color: var(--muted);
}

.cpsd-view-pill {
	flex: none;
	margin: 0;
	padding: 7px 14px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	color: var(--muted);
	background: transparent;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cpsd-view-pill:hover {
	color: var(--text);
	background: rgba(148, 163, 184, 0.14);
}

.cpsd-view-pill.is-active {
	color: var(--accent-ink);
	background: var(--accent);
}

.cpsd-side-badge {
	position: absolute;
	bottom: 70px;
	left: 50%;
	margin: 0;
	padding: 6px 14px;
	font-size: 13px;
	color: var(--muted);
	background: rgba(15, 23, 42, 0.85);
	border: 1px solid var(--line);
	border-radius: 999px;
	transform: translateX(-50%);
	pointer-events: none;
}

.cpsd-stage__tip {
	position: absolute;
	top: 18px;
	left: 16px;
	max-width: calc(100% - 330px);
	margin: 0;
	font-size: 12px;
	line-height: 1.45;
	color: var(--muted);
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.cpsd-stage.is-zoomed .cpsd-stage__tip {
	opacity: 0;
}

@media (max-width: 1180px) {
	.cpsd-stage__tip {
		display: none;
	}
}

.cpsd-drop {
	position: absolute;
	inset: 12px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(8, 145, 178, 0.18);
	border: 2px dashed var(--accent);
	border-radius: var(--radius);
	pointer-events: none;
}

.cpsd-drop span {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	font-weight: 700;
}

.cpsd-loading {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: var(--muted);
	background: var(--stage);
}

.cpsd-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid rgba(148, 163, 184, 0.25);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: cpsd-spin 0.8s linear infinite;
}

.cpsd-toast {
	position: absolute;
	left: 50%;
	top: 16px;
	z-index: 6;
	max-width: min(92%, 460px);
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: #1e293b;
	border: 1px solid var(--line-2);
	border-radius: 12px;
	box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.9);
	opacity: 0;
	transform: translate(-50%, -8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.cpsd-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.cpsd-toast--success {
	border-color: rgba(52, 211, 153, 0.6);
}

.cpsd-toast--error {
	background: #3b1219;
	border-color: rgba(248, 113, 113, 0.7);
}

/* ---------- Sidebar ---------- */

.cpsd-sidebar {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: var(--panel);
	border-left: 1px solid var(--line);
}

.cpsd-sidebar__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px 14px;
	border-bottom: 1px solid var(--line);
}

.cpsd-sidebar__head h2 {
	margin: 2px 0 4px;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.2;
	color: #fff;
}

.cpsd-sidebar__head p {
	margin: 0;
	font-size: 13px;
	color: var(--muted);
}

.cpsd-kicker {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--accent);
}

.cpsd-x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 1px solid var(--line-2);
	border-radius: 50%;
	cursor: pointer;
}

.cpsd-x:hover {
	background: rgba(148, 163, 184, 0.14);
}

.cpsd-steps {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #334155 transparent;
}

.cpsd-step {
	border-bottom: 1px solid var(--line);
}

.cpsd-step__h {
	margin: 0;
	font-size: inherit;
}

.cpsd-step__head {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 14px 20px;
	text-align: left;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.cpsd-step__head:hover {
	background: rgba(148, 163, 184, 0.06);
}

.cpsd-step__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 30px;
	height: 30px;
	font-size: 14px;
	font-weight: 800;
	color: var(--muted);
	border: 2px solid var(--line-2);
	border-radius: 50%;
}

.cpsd-step.is-open .cpsd-step__num {
	color: var(--accent-ink);
	background: var(--accent);
	border-color: var(--accent);
}

.cpsd-step__titles {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.cpsd-step__kicker {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

.cpsd-step__title {
	font-size: 16px;
	font-weight: 700;
	color: #fff;
}

.cpsd-step__summary {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 0;
	overflow: hidden;
	font-size: 12px;
	color: var(--muted);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.cpsd-step.is-open .cpsd-step__summary {
	display: none;
}

.cpsd-dots {
	display: inline-flex;
	gap: 3px;
}

.cpsd-dots i {
	width: 12px;
	height: 12px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
}

.cpsd-step__chev {
	color: var(--muted);
	transition: transform 0.2s ease;
}

.cpsd-step.is-open .cpsd-step__chev {
	transform: rotate(180deg);
}

.cpsd-step__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 2px 20px 20px;
}

.cpsd-label {
	margin: 4px 0 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.cpsd-note {
	margin: 0;
	font-size: 12.5px;
	color: var(--muted);
}

.cpsd-inline {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

.cpsd-grow {
	flex: 1;
	min-width: 0;
}

.cpsd-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	font-size: 13px;
	color: var(--muted);
}

.cpsd-input {
	width: 100%;
	min-height: 42px;
	margin: 0;
	padding: 9px 12px;
	font: inherit;
	font-size: 15px;
	color: var(--text);
	background: var(--panel-2);
	border: 1px solid var(--line-2);
	border-radius: 10px;
	box-shadow: none;
}

.cpsd-input:focus {
	border-color: var(--accent);
	outline: none;
}

select.cpsd-input {
	appearance: auto;
}

.cpsd-color {
	width: 48px;
	height: 42px;
	padding: 3px;
	background: var(--panel-2);
	border: 1px solid var(--line-2);
	border-radius: 10px;
	cursor: pointer;
}

/* Upload */

.cpsd-upload {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px;
	background: rgba(34, 211, 238, 0.06);
	border: 2px dashed rgba(34, 211, 238, 0.45);
	border-radius: var(--radius);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cpsd-upload:hover,
.cpsd-upload:focus-within {
	background: rgba(34, 211, 238, 0.12);
	border-color: var(--accent);
}

.cpsd-upload input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.cpsd-upload__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	color: var(--accent-ink);
	background: var(--accent);
	border-radius: 12px;
}

.cpsd-upload strong {
	display: block;
	color: #fff;
}

.cpsd-upload small {
	display: block;
	font-size: 12px;
	color: var(--muted);
}

/* Buttons */

.cpsd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	margin: 0;
	padding: 10px 16px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.1;
	background: var(--panel-2);
	border: 1px solid var(--line-2);
	border-radius: 10px;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.cpsd-btn:active {
	transform: translateY(1px);
}

.cpsd-btn--primary {
	min-height: 50px;
	padding: 12px 22px;
	font-size: 16px;
	color: var(--accent-ink) !important;
	background: linear-gradient(135deg, #67e8f9, var(--accent-2));
	border: 0;
	border-radius: 999px;
	box-shadow: 0 12px 26px -12px rgba(34, 211, 238, 0.7);
}

.cpsd-btn--primary:hover {
	filter: brightness(1.06);
}

.cpsd-btn--accent {
	color: var(--accent-ink) !important;
	background: var(--accent);
	border-color: var(--accent);
}

.cpsd-btn--ghost {
	background: transparent;
}

.cpsd-btn--ghost:hover {
	background: rgba(148, 163, 184, 0.12);
}

.cpsd-btn--sm {
	min-height: 34px;
	padding: 6px 12px;
	font-size: 13px;
}

.cpsd-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.cpsd-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	margin: 0;
	padding: 6px 11px;
	font-size: 13px;
	font-weight: 600;
	background: var(--panel-2);
	border: 1px solid var(--line-2);
	border-radius: 999px;
	cursor: pointer;
}

.cpsd-chip:hover {
	border-color: var(--accent);
}

.cpsd-chip--danger {
	color: var(--danger);
}

.cpsd-chip--danger:hover {
	border-color: var(--danger);
}

/* Range sliders */

.cpsd-range {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	color: var(--muted);
}

.cpsd-range > span {
	display: flex;
	justify-content: space-between;
}

.cpsd-range output {
	font-variant-numeric: tabular-nums;
	color: var(--text);
}

.cpsd-range input {
	width: 100%;
	accent-color: var(--accent);
}

/* Items list */

.cpsd-items {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.cpsd-item {
	display: flex;
	align-items: center;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 10px;
}

.cpsd-item.is-active {
	border-color: var(--accent);
}

.cpsd-item__name {
	display: flex;
	align-items: center;
	flex: 1;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 8px 10px;
	text-align: left;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.cpsd-item__name span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.cpsd-item.is-elsewhere .cpsd-item__name {
	color: var(--muted);
}

.cpsd-item__view {
	flex: none;
	margin-left: auto;
	padding: 2px 7px;
	font-size: 11px;
	font-style: normal;
	font-weight: 600;
	color: var(--muted);
	background: rgba(148, 163, 184, 0.14);
	border-radius: 999px;
}

.cpsd-item.is-active .cpsd-item__view {
	color: var(--accent-ink);
	background: var(--accent);
}

/* "Adding to the Back view" / "No artwork area on this angle" */
.cpsd-view-note {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	padding: 8px 10px;
	font-size: 13px;
	color: var(--accent);
	background: rgba(34, 211, 238, 0.1);
	border-radius: 10px;
}

.cpsd-view-note[hidden] {
	display: none;
}

.cpsd-view-note.is-warning {
	color: #fde68a;
	background: rgba(234, 179, 8, 0.12);
}

.cpsd-view-note .cpsd-chip {
	margin-left: auto;
}

.cpsd-step__body.is-disabled .cpsd-upload,
.cpsd-step__body.is-disabled .cpsd-label,
.cpsd-step__body.is-disabled .cpsd-inline {
	opacity: 0.45;
	pointer-events: none;
}

.cpsd-item__x {
	display: inline-flex;
	margin: 0;
	padding: 8px 10px;
	color: var(--muted);
	background: transparent;
	border: 0;
	cursor: pointer;
}

.cpsd-item__x:hover {
	color: var(--danger);
}

.cpsd-quality {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 10px;
	font-size: 13px;
	color: #fde68a;
	background: rgba(234, 179, 8, 0.12);
	border-radius: 10px;
}

/* Color slots & swatches */

.cpsd-slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
	gap: 6px;
}

.cpsd-slot {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	min-height: 40px;
	margin: 0;
	padding: 6px 10px 6px 6px;
	font-size: 13px;
	font-weight: 600;
	text-align: left;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 10px;
	cursor: pointer;
}

.cpsd-slot.is-active {
	border-color: var(--accent);
	box-shadow: inset 0 0 0 1px var(--accent);
}

.cpsd-slot__chip {
	flex: none;
	width: 26px;
	height: 26px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 7px;
}

.cpsd-slot__label {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.cpsd-gradbox {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px;
	background: rgba(15, 23, 42, 0.55);
	border: 1px solid var(--line);
	border-radius: 12px;
}

.cpsd-seg {
	display: flex;
	padding: 3px;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 999px;
}

.cpsd-segbtn {
	flex: 1;
	min-height: 34px;
	margin: 0;
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 700;
	background: transparent;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

.cpsd-segbtn.is-active {
	color: var(--accent-ink);
	background: var(--accent);
}

.cpsd-gradbox__ends {
	display: flex;
	gap: 6px;
}

.cpsd-end {
	display: flex;
	align-items: center;
	flex: 1;
	gap: 8px;
	margin: 0;
	padding: 6px 10px 6px 6px;
	font-size: 13px;
	font-weight: 600;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 10px;
	cursor: pointer;
}

.cpsd-end.is-active {
	border-color: var(--accent);
}

.cpsd-end__chip {
	width: 22px;
	height: 22px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
}

.cpsd-palette__for {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--muted);
}

.cpsd-swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
	gap: 7px;
}

.cpsd-swatch {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	min-height: 0;
	margin: 0;
	padding: 0;
	background: var(--sw);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	cursor: pointer;
	transition: transform 0.12s ease;
}

.cpsd-swatch:hover {
	transform: scale(1.08);
}

.cpsd-swatch.is-active {
	box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent);
}

.cpsd-swatch--custom {
	overflow: hidden;
	background: conic-gradient(#ef4444, #eab308, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444);
}

.cpsd-swatch--custom input {
	position: absolute;
	inset: -6px;
	width: calc(100% + 12px);
	height: calc(100% + 12px);
	opacity: 0;
	cursor: pointer;
}

/* Pattern pills & cards */

.cpsd-pills {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 2px;
	scrollbar-width: none;
}

.cpsd-pills--wrap {
	flex-wrap: wrap;
}

.cpsd-pill {
	flex: none;
	min-height: 34px;
	margin: 0;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	background: var(--panel-2);
	border: 1px solid var(--line-2);
	border-radius: 999px;
	cursor: pointer;
}

.cpsd-pill small {
	font-weight: 500;
	color: var(--muted);
}

.cpsd-pill.is-active {
	color: var(--accent-ink);
	background: var(--accent);
	border-color: var(--accent);
}

.cpsd-pill.is-active small {
	color: var(--accent-ink);
}

.cpsd-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

.cpsd-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 6px;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 12px;
	cursor: pointer;
}

.cpsd-card svg {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	border-radius: 8px;
}

.cpsd-card.is-active {
	border-color: var(--accent);
	box-shadow: inset 0 0 0 1px var(--accent);
}

/* Patch size / style / backing */

.cpsd-seg--full .cpsd-segbtn {
	min-height: 38px;
}

.cpsd-backings {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.cpsd-backing {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	margin: 0;
	padding: 10px;
	text-align: left;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 12px;
	cursor: pointer;
}

.cpsd-backing small {
	color: var(--muted);
}

.cpsd-backing.is-active {
	border-color: var(--accent);
	box-shadow: inset 0 0 0 1px var(--accent);
}

.cpsd-backing__swatch {
	width: 100%;
	height: 34px;
	margin-bottom: 4px;
	background: #e5e7eb;
	border-radius: 8px;
}

.cpsd-backing__swatch--iron {
	background: linear-gradient(135deg, #f8fafc, #cbd5e1 45%, #f1f5f9 55%, #94a3b8);
}

.cpsd-backing__swatch--velcro {
	background: repeating-radial-gradient(circle at 30% 30%, #475569 0 1px, #1e293b 1px 3px);
}

.cpsd-backing__swatch--adhesive {
	background: linear-gradient(135deg, #fef3c7 0 70%, #f8fafc 70%);
}

.cpsd-backing__swatch--sew {
	background: repeating-linear-gradient(45deg, #e2e8f0 0 4px, #cbd5e1 4px 8px);
}

.cpsd-field--qty input {
	max-width: 140px;
}

/* Footer quantity stepper */

.cpsd-stepper {
	display: inline-flex;
	flex: none;
	align-items: center;
	padding: 3px;
	background: var(--panel-2);
	border: 1px solid var(--line-2);
	border-radius: 999px;
}

.cpsd-stepper__btn {
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--text);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.cpsd-stepper__btn:hover {
	background: rgba(148, 163, 184, 0.16);
}

.cpsd-stepper__input {
	width: 46px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: center;
	color: var(--text);
	background: transparent;
	border: 0;
	-moz-appearance: textfield;
	appearance: textfield;
}

.cpsd-stepper__input::-webkit-outer-spin-button,
.cpsd-stepper__input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.cpsd-stepper__input:focus-visible {
	outline: 2px solid var(--accent);
	border-radius: 6px;
}

/* Price change pulse */
.cpsd-price__total {
	transition: color 0.2s ease;
}

.cpsd-price__total.is-changed {
	animation: cpsd-pulse 0.4s ease;
}

@keyframes cpsd-pulse {
	40% {
		color: var(--accent);
		transform: scale(1.06);
	}
}

/* Mobile step switcher (hidden on desktop, where the accordion is beside the stage) */

.cpsd-stepnav {
	display: none;
	gap: 6px;
	padding: 0 16px 12px;
	overflow-x: auto;
	scrollbar-width: none;
}

.cpsd-stepnav::-webkit-scrollbar {
	display: none;
}

.cpsd-stepnav__btn {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	margin: 0;
	padding: 6px 12px 6px 6px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	color: var(--muted);
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.cpsd-stepnav__btn span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	font-size: 12px;
	color: var(--text);
	background: rgba(148, 163, 184, 0.18);
	border-radius: 50%;
}

.cpsd-stepnav__btn.is-active {
	color: var(--text);
	border-color: var(--accent);
}

.cpsd-stepnav__btn.is-active span {
	color: var(--accent-ink);
	background: var(--accent);
}

/* Browser-draft restore banner */

.cpsd-restore {
	position: absolute;
	top: 64px;
	right: 14px;
	left: 14px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: fit-content;
	max-width: calc(100% - 28px);
	margin: 0 auto;
	padding: 8px 8px 8px 14px;
	font-size: 13px;
	background: rgba(15, 23, 42, 0.94);
	border: 1px solid var(--accent);
	border-radius: 14px;
	box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.9);
	animation: cpsd-drop-in 0.25s ease;
}

.cpsd-restore[hidden] {
	display: none;
}

@keyframes cpsd-drop-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
}

/* Fill type preview chip (Solid / Linear / Radial) */
.cpsd-seg__preview {
	flex: none;
	width: 30px;
	margin: 3px 3px 3px 6px;
	border: 1px solid var(--line-2);
	border-radius: 8px;
}

/* Upload card as a drop target */
.cpsd-upload em {
	font-style: normal;
	font-weight: 500;
	color: var(--muted);
}

.cpsd-upload.is-dragover {
	border-color: var(--accent);
	background: rgba(34, 211, 238, 0.12);
	transform: scale(1.01);
}

/* Action bar: with a quantity stepper, price + stepper share the first row
 * and Add to Cart spans the second. */

.cpsd-actionbar--qty {
	flex-wrap: wrap;
	row-gap: 10px;
}

.cpsd-actionbar.cpsd-actionbar--qty .cpsd-btn--primary {
	flex: 1 1 100%;
	justify-content: center;
	min-height: 50px;
	font-size: 16px;
}

.cpsd-price__total,
.cpsd-price__note {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Action bar */

.cpsd-actionbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
	background: #0f141d;
	border-top: 1px solid var(--line);
}

.cpsd-price {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.cpsd-actionbar .cpsd-btn--primary {
	flex: none;
	white-space: nowrap;
}

.cpsd-price__label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

.cpsd-price__total {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.15;
	color: #fff;
	font-variant-numeric: tabular-nums;
}

.cpsd-price__note {
	font-size: 12px;
	color: var(--muted);
}

/* Drafts sheet */

.cpsd-sheet {
	position: absolute;
	inset: 0;
	z-index: 8;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.cpsd-sheet__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 12, 0.7);
}

.cpsd-sheet__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: min(560px, 100%);
	max-height: min(80vh, 680px);
	padding: 18px;
	background: var(--panel);
	border: 1px solid var(--line-2);
	border-radius: 18px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
}

.cpsd-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.cpsd-sheet__head h3 {
	margin: 0;
	font-size: 18px;
	color: #fff;
}

.cpsd-drafts {
	min-height: 80px;
	overflow-y: auto;
}

.cpsd-draftlist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cpsd-draft {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 12px;
}

.cpsd-draft.is-current {
	border-color: var(--accent);
}

.cpsd-draft img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
}

.cpsd-draft__title {
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.cpsd-draft__actions {
	display: flex;
	gap: 6px;
}

.cpsd-draft__actions .cpsd-btn--accent {
	flex: 1;
}

/* Busy overlay */

.cpsd-busy {
	position: absolute;
	inset: 0;
	z-index: 9;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(2, 6, 12, 0.72);
}

.cpsd-busy__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	min-width: 260px;
	padding: 24px;
	background: var(--panel);
	border: 1px solid var(--line-2);
	border-radius: 16px;
}

.cpsd-progress {
	width: 100%;
	height: 6px;
	overflow: hidden;
	background: rgba(148, 163, 184, 0.2);
	border-radius: 999px;
}

.cpsd-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--accent);
	transition: width 0.2s ease;
}

/* ---------- Artwork step: Upload & text | Stock art tabs ---------- */

.cpsd-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	margin: 0 0 14px;
	padding: 4px;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 12px;
}

.cpsd-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	margin: 0;
	padding: 6px 10px;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--muted);
	background: transparent;
	border: 0;
	border-radius: 9px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cpsd-tab:hover {
	color: var(--text);
}

.cpsd-tab.is-active {
	color: var(--accent-ink);
	background: var(--accent);
}

.cpsd-tab:focus-visible,
.cpsd-clip:focus-visible,
.cpsd-tier:focus-visible,
.cpsd-drawer-handle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.cpsd-tabpanel[hidden] {
	display: none;
}

/* Stock art grid */
.cpsd-clipgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
	gap: 8px;
	margin: 10px 0;
}

.cpsd-clip {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-height: 96px;
	margin: 0;
	padding: 8px 6px;
	font: inherit;
	font-size: 11px;
	line-height: 1.2;
	text-align: center;
	color: var(--muted);
	background: #f8fafc;
	border: 1px solid var(--line);
	border-radius: 12px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cpsd-clip[hidden] {
	display: none;
}

.cpsd-clip svg {
	width: 56px;
	height: 56px;
}

.cpsd-clip span {
	color: #334155;
}

.cpsd-clip:hover {
	border-color: var(--accent);
	box-shadow: 0 6px 16px -10px rgba(34, 211, 238, 0.9);
	transform: translateY(-2px);
}

.cpsd-clip:active {
	transform: scale(0.96);
}

/* ---------- Pre-flight: live DPI badge + background knock-out ---------- */

.cpsd-preflight {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
}

.cpsd-preflight[hidden] {
	display: none;
}

.cpsd-dpi {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 32px;
	padding: 5px 12px 5px 10px;
	font-size: 12px;
	font-weight: 700;
	border: 1px solid transparent;
	border-radius: 999px;
}

.cpsd-dpi i {
	width: 9px;
	height: 9px;
	background: currentColor;
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.cpsd-dpi b {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
}

.cpsd-dpi.is-good {
	color: #4ade80;
	background: rgba(34, 197, 94, 0.12);
	border-color: rgba(34, 197, 94, 0.35);
}

.cpsd-dpi.is-ok {
	color: #facc15;
	background: rgba(234, 179, 8, 0.12);
	border-color: rgba(234, 179, 8, 0.35);
}

.cpsd-dpi.is-bad {
	color: #f87171;
	background: rgba(239, 68, 68, 0.14);
	border-color: rgba(239, 68, 68, 0.4);
	animation: cpsd-pulse-warn 1.6s ease-in-out 2;
}

@keyframes cpsd-pulse-warn {
	50% {
		box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
	}
}

.cpsd-knockout[hidden] {
	display: none;
}

.cpsd-knockout:disabled {
	opacity: 0.5;
	cursor: default;
}

/* Vector recolor swatches */
.cpsd-colorslots[hidden],
.cpsd-texttune[hidden] {
	display: none;
}

.cpsd-colorslots__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}

.cpsd-colorslot {
	position: relative;
	display: inline-flex;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border: 2px solid var(--line-2);
	border-radius: 50%;
	cursor: pointer;
}

.cpsd-colorslot input {
	position: absolute;
	inset: -8px;
	width: calc(100% + 16px);
	height: calc(100% + 16px);
	padding: 0;
	border: 0;
	cursor: pointer;
}

/* ---------- Footer: volume tiers + roster ---------- */

.cpsd-tiers {
	display: flex;
	flex: 1 1 100%;
	gap: 6px;
	margin: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.cpsd-tiers::-webkit-scrollbar {
	display: none;
}

.cpsd-tier {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	align-items: center;
	min-width: 72px;
	margin: 0;
	padding: 6px 8px;
	font: inherit;
	font-size: 11px;
	line-height: 1.25;
	color: var(--muted);
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.cpsd-tier b {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--text);
}

.cpsd-tier.is-active {
	color: var(--accent);
	background: rgba(34, 211, 238, 0.1);
	border-color: var(--accent);
}

.cpsd-tier:disabled {
	cursor: default;
}

/* Last row: [Team roster] [Add to Cart] */
.cpsd-actionbar__cta {
	display: flex;
	flex: none;
	gap: 8px;
}

.cpsd-actionbar--qty .cpsd-actionbar__cta {
	flex: 1 1 100%;
}

.cpsd-actionbar__cta .cpsd-roster-btn {
	flex: none;
	min-height: 50px;
}

.cpsd-actionbar.cpsd-actionbar--qty .cpsd-actionbar__cta .cpsd-btn--primary {
	flex: 1 1 0;
}

.cpsd-roster-btn.is-active {
	color: var(--accent);
	border-color: var(--accent);
}

.cpsd-stepper__btn:disabled,
.cpsd-stepper__input:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* ---------- Team roster sheet ---------- */

.cpsd-roster__card {
	width: min(680px, calc(100vw - 24px));
	max-height: min(86vh, 760px);
	overflow-y: auto;
}

.cpsd-roster__opts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 12px;
}

.cpsd-roster__scroll {
	max-height: 44vh;
	overflow: auto;
	border: 1px solid var(--line);
	border-radius: 12px;
}

.cpsd-roster__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.cpsd-roster__table th {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 8px 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-align: left;
	text-transform: uppercase;
	color: var(--muted);
	background: var(--panel-2);
}

.cpsd-roster__table td {
	padding: 4px;
	border-top: 1px solid var(--line);
}

.cpsd-roster__table .cpsd-input {
	width: 100%;
	min-height: 40px;
}

.cpsd-roster__num {
	max-width: 72px;
	text-align: center;
}

.cpsd-roster__qty {
	max-width: 70px;
}

.cpsd-roster__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px;
	margin: 12px 0 6px;
}

.cpsd-roster__paste {
	flex: 1;
	min-width: 220px;
}

.cpsd-roster__paste summary {
	min-height: 32px;
	padding: 6px 0;
	font-size: 13px;
	color: var(--accent);
	cursor: pointer;
}

.cpsd-roster__paste textarea {
	width: 100%;
	font-family: ui-monospace, Consolas, monospace;
}

.cpsd-roster__total {
	margin: 6px 0 12px;
	font-weight: 700;
}

.cpsd-roster__actions {
	display: flex;
	justify-content: space-between;
	gap: 10px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Bottom-sheet handle: only shown on phones. */
.cpsd-drawer-handle {
	display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
	.cpsd-shell {
		grid-template-columns: minmax(0, 1fr) 360px;
	}

	.cpsd-tbtn span {
		display: none;
	}

	.cpsd-tbtn {
		padding: 8px 11px;
	}
}

/* Accordion bodies slide in when a step opens. */
.cpsd-step.is-open .cpsd-step__body {
	animation: cpsd-fade-up 0.24s ease;
}

@keyframes cpsd-fade-up {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

@media (max-width: 800px) {
	.cpsd-modal {
		font-size: 14px;
	}

	.cpsd-topbar {
		min-height: 56px;
		gap: 6px;
	}

	/* Breadcrumb collapses to the product name. */
	.cpsd-crumbs li:not([aria-current]) {
		display: none;
	}

	.cpsd-crumbs [aria-current="page"] span {
		max-width: 34vw;
	}

	.cpsd-topbar__actions {
		gap: 2px;
	}

	.cpsd-close {
		width: 38px;
		height: 38px;
	}

	.cpsd-stepnav {
		display: flex;
	}

	.cpsd-restore {
		top: 10px;
	}

	.cpsd-actionbar {
		flex-wrap: wrap;
	}

	.cpsd-shell {
		display: flex;
		flex-direction: column;
		overflow-y: auto;
	}

	.cpsd-stagecol {
		flex: none;
		height: min(58vh, 520px);
		height: min(58svh, 520px);
	}

	.cpsd-topbar {
		padding: 8px 10px;
	}

	.cpsd-sidebar {
		flex: none;
		border-left: 0;
		border-top: 1px solid var(--line);
	}

	.cpsd-sidebar__head {
		padding: 14px 16px 10px;
	}

	.cpsd-sidebar__head h2 {
		font-size: 17px;
	}

	.cpsd-sidebar__head p,
	.cpsd-sidebar__head .cpsd-x,
	.cpsd-stage__tip {
		display: none;
	}

	.cpsd-steps {
		overflow: visible;
	}

	.cpsd-step__head {
		padding: 12px 16px;
	}

	.cpsd-step__body {
		padding: 2px 16px 16px;
	}

	.cpsd-actionbar {
		position: sticky;
		bottom: 0;
		z-index: 3;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	}

	.cpsd-price__total {
		font-size: 19px;
	}

	.cpsd-btn--primary {
		padding: 12px 16px;
	}
}

@media (max-width: 600px) {
	.cpsd-hud {
		top: 8px;
		right: 8px;
	}

	.cpsd-zbtn {
		min-width: 32px;
		height: 32px;
		padding: 0 6px;
	}

	.cpsd-zoom-value {
		min-width: 48px;
	}

	.cpsd-views {
		bottom: 10px;
	}

	.cpsd-views__icon {
		display: none;
	}

	.cpsd-view-pill {
		padding: 7px 11px;
		font-size: 12px;
	}

	.cpsd-side-badge {
		bottom: 58px;
	}
}

@media (max-width: 400px) {
	.cpsd-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cpsd-topbar {
		padding: 8px 6px;
	}

	.cpsd-tbtn,
	.cpsd-tbtn--icon {
		padding: 8px 7px;
	}

	.cpsd-crumbs [aria-current="page"] span {
		max-width: 22vw;
	}
}

/* =========================================================================
 * Phones (< 768 px): bottom-sheet drawer
 *   canvas stays in the upper 55 % of the screen; the tools live in a sheet
 *   that snaps between collapsed (handle + price bar), half (45 %) and full.
 *   Heights follow the visual viewport (--cpsd-vvh) so the on-screen
 *   keyboard never clips the sheet; 16 px inputs stop iOS focus-zoom.
 * ====================================================================== */
@media (max-width: 767px) {
	.cpsd-modal {
		height: var(--cpsd-vvh, 100dvh);
		bottom: auto;
	}

	.cpsd-shell {
		position: relative;
		display: block;
		height: 100%;
		overflow: hidden;
	}

	.cpsd-stagecol {
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		height: 55%;
	}

	.cpsd-sidebar {
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 6;
		height: 45%;
		border-top: 1px solid var(--line-2);
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -18px 40px -18px rgba(0, 0, 0, 0.9);
		transition: height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
	}

	.cpsd-sidebar.is-dragging {
		transition: none;
	}

	.cpsd-modal[data-drawer="full"] .cpsd-sidebar {
		height: calc(100% - 56px);
	}

	.cpsd-modal[data-drawer="collapsed"] .cpsd-sidebar {
		height: auto;
	}

	.cpsd-modal[data-drawer="collapsed"] .cpsd-steps,
	.cpsd-modal[data-drawer="collapsed"] .cpsd-stepnav {
		display: none;
	}

	.cpsd-drawer-handle {
		display: flex;
		flex: none;
		align-items: center;
		justify-content: center;
		height: 26px;
		cursor: grab;
		touch-action: none;
	}

	.cpsd-drawer-handle span {
		width: 44px;
		height: 5px;
		background: var(--line-2);
		border-radius: 999px;
	}

	.cpsd-sidebar.is-dragging .cpsd-drawer-handle {
		cursor: grabbing;
	}

	.cpsd-sidebar__head {
		display: none;
	}

	.cpsd-stepnav {
		flex: none;
		padding-top: 2px;
	}

	.cpsd-steps {
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.cpsd-actionbar {
		position: static;
		flex: none;
		padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
	}

	.cpsd-tiers {
		order: -1;
	}

	/* 16 px fields: no automatic zoom when the keyboard opens. */
	.cpsd-modal input,
	.cpsd-modal select,
	.cpsd-modal textarea {
		font-size: 16px;
	}

	.cpsd-views {
		bottom: 8px;
	}

	.cpsd-roster__card {
		width: 100vw;
		max-height: 92%;
		border-radius: 20px 20px 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cpsd-modal,
	.cpsd-shell,
	.cpsd-flipper,
	.cpsd-toast,
	.cpsd-step__chev,
	.cpsd-zbtn,
	.cpsd-view-pill,
	.cpsd-close,
	.cpsd-stepper__btn,
	.cpsd-sidebar,
	.cpsd-clip,
	.cpsd-tab,
	.cpsd-tier {
		transition: none !important;
	}

	.cpsd-step.is-open .cpsd-step__body,
	.cpsd-dpi.is-bad,
	.cpsd-restore,
	.cpsd-price__total.is-changed {
		animation: none !important;
	}

	*:active {
		transform: none !important;
	}

	.cpsd-tbtn.is-spinning .cpsd-icon,
	.cpsd-spinner {
		animation-duration: 0s;
	}
}
