:root {
  --bg: #f3f5f8; --card: #fff; --ink: #1d2733; --ink2: #4b5866; --muted: #7a8794; --line: #dfe4ea;
  --navy: #1f3b5a; --navy2: #2b5480; --accent: #0f7b6c; --accent-bg: #e5f4f1;
  --red: #c0392b; --red-bg: #fdecea; --amber: #b7791f; --amber-bg: #fff6e0; --blue-bg: #e8f0fb; --green-bg: #e9f6ec;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Yu Gothic UI","Yu Gothic","Hiragino Sans","Noto Sans JP","Meiryo",sans-serif; font-size: 14px; line-height: 1.65; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.top { background: var(--navy); color: #fff; }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 9px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.ttl { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.sub { font-size: 12px; opacity: .8; }
.demo-badge { background: #f5c451; color: #3a2a00; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.intro { margin: 18px 0 14px; color: var(--ink2); }
.intro p { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-h h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--muted); font-size: 12px; font-weight: normal; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.lead { color: var(--ink2); margin: 0 0 10px; font-size: 13px; }
.file-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
.col-h { font-size: 12px; font-weight: 700; color: var(--ink2); margin-bottom: 6px; }
.flist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#pdfList { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.flist li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; background: #fafbfc; min-width: 0; }
.flist .ic { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; }
.ic.xl { background: #1d7a46; } .ic.p { background: #c0392b; }
.flist .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist .nm a { color: inherit; text-decoration: none; }
.flist .nm a:hover { text-decoration: underline; }
.flist .st { font-size: 11px; white-space: nowrap; color: var(--muted); }
.st.ok { color: var(--accent); } .st.ng { color: var(--red); } .st.run { color: var(--amber); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 14px; }
.step { display: flex; align-items: center; gap: 8px; justify-content: center; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 10px; font: inherit; font-weight: 700; color: var(--ink2); cursor: pointer; position: relative; }
.step .num { background: #b8c3cf; }
.step.on { border-color: var(--navy); color: var(--navy); box-shadow: 0 2px 0 var(--navy); }
.step.on .num { background: var(--navy); }
.step em { font-style: normal; background: var(--red); color: #fff; font-size: 11px; padding: 0 7px; border-radius: 99px; }
.step em:empty { display: none; }
.panel { display: none; }
.panel.on { display: block; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 800; line-height: 1.2; }
.kpi .v small { font-size: 13px; font-weight: 600; margin-left: 2px; }
.kpi.ok .v { color: var(--accent); } .kpi.ng .v { color: var(--red); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th { background: #eef2f6; color: var(--ink2); font-weight: 700; text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 7px 9px; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.click tbody tr { cursor: pointer; }
.tbl.click tbody tr:hover td { background: #f6f9fc; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl .nw { white-space: nowrap; }
.tbl select, .tbl input { font: inherit; font-size: 12px; border: 1px solid #c9d2db; border-radius: 6px; padding: 3px 5px; background: #fff; }
.tbl input { width: 110px; }
.tbl td.msg { min-width: 200px; max-width: 300px; font-size: 12px; color: var(--ink2); }
#errTable select { max-width: 170px; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.chip.ok { background: var(--accent-bg); color: var(--accent); }
.chip.ng { background: var(--red-bg); color: var(--red); }
.chip.warn { background: var(--amber-bg); color: var(--amber); }
.chip.info { background: var(--blue-bg); color: var(--navy2); }
.chip.off { background: #eef0f2; color: var(--muted); }
.diff { color: var(--red); font-weight: 700; }
.done td { background: #f7fbf9; }
.done td:not(:last-child):not(:nth-last-child(2)) { color: var(--muted); }
.howto { background: #fff; border: 1px dashed #b9c6d3; border-radius: var(--r); padding: 14px 18px; margin-bottom: 16px; }
.howto h3 { margin: 0 0 6px; font-size: 14px; }
.howto ol { margin: 0; padding-left: 20px; color: var(--ink2); font-size: 13px; }
.howto li { margin: 3px 0; }
.prod { margin: 10px 0 0; background: var(--accent-bg); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.sel { font-size: 12px; color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.sel select, .fld select, .fld input { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid #c9d2db; border-radius: 7px; background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; font-size: 12px; color: var(--ink2); }
.lg::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.08); }
.lg.new::before { background: var(--green-bg); } .lg.warn::before { background: var(--amber-bg); }
.lg.first::before { background: #dfe9f7; } .lg.bonus::before { background: #f3e6fb; }
.sched td, .sched th { font-size: 12px; }
.sched td.m { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 66px; }
.sched td.first { background: #dfe9f7; }
.sched td.bonus { background: #f3e6fb; }
.sched tr.new td.fix { background: var(--green-bg); }
.sched tr.warn td.fix { background: var(--amber-bg); }
.sched td.fix, .sched th.fix { position: sticky; left: 0; z-index: 1; background: #fff; }
.sched th.fix { z-index: 2; background: #eef2f6; }
.sched tfoot td { font-weight: 800; background: #f3f6f9; border-top: 2px solid var(--line); }
.sched td.tot { font-weight: 700; background: #f8fafb; }
.csv-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 8px; }
.h3 { font-size: 13px; margin: 6px 0 8px; color: var(--ink2); }
.csv-set { background: #f8fafb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.fld { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 8px; }
.fld select, .fld input { display: block; width: 100%; margin-top: 3px; }
.csv { background: #0f1720; color: #d8e3ee; border-radius: 8px; padding: 12px 14px; font-family: Consolas, "MS Gothic", monospace; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre; margin: 0; max-height: 300px; }
.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0 30px; }
.foot p { margin: 2px 0; }
.modal { position: fixed; inset: 0; background: rgba(15,25,35,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 12px; width: min(760px, 100%); max-height: 88vh; overflow: auto; padding: 20px 22px; position: relative; }
.modal-box h3 { margin: 0 0 10px; font-size: 16px; padding-right: 30px; }
.x { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.mmeta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; }
.mmeta a { color: var(--accent); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1d2733; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%); }
@media (max-width: 860px) {
  .file-grid, .csv-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .sub { display: none; }
  .ttl { font-size: 15px; }
  .steps { grid-template-columns: 1fr; }
  .step { justify-content: flex-start; }
  .card { padding: 14px; }
  .card-h .btns { width: 100%; }
  .card-h .btns .btn { flex: 1; }
}
