.kiwi-maru-regular {
	font-family: "Kiwi Maru", serif;
	font-weight: 400;
	font-style: normal;
}

/* =========================
   Base
========================= */
:root {
	--bg: #fffdf7;
	--text: #333;
	--primary: #ff7eb9;
	/* ポップなピンク */
	--secondary: #7afcff;
	/* 水色 */
	--accent: #feff9c;
	/* イエロー */
	--success: #9dffb0;
	/* ライトグリーン */
	--danger: #ff6f61;
	--card: #ffffff;
	--border: #eaeaea;
	--radius: 14px;
	--shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
	box-sizing: border-box
}

html,
body {
	height: 100%
}

body {
	font-family: "Kiwi Maru", serif;
	/* —— ここを“淡いグラデーション背景”に変更 —— */
	background: linear-gradient(135deg, #ffdde1, #ee9ca7, #a1c4fd, #c2e9fb);
	background-size: 400% 400%;
	animation: gradientFlow 18s ease infinite;
	color: var(--text);
	margin: 0;
	padding: 0;
}

/* 背景グラデーションをゆっくり動かす */
@keyframes gradientFlow {
	0% {
		background-position: 0% 50%;
	}

	50% {
		background-position: 100% 50%;
	}

	100% {
		background-position: 0% 50%;
	}
}

/* Layout */
.container {
	max-width: 900px;
	margin: 20px auto;
	padding: 20px;
	text-align: center;
	/* グラデ背景上で読みやすくするカード風 */
	background: rgba(255, 255, 255, 0.92);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

/* Header / Nav（_header.phpで囲っている想定） */
.header {
	/* ピンクベタ → 透明感のあるガラス風ヘッダーに */
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: var(--primary);
	padding: 10px 20px;
	box-shadow: var(--shadow);
	border-bottom: 1px solid #ffffff66;
}

.header__inner {
	max-width: 980px;
	margin: 0 auto;
	padding: 10px var(--space);
	display: flex;
	gap: 18px;
	align-items: center;
	flex-wrap: wrap;
}

.header a {
	color: var(--primary);
	margin-right: 15px;
	text-decoration: none;
	font-weight: bold;
	transition: opacity 0.2s;
}

.header a:hover {
	opacity: 0.8;
}

/* --- ナビのベース（PC表示） --- */
.header .brand {
	font-weight: 800;
	color: var(--primary);
	text-decoration: none;
}

.nav {
	margin-left: auto;
	display: flex;
	gap: 14px;
}

.nav a {
	padding: 6px 8px;
	border-radius: 10px;
}

.nav a:hover {
	background: #0000000d;
}

/* ハンバーガーボタン */
.nav-toggle {
	display: none;
	/* PCでは非表示 */
	width: 40px;
	height: 40px;
	margin-left: auto;
	border: none;
	background: transparent;
	border-radius: 10px;
	cursor: pointer;
}

.nav-toggle__bar {
	display: block;
	width: 22px;
	height: 2px;
	margin: 5px auto;
	background: var(--primary);
	transition: transform .2s, opacity .2s;
}

/* 開いたときの×風アニメ */
.header.is-open .nav-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.header.is-open .nav-toggle__bar:nth-child(2) {
	opacity: 0;
}

.header.is-open .nav-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Headings */
h1 {
	font-size: clamp(22px, 3.2vw, 32px);
	margin: 18px 0 14px;
	text-align: center
}

h2 {
	font-size: 20px;
	margin: 18px 0 10px
}

h3 {
	font-size: 18px;
	margin: 14px 0 8px
}

ul {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

.features {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

.features li {
	margin: 6px 0;
}

/* Links / Buttons */
a {
	color: var(--link);
	text-decoration: none;
}

a.btn,
.btn {
	display: inline-block;
	padding: 8px 14px;
	border-radius: var(--radius);
	border: none;
	cursor: pointer;
	font-weight: bold;
	transition: transform 0.1s, box-shadow 0.2s;
	background: var(--primary);
	color: white;
	text-decoration: none;
}

.btn:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}

.btn.primary {
	background: var(--secondary);
	color: #333;
}

.btn.primary:hover {
	filter: brightness(.98);
}

.btn.danger {
	background: var(--danger);
	color: #fff;
}

.btn.small {
	padding: 6px 10px;
	font-size: 14px
}

.linklike {
	background: none;
	border: none;
	color: var(--danger);
	text-decoration: none;
	cursor: pointer;
}

/* Forms */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
	border: 2px solid var(--border);
	border-radius: var(--radius);
	padding: 6px 10px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--primary);
}

label {
	display: block;
	font-weight: 600;
	margin: 10px 0 6px
}

.auth-form,
.form-panel {
	background: var(--panel);
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

/* Flash */
.alert {
	padding: 10px;
	border-radius: var(--radius);
	margin: 10px 0;
}

.alert.error {
	background: #ffe0e0;
	color: #c00;
}

.alert.success {
	background: #e0ffe0;
	color: #060;
}

/* Tables */
table {
	border-collapse: collapse;
	width: 100%
}

table.list {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow)
}

.list th,
.list td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	vertical-align: middle
}

.list thead th {
	background: #f8fafc;
	text-align: center;
	font-size: 14px;
	color: #374151
}

.list tr:hover td {
	background: #fafafa
}

.list td a {
	color: var(--primary);
}

/* 操作列のボタンを詰める */
#shop-list .btn.small {
	padding: 4px 8px;
	font-size: 12px;
}

#shop-list {
	table-layout: fixed;
	width: 100%;
}

#shop-list th,
#shop-list td {
	padding: 6px 8px;
}

/* 1=チェック 2=食材名 3=必要量 4=単位 5=購入量 6=操作 */
#shop-list th:nth-child(1),
#shop-list td:nth-child(1) {
	width: 2.2em;
}

#shop-list th:nth-child(3),
#shop-list td:nth-child(3) {
	width: 4.8em;
	text-align: right;
}

#shop-list th:nth-child(4),
#shop-list td:nth-child(4) {
	width: 3.6em;
	white-space: nowrap;
}

#shop-list th:nth-child(5),
#shop-list td:nth-child(5) {
	width: 5.2em;
}

/* ←購入量を細く */
#shop-list th:nth-child(6),
#shop-list td:nth-child(6) {
	width: 4.2em;
	text-align: right;
}

#shop-list .buy-qty {
	width: 100%;
	/* 列幅に合わせる */
	max-width: 5.2em;
	/* 列幅と同じくらいに制限 */
	min-width: 0;
	/* これが無いとオーバーランしやすい */
	box-sizing: border-box;
	text-align: right;
}

/* カード感の余白（任意） */
.add-extra.box input {
	padding: 6px 10px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
}


/* Modal (week.php) */
.modal[hidden] {
	display: none
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
}

.modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: 1;
}

.modal__panel {
	position: relative;
	z-index: 2;
	/* ← これで panel が必ず前面 */
	margin: 7vh auto 0;
	max-width: 560px;
	background: #fff;
	border-radius: 16px;
	padding: 18px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
	border: 1px solid #eee;
}

.modal h2 {
	margin-top: 2px;
	margin-bottom: 10px
}

.modal .grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px
}

.modal__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 14px
}

/* Pantry */
.pantry-form input[type="number"] {
	text-align: right
}

.pantry .btn-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 10px 0
}

/* Recipe list cards（一覧を少しカードっぽく見せたい時に使う） */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px
}

.card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px;
	box-shadow: var(--shadow);
}

.card h3 {
	margin: 0 0 6px
}

.badge {
	display: inline-flex;
	align-items: center;
	height: 22px;
	padding: 0 8px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #334155;
	font-size: 12px
}

/* Footer */
footer {
	color: var(--muted);
	font-size: 13px;
	margin: 22px 0;
	text-align: center;
}

/* Utilities */
.m-0 {
	margin: 0
}

.mt-1 {
	margin-top: 6px
}

.mt-2 {
	margin-top: 12px
}

.mt-3 {
	margin-top: 18px
}

.gap-1 {
	gap: 6px
}

.gap-2 {
	gap: 12px
}

.center {
	display: flex;
	justify-content: center;
	align-items: center
}

.right {
	text-align: right
}

.hidden {
	display: none !important
}

/* recipe new/edit */
.recipe-form {
	max-width: 760px;
	margin: 0 auto;
}

/* フォーム全体を中央に */
.recipe-form .form-row {
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 12px;
	align-items: start;
	/* 入力欄を上揃え */
	margin: 12px 0;
}

.recipe-form .form-row textarea {
	min-height: 180px;
	resize: vertical;
}

/* 使い方欄の高さ */

/* 材料ブロックだけを「真ん中にぎゅっ」 */
.ing-wrap {
	max-width: 700px;
	margin: 0 auto;
}

/* 幅を絞って中央寄せ */
.ing-grid {
	/* ヘッダ/行を同じグリッドで揃える */
	display: grid;
	grid-template-columns: 1.2fr 0.6fr 0.6fr 1fr auto;
	gap: 10px;
	align-items: center;
	justify-items: start;
}

.ing-head {
	font-weight: 600;
	color: #374151;
	margin-top: 10px;
}

.ing-row input {
	width: 100%;
}

/* 各セルのinputを列幅いっぱいに */
.ing-actions {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 12px;
}

/* Responsive tweaks */
@media (max-width:720px) {
	.modal .grid {
		grid-template-columns: 1fr;
	}

	.week-table th:first-child {
		background: var(--accent);
	}

	.header__inner {
		gap: 10px;
	}

	.btn {
		padding: 7px 12px;
	}

	body {
		font-size: 15px;
	}

	.nav-toggle {
		display: block;
	}

	/* デフォは閉じる */
	.nav {
		position: absolute;
		right: 14px;
		left: 14px;
		top: 58px;
		display: none;
		flex-direction: column;
		gap: 8px;
		padding: 12px;
		background: rgba(255, 255, 255, 0.95);
		border: 1px solid var(--border);
		border-radius: var(--radius);
		box-shadow: var(--shadow);
		z-index: 100;
		pointer-events: auto;
	}

	/* 開いたら表示 */
	.header.is-open .nav {
		display: flex;
		pointer-events: auto;
	}
}

/* --- Weekly planner polish --- */
.week-table {
	table-layout: fixed;
	/* はみ出し防止 */
	border-radius: 18px;
	/* ふんわりカード感 */
	overflow: hidden;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
	margin-bottom: 10px;
}

.week-table thead th {
	background: linear-gradient(0deg, #fff6a5, #feff9c);
	color: #3b3b3b;
	font-weight: 700;
	letter-spacing: .3px;
	border-bottom: 1px solid #f1eaa4;
}

.week-table th:first-child {
	background: #fff6a5;
	/* 左の「日付」列 */
	position: static;
	left: 0;
	z-index: 2;
	font-weight: 700;
	border-right: 1px solid #f1eaa4;
	border-bottom: 1px solid #f1eaa4;
}

.week-table tbody tr:nth-child(odd) td {
	background: #ffffff;
	/* 交互でほんのり */
}

.week-table tbody tr:nth-child(even) td {
	background: #fffdf7;
}

/* 今日の行を目立たせる（下の JS or PHP で .is-today を付与） */
.week-table tr.is-today th:first-child,
.week-table tr.is-today td {
	background: #fff1f4 !important;
	box-shadow: inset 0 0 0 9999px rgba(255, 126, 185, .05);
}

/* セル内のコントロールを“ピル”風に */
.week-cell {
	display: grid;
	grid-template-columns: 1fr auto;
	/* [select] [人数] */
	grid-template-rows: auto auto;
	/* 下段に2行ラベル */
	column-gap: 8px;
	row-gap: 4px;
	align-items: center;
	position: relative;
	border-bottom: 1px dotted rgb(186, 186, 186);
	border-right: 1px dotted rgb(187, 187, 187);
}

.week-cell .recipe-select {
	width: 100%;
	min-width: 0;
	padding: 6px 10px;
	border: 2px solid var(--border);
	border-radius: var(--radius);
	background: #fff;
	/* box-shadow: 0 2px 0 rgba(0, 0, 0, .03); */
}

/* .week-cell .servings-wrap {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid #e5e7eb;
	background: #fff;
	box-shadow: 0 2px 0 rgba(0, 0, 0, .03);
	white-space: nowrap;
} */

.week-cell .servings {
	width: 3.2em;
	text-align: right;
}

/* 2行までのラベル（長い料理名を折り返し） */
.week-cell .recipe-label {
	grid-column: 1 / -1;
	font-size: 12px;
	line-height: 1.2;
	color: #666;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
	pointer-events: none;
	/* クリック妨害しない */
}

/* iPhone SE 等の幅での最適化 */
@media (max-width: 420px) {

	.week-table td,
	.week-table th {
		padding: 6px 8px;
		font-size: 14px;
	}

	.week-cell {
		grid-template-columns: 1fr;
		/* 縦積み */
		grid-template-rows: auto auto auto;
		border: none;
	}

	.week-cell .servings-wrap {
		justify-self: end;
		/* 2段目右寄せ */
	}

	.week-cell .recipe-label {
		font-size: 11.5px;
		opacity: .9;
		/* 3段目 */
	}

	.week-table th:first-child {
		width: 20%;
	}
}

/* セレクトがクリックできない事故の予防 */
.week-cell .recipe-select,
.week-cell .servings-wrap {
	z-index: 1;
}

/* 材料テーブル：スマホではレスポンシブに縦積み */
#ing-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
}

#ing-table th,
#ing-table td {
	padding: 6px;
	border-bottom: 1px solid #eee;
	text-align: left;
}

/* --- スマホサイズ以下 --- */
@media (max-width: 600px) {
	#ing-table thead {
		display: none;
		/* ヘッダ非表示 */
	}

	#ing-table tr {
		display: block;
		margin-bottom: 12px;
		border: 1px solid #f0f0f0;
		border-radius: 10px;
		padding: 8px;
		background: #fff;
		box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
	}

	#ing-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 6px;
		border: none;
	}

	#ing-table td::before {
		content: attr(data-label);
		/* ヘッダ名を疑似要素で表示 */
		font-weight: bold;
		margin-right: 8px;
		color: #555;
		flex-shrink: 0;
	}

	/* 入力欄が狭すぎないように */
	#ing-table input {
		flex: 1;
		min-width: 0;
	}
}