@charset "UTF-8";

:root {
	font-family: "M PLUS 1c", "Noto Sans JP", system-ui, sans-serif;
	color: #202020;
	background: #6495ed;
	font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
	min-height: 100vh;
	padding-bottom: env(safe-area-inset-bottom);
	background: #6495ed;
}

.app-header {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 62px;
	padding: 10px 16px;
	background: #4169e1;
	color: #fff;
	font-size: 22px;
	font-weight: 700;
}

.brand-icon { width: 34px; height: 34px; }

.app-main {
	width: min(100% - 24px, 560px);
	margin: 16px auto 28px;
}

.status-card, .scanner-card, .result-card, .action-card, .history-card, .install-help {
	margin: 12px 0;
	padding: 16px;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.status-card { display: grid; gap: 5px; text-align: center; }
.status-card strong { font-size: 15px; }
.status-card span, .help-text { color: #555; font-size: 13px; }

.camera-frame {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 260px;
	overflow: hidden;
	border: 8px solid #fff;
	background: #17202a;
}

#camera-video {
	display: none;
	width: 100%;
	max-height: min(56vh, 440px);
	object-fit: cover;
}

.camera-placeholder {
	display: grid;
	justify-items: center;
	gap: 12px;
	padding: 24px 12px;
	color: #fff;
	text-align: center;
}

.camera-placeholder p { margin: 0; }
.scan-guide {
	position: absolute;
	display: none;
	left: 12%;
	right: 12%;
	top: 50%;
	height: 2px;
	background: rgba(255,255,255,.8);
	box-shadow: 0 0 10px rgba(255,255,255,.8);
	pointer-events: none;
}

.qr-mark {
	position: relative;
	width: 78px;
	height: 78px;
	border: 6px solid #fff;
}
.qr-mark::before, .qr-mark::after, .qr-mark i {
	position: absolute;
	width: 21px;
	height: 21px;
	border: 4px solid #fff;
	content: "";
}
.qr-mark::before { top: 5px; left: 5px; }
.qr-mark::after { top: 5px; right: 5px; }
.qr-mark i:first-child { bottom: 5px; left: 5px; }
.qr-mark i:nth-child(2) { right: 7px; bottom: 7px; width: 8px; height: 8px; border: 0; background: #fff; }
.qr-mark i:nth-child(3) { display: none; }

.scan-status { min-height: 24px; margin: 12px 0; text-align: center; }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.btn {
	min-height: 44px;
	padding: 9px 14px;
	border: 0;
	border-radius: 3px;
	color: #fff;
	font: inherit;
	font-size: 16px;
	cursor: pointer;
}
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-secondary { display: block; margin: 14px auto 0; font-size: 14px; }

h2 { margin: 0 0 12px; font-size: 18px; }
.last-code {
	min-height: 42px;
	padding: 10px;
	border: 1px solid #dcdcdc;
	background: #f7f7f7;
	font-size: 14px;
	overflow-wrap: anywhere;
}
.count-line { margin: 10px 0 0; text-align: right; }
.count-line strong { font-size: 20px; }
.help-text { margin: 12px 0 0; line-height: 1.6; text-align: center; }

.recent-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.recent-list li {
	padding: 9px 10px;
	border: 1px solid #dcdcdc;
	border-radius: 3px;
	background: #fafafa;
}
.recent-code { display: block; overflow-wrap: anywhere; font-size: 14px; }
.recent-time { display: block; margin-top: 4px; color: #555; font-size: 12px; }
.empty-list { color: #666; text-align: center; }
.install-help { border: 2px solid #4169e1; line-height: 1.6; }
.install-help p { margin: 8px 0 14px; }
footer { padding: 12px; color: #fff; font-size: 12px; text-align: center; }
footer span { display: block; opacity: .9; }

@media (max-width: 380px) {
	.app-main { width: min(100% - 16px, 560px); margin-top: 8px; }
	.status-card, .scanner-card, .result-card, .action-card, .history-card { padding: 12px; }
	.camera-frame { min-height: 220px; }
	.btn { width: 100% !important; max-width: 300px; }
}
