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

#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;
	padding: 0;
}

/* 見た目の合成は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;
}

#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: #fff;
	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 {
	z-index: 2;
}

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

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

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

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

.bk-overlay-handle-southeast {
	right: -12px;
	bottom: -12px;
	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-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-canvas-zoom-viewport {
	position: relative;
	overflow: hidden;
	max-width: 100%;
	margin: 0 auto;
	line-height: 0;
}

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

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

.bk-stamp-titlebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-top: 4px;
	padding-bottom: 4px;
}

.bk-stamp-titlebar-text {
	min-width: 0;
	text-align: left;
}

.bk-stamp-titlebar-actions {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	margin-left: auto;
	letter-spacing: 0;
	white-space: nowrap;
}

.bk-stamp-toolbar {
	margin-top: 8px;
	margin-bottom: 5px;
	padding: 8px 10px;
	background: #d9edf7;
	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-layer {
	margin-top: 6px;
}

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

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

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

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

.bk-stamp-options-band {
	width: auto;
	background: #d9edf7;
	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-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-range-row,
.bk-select-row,
.bk-pickr-row {
	display: flex;
	align-items: stretch;
	width: 100%;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	overflow: hidden;
}

.bk-range-label,
.bk-range-value,
.bk-select-label,
.bk-pickr-label {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 14px;
	background: #eee;
	color: #333;
	font-size: 16px;
	font-weight: 400;
	white-space: nowrap;
}

.bk-range-label,
.bk-range-value {
	min-height: 58px;
}

.bk-select-label,
.bk-pickr-label {
	min-height: 46px;
}

.bk-range-label {
	border-right: 1px solid #ccc;
}

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

.bk-range-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 58px;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	box-shadow: none;
}

.bk-range-input::-webkit-slider-thumb {
	width: 30px;
	height: 30px;
}

.bk-range-input::-moz-range-thumb {
	width: 30px;
	height: 30px;
}

.bk-select-label {
	border-right: 1px solid #ccc;
}

.bk-select-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	padding: 0 12px;
	border: 0;
	background: #fff;
	color: #333;
	font-size: 16px;
	box-shadow: none;
}

.bk-pickr-label {
	border-right: 1px solid #ccc;
}

.bk-stamp-options .bk-pickr-trigger,
.bk-stamp-options .bk-pickr-trigger .pickr,
.bk-stamp-options .bk-pickr-trigger .pcr-button {
	display: block;
	width: 86px;
	height: 46px;
	border: 0;
	border-radius: 0;
	margin: 0;
	font-size: 16px;
}

.bk-pickr-button {
	display: block;
	box-sizing: border-box;
	width: 86px;
	height: 46px;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: #3fb1e4 !important;
	background-image: linear-gradient(to bottom, #3fb1e4 0%, #3fb1e4 50%, #2daae1 51%, #2daae1 100%) !important;
	background-repeat: repeat-x;
	color: #fff !important;
	font-size: 16px;
	text-shadow: none;
	box-shadow: inset 0 0 0 1px #1a84b3;
	text-align: center;
	white-space: nowrap;
}

.bk-pickr-button:hover,
.bk-pickr-button:focus {
	background: #2daae1 !important;
	background-image: linear-gradient(to bottom, #2daae1 0%, #2daae1 100%) !important;
	background-position: 0 -15px;
	color: #fff !important;
	outline: 0;
	text-decoration: none;
}

.bk-pickr-button:active {
	background: #2daae1 !important;
	background-image: none !important;
	box-shadow: inset 0 0 0 1px #1a84b3, inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.bk-pickr-swatch {
	display: block;
	flex: 0 0 44px;
	width: 44px;
	height: 46px;
	border-left: 1px solid #ccc;
	border-right: 1px solid #ccc;
	background: #fff;
	position: relative;
}

.bk-pickr-swatch::before {
	position: absolute;
	top: 5px;
	left: 5px;
	right: 5px;
	bottom: 5px;
	border: 1px solid #888;
	border-radius: 4px;
	background: var(--bk-pickr-swatch-color, #ffffff);
	content: "";
}

.bk-pickr-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 46px;
	padding: 0 12px;
	border: 0;
	background: #fff;
	color: #333;
	font-size: 16px;
	box-shadow: 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-range-row {
		flex-wrap: wrap;
	}

	.bk-range-label {
		flex: 1 1 auto;
		justify-content: flex-start;
	}

	.bk-range-input {
		order: 3;
		flex-basis: 100%;
		border-top: 1px solid #ccc;
	}

	.bk-select-row {
		flex-wrap: wrap;
	}

	.bk-select-label,
	.bk-select-input {
		flex-basis: 100%;
	}

	.bk-select-label {
		justify-content: flex-start;
		border-right: 0;
		border-bottom: 1px solid #ccc;
	}

	.bk-pickr-row {
		flex-wrap: wrap;
	}

	.bk-pickr-label,
	.bk-pickr-input {
		flex-basis: 100%;
	}

	.bk-pickr-label {
		justify-content: flex-start;
		border-right: 0;
		border-bottom: 1px solid #ccc;
	}

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