.scan-tool{border:1px solid var(--edge);border-radius:16px;background:var(--card);box-shadow:0 13px 36px rgba(24,47,64,.08);overflow:hidden}
.scan-intake{padding:18px 20px 14px;border-bottom:1px solid var(--edge);position:relative}
.scan-controls,.export-actions,.scan-edits{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.button{display:inline-flex;justify-content:center;align-items:center;min-height:42px;padding:7px 13px;border:1px solid var(--edge);border-radius:8px;background:white;color:var(--ink);cursor:pointer;font:600 14px/1.3 var(--body);text-align:center}
.button:hover:not(:disabled){border-color:var(--teal);color:var(--teal)}
.button.primary{background:var(--teal);border-color:var(--teal);color:#fff}
.button.primary:hover:not(:disabled){background:#00483e;color:white}
.button:disabled{opacity:.48;cursor:not-allowed}
.button.compact{min-height:36px;padding:6px 10px;font-size:13px}
.scan-limit,.scan-status,.scan-hint{font-size:13px;color:var(--quiet);margin:7px 0 0}
.scan-status{min-height:20px;color:var(--ink)}
.scan-status[data-error]{color:#953515}
.scan-intake progress{width:100%;height:7px;appearance:auto;accent-color:var(--teal);display:block;margin-top:8px}
.scan-intake progress[hidden],.scan-edits[hidden]{display:none}
.scan-workspace{display:grid;grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr)}
.scan-source,.scan-result{min-width:0;padding:17px 16px 15px}
.scan-source{background:#f1f4f3;border-right:1px solid var(--edge)}
.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-height:48px;margin-bottom:7px}
.panel-heading h2{font:650 18px/1.25 var(--body);margin:1px 0 3px}
.panel-meta{color:var(--quiet);font-size:12px;margin:0;overflow-wrap:anywhere}
.scan-document,.scan-grid{overflow:auto;max-height:470px;border:1px solid var(--edge);border-radius:8px;background:white}
.scan-document{min-height:170px;padding:9px;display:block}
.scan-document canvas{display:block;width:auto;height:auto;max-width:100%;margin:auto;background:white}
.scan-document[data-zoomed] canvas{max-width:none;max-height:none}
.scan-grid{min-height:170px}
.scan-empty{padding:38px 16px;text-align:center;color:var(--quiet);font-size:14px}
.scan-empty strong{color:var(--ink)}
.scan-empty p{margin:5px 0}
.scan-table{border-collapse:separate;border-spacing:0;min-width:100%;width:max-content;font:14px/1.3 var(--mono)}
.scan-table th{padding:5px 8px;font-size:12px;font-weight:600;background:#edf3f1;color:var(--quiet);border-right:1px solid var(--edge);border-bottom:1px solid var(--edge);text-align:center;white-space:nowrap}
.scan-table thead th{position:sticky;top:0;z-index:1}
.scan-table td{background:white;border-right:1px solid var(--edge);border-bottom:1px solid var(--edge);padding:0}
.scan-table tr:last-child td,.scan-table tr:last-child th{border-bottom:0}
.scan-table .scan-cell{width:148px;height:37px;border:0;border-radius:0;padding:6px 7px;background:transparent;color:var(--ink);font:inherit}
.scan-table .scan-cell:focus{position:relative;z-index:1;outline:2px solid var(--teal);outline-offset:-2px}
.scan-table td[data-review]{background:#fff2ce}
.scan-table td[data-selected]{box-shadow:inset 0 0 0 1px var(--teal)}
.scan-edits{margin-top:12px}
.scan-hint{min-height:18px}
.file-button:has(+input:focus-visible){outline:3px solid #76aea3;outline-offset:3px}
@media(max-width:760px){.scan-workspace{grid-template-columns:1fr}.scan-source{border-right:0;border-bottom:1px solid var(--edge)}.scan-source,.scan-result{padding:13px}.scan-intake{padding:15px}.scan-document{max-height:320px}.scan-grid{max-height:420px}}
@media(max-width:420px){.result-heading{align-items:stretch;flex-direction:column}.export-actions{align-self:flex-start}.scan-controls .button{font-size:13px;padding-inline:9px}.scan-table .scan-cell{width:106px}}
