/* =========================
全体設定
========================= */
body {
	font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
	background: #eef1f5;
	margin: 0;
	padding: 20px 10px 60px;
	overflow-x: hidden;
	font-size: 13px;
	line-height: 1.4;
	-webkit-text-size-adjust: 100%;
}

.container {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 8px;
	box-sizing: border-box;
}

/* =========================
共通ユーティリティ
========================= */
.full-width {
	width: 100%;
	display: block;
	box-sizing: border-box;
}

/* =========================
カード
========================= */
.card {
	background: #fff;
	padding: 12px;
	margin-bottom: 12px;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* =========================
見出し
========================= */
h3 {
	font-size: 13px;
	margin: 0 0 10px;
	border-left: 4px solid #4a90e2;
	padding-left: 8px;
}

/* =========================
作業ブロック
========================= */
.work-block {
	background: #f9fafc;
	border-left: 4px solid #4a90e2;
	padding: 10px;
	margin-bottom: 12px;
	border-radius: 8px;
	position: relative;
}

.work-body {
	display: none;
}
.work-block.open .work-body {
	display: block;
}

.work-del-btn {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 26px;
	height: 26px;
	font-size: 14px;
	border-radius: 50%;
}

/* =========================
入力共通
========================= */
input,
select,
textarea {
	font-size: 13px;
	box-sizing: border-box;
}

/* =========================
work-body入力（全幅）
========================= */
.work-body input,
.work-body textarea {
	width: 100%;
	max-width: 100%;
}

/* =========================
作業内容
========================= */
.work-body input.auto-size {
	padding: 6px 8px;
}

/* =========================
メモ
========================= */
.work-body textarea.auto-height {
	min-height: 60px;
	padding: 6px 8px;
	line-height: 1.4;
	resize: none;
	overflow: hidden;
}

/* =========================
材料行（最重要）
========================= */
.material-row {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	width: 100%;
	gap: 6px;
}

.material-row > * {
	min-width: 0;
	flex-shrink: 1;
}

/* 材料名 */
.mat-name {
	flex: 1 1 auto;
	min-width: 0;
}

/* 数量（ラベルを疑似要素化） */
.mat-qty {
	flex: 0 0 50px;
	width: 50px;
	min-width: 50px;
	max-width: 50px;
	text-align: center;

	position: relative;
	padding-top: 0; /* ← 高さが伸びない */
}

.mat-qty::before {
	content: "数量";
	position: absolute;
	top: -12px; /* ← input の外側に浮かせる */
	left: 0;
	font-size: 10px;
	color: #666;
}



/* 削除ボタン */
.material-row .del-btn {
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	padding: 0;
	font-size: 13px;
}

/* =========================
時間入力（time-box 削除対応）
========================= */
.row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.row label {
	display: block;
	margin-bottom: 4px;
}
.row input[type="time"] {
	width: 100%;
}

/* =========================
写真（wrapper 削除対応）
========================= */
.photo-preview {
	display: flex;
	overflow-x: auto;
	gap: 8px;
}
.photo-preview img {
	height: 90px;
	width: auto;
	object-fit: cover;
	border-radius: 6px;
}

/* =========================
ボタン
========================= */
.add-btn,
.del-btn,
button {
	font-size: 13px;
}

.add-btn {
	background: #4caf50;
	color: #fff;
	padding: 8px 10px;
	border-radius: 6px;
	border: none;
}

.del-btn {
	background: #e74c3c;
	color: #fff;
	border: none;
}

/* =========================
textarea共通
========================= */
textarea {
	line-height: 1.4;
	padding: 6px 8px;
	resize: none;
}

/* =========================
content-area
========================= */
.content-area.full-width {
	width: 100%;
	display: block;
	max-width: 100%;
}

/* =========================
固定バー
========================= */
#fixed_bar {
	position: fixed;
	bottom: env(safe-area-inset-bottom, 0);
	left: 0;
	width: 100%;
	background: #fff;
	padding: 6px 10px;
	box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
	display: flex;
	gap: 6px;
	box-sizing: border-box;
	z-index: 999;
}

#fixed_bar button,
#fixed_bar a {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	font-size: 13px;
	border-radius: 6px;
	border: none;
	color: #fff;
	text-decoration: none;
}

/* 保存 */
#fixed_bar .save-btn {
	background: #4a90e2;
}

/* 戻る */
#fixed_bar .list-btn {
	background: #999;
}

/* =========================
iPhone補正
========================= */
@supports (-webkit-touch-callout: none) {
	.photo-preview img {
		min-width: 110px;
	}

	.card {
		padding-left: 8px;
		padding-right: 8px;
	}
}

/* =========================
PC最適化
========================= */
@media screen and (min-width: 900px) {

	.container {
		padding: 0 20px;
	}

	.card {
		padding: 20px;
		margin-bottom: 20px;
	}

	.mat-name {
		min-width: 150px;
	}

	#fixed_bar {
		position: static;
		box-shadow: none;
		margin-top: 20px;
	}
}

.preview-thumb {
	width: 120px;
	height: auto;
	margin: 5px;
	border-radius: 4px;
	object-fit: cover;
}
#fixed_bar .view-btn {
	background: #4a90e2;
	color: #fff;
	padding: 10px 14px;
	border-radius: 6px;
	text-decoration: none;
	margin-left: 8px;
}
/* =============================
写真 2 列グリッド（sekisan.php 用）
============================= */
.photo-grid {
	display: grid;
	grid-template-columns: 1fr 1fr; /* ★ 2列 */
	gap: 12px;
	margin-top: 10px;
}

/* 各写真ブロック */
.photo-item {
	background: #fff;
	padding: 8px;
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
	text-align: center;
}

/* サムネイル画像 */
.photo-item img {
	width: 100%;
	height: auto;
	max-height: 180px;
	object-fit: contain;
	border-radius: 6px;
}

/* null 写真用 */
.no-photo-thumb {
	width: 100%;
	height: 150px;
	background: #ddd;
	border-radius: 6px;
	display: flex;
	justify-content: center;
	align-items: center;
	color: #666;
	font-size: 12px;
}

/* ボタン（3段構成） */
.photo-btns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin-top: 6px;
}

.photo-btns .full-row {
	grid-column: 1 / 3;
}

/* =============================
サムネイル 2 列グリッド
============================= */
.photo-grid {
	display: grid;
	grid-template-columns: 1fr 1fr; /* ★ 2列 */
	gap: 12px;
	margin-top: 10px;
}

/* 各写真ブロック */
.photo-item {
	background: #fff;
	padding: 8px;
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
	text-align: center;
}

/* サムネイル画像 */
.photo-item img {
	width: 100%;
	height: auto;
	max-height: 180px;
	object-fit: contain;
	border-radius: 6px;
}


