/* 名刺フォロー 見た目
   決まり: 文字は 16px 以上（px で書く）・押す所は高さ 44px 以上・iPhone の幅 375px で崩れない。
   インラインの style は使わない。外のフォント・画像は読まない。グラデーション・絵文字の飾りは使わない。
   「今日やる」「エラー」は色だけにせず、文字でも出す。 */

:root {
  color-scheme: light;
  --ink: #1c2430;          /* 文字 */
  --ink-2: #4a5361;        /* 添える文字（地 #f4f3ef に対して 7:1 以上） */
  --bg: #f4f3ef;           /* 地 */
  --surface: #ffffff;      /* 札・入れる所 */
  --sunk: #e9e6de;         /* 写真の下地 */
  --line: #dcd8ce;         /* 区切り */
  --line-strong: #8a8578;  /* 入れる所の枠（白に対して 3:1 以上） */
  --primary: #1f4f7a;      /* 押す所の主（白文字 8:1 以上） */
  --primary-press: #173d5f;
  --primary-soft: #e4edf6;
  --due: #8a4b00;          /* 今日やる（白文字 6:1 以上） */
  --due-soft: #fbf0dc;
  --danger: #a1261f;       /* エラー・消す */
  --danger-ink: #7c1b15;
  --danger-soft: #fbeceb;
  --radius: 12px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgb(28 36 48 / 0.06);
  --gutter-l: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
img { max-width: 100%; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px var(--gutter-r) calc(40px + env(safe-area-inset-bottom)) var(--gutter-l);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 上の帯 ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: env(safe-area-inset-top) var(--gutter-r) 0 var(--gutter-l);
}
.app-title {
  max-width: 608px;
  margin: 0 auto;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
}
.screen-title { font-size: 26px; line-height: 1.35; margin: 8px 0 12px; font-weight: 700; }
h3 { font-size: 20px; line-height: 1.4; margin: 20px 0 8px; }

/* ---------- 知らせの帯 ---------- */
.banners { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter-r) 0 var(--gutter-l); }
.banner {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0 0;
  border: 1px solid transparent;
}
.banner-warn { background: var(--danger-soft); color: var(--danger-ink); border-color: #ecc4c1; }
.banner-warn::before {
  content: "注意";
  display: inline-block;
  margin-right: 8px;
  padding: 0 8px;
  font-size: 16px;
  border-radius: 6px;
  background: var(--danger);
  color: #fff;
}
.banner-info { background: var(--primary-soft); color: var(--primary); border-color: #c7d8ea; font-weight: 600; }

/* ---------- ボタン ---------- */
.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 10px 0;
  padding: 10px 16px;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:active { background: #eceae4; }
.btn:focus-visible,
.row-btn:focus-visible,
.photo-big-btn:focus-visible,
.more-summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.btn:disabled, .btn.is-disabled { opacity: 0.45; cursor: default; }

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 72px;
  margin: 4px 0 16px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgb(31 79 122 / 0.25);
}
.btn-add::before {
  content: "+";
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}
.btn-add:active, .btn-main:active { background: var(--primary-press); border-color: var(--primary-press); }

.btn-main {
  min-height: 60px;
  font-size: 20px;
  font-weight: 700;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-sub { background: var(--surface); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: var(--surface); }
.btn-danger:active { background: var(--danger-soft); }
.btn-small { min-height: 44px; font-size: 16px; margin: 6px 0 0; padding: 6px 12px; }

/* 一覧へ（戻る） */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 44px;
  margin: 0 0 4px -8px;
  padding: 6px 12px 6px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}
.btn-back::before {
  content: "";
  width: 11px;
  aspect-ratio: 1;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
}

/* ---------- 知らせ ---------- */
.notice { font-size: 16px; line-height: 1.55; margin: 8px 0; }
.notice-error {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ecc4c1;
  border-left: 5px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-weight: 700;
}
.notice-error::before {
  content: "エラー";
  display: inline-block;
  margin-right: 8px;
  padding: 0 8px;
  font-size: 16px;
  border-radius: 6px;
  background: var(--danger);
  color: #fff;
}
.notice-check::before { content: "確かめてください"; }
.notice-info {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.notice-due { color: var(--ink-2); margin: 0 0 8px; }

/* 読めたら戻す下書き・消されていた人の下書き */
.ask-box {
  margin: 8px 0;
  padding: 14px;
  background: var(--due-soft);
  border: 2px solid var(--due);
  border-radius: var(--radius-lg);
}
.ask-text { font-size: 18px; font-weight: 700; line-height: 1.5; margin: 0 0 4px; }

/* ---------- 一覧 ---------- */
.list-notices { margin: 0 0 8px; }
.list-notices:not(:has(> :not([hidden]))) { display: none; }

/* 今日連絡する人 ◯人 ／ ほかの人 */
.list-section { margin: 0 0 20px; }
.list-heading {
  margin: 8px 0 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink-2);
}
.list-heading-due { font-size: 22px; color: var(--due); }
.person-list { list-style: none; margin: 0; padding: 0; }
.person-row { margin: 0 0 10px; }
.row-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 104px;
  padding: 12px 40px 12px 12px;
  font: inherit;
  font-size: 18px;
  text-align: left;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
}
.row-btn:active { background: #f7f6f2; }
/* 右の「開く」の印 */
.row-btn::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 10px;
  aspect-ratio: 1;
  margin-top: -5px;
  border-top: 2px solid var(--ink-2);
  border-right: 2px solid var(--ink-2);
  transform: rotate(45deg);
}
/* 今日やる人: 左に太い線＋「今日やる」の札 */
.person-row.is-due .row-btn { border-color: #e2c48f; box-shadow: inset 6px 0 0 var(--due), var(--shadow); padding-left: 18px; }
/* いま足した人: 青の枠＋「いま足しました」の札 */
.person-row.is-new .row-btn {
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  animation: row-arrive 1.6s ease-out 1;
}
.person-row.is-new.is-due .row-btn { box-shadow: inset 6px 0 0 var(--due); }
@keyframes row-arrive {
  0% { box-shadow: 0 0 0 6px rgb(31 79 122 / 0.35); }
  100% { box-shadow: 0 0 0 0 rgb(31 79 122 / 0); }
}

.thumb {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 12px;
  background: var(--sunk);
}
.thumb-none {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
}
.thumb-none::after {
  content: "写真なし";
  font-size: 16px;
  line-height: 1.2;
  color: var(--ink-2);
  text-align: center;
}
.row-thumb { width: 96px; height: 96px; }
/* 一緒の写真が無い人: 頭文字の丸 */
.avatar-initial {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}
.row-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; flex: 1 1 auto; }
.row-text > * { max-width: 100%; }
.row-headline { font-weight: 700; font-size: 19px; line-height: 1.4; }
/* 名前も会社も無い人: 見出しは小さな灰色、一言メモを本文に */
.row-noname { font-size: 16px; line-height: 1.4; color: var(--ink-2); }
.row-memo.row-memo-main {
  font-size: 18px;
  color: var(--ink);
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
/* 次にやること（動詞） */
.row-next {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--primary);
}
.person-row.is-due .row-next { color: var(--due); }
.row-next.is-done { color: var(--ink-2); font-weight: 600; }
.row-memo {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  display: inline-block;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  padding: 1px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f1efe9;
  color: var(--ink-2);
  white-space: nowrap;
}
.tag-due { background: var(--due); border-color: var(--due); color: #fff; font-weight: 700; }
.tag-new { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

/* 済みの人: ほかの人の一番下にまとめ、札を小さく薄く */
.list-subheading {
  margin: 18px 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink-2);
}
.person-list-done .person-row { margin-bottom: 6px; }
.person-list-done .row-btn {
  min-height: 64px;
  gap: 10px;
  padding: 8px 36px 8px 8px;
  background: var(--bg);
  border-color: var(--line);
  box-shadow: none;
}
.person-list-done .row-thumb { width: 48px; height: 48px; }
.person-list-done .avatar-initial { font-size: 22px; background: var(--sunk); color: var(--ink-2); }
.person-list-done .row-headline { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.person-list-done .row-memo, .person-list-done .row-next { font-size: 16px; }
.person-list-done .row-next { margin-top: 0; }
.person-list-done .row-memo.row-memo-main { font-size: 16px; color: var(--ink-2); -webkit-line-clamp: 1; line-clamp: 1; }
.person-list-done .person-row.is-new .row-btn { background: var(--primary-soft); }

.list-empty {
  margin: 12px 0;
  padding: 24px 16px;
  text-align: center;
  font-size: 18px;
  color: var(--ink-2);
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* ---------- 控え ---------- */
.backup {
  margin-top: 32px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.backup[open] { padding-bottom: 12px; }
/* 畳んだときは「控え（文字だけ）」の1行だけ */
.backup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.backup-title::-webkit-details-marker { display: none; }
.backup-title::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 150ms ease;
}
.backup[open] .backup-title::after { transform: translateY(2px) rotate(-135deg); }
.backup-title:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.backup-body { border-top: 1px solid var(--line); padding-top: 8px; }
.backup-note { font-size: 16px; margin: 4px 0; color: var(--ink-2); }
.backup-state { font-weight: 600; white-space: pre-line; }
/* 手元の確かめ（localhost）のときだけの1行 */
.foot-note { font-size: 16px; color: var(--ink-2); text-align: center; margin: 24px 0 0; }
.import-result { font-size: 16px; padding-left: 20px; margin: 8px 0 0; }
.import-result:empty { display: none; }
.download-link { display: inline-block; min-height: 44px; padding: 8px 0; color: var(--primary); font-weight: 700; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-btn, .photo-btn { display: flex; align-items: center; justify-content: center; }
.backup:has(.file-input:focus-visible) .file-btn { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- 足す・直す ---------- */
.photo-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.photo-slot { min-width: 0; }
.photo-btn {
  flex-direction: column;
  gap: 4px;
  min-height: 120px;
  margin: 0;
  padding: 12px 8px;
  font-weight: 700;
  color: var(--primary);
  border: 2px dashed var(--line-strong);
  background: var(--surface);
}
.photo-btn::before {
  content: "+";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}
/* 選んだあとは「選び直す」の大きさに縮める */
.photo-slot:has(.photo-preview:not([hidden])) .photo-btn {
  min-height: 52px;
  border-style: solid;
  border-width: 1px;
  flex-direction: row;
  font-size: 17px;
}
.photo-slot:has(.photo-preview:not([hidden])) .photo-btn::before { display: none; }
.photo-slot:has(.file-input:focus-visible) .photo-btn { outline: 3px solid var(--primary); outline-offset: 2px; }
.photo-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 8px;
  object-fit: contain;
  background: var(--sunk);
  border-radius: 10px;
}
.photo-status { font-size: 16px; line-height: 1.5; margin: 6px 0 0; color: var(--ink-2); }
.photo-status:empty { display: none; }

.form-fields { border: 0; margin: 8px 0 0; padding: 0; min-width: 0; }
.field-label { display: block; font-size: 16px; font-weight: 700; margin: 16px 0 6px; color: var(--ink); }
.field {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgb(31 79 122 / 0.28); }
.field::placeholder { color: #6e7480; }
.field::-webkit-date-and-time-value { text-align: left; }
.field-memo { min-height: 128px; resize: vertical; line-height: 1.6; }

.more-fields {
  margin: 20px 0 0;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.more-fields[open] { padding-bottom: 14px; }
.more-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.more-summary::-webkit-details-marker { display: none; }
.more-summary::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 150ms ease;
}
.more-fields[open] .more-summary::after { transform: translateY(2px) rotate(-135deg); }
.more-summary + .field-label { margin-top: 4px; }

.form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.form-actions .btn { margin: 0; }
.form-actions .ask-box { margin: 0; }
.nophoto-ask .btn { margin: 10px 0 0; }

/* ---------- 同じ人がいます（画面に重ねる箱） ---------- */
body.has-layer { overflow: hidden; }
.dup-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 0 0;
  background: rgb(13 17 23 / 0.78);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dup {
  width: 100%;
  max-width: 640px;
  max-height: 100%;
  overflow-y: auto;
  padding: 18px var(--gutter-r) calc(16px + env(safe-area-inset-bottom)) var(--gutter-l);
  background: var(--surface);
  border-top: 4px solid var(--due);
  border-radius: 18px 18px 0 0;
}
.dup-title { margin-top: 0; color: var(--due); }
.dup-title:focus { outline: none; }
.dup-title::before {
  content: "確かめてください";
  display: block;
  width: fit-content;
  margin-bottom: 4px;
  padding: 0 8px;
  font-size: 16px;
  border-radius: 6px;
  background: var(--due);
  color: #fff;
}
.dup-reason { font-size: 18px; font-weight: 700; margin: 4px 0 4px; }
.dup-matched {
  margin: 0 0 12px;
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 700;
  background: var(--due-soft);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.dup-people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dup-person {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.dup-thumb { width: 96px; height: 96px; }
.dup-label, .dup-met, .dup-note { font-size: 16px; color: var(--ink-2); }
.dup-label { font-weight: 700; }
.dup-met { white-space: nowrap; }
.dup-headline { font-size: 18px; font-weight: 700; line-height: 1.4; }
.dup-note { margin: 12px 0 4px; }

/* ---------- 詳細 ---------- */
/* 一番上の大きな写真（一緒に撮った写真。無ければ名刺の写真） */
.detail-hero { margin: 4px 0 12px; }
.detail-hero .photo-cap:empty { display: none; }
.detail-sub { margin: 16px 0 0; }
/* 名前のすぐ下の一言メモと、次にやること */
.detail-name { margin: 0 0 6px; }
.detail-memo {
  margin: 0 0 8px;
  padding: 12px 14px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--surface);
  border-left: 5px solid var(--primary);
  border-radius: 10px;
}
/* 次: 〜（一覧と同じ文） */
.detail-next {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--primary);
}
/* 電話する・メールを書く */
.detail-contacts { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0 0 12px; }
.detail-contacts:empty { display: none; }
.btn-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  text-align: left;
  text-decoration: none;
  color: var(--primary);
  border-color: var(--primary);
}
.contact-label { font-size: 18px; font-weight: 700; }
.contact-value { font-size: 16px; font-weight: 400; color: var(--ink-2); }
.detail-photo { margin-left: 0; margin-right: 0; }
.photo-big-btn {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: none;
  cursor: zoom-in;
}
.photo-big {
  display: block;
  width: 100%;
  max-height: 440px;
  min-height: 160px;
  object-fit: contain;
  background: var(--sunk);
  border-radius: var(--radius-lg);
}
.photo-cap { font-size: 16px; color: var(--ink-2); margin-top: 6px; }

.detail-items {
  margin: 20px 0 0;
  padding: 4px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.detail-items:empty { display: none; }
.item-label { font-size: 16px; color: var(--ink-2); font-weight: 600; padding-top: 10px; }
.item-value { margin: 0; padding: 0 0 10px; font-size: 18px; white-space: pre-wrap; border-bottom: 1px solid var(--line); }
.item-value:last-child { border-bottom: 0; }

.stage-panel {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.stage-title { margin: 0 0 4px; }
.stage-buttons { margin-bottom: 8px; }
.stage-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  text-align: left;
}
/* 左の四角（押すと印が付く） */
.stage-btn::before {
  content: "";
  flex: 0 0 auto;
  width: 26px;
  aspect-ratio: 1;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}
.stage-btn.is-on {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.stage-btn.is-on::before { background: var(--primary); border-color: var(--primary); }
.stage-btn.is-on::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 50%;
  width: 8px;
  aspect-ratio: 8 / 14;
  margin-top: -9px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
}
.stage-panel .field-label { margin-top: 12px; }

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.detail-actions .btn { margin: 0; }

/* ---------- 写真を画面いっぱい ---------- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: env(safe-area-inset-top) 8px calc(12px + env(safe-area-inset-bottom));
  background: #0d1117;
}
.viewer-img { max-width: 100%; max-height: calc(100% - 76px); object-fit: contain; }
.viewer-close {
  width: auto;
  min-width: 140px;
  margin: 0;
  border-radius: 999px;
  background: #fff;
  border-color: #fff;
}

/* 動きを減らす設定の人には動かさない */
@media (prefers-reduced-motion: reduce) {
  .person-row.is-new .row-btn { animation: none; }
  .btn, .field, .more-summary::after, .backup-title::after { transition: none; }
}
