.mbcd-app:has(.mbcd-template[data-mbcd-template="custom"]) .mbcd-template-picker {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mbcd-app:has(.mbcd-template[data-mbcd-template="custom"]) .mbcd-template {
	flex-direction: column;
	gap: 3px;
	justify-content: center;
	min-height: 58px;
	padding: 5px 4px;
}

.mbcd-app:has(.mbcd-template[data-mbcd-template="custom"]) .mbcd-template__swatch {
	width: 42px;
	height: 26px;
	flex: 0 0 26px;
}

.mbcd-template__swatch--custom {
	background: #fffaf2;
}

.mbcd-template__swatch--custom::before {
	inset: 4px 6px;
	border: 1px solid #ee6b2f;
	border-radius: 2px;
	background: #fff;
}

.mbcd-template__swatch--custom i {
	top: 9px;
	left: 11px;
	width: 17px;
	height: 10px;
	border: 0;
	border-radius: 0;
	background:
		linear-gradient(#1b484a, #1b484a) 0 1px / 17px 2px no-repeat,
		linear-gradient(#7b8b90, #7b8b90) 0 7px / 12px 1px no-repeat;
	transform: none;
}

.mbcd-template__swatch--custom i::before,
.mbcd-template__swatch--custom i::after {
	display: none;
}

.mbcd-template__swatch--custom b {
	top: 1px;
	right: 1px;
	left: auto;
	width: 13px;
	height: 13px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #ff9800;
	box-shadow: 0 1px 3px rgba(85, 43, 0, 0.24);
}

.mbcd-template__swatch--custom b::before,
.mbcd-template__swatch--custom b::after {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 1.5px;
	background: #fff;
	content: "";
	transform: translate(-50%, -50%);
}

.mbcd-template__swatch--custom b::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.mbcd-card--custom > :not(.mbcd-custom-preview) {
	display: none !important;
}

.mbcd-card:not(.mbcd-card--custom) .mbcd-custom-preview {
	display: none !important;
}

.mbcd-card--custom .mbcd-custom-preview {
	position: absolute;
	z-index: 1;
	inset: 0;
	display: block !important;
	overflow: hidden;
}

.mbcd-card--custom .mbcd-custom-preview > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: fill;
}

.mbcd-card--custom[data-custom-orientation="portrait"] {
	width: min(58%, 290px);
	aspect-ratio: 55 / 91;
}

.mbcd-custom-preview__fields {
	position: absolute;
	inset: 0;
}

.mbcd-custom-preview__fields > span {
	position: absolute;
	display: flex !important;
	align-items: center;
	isolation: isolate;
	box-sizing: border-box;
	padding: 0 0.18em;
	overflow: visible !important;
	font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
	font-size: var(--mbcd-custom-font-size, 3.2cqw);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1;
	text-overflow: clip;
	white-space: nowrap;
	transform: none !important;
}

.mbcd-custom-preview__fields > span::before,
.mbcd-custom-result__card span::before {
	position: absolute;
	z-index: 0;
	inset: calc(var(--mbcd-custom-mask-expand, 1px) * -1);
	border-radius: var(--mbcd-custom-mask-radius, 0);
	background-color: var(--mbcd-custom-mask-color, transparent);
	background-image: var(--mbcd-custom-mask-image, none);
	background-position: center;
	background-repeat: no-repeat;
	background-size: 100% 100%;
	content: "";
	pointer-events: none;
}

.mbcd-custom-preview__fields > span > [data-mbcd-custom-text],
.mbcd-custom-result__card span > [data-mbcd-custom-text] {
	position: relative;
	z-index: 1;
	display: block;
	flex: 0 0 auto;
	font: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	white-space: nowrap;
	transform: scaleX(var(--mbcd-custom-fit-scale, 1));
	transform-origin: left center;
}

.mbcd-custom-preview__fields > span[hidden] {
	display: none !important;
}

body.mbcd-custom-modal-open {
	overflow: hidden;
}

.mbcd-custom-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 24px;
	color: #18232b;
	font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

.mbcd-custom-modal[hidden] {
	display: none;
}

.mbcd-custom-modal [hidden] {
	display: none !important;
}

.mbcd-custom-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 24, 31, 0.72);
	backdrop-filter: blur(5px);
}

.mbcd-custom-modal__dialog {
	position: relative;
	display: flex;
	width: min(1080px, 100%);
	height: min(760px, calc(100vh - 48px));
	max-height: calc(100vh - 48px);
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(255, 155, 0, 0.42);
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 30px 80px rgba(5, 20, 29, 0.35);
}

.mbcd-custom-modal__header {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	justify-content: space-between;
	padding: 23px 28px 18px;
	border-bottom: 1px solid #ece5d9;
}

.mbcd-custom-modal__header .mbcd-custom-kicker {
	margin: 0 0 6px;
	color: #d66d00;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.12em;
}

.mbcd-custom-modal__header h3 {
	margin: 0;
	color: #101d25;
	font-size: clamp(20px, 2.3vw, 28px);
	line-height: 1.35;
}

.mbcd-custom-modal__close {
	display: grid;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	place-items: center;
	padding: 0;
	border: 1px solid #d9dfe2;
	border-radius: 50%;
	background: #fff;
	color: #51616a;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
}

.mbcd-custom-progress {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin: 0;
	padding: 14px 28px;
	border-bottom: 1px solid #eee8dd;
	background: #fbf8f2;
	list-style: none;
}

.mbcd-custom-progress li {
	position: relative;
	display: flex;
	gap: 8px;
	align-items: center;
	color: #8a9499;
	font-size: 12px;
	font-weight: 700;
}

.mbcd-custom-progress li::after {
	position: absolute;
	top: 50%;
	right: 10px;
	left: 42px;
	height: 1px;
	background: #d8dde0;
	content: "";
}

.mbcd-custom-progress li:last-child::after {
	display: none;
}

.mbcd-custom-progress span {
	position: relative;
	z-index: 1;
	display: grid;
	width: 25px;
	height: 25px;
	place-items: center;
	border: 1px solid #ccd4d8;
	border-radius: 50%;
	background: #fff;
	font-size: 11px;
}

.mbcd-custom-progress li.is-complete {
	color: #a86a2f;
}

.mbcd-custom-progress li.is-complete span {
	border-color: #f1b66f;
	background: #fff3e2;
	color: #c86200;
}

.mbcd-custom-progress li.is-active {
	color: #ad5000;
}

.mbcd-custom-progress li.is-active span {
	border-color: #ff9b00;
	background: #ff9b00;
	color: #fff;
}

.mbcd-custom-progress li.is-active::before {
	display: none;
}

.mbcd-custom-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 24px 28px;
	overflow: auto;
}

.mbcd-custom-step {
	min-height: 350px;
}

.mbcd-custom-step[hidden] {
	display: none;
}

.mbcd-custom-upload {
	display: grid;
	min-height: 275px;
	place-items: center;
	align-content: center;
	padding: 30px;
	border: 2px dashed #d8c5a9;
	border-radius: 16px;
	background: #fffaf1;
	text-align: center;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.mbcd-custom-upload.is-dragover {
	border-color: #ff9b00;
	background: #fff4df;
}

.mbcd-custom-upload__icon {
	display: grid;
	width: 54px;
	height: 54px;
	place-items: center;
	margin-bottom: 8px;
	border-radius: 50%;
	background: #ff9b00;
	color: #fff;
	font-size: 26px;
	font-weight: 700;
}

.mbcd-custom-upload h4,
.mbcd-custom-step__heading h4 {
	margin: 0;
	color: #15242c;
	font-size: 19px;
	line-height: 1.5;
}

.mbcd-custom-upload p {
	margin: 6px 0 16px;
	color: #6c777d;
	font-size: 13px;
}

.mbcd-custom-button,
.mbcd-custom-next,
.mbcd-custom-confirm,
.mbcd-custom-ocr-button {
	display: inline-flex;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	padding: 0 24px;
	border: 1px solid #ff9b00;
	border-radius: 999px;
	background: #ff9b00;
	color: #fff;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
}

.mbcd-custom-button input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.mbcd-custom-upload .mbcd-custom-upload__name {
	min-height: 20px;
	margin: 13px 0 0;
	color: #c25d00;
	font-weight: 700;
}

.mbcd-custom-notice {
	margin-top: 16px;
	padding: 12px 15px;
	border-left: 3px solid #1b6b69;
	border-radius: 4px;
	background: #f1f8f7;
	color: #3e5157;
	font-size: 12px;
	line-height: 1.65;
}

.mbcd-custom-notice strong,
.mbcd-custom-notice p {
	margin: 0;
}

.mbcd-custom-notice--important {
	border-left-color: #ff9b00;
	background: #fff7e8;
}

.mbcd-custom-step__heading {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 15px;
}

.mbcd-custom-step__heading p {
	margin: 4px 0 0;
	color: #68767c;
	font-size: 13px;
}

.mbcd-custom-orientation {
	display: flex;
	flex: 0 0 auto;
	padding: 3px;
	border-radius: 9px;
	background: #eef1f2;
}

.mbcd-custom-orientation button {
	padding: 8px 14px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: #66747a;
	font-weight: 700;
	cursor: pointer;
}

.mbcd-custom-orientation button.is-active {
	background: #fff;
	box-shadow: 0 2px 7px rgba(25, 45, 55, 0.12);
	color: #c45f00;
}

.mbcd-custom-pdf-page {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 10px;
	font-size: 12px;
	font-weight: 700;
}

.mbcd-custom-pdf-page select {
	min-width: 100px;
	padding: 6px 8px;
}

.mbcd-custom-crop {
	position: relative;
	display: grid;
	height: clamp(270px, calc(100vh - 430px), 420px);
	min-height: 270px;
	place-items: center;
	padding: 34px 22px 18px;
	overflow: hidden;
	border-radius: 13px;
	background:
		linear-gradient(45deg, rgba(255, 255, 255, 0.055) 25%, transparent 25%) 0 0 / 18px 18px,
		linear-gradient(-45deg, rgba(255, 255, 255, 0.055) 25%, transparent 25%) 0 9px / 18px 18px,
		#27343b;
}

.mbcd-custom-crop__frame {
	position: relative;
	width: min(100%, calc((100vh - 500px) * 1.655), 660px);
	min-width: 360px;
	aspect-ratio: 91 / 55;
	overflow: visible;
	border: 3px solid #ff9b00;
	border-radius: 5px;
	background: #fff;
	box-shadow:
		0 0 0 5px rgba(255, 155, 0, 0.2),
		0 18px 35px rgba(5, 15, 20, 0.35);
}

.mbcd-custom-crop__frame::before,
.mbcd-custom-crop__frame::after {
	position: absolute;
	z-index: 2;
	inset: 0;
	content: "";
	pointer-events: none;
}

.mbcd-custom-crop__frame::before {
	background:
		linear-gradient(
			to right,
			transparent calc(33.333% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(33.333% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(33.333% + 0.5px),
			transparent calc(33.333% + 0.5px),
			transparent calc(66.666% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(66.666% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(66.666% + 0.5px),
			transparent calc(66.666% + 0.5px)
		),
		linear-gradient(
			to bottom,
			transparent calc(33.333% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(33.333% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(33.333% + 0.5px),
			transparent calc(33.333% + 0.5px),
			transparent calc(66.666% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(66.666% - 0.5px),
			rgba(255, 155, 0, 0.32) calc(66.666% + 0.5px),
			transparent calc(66.666% + 0.5px)
		);
}

.mbcd-custom-crop__frame::after {
	inset: -8px;
	border: 2px solid rgba(255, 255, 255, 0.7);
	border-radius: 8px;
}

.mbcd-custom-crop__frame.is-portrait {
	width: min(46%, calc((100vh - 500px) * 0.604), 270px);
	min-width: 160px;
	aspect-ratio: 55 / 91;
}

.mbcd-custom-crop__label {
	position: absolute;
	z-index: 4;
	top: 9px;
	left: 10px;
	padding: 5px 9px;
	border-radius: 999px;
	background: #ff9b00;
	box-shadow: 0 3px 8px rgba(82, 43, 0, 0.25);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.2;
	pointer-events: none;
}

.mbcd-custom-crop__frame canvas {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	border-radius: 2px;
	box-shadow: none;
	cursor: grab;
	touch-action: none;
}

.mbcd-custom-mapping__canvas {
	position: relative;
	display: grid;
	min-height: 340px;
	place-items: center;
	padding: 36px 24px 22px;
	overflow: hidden;
	border-radius: 13px;
	background: #36444b;
}

.mbcd-custom-mapping__frame {
	position: relative;
	width: fit-content;
	max-width: 100%;
	line-height: 0;
	box-shadow:
		0 0 0 2px #ff9b00,
		0 12px 30px rgba(9, 24, 31, 0.34);
}

.mbcd-custom-mapping__label {
	position: absolute;
	z-index: 4;
	top: -26px;
	left: 0;
	display: flex;
	gap: 6px;
	align-items: center;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	pointer-events: none;
}

.mbcd-custom-mapping__label::before {
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	border-radius: 50%;
	background: #ff9b00;
	content: "";
}

.mbcd-custom-mapping canvas {
	display: block;
	max-width: 100%;
	max-height: 430px;
	box-shadow: none;
	cursor: grab;
	touch-action: none;
}

.mbcd-custom-crop canvas:active {
	cursor: grabbing;
}

.mbcd-custom-zoom {
	display: flex;
	gap: 12px;
	align-items: center;
	min-height: 43px;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 700;
}

.mbcd-custom-zoom label {
	flex: 0 0 auto;
	color: #26373f;
}

.mbcd-custom-zoom input {
	flex: 1 1 auto;
	accent-color: #ff9b00;
}

.mbcd-custom-zoom output {
	flex: 0 0 42px;
	color: #c45f00;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.mbcd-custom-zoom button,
.mbcd-custom-back,
.mbcd-custom-cancel {
	min-height: 40px;
	padding: 0 17px;
	border: 1px solid #d5dcdf;
	border-radius: 999px;
	background: #fff;
	color: #526168;
	font-weight: 700;
	cursor: pointer;
}

.mbcd-custom-ocr-button {
	min-height: 40px;
	background: #fff;
	color: #ca6200;
}

.mbcd-custom-ocr-button[disabled],
.mbcd-custom-next[disabled] {
	border-color: #d9dede;
	background: #e7ebeb;
	color: #9ba4a7;
	cursor: not-allowed;
}

.mbcd-custom-ocr-status {
	min-height: 21px;
	margin: -5px 0 12px;
	color: #596a71;
	font-size: 12px;
}

.mbcd-custom-mapping {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 210px;
	gap: 17px;
	align-items: start;
}

.mbcd-custom-mapping__canvas {
	min-height: 390px;
}

.mbcd-custom-mapping__canvas canvas {
	cursor: pointer;
}

.mbcd-custom-boxes,
.mbcd-custom-draw-box {
	position: absolute;
	pointer-events: none;
}

.mbcd-custom-boxes {
	inset: 0;
}

.mbcd-custom-box {
	position: absolute;
	box-sizing: border-box;
	border: 2px solid #ff8300;
	background: rgba(255, 155, 0, 0.14);
	color: #9f4d00;
	font-size: 10px;
	font-weight: 800;
	cursor: move;
	pointer-events: auto;
	touch-action: none;
}

.mbcd-custom-box.is-active {
	box-shadow: 0 0 0 2px rgba(255, 131, 0, 0.28);
}

.mbcd-custom-box span {
	position: absolute;
	z-index: 3;
	top: -21px;
	left: -2px;
	padding: 2px 5px;
	border-radius: 3px 3px 0 0;
	background: #ff8300;
	color: #fff;
	line-height: 1.4;
	white-space: nowrap;
	pointer-events: none;
}

.mbcd-custom-box i[data-mbcd-resize] {
	position: absolute;
	z-index: 2;
	width: 11px;
	height: 11px;
	border: 2px solid #ff8300;
	border-radius: 2px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(20, 35, 42, 0.22);
}

.mbcd-custom-box i[data-mbcd-resize="nw"] {
	top: -7px;
	left: -7px;
	cursor: nwse-resize;
}

.mbcd-custom-box i[data-mbcd-resize="ne"] {
	top: -7px;
	right: -7px;
	cursor: nesw-resize;
}

.mbcd-custom-box i[data-mbcd-resize="sw"] {
	bottom: -7px;
	left: -7px;
	cursor: nesw-resize;
}

.mbcd-custom-box i[data-mbcd-resize="se"] {
	right: -7px;
	bottom: -7px;
	cursor: nwse-resize;
}

.mbcd-custom-context-menu {
	position: fixed;
	z-index: 10020;
	min-width: 170px;
	padding: 5px;
	border: 1px solid #d6dde0;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(24, 38, 45, 0.2);
}

.mbcd-custom-context-menu[hidden] {
	display: none;
}

.mbcd-custom-context-menu button {
	width: 100%;
	padding: 9px 12px;
	border: 0;
	border-radius: 5px;
	background: transparent;
	color: #a93f20;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

.mbcd-custom-context-menu button:hover,
.mbcd-custom-context-menu button:focus-visible {
	background: #fff1e8;
	outline: none;
}

.mbcd-custom-draw-box {
	border: 2px dashed #1b6b69;
	background: rgba(27, 107, 105, 0.13);
}

.mbcd-custom-field-list {
	display: grid;
	gap: 7px;
}

.mbcd-custom-field-list > button {
	display: flex;
	min-height: 43px;
	align-items: center;
	justify-content: space-between;
	padding: 7px 10px;
	border: 1px solid #dce2e4;
	border-radius: 8px;
	background: #fff;
	color: #26373f;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	user-select: none;
}

.mbcd-custom-field-list > button:active,
.mbcd-custom-field-list > button.is-dragging {
	cursor: grabbing;
}

.mbcd-custom-field-list > button.is-dragging {
	opacity: 0.48;
}

.mbcd-custom-field-list > button.is-active {
	border-color: #ff9b00;
	box-shadow: 0 0 0 3px rgba(255, 155, 0, 0.12);
}

.mbcd-custom-field-list > button.is-set small {
	color: #147167;
}

.mbcd-custom-field-list > button:not(.is-set) small {
	color: #c55d00;
}

.mbcd-custom-field-list small {
	color: #969fa3;
	font-size: 10px;
	font-weight: 700;
}

.mbcd-custom-field-list .mbcd-custom-field-list__clear {
	justify-content: center;
	margin-top: 5px;
	border-style: dashed;
	color: #6b777c;
	font-size: 11px;
}

.mbcd-custom-result {
	display: grid;
	min-height: 390px;
	place-items: center;
	padding: 25px;
	border-radius: 15px;
	background: #eef2f2;
}

.mbcd-custom-result__card {
	position: relative;
	width: min(100%, 620px);
	aspect-ratio: 91 / 55;
	overflow: hidden;
	border-radius: 5px;
	background: #fff;
	box-shadow: 0 18px 40px rgba(20, 39, 49, 0.22);
}

.mbcd-custom-result__card.is-portrait {
	width: min(54%, 300px);
	aspect-ratio: 55 / 91;
}

.mbcd-custom-result__card > img {
	display: block;
	width: 100%;
	height: 100%;
}

.mbcd-custom-result__card > div {
	position: absolute;
	inset: 0;
}

.mbcd-custom-result__card span {
	position: absolute;
	display: flex;
	isolation: isolate;
	box-sizing: border-box;
	align-items: center;
	padding: 0 0.18em;
	overflow: visible;
	font-size: var(--mbcd-custom-result-font-size, 18px);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.mbcd-custom-error {
	margin-top: 14px;
	padding: 11px 13px;
	border: 1px solid #efaaa1;
	border-radius: 8px;
	background: #fff1ef;
	color: #a33121;
	font-size: 12px;
	font-weight: 700;
}

.mbcd-custom-modal__footer {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 16px 28px;
	border-top: 1px solid #e8e3da;
	background: #fff;
}

.mbcd-custom-modal__footer-spacer {
	flex: 1 1 auto;
}

.mbcd-custom-confirm {
	min-width: 180px;
}

.mbcd-custom-next,
.mbcd-custom-confirm {
	min-width: 130px;
}

@media (max-width: 920px) {
	.mbcd-app:has(.mbcd-template[data-mbcd-template="custom"]) .mbcd-template-picker {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mbcd-custom-mapping {
		grid-template-columns: 1fr;
	}

	.mbcd-custom-field-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mbcd-custom-field-list__clear {
		grid-column: 1 / -1;
	}
}

@media (max-height: 900px) and (min-width: 641px) {
	.mbcd-custom-modal__header {
		padding-top: 8px;
		padding-bottom: 6px;
	}

	.mbcd-custom-modal__header h3 {
		font-size: 20px;
	}

	.mbcd-custom-modal__header .mbcd-custom-kicker {
		margin-bottom: 2px;
		font-size: 10px;
	}

	.mbcd-custom-modal__close {
		width: 36px;
		height: 36px;
		flex-basis: 36px;
		font-size: 24px;
	}

	.mbcd-custom-progress {
		padding-top: 4px;
		padding-bottom: 4px;
	}

	.mbcd-custom-progress span {
		width: 23px;
		height: 23px;
	}

	.mbcd-custom-modal__body {
		padding-top: 10px;
		padding-bottom: 10px;
	}

	.mbcd-custom-step__heading {
		margin-bottom: 9px;
	}

	.mbcd-custom-step__heading h4 {
		font-size: 17px;
	}

	.mbcd-custom-crop {
		height: clamp(220px, calc(100vh - 380px), 320px);
		min-height: 220px;
	}

	.mbcd-custom-crop__frame {
		width: clamp(278px, calc(165.5vh - 715px), 444px);
		min-width: 0;
		height: auto;
		max-width: 100%;
	}

	.mbcd-custom-crop__frame.is-portrait {
		width: clamp(102px, calc(60.4vh - 261px), 162px);
		min-width: 0;
		height: auto;
	}

	.mbcd-custom-zoom {
		min-height: 40px;
		margin-top: 7px;
	}

	.mbcd-custom-modal__footer {
		padding-top: 6px;
		padding-bottom: 6px;
	}

	.mbcd-custom-modal[data-current-step="4"] .mbcd-custom-result {
		min-height: 0;
		padding: 14px;
	}

	.mbcd-custom-modal[data-current-step="4"]
		.mbcd-custom-result__card:not(.is-portrait) {
		width: min(100%, clamp(460px, calc(103vh - 223px), 620px));
	}

	.mbcd-custom-modal[data-current-step="4"] .mbcd-custom-notice--important {
		margin-top: 8px;
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.mbcd-custom-modal[data-current-step="3"] .mbcd-custom-mapping__canvas {
		min-height: 0;
	}

	.mbcd-custom-modal[data-current-step="3"] .mbcd-custom-mapping canvas {
		max-height: clamp(250px, calc(100vh - 455px), 430px);
	}

	.mbcd-custom-modal[data-current-step="3"] .mbcd-custom-field-list {
		gap: 5px;
	}

	.mbcd-custom-modal[data-current-step="3"] .mbcd-custom-field-list > button {
		min-height: 38px;
		padding-top: 5px;
		padding-bottom: 5px;
	}

	.mbcd-custom-modal[data-current-step="3"]
		.mbcd-custom-field-list
		.mbcd-custom-field-list__clear {
		margin-top: 0;
	}
}

@media (max-width: 640px) {
	.mbcd-custom-modal {
		padding: 0;
	}

	.mbcd-custom-modal__dialog {
		width: 100%;
		height: 100vh;
		max-height: 100vh;
		min-height: 100vh;
		border: 0;
		border-radius: 0;
	}

	.mbcd-custom-modal__header {
		padding: 16px 17px 12px;
	}

	.mbcd-custom-modal__header h3 {
		font-size: 18px;
	}

	.mbcd-custom-progress {
		padding: 10px 17px;
	}

	.mbcd-custom-progress li {
		justify-content: center;
		font-size: 0;
	}

	.mbcd-custom-progress li::after {
		right: -28%;
		left: 58%;
	}

	.mbcd-custom-progress span {
		font-size: 11px;
	}

	.mbcd-custom-modal__body {
		padding: 16px 17px;
	}

	.mbcd-custom-step {
		min-height: 0;
	}

	.mbcd-custom-step__heading {
		display: block;
	}

	.mbcd-custom-orientation,
	.mbcd-custom-ocr-button {
		margin-top: 12px;
	}

	.mbcd-custom-crop,
	.mbcd-custom-mapping__canvas,
	.mbcd-custom-result {
		min-height: 250px;
	}

	.mbcd-custom-crop {
		height: clamp(190px, calc(100vh - 470px), 280px);
		min-height: 190px;
		padding: 32px 12px 14px;
	}

	.mbcd-custom-crop__frame {
		width: min(100%, clamp(238px, calc(165.5vh - 854px), 386px));
		min-width: 0;
	}

	.mbcd-custom-crop__frame.is-portrait {
		width: min(58%, clamp(81px, calc(60.4vh - 312px), 141px));
		min-width: 81px;
	}

	.mbcd-custom-crop__label {
		top: 7px;
		left: 7px;
		font-size: 10px;
	}

	.mbcd-custom-zoom {
		flex-wrap: wrap;
		gap: 7px 10px;
	}

	.mbcd-custom-zoom input {
		min-width: 130px;
	}

	.mbcd-custom-modal__footer {
		padding: 12px 17px;
	}

	.mbcd-custom-cancel {
		display: none;
	}

	.mbcd-custom-next,
	.mbcd-custom-confirm {
		min-width: 120px;
	}
}

/*
 * STEP 2 は、トリミング枠だけを残りの高さへ収める。
 * 画面の高さにかかわらず、拡大操作をフッター直上に表示する。
 */
.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-modal__body {
	position: relative;
	display: grid;
	grid-template-rows: minmax(0, 1fr);
	overflow: hidden;
}

.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-step[data-mbcd-custom-step="2"].is-active {
	display: grid;
	height: auto;
	min-height: 0;
	grid-template-rows: max-content max-content minmax(110px, 1fr) max-content;
}

.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-step__heading {
	grid-row: 1;
	margin-bottom: 9px;
}

.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-pdf-page {
	grid-row: 2;
	margin-bottom: 8px;
}

.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-crop {
	grid-row: 3;
	height: auto;
	min-height: 0;
	align-self: stretch;
}

.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-crop__frame,
.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-crop__frame.is-portrait {
	width: auto;
	min-width: 0;
	max-width: 100%;
	max-height: 100%;
}

.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-zoom {
	position: relative;
	z-index: 5;
	grid-row: 4;
	flex: 0 0 auto;
	margin-top: 8px;
	margin-bottom: 0;
	background: #fff;
}

@media (max-width: 640px) {
	.mbcd-custom-modal[data-current-step="2"] .mbcd-custom-step[data-mbcd-custom-step="2"].is-active {
		grid-template-rows: max-content max-content minmax(90px, 1fr) max-content;
	}
}

/* STEP 2 のトリミング面は、画像と仕上がり範囲だけが分かる簡潔な表示にする。 */
.mbcd-custom-crop {
	background: #36444b;
}

.mbcd-custom-crop__frame,
.mbcd-custom-crop__frame.is-portrait {
	border: 2px solid #ff9800;
	border-radius: 4px;
	box-shadow: 0 8px 22px rgba(6, 17, 22, 0.28);
}

.mbcd-custom-crop__frame::before {
	background:
		linear-gradient(
			to right,
			transparent calc(33.333% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(33.333% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(33.333% + 0.5px),
			transparent calc(33.333% + 0.5px),
			transparent calc(66.666% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(66.666% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(66.666% + 0.5px),
			transparent calc(66.666% + 0.5px)
		),
		linear-gradient(
			to bottom,
			transparent calc(33.333% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(33.333% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(33.333% + 0.5px),
			transparent calc(33.333% + 0.5px),
			transparent calc(66.666% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(66.666% - 0.5px),
			rgba(255, 152, 0, 0.18) calc(66.666% + 0.5px),
			transparent calc(66.666% + 0.5px)
		);
}

.mbcd-custom-crop__frame::after {
	display: none;
}

.mbcd-custom-crop__label {
	top: -25px;
	left: 0;
	display: flex;
	gap: 6px;
	align-items: center;
	padding: 0;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.mbcd-custom-crop__label::before {
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	border-radius: 50%;
	background: #ff9800;
	content: "";
}

/* 進行表示は番号と文言だけにし、文字へ重なる接続線は表示しない。 */
.mbcd-custom-progress li::after {
	display: none;
}
