/*
 * 新しい Engawa の見た目（2026-11-16 作業 20506）
 * - 見た目の決まり（色・文字・角の丸み・余白）は今の Engawa（engawa.css の :root）から受け継ぐ
 * - HTML と CSS は新しく作る。古い float・<br clear>・!important は使わない
 * - 順番は @layer で決める（あとの層が勝つ）。部品の中の切り替えは、画面全体の幅ではなく部品の幅で（@container）
 */
@layer reset, tokens, base, frame, parts, screens;

/* ---------- 決まり（今の Engawa と同じ値） ---------- */
@layer tokens {
	:root {
		--bg: #f3eee5; --surface: #fbf8f2; --ink: #2b2622; --sub: #7d7368; --line: #d8cfc0; --line2: #e7dfd1;
		--accent: #a4532b; --accent-ink: #fff; --hi: #f1e2d3; --late: #b3261e; --radius: 4px;
		--side: #2b2622; --side-ink: #efe8dc; --side-sub: #a69a8b;
		--sat: #2f5fb3; --come: #5b6b4a; --other: #b9ad9c; --ev-bg: #f6efe4;
		--err: #cf6408; --err-bg: #fdf1e4; --err-line: #f1cfaa;
		--font: "Jost", "Zen Kaku Gothic New", sans-serif;
	}
}

@layer reset {
	*, *::before, *::after { box-sizing: border-box; }
	body, h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
	ol, ul { padding: 0; list-style: none; }
	button, input, select, textarea { font: inherit; color: inherit; }
	img, svg { display: block; max-width: 100%; }
	[hidden] { display: none !important; } /* 隠した欄は、どの指定よりも優先して隠す（いちばん前の層の !important は後の層にも勝つ） */
	table { border-collapse: collapse; }
}

@layer base {
	body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.65; -webkit-text-size-adjust: 100%; }
	a { color: var(--accent); text-decoration: none; }
	a:hover { color: var(--ink); text-decoration: underline; }
	/* プルダウン（今の Engawa では同じ指定が5か所にあったものを1つに） */
	select:not([multiple]) { appearance: none; block-size: 38px; padding: 0 34px 0 12px; font-size: 14px; color: var(--ink); cursor: pointer;
		background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%237d7368' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
		border: 1px solid var(--line); border-radius: var(--radius); }
	.ic { inline-size: 20px; block-size: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
	.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- 枠：左のメニュー（PC）／上の帯と下のタブ（スマートフォン） ---------- */
@layer frame {
	.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-block-size: 100vh; }
	.side { background: var(--side); color: var(--side-ink); padding: 24px 14px; position: sticky; inset-block-start: 0; block-size: 100vh; display: flex; flex-direction: column; gap: 24px; }
	.brand { display: block; color: var(--side-ink); font-weight: 700; font-size: 24px; letter-spacing: .12em; line-height: 1; padding: 0 10px; text-decoration: none; }
	.brand small { display: block; font-size: 10px; color: var(--side-sub); margin-block-start: 6px; letter-spacing: .02em; font-weight: 400; }
	.side-nav { display: flex; flex-direction: column; gap: 2px; }
	.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: var(--side-ink); font-weight: 500; text-decoration: none; }
	.side-nav a:hover { background: rgb(255 255 255 / .06); }
	.side-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
	.side-me { margin-block-start: auto; padding: 12px; border-block-start: 1px solid rgb(166 154 139 / .4); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
	.side-me button { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--side-sub); cursor: pointer; }
	.side-me .ic { inline-size: 16px; block-size: 16px; }
	.app-body { min-inline-size: 0; }
	.main { padding: 24px 32px 48px; container: main / inline-size; }
	.mtop, .tabbar { display: none; }
	.flash { margin: 0 0 14px; padding: 10px 14px; background: var(--hi); border-radius: var(--radius); font-size: 13px; }

	@media (max-width: 760px) {
		.app { display: block; }
		.side { display: none; }
		.mtop { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--side); position: sticky; inset-block-start: 0; z-index: 20; }
		.mtop .brand { padding: 0; font-size: 22px; }
		.main { padding: 16px 16px 96px; }
		.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset-inline: 0; inset-block-end: 0; background: var(--surface); border-block-start: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
		.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--sub); padding: 4px 0; text-decoration: none; }
		.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
	}
}

/* ---------- 部品 ---------- */
@layer parts {
	/* 画面の見出し：題名と「＋ 追加」、下に小さな説明。右に操作（狭いときは下へ） */
	.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 24px; margin-block-end: 16px; }
	.page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
	.page-title h1 { font-size: 24px; line-height: 1.25; font-weight: 700; }
	.page-sub { inline-size: 100%; font-size: 13px; color: var(--sub); line-height: 1.5; }
	.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
	.page-actions { justify-content: flex-end; }
	@container main (max-width: 900px) { .page-head { grid-template-columns: minmax(0, 1fr); } .page-actions { justify-content: flex-start; } }

	:is(.btn, .pager a, .seg a, .tabs a, .ev, .tk, .strip-row, .res, .mev, .mtk, .mday, .member-head h3 a):hover { text-decoration: none; }
	.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 700; line-height: 1.4; text-decoration: none; white-space: nowrap; cursor: pointer; border: 1px solid transparent; }
	.btn-primary { background: var(--accent); color: var(--accent-ink); }
	.btn-primary:hover { filter: brightness(1.08); }
	.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; }
	.btn-ghost:hover { border-color: var(--sub); }
	.btn-sm { padding: 5px 12px; font-size: 12px; font-weight: 500; }
	.page-title .btn-primary { padding: 6px 14px; }
	/* ページの編集ボタンは、いつも画面の見出しの右上隅にオレンジ色で出す（2026-11-16 日野さんの指示） */
	.btn-edit { background: var(--accent); color: var(--accent-ink); padding: 6px 18px; }
	.btn-edit:hover { filter: brightness(1.08); }
	.page-head:has(.btn-edit) { position: relative; padding-inline-end: 84px; }
	.page-head .btn-edit { position: absolute; inset-block-start: 0; inset-inline-end: 0; }

	/* 前・次の矢印と期間 */
	.pager { display: flex; align-items: center; gap: 6px; }
	.pager .arrow { color: var(--ink); display: inline-grid; place-items: center; inline-size: 34px; block-size: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 18px; text-decoration: none; }
	.pager .range { font-size: 17px; font-weight: 600; margin: 0 4px; white-space: nowrap; }
	.pager .today { font-size: 12px; color: var(--sub); padding: 0 6px; text-decoration: none; }

	/* 切り替え（週｜月） */
	.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
	.seg a { padding: 7px 14px; font-size: 13px; color: var(--ink); }
	.seg a[aria-current="page"] { background: var(--ink); color: var(--surface); }

	/* チェックで切り替える札（作業を表示） */
	.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; user-select: none; }
	.toggle input { inline-size: 16px; block-size: 16px; accent-color: var(--accent); margin: 0; }

	/* タブ（下線） */
	.tabs { display: flex; gap: 2px; border-block-end: 1px solid var(--line); margin-block-end: 14px; }
	.tabs a { padding: 8px 14px; font-size: 14px; color: var(--sub); text-decoration: none; border-block-end: 2px solid transparent; margin-block-end: -1px; }
	.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-block-end-color: var(--accent); }

	/* 枠のある欄 */
	.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-block-end: 16px; }
	.card-head { display: flex; align-items: center; gap: 10px; margin-block-end: 10px; padding-block-end: 10px; border-block-end: 1px solid var(--line); }
	.card-head h2 { font-size: 15px; font-weight: 700; }
	.card-head .btn { margin-inline-start: auto; }
	.pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-block-end: 18px; font-size: 13px; color: var(--sub); }
	.pick select { min-inline-size: 240px; block-size: auto; padding-block: 9px; font-size: 13px; }
	@container main (max-width: 600px) { .pick select { min-inline-size: 0; inline-size: 100%; } }

	/* 札（期限切れ・締切間近） */
	.chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: var(--radius); background: var(--hi); color: var(--accent); white-space: nowrap; font-weight: 500; }
	.chip.late { background: var(--late); color: #fff; }
	.chip.soon { background: var(--accent); color: #fff; }

	.empty { font-size: 12px; color: var(--sub); }
}

/* ---------- スケジュール ---------- */
@layer screens {
	/* 1週間：PC は7列、狭いときは日ごとの行（部品の幅で切り替える） */
	.week-wrap { container: week / inline-size; }
	.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
	.day { border-inline-end: 1px solid var(--line2); min-block-size: 360px; display: flex; flex-direction: column; min-inline-size: 0; }
	.day:last-child { border-inline-end: 0; }
	.week.is-mini .day { min-block-size: 120px; }
	.day-head { padding: 10px 10px 8px; border-block-end: 1px solid var(--line2); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-weight: 400; }
	.day-head .dn { font-size: 22px; line-height: 1; padding: 2px 4px; }
	.day-head .dw { font-size: 12px; color: var(--sub); }
	.day-head .hol { font-size: 10px; color: var(--late); inline-size: 100%; }
	.day.is-sat :is(.dn, .dw) { color: var(--sat); }
	.day:is(.is-sun, .is-hol) :is(.dn, .dw) { color: var(--late); }
	.day.is-today .dn { background: var(--accent); color: #fff; border-radius: var(--radius); }
	.day-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
	.day-body .empty { display: none; margin: 2px; }
	.day-add { margin-block-start: auto; font-size: 12px; color: var(--sub); padding: 4px; text-decoration: none; }

	/* 予定（左の線の色で 往訪・来訪・そのほか） */
	.ev { color: var(--ink); display: block; padding: 9px 11px; background: var(--ev-bg); border-inline-start: 3px solid var(--accent); text-decoration: none; }
	.ev.come { border-inline-start-color: var(--come); }
	.ev.other { border-inline-start-color: var(--other); }
	.ev time, .ev small { display: block; font-size: 12px; color: var(--sub); }
	.ev small { font-size: 11px; }
	.ev b { display: block; font-weight: 700; line-height: 1.45; }

	/* 作業の締切。急ぎ（期限切れ・あさってまで）はいつも、ほかと完了は「作業を表示」にチェックしたとき（:has で切り替え。JavaScript なし） */
	.tasks { border-block-start: 1px dashed var(--line); padding-block-start: 6px; display: flex; flex-direction: column; gap: 2px; }
	.tasks.is-urgent + .tasks { border-block-start: 0; padding-block-start: 0; }
	.tasks.is-normal { display: none; }
	.sched:has(.js-tview:checked) .tasks.is-normal { display: flex; }
	.tk { color: var(--ink); display: block; font-size: 11.5px; line-height: 1.5; padding: 3px 4px; text-decoration: none; border-radius: var(--radius); }
	.tk:hover { background: var(--bg); }
	.tk .lbl { display: inline-block; font-size: 10px; color: var(--accent); border: 1px solid currentColor; border-radius: 2px; padding: 0 4px; margin-inline-end: 5px; line-height: 1.5; vertical-align: 1px; }
	.tk small { display: block; color: var(--sub); font-size: 10.5px; }
	.tk.done .nm { color: #b3aaa0; text-decoration: line-through; } /* 完了作業のタイトルは薄いグレー（2026-11-16 日野さんの指示） */
	.tk.done .lbl { color: var(--sub); }
	.tk.late .nm { color: var(--late); }
	.tk.late .lbl { background: var(--late); border-color: var(--late); color: #fff; }
	.tk.soon .nm { color: var(--accent); }
	.tk.soon .lbl { background: var(--accent); border-color: var(--accent); color: #fff; }

	.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--sub); margin: 10px 0 16px; }
	.legend span { display: inline-flex; align-items: center; gap: 6px; }
	.legend i { inline-size: 10px; block-size: 10px; background: var(--accent); }
	.legend i.come { background: var(--come); }
	.legend i.other { background: var(--other); }
	.legend b { font-size: 10px; font-weight: 400; color: var(--accent); border: 1px solid currentColor; border-radius: 2px; padding: 0 4px; line-height: 1.5; }

	@container week (max-width: 600px) {
		.week { display: flex; flex-direction: column; gap: 10px; background: none; border: 0; overflow: visible; }
		.day, .day:last-child { display: grid; grid-template-columns: 56px 1fr; min-block-size: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
		.week.is-mini .day { min-block-size: 0; }
		.day-head { flex-direction: column; align-items: center; border-block-end: 0; border-inline-end: 1px solid var(--line2); padding: 12px 2px; gap: 2px; text-align: center; }
		.day-head .hol { font-size: 9px; }
		.day-body { padding: 10px; }
		.day-body .empty { display: block; }
		.day-add { display: none; }
	}

	/* 進行中の作業（開くと一覧） */
	.strip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-block-end: 16px; }
	.strip summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; flex-wrap: wrap; }
	.strip summary::-webkit-details-marker { display: none; }
	.strip .t { font-weight: 700; display: flex; align-items: baseline; gap: 6px; }
	.strip .num { font-size: 18px; color: var(--accent); font-weight: 500; }
	.strip .more { margin-inline-start: auto; font-size: 12px; color: var(--sub); }
	.strip .more::after { content: " ▾"; }
	.strip[open] .more::after { content: " ▴"; }
	.strip[open] summary { border-block-end: 1px solid var(--line2); }
	.strip-list { padding: 2px 14px 8px; container: strip / inline-size; }
	.strip-row { color: var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) 150px 130px; gap: 14px; align-items: center; padding: 9px 0; border-block-end: 1px solid var(--line2); text-decoration: none; }
	.strip-row:last-child { border-block-end: 0; }
	.strip-row b { display: block; font-weight: 500; }
	.strip-row small { display: block; font-size: 12px; color: var(--sub); }
	.strip-row .chip { justify-self: end; }
	.progress { display: flex; align-items: center; gap: 8px; }
	.progress .bar { flex: 1; block-size: 6px; background: var(--line2); border-radius: var(--radius); overflow: hidden; }
	.progress .bar i { display: block; block-size: 100%; background: var(--accent); }
	.progress .pct { font-size: 12px; color: var(--sub); inline-size: 34px; text-align: end; }
	@container strip (max-width: 520px) {
		.strip-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
		.strip-row .progress { grid-column: 1 / -1; order: 3; }
	}

	/* Myメンバーの1週間 */
	.member-week { margin-block-end: 18px; }
	.member-week:last-child { margin-block-end: 0; }
	.member-head { display: flex; align-items: baseline; gap: 10px; margin-block-end: 8px; }
	.member-head h3 { font-size: 15px; font-weight: 700; }
	.member-head h3 a { color: var(--ink); }
	.member-head small { font-size: 12px; color: var(--sub); font-weight: 400; margin-inline-start: 8px; }
	.member-head > a { margin-inline-start: auto; font-size: 12px; color: var(--sub); }

	/* 設備の予約状況：設備×7日の表。狭いときは設備ごとの札にして、予約のある日だけ出す */
	.fac-wrap { container: fac / inline-size; }
	.fac-wrap .pager { margin-block-end: 10px; }
	.fac { inline-size: 100%; table-layout: fixed; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
	.fac :is(th, td) { border-inline-end: 1px solid var(--line2); border-block-end: 1px solid var(--line2); vertical-align: top; text-align: start; }
	.fac :is(th, td):last-child { border-inline-end: 0; }
	.fac tr:last-child > * { border-block-end: 0; }
	.fac thead th { padding: 8px 10px; font-size: 12px; color: var(--sub); font-weight: 400; }
	.fac thead th:first-child { inline-size: 180px; }
	.fac thead .dn { font-size: 15px; color: var(--ink); margin-inline-end: 4px; }
	.fac thead .is-today .dn { color: var(--accent); font-weight: 700; }
	.fac tbody th { padding: 10px 12px; font-size: 13px; }
	.fac tbody th small { display: block; font-size: 11px; color: var(--sub); font-weight: 400; }
	.fac td { padding: 8px; block-size: 58px; }
	.fac .is-today { background: rgb(241 226 211 / .35); }
	.fac .dl { display: none; }
	.res { color: var(--ink); display: block; font-size: 11.5px; line-height: 1.45; padding: 4px 6px; margin-block-end: 4px; background: var(--hi); border-inline-start: 3px solid var(--accent); text-decoration: none; }
	.res time { display: block; color: var(--sub); }
	.res.mine { background: var(--accent); color: #fff; border-inline-start-color: #7a3a1c; }
	.res.mine time { color: #f3e2d6; }
	@container fac (max-width: 600px) {
		.fac, .fac tbody, .fac tr, .fac th, .fac td { display: block; }
		.fac { border: 0; background: none; overflow: visible; }
		.fac thead { display: none; }
		.fac tbody tr { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-block-end: 10px; }
		.fac tbody th { border-inline-end: 0; border-block-end: 1px solid var(--line2); }
		.fac td { border: 0; block-size: auto; padding: 6px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
		.fac td:not(:has(.res)) { display: none; }
		.fac .dl { display: inline; font-size: 12px; color: var(--sub); inline-size: 64px; }
		.fac .res { flex: 1; margin: 0; }
	}

	/* 月：7列の表。狭いときは日付と点だけにして、下に予定のある日の一覧 */
	.month-wrap { container: month / inline-size; }
	.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
	.month-head, .month-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
	.month-head span { padding: 8px 10px; font-size: 12px; color: var(--sub); border-block-end: 1px solid var(--line); }
	.month-head .is-sat { color: var(--sat); }
	.month-head .is-sun { color: var(--late); }
	.mc { position: relative; min-block-size: 112px; border-inline-end: 1px solid var(--line2); border-block-end: 1px solid var(--line2); padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; min-inline-size: 0; }
	.mc:nth-child(7) { border-inline-end: 0; }
	.month-row:last-child .mc { border-block-end: 0; }
	.mc.is-out { background: rgb(243 238 229 / .6); }
	.mday { color: var(--ink); display: flex; align-items: center; gap: 6px; padding: 0 2px; text-decoration: none; }
	.mday b { font-size: 15px; font-weight: 500; }
	.mday em { font-style: normal; font-size: 10px; color: var(--late); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.mc.is-sat .mday b { color: var(--sat); }
	.mc:is(.is-sun, .is-hol) .mday b { color: var(--late); }
	.mc.is-out .mday b { color: var(--line); } /* 前後の月の日は、土日でも薄く */
	.mc.is-today .mday b { background: var(--accent); color: #fff; border-radius: var(--radius); padding: 0 5px; }
	.mev { color: var(--ink); display: block; font-size: 11.5px; line-height: 1.45; padding: 2px 6px; border-inline-start: 3px solid var(--accent); background: var(--ev-bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
	.mev.come { border-inline-start-color: var(--come); }
	.mev.other { border-inline-start-color: var(--other); }
	.mev time { color: var(--sub); margin-inline-end: 4px; }
	.mmore { font-size: 11px; color: var(--sub); padding: 0 4px; }
	.mtk { font-size: 11px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent); text-decoration: none; }
	.mtk.late { color: var(--late); }
	.mtk::before { content: "締切間近"; font-size: 9.5px; background: var(--accent); color: #fff; border-radius: 2px; padding: 0 3px; margin-inline-end: 4px; }
	.mtk.late::before { content: "期限切れ"; background: var(--late); }
	.madd { position: absolute; inset-block-start: 4px; inset-inline-end: 6px; font-size: 14px; color: var(--sub); opacity: 0; text-decoration: none; }
	.mc:hover .madd, .madd:focus { opacity: 1; }
	.dots { display: none; }
	.agenda { display: none; }
	@container month (max-width: 600px) {
		.mc { min-block-size: 54px; padding: 4px 2px; align-items: center; }
		.mday { justify-content: center; }
		.mday b { font-size: 14px; }
		.mday em, .mev, .mtk, .mmore, .madd { display: none; }
		.dots { display: flex; gap: 3px; justify-content: center; }
		.dots i { inline-size: 5px; block-size: 5px; border-radius: 50%; background: var(--accent); }
		.dots i.come { background: var(--come); }
		.dots i.other { background: var(--other); }
		.dots i.tk { background: var(--late); border-radius: 1px; }
		.month-head span { text-align: center; padding: 6px 0; }
		.agenda { display: block; margin-block-start: 16px; }
	}
	.agenda-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-block-end: 10px; scroll-margin-block-start: 70px; display: flex; flex-direction: column; gap: 8px; }
	.agenda-day.is-today { border-color: var(--accent); }
	.agenda-day h3 { font-size: 14px; font-weight: 700; }
	.agenda-day h3 em { font-style: normal; font-size: 11px; color: var(--late); margin-inline-start: 8px; font-weight: 400; }

	@media (max-width: 760px) {
		.sched .page-actions .btn-ghost { display: none; } /* スケジュールの「設備を予約」だけ隠す（今の Engawa と同じ） */
		.page-actions .pager, .tabs { inline-size: 100%; }
		.strip .more { margin-inline-start: 0; inline-size: 100%; }
		.pager .range { font-size: 16px; }
	}
}

/* ---------- 部品（どの画面でも使う）2026-11-16 作業 20506 ---------- */
@layer parts {
	/* 入力欄 */
	:where(input:not([type=checkbox], [type=radio], [type=submit], [type=button], [type=hidden]), textarea) {
		inline-size: 100%; padding: 8px 12px; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
	:where(input[type=number]) { inline-size: 90px; text-align: end; }
	:where(input[type=datetime-local], input[type=date], input[type=time]) { inline-size: auto; block-size: 38px; }
	:where(input, textarea, select):focus-visible { outline: 2px solid var(--hi); border-color: var(--accent); }
	:where(input[type=checkbox], input[type=radio]) { inline-size: 18px; block-size: 18px; margin: 0; accent-color: var(--accent); vertical-align: -3px; }
	textarea { line-height: 1.7; resize: vertical; }

	/* 入力の画面：欄の札（左に項目名）と、下の「削除／やめる・保存」 */
	.form { max-inline-size: none; } /* 2026-11-16 日野さんの指示：基本ページ全体に（これまで 980px まで） */
	.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 22px; margin-block-end: 16px; }
	.field { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-block-end: 1px solid var(--line2); align-items: start; }
	.field:last-child { border-block-end: 0; }
	.field > label, .field > .label { font-size: 13px; font-weight: 700; padding-block-start: 9px; }
	.field > label em { font-style: normal; color: var(--late); font-size: 11px; margin-inline-start: 6px; font-weight: 500; }
	.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 4px 0 0; }
	.form-actions .btn { padding: 10px 22px; font-size: 14px; }
	.form-actions .btn-del { margin-inline-end: auto; }
	.btn-del { background: var(--surface); color: var(--late); border-color: #e6b9b5; font-weight: 500; }
	.btn-del:hover { background: #fbeceb; color: var(--late); }
	.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
	.choices { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-block-start: 8px; }
	.choices small { color: var(--sub); }
	.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
	.hint { font-size: 12px; color: var(--sub); margin-block-start: 6px; }
	.errors { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err); border-radius: var(--radius); padding: 10px 16px; margin-block-end: 16px; font-size: 13px; }
	@container main (max-width: 640px) {
		.form-card { padding: 4px 16px; }
		.field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
		.field > label, .field > .label { padding-block-start: 0; }
	}

	/* Markdown の書き込み欄（書く／プレビュー） */
	.g-md-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-block-end: 6px; }
	.g-md-tabs button { background: #fff; border: 0; padding: 5px 16px; font-size: 13px; cursor: pointer; }
	.g-md-tabs button.on { background: var(--ink); color: #fff; font-weight: 700; }
	.g-md-prev { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-block-size: 120px; }

	/* 塗りの切り替え（未完｜完了｜すべて、ア行｜カ行 …） */
	.switch { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
	.switch a { padding: 8px 18px; font-size: 13px; color: var(--ink); border-inline-end: 1px solid var(--line); }
	.switch a:last-child { border-inline-end: 0; }
	.switch a:hover { background: var(--hi); text-decoration: none; }
	.switch a[aria-current="page"] { background: var(--accent); color: #fff; }
	.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-end: 12px; }
	.toolbar .end { margin-inline-start: auto; display: flex; gap: 10px; }

	/* 一覧の表 */
	.list { inline-size: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
	.list th { text-align: start; font-size: 12px; font-weight: 500; color: var(--sub); padding: 10px 12px; border-block-end: 1px solid var(--line); background: #fff; white-space: nowrap; }
	.list td { padding: 12px; border-block-end: 1px solid var(--line2); vertical-align: middle; font-size: 13.5px; }
	.list tr:last-child td { border-block-end: 0; }
	.list tbody tr:nth-child(odd) td { background: #fff; }
	.list .name { font-weight: 700; }
	.list .num, .list .sub { color: var(--sub); font-size: 12.5px; }
	.list .act { text-align: end; white-space: nowrap; inline-size: 1%; }
	.list-wrap { overflow-x: auto; }

	/* 詳細の画面：大きな枠、題名、項目と値、中の小さな欄 */
	.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-block-end: 16px; }
	.panel-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 20px; line-height: 1.4; padding-block-end: 12px; margin-block-end: 14px; border-block-end: 1px solid var(--line); }
	.panel-title .kind { font-size: 12px; font-weight: 500; background: var(--hi); color: var(--accent); padding: 2px 10px; border-radius: var(--radius); align-self: center; }
	.ctx { font-size: 12px; color: var(--sub); margin: -6px 0 12px; }
	.ctx a { font-size: 17px; font-weight: 700; margin-inline-start: 4px; }
	.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; margin-block-end: 6px; }
	.meta dt { font-size: 11.5px; color: var(--sub); margin-inline-end: 6px; white-space: nowrap; }
	.meta div { display: flex; align-items: baseline; }
	.meta dd { margin: 0; }
	.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-block: 16px; background: var(--surface); }
	.box-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-block-end: 8px; }
	.box-head h3 { font-size: 14px; font-weight: 700; }
	.box-head small { color: var(--sub); font-size: 12px; }
	.box-head .adds { margin-inline-start: auto; display: flex; gap: 12px; font-size: 12.5px; }
	.box ul > li { padding: 6px 0; border-block-end: 1px solid var(--line2); font-size: 13px; }
	.box ul > li:last-child { border-block-end: 0; }
	.box .none, .box > p { color: var(--sub); font-size: 13px; }
	.section-title { font-size: 15px; font-weight: 700; padding-block-end: 8px; margin: 28px 0 12px; border-block-end: 1px solid var(--line); }
	.body-text { background: #fff; border: 1px solid var(--line2); border-radius: var(--radius); padding: 16px 18px; margin-block: 14px; }

	/* 札・小さなしるし */
	.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: var(--radius); background: var(--bg); color: var(--sub); white-space: nowrap; vertical-align: 1px; }
	.badge.int { background: #3d3530; color: #fff; }
	.badge.k1 { background: #e7eef6; color: #2f5fb3; }
	.badge.k2 { background: #e3eedd; color: #4c6b3c; }
	.badge.k3 { background: #f0e6f3; color: #7a4d8a; }
	.status { font-size: 12.5px; color: var(--sub); white-space: nowrap; }
	.status::before { content: "●"; font-size: 9px; margin-inline-end: 4px; vertical-align: 2px; }
	.status.s1, .status.pj1 { color: var(--accent); }
	.status.s5, .status.pj3 { color: #5f8a4a; }
	.status.s6 { color: var(--late); }
	.status.s2, .status.s3 { color: #c47a12; }
	.status.s7 { color: #2f5fb3; }

	/* Markdown の表示 */
	.md { line-height: 1.8; word-break: break-word; }
	.md > * + * { margin-block-start: .7em; }
	.md h1, .md h2, .md h3 { font-size: 15px; font-weight: 700; padding-block-end: 4px; border-block-end: 1px solid var(--line2); margin-block-start: 1.2em; }
	.md ul, .md ol { padding-inline-start: 1.4em; list-style: revert; }
	.md code { background: #f1ece3; padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
	.md pre { background: #f1ece3; padding: 10px 12px; border-radius: var(--radius); overflow-x: auto; }
	.md pre code { background: none; padding: 0; }
	.md table { border: 1px solid var(--line); }
	.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: start; }
	.md th { background: var(--bg); }
	.md blockquote { border-inline-start: 3px solid var(--line); padding-inline-start: 12px; color: var(--sub); margin-inline: 0; }
	.md a { text-decoration: underline; }
}

/* ---------- 画面ごと ---------- */
@layer screens {
	/* コメント */
	.comments-count { font-size: 12.5px; color: var(--sub); padding-block-end: 8px; border-block-end: 1px solid var(--line); margin-block: 20px 0; }
	.comment { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 16px 14px; border-block-end: 1px solid var(--line2); }
	.comment-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--sub); }
	.comment-head b { font-size: 16px; color: var(--ink); min-inline-size: 18px; }
	.comment-date { font-size: 11.5px; color: var(--sub); margin-block-start: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
	.comment-date form { display: inline; }
	.comment-date button { background: none; border: 0; padding: 0; color: var(--sub); text-decoration: underline; cursor: pointer; font-size: 11.5px; }
	.comment-date a { color: var(--sub); text-decoration: underline; }
	.comment.is-int { background: #f6f1ea; }
	/* コメントの色（今の Engawa と同じ9色。左上の三角と番号の色、薄い背景） */
	.cc1 { --cc: #c73e3a; --cc-bg: #f5e9e9; } .cc2 { --cc: #005caf; --cc-bg: #eaf2f9; } .cc3 { --cc: #996600; --cc-bg: #f0e9e7; }
	.cc4 { --cc: #8b81c3; --cc-bg: #e9e7f6; } .cc5 { --cc: #f75c2f; --cc-bg: #feeeea; } .cc6 { --cc: #828282; --cc-bg: #efefef; }
	.cc7 { --cc: #1c1c1c; --cc-bg: #e2e2e2; } .cc8 { --cc: #c18a26; --cc-bg: #f5ecdc; } .cc9 { --cc: #7ba23f; --cc-bg: #eff4e8; }
	.comment[class*="cc"] { position: relative; background: var(--cc-bg); }
	.comment[class*="cc"]::before { content: ""; position: absolute; inset: 0 auto auto 0; border-block-start: 32px solid var(--cc); border-inline-end: 32px solid transparent; pointer-events: none; }
	.comment[class*="cc"] .comment-head b { color: var(--cc); }
	.comment-form { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px 18px; margin-block-start: 20px; }
	.comment-form h3 { font-size: 13px; font-weight: 700; margin-block-end: 10px; }
	.comment-form .send { display: flex; justify-content: flex-end; margin-block-start: 10px; }
	.mn-bar { margin-block-end: 8px; }
	.mn-bar summary { cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 700; list-style: none; }
	.mn-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
	.mn-list button { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 3px 12px; font-size: 12.5px; cursor: pointer; }
	.mn-list button.oth { border-style: dashed; }
	/* 「@」で出すメンションの候補 */
	.g-md { position: relative; }
	.mn-pop { position: absolute; z-index: 30; min-inline-size: 200px; max-inline-size: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgb(0 0 0 / .12); padding: 4px; display: flex; flex-direction: column; }
	.mn-pop[hidden] { display: none; }
	.mn-pop button { display: flex; align-items: baseline; gap: 8px; text-align: start; background: none; border: 0; border-radius: var(--radius); padding: 6px 10px; font-size: 13px; color: var(--ink); cursor: pointer; }
	.mn-pop button small { color: var(--sub); font-size: 11.5px; }
	.mn-pop button.on, .mn-pop button:hover { background: var(--hi); color: var(--accent); }
	.mn-hint { inline-size: 100%; font-size: 11.5px; color: var(--sub); }
	@container main (max-width: 640px) { .comment { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

	/* 案件詳細の作業一覧 */
	.tasklist { inline-size: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
	.tasklist td { padding: 12px; border-block-end: 1px solid var(--line2); vertical-align: middle; font-size: 13px; }
	.tasklist tr:last-child td { border-block-end: 0; }
	.tasklist .no { color: var(--sub); inline-size: 60px; }
	.tasklist .tname a { font-weight: 700; color: var(--ink); }
	.tasklist .tname small { display: block; margin-block-start: 2px; font-size: 12px; color: var(--sub); }
	.tasklist .tname small > * + * { margin-inline-start: 10px; }
	.tasklist tr.is-child td { background: #fff; } /* 子作業の行は親より薄い背景（白）に（今の Engawa と同じ。2026-11-13 日野さんの指示） */
	.tasklist tr.is-child .tname { padding-inline-start: 34px; }
	.tasklist tr.is-child .tname a::before { content: "└ "; display: inline-block; white-space: pre; color: var(--sub); font-weight: 400; } /* inline-block で取り消し線をかけない */
	.tasklist tr.is-done .tname a { text-decoration: line-through; color: #b3aaa0; } /* 完了作業のタイトルは薄いグレー（2026-11-16 日野さんの指示） */
	.tasklist .who { color: var(--accent); white-space: nowrap; }
	.tasklist .kado { color: var(--sub); white-space: nowrap; }
	.tasklist .due { white-space: nowrap; text-align: end; }
	.due.late { color: var(--late); font-weight: 700; }
	.due.soon { color: var(--accent); font-weight: 700; }
	@container main (max-width: 720px) {
		.tasklist, .tasklist tbody, .tasklist tr, .tasklist td { display: block; }
		.tasklist tr { border-block-end: 1px solid var(--line2); padding: 8px 0; }
		.tasklist td { border: 0; padding: 2px 12px; }
		.tasklist .no { display: none; }
		.tasklist .who, .tasklist .kado, .tasklist .due { display: inline-block; text-align: start; font-size: 12px; }
	}

	/* マイページ */
	.mypage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
	.mypage > .page-head { grid-column: 1 / -1; margin: 0; }
	@container main (max-width: 900px) { .mypage { grid-template-columns: minmax(0, 1fr); } .mypage-side { order: -1; } }
	.mp-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px; gap: 14px; align-items: center; padding: 12px 0; border-block-end: 1px solid var(--line2); }
	.mp-row:last-child { border-block-end: 0; }
	.mp-row .nm a { font-weight: 700; color: var(--ink); }
	.mp-row .nm small { display: block; font-size: 12px; color: var(--sub); }
	.mp-row .nm small a { font-weight: 400; color: var(--sub); }
	.mp-row .due { justify-self: end; }
	.chip.plain { background: #f6e8dc; color: var(--accent); }
	@container main (max-width: 640px) { .mp-row { grid-template-columns: minmax(0, 1fr) auto; } .mp-row .progress { grid-column: 1 / -1; } }
	.alerts li { padding: 8px 0; border-block-end: 1px solid var(--line2); font-size: 13px; }
	.alerts li:last-child { border-block-end: 0; }
	.today-ev { margin-block: 8px; }
	.topic-item { display: block; padding: 10px 0; border-block-end: 1px solid var(--line2); color: var(--ink); }
	.topic-item:last-child { border-block-end: 0; }
	.topic-item:hover { text-decoration: none; }
	.topic-item time, .topic-item small { display: block; font-size: 12px; color: var(--sub); }
	.topic-item b { display: block; }
	.card-head .date { font-size: 12px; color: var(--sub); font-weight: 400; }

	/* 備忘録 */
	.nt-bar { display: flex; gap: 8px; margin-block-end: 16px; }
	.nt-bar input { flex: 1; }
	.nt-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
	.nt-cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
	.nt-cat .h { font-size: 11px; color: var(--sub); padding: 8px 10px 4px; }
	.nt-cat a { display: flex; justify-content: space-between; padding: 8px 10px; font-size: 13px; border-radius: var(--radius); color: var(--ink); }
	.nt-cat a:hover { text-decoration: none; background: var(--bg); }
	.nt-cat a[aria-current="page"] { background: var(--hi); color: var(--accent); font-weight: 700; }
	.nt-cat a span { color: var(--sub); font-size: 12px; }
	.nt-list { display: flex; flex-direction: column; gap: 10px; }
	.nt-item { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; color: var(--ink); }
	.nt-item:hover { border-color: var(--sub); text-decoration: none; }
	.nt-it { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
	.nt-it b { font-size: 15px; }
	.nt-it time { font-size: 12px; color: var(--sub); white-space: nowrap; }
	.nt-item p { color: var(--sub); font-size: 13px; margin-block-start: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-block-start: 8px; }
	.tag { font-size: 11.5px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 20px; color: var(--sub); }
	.tag.pj { background: var(--hi); border-color: var(--hi); color: var(--accent); }
	@container main (max-width: 700px) { .nt-layout { grid-template-columns: minmax(0, 1fr); } }

	/* 接続情報（金庫） */
	.vault { border: 1px solid var(--line); border-inline-start: 3px solid #8a6a3d; border-radius: var(--radius); margin-block: 16px; background: var(--surface); }
	.vault summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
	.vault summary::-webkit-details-marker { display: none; }
	.vault summary b { font-size: 14px; }
	.vault summary .more { margin-inline-start: auto; font-size: 12px; color: var(--sub); }
	.vault .vt-o, .vault[open] .vt-c { display: none; }
	.vault[open] .vt-o { display: inline; }
	.vault[open] summary { border-block-end: 1px solid var(--line2); }
	.vt-body { padding: 8px 14px 12px; }
	.vt-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; font-size: 12px; color: var(--sub); }
	.vt-head span { display: flex; gap: 12px; }
	.vt-it { padding: 8px 0; border-block-end: 1px solid var(--line2); }
	.vt-it:last-child { border-block-end: 0; }
	.vt-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
	.vt-sc { font-size: 11px; font-weight: 400; color: var(--sub); margin-inline-start: 8px; }
	.vt-btns { display: flex; gap: 6px; }
	.vt-b { font-size: 12px; padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); cursor: pointer; }
	.vt-sec { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin-block-start: 8px; font-size: 13px; background: #fff; padding: 8px 12px; border-radius: var(--radius); }
	.vt-sec[hidden] { display: none; }
	.vt-sec dt { color: var(--sub); }
	.vt-sec dd { margin: 0; word-break: break-all; }
}
@layer parts {
	.pages { display: flex; flex-wrap: wrap; gap: 4px; margin-block: 16px; font-size: 13px; }
	.pages > * { padding: 5px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
	.pages span:not([aria-current]) { color: var(--line); }
	.pages [aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
}
@layer parts {
	/* 項目と値の表（クライアント・ユーザーの詳細） */
	.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); font-size: 13.5px; }
	.kv dt { font-weight: 700; font-size: 13px; padding: 12px 0; border-block-end: 1px solid var(--line2); }
	.kv dd { margin: 0; padding: 12px 0; border-block-end: 1px solid var(--line2); word-break: break-word; }
	.plain > li { padding: 8px 0; border-block-end: 1px solid var(--line2); font-size: 13.5px; }
	.plain > li:last-child { border-block-end: 0; }
	.sub { color: var(--sub); }
	a.name { color: var(--accent); font-weight: 700; }
	a.name.nb { font-weight: 400; } /* クライアント一覧の名称は太字にしない（2026-11-16 日野さんの指示。作業 20499） */
	@container main (max-width: 600px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dt { border: 0; padding-block-end: 0; } }
}
@layer parts {
	.page-body { display: block; }
	.links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-block: 10px; font-size: 13px; }
	.links button { padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 13px; }
	.ctx:not(:has(a)) { font-size: 13px; }
	.form-card > h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
	/* 入力の画面の中の表（並び・名前を並べて直す欄など） */
	.grid-table { inline-size: 100%; font-size: 13.5px; margin-block: 6px 12px; }
	.grid-table th { text-align: start; font-size: 12px; font-weight: 500; color: var(--sub); padding: 8px 8px; border-block-end: 1px solid var(--line); }
	.grid-table td { padding: 6px 8px; border-block-end: 1px solid var(--line2); vertical-align: middle; }
	.grid-table tr:last-child td { border-block-end: 0; }
	.grid-table tr > th[scope="row"], .grid-table tbody th { font-weight: 700; color: var(--ink); font-size: 13px; inline-size: 150px; }
	.fac td .day-add { display: block; text-align: center; padding: 2px; }
}
/* ログイン（左に名前、右に入力） */
@layer screens {
	.login { display: grid; grid-template-columns: 1fr 1fr; min-block-size: 100vh; }
	.login-visual { background: var(--side); padding: 48px; }
	.login-visual .brand { font-size: 44px; padding: 0; }
	.login-visual .brand small { font-size: 13px; margin-block-start: 10px; letter-spacing: .04em; }
	.login-panel { display: grid; place-items: center; padding: 32px 24px; }
	.login-panel > * { inline-size: min(360px, 100%); }
	.login-panel h1 { font-size: 22px; margin-block-end: 8px; }
	.login-panel .lead { font-size: 13px; color: var(--sub); margin-block-end: 24px; }
	.login-field { margin-block-end: 16px; }
	.login-field label { display: block; font-size: 13px; font-weight: 700; margin-block-end: 6px; }
	.login-btn { inline-size: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-block: 20px 28px; }
	.login .foot { font-size: 12px; color: var(--sub); }
	@media (max-width: 760px) {
		.login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
		.login-visual { padding: 24px; }
		.login-visual .brand { font-size: 32px; }
		.login-panel { place-items: start center; }
	}
}
@layer screens {
	/* 設定：分野ごとの札 */
	.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: start; }
	.menu { margin: 0; }
	.menu .card-head .chip { margin-inline-start: auto; border-radius: 20px; font-size: 11px; }
	.menu li { border-block-end: 1px solid var(--line2); }
	.menu li:last-child { border-block-end: 0; }
	.menu a { display: flex; justify-content: space-between; padding: 12px 2px; color: var(--ink); font-size: 14px; }
	.menu a::after { content: "›"; color: var(--sub); }
	.menu a:hover { color: var(--accent); text-decoration: none; }
}
@layer screens {
	/* 作業の一括操作（B1） */
	.tasklist .ck { inline-size: 36px; padding-inline-end: 0; }
	.bulk-form:has(.js-hide-kids:checked) tr.is-child { display: none; } /* 子作業を隠す（JavaScript なし） */
	.bulk-form label.btn { gap: 6px; font-weight: 500; }
	.bulk { margin-block-start: 16px; }
	.bulk-body { padding: 6px 14px 12px; }
	.bulk-op { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-block-end: 1px solid var(--line2); font-size: 13px; }
	.bulk-op:last-child { border-block-end: 0; }
	.bulk-op .l { font-weight: 700; }
	.bulk-op select { block-size: 34px; }
	@container main (max-width: 640px) { .bulk-op { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
}
@layer screens {
	.list-label { font-size: 13px; font-weight: 700; margin: 14px 0 6px; color: var(--sub); }
	.btn[aria-pressed="true"] { background: var(--hi); border-color: var(--accent); color: var(--accent); }
}
@layer screens {
	/* 案件・作業カレンダー（B3） */
	.tcal .mc { min-block-size: 120px; }
	.tcal-pj { display: flex; flex-direction: column; gap: 2px; padding: 3px 4px; border-inline-start: 3px solid var(--accent); background: var(--ev-bg); }
	.tcal-pjname { font-size: 11px; font-weight: 700; color: var(--accent); }
	.tcal-tk { font-size: 11.5px; line-height: 1.4; color: var(--ink); }
	.tcal-tk small { color: var(--sub); }
	.tcal-tk.is-start { font-weight: 700; }
	.tcal-tk.is-done { color: #b3aaa0; text-decoration: line-through; } /* 同上 */
	@container month (max-width: 600px) {
		.tcal .month-head { display: none; }
		.tcal .month-row { grid-template-columns: minmax(0, 1fr); }
		.tcal .mc { min-block-size: 0; align-items: stretch; border-inline-end: 0; }
		.tcal .mc:not(:has(.tcal-pj)) { display: none; }
		.tcal .mday { justify-content: flex-start; }
	}
}
@layer screens {
	.cm-ops { margin-block-start: 12px; font-size: 13px; }
	.cm-ops select { block-size: 34px; inline-size: auto; }
	.comment-head input { margin-inline-end: 2px; }
}
@layer screens {
	/* マイページの「＋ 作業を追加」（案件を選ぶ）とチェック（B9） */
	.menu-pop { position: relative; }
	.menu-pop summary { list-style: none; cursor: pointer; }
	.menu-pop summary::-webkit-details-marker { display: none; }
	.menu-pop-body { position: absolute; z-index: 40; inset-block-start: calc(100% + 6px); inset-inline-start: 0; min-inline-size: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgb(0 0 0 / .12); padding: 8px; }
	.menu-pop-body p { font-size: 12px; color: var(--sub); padding: 4px 8px; }
	.menu-pop-body a { display: block; padding: 8px; border-radius: var(--radius); color: var(--ink); font-size: 13.5px; }
	.menu-pop-body a:hover { background: var(--hi); text-decoration: none; }
	.menu-pop-body a.all { border-block-start: 1px solid var(--line2); margin-block-start: 4px; color: var(--accent); }
	.mp-row.has-ck { grid-template-columns: 22px minmax(0, 1fr) 150px 140px auto; }
	@container main (max-width: 640px) { .mp-row.has-ck { grid-template-columns: 22px minmax(0, 1fr) auto; } .mp-row.has-ck .progress { grid-column: 2 / -1; } }
}
@layer screens {
	/* 週間線表・月間線表（B6）：列は日、行は作業。棒は grid-column で開始日から終了日まで */
	.gantt-wrap { margin-block: 8px 20px; container: gantt / inline-size; }
	.gantt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
	/* 2026-11-16 作業 20508：PC では1か月が横スクロールなしで収まる。狭い画面では横スクロールし、作業名の欄は左に止める */
	.gantt-row { display: grid; grid-template-columns: 130px repeat(var(--days), minmax(28px, 1fr)); align-items: center; min-inline-size: calc(130px + var(--days) * 28px); border-block-end: 1px solid var(--line2); }
	@container gantt (min-width: 740px) { .gantt-row { grid-template-columns: 180px repeat(var(--days), minmax(0, 1fr)); min-inline-size: 0; } }
	.gantt-row:last-child { border-block-end: 0; }
	.gantt-name { grid-column: 1; position: sticky; inset-inline-start: 0; z-index: 1; align-self: stretch; background: var(--surface); border-inline-end: 1px solid var(--line2); padding: 8px 10px; font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.gantt-head { background: #fff; font-size: 11px; color: var(--sub); }
	.gantt-head .gantt-name { background: #fff; }
	.gantt-d { display: flex; flex-direction: column; align-items: center; padding: 6px 0; line-height: 1.2; }
	.gantt-d b { font-size: 12.5px; color: var(--ink); font-weight: 500; }
	.gantt-d.is-sun b, .gantt-d.is-sun small { color: var(--late); }
	.gantt-d.is-sat b, .gantt-d.is-sat small { color: var(--sat); }
	.gantt-d.is-today b { background: var(--accent); color: #fff; border-radius: var(--radius); padding: 0 2px; }
	.gantt-bar { grid-row: 1; block-size: 20px; margin: 6px 1px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 10.5px; line-height: 20px; padding-inline: 6px; white-space: nowrap; overflow: hidden; }
	.gantt-bar.is-done { background: #8fae7a; }
	.gantt-bar.is-pnd { background: #b9ad9c; }
	.gantt-bar.is-late { background: var(--late); }
	.gantt-bar.cut-l { border-start-start-radius: 0; border-end-start-radius: 0; }
	.gantt-bar.cut-r { border-start-end-radius: 0; border-end-end-radius: 0; }
}
@layer screens {
	/* 備忘録の目次と「Markdown をコピー」（C2）：本文の右。狭いときは本文の上 */
	.note-view { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; align-items: start; container: note / inline-size; }
	.note-view .body-text { margin: 0; }
	.note-side { position: sticky; inset-block-start: 16px; display: flex; flex-direction: column; gap: 12px; }
	.toc { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 10px 12px; font-size: 12.5px; }
	.toc .h { font-size: 11px; color: var(--sub); margin-block-end: 6px; }
	.toc li { padding: 3px 0; }
	.toc li.lv2 { padding-inline-start: 10px; }
	.toc li.lv3 { padding-inline-start: 20px; font-size: 12px; }
	.toc a { color: var(--ink); }
	.md :is(h1, h2, h3)[id] { scroll-margin-block-start: 70px; }
	@container main (max-width: 800px) { .note-view { grid-template-columns: minmax(0, 1fr); } .note-side { position: static; order: -1; } .toc { display: none; } }
}
@layer screens {
	/* グループの管理（D2） */
	.group-item { padding-block: 10px 14px; border-block-end: 1px solid var(--line2); }
	.group-item:last-of-type { border-block-end: 0; }
	.group-item .grid-table { margin-block-end: 8px; }
	.group-req { padding: 8px 0; border-block-end: 1px solid var(--line2); }
	.group-req:last-child { border-block-end: 0; }
}
@layer parts {
	/* はい／いいえで聞く小さな窓（2026-11-16） */
	dialog.ask { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px 24px 18px; max-inline-size: min(420px, calc(100vw - 32px)); box-shadow: 0 8px 28px rgb(43 38 34 / .18); }
	dialog.ask::backdrop { background: rgb(43 38 34 / .35); }
	dialog.ask p { margin: 0 0 18px; font-size: 14px; line-height: 1.7; }
	.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
}
@layer parts {
	/* ラジオボタン：新デザインの選択欄（デザイン D1 の .radio と同じ形。2026-11-16）。
	   <span class="radio"><label><input type="radio"><span>文字</span></label>…</span>
	   丸は見えなくするが、input はそのまま残すので、キーボード（矢印キー）と読み上げはふつうのラジオボタンと同じに使える */
	.radio { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; vertical-align: middle; }
	.radio > label { position: relative; display: flex; cursor: pointer; }
	.radio > label > input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: pointer; }
	.radio > label > span { padding: 8px 16px; font-size: 13px; line-height: 1.5; color: var(--ink); border-inline-end: 1px solid var(--line); white-space: nowrap; }
	.radio > label:last-child > span { border-inline-end: 0; }
	.radio > label:hover > span { background: var(--hi); }
	.radio > label > input:checked + span { background: var(--accent); color: #fff; }
	.radio > label > input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -4px; }
	.radio > label > input:disabled + span { opacity: .5; cursor: not-allowed; }
	.scope-notes { margin: 8px 0 0; padding: 0; list-style: none; }
	.scope-notes li { margin-block: 2px; }
}
@layer parts {
	/* 欄の中で行を重ねるとき（2026-11-16 予定の登録：ボタンどうしが詰まらないように） */
	.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
	.stack > .hint { margin: 0; }
	.stack .sub { font-size: 13px; color: var(--sub); }
	.dt .hm { display: inline-flex; align-items: center; gap: 4px; }
	.dt .hm i { font-style: normal; color: var(--sub); }
	.dt input[type=date] { inline-size: auto; }
	.dt select { inline-size: auto; min-inline-size: 64px; }
}
@layer parts {
	/* 参加メンバーを選ぶ（今の Engawa の予定の登録と同じ形。2026-11-16） */
	.picker .chips { display: flex; flex-wrap: wrap; gap: 6px; }
	.chip-p { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; background: var(--bg); border-radius: 20px; font-size: 13px; }
	.chip-p small { color: var(--sub); }
	.chip-p button { background: none; border: 0; padding: 0 4px; color: var(--sub); font-size: 14px; line-height: 1; cursor: pointer; }
	.chip-p button:hover { color: var(--late); }
	.picker .none { font-size: 13px; color: var(--sub); }
	.addbtn { background: none; color: var(--sub); border: 1px dashed var(--line); border-radius: 20px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
	.addbtn:hover { background: var(--hi); color: var(--accent); }
	.picker-box { align-self: stretch; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
	.picker-box > select { inline-size: auto; min-inline-size: 240px; margin-block-end: 12px; }
	.plist { display: flex; flex-wrap: wrap; gap: 6px; }
	.plist button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
	.plist button:hover { border-color: var(--accent); color: var(--accent); background: var(--hi); }
	@media (max-width: 760px) { .picker-box > select { min-inline-size: 0; inline-size: 100%; } }
}
@layer parts {
	/* 参加メンバー：「＋ 追加」を先に、その横に選んだ人（2026-11-16 日野さんの指示） */
	.picker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
	.picker-row .chips { display: contents; }
	.picker-row .addbtn { flex: none; }
	.chip-g { background: var(--hi); color: var(--accent); }
	.picker-row.has-flag .js-picker-chips .none { display: none; } /* まとめて見せる相手があるときは「まだ…いません」を出さない */
}
@layer parts {
	/* 場所の候補（2026-11-16 案A） */
	.place-cands { gap: 6px; }
	.place-cands .sub { font-size: 12px; color: var(--sub); margin-inline-end: 2px; }
	.js-place-cands { display: contents; }
	.cand { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
	.cand:hover { border-color: var(--accent); color: var(--accent); background: var(--hi); }
	.cand[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
	.stack.place { align-items: stretch; }
	.stack.place .place-cands { align-self: flex-start; }
}
@layer parts {
	/* カードの下に置く操作（2026-11-16 予定詳細の削除） */
	.after-card { margin-block-start: 14px; }
}
@layer parts {
	/* ユーザー管理で本名の横に出すニックネーム（2026-11-16） */
	.nick { font-size: 12px; color: var(--sub); font-weight: 400; margin-inline-start: 4px; }
}

/* 案件一覧（2026-11-16 日野さんの指示。今の Engawa の案件一覧に寄せる：見出しなし、案件名は黒の太字、クライアント・主担当はオレンジ、進捗の棒は短く濃く） */
@layer screens {
	.pl-list .pl-name { color: var(--ink); font-weight: 700; }
	.pl-list .pl-name:hover { color: var(--accent); }
	.pl-list .status { margin-inline-start: 10px; } /* 案件名と状態の間をあける（2026-11-16 日野さんの指示） */
	.pl-list td:first-child { inline-size: 100%; } /* 余った幅は案件名に回し、ほかの項目は詰める（2026-11-16 日野さんの指示） */
	.pl-list td + td { padding-inline: 10px; white-space: nowrap; }
	.pl-list td:last-child { padding-inline-end: 12px; }
	.pl-list .pl-client, .pl-list .pl-charge { color: var(--accent); white-space: nowrap; }
	.pl-list .pl-client a { color: inherit; }
	.pl-list .pl-prog .progress { inline-size: 120px; }
	.pl-list .pl-prog .bar { block-size: 5px; }
	.pl-list .pl-date { white-space: nowrap; color: var(--sub); font-size: 12.5px; }
	@container main (max-width: 640px) {
		.pl-list, .pl-list tbody { display: block; }
		.pl-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name act" "client charge" "prog date"; align-items: center; gap: 6px 12px; padding: 10px 12px; border-block-end: 1px solid var(--line2); }
		.pl-list tr:nth-child(odd) { background: #fff; }
		.pl-list td, .pl-list td + td, .pl-list td:last-child { display: block; padding: 0; border: 0; background: none; inline-size: auto; }
		.pl-list .status { margin-inline-start: 6px; }
		.pl-list td:first-child { grid-area: name; }
		.pl-list .pl-client { grid-area: client; } .pl-list .pl-charge { grid-area: charge; text-align: end; }
		.pl-list .pl-prog { grid-area: prog; inline-size: auto; } .pl-list .pl-date { grid-area: date; text-align: end; } .pl-list .act { grid-area: act; inline-size: auto; }
		.pl-list .pl-prog .progress { inline-size: auto; }
	}
}
