:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1f2328; --muted: #3f4651; --line: #d9dde3;
  --accent: #1d5fbf; --accent-ink: #fff; --warn-bg: #fff6e0; --warn-line: #e3b341;
  --info-bg: #e8f1fc; --err-bg: #fde8e8; --err-line: #d14343;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; font-size: 15px; line-height: 1.6; }
.inner { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
header.top { background: #fff; color: var(--ink); border-bottom: 3px solid #22324a; }
header.top .inner { display: flex; justify-content: space-between; align-items: center; min-height: 60px; flex-wrap: wrap; gap: 8px; }
header.top a { color: var(--accent); }
.brand { display: flex; align-items: center; gap: 14px; font-weight: 700; text-decoration: none; font-size: 17px; }
header.top a.brand { color: #22324a; }
.brand .logo { height: 36px; width: auto; display: block; }
@media (max-width: 480px) { .brand .logo { height: 28px; } .brand { font-size: 15px; gap: 10px; } }
.who { font-weight: 700; color: #22324a; display: flex; align-items: center; gap: 16px; }
.who .manual-link { font-weight: 600; font-size: 14px; }
.manual-cta { background: #f2f6fc; border: 1px solid #b9d3f3; border-radius: 6px; padding: 8px 12px; }

/* 利用マニュアル */
.manual { line-height: 1.8; }
.manual h2 { margin-top: 32px; scroll-margin-top: 12px; }
.manual h2:first-of-type { margin-top: 12px; }
.manual h3 { margin-top: 22px; }
.manual table { margin: 10px 0 14px; font-size: 14px; }
.manual th { background: #f2f4f7; text-align: left; white-space: nowrap; }
.manual td, .manual th { border: 1px solid var(--line); }
.manual li { margin: 3px 0; }
.manual-toc { background: #f7f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px; margin-bottom: 8px; }
.manual-toc p { margin: 0 0 4px; font-weight: 700; }
.manual-toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.manual-flow { margin: 12px 0; }
.manual-flow svg { width: 100%; height: auto; display: block; }
@media (max-width: 600px) { .manual-toc ol { columns: 1; } .manual table { display: block; overflow-x: auto; } }
.titlebar { background: #22324a; color: #fff; }
.titlebar .inner { padding-top: 10px; padding-bottom: 10px; font-size: 18px; font-weight: 700; }
main { padding-top: 20px; padding-bottom: 40px; }

/* 進行状況 */
.progress { background: #fff; border-bottom: 1px solid var(--line); }
.progress ol { list-style: none; display: flex; gap: 4px; padding-top: 10px; padding-bottom: 10px; margin: 0 auto; overflow-x: auto; }
.progress li { flex: 1 1 0; min-width: 88px; display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: #eef0f3; color: var(--muted); font-size: 13px; border-radius: 4px; white-space: nowrap; }
.progress li .no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #c5cbd3; color: #fff; font-weight: 700; flex: none; }
.progress li.done { background: #e3ecf8; color: #22324a; }
.progress li.done .no { background: #6f8fbf; }
.progress li.cur { background: var(--accent); color: #fff; font-weight: 700; }
.progress li.cur .no { background: #fff; color: var(--accent); }
.progress li.jump { cursor: pointer; }
@media (max-width: 640px) {
  .progress li { flex: none; min-width: 0; }
  .progress li:not(.cur) .nm { display: none; }
  .progress li.cur { flex: 1 1 auto; }
}
.progress li.jump:hover { outline: 1px solid var(--accent); }

/* トップの入口 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0 6px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px; border-radius: 8px;
  border: 2px solid #e8b400; background: #ffd23f; color: #1f2328; text-decoration: none; min-height: 170px; }
.tile:hover { background: #ffdb63; }
.tile-icon { display: inline-grid; place-items: center; min-width: 46px; height: 40px; padding: 0 8px; border-radius: 6px;
  background: #fff; color: #1a7f3c; font-weight: 800; font-size: 14px; }
.tile-title { font-size: 21px; font-weight: 800; }
.tile-desc { font-size: 13.5px; }
.filebtn { position: relative; overflow: hidden; margin-top: auto; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
ul.plain { padding-left: 20px; margin: 0 0 10px; }
ul.plain li { margin-bottom: 6px; }
.save-card { border: 2px solid #e8b400; background: #fffaf0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin-bottom: 18px; }
.card.narrow { max-width: 560px; margin: 24px auto; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 19px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
h3 { font-size: 16px; margin: 22px 0 8px; color: #22324a; }
.hint, .muted { color: var(--muted); font-size: 13.5px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid var(--line); }
.flash.info { background: var(--info-bg); border-color: #b9d3f3; }
.flash.error { background: var(--err-bg); border-color: var(--err-line); }
.flash.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field.boolf { justify-content: center; }
.field > label { font-size: 13.5px; font-weight: 600; }
.help { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
input[type=text], input[type=date], select { font: inherit; padding: 7px 9px; border: 1px solid #b8bfc9; border-radius: 5px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus { outline: 2px solid #9cc0f5; border-color: var(--accent); }
.yen { display: flex; align-items: center; gap: 6px; }
.yen input { text-align: right; }
label.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 14px; }
label.check input { margin-top: 4px; width: 17px; height: 17px; flex: none; }
.radio-row { display: flex; gap: 24px; margin-bottom: 10px; flex-wrap: wrap; }
.person { padding: 2px 0; }
.row-card { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; background: #fafbfc; }
.row-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
button, .btn { font: inherit; padding: 8px 16px; border-radius: 6px; border: 1px solid #b8bfc9; background: #fff; cursor: pointer;
  text-decoration: none; color: var(--ink); display: inline-block; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.secondary { background: #fff; }
button.add { border-style: dashed; color: var(--accent); background: #fff; }
button.link { border: none; background: none; padding: 0; color: var(--accent); }
button.link.danger { color: var(--err-line); font-weight: 400; }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.actions.sticky { position: sticky; bottom: 0; background: rgba(244, 245, 247, .96); padding: 12px 0; border-top: 1px solid var(--line); }
form.login { display: grid; gap: 8px; margin: 16px 0; }
form.login button { margin-top: 8px; }
.note { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.note ul { padding-left: 20px; margin: 4px 0; }
.dl { display: grid; gap: 10px; margin: 10px 0 14px; }
.dl-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.dl-item.all { background: #f2f6fc; }
.dl-title { flex: 1 1 280px; font-weight: 600; }
table { border-collapse: collapse; width: 100%; }
table.kv th { text-align: left; font-weight: 600; width: 46%; }
table th, table td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
table.list thead th { background: #f2f4f7; text-align: left; font-size: 13.5px; }
td.r { text-align: right; }
tr.muted td { color: var(--muted); }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 24px; }
[hidden] { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px);
  background: #22324a; color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
@media (max-width: 600px) {
  .card { padding: 16px 14px; }
  .actions.sticky { gap: 6px; padding: 8px 0; }
  .actions.sticky > * { flex: 1 1 auto; padding: 8px 8px; font-size: 13.5px; text-align: center; }
  .table-wrap { overflow-x: auto; }
  table.list { font-size: 13px; }
}
