.webpcv-app {
	--webpcv-ink: #16181d;
	--webpcv-muted: #6b7280;
	--webpcv-line: #e2e2e7;
	--webpcv-bg-soft: #f7f7f9;
	--webpcv-accent: #3652cc;
	--webpcv-accent-soft: #eaedfb;
	--webpcv-good: #16794f;
	--webpcv-good-soft: #e6f5ee;
	--webpcv-caution: #a4530a;
	--webpcv-caution-soft: #fbeee1;
	--webpcv-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--webpcv-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;

	max-width: 720px;
	margin: 2rem auto;
	font-family: var(--webpcv-sans);
	color: var(--webpcv-ink);
	line-height: 1.6;
	box-sizing: border-box;
}
.webpcv-app *,
.webpcv-app *::before,
.webpcv-app *::after {
	box-sizing: inherit;
}

.webpcv-app--disabled .webpcv-disabled-msg {
	padding: 1.25rem;
	border: 1px solid var(--webpcv-line);
	border-radius: 10px;
	background: var(--webpcv-bg-soft);
	color: var(--webpcv-muted);
}

/* ---- ドロップゾーン ---- */
.webpcv-drop {
	border: 1.5px dashed var(--webpcv-line);
	border-radius: 12px;
	background: var(--webpcv-bg-soft);
	padding: 2.5rem 1.5rem;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.webpcv-drop:hover,
.webpcv-drop:focus-visible {
	border-color: var(--webpcv-accent);
	background: var(--webpcv-accent-soft);
}
.webpcv-drop.is-dragover {
	border-color: var(--webpcv-accent);
	background: var(--webpcv-accent-soft);
}
.webpcv-drop:focus-visible {
	outline: 2px solid var(--webpcv-accent);
	outline-offset: 3px;
}
.webpcv-drop__icon {
	color: var(--webpcv-accent);
	margin-bottom: 0.5rem;
}
.webpcv-drop__title {
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 0.35rem;
}
.webpcv-drop__sub {
	font-size: 0.85rem;
	color: var(--webpcv-muted);
	margin: 0 0 1.25rem;
}
.webpcv-drop__buttons {
	display: flex;
	gap: 0.75rem;
	justify-content: center;
	flex-wrap: wrap;
}

.webpcv-btn {
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.55rem 1.1rem;
	border-radius: 8px;
	cursor: pointer;
	border: 1.5px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.webpcv-btn--outline {
	background: #fff;
	border-color: var(--webpcv-accent);
	color: var(--webpcv-accent);
}
.webpcv-btn--outline:hover {
	background: var(--webpcv-accent-soft);
}
.webpcv-btn--primary {
	background: var(--webpcv-accent);
	color: #fff;
	width: 100%;
	margin-top: 0.85rem;
	padding: 0.7rem 1.1rem;
}
.webpcv-btn--primary:hover {
	background: #2c44ab;
}
.webpcv-btn--full {
	width: 100%;
	margin-top: 0.6rem;
}
.webpcv-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* ---- 品質設定 ---- */
.webpcv-quality {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 1.1rem 0;
	flex-wrap: wrap;
}
.webpcv-quality__label {
	font-size: 0.85rem;
	color: var(--webpcv-muted);
	font-weight: 600;
}
.webpcv-quality__options {
	display: flex;
	gap: 0.6rem;
}
.webpcv-quality__options label {
	border: 1.5px solid var(--webpcv-line);
	border-radius: 999px;
	padding: 0.3rem 0.85rem;
	font-size: 0.85rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}
.webpcv-quality__options input {
	accent-color: var(--webpcv-accent);
}
.webpcv-quality__options label:has(input:checked) {
	border-color: var(--webpcv-accent);
	background: var(--webpcv-accent-soft);
	color: var(--webpcv-accent);
}

/* ---- 集計サマリー：計測レシート風 ---- */
.webpcv-summary {
	border: 1.5px dashed var(--webpcv-line);
	border-radius: 10px;
	padding: 1.1rem 1.25rem;
	margin: 1.25rem 0;
	background: #fff;
	font-family: var(--webpcv-mono);
}
.webpcv-summary__row {
	display: flex;
	justify-content: space-between;
	font-size: 0.9rem;
	padding: 0.3rem 0;
	border-bottom: 1px dashed var(--webpcv-line);
}
.webpcv-summary__row:last-of-type {
	border-bottom: none;
}
.webpcv-summary__row span {
	color: var(--webpcv-muted);
	font-family: var(--webpcv-sans);
}
.webpcv-summary__row--highlight strong {
	color: var(--webpcv-good);
	font-size: 1.1rem;
}


/* ---- 注意書き ---- */
.webpcv-notice {
	margin-top: 0.85rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--webpcv-line);
}
.webpcv-notice p {
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	color: var(--webpcv-muted);
	line-height: 1.6;
}
.webpcv-notice p:last-child {
	margin-bottom: 0;
}

/* ---- 結果リスト ---- */
.webpcv-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.webpcv-row {
	border: 1px solid var(--webpcv-line);
	border-radius: 12px;
	padding: 1rem;
	background: #fff;
}
.webpcv-row__name {
	font-size: 0.9rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
	word-break: break-all;
}

/* ---- 比較画像：左右に大きく並べる ---- */
.webpcv-row__compare {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-bottom: 0.9rem;
}
.webpcv-row__compare[hidden] {
	display: none;
}
.webpcv-row__compare-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
}
.webpcv-row__compare-frame {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	border: 1px solid var(--webpcv-line);
	background: repeating-conic-gradient(#ececef 0% 25%, #fff 0% 50%) 50% / 16px 16px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.webpcv-row__compare-item:last-child .webpcv-row__compare-frame {
	border-color: var(--webpcv-accent);
	box-shadow: 0 0 0 1px var(--webpcv-accent) inset;
}
.webpcv-row__thumb {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.webpcv-row__compare-label {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--webpcv-muted);
}
.webpcv-row__compare-item:last-child .webpcv-row__compare-label {
	color: var(--webpcv-accent);
}

.webpcv-row__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.webpcv-row__capacity {
	margin: 0;
	font-family: var(--webpcv-mono);
	font-size: 0.82rem;
	color: var(--webpcv-ink);
}
.webpcv-row__quality {
	margin: 0;
	font-family: var(--webpcv-mono);
	font-size: 0.8rem;
	color: var(--webpcv-muted);
}
.webpcv-row__judge {
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	font-size: 0.8rem;
	color: var(--webpcv-muted);
}
.webpcv-pill {
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
}
.webpcv-pill.is-good {
	background: var(--webpcv-good-soft);
	color: var(--webpcv-good);
}
.webpcv-pill.is-caution {
	background: var(--webpcv-caution-soft);
	color: var(--webpcv-caution);
}
.webpcv-pill.is-neutral {
	background: var(--webpcv-bg-soft);
	color: var(--webpcv-muted);
}
.webpcv-row__reason {
	margin: 0;
	font-size: 0.8rem;
	color: var(--webpcv-ink);
}
.webpcv-row__badge {
	margin: 0.35rem 0 0;
	font-size: 0.75rem;
	padding: 0.15rem 0.5rem;
	border-radius: 6px;
	display: inline-block;
}
.webpcv-row__badge[hidden] {
	display: none;
}
.webpcv-row__badge--error {
	background: #fdeaea;
	color: #b3261e;
}
.webpcv-row__download {
	text-decoration: none;
	white-space: nowrap;
	align-self: flex-start;
	margin-top: 0.15rem;
}

/* ---- 通知モーダル（画面外クリックで閉じる） ---- */
.webpcv-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(22, 24, 29, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	z-index: 1000;
}
.webpcv-modal-backdrop[hidden] {
	display: none;
}
.webpcv-modal {
	background: #fff;
	border-radius: 12px;
	padding: 1.5rem;
	max-width: 360px;
	width: 100%;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.webpcv-modal__message {
	margin: 0 0 1.1rem;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--webpcv-ink);
}
.webpcv-modal__ok {
	width: 100%;
}

@media (prefers-reduced-motion: reduce) {
	.webpcv-app * {
		transition: none !important;
	}
}
