.accounting-panel small{display:block;margin-top:4px;line-height:1.4;color:var(--muted)}
.accounting-tools{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:18px 0}
.accounting-tools label{display:grid;gap:5px;flex:1;min-width:180px}
.accounting-tools input,.accounting-tools select,.accounting-dialog input:not([type=checkbox]),.accounting-dialog select{min-height:40px;height:40px;padding:8px 12px;width:100%;margin:0}
.accounting-upload{display:grid;gap:8px;padding:14px 0;border-bottom:1px solid var(--border)}
.accounting-upload input{display:block;max-width:100%;margin-top:8px}
.accounting-dialog{background:var(--surface,#102023);color:var(--text,#e8f2f3);border:1px solid var(--border,#2a4245);border-radius:20px;padding:24px;width:min(980px,calc(100vw - 24px));max-height:calc(100dvh - 32px);box-sizing:border-box;overflow:auto}
.accounting-dialog::backdrop{background:rgba(0,0,0,.65)}
.accounting-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.accounting-dialog-heading h3{margin:0}.accounting-dialog-heading button{flex:0 0 40px;min-width:40px;padding:6px;font-size:24px}
.accounting-dialog label{display:grid;gap:6px;font-size:14px;line-height:1.5;margin:0}
.accounting-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0;align-items:start}
.accounting-lookup{display:flex;gap:6px;margin-top:6px;align-items:center}.accounting-lookup input{min-width:0}.accounting-lookup button{flex-shrink:0;min-height:36px}
.accounting-line{border:1px solid var(--border,#2a4245);padding:12px 16px;border-radius:12px;margin:16px 0}.accounting-line legend{padding:0 6px;font-weight:700}
.accounting-dialog .accounting-fields{margin-top:8px}.accounting-dialog textarea{width:100%;min-height:64px;box-sizing:border-box;padding:10px 12px}
.accounting-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:20px}
.accounting-dialog .primary-button,.accounting-dialog .secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:42px;margin:0;padding:10px 16px;text-decoration:none;line-height:1.3}
.accounting-preview{border:1px solid var(--border,#2a4245);border-radius:12px;padding:16px;margin-top:20px}.accounting-confirm{display:flex!important;align-items:flex-start;gap:10px!important;margin:16px 0!important}.accounting-confirm input{flex:0 0 auto;margin-top:3px}
.accounting-scan{border-block:1px solid var(--border,#2a4245);padding:16px 0;margin:16px 0}.accounting-scan pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:300px;overflow:auto;font-size:13px}
.accounting-dialog details{margin:12px 0}.accounting-dialog summary{cursor:pointer}.draft-original{display:grid;grid-template-columns:140px 1fr;gap:6px 12px;font-size:14px}.draft-original dd{margin:0;overflow-wrap:anywhere}
@media(max-width:600px){.accounting-dialog{padding:16px}.accounting-fields{grid-template-columns:1fr}.accounting-actions>*{width:100%}.accounting-tools{align-items:stretch}.accounting-tools label{min-width:100%}}
.accounting-panel{min-width:0;max-width:100%;box-sizing:border-box}
.accounting-panel .table-scroll{max-width:100%;overflow-x:auto}
.accounting-panel table{width:100%;min-width:620px}
.accounting-dialog .accounting-fields>*{min-width:0}
.accounting-dialog input,.accounting-dialog select{box-sizing:border-box;min-width:0}
.accounting-upload{grid-template-columns:minmax(0,1fr)}
.accounting-upload>*{min-width:0;max-width:100%}
.accounting-upload input{width:100%;min-width:0;box-sizing:border-box;font:inherit;font-size:13px}
.accounting-dialog input:not([type=checkbox]),.accounting-dialog select,.accounting-dialog textarea,.accounting-tools input,.accounting-tools select{border:1px solid var(--border);border-radius:10px;background:var(--surface-2);color:var(--text);font:inherit;font-size:14px}
.accounting-dialog input::placeholder,.accounting-dialog textarea::placeholder,.accounting-tools input::placeholder{color:var(--muted)}
.accounting-dialog small{display:block;margin-top:5px;font-size:12px;line-height:1.4;color:var(--muted)}
.accounting-dialog input[type=checkbox]{accent-color:var(--accent)}
.accounting-dialog select{appearance:auto;cursor:pointer}
.accounting-panel .status-pill,.accounting-dialog .status-pill{display:inline-flex;align-items:center;justify-content:center;align-self:start;min-height:0;padding:6px 12px;border-radius:999px;background:var(--surface-2);line-height:1.3;white-space:normal;text-align:center}
.accounting-panel .status-pill.ok{color:var(--positive);background:color-mix(in srgb,var(--positive) 12%,var(--surface))}

.accounting-next{border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin:12px 0 20px;background:var(--surface-2)}
.accounting-next p{margin:8px 0;font-size:14px;line-height:1.5}.accounting-next .accounting-actions{margin-top:12px}
.accounting-dialog .accounting-danger{color:var(--negative,#dc5d65);border-color:currentColor;background:transparent}
.accounting-reference{font-weight:700;overflow-wrap:anywhere}.accounting-reject{margin-top:16px;padding-top:14px;border-top:1px solid var(--border)}

.catalog-controls{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}.catalog-controls button{display:inline-flex;align-items:center;justify-content:center;min-height:36px;width:auto;margin:0;padding:8px 12px;font-size:13px;line-height:1.3}.catalog-controls button:disabled{opacity:.45;cursor:default}.mini-lookup select{max-width:100%}
@media(max-width:600px){.catalog-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}}

.source-comment{white-space:pre-wrap;overflow-wrap:anywhere}

.accounting-scan .scan-lines {padding-inline-start:2.5em;max-height:20rem;overflow:auto}
.accounting-scan .scan-lines li {padding:.35rem .25rem;border-bottom:1px solid var(--border);overflow-wrap:anywhere}
.accounting-scan caption {text-align:start;font-weight:600;padding:.5rem 0}

.scan-badge {display:table;margin-block:.35rem;padding:.18rem .55rem;border:1px solid currentColor;border-radius:.45rem;font-size:.82rem;font-weight:650}
.scan-complete {color:#b4f0c3;background:#153728}
.scan-partial,.scan-failed {color:#ffd1d0;background:#512421}
[data-theme=light] .scan-complete {color:#16522e;background:#e5f5e8}
[data-theme=light] :is(.scan-partial,.scan-failed) {color:#842320;background:#fff0ed}
