#basearea {
	position: relative;
	overflow: visible;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 auto !important;
}

/* アップロード画面の使い方・Q&A。構造はcompositeとそろえる。 */
.bk-stamp-quick-guide { margin-bottom: 14px; }
.bk-stamp-quick-guide-intro { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; padding: 12px 14px; border-left: 4px solid #3fb1e4; border-radius: 6px; background: #eef9fd; }
.bk-stamp-quick-guide-intro strong { color: #236d8d; font-size: 18px; }
.bk-stamp-quick-guide-intro span { color: #60747d; font-size: 13px; }
.bk-stamp-quick-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.bk-stamp-quick-steps li { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 11px; border: 1px solid #cfe4ed; border-radius: 7px; background: #fff; }
.bk-stamp-quick-steps li > span:last-child { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.bk-stamp-quick-step-number { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 27px; width: 27px; height: 27px; border-radius: 50%; background: #3faed8; color: #fff; font-size: 14px; font-weight: 700; }
.bk-stamp-quick-steps strong { color: #334d59; font-size: 14px; line-height: 1.45; }
.bk-stamp-quick-steps small { margin-top: 3px; color: #6a7c84; font-size: 12px; line-height: 1.45; }
.bk-stamp-help-details,
.bk-stamp-faq-list details { margin: 0 0 8px; border: 1px solid #d5dfe4; border-radius: 7px; background: #fff; }
.bk-stamp-help-details summary,
.bk-stamp-faq-list summary { display: flex; align-items: center; gap: 8px; padding: 11px 13px; color: #3d5966; font-weight: 700; line-height: 1.5; cursor: pointer; list-style: none; }
.bk-stamp-help-details summary::-webkit-details-marker,
.bk-stamp-faq-list summary::-webkit-details-marker { display: none; }
.bk-stamp-help-details summary::after,
.bk-stamp-faq-list summary::after { flex: 0 0 auto; margin-left: auto; color: #3998bd; font-size: 18px; font-weight: 400; content: "＋"; }
.bk-stamp-help-details[open] summary::after,
.bk-stamp-faq-list details[open] summary::after { content: "−"; }
.bk-stamp-help-details[open] summary,
.bk-stamp-faq-list details[open] summary { border-bottom: 1px solid #dce6ea; background: #f5fbfd; }
.bk-stamp-help-details-body { padding: 4px 14px 8px; }
.bk-stamp-help-details-body p { margin: 10px 0; line-height: 1.65; }
.bk-stamp-faq-heading { display: flex; flex-direction: column; gap: 2px; margin: 18px 0 9px; }
.bk-stamp-faq-heading strong { color: #765313; font-size: 16px; }
.bk-stamp-faq-heading span { color: #777; font-size: 12px; }
.bk-stamp-faq-list summary::before { flex: 0 0 auto; color: #c47c00; content: "Q."; }
.bk-stamp-faq-list details p { margin: 0; padding: 11px 14px 13px 40px; color: #4e5d64; line-height: 1.7; }

#baseimage {
	display: block;
	max-width: 100%;
	height: auto;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 auto !important;
	user-select: none;
	-webkit-user-drag: none;
}

.bk-koukasen-viewport-host {
	width: 100%;
	margin: 0 auto;
	padding: 0;
}

.bk-editor-action-band {
	padding-top: 4px;
	padding-bottom: 4px;
}

@media (min-width: 992px) {
	#main .image-wrapper {
		padding: 5px 50px;
	}

	#basearea:not(.bk-canvas-ready):not(.bk-static-display-ready) {
		visibility: hidden;
	}
}

.bk-stamp-grid-setting,
.bk-stamp-view-setting,
.bk-stamp-output-setting {
	padding: 0;
	margin-bottom: 0;
	border: 0;
	background: transparent;
}

.bk-stamp-grid-setting .bk-output-format,
.bk-stamp-view-setting .bk-output-format,
.bk-stamp-output-setting .bk-output-format {
	margin-bottom: 10px;
}

@media (max-width: 991px) {
	.bk-stamp-view-setting {
		display: none;
	}
}

/* 見た目の合成はCanvas、枠とハンドルだけはDOMで扱う。 */
.bk-canvas-ready #baseimage,
.bk-canvas-ready #stampimage,
.bk-canvas-ready .bk-stamp-image {
	display: none;
}

.bk-koukasen-base-canvas,
.bk-koukasen-effect-canvas {
	display: block;
	max-width: none;
	border: 0;
	padding: 0;
	margin: 0;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

.bk-koukasen-effect-canvas {
	position: absolute;
	top: 0;
	left: 0;
}

#stamp,
.bk-stamp-overlay {
	position: absolute;
	display: block;
	box-sizing: border-box;
	border: 2px solid transparent;
	touch-action: none;
	user-select: none;
	transform-origin: 50% 50%;
}

#stamp.bk-overlay-is-active,
.bk-stamp-overlay.bk-overlay-is-active {
	border-color: #46b8da;
	cursor: default;
	z-index: 20 !important;
}

#stamp.bk-overlay-is-active.bk-overlay-is-small,
.bk-stamp-overlay.bk-overlay-is-active.bk-overlay-is-small {
	border-width: 1px;
	border-color: rgba(70, 184, 218, 0.7);
}

#stamp.bk-overlay-is-resizing,
#stamp.bk-overlay-is-resizing .bk-overlay-handle,
.bk-stamp-overlay.bk-overlay-is-resizing,
.bk-stamp-overlay.bk-overlay-is-resizing .bk-overlay-handle {
	cursor: pointer;
}

#stampimage,
.bk-stamp-image {
	width: 100%;
	height: 100%;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

.bk-overlay-handle {
	position: absolute;
	display: block;
	box-sizing: border-box;
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.65);
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
	touch-action: none;
	cursor: default;
}

.bk-overlay-handle::before,
.bk-overlay-handle::after {
	position: absolute;
	display: block;
	content: "";
	background: #333;
}

.bk-overlay-handle .fa-regular,
.bk-overlay-handle .fa-solid {
	position: absolute;
	left: 50%;
	top: 50%;
	color: #333;
	font-size: 18px;
	line-height: 1;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.bk-overlay-handle-northwest,
.bk-overlay-handle-northeast,
.bk-overlay-handle-southwest,
.bk-overlay-handle-southeast {
	width: 32px;
	height: 32px;
	background: transparent;
	box-shadow: none;
	z-index: 2;
}

.bk-overlay-handle-northwest::after,
.bk-overlay-handle-northeast::after,
.bk-overlay-handle-southwest::after,
.bk-overlay-handle-southeast::after {
	display: none;
}

.bk-overlay-handle-northwest::before,
.bk-overlay-handle-northeast::before,
.bk-overlay-handle-southwest::before,
.bk-overlay-handle-southeast::before {
	display: block;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.65);
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
	transform: translate(-50%, -50%);
}

.bk-overlay-handle-northwest {
	left: -16px;
	top: -16px;
	cursor: default;
}

.bk-overlay-handle-northeast {
	right: -16px;
	top: -16px;
	cursor: default;
}

.bk-overlay-handle-southwest {
	left: -16px;
	bottom: -16px;
	cursor: default;
}

.bk-overlay-handle-southeast {
	right: -16px;
	bottom: -16px;
	cursor: default;
}

.bk-overlay-handle-move {
	left: 50%;
	bottom: -48px;
	width: 34px;
	height: 34px;
	margin-left: 5px;
}

.bk-overlay-handle-move::before {
	display: none;
}

.bk-overlay-handle-move::after {
	display: none;
}

.bk-overlay-handle-rotate {
	left: 50%;
	bottom: -48px;
	width: 34px;
	height: 34px;
	margin-left: -39px;
}

.bk-overlay-handle-rotate::before {
	display: none;
}

.bk-overlay-handle-rotate::after {
	display: none;
}

.bk-overlay-handle-delete {
	top: -48px;
	width: 34px;
	height: 34px;
}

.bk-overlay-handle-delete {
	left: 50%;
	margin-left: -17px;
}

.bk-overlay-handle-delete::before,
.bk-overlay-handle-delete::after {
	display: none;
}

.bk-overlay-handle-delete .fa-solid {
	color: #c9302c;
}

.bk-overlay-is-small .bk-overlay-handle {
	width: 14px;
	height: 14px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.bk-overlay-is-small .bk-overlay-handle .fa-regular,
.bk-overlay-is-small .bk-overlay-handle .fa-solid {
	font-size: 12px;
}

.bk-overlay-is-small .bk-overlay-handle-northwest,
.bk-overlay-is-small .bk-overlay-handle-northeast,
.bk-overlay-is-small .bk-overlay-handle-southwest,
.bk-overlay-is-small .bk-overlay-handle-southeast {
	width: 32px;
	height: 32px;
	background: transparent;
	box-shadow: none;
}

.bk-overlay-is-small .bk-overlay-handle-northwest::before,
.bk-overlay-is-small .bk-overlay-handle-northeast::before,
.bk-overlay-is-small .bk-overlay-handle-southwest::before,
.bk-overlay-is-small .bk-overlay-handle-southeast::before {
	width: 14px;
	height: 14px;
}

.bk-overlay-is-small .bk-overlay-handle-northwest {
	left: -16px;
	top: -16px;
}

.bk-overlay-is-small .bk-overlay-handle-northeast {
	right: -16px;
	top: -16px;
}

.bk-overlay-is-small .bk-overlay-handle-southwest {
	left: -16px;
	bottom: -16px;
}

.bk-overlay-is-small .bk-overlay-handle-southeast {
	right: -16px;
	bottom: -16px;
}

.bk-overlay-is-small .bk-overlay-handle-move {
	bottom: -34px;
	width: 24px;
	height: 24px;
	margin-left: 3px;
}

.bk-overlay-is-small .bk-overlay-handle-rotate {
	bottom: -34px;
	width: 24px;
	height: 24px;
	margin-left: -27px;
}

.bk-overlay-is-small .bk-overlay-handle-delete {
	top: -34px;
	width: 24px;
	height: 24px;
	margin-left: -12px;
}

.bk-overlay-rotation-label {
	position: absolute;
	left: 50%;
	bottom: -83px;
	min-width: 52px;
	padding: 5px 9px;
	border-radius: 14px;
	background: rgba(0, 0, 0, 0.78);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	transform: translateX(-50%);
	pointer-events: none;
}

.bk-overlay-is-inactive .bk-overlay-handle {
	display: none;
}

.bk-stamp-overlay .bk-overlay-handle-delete {
	display: none;
}

.bk-stamp-action-toolbar {
	position: absolute;
	z-index: 12;
	top: -52px;
	left: 50%;
	display: flex;
	gap: 5px;
	transform: translateX(-50%);
}

.bk-stamp-overlay.bk-overlay-is-inactive .bk-stamp-action-toolbar {
	display: none;
}

.bk-stamp-action-button {
	position: relative;
	display: block;
	box-sizing: border-box;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.78);
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
	color: #333;
	font-size: 18px;
	line-height: 38px;
	touch-action: none;
	cursor: pointer;
}

.bk-stamp-action-button:hover,
.bk-stamp-action-button:focus {
	background: #f1f7fa;
	outline: 0;
}

.bk-stamp-action-delete {
	border: 1px solid #e3b5b3;
	background: rgba(255, 255, 255, 0.9);
	color: #c9302c;
}

.bk-stamp-action-delete:hover,
.bk-stamp-action-delete:focus {
	background: #fff1f0;
	color: #a92622;
}

.bk-stamp-action-button .fa-solid {
	pointer-events: none;
}

.bk-overlay-is-small .bk-stamp-action-toolbar {
	top: -34px;
	gap: 4px;
}

.bk-overlay-is-small .bk-stamp-action-button {
	flex-basis: 24px;
	width: 24px;
	height: 24px;
	font-size: 12px;
	line-height: 24px;
}

.bk-canvas-zoom-viewport {
	position: relative;
	overflow: visible;
	max-width: 100%;
	margin: 0 auto;
	line-height: 0;
}

.bk-canvas-zoom-viewport.bk-canvas-is-zoomed {
	overflow: hidden;
}

.bk-canvas-zoom-stage {
	position: relative;
	transform-origin: 0 0;
	will-change: transform;
}

.bk-canvas-pan-mode {
	touch-action: none;
}

.bk-stamp-action-band {
	padding: 4px 12px;
	border-right: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
	border-left: 1px solid #ddd;
	background: #f8f8f8;
}

.bk-stamp-action-band-inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-width: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.bk-stamp-action-band .bk-stamp-controls-layer {
	flex: 0 0 auto;
	flex-wrap: nowrap;
	justify-content: flex-end;
	margin: 0 0 0 auto;
}

.bk-stamp-toolbar {
	margin-top: 10px;
	margin-bottom: 10px;
	padding: 10px;
	border: 10px solid #eee;
	background: #fff;
	text-align: center;
}

.bk-zoom-toolbar {
	margin-top: 5px;
	padding: 8px 10px;
	background: #eee;
	text-align: center;
}

.bk-canvas-mode-toolbar {
	margin-top: 1px;
	padding: 8px 10px;
	background: #eee;
	text-align: center;
}

.bk-stamp-controls,
.bk-zoom-controls,
.bk-canvas-mode-controls {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	max-width: 100%;
}

.bk-stamp-controls {
	display: flex;
	margin: 0 auto;
}

.bk-stamp-controls-primary {
	width: 100%;
	flex-wrap: nowrap;
}

.bk-stamp-controls-primary .bk-stamp-tool {
	flex: 1 1 0;
	min-width: 0;
	padding-right: 6px;
	padding-left: 6px;
}

.bk-stamp-tool {
	min-width: 44px;
}

.bk-stamp-tool:hover {
	border-color: #bbb;
	background: #e8e8e8;
	color: #333;
}

.bk-stamp-controls-primary .bk-stamp-tool.bk-stamp-panel-open {
	border-color: #bbb;
	background: #e8e8e8;
	color: #333;
}

.bk-stamp-controls-primary .bk-stamp-tool.bk-stamp-setting-active {
	border-color: #46b8da;
	background: #d9edf7;
	color: #245580;
	font-weight: 400;
	box-shadow: none;
}

.bk-stamp-tool:focus {
	background: #fff;
	color: #333;
}

.bk-stamp-controls-primary .bk-stamp-tool.bk-stamp-panel-open:focus {
	border-color: #bbb;
	background: #e8e8e8;
	color: #333;
}

.bk-stamp-controls-primary .bk-stamp-tool.bk-stamp-setting-active:focus {
	border-color: #46b8da;
	background: #d9edf7;
	color: #245580;
}

.bk-stamp-tool:focus,
.bk-stamp-tool:active:focus,
.bk-stamp-tool.active:focus {
	outline: 0;
	box-shadow: none;
}

@media (max-width: 480px) {
	.bk-stamp-controls-primary {
		gap: 4px;
	}

	.bk-stamp-controls-primary .bk-stamp-tool {
		padding-right: 3px;
		padding-left: 3px;
		font-size: 14px;
	}
}

.bk-stamp-options-band {
	width: auto;
	background: #eee;
	overflow: hidden;
	max-height: 0;
	padding: 10px;
	opacity: 0;
	transform: translateY(-6px);
	transition: max-height 180ms ease, opacity 150ms ease, transform 180ms ease, padding 180ms ease;
}

.bk-stamp-options-band.is-open {
	max-height: 520px;
	padding-top: 8px;
	padding-bottom: 8px;
	opacity: 1;
	transform: translateY(0);
}

.bk-stamp-options {
	width: 100%;
	padding: 0;
}

.bk-stamp-options #form_option {
	width: 100%;
	margin: 0;
	padding: 14px 16px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
	text-align: left;
}

.bk-stamp-options .form-group,
.bk-stamp-options .checkbox,
.bk-stamp-options .bk-choice-group {
	margin-bottom: 12px;
}

.bk-color-history-row {
	display: flex;
	align-items: stretch;
	margin-top: 6px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #eee;
}

.bk-color-history-label {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	padding: 6px 10px;
	border-right: 1px solid #ccc;
	color: #555;
	font-weight: 400;
}

.bk-color-history {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
	padding: 6px 8px;
}

.bk-color-history-item {
	width: 34px;
	height: 34px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 4px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.bk-color-history-item.is-current {
	box-shadow: 0 0 0 2px #337ab7;
}

.bk-range-stepper {
	display: flex;
	align-items: stretch;
	flex: 0 0 auto;
}

.bk-range-stepper .bk-range-value {
	min-width: 64px;
	border-left: 1px solid #ccc;
}

.bk-range-step-button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 10px;
	border: 0;
	border-left: 1px solid #ccc;
	background: #fff;
	color: #333;
	font-size: 18px;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.bk-range-step-button:hover:not(:disabled),
.bk-range-step-button:focus {
	background: #e6e6e6;
}

.bk-range-step-button:disabled {
	color: #aaa;
	cursor: not-allowed;
}

@media (max-width: 480px) {
	.bk-stamp-options #form_option {
		padding-right: 8px;
		padding-left: 8px;
	}

	.bk-stamp-options .bk-range-row {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}

	.bk-stamp-options .bk-range-label {
		padding-right: 6px;
		padding-left: 6px;
	}

	.bk-stamp-options .bk-range-input {
		min-width: 0;
	}

	.bk-range-step-button {
		padding: 0 8px;
	}

	.bk-range-stepper .bk-range-value {
		min-width: 48px;
		padding-right: 5px;
		padding-left: 5px;
	}
}

.bk-stamp-option-group[hidden] {
	display: none !important;
}

.bk-choice-group {
	display: flex;
	gap: 8px;
	border: 0;
	padding: 0;
}

.bk-choice-group label {
	display: flex;
	position: relative;
	align-items: center;
	justify-content: flex-start;
	flex: 1 1 0;
	min-height: 44px;
	margin: 0;
	padding: 8px 12px 8px 42px;
	border: 1px solid #bdbdbd;
	border-radius: 4px;
	background: #f6f6f6;
	color: #333;
	font-weight: 400;
	cursor: pointer;
}

.bk-choice-group label::before {
	position: absolute;
	left: 14px;
	top: 50%;
	width: 16px;
	height: 16px;
	border-radius: 2px;
	background: #fff;
	content: "";
	transform: translateY(-50%);
}

.bk-choice-group label:has(:checked)::after {
	position: absolute;
	left: 18px;
	top: 50%;
	width: 7px;
	height: 12px;
	border: solid #2f8ecb;
	border-width: 0 3px 3px 0;
	content: "";
	transform: translateY(-62%) rotate(45deg);
}

.bk-choice-group label:has(:checked) {
	border-color: #46b8da;
	background: #5bc0de;
	color: #FFF;
}

.bk-choice-group input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.bk-stamp-options .form-group:last-child,
.bk-stamp-options .checkbox:last-child {
	margin-bottom: 0;
}

#basearea,
.bk-stamp-toolbar,
.bk-stamp-options-band,
.main-btn-wrapper {
	user-select: none;
	-webkit-user-select: none;
}

.bk-stamp-options-band input,
.bk-stamp-options-band textarea,
.bk-stamp-options-band select,
.bk-stamp-options-band [contenteditable="true"] {
	user-select: text;
	-webkit-user-select: text;
}

.bk-flip-actions {
	display: flex;
	gap: 8px;
}

.bk-flip-actions .btn {
	flex: 1 1 0;
}

.bk-zoom-icon {
	min-width: 44px;
}

.bk-zoom-value {
	min-width: 58px;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: #555;
	line-height: 20px;
	text-align: center;
}

.bk-zoom-pan:focus,
.bk-zoom-pan:active:focus,
.bk-zoom-pan.active:focus,
#overlay_adjust:focus,
#overlay_adjust:active:focus,
#overlay_adjust.active:focus {
	outline: 0;
	box-shadow: none;
}

.bk-zoom-status {
	margin-top: 5px;
	padding: 9px 12px;
	border-left: 4px solid #337ab7;
	background: #d9edf7;
	color: #245580;
	line-height: 1.5;
}

.bk-zoom-status .fa {
	margin-right: 4px;
}

@media (max-width: 767px) {
	.bk-zoom-toolbar,
	.bk-canvas-mode-toolbar,
	.bk-zoom-status {
		display: none !important;
	}
}

@media (max-width: 360px) {
	.bk-zoom-controls,
	.bk-canvas-mode-controls {
		gap: 4px;
	}

	.bk-zoom-icon {
		min-width: 40px;
	}

	.bk-canvas-mode-controls {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}

	.bk-canvas-mode-controls .bk-zoom-pan,
	.bk-canvas-mode-controls #overlay_adjust {
		flex: 1 1 100%;
	}

	.bk-stamp-options #form_option {
		padding: 12px;
	}

	.bk-flip-actions,
	.bk-choice-group {
		flex-direction: column;
	}
}
