/* メモキュー 共通スタイル（カンプ１に合わせたスマホ向けのデザイン。PCでは中央に同じ幅で表示） */
:root {
	--bg: #f9f7ef;        /* 背景のクリーム色 */
	--panel: #fffefb;     /* 白い大きな枠 */
	--card: #ffffff;      /* メモ1件の行 */
	--text: #333333;
	--muted: #777777;
	--line: #e6e2d9;
	--accent: #5b7a92;    /* add ボタンの枠など（猫のリボンの青に寄せた色） */
	--bar: #c4cdc6;       /* 下部バーのグレーグリーン */
	--danger: #c0504d;
	--radius: 24px;
}

* { box-sizing: border-box; }
body {
	margin: 0 auto; max-width: 430px; min-height: 100vh;
	padding: 0 14px 72px;  /* 下は固定バーの分あける */
	background: var(--bg); color: var(--text);
	font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; font-size: 15px;
}
a { color: var(--accent); }

/* ===== ロゴ ===== */
.logo { text-align: center; padding: 14px 0 4px; }
.logo a { text-decoration: none; }
.logo img { height: 56px; max-width: 70%; object-fit: contain; color: #2d4f8a; font-size: 26px; font-style: italic; }

/* ===== 検索・並び順 ===== */
form.search { display: flex; gap: 8px; margin: 4px 0 12px; }
form.search input { flex: 1; min-width: 0; }
form.search input, form.search select {
	padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font: inherit; font-size: 13px;
}
.search-result { font-size: 13px; color: var(--muted); margin: 0 4px 8px; }

/* ===== 白い大きな枠 ===== */
.panel, .container {
	background: var(--panel); border-radius: var(--radius);
	padding: 24px 22px;
}
.container { margin-top: 8px; }
.container h1 { font-size: 18px; margin: 0 0 16px; }

/* ===== メモ一覧 ===== */
/* 1件の高さ74px＋間24px。5件分の高さで止め、それ以上は枠の中をスクロール（スマホではスワイプ） */
.panel { padding: 24px 22px 120px; }  /* 左右同じ余白でメモを中央に。下は猫と add ボタンが重なる分 */
ul.memos {
	list-style: none; margin: 0; padding: 0 0 0 0;
	max-height: calc(74px * 5 + 24px * 4);
	overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
	scroll-snap-type: y proximity; scrollbar-width: none;
}
ul.memos::-webkit-scrollbar { display: none; }
ul.memos li { scroll-snap-align: start; }
ul.memos li + li { margin-top: 24px; }
ul.memos a {
	display: grid; grid-template-columns: 40px 20px 1fr auto 18px; align-items: center; column-gap: 10px;
	height: 74px; padding-left: 10px;
	background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
	color: inherit; text-decoration: none;
}
ul.memos a:active { background: #f4f1ea; }
ul.memos .date { display: flex; flex-direction: column; font-size: 12px; line-height: 1.5; }
/* 日付と内容の間の斜め線 */
ul.memos .slash { justify-self: center; width: 1px; height: 40px; background: var(--text); transform: rotate(-12deg); }
ul.memos .content { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
ul.memos .tag { font-size: 13px; color: var(--muted); max-width: 5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.memos .bar { align-self: stretch; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; margin: 0; line-height: 1.8; }

/* ===== add ボタン（白い枠の下端に半分重ねる）と、後ろの猫（haku.png） ===== */
.add-area {
	/* 猫を白い枠の下の方に重ね、その上に add ボタンを置く（カンプ１の配置） */
	position: relative; margin-top: -118px; height: 230px;
	display: flex; justify-content: center; align-items: flex-start;
	background: url("../images/haku.png") center top / 230px 230px no-repeat;
	pointer-events: none;  /* 猫の部分は押せないように（ボタンだけ押せる） */
}
.add {
	position: relative; top: 70px; pointer-events: auto; width: 92px; height: 92px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; text-align: center;
	background: #fff; border: 1px solid var(--accent); color: #111;
	font-weight: bold; font-size: 17px; line-height: 1.1; text-decoration: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

/* ===== 下部の固定バー ===== */
.bottombar {
	position: fixed; left: 0; right: 0; bottom: 0; height: 50px;
	display: flex; justify-content: space-between; align-items: center;
	padding: 0 max(28px, calc(50% - 215px + 28px));  /* PCでも中身は430px幅にそろえる */
	padding-bottom: env(safe-area-inset-bottom);
	background: var(--bar);
}
.bottombar a, .bottombar button.link { color: var(--text); text-decoration: none; font-size: 14px; }
.bottombar form { margin: 0; }
button.link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }

/* ===== お知らせ・エラー ===== */
.notice { color: var(--accent); font-size: 13px; margin: 0 4px 8px; }
.error { color: var(--danger); margin: 4px 0 0; font-size: 13px; }

/* ===== 入力画面（メモ登録・タグ登録・ログインなど） ===== */
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: bold; }
.field input, .field select, .field textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
	background: #fff; font: inherit;
}
.field input.color { width: 64px; height: 40px; padding: 2px; }
.field.checkbox label { display: block; font-weight: normal; margin-bottom: 6px; }
.field.checkbox input { width: auto; }
.field a { display: inline-block; margin-top: 6px; font-size: 13px; }
button, a.button {
	display: inline-block; padding: 10px 28px; border: 1px solid var(--accent); border-radius: 999px;
	background: #fff; color: #111; font: inherit; font-weight: bold; text-decoration: none; cursor: pointer;
}
button.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
form > button + a { margin-left: 12px; font-size: 13px; }
.delete-form { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ===== タグ一覧 ===== */
table.tags { width: 100%; border-collapse: collapse; }
table.tags th, table.tags td { padding: 10px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
table.tags th { font-size: 12px; color: var(--muted); font-weight: normal; }
table.tags td.actions { text-align: right; white-space: nowrap; }
table.tags td.actions a { margin-left: 8px; font-size: 13px; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; border: 1px solid var(--line); }
