/* Welcart 入稿プラグイン - 入稿エディター */

.wcnk-modal {
	--wcnk-accent: #0068b7;
	--wcnk-accent-ink: #fff;
	--wcnk-ink: #1d2327;
	--wcnk-muted: #646970;
	--wcnk-line: #dcdcde;
	--wcnk-panel: #fff;
	--wcnk-canvas: #8c8f94;
	--wcnk-danger: #b32d2e;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.6);
	font-size: 14px;
	line-height: 1.6;
	color: var(--wcnk-ink);
	box-sizing: border-box;
}

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

.wcnk-dialog {
	display: flex;
	flex-direction: column;
	width: min(1200px, 100%);
	height: min(860px, 100%);
	background: var(--wcnk-panel);
	border-radius: 8px;
	overflow: hidden;
	outline: none;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.wcnk-head,
.wcnk-foot {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--wcnk-line);
}

.wcnk-foot {
	justify-content: flex-end;
	border-top: 1px solid var(--wcnk-line);
	border-bottom: 0;
}

.wcnk-head h2 {
	flex: 1;
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}

.wcnk-close {
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--wcnk-muted);
}

.wcnk-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.wcnk-stage-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wcnk-canvas);
	overflow: hidden;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	cursor: grab;
}

.wcnk-stage-wrap.wcnk-dragging {
	cursor: grabbing;
}

.wcnk-stage-wrap.wcnk-dropping {
	outline: 3px dashed var(--wcnk-accent);
	outline-offset: -8px;
}

.wcnk-stage {
	position: relative;
	flex: none;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.wcnk-stage img {
	position: absolute;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	pointer-events: none;
}

.wcnk-art {
	image-rendering: auto;
}

.wcnk-guide {
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

.wcnk-shade {
	position: absolute;
	background: rgba(60, 60, 60, 0.45);
	pointer-events: none;
}

.wcnk-empty {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	width: min(360px, 90%);
	padding: 20px;
	text-align: center;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 8px;
	cursor: default;
}

.wcnk-empty p {
	margin: 0 0 12px;
}

.wcnk-side {
	width: 300px;
	flex: none;
	padding: 16px;
	overflow-y: auto;
	border-left: 1px solid var(--wcnk-line);
}

.wcnk-field {
	margin-bottom: 18px;
}

.wcnk-label {
	margin-bottom: 6px;
	font-weight: 600;
}

.wcnk-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}

.wcnk-range {
	flex: 1;
	min-width: 0;
}

.wcnk-num {
	width: 96px;
	padding: 4px 6px;
	border: 1px solid var(--wcnk-line);
	border-radius: 4px;
	font-size: 14px;
}

.wcnk-faces {
	display: flex;
	gap: 6px;
}

.wcnk-face-tab {
	flex: 1;
	min-height: 36px;
	padding: 6px 8px;
	border: 1px solid var(--wcnk-line);
	border-radius: 4px;
	background: #fff;
	color: var(--wcnk-ink);
	font-size: 13px;
	cursor: pointer;
}

.wcnk-face-tab.wcnk-face-missing {
	color: var(--wcnk-danger);
}

.wcnk-face-tab.wcnk-active {
	border-color: var(--wcnk-accent);
	background: var(--wcnk-accent);
	color: var(--wcnk-accent-ink);
}

.wcnk-face-tab:disabled {
	cursor: progress;
}

.wcnk-field .wcnk-btn + .wcnk-btn {
	margin-top: 6px;
}

.wcnk-select {
	width: 100%;
	max-width: 100%;
	padding: 6px 8px;
	border: 1px solid var(--wcnk-line);
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
}

.wcnk-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wcnk-controls.wcnk-disabled {
	opacity: 0.4;
	pointer-events: none;
}

.wcnk-file-name {
	margin-bottom: 8px;
	font-weight: 600;
	word-break: break-all;
}

.wcnk-small {
	font-size: 12px;
	color: var(--wcnk-muted);
}

.wcnk-legend {
	padding: 8px;
	background: #f6f7f7;
	border-radius: 4px;
}

.wcnk-msg {
	min-height: 1.6em;
	font-weight: 600;
	white-space: pre-line;
}

.wcnk-checks {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
}

.wcnk-checks li {
	margin: 0 0 6px;
	padding: 6px 8px 6px 26px;
	border-radius: 4px;
	position: relative;
	line-height: 1.5;
}

.wcnk-checks li::before {
	position: absolute;
	left: 8px;
	top: 6px;
	font-weight: 700;
}

.wcnk-check-error {
	background: #fcf0f1;
	color: #8a1f1f;
}

.wcnk-check-error::before {
	content: "×";
}

.wcnk-check-warning {
	background: #fcf9e8;
	color: #614b00;
}

.wcnk-check-warning::before {
	content: "!";
}

.wcnk-check-ok {
	background: #edfaef;
	color: #1e5c28;
}

.wcnk-check-ok::before {
	content: "✓";
}

.wcnk-admin-checks {
	margin: 4px 0 0;
	font-size: 12px;
}

.wcnk-admin-checks .wcnk-check-error,
.wcnk-admin-checks .wcnk-check-warning {
	display: block;
	margin-top: 2px;
	padding: 2px 6px;
	border-radius: 3px;
}

.wcnk-msg.wcnk-error,
.wcnk-warn,
.wcnk-small.wcnk-warn {
	color: var(--wcnk-danger);
}

.wcnk-progress {
	height: 6px;
	margin-top: 8px;
	background: var(--wcnk-line);
	border-radius: 3px;
	overflow: hidden;
}

.wcnk-progress-bar {
	width: 0;
	height: 100%;
	background: var(--wcnk-accent);
	transition: width 0.2s;
}

.wcnk-hidden {
	display: none !important;
}

.wcnk-busy .wcnk-stage-wrap {
	cursor: progress;
}

/* ボタン（テーマのスタイルに負けないよう最低限を指定） */
.wcnk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--wcnk-accent, #0068b7);
	border-radius: 4px;
	background: #fff;
	color: var(--wcnk-accent, #0068b7);
	font-size: 14px;
	line-height: 1.3;
	cursor: pointer;
	text-decoration: none;
}

.wcnk-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wcnk-btn-primary {
	background: var(--wcnk-accent, #0068b7);
	color: var(--wcnk-accent-ink, #fff);
}

.wcnk-btn-icon {
	width: 36px;
	padding: 0;
	font-size: 18px;
}

/* 商品ページ */
.wcnk-product-box {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 8px 0;
}

.wcnk-status {
	font-size: 13px;
}

/* カート */
.wcnk-cart-box {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 6px 0;
}

.wcnk-thumb {
	width: 64px;
	height: 64px;
	object-fit: contain;
	background: #fff;
	border: 1px solid #dcdcde;
}

.wcnk-admin-thumb {
	max-width: 80px;
	max-height: 80px;
	min-width: 20px;
	min-height: 20px;
	background: #fff;
	border: 1px solid #ddd;
}

.wcnk-notice {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-left: 4px solid #b32d2e;
	background: #fcf0f1;
	color: #b32d2e;
	font-weight: 600;
}

@media (max-width: 782px) {
	.wcnk-modal {
		padding: 0;
	}

	.wcnk-dialog {
		width: 100%;
		height: 100%;
		border-radius: 0;
	}

	.wcnk-body {
		flex-direction: column;
	}

	.wcnk-stage-wrap {
		flex: none;
		height: 55%;
	}

	.wcnk-side {
		width: auto;
		flex: 1;
		border-left: 0;
		border-top: 1px solid var(--wcnk-line);
	}

	.wcnk-actions {
		flex-direction: row;
		flex-wrap: wrap;
	}
}
