:root {
  --bg: #f6f5f1; --surface: #fff; --surface-2: #f0eee8; --text: #1f1d1a; --muted: #6b665e; --line: #e2dfd6;
  --accent: #2f5d50; --accent-text: #fff;
  --yellow: #f3c94b; --yellow-bg: #fdf3cf; --red: #d6574a; --red-bg: #fbe3e0;
  --s0: #cfcdc5; --s1: #6fa0d8; --s2: #e5b04a; --s3: #55a867;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
header.top h1 { font-size: 20px; margin: 0; }
header.top nav { display: flex; gap: 6px; }
header.top nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text); border: 1px solid var(--line); background: var(--surface); }
header.top nav a.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.spacer { flex: 1; }
select, input, textarea, button { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
textarea { width: 100%; resize: vertical; }
button { cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--s2); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.notice.err { border-left-color: var(--red); background: var(--red-bg); }
.undecided { color: var(--muted); font-style: italic; }
.big { font-size: 28px; font-weight: 700; }
.alert-count { display: inline-block; min-width: 2em; padding: 0 10px; border-radius: 999px; background: var(--red-bg); color: #8a2a1f; font-weight: 700; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--s3); }
.stage-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; margin-top: 8px; }
.stack { display: flex; height: 14px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.stack i { display: block; height: 100%; }
.s0 { background: var(--s0); } .s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.legend .l0::before { background: var(--s0); } .legend .l1::before { background: var(--s1); } .legend .l2::before { background: var(--s2); } .legend .l3::before { background: var(--s3); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; border-left: 6px solid var(--line); }
.card.yellow { border-left-color: var(--yellow); background: var(--yellow-bg); }
.card.red { border-left-color: var(--red); background: var(--red-bg); }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 12px; }
.card dl { display: grid; grid-template-columns: 7em 1fr; gap: 2px 8px; margin: 8px 0; font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; white-space: pre-wrap; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-left: 4px; }
.card .actions { display: flex; gap: 8px; margin-top: 8px; }
.stage-grid { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 8px 10px; align-items: center; }
.stage-grid .h { font-size: 12px; color: var(--muted); }
.field { margin-bottom: 12px; }
.field > label { display: block; font-weight: 600; margin-bottom: 4px; }
.imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.imgs figure { margin: 0; width: 150px; font-size: 12px; }
.imgs img { width: 150px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
table.hist { width: 100%; border-collapse: collapse; font-size: 13px; }
table.hist th, table.hist td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

.card-head { display: flex; gap: 10px; align-items: flex-start; }
.thumb { width: 84px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
details > summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
.detail { padding-top: 6px; }

.sel { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; cursor: pointer; }
.bulk { border-color: var(--accent); }
