/* 入金チェックかんたん — かんたんツールズ配色（主色 #2563eb）。390px でも折りたたまず縦積み */
:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #5f6b7a;
  --line: #d9e0ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #b91c1c;
  --warn: #92400e;
  --warn-bg: #fffbeb;
  --ok: #166534;
  --ok-bg: #ecfdf3;
  --fee: #9a3412;
  --fee-bg: #fff7ed;
  --tax: #1e40af;
  --tax-bg: #eff6ff;
  --extra: #374151;
  --extra-bg: #f3f4f6;
  --confirm: #854d0e;
  --confirm-bg: #fef9c3;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-header, .site-footer { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-footer { border-bottom: 0; border-top: 1px solid var(--line); margin-top: 32px; font-size: .86rem; color: var(--muted); }
.header-inner, .container, .footer-inner { width: min(1080px, calc(100% - 24px)); margin: 0 auto; }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; flex-wrap: wrap; }
.brand { color: var(--text); font-size: 1.1rem; font-weight: 700; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.main-nav, .footer-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .92rem; }
.main-nav a[aria-current] { font-weight: 700; color: var(--text); }
.container { padding: 16px 0 40px; }
h1 { font-size: 1.45rem; margin: 8px 0 10px; line-height: 1.35; }
h2 { font-size: 1.08rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 12px 0 6px; }
.lead { color: var(--muted); margin: 0 0 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 14px 0; }
.disclaimer { background: var(--warn-bg); border: 1px solid #fde68a; color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 12px 0; }
.privacy { font-size: .92rem; }
.step-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--primary); text-transform: none; }
.actions, .toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btn, .file-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-align: center; max-width: 100%;
}
.btn:hover, .file-btn:hover { border-color: var(--primary); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger-outline { color: var(--danger); border-color: #f3c4c4; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .92rem; min-width: 0; }
.field > span, .field > label { font-weight: 600; }
.grid { display: grid; grid-template-columns: 1fr; gap: 10px 14px; }
@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: 1fr 1fr 1fr; }
}
input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #b8c3d1;
  border-radius: 8px; font: inherit; background: #fff; color: var(--text); min-width: 0;
}
textarea { min-height: 80px; }
.hint, .muted { color: var(--muted); font-size: .86rem; }
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--ok); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: #f3f6fb; font-weight: 700; white-space: nowrap; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.st-paid { background: var(--ok-bg); color: var(--ok); }
.st-fee { background: var(--fee-bg); color: var(--fee); }
.st-tax { background: var(--tax-bg); color: var(--tax); }
.st-unpaid, .st-overdue { background: #fee2e2; color: var(--danger); }
.st-extra { background: var(--extra-bg); color: var(--extra); }
.st-confirm { background: var(--confirm-bg); color: var(--confirm); }
.st-out { background: #f3f4f6; color: #6b7280; }
.summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.summary li { list-style: none; }
.file-pill { display: inline-block; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 2px 8px; margin: 2px 4px 2px 0; font-size: .8rem; }
.preview { max-height: 240px; overflow: auto; font-size: .8rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.notice { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 8px 10px; font-size: .9rem; }
.drop { border: 2px dashed #c5d0de; border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--primary); background: #eff6ff; }
ul.plain { padding-left: 1.2em; }
@media (max-width: 420px) {
  body { font-size: 16px; }
  h1 { font-size: 1.28rem; }
  .btn, .file-btn { width: 100%; }
  .toolbar .btn, .toolbar .file-btn { width: auto; flex: 1 1 auto; }
}
.field-narrow { max-width: 16rem; }
/* プレビューと数値は途中で折らない。本文は単語境界で折り返す */
body { overflow-wrap: break-word; }
.preview table { white-space: nowrap; }
.preview td, .preview th { overflow-wrap: normal; }
td.num, th { overflow-wrap: normal; }
.file-pill { white-space: normal; }
#result-table { min-width: 52rem; }
#result-table td:nth-child(2), #result-table th:nth-child(2) { min-width: 9em; }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 16px; }
.pager .hint { margin-right: 8px; }
.candidate-list { margin: 4px 0 0 1.2em; padding: 0; font-size: .85rem; }
