.pqs-scanner {
	max-width: 480px;
	margin: 0 auto;
	font-size: 16px;
	box-sizing: border-box;
}

.pqs-scanner * {
	box-sizing: border-box;
}

.pqs-scanner-title {
	text-align: center;
	margin-bottom: 12px;
}

/* 視覚的には非表示（スクリーンリーダー向けのaria-live読み上げ専用）。
   実際の見た目の表示はトースト（.pqs-toast）とモーダル（.pqs-modal-overlay）が担う。 */
.pqs-scanner-message {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==================== トースト（成功・案内メッセージ） ==================== */

.pqs-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 100000;
	max-width: calc(100% - 32px);
	padding: 10px 16px;
	border-radius: 6px;
	background: #323232;
	color: #fff;
	font-size: 14px;
	text-align: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(10px);
	transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.pqs-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ==================== モーダル（エラーメッセージ） ==================== */

.pqs-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100001;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.5);
}

.pqs-modal-overlay.is-visible {
	display: flex;
}

.pqs-modal-box {
	width: 100%;
	max-width: 360px;
	padding: 20px;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pqs-modal-message {
	margin: 0 0 16px;
	color: #611a15;
	font-size: 14px;
	white-space: pre-wrap;
}

.pqs-modal-close-btn {
	display: block;
	width: 100%;
}

/* ==================== 診断ログパネル（設定の「デバッグログ」有効時のみ表示） ==================== */

.pqs-debug-panel {
	position: fixed;
	left: 8px;
	right: 8px;
	bottom: 8px;
	z-index: 100002;
	max-height: 40vh;
	display: flex;
	flex-direction: column;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.88);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.pqs-debug-panel-toolbar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pqs-debug-panel-title {
	flex: 1;
	color: #fff;
	font-size: 12px;
	font-weight: bold;
}

.pqs-debug-panel-toolbar .pqs-btn {
	width: auto;
	padding: 4px 10px;
	font-size: 12px;
}

.pqs-debug-panel-body {
	overflow-y: auto;
	padding: 8px;
	color: #7CFC7C;
	font-family: monospace;
	font-size: 11px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-all;
}

.pqs-btn {
	display: inline-block;
	padding: 10px 16px;
	font-size: 15px;
	border: 1px solid #999;
	border-radius: 4px;
	background: #f6f7f7;
	cursor: pointer;
	min-height: 44px;
}

.pqs-btn-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.pqs-camera-section {
	margin-bottom: 12px;
	text-align: center;
}

.pqs-btn-camera {
	width: 100%;
}

.pqs-btn-camera-stop {
	width: 100%;
	margin-top: 8px;
}

.pqs-camera-viewport {
	position: relative;
	margin-top: 10px;
	width: 100%;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
}

.pqs-camera-target {
	width: 100%;
	line-height: 0;
	cursor: pointer;
}

.pqs-camera-target video,
.pqs-camera-target img,
.pqs-camera-target canvas {
	width: 100% !important;
	height: auto !important;
	display: block;
}

/* タップでフォーカスした位置に表示する円形のフィードバック。 */
.pqs-focus-ring {
	position: absolute;
	width: 64px;
	height: 64px;
	margin-left: -32px;
	margin-top: -32px;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
	pointer-events: none;
	opacity: 0;
	transform: scale(1.4);
	transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.pqs-focus-ring.is-active {
	opacity: 1;
	transform: scale(1);
	transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.pqs-manual-section {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.pqs-manual-input {
	flex: 1;
	padding: 10px 12px;
	font-size: 16px;
	border: 1px solid #999;
	border-radius: 4px;
	min-height: 44px;
}

.pqs-name-search-section {
	position: relative;
	margin-bottom: 16px;
}

.pqs-name-search-input {
	width: 100%;
	padding: 10px 12px;
	font-size: 16px;
	border: 1px solid #999;
	border-radius: 4px;
	min-height: 44px;
}

.pqs-name-search-results {
	position: absolute;
	z-index: 20;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	background: #fff;
	border: 1px solid #999;
	border-radius: 4px;
	max-height: 260px;
	overflow-y: auto;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.pqs-name-search-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 10px 12px;
	background: none;
	border: none;
	border-bottom: 1px solid #f0f0f1;
	cursor: pointer;
	font-size: 14px;
}

.pqs-name-search-item:last-child {
	border-bottom: none;
}

.pqs-name-search-item:hover,
.pqs-name-search-item:focus {
	background: #f0f6fc;
}

.pqs-name-search-item-name {
	display: block;
	font-weight: 600;
}

.pqs-name-search-item-meta {
	display: block;
	font-size: 12px;
	color: #50575e;
	margin-top: 2px;
}

.pqs-name-search-empty {
	padding: 10px 12px;
	font-size: 13px;
	color: #50575e;
}

.pqs-product-info {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 16px;
}

.pqs-product-info dl {
	margin: 0;
}

.pqs-product-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	border-bottom: 1px dashed #dcdcde;
}

.pqs-product-row:last-child {
	border-bottom: none;
}

.pqs-product-row dt {
	font-weight: 600;
	color: #50575e;
}

.pqs-product-row dd {
	margin: 0;
	text-align: right;
}

.pqs-quantity-inputs {
	margin-bottom: 16px;
}

.pqs-quantity-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.pqs-quantity-row label {
	flex: 0 0 100px;
	font-weight: 600;
}

.pqs-qty-input {
	flex: 1;
	padding: 10px 12px;
	font-size: 18px;
	border: 1px solid #999;
	border-radius: 4px;
	min-height: 44px;
	text-align: right;
}

.pqs-qty-input:disabled {
	background: #f0f0f1;
}

.pqs-type-section {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 16px;
}

.pqs-type-label {
	font-weight: 600;
}

.pqs-type-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 16px;
	cursor: pointer;
}

.pqs-type-option input {
	width: 20px;
	height: 20px;
}

.pqs-shelf-section {
	margin-bottom: 16px;
}

.pqs-shelf-label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.pqs-shelf-input {
	width: 100%;
	padding: 10px 12px;
	font-size: 16px;
	border: 1px solid #999;
	border-radius: 4px;
	min-height: 44px;
}

.pqs-shelf-help {
	font-size: 12px;
	color: #50575e;
	margin: 4px 0 0;
}

.pqs-total-section {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	background: #2271b1;
	color: #fff;
	padding: 16px;
	border-radius: 4px;
	margin-bottom: 16px;
}

.pqs-total-label {
	font-size: 16px;
}

.pqs-total-value {
	font-size: 28px;
	font-weight: 700;
}

.pqs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 24px;
}

.pqs-actions .pqs-btn {
	flex: 1 1 120px;
}

.pqs-btn-store {
	background: #00a32a;
	border-color: #00a32a;
	color: #fff;
}

.pqs-btn-store:disabled {
	background: #f0f0f1;
	border-color: #ccd0d4;
	color: #a7aaad;
	cursor: not-allowed;
}

.pqs-btn-danger {
	background: #fdecea;
	border-color: #d63638;
	color: #8a1f1f;
}

.pqs-login-required {
	max-width: 480px;
	margin: 0 auto;
}

/* 保管リスト */
.pqs-storage-section {
	border-top: 2px solid #dcdcde;
	padding-top: 16px;
}

.pqs-storage-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.pqs-storage-title {
	margin: 0;
	font-size: 16px;
}

.pqs-storage-count {
	font-size: 13px;
	color: #50575e;
	background: #f0f0f1;
	padding: 2px 10px;
	border-radius: 10px;
}

.pqs-storage-empty {
	font-size: 13px;
	color: #50575e;
	padding: 12px 0;
}

.pqs-storage-table-wrap {
	overflow-x: auto;
	margin-bottom: 12px;
}

.pqs-storage-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}

.pqs-storage-table th,
.pqs-storage-table td {
	padding: 6px 8px;
	border-bottom: 1px solid #dcdcde;
	text-align: left;
	white-space: nowrap;
}

.pqs-storage-table thead th {
	background: #f6f7f7;
	font-weight: 600;
}

.pqs-storage-status {
	display: inline-block;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
}

.pqs-storage-status.is-sent {
	background: #e6f4ea;
	color: #1e4620;
}

.pqs-storage-status.is-unsent {
	background: #f0f0f1;
	color: #50575e;
}

.pqs-storage-type {
	display: inline-block;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
	font-weight: 600;
}

.pqs-storage-type.is-in {
	background: #e7f3ff;
	color: #0a4b78;
}

.pqs-storage-type.is-out {
	background: #fff4e5;
	color: #8a4b00;
}

.pqs-storage-delete-link {
	color: #d63638;
	cursor: pointer;
	text-decoration: underline;
	font-size: 12px;
	background: none;
	border: none;
	padding: 0;
}

.pqs-storage-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pqs-storage-actions .pqs-btn {
	flex: 1 1 140px;
}

@media (min-width: 782px) {
	.pqs-scanner {
		max-width: 640px;
	}

	.pqs-product-info {
		display: grid;
	}
}
