/* 数字はチャッピーの案（_report/チャッピーの案.md）どおり */
:root {
  --bg: #ffffff; --soft: #f5f7f6; --fg: #222222; --mute: #6b7270; --line: #e3e7e5;
  --main: #387c65; --main-soft: #e6f1ed; --warn: #a15c00; --bad: #c0392b;
  --safe: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161917; --soft: #212523; --fg: #ececec; --mute: #9aa29f; --line: #2f3431; --main: #5fb393; --main-soft: #1f3129; --warn: #e0a24a; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.55 -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  padding-bottom: calc(64px + var(--safe)); max-width: 560px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 20px; margin: 16px 0 4px; }
h2.big b { color: var(--main); font-size: 26px; margin-left: 6px; }
h2.big small { font-size: 15px; margin-left: 2px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
p { margin: 0; }
.mini { font-size: 13px; color: var(--mute); }
.center { text-align: center; }
button { font: inherit; color: var(--fg); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 0 16px; cursor: pointer; }
button.primary { background: var(--main); border-color: var(--main); color: #fff; font-weight: 600; }
button.wide { width: 100%; margin-top: 12px; }
button:disabled { opacity: .5; }
button.icon { border: none; background: none; font-size: 24px; min-width: 44px; padding: 0; color: var(--mute); }
input { font: inherit; font-size: 16px; color: var(--fg); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

/* 上 */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 16px 8px; border-bottom: 1px solid var(--line); }
.titlerow { display: flex; align-items: center; justify-content: space-between; }
.fresh { font-size: 13px; color: var(--mute); }
.fresh::before { content: "●"; color: var(--main); font-size: 9px; margin-right: 6px; vertical-align: 2px; }
.fresh.old { color: var(--warn); font-weight: 600; }
.fresh.old::before { color: var(--warn); }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; width: 0; background: var(--main); transition: width .3s; }
.bar.thin { height: 8px; border-radius: 4px; margin: 8px 0 6px; }

main { padding: 0 16px 16px; }
.lead { margin: 8px 0 12px; }
.idline { display: flex; align-items: center; gap: 4px; }
.idline input { flex: 1; min-width: 0; }

/* 今日のフォロー */
.today { background: var(--soft); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.todayrow { display: flex; justify-content: space-between; align-items: baseline; }
.todayrow b { font-size: 18px; }

/* 人の一覧（1人＝1枚） */
.people { list-style: none; margin: 8px 0 0; padding: 0; }
.people li { display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; gap: 4px 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); min-height: 96px; align-items: start; }
.people li.empty { display: block; min-height: 0; text-align: center; color: var(--mute); padding: 28px 0; border: none; }
.av { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 50%; background: var(--main-soft); color: var(--main);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.who { min-width: 0; }
.who .nm { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.who .id { font-size: 12px; color: var(--mute); }
.days { font-size: 13px; color: var(--mute); text-align: right; white-space: nowrap; }
.meta { grid-column: 2; font-size: 13px; line-height: 1.6; }
.meta .rel { color: var(--mute); display: block; }
.mark { display: inline-block; font-weight: 600; }
.mark.t3, .mark.t2 { color: var(--warn); }
.mark.t0 { color: var(--main); }
.mark.wait { color: var(--mute); font-weight: normal; }
a.open { grid-column: 3; align-self: end; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 112px; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--main);
  color: var(--main); background: var(--bg); text-decoration: none; font-size: 14px; font-weight: 600; }
a.open:active { background: var(--main-soft); }
a.open.seen { border-color: var(--line); color: var(--mute); }
.seenlabel { grid-column: 3; font-size: 11px; color: var(--mute); text-align: center; margin-top: -2px; }

details.more { margin-top: 20px; }
details.more summary { cursor: pointer; font-size: 15px; font-weight: 600; min-height: 44px; display: flex; align-items: center; color: var(--mute); }

/* 全員 */
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.counts div { background: var(--soft); border-radius: 12px; padding: 10px 4px; text-align: center; }
.counts b { display: block; font-size: 22px; color: var(--main); }
.counts span { font-size: 12px; color: var(--mute); }
.search { width: 100%; margin-top: 12px; }

/* 設定 */
.field { display: grid; gap: 6px; margin-top: 16px; font-weight: 600; font-size: 14px; }
.field > span { display: flex; align-items: center; gap: 6px; font-weight: normal; }
.field input[type=number] { width: 80px; }

/* 下のタブ */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: var(--bg); border-top: 1px solid var(--line);
  height: calc(64px + var(--safe)); padding-bottom: var(--safe); max-width: 560px; margin: 0 auto; }
.tabs button { flex: 1; border: none; border-radius: 0; background: none; color: var(--mute); font-size: 11px; padding: 6px 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; }
.tabs button i { font-style: normal; font-size: 20px; line-height: 1.2; }
.tabs button.on { color: var(--main); font-weight: 700; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(76px + var(--safe)); background: var(--fg); color: var(--bg);
  padding: 12px 14px; border-radius: 10px; font-size: 14px; z-index: 9; max-width: 528px; margin: 0 auto; }
.field input[type=file] { width: 100%; max-width: 100%; font-size: 14px; }
