:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #5f6b7a;
  --line: #dde1e7;
  --accent: #2b5d8c;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0f7;
  --ok: #2f7d4f;
  --ok-soft: #e6f3ea;
  --warn: #a4571a;
  --warn-soft: #fbeedd;
  --err: #b3321f;
  --err-soft: #fbe9e6;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 45, 0.06), 0 2px 8px rgba(20, 30, 45, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181d;
    --surface: #1c2229;
    --text: #e6eaef;
    --muted: #9aa5b3;
    --line: #2f3843;
    --accent: #6fa4d6;
    --accent-ink: #0f1a24;
    --accent-soft: #1f2e3d;
    --ok: #6cc08a;
    --ok-soft: #1c2f24;
    --warn: #e0a266;
    --warn-soft: #33281b;
    --err: #ee8f7e;
    --err-soft: #3a211d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; stroke: var(--accent-ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: var(--radius); text-decoration: none; color: var(--muted); font-size: 14px; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.35; margin: 0 0 16px; letter-spacing: 0.01em; }
.hero p.lead { max-width: 40em; color: var(--muted); margin: 0 0 28px; font-size: 17px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .note { color: var(--muted); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 16px; }

section.block { padding: 40px 0; }
section.block h2 { font-size: 22px; margin: 0 0 8px; }
section.block p.sub { color: var(--muted); margin: 0 0 24px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); counter-reset: s; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.steps .card { position: relative; padding-top: 52px; }
.steps .card::before { counter-increment: s; content: counter(s); position: absolute; top: 16px; left: 20px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }

table.spec { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.spec th, table.spec td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
table.spec th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: 13px; }
table.spec tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.tag-req { background: var(--err-soft); color: var(--err); }
.tag-opt { background: var(--accent-soft); color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; }

.app-head { padding: 28px 0 8px; }
.app-head h1 { font-size: 24px; margin: 0 0 4px; }
.app-head p { margin: 0; color: var(--muted); }
.mock-banner { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); font-size: 13px; text-align: center; padding: 6px 16px; }

.stepper { display: flex; gap: 8px; list-style: none; margin: 20px 0; padding: 0; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.stepper li b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--text); font-size: 12px; }
.stepper li.done { color: var(--ok); }
.stepper li.done b { background: var(--ok); color: var(--surface); }
.stepper li.now { border-color: var(--accent); color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.stepper li.now b { background: var(--accent); color: var(--accent-ink); }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.drop strong { display: block; }
.drop span { color: var(--muted); font-size: 14px; }
.drop .src { display: flex; gap: 8px; flex-wrap: wrap; }

.summary { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.err .v { color: var(--err); }
.stat.ok .v { color: var(--ok); }

.alert { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); background: var(--err-soft); color: var(--err); border: 1px solid var(--err); margin-bottom: 16px; font-size: 15px; }
.alert b { font-weight: 700; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.rows { width: 100%; border-collapse: collapse; min-width: 760px; }
table.rows th { position: sticky; top: 0; background: var(--bg); color: var(--muted); font-size: 13px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.rows td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.rows tr:last-child td { border-bottom: 0; }
table.rows input { width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
table.rows input:hover { border-color: var(--line); }
table.rows input:focus { border-color: var(--accent); background: var(--surface); }
table.rows input.num { text-align: right; font-variant-numeric: tabular-nums; }
table.rows tr.bad td { background: var(--err-soft); }
table.rows tr.bad input { border-color: var(--err); }
table.rows td.idx { color: var(--muted); font-size: 13px; width: 40px; text-align: right; padding-right: 12px; }
table.rows td.msg { color: var(--err); font-size: 13px; min-width: 180px; }
table.rows td.msg.ok { color: var(--ok); }
.col-date { min-width: 130px; } .col-key { min-width: 170px; } .col-amt { min-width: 120px; }
table.rows th:nth-child(6) { min-width: 220px; }

.actions-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 20px 0 8px; }
.hint { color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
  .steps, .grid2 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 40px 0 24px; }
  .nav a { padding: 8px; }
}

.stepper li.now { border-color: var(--accent); }
.mapping { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 20px 0 0; padding: 12px 16px 16px; display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mapping legend { padding: 0 8px; font-weight: 700; font-size: 14px; }
.mapping label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.mapping label.check { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 40px; color: var(--text); font-size: 15px; }
.mapping select { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; padding: 0 8px; }
.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); margin-bottom: 16px; font-size: 15px; }
table.rows tr.skip td { color: var(--muted); }
table.rows tr.skip input { color: var(--muted); }
table.rows td.msg.skip { color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop { margin-bottom: 0; }
.stepper li.now b { color: var(--accent-ink); }
