/* MiriCanvas アンバサダーポータル — 共通スタイル
   ブランドカラー: MiriCanvas teal (#21afbf 系) / テキスト #16181d / 背景 #f5f7fa */
:root {
  --accent: #0e9aab;            /* ボタン・リンク（白地で読めるよう一段深いティール） */
  --accent-dark: #0b8494;
  --accent-bright: #21afbf;     /* ブランド原色（グラデ・強調面用） */
  --accent-light: #e6f6f8;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #16181d;
  --muted: #70798f;
  --border: #e4e7ec;
  --green: #15803d;
  --green-bg: #e8f6ee;
  --amber: #b45309;
  --amber-bg: #fdf3e0;
  --blue: #0e7f9b;
  --blue-bg: #e6f4f8;
  --red: #d92d20;
  --red-bg: #feeceb;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 3px rgba(14, 60, 70, .06), 0 4px 14px rgba(14, 60, 70, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { text-wrap: balance; }
.muted { color: var(--muted); font-size: 13px; }

.container { max-width: 920px; margin: 0 auto; padding: 16px 16px 64px; }

button { transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .12s ease, box-shadow .18s ease; }
button:active { transform: scale(.98); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; border-radius: 4px; }

/* ── ヘッダー ── */
.app-header {
  background: linear-gradient(115deg, #0a7e8e 0%, #14a3b4 55%, #2ec0d0 100%);
  color: #fff;
  padding: 22px 16px 26px;
}
.app-header .inner { max-width: 920px; margin: 0 auto; }
.app-header h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .01em; }
.app-header .sub { margin-top: 4px; font-size: 13px; opacity: .92; }

/* ── カード ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.card h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }

/* ── サマリー：金額重視の3スタット ── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat.hl { background: linear-gradient(135deg, #0e96a7, #2ec0d0); border: none; color: #fff; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat.hl .stat-label { color: rgba(255,255,255,.88); }
.stat-amount {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-amount small { font-size: 15px; font-weight: 700; }
.stat-breakdown { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.8; font-variant-numeric: tabular-nums; }
.stat.hl .stat-breakdown { color: rgba(255,255,255,.88); }
.stat-breakdown b { font-weight: 700; color: var(--text); }
.stat.hl .stat-breakdown b { color: #fff; }
.stat-breakdown .bd-row { display: flex; justify-content: space-between; gap: 8px; }
.stat-breakdown .over { color: var(--red); font-weight: 700; }
.stat.hl .stat-breakdown .over { color: #ffd9d6; }
/* モバイル：3スタットは横スワイプ（スナップ）。今月を先頭に */
@media (max-width: 640px) {
  .stat-grid {
    display: flex; overflow-x: auto; gap: 10px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    padding-bottom: 6px; scrollbar-width: none;
  }
  .stat-grid::-webkit-scrollbar { display: none; }
  .stat { min-width: 74%; flex: none; scroll-snap-align: center; }
  .stat.hl { order: -1; }
  .stat-amount { font-size: 26px; }
}

/* ── 下書きリスト（まとめて提出） ── */
.draft-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 10px 14px; margin-top: 8px; background: #fff;
}
.draft-item .d-title { flex: 1; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-item .d-files { font-size: 11.5px; color: var(--muted); }

/* ── タブ（セグメント型 — 運営・ポータル共通） ── */
.mode-tabs, .tabs {
  display: grid; gap: 0;
  margin-top: 20px;
  background: #e7ebf0;
  border-radius: 12px;
  padding: 4px;
}
.mode-tabs { grid-template-columns: 1fr 1fr; }
.mode-tabs.three, .tabs { grid-template-columns: 1fr 1fr 1fr; }
.mode-btn, .tab-btn {
  border: none; background: transparent;
  border-radius: 9px; padding: 12px 8px;
  font-size: 14.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.mode-btn.active, .tab-btn.active { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(14,60,70,.12); }
@media (max-width: 480px) {
  .mode-tabs.three .mode-btn, .tabs .tab-btn { font-size: 12px; padding: 11px 2px; }
}

/* ── 提出ボタン3種 ── */
.submit-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.submit-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-s);
  padding: 13px 6px; font-size: 13px; font-weight: 700; color: var(--text);
  cursor: pointer; font-family: inherit;
}
.submit-btn span { font-size: 21px; }
.submit-btn:hover { border-color: var(--accent-bright); color: var(--accent); box-shadow: 0 3px 10px rgba(33,175,191,.16); transform: translateY(-1px); }
@media (max-width: 560px) { .submit-btn { font-size: 11.5px; } }

/* ── フォーム ── */
label.field { display: block; margin-top: 14px; font-size: 13px; font-weight: 600; }
label.field .req, .cfield .req { color: var(--red); margin-left: 2px; }
input[type=text], input[type=url], input[type=date], input[type=datetime-local],
input[type=number], input[type=month], input[type=password], select, textarea {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-light);
}
/* 入力の高さを統一（日付・月ピッカーも周囲のテキスト入力と完全に同じ高さに） */
input[type=text], input[type=url], input[type=date], input[type=datetime-local],
input[type=number], input[type=month], input[type=password], select { height: 44px; }
input[type=date], input[type=month], input[type=datetime-local] {
  appearance: none; -webkit-appearance: none; line-height: 1.4;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
.cfield input:not([type=file]):not([type=checkbox]), .cfield select { height: 38px; }
.month-select { height: 38px !important; padding: 6px 10px !important; }
.filters input, .filters select { height: 42px; }

/* ── ドラッグ＆ドロップ ── */
.dropzone {
  margin-top: 4px;
  border: 1.5px dashed #c4ccd6; border-radius: 10px;
  background: #fafcfd; padding: 14px 12px;
  text-align: center; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent-bright); background: var(--accent-light); }
.dz-prompt { font-size: 12.5px; color: var(--muted); font-weight: 500; pointer-events: none; }
.dz-list { text-align: left; }
.dz-list:not(:empty) { margin-top: 8px; }
.dz-item {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 8px 5px 10px; margin-top: 5px; font-size: 12.5px;
}
.dz-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dz-item .sz { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dz-rm {
  border: none; background: none; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 3px 6px; border-radius: 5px; font-family: inherit;
}
.dz-rm:hover { color: var(--red); background: var(--red-bg); }

/* ── 複数選択チップ ── */
.chip-select { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.chip {
  border: 1.5px solid var(--border); background: #fff; color: var(--text);
  border-radius: 999px; padding: 9px 15px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--accent-bright); }
.chip.on {
  border-color: var(--accent); background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(14,154,171,.25);
}

/* ── 同意カード（見やすいチェック） ── */
.consent-card {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; background: #fff;
  font-size: 13px; transition: border-color .15s ease, background-color .15s ease;
}
.consent-card:has(input:checked) { border-color: var(--accent-bright); background: var(--accent-light); }
.consent-card input { width: 19px; height: 19px; margin-top: 2px; flex: none; cursor: pointer; }
.consent-card b { font-weight: 700; }
.consent-sub { font-size: 11.5px; color: var(--muted); line-height: 1.55; display: inline-block; margin-top: 2px; }

/* コンパクトフォーム（ポップアップ内） */
.hint {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-top: 10px;
  color: #0a6573;
}
.hint.warn { background: var(--amber-bg); color: var(--amber); }
.hint.slim {
  font-size: 12.5px; padding: 10px 14px; margin: 8px 0 2px;
  border-left: 3px solid var(--accent-bright); border-radius: 4px 8px 8px 4px;
}
.hint ul { margin: 0; padding-left: 1.25em; }
.hint li { margin: 2px 0; line-height: 1.6; }
.hint li b { color: #07505b; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 10px; }
.form-grid .full { grid-column: 1 / -1; }
.cfield { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.cfield input, .cfield select, .cfield textarea { margin-top: 3px; padding: 8px 10px; font-size: 14px; }
.cfield input[type=file] { padding: 6px 8px; font-size: 12px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); font-weight: 400; }
.cform button.primary { margin-top: 14px; padding: 10px 22px; }

.radio-cards { display: grid; gap: 8px; margin-top: 6px; }
.radio-card {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; background: #fff;
  transition: border-color .15s ease, background-color .15s ease;
}
.radio-card:has(input:checked) { border-color: var(--accent-bright); background: var(--accent-light); }
.radio-card input { margin-top: 4px; accent-color: var(--accent); }
.radio-card .t { font-weight: 700; font-size: 14px; }
.radio-card .d { font-size: 12px; color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* ── ボタン ── */
button.primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 12px 22px; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 18px; width: 100%; font-family: inherit;
}
button.primary:hover { background: var(--accent-dark); box-shadow: 0 3px 10px rgba(14,154,171,.3); }
button.primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
/* ボタンのサイズ体系：表内 28px ／ 通常 36px ／ フォーム行 42px ／ モーダル下部 46px */
button.ghost {
  background: #fff; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; height: 36px; padding: 0 14px; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
button.ghost:hover { border-color: var(--accent-bright); color: var(--accent); background: var(--accent-light); }
button.danger {
  background: #fff; border: 1px solid #f3b6b1; color: var(--red);
  border-radius: 8px; height: 36px; padding: 0 14px; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
button.danger:hover { border-color: var(--red); background: var(--red-bg); }
.btn-sm { height: 28px !important; padding: 0 10px !important; font-size: 12px !important; border-radius: 7px !important; }
.btn-inline { width: auto !important; margin: 0 !important; height: 36px !important; padding: 0 18px !important; font-size: 14px !important; }
.filters .btn-inline { height: 42px !important; }

/* ── ステータスバッジ ── */
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.submitted { background: var(--amber-bg); color: var(--amber); }
.badge.approved { background: var(--green-bg); color: var(--green); }
.badge.paid { background: var(--blue-bg); color: var(--blue); }
.badge.rejected { background: var(--red-bg); color: var(--red); }
.badge.type { background: #eef1f5; color: #515a6e; font-weight: 600; }
.badge.flag { background: var(--red-bg); color: var(--red); }

/* ── テーブル ── */
table.list { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.list th, table.list td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.list th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.list tr.clickable { cursor: pointer; transition: background-color .12s ease; }
table.list tr.clickable:hover { background: var(--accent-light); }
.table-wrap { overflow-x: auto; }
/* タイトル・メモ列は詰めて他の列に余裕を（全文はツールチップ＆詳細で） */
td.cell-title { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.cell-memo { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }

/* ネストした表（ポップアップ内の対象活動） */
.nested-wrap { padding: 2px 6px 10px; }
.nested-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.nested-table th { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--muted); font-weight: 600; text-align: left; background: #f8fafc; }
.nested-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.nested-table tr:last-child td { border-bottom: none; }
.nested-table tr.hoverable { cursor: pointer; }
.nested-table tr.hoverable:hover td { background: var(--accent-light); }

/* ── フィルター ── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: flex-end; }
.filters > div { min-width: 130px; flex: 1; }
.filters label { font-size: 12px; color: var(--muted); display: block; font-weight: 600; }

/* アンバサダー登録フォーム：名前・説明・登録を1行ずつ（縦積み） */
#amb-add { display: block; }
#amb-add > div { width: 100%; margin-top: 10px; min-width: 0; }
#amb-add .btn-inline { width: 100% !important; height: 44px !important; }
/* 名前・説明列はゆったり */
#ambs-table td:nth-child(2) { min-width: 110px; }
#ambs-table td:nth-child(3) { min-width: 220px; }

/* ── リワード案件作成の選択バー ── */
.bill-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--accent-light); border: 1px solid var(--accent-bright);
  border-radius: 10px; padding: 10px 14px; margin-top: 12px;
  font-size: 14px; flex-wrap: wrap;
}

/* ── モーダル ── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(13, 35, 40, .55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 24px 12px; z-index: 50; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%;
  padding: 22px; position: relative;
  box-shadow: 0 12px 40px rgba(10, 40, 50, .22);
  animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.modal h2 { margin: 0 14px 8px 0; font-size: 17px; }
.close-x {
  position: absolute; top: 8px; right: 10px;
  font-size: 22px; line-height: 1; border: none; background: none;
  color: var(--muted); cursor: pointer; padding: 6px 10px; font-family: inherit;
  border-radius: 8px;
}
.close-x:hover { color: var(--accent); background: var(--accent-light); }
/* モーダル下部のボタン：すべて同じ高さ（46px）に統一 */
.modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions:empty { display: none; }
.modal-actions > * { flex: 1 1 0; min-width: 110px; }
.modal-actions .primary, .modal-actions .danger, .modal-actions .ghost {
  height: 46px; padding: 0 16px; margin-top: 0; width: auto;
  font-size: 15px; font-weight: 700; border-radius: 8px;
}
.modal-close-row { margin-top: 10px; }
.modal-close-row .big-close {
  width: 100%; height: 46px; padding: 0 16px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 8px; cursor: pointer; font-family: inherit;
}
.modal-close-row .big-close:hover { border-color: var(--accent-bright); color: var(--accent); }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13.5px; margin-top: 10px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.file-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.file-thumbs img { max-width: 140px; max-height: 100px; border-radius: 6px; border: 1px solid var(--border); }
.codes-block {
  margin-top: 10px; background: var(--accent-light);
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
}
.codes-block ul { margin: 6px 0 0; padding-left: 18px; }
.codes-block code { background: #fff; padding: 2px 8px; border-radius: 4px; font-size: 13px; letter-spacing: .03em; }

/* ── トースト ── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1d2630; color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; display: none; z-index: 99; max-width: 90vw;
  box-shadow: 0 6px 20px rgba(10, 40, 50, .25);
}
#toast.show { display: block; animation: modal-in .18s ease; }
#toast.error { background: var(--red); }

/* ── ランディング/ログイン ── */
.landing { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.landing-card { max-width: 420px; text-align: center; padding: 36px 28px; }
.landing-card h1 { font-size: 22px; margin: 0 0 16px; color: var(--accent); }

/* ── 活動履歴：ヘッダー行＋月フィルター ── */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.month-select { width: auto !important; margin-top: 0 !important; padding: 7px 10px; font-size: 13.5px; }

/* ── 活動履歴：種別ごとの小計＋合計 ── */
.hist-sub { margin-top: 14px; border-top: 2px solid var(--border); padding-top: 10px; font-variant-numeric: tabular-nums; }
.hist-sub .sub-row { display: grid; grid-template-columns: 1fr 70px 110px; gap: 8px; padding: 4px 10px; font-size: 13px; }
.hist-sub .sub-row span:nth-child(2) { text-align: right; color: var(--muted); }
.hist-sub .sub-row span:nth-child(3) { text-align: right; }
.hist-sub .sub-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-weight: 700; font-size: 14px; }
.hist-sub .caption, .caption { font-size: 11px; color: var(--muted); text-align: right; padding: 2px 10px 0; }

/* ── 活動履歴グリッド（全行で列位置を統一） ── */
.hist { margin-top: 4px; }
.hist-head, .hist-row {
  display: grid;
  grid-template-columns: 60px 100px 1fr 90px 80px 96px;
  gap: 8px; align-items: center;
  font-variant-numeric: tabular-nums;
}
.h-recv { text-align: center; font-size: 12.5px; color: var(--muted); }
.hist-head {
  font-size: 11.5px; color: var(--muted); font-weight: 600;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.hist-head .r, .hist-row .h-amount { text-align: right; }
.hist-head .c, .hist-row .h-status { text-align: center; }
.hist-row { padding: 11px 10px 0; cursor: pointer; }
.hist-row:hover .h-title { color: var(--accent); }
.hist-item { border-bottom: 1px solid var(--border); padding-bottom: 11px; transition: background-color .12s ease; }
.hist-item:hover { background: #fafdfd; }
.hist-item:last-child { border-bottom: none; }
.h-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.h-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-amount { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.h-amount .est { font-weight: 400; color: var(--muted); }
.hist-extra { padding: 4px 10px 0 10px; }
.hist-extra .files { font-size: 12.5px; }
.hist-extra .note { background: var(--red-bg); color: var(--red); border-radius: 6px; padding: 6px 10px; font-size: 12.5px; margin-top: 6px; }

@media (max-width: 640px) {
  .hist-head { display: none; }
  /* 3行構成（列幅は全行で固定 → 縦の整列が崩れない）
     1行目: [日付][種別チップ]
     2行目: [タイトル（全幅）]
     3行目: [金額（左）][ステータス（中央）][受領日（右）] */
  .hist-head + #history-list .hist-row, .hist-row {
    grid-template-columns: 92px 1fr 92px;
    grid-template-areas: "date type type" "title title title" "amount status recv";
    row-gap: 6px; column-gap: 8px; align-items: center;
  }
  .h-date { grid-area: date; }
  .h-type { grid-area: type; justify-self: start; }
  .h-title { grid-area: title; white-space: normal; }
  .h-amount { grid-area: amount; text-align: left; font-size: 14px; }
  .h-status { grid-area: status; justify-self: center; }
  .h-recv { grid-area: recv; text-align: right; font-size: 12px; }
  .form-grid { grid-template-columns: 1fr; }

  /* モーダル：画面内で自然にスクロール、iOSのフォーカスズーム防止 */
  .modal-bg { padding: 12px 8px 48px; }
  .modal { padding: 18px 14px; border-radius: 12px; }
  input[type=text], input[type=url], input[type=date], input[type=datetime-local],
  input[type=number], input[type=month], input[type=password], select, textarea {
    font-size: 16px;
  }
  .cfield input:not([type=file]):not([type=checkbox]), .cfield select { height: 42px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
