/* モバカルの業務画面（収納一覧）に寄せた、線で区切る詰まった見た目 */
:root {
  --bg: #eef1f5; --surface: #ffffff; --text: #222a35; --muted: #5d6776; --line: #c9d2de; --line-soft: #e1e6ed;
  --head: #e6ecf4; --head-text: #34425a; --bar: #1e4f9c; --bar-2: #2c63b8;
  --brand: #1e4f9c; --link: #1a5bc4; --brand-weak: #e7eefa;
  --ok: #2e8b3e; --ok-weak: #e8f4ea; --warn: #b36b00; --warn-weak: #fff4dc; --bad: #d0312d; --bad-weak: #fdecec;
  --radius: 3px;
}
* { box-sizing: border-box; }
/* フォントは ritaen.com と同じ指定（LINE Seed JP → ヒラギノ角ゴ → 游ゴシック → メイリオ） */
:root { --jp: "LINE Seed JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.6 var(--jp); }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 15px; margin: 0; font-weight: 600; } h2 { font-size: 14px; margin: 0 0 8px; } h3 { font-size: 13px; margin: 0 0 6px; }
a { color: var(--link); }
.muted { color: var(--muted); } .small { font-size: 12px; }

/* ヘッダー（紺の帯） */
.top { position: sticky; top: 0; z-index: 20; }
.appbar { background: var(--bar); color: #fff; }
.appbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 42px; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.appbar .logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar h1 { white-space: nowrap; }
.appbar h1 a { color: inherit; text-decoration: none; }
.appbar h1 a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .appbar .logo small { display: none; } }
@media (max-width: 480px) { .appbar .logo .tag { display: none; } }
.appbar .logo small { opacity: .8; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .right { display: flex; align-items: center; gap: 8px; }
.tag { font-size: 11px; background: rgba(255,255,255,.18); color: #fff; padding: 1px 8px; border-radius: 2px; white-space: nowrap; }
.tag.dummy { background: #ffd666; color: #5a3d00; }
.helpbtn { background: #fff; color: var(--bar); border: 0; font-weight: 700; padding: 4px 12px; border-radius: 2px; cursor: pointer; white-space: nowrap; }
.helpbtn.on { background: #ffd666; color: #5a3d00; }
.tabs { background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs .wrap { display: flex; gap: 0; overflow-x: auto; }
.tabs button { border: 0; border-right: 1px solid var(--line-soft); background: none; padding: 9px 16px; color: var(--muted); font: inherit; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs button b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 2px; background: var(--line); color: #fff; font-size: 11px; margin-right: 6px; }
.tabs button.on { color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); background: var(--brand-weak); }
.tabs button.on b { background: var(--brand); }
.tabs button:disabled { opacity: .45; cursor: default; }
.tabs .spacer { flex: 1; }
.tabs .tabsep { width: 6px; background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.tabs button.pre small { font-size: 11px; margin-left: 2px; }
.notice { background: #eef3fb; border-bottom: 1px solid #c4d4ef; color: var(--brand); font-size: 12px; }
.notice .wrap { padding-top: 4px; padding-bottom: 4px; }
.notice-inline { background: #eef3fb; border: 1px solid #c4d4ef; color: var(--brand); padding: 6px 10px; border-radius: var(--radius); font-size: 12.5px; }
tr.lv-stop td { background: #fff5f5; } tr.lv-check td { background: #fffaf0; }
.pill.stop { background: var(--bad); color: #fff; } .pill.check { background: var(--warn-weak); color: var(--warn); border-color: #f0d49a; }
.pill.info { background: #eef3fb; color: var(--brand); border-color: #c4d4ef; } .pill.ok { background: var(--ok-weak); color: var(--ok); }
.flags { margin: 0; padding-left: 16px; }
.memo-opt { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.tabs button.tech { color: var(--muted); font-size: 12px; }

main { padding: 14px 16px 40px; }
.step { display: none; } .step.on { display: block; }

/* パネル：紺の見出し帯 ＋ 白い中身 */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.panel > .ph { background: var(--head); border-bottom: 1px solid var(--line); padding: 6px 12px; font-weight: 700; color: var(--head-text); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel > .pb { padding: 12px; }
.note { color: var(--muted); font-size: 12px; }
.actions { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ボタン（モバカル風の小さい白ボタン） */
button { font: inherit; border: 1px solid #aab6c6; background: linear-gradient(#fff, #f1f4f8); color: var(--text); padding: 4px 12px; border-radius: 2px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--brand); background: #fff; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
button.primary:hover:not(:disabled) { background: var(--bar-2); }
button.big { padding: 7px 20px; font-size: 14px; }
button:disabled { opacity: .5; cursor: default; }
.ico { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; color: #fff; font-size: 10px; line-height: 14px; text-align: center; font-weight: 700; }
.ico.g { background: var(--ok); } .ico.r { background: var(--bad); } .ico.b { background: var(--brand); } .ico.o { background: #e08a00; }

/* 取り込み */
.files { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 10px 0; }
.file { border: 1px dashed #9fb0c6; border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: #fbfcfe; min-width: 0; }
.file-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.file-title .no { color: var(--brand); font-size: 16px; }
.file-title .req { font-size: 11px; font-weight: 700; color: #fff; background: var(--bad); padding: 0 6px; border-radius: 2px; }
.file-spec { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0; font-size: 12px; }
.file-spec dt { color: var(--muted); white-space: nowrap; }
.file-spec dd { margin: 0; }
.file-act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.pick { display: inline-block; border: 1px solid #aab6c6; background: linear-gradient(#fff, #f1f4f8); padding: 3px 12px; border-radius: 2px; cursor: pointer; font-size: 12.5px; }
.pick:hover { border-color: var(--brand); }
.pick input { display: none; }
.file-state { font-size: 12px; color: var(--muted); }
.file-preview { overflow-x: auto; }
.file-preview table { font-size: 11px; }
.file-preview th, .file-preview td { padding: 1px 5px; white-space: nowrap; }
.file.ready { border-style: solid; border-color: var(--ok); background: var(--ok-weak); }
.file.ready .file-state { color: var(--ok); font-weight: 700; }
.error { color: var(--bad); background: var(--bad-weak); padding: 8px 10px; border: 1px solid #f3b9b7; border-radius: var(--radius); }

/* 集計タイル */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 24px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .hint { font-size: 11.5px; color: var(--muted); }
.kpi.ok { border-top-color: var(--ok); } .kpi.warn { border-top-color: var(--warn); } .kpi.bad { border-top-color: var(--bad); }
.kpi.bad .value { color: var(--bad); }
/* 次の画面へ進むボタン：画面の下にいつも出しておく（スクロールしなくても押せる） */
.nextbar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 12px -16px 0; padding: 8px 16px; background: rgba(238, 241, 245, .94); border-top: 1px solid var(--line); backdrop-filter: blur(4px); }
.nextbar .nb-info { margin-right: auto; font-size: 12.5px; color: var(--muted); }
.nextbar .nb-info b { color: var(--text); }
.conf-rule { margin-top: 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 6px 10px; background: #fafbfd; }
.conf-rule summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.conf-rule table { margin-top: 6px; }
.conf-rule td:first-child, .conf-rule th:first-child { width: 1%; white-space: nowrap; text-align: center; }
/* 便利機能の印と、最初の画面の「便利な機能」カード */
.plus { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: #e07b00; padding: 0 6px; border-radius: 2px; vertical-align: 1px; letter-spacing: .02em; }
.features { border-color: #f0c27a; }
.features > .ph { background: #fff4e0; border-bottom-color: #f0c27a; color: #7a4a00; }
.feature-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.fcard { border: 1px solid var(--line-soft); border-top: 3px solid #e07b00; border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.fcard h3 { margin: 0; font-size: 14px; color: var(--text); }
.fcard p { margin: 0; font-size: 12.5px; }
.fcard .where { color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 4px; }
.fcard button { align-self: flex-start; margin-top: 4px; }
.fcard .wait { font-size: 12px; color: var(--warn); }
tr.newfeat td { color: var(--bad); }
tr.newfeat td:first-child { font-weight: 700; }
.newtag { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--bad); padding: 0 6px; border-radius: 2px; vertical-align: 1px; }
.rv-prop { align-items: center; }
.rv-prop b { font-size: 12px; color: var(--brand); margin-right: 2px; }
.rv-prop.none { font-size: 12px; color: var(--muted); }
.kpi-note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 10px; font-size: 12.5px; }

.time { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.time > div { background: #f6f8fb; border: 1px solid var(--line-soft); padding: 8px 12px; }
.time .big { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .time { grid-template-columns: 1fr; } }

.reading { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.reading .box { border: 1px solid var(--line-soft); padding: 8px 10px; }

/* 表（モバカルの一覧に寄せた格子） */
.chips { display: flex; gap: 0; }
.chips button { border-radius: 0; margin-left: -1px; font-size: 12px; padding: 3px 12px; }
.chips button:first-child { border-radius: 2px 0 0 2px; } .chips button:last-child { border-radius: 0 2px 2px 0; }
.chips button.on { background: var(--brand); color: #fff; border-color: var(--brand); position: relative; }
.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 8px; background: #f6f8fb; border: 1px solid var(--line); border-bottom: 0; }
.toolbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.toolbar select, .toolbar input, .search { font: inherit; border: 1px solid #aab6c6; border-radius: 2px; padding: 3px 6px; background: #fff; color: var(--text); }
.search { width: min(320px, 100%); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 4px 8px; border: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--head); color: var(--head-text); font-weight: 700; font-size: 12px; white-space: nowrap; border-color: var(--line); }
tbody tr:hover td { background: #f3f7fd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.red { color: var(--bad); font-weight: 700; }
td.center, th.center { text-align: center; }
.pname { color: var(--link); } .pname::before { content: "👤"; font-size: 11px; margin-right: 3px; filter: hue-rotate(180deg) saturate(.6); }
.pill { display: inline-block; font-size: 11.5px; padding: 0 7px; border-radius: 2px; white-space: nowrap; border: 1px solid transparent; }
.pill.auto { background: var(--ok-weak); color: var(--ok); border-color: #b9dcc0; }
.pill.review { background: var(--warn-weak); color: var(--warn); border-color: #f0d49a; }
.pill.unpaid { background: var(--bad-weak); color: var(--bad); border-color: #f3b9b7; }
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; align-items: center; font-size: 12px; }

/* 要確認 */
.progress { height: 6px; background: var(--line-soft); overflow: hidden; margin-top: 8px; }
.progress div { height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.reviews { display: grid; gap: 8px; }
.rv { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.rv.approved { border-left-color: var(--ok); background: #f6fbf7; }
.rv.hold { opacity: .65; border-left-color: var(--muted); }
.rv-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.rv-reason { font-weight: 700; font-size: 13.5px; }
.conf { font-size: 11.5px; padding: 0 7px; border-radius: 2px; background: #f0f2f5; color: var(--muted); }
.conf.高 { background: var(--ok-weak); color: var(--ok); } .conf.中 { background: var(--warn-weak); color: var(--warn); } .conf.低 { background: var(--bad-weak); color: var(--bad); }
.rv-meta { font-size: 12px; color: var(--muted); }
.rv-detail { margin: 4px 0; }
.rv-notes { font-size: 12px; color: var(--muted); margin: 0; padding-left: 18px; }
.rv-prop { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.rv-prop span { font-size: 12px; background: var(--brand-weak); color: var(--brand); padding: 1px 8px; border: 1px solid #c4d4ef; border-radius: 2px; }
.rv-btns { display: flex; flex-direction: column; gap: 6px; min-width: 76px; }
.rv-btns .ok.on { background: var(--ok); color: #fff; border-color: var(--ok); }
.rv-btns .hd.on { background: var(--muted); color: #fff; border-color: var(--muted); }
@media (max-width: 560px) { .rv { grid-template-columns: 1fr; } .rv-btns { flex-direction: row; } }

/* 反映（収納一覧の再現） */
.reflect { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reflect .opt { border: 1px solid var(--line-soft); padding: 10px 12px; }
.reflect .opt.disabled { background: #f6f8fb; }
@media (max-width: 720px) { .reflect { grid-template-columns: 1fr; } }
.winbar { background: var(--bar); color: #fff; font-size: 12px; padding: 3px 10px; display: flex; gap: 10px; }
.winbar small { opacity: .8; }
tr.paid td { color: var(--text); }
tr.paid td.red { color: var(--text); font-weight: 400; }

/* ダイアログ */
.modal { position: fixed; inset: 0; background: rgba(20, 30, 50, .35); display: none; place-items: center; z-index: 70; padding: 16px; }
.modal.on { display: grid; }
.dialog { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); width: min(380px, 100%); box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.dialog .ph { background: var(--bar); color: #fff; padding: 6px 12px; font-weight: 700; }
.dialog .pb { padding: 14px 12px; }
.dialog .pf { padding: 8px 12px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 6px; background: #f6f8fb; }
.dialog input[type=date] { font: inherit; padding: 3px 6px; border: 1px solid #aab6c6; border-radius: 2px; }

/* 技術構成 */
.tech h3 { margin-top: 14px; color: var(--brand); }
.tech table td:first-child { white-space: nowrap; font-weight: 700; background: #fafbfd; width: 1%; }
.flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.flow .node { border: 1px solid var(--line); background: #fbfcfe; padding: 8px 10px; flex: 1 1 180px; }
.flow .node b { display: block; color: var(--brand); }
.flow .arrow { align-self: center; color: var(--muted); font-size: 16px; }
.flow .node.next { border-style: dashed; background: #fff; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; background: #f1f4f8; padding: 0 4px; border-radius: 2px; }
.manual { font-size: 13px; }
.manual .howto { margin: 4px 0; padding-left: 22px; }
.manual .howto li { margin-bottom: 4px; }
.manual table th:first-child, .manual table td:first-child { width: 1%; white-space: nowrap; }
.manual .faq { margin: 4px 0; }
.manual .faq dt { font-weight: 700; margin-top: 8px; }
.manual .faq dt::before { content: "Q. "; color: var(--brand); }
.manual .faq dd { margin: 2px 0 0 1.6em; }

/* 使い方（説明モード） */
body.help { cursor: pointer; }
.help-banner { display: none; background: #fff6d9; border-bottom: 1px solid #f0d49a; color: #5a3d00; font-size: 12.5px; }
.help-banner .wrap { padding-top: 6px; padding-bottom: 6px; }
body.help .help-banner { display: block; }
#helpRing { position: fixed; pointer-events: none; z-index: 60; border: 2px solid #ffd666; border-radius: 4px; box-shadow: 0 0 0 9999px rgba(15, 25, 45, .45); display: none; transition: all .12s; }
#helpTip { position: fixed; z-index: 61; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); background: #fff; color: var(--text); border: 1px solid #f0d49a; border-top: 4px solid #f0a500; border-radius: 4px; padding: 10px 12px 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); display: none; font-size: 12.5px; cursor: default; }
#helpTip b { display: block; margin-bottom: 2px; font-size: 13.5px; }
#helpTip .tip-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
#helpTip .tip-count { color: var(--muted); font-size: 12px; }
#helpTip .tip-btns { display: flex; gap: 6px; }
#helpTip .tip-btns button { min-width: 72px; }
.foot { color: var(--muted); font-size: 11.5px; padding-bottom: 30px; }
