/* 新しく読み取る */
.wrap.wide{max-width:1600px}
.drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:2px dashed #9fb2cf;border-radius:12px;padding:34px 16px;cursor:pointer;background:#f8fafd;text-align:center}
.drop.over{background:#eaf1fb;border-color:var(--blue)}
.drop-big{font-size:18px;font-weight:700;color:var(--navy)}
#picked{margin-top:10px}
#picked .f{display:flex;gap:10px;align-items:center;padding:6px 0;border-bottom:1px solid var(--line);font-size:14px}
#picked .f span.n{color:var(--sub);margin-left:auto;white-space:nowrap}

.bar{height:10px;background:#e3e8f0;border-radius:99px;overflow:hidden;margin:6px 0 16px}
.bar div{height:100%;width:0;background:var(--blue);transition:width .3s}
.pages{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.pg{background:#fff;border:1px solid var(--line);border-radius:8px;padding:6px;font-size:12px;text-align:center}
.pg canvas{width:100%;height:150px;object-fit:contain;display:block;background:#fafafa}
.pg .st{margin-top:4px;min-height:34px}
.pg.busy{border-color:var(--blue);box-shadow:0 0 0 2px #cfe0f5}
.pg.ok .st{color:var(--green)}
.pg.ng{border-color:#e3a9a4}
.pg.ng .st{color:var(--redink)}

.check{display:grid;grid-template-columns:minmax(300px,38%) minmax(0,1fr);gap:16px;align-items:start;margin-top:10px}
@media (max-width:1000px){.check{grid-template-columns:minmax(0,1fr)}}
.viewer{position:sticky;top:70px;padding:10px}
@media (max-width:1000px){.viewer{position:static}}
.thumbs{display:flex;gap:6px;overflow-x:auto;padding-bottom:6px}
.thumbs button{flex:0 0 auto;border:2px solid transparent;background:#f3f5f9;border-radius:6px;padding:2px;cursor:pointer;font-size:11px;line-height:1.2;color:var(--sub)}
.thumbs button canvas{display:block;height:64px;width:auto;margin:0 auto 2px}
.thumbs button.on{border-color:var(--orange);color:var(--ink)}
.thumbs button.hl{background:#fde9d7}
.thumbs button.ngp{background:var(--red)}
.big{position:relative;background:#eef1f6;border-radius:6px;overflow:auto;max-height:calc(100vh - 230px);min-height:200px;display:flex;justify-content:center}
.big canvas{max-width:100%;height:auto;display:block;cursor:zoom-in}
.big.zoom canvas{max-width:none;cursor:zoom-out}
.big-empty{padding:40px;color:var(--sub)}
.viewer-foot{margin-top:8px}

.right{min-width:0}
#checks .err{margin:0 0 10px}
.tabs{display:flex;gap:4px;flex-wrap:wrap;border-bottom:2px solid var(--navy);margin:-4px -4px 0}
.tabs button{border:1px solid var(--line);border-bottom:none;background:#f3f5f9;border-radius:8px 8px 0 0;padding:7px 14px;cursor:pointer;font-weight:700;color:var(--sub)}
.tabs button.on{background:var(--navy);color:#fff;border-color:var(--navy)}
.tabs button .c{font-weight:400;font-size:12px;opacity:.8;margin-left:4px}
.sheet-warn:not(:empty){background:var(--amber);border-radius:6px;padding:6px 10px;margin-top:10px;font-size:13px}
.sheet-wrap{overflow:auto;max-height:calc(100vh - 360px);min-height:120px;margin-top:10px;border:1px solid var(--line)}
table.sheet{border-collapse:collapse;font-size:13px;background:#fff;min-width:100%}
table.sheet th{position:sticky;top:0;z-index:1;background:#dce4f0;border:1px solid #c4cedd;padding:6px 8px;white-space:nowrap}
table.sheet td{border:1px solid #e1e6ee;padding:5px 8px;white-space:nowrap;max-width:360px;overflow:hidden;text-overflow:ellipsis}
table.sheet td.num{text-align:right;font-variant-numeric:tabular-nums}
table.sheet td.ed{cursor:text}
table.sheet td.ed:hover{outline:2px solid #9fb2cf;outline-offset:-2px}
table.sheet td.u{background:var(--yellow)}
table.sheet td.e{color:var(--blue);font-weight:600}
table.sheet tr.bad td{background:var(--red)}
table.sheet tr.bad td.u{background:#f6c38d}
table.sheet tr.orphan td{background:var(--amber)}
table.sheet tr.subtotal td,table.sheet tr.total td{font-weight:700;background:#f3f5f9}
table.sheet tr.total td{border-top:2px solid var(--navy)}
table.sheet tr.sel td{box-shadow:inset 0 2px 0 var(--orange),inset 0 -2px 0 var(--orange)}
table.sheet td input{width:100%;min-width:80px;border:1px solid var(--blue);border-radius:4px;padding:2px 4px;font-size:13px}
.legend{margin:8px 0 0}
.sw{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-1px;margin-right:3px;border:1px solid #ccc}
.sw.y{background:var(--yellow)}.sw.r{background:var(--red)}.sw.a{background:var(--amber)}

.talk{max-height:260px;overflow:auto;display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.talk .b{max-width:85%;padding:8px 12px;border-radius:12px;white-space:pre-wrap;font-size:14px}
.talk .b.ai{background:#eef3fa;align-self:flex-start;border-top-left-radius:4px}
.talk .b.user{background:#fde9d7;align-self:flex-end;border-top-right-radius:4px}
.talk .b.wait{color:var(--sub)}

.modal{position:fixed;inset:0;background:rgba(20,30,50,.45);display:flex;align-items:center;justify-content:center;z-index:100;padding:16px}
.modal[hidden]{display:none}
.modal-in{max-width:520px;width:100%;margin:0}
