/* Mermed label designer. To match the site, override these variables on .mld in the theme. */
.mld {
	--mld-ink: #12303b;
	--mld-muted: #55707a;
	--mld-line: #c3d2d7;
	--mld-liner: #d5e3e6;
	--mld-ghost: #e4eef0;
	--mld-accent: #0b5f6b;
	--mld-accent-text: #ffffff;
	--mld-tint: #e6f1f2;
	--mld-error: #b3261e;
	--mld-field: #ffffff;
	--mld-sticky-top: 0px;

	container-type: inline-size;
	color: var(--mld-ink);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

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

.mld .mld-status {
	margin: 0;
	padding: 32px 0;
}

.mld .mld-layout {
	display: grid;
	gap: 28px;
	grid-template-columns: minmax(0, 1fr);
}

.mld .mld-aside {
	display: contents;
}

/* Preview: the design sits on a strip of backing paper, as it does on the roll. */
.mld .mld-preview {
	background: var(--mld-field);
	margin: 0;
	padding: 8px 0 4px;
	position: sticky;
	top: var(--mld-sticky-top);
	z-index: 5;
}

.mld .mld-stage {
	position: relative;
}

.mld .mld-liner {
	align-items: center;
	background: var(--mld-liner);
	display: flex;
	gap: var(--mld-gap, 16px);
	justify-content: center;
	overflow: hidden;
	padding: 16px 0;
}

.mld .mld-label,
.mld .mld-ghost {
	border-radius: var(--mld-radius, 8px);
	flex: 0 0 auto;
	height: var(--mld-h, 160px);
	width: var(--mld-w, 240px);
}

.mld .mld-ghost {
	background: var(--mld-ghost);
}

.mld .mld-label {
	background: #ffffff;
	box-shadow: 0 0 0 1px rgba(18, 48, 59, 0.14);
	overflow: hidden;
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.mld .mld-label img {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	display: block;
	height: 100%;
	margin: 0;
	max-width: none;
	width: 100%;
}

.mld.is-added .mld-label {
	box-shadow: 0 14px 22px rgba(18, 48, 59, 0.28);
	transform: translateY(-6px) rotate(-2deg);
}

.mld .mld-dim {
	color: var(--mld-muted);
	font-size: 13px;
	margin: 6px auto 0;
	position: relative;
	text-align: center;
	width: var(--mld-w, 240px);
}

.mld .mld-dim span {
	background: var(--mld-field);
	padding: 0 8px;
	position: relative;
}

.mld .mld-dim::before {
	border-color: var(--mld-muted);
	border-style: solid;
	border-width: 0 1px 1px;
	content: "";
	height: 7px;
	left: 0;
	position: absolute;
	right: 0;
	top: 6px;
}

/* Order panel */
.mld .mld-order {
	border-top: 2px solid var(--mld-ink);
	order: 3;
	padding-top: 14px;
}

.mld .mld-total {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mld .mld-amount {
	font-size: 34px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1.15;
}

.mld .mld-tax,
.mld .mld-note,
.mld .mld-breakdown {
	color: var(--mld-muted);
	font-size: 14px;
}

.mld .mld-breakdown {
	list-style: none;
	margin: 6px 0 14px;
	padding: 0;
}

.mld .mld-breakdown li {
	list-style: none;
	margin: 0;
}

.mld .mld-note {
	margin: 10px 0 0;
}

.mld .mld-added-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 12px;
}

.mld .mld-actions {
	display: grid;
	gap: 8px;
}

/* Form */
.mld .mld-form {
	display: grid;
	gap: 26px;
	min-width: 0;
	order: 2;
}

.mld .mld-form > div:empty {
	display: none;
}

.mld .mld-group {
	border: 0;
	margin: 0;
	min-width: 0;
	padding: 0;
}

.mld .mld-group > legend,
.mld .mld-heading {
	display: block;
	float: none;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 10px;
	padding: 0;
	width: auto;
}

.mld .mld-choices {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.mld .mld-choice {
	cursor: pointer;
	display: block;
	font-weight: 400;
	margin: 0;
	position: relative;
}

.mld .mld-choice input {
	height: 1px;
	margin: 0;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.mld .mld-choice-body {
	align-items: center;
	background: var(--mld-field);
	border: 1px solid var(--mld-line);
	border-radius: 4px;
	display: flex;
	gap: 10px;
	height: 100%;
	min-height: 56px;
	padding: 9px 10px;
}

.mld .mld-choice:hover .mld-choice-body {
	border-color: var(--mld-accent);
}

.mld .mld-choice input:checked + .mld-choice-body {
	background: var(--mld-tint);
	border-color: var(--mld-accent);
	box-shadow: inset 0 0 0 1px var(--mld-accent);
}

.mld .mld-choice input:focus-visible + .mld-choice-body,
.mld .mld-input:focus-visible,
.mld .mld-btn:focus-visible,
.mld .mld-tier:focus-visible,
.mld .mld-step:focus-visible {
	outline: 2px solid var(--mld-accent);
	outline-offset: 2px;
}

.mld .mld-choice-text {
	font-size: 14px;
	line-height: 1.3;
	min-width: 0;
}

.mld .mld-choice-text strong {
	display: block;
	font-size: 15px;
	font-weight: 600;
}

.mld .mld-choice-text small {
	color: var(--mld-muted);
	font-size: 13px;
}

.mld .mld-thumb {
	border: 1px solid var(--mld-line);
	border-radius: 0;
	display: block;
	flex: 0 0 64px;
	height: auto;
	margin: 0;
	max-width: 64px;
}

.mld .mld-field {
	margin: 0 0 14px;
}

.mld .mld-field:last-child {
	margin-bottom: 0;
}

.mld .mld-field-label {
	align-items: baseline;
	display: flex;
	font-size: 15px;
	font-weight: 600;
	gap: 8px;
	justify-content: space-between;
	margin: 0 0 4px;
}

.mld .mld-field-label small {
	color: var(--mld-muted);
	font-size: 13px;
	font-weight: 400;
}

.mld .mld-input {
	background: var(--mld-field);
	border: 1px solid var(--mld-muted);
	border-radius: 4px;
	box-shadow: none;
	color: var(--mld-ink);
	font: inherit;
	height: 44px;
	margin: 0;
	max-width: 100%;
	padding: 0 12px;
	width: 100%;
}

.mld .mld-input[aria-invalid="true"] {
	border-color: var(--mld-error);
	box-shadow: inset 0 0 0 1px var(--mld-error);
}

.mld .mld-msg {
	color: var(--mld-error);
	font-size: 14px;
	margin: 5px 0 0;
}

.mld .mld-msg:empty {
	display: none;
}

.mld .mld-hint {
	color: var(--mld-muted);
	font-size: 14px;
	margin: 0 0 10px;
}

.mld .mld-logo-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.mld .mld-file {
	height: 1px;
	opacity: 0;
	position: absolute;
	width: 1px;
}

.mld .mld-file:focus-visible + .mld-btn {
	outline: 2px solid var(--mld-accent);
	outline-offset: 2px;
}

.mld .mld-btn {
	align-items: center;
	background: var(--mld-field);
	border: 1px solid var(--mld-accent);
	border-radius: 4px;
	box-shadow: none;
	color: var(--mld-accent);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 600;
	justify-content: center;
	letter-spacing: normal;
	line-height: 1.2;
	margin: 0;
	min-height: 44px;
	padding: 8px 16px;
	text-decoration: none;
	text-transform: none;
}

.mld .mld-btn:hover {
	background: var(--mld-tint);
	color: var(--mld-accent);
}

.mld .mld-btn-primary,
.mld .mld-btn-primary:hover {
	background: var(--mld-accent);
	color: var(--mld-accent-text);
}

.mld .mld-btn-primary:hover {
	filter: brightness(0.88);
}

.mld .mld-btn-wide {
	width: 100%;
}

.mld .mld-btn[disabled] {
	cursor: progress;
	opacity: 0.65;
}

.mld .mld-stepper {
	display: flex;
	margin-bottom: 12px;
	max-width: 190px;
}

.mld .mld-step {
	background: var(--mld-field);
	border: 1px solid var(--mld-muted);
	border-radius: 4px 0 0 4px;
	color: var(--mld-ink);
	cursor: pointer;
	flex: 0 0 48px;
	font-size: 22px;
	height: 44px;
	line-height: 1;
	margin: 0;
	padding: 0;
}

.mld .mld-step:hover {
	background: var(--mld-tint);
	color: var(--mld-ink);
}

.mld .mld-step + .mld-input + .mld-step {
	border-radius: 0 4px 4px 0;
}

.mld .mld-stepper .mld-input {
	-moz-appearance: textfield;
	appearance: textfield;
	border-left: 0;
	border-radius: 0;
	border-right: 0;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.mld .mld-stepper .mld-input::-webkit-outer-spin-button,
.mld .mld-stepper .mld-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.mld .mld-tiers {
	display: grid;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mld .mld-tiers li {
	border-top: 1px solid var(--mld-line);
	list-style: none;
	margin: 0;
}

.mld .mld-tier {
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--mld-ink);
	cursor: pointer;
	display: flex;
	font: inherit;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	justify-content: space-between;
	letter-spacing: normal;
	margin: 0;
	padding: 9px 8px;
	text-transform: none;
	width: 100%;
}

.mld .mld-tier:hover {
	background: var(--mld-tint);
	color: var(--mld-ink);
}

.mld .mld-tier[aria-current="true"] {
	background: var(--mld-tint);
	font-weight: 700;
}

.mld [inert] {
	opacity: 0.55;
}

/* Two columns once the designer itself is wide enough, whatever the theme's page width. */
@container (min-width: 780px) {
	.mld .mld-layout {
		align-items: start;
		gap: 44px;
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	}

	.mld .mld-aside {
		display: block;
		position: sticky;
		top: calc(var(--mld-sticky-top) + 16px);
	}

	.mld .mld-preview {
		padding-top: 0;
		position: static;
	}

	.mld .mld-order {
		margin-top: 20px;
	}

	.mld .mld-choices-wide {
		grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.mld .mld-label {
		transition: none;
	}

	.mld.is-added .mld-label {
		transform: none;
	}
}
