:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#263d38;background:#f3f5f2;font-size:15px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,.button{cursor:pointer;border:1px solid #cad6cf;background:white;color:#284d43;border-radius:7px;padding:9px 14px;text-decoration:none;display:inline-block}button:hover,.button:hover{background:#edf4ef}button:disabled{opacity:.5;cursor:wait}.primary{background:#175b4c;color:white;border-color:#175b4c}.primary:hover{background:#104637}.danger{color:#b34537}header{padding:22px 32px;background:#fff;border-bottom:1px solid #dce3dc;display:flex;align-items:center;justify-content:space-between;gap:15px}.brand{font-size:23px;font-weight:700;letter-spacing:2px}.sub{font-size:13px;color:#73857b;letter-spacing:0;font-weight:400;margin-left:14px}.layout{display:grid;grid-template-columns:210px 1fr;min-height:calc(100vh - 80px)}nav{padding:25px 15px;background:#e8eee7;border-right:1px solid #d8e1d8}nav button{width:100%;text-align:left;margin-bottom:10px;background:transparent;border:0;padding:14px 12px}nav button.active{background:#175b4c;color:white}nav small{display:block;padding:20px 12px;color:#6a7c71;line-height:1.8}main{padding:30px;min-width:0;max-width:1800px}h1{font-size:26px;margin:0 0 8px}h2{font-size:20px;margin:18px 0}h3{font-size:17px}.muted{color:#718078;font-size:14px}.topline,.actions{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.actions{justify-content:flex-start}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:25px 0}.stat{background:white;border:1px solid #dce4dc;border-radius:10px;padding:22px}.stat strong{display:block;font-size:28px;font-weight:600;margin-top:12px;font-variant-numeric:tabular-nums}.stat:first-child{background:#e3eee6}.stat.warn{background:#fff6e4}.filters{display:flex;gap:10px;flex-wrap:wrap;padding:17px;background:#fff;border:1px solid #dce4dc;border-bottom:0;border-radius:10px 10px 0 0}.filters input,.filters select{width:auto;max-width:170px}.tablewrap{overflow:auto;background:#fff;border:1px solid #dce4dc;border-radius:0 0 10px 10px}table{border-collapse:collapse;width:100%;white-space:nowrap;font-size:14px}th{text-align:left;background:#f7f9f5;color:#63776c;font-weight:500;padding:15px}td{padding:17px 15px;border-top:1px solid #edf0ea}tr:hover td{background:#fafcf9}td strong{font-weight:600}.num{text-align:right;font-variant-numeric:tabular-nums}.badge{display:inline-block;border-radius:5px;background:#eef2ed;padding:4px 7px;font-size:12px}.badge.warn{background:#fff0d4;color:#946223}.badge.good{background:#e6f3e9;color:#28673c}.link{border:0;padding:4px;background:transparent;color:#175b4c}.empty{padding:50px;text-align:center;color:#819085}.hint{padding:13px 16px;background:#edf3ed;border-radius:7px;font-size:14px;line-height:1.7;margin:14px 0}.alert{background:#fff7e8;border-left:3px solid #d3a04f;padding:15px;margin:12px 0;border-radius:5px;line-height:1.6}.card{border:1px solid #dce4dc;border-radius:9px;padding:18px;margin:15px 0;background:white}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.wide{grid-column:1/-1}label{display:block;font-size:14px;color:#536a5e}input,select,textarea{width:100%;padding:10px 11px;background:white;color:#233e32;border:1px solid #cbd7cc;border-radius:6px;margin-top:6px;min-height:40px}input[type=checkbox]{width:auto;min-height:0}textarea{min-height:72px;resize:vertical}dialog{border:0;border-radius:13px;width:min(920px,94vw);max-height:90vh;padding:26px;box-shadow:0 20px 100px #19332340;color:#263d38}dialog::backdrop{background:#16312870;backdrop-filter:blur(2px)}.modalhead{display:flex;justify-content:space-between;align-items:center;position:sticky;top:-26px;background:white;z-index:1;padding:10px 0}.modalhead h2{margin:0}.close{border:0;font-size:24px;padding:0 8px}.footer{display:flex;justify-content:flex-end;gap:12px;padding-top:20px}.splitrow{display:grid;grid-template-columns:1fr 1.3fr 1fr 110px 40px;gap:8px;margin:10px 0;align-items:end}.payrow{display:grid;grid-template-columns:1fr 150px 40px;gap:10px;margin:10px 0}.thumbs{display:flex;gap:12px;flex-wrap:wrap;margin:12px 0}.thumbs a{display:flex;flex-direction:column;max-width:130px;color:#34594a;font-size:12px;text-decoration:none;word-break:break-all}.thumbs img,.pdf{width:110px;height:85px;object-fit:cover;border:1px solid #d2ddd2;border-radius:6px}.pdf{display:grid;place-items:center;background:#f1f2e9;font-size:23px}#toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#243f34;color:white;padding:15px 24px;border-radius:8px;display:none;z-index:20}.login{max-width:420px;margin:12vh auto;padding:35px;background:white;border-radius:14px;border:1px solid #dce4dc}.login label{margin:20px 0}.login button{width:100%}.small{font-size:12px;color:#768579}.totalrow{display:flex;gap:24px;flex-wrap:wrap;padding:16px;background:#f2f6f0;border-radius:8px}.totalrow strong{display:block;font-size:22px;margin-top:8px}@media(max-width:800px){header{padding:16px}.sub{display:none}.layout{display:block}nav{display:flex;padding:8px;gap:5px}nav button{font-size:13px;margin:0;padding:10px 5px;text-align:center}nav small{display:none}main{padding:18px 12px}.stats{grid-template-columns:1fr 1fr;gap:9px;margin:18px 0}.stat{padding:15px}.stat strong{font-size:22px}.grid{grid-template-columns:1fr}.splitrow{grid-template-columns:1fr 1fr}.splitrow button{grid-column:2}.payrow{grid-template-columns:1fr 100px 35px}dialog{padding:18px}.modalhead{top:-18px}.filters input,.filters select{max-width:46%}h1{font-size:23px}}
.combo{display:flex;align-items:center;gap:0}.combo input{min-width:0;border-radius:6px 0 0 6px}.combo button{margin-top:6px;border-left:0;border-radius:0 6px 6px 0;padding:10px 9px;min-height:40px;background:#eef5ee}.option-chips{display:flex;gap:10px;flex-wrap:wrap;margin:24px 0}#optionDialog{width:min(460px,94vw)}.entry-layout{grid-template-columns:180px minmax(0,1fr)}.entry-layout main{max-width:none;padding:25px 20px}.entry-notice{display:flex;gap:25px;padding:14px 18px;background:#e5eee6;color:#365d46;border-radius:8px 8px 0 0;margin-top:20px;font-size:14px}.worksheet-wrap{overflow:auto;border:1px solid #bdcfc0;max-height:65vh;background:white}.worksheet{table-layout:fixed;width:2070px;white-space:normal}.worksheet th{position:sticky;top:0;z-index:2;background:#dfece0;color:#274d35;font-weight:600;border-right:1px solid #c7d7c9}.worksheet td{vertical-align:top;padding:10px;border-right:1px solid #e1e9e0}.worksheet th:nth-child(1){width:48px}.worksheet th:nth-child(2){width:145px}.worksheet th:nth-child(3){width:250px}.worksheet th:nth-child(4){width:240px}.worksheet th:nth-child(5),.worksheet th:nth-child(9){width:185px}.worksheet th:nth-child(6),.worksheet th:nth-child(8){width:150px}.worksheet th:nth-child(7){width:180px}.worksheet th:nth-child(10){width:195px}.worksheet th:nth-child(11){width:240px}.worksheet input,.worksheet select{margin:0 0 8px;padding:9px;font-size:14px}.worksheet .combo button{margin:0 0 8px;padding:9px}.worksheet .row-index{text-align:center;background:#f5f8f1}.row-index span{display:block;margin-top:8px;color:#6a826c}.worksheet td:focus-within{background:#f0f7ec}.dropzone{min-height:126px;padding:7px;border:1px dashed #a5bca7;background:#f6f9f1;border-radius:6px;outline-offset:2px}.dropzone.dragging{background:#d4ead4;border:2px solid #256c43}.filepick{cursor:pointer;text-align:center;padding:9px 0;font-size:13px;color:#568060;line-height:1.7}.filepick span{font-size:12px}.filepick input{width:100%;font-size:12px;margin-top:6px}.draftthumbs{display:flex;gap:7px;flex-wrap:wrap}.draftthumb{position:relative;display:inline-block}.draftthumb img,.draftthumb .pdf{width:68px;height:66px;object-fit:cover;border:1px solid #c6d2c2;border-radius:4px}.draftthumb button{position:absolute;right:-6px;top:-6px;border-radius:50%;padding:0;width:20px;height:20px;font-size:14px;background:white;color:#a74737}.worksheet .small{display:block;line-height:1.6;white-space:normal}#draftStatus{font-weight:600}@media(max-width:800px){.entry-layout{display:block}.entry-layout main{padding:16px 12px}.entry-notice{gap:12px;flex-wrap:wrap}.worksheet-wrap{max-height:65vh}}
/* 表格录单把宽度留给单据，三个业务入口改为顶部标签。 */
.entry-layout{display:block}.entry-layout nav{display:flex;gap:8px;padding:10px 20px;border-right:0;border-bottom:1px solid #d8e1d8}.entry-layout nav button{width:auto;margin:0;padding:10px 18px}.entry-layout nav small{display:none}.worksheet td:first-child{position:sticky;left:0;z-index:1;background:#f5f8f1}.worksheet th:first-child{left:0;z-index:4}.worksheet td:nth-child(3){position:sticky;left:48px;z-index:1;background:#fff;box-shadow:2px 0 3px #244b3210}.worksheet th:nth-child(3){left:48px;z-index:3}.worksheet td:nth-child(3):focus-within{background:#f0f7ec}@media(max-width:800px){.entry-layout nav{padding:8px}.entry-layout nav button{flex:1;padding:10px 5px}.worksheet td:nth-child(3),.worksheet th:nth-child(3){position:static}.entry-notice{font-size:13px}}
.ocr-modal{width:min(1450px,97vw)}.ocr-workbench{display:grid;grid-template-columns:minmax(250px,35%) minmax(0,1fr);gap:22px;margin-top:12px}.ocr-workbench aside{align-self:start;position:sticky;top:55px}.ocr-original{width:100%;border:1px solid #c8d6c9;border-radius:7px}.ocr-raw{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;max-height:250px;overflow:auto}.ocr-lines table{min-width:790px}.ocr-lines td,.ocr-lines th{padding:7px}.ocr-lines input{min-width:65px;max-width:170px;margin:0;padding:8px}.ocr-lines td:nth-child(8) input{min-width:125px}.ocr-group{display:grid;grid-template-columns:1fr 1.3fr 1fr auto;align-items:center;gap:10px;border:1px solid #dce5db;padding:12px;border-radius:7px;margin:10px 0}.ocr-group strong small{display:block;font-size:13px;font-weight:400;margin-top:5px}.ocr-confirm{margin-top:20px;line-height:1.7}.ocr-style-list{display:flex;gap:5px;flex-wrap:wrap;margin:8px 0}.ocr-workbench .alert{font-size:14px}.ocr-workbench .hint{margin-top:0}@media(max-width:900px){.ocr-workbench{grid-template-columns:1fr}.ocr-workbench aside{position:static}.ocr-original{max-height:300px;object-fit:contain}.ocr-group{grid-template-columns:1fr 1fr}}
#imagePreview{width:96vw;max-width:1600px;height:94vh;max-height:94vh;padding:0;overflow:hidden;background:#f3f5f2}#imagePreview::backdrop{background:#11221ce6;backdrop-filter:blur(3px)}.image-preview-head{display:flex;justify-content:space-between;align-items:center;gap:12px;background:white;padding:14px 20px;border-bottom:1px solid #d7e1d9;min-height:68px}.image-preview-head strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:45%}.image-preview-body{height:calc(100% - 78px);overflow:auto;padding:16px;text-align:center}.image-preview-body img{display:block;margin:auto;max-width:none;height:auto;box-shadow:0 2px 16px #16271a26}#imageScale{font-size:13px;min-width:65px;text-align:center}.thumbs img,.draftthumb img,.ocr-original{cursor:zoom-in}@media(max-width:650px){.image-preview-head{flex-wrap:wrap;padding:10px}.image-preview-head strong{max-width:100%;width:100%}.image-preview-head button{padding:7px 10px}.image-preview-body{height:calc(100% - 110px)}}

/* 白色预览框随图片缩放，上限为视口，超出时在框内滚动。 */
#imagePreview{height:auto;max-width:96vw}.image-preview-head{flex-wrap:wrap}.image-preview-head strong{max-width:100%;flex:1 1 180px}.image-preview-head .actions{flex-wrap:nowrap}.image-preview-body{height:auto}

#imagePreview{position:fixed;z-index:10000;border:1px solid #b9c9bf;border-radius:12px;box-shadow:0 10px 45px #142c3955;margin:0;max-height:94vh;color:#263d38}.image-preview-head{cursor:move;touch-action:none}.image-preview-head .actions{flex-wrap:wrap;gap:5px}.image-preview-head button{padding:7px 9px}.image-preview-head strong{font-size:13px}.image-preview-body{background:#f3f5f2}
.attachment-drop,.recon-drop{display:block;border:2px dashed #a4bca8;padding:14px;border-radius:8px;background:#f7faf5}.attachment-drop.dragging{background:#dceedd;border-color:#175b4c}.upload-preview{display:flex;gap:10px;flex-wrap:wrap}.upload-preview>span{max-width:130px;font-size:12px;overflow-wrap:anywhere}.upload-preview img{display:block;width:90px;height:80px;object-fit:contain;cursor:zoom-in}.recon-modal{width:min(1450px,96vw)}.recon-import-table{max-height:55vh;margin:18px 0}.recon-import-table input,.recon-import-table select{min-width:100px;margin:3px 0}.recon-import-table td{vertical-align:top}.recon-row-issue{display:block;color:#a0402d;font-size:13px;white-space:normal;min-width:150px}
.choice-popup{position:fixed;z-index:20000;overflow:auto;background:white;border:1px solid #b8cdbd;border-radius:8px;padding:5px;box-shadow:0 8px 24px #18362730}.choice-popup button{display:block;text-align:left;width:100%;border:0;border-radius:4px;padding:10px 12px;margin:0;color:#263d38;background:white}.choice-popup button:hover,.choice-popup button:focus,.choice-popup button[aria-selected=true]{background:#e4f0e6;outline:0}.combo .choice-toggle{border-radius:0;padding-left:8px;padding-right:8px;flex-shrink:0}.choice-popup .small{padding:12px}
.size-count-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}.size-count-cell{font-size:16px;font-weight:600;background:#f3f7f1;border:1px solid #d7e2d8;border-radius:8px;padding:12px}.size-count-cell>span{display:flex;align-items:center;gap:8px}.size-count-cell input{min-width:0;width:100%;font-weight:400}.size-count-cell span span{font-size:14px;font-weight:400;white-space:nowrap}.size-add-row{display:flex;gap:10px;align-items:flex-end;margin:12px 0}.size-add-row label{max-width:220px}.size-editor details{margin-top:14px}
/* 导入核对：固定列边界，字段与提示各自分行，避免全局nowrap挤出单元格。 */
.recon-import-table table{table-layout:fixed;width:100%;min-width:1170px;white-space:normal}.recon-import-table th,.recon-import-table td{white-space:normal;overflow-wrap:anywhere;padding:14px 12px;vertical-align:top}.recon-import-table thead th{position:sticky;top:0;z-index:2;background:#eaf1e9}.recon-import-table .import-source{width:120px}.recon-import-table .import-style{width:230px}.recon-import-table .import-factory{width:180px}.recon-import-table .import-date{width:180px}.recon-import-table .import-quantity{width:220px}.recon-import-table .import-money{width:200px}.recon-import-table .import-notes{width:220px}.recon-import-table [hidden]{display:none!important}.recon-import-table .import-field{display:block;margin:0 0 10px;font-size:12px;line-height:1.5}.recon-import-table input,.recon-import-table select{display:block;width:100%;min-width:0;max-width:100%;margin:4px 0 0;font-size:14px}.recon-import-table .combo{display:flex;min-width:0;max-width:100%}.recon-import-table .combo input{flex:1;width:0}.recon-import-table .combo button{margin-top:4px}.recon-import-table input[type=checkbox]{display:inline-block;width:auto;min-height:0;margin-right:5px}.recon-import-table small{display:block;font-size:12px;line-height:1.6;white-space:normal;margin:6px 0}.recon-import-table .recon-row-issue{display:block;min-width:0;white-space:normal;line-height:1.7;padding:8px;border-radius:6px;background:#fff1e9}.recon-import-table .recon-row-issue:empty{display:none}.recon-import-table tbody tr:nth-child(even){background:#f8faf7}
.recon-import-table table{min-width:1000px}.recon-import-table .import-source{width:10%}.recon-import-table .import-style{width:19%}.recon-import-table .import-factory{width:15%}.recon-import-table .import-quantity{width:19%}.recon-import-table .import-money{width:17%}.recon-import-table .import-notes{width:20%}.recon-import-table .import-date{width:180px}
.cost-row{border:1px solid var(--border,#d8e0db);border-radius:10px;padding:16px;margin:14px 0;background:#fafcfb}.cost-row-main{display:grid;grid-template-columns:2fr 1fr .7fr 1fr 1.2fr auto auto;gap:12px;align-items:end}.cost-row label,.cost-row .combo{min-width:0}.cost-row input{min-width:0;width:100%}.cost-row input[type=checkbox]{width:auto}.cost-row .combo input{width:0;flex:1}.cost-row details{margin-top:12px}.cost-checks p{margin:8px 0}@media(max-width:800px){.cost-row-main{grid-template-columns:1fr 1fr}.cost-row-main>label:first-child{grid-column:1/-1}}

.cost-attachment{display:flex;flex-direction:column;gap:8px;width:160px;max-width:100%}.cost-attachment a{max-width:100%;overflow-wrap:anywhere}.cost-attachment button{align-self:flex-start}.cost-attachment img{max-width:100%}

#toast{inset:auto auto 30px 50%;margin:0;border:0;max-width:min(640px,calc(100vw - 32px));width:max-content;white-space:normal;overflow-wrap:anywhere;box-shadow:0 6px 28px #0003;pointer-events:none}#toast::backdrop{background:transparent;pointer-events:none}.form-error{background:#fff1ec;color:#963b28;border:1px solid #e5afa0;border-left:4px solid #ba4b35;border-radius:7px;padding:14px 16px;margin:14px 0;white-space:pre-wrap;overflow-wrap:anywhere}

.worksheet .row-index{min-width:82px;width:82px}.row-delete-visible{display:block;font-size:12px;padding:6px 4px;margin:10px auto;white-space:nowrap}.recon-row-deleted td:not(:first-child){display:none}.recon-row-deleted{background:#f4f4f1}.recon-row-deleted .import-source{width:auto}.recon-row-deleted .import-source small{display:block}

.daily-worksheet th:nth-child(4),.daily-worksheet td:nth-child(4){display:none}

.ocr-attention td{background:#fff1c8}.ocr-attention input:focus{outline:3px solid #d98c24}

.batch-receipt-drop{text-align:center;padding:28px 18px;min-height:150px}.batch-receipt-drop.dragging{background:#dceedd;border-color:#175b4c}.batch-receipt-drop input{max-width:420px;margin:auto}.batch-file-preview{display:flex;gap:12px;flex-wrap:wrap;max-height:260px;overflow:auto;margin-bottom:18px}.batch-file-card{width:130px;border:1px solid #c6d2c2;border-radius:8px;padding:8px;display:flex;flex-direction:column;gap:6px}.batch-file-card img,.batch-file-card .pdf{width:100%;height:90px;object-fit:contain}.batch-file-card>span{font-size:12px;overflow-wrap:anywhere}.batch-file-card button{padding:5px}

#batchFilePreview{max-height:55vh;display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}#batchFilePreview .batch-file-card{width:auto;min-width:0}#batchFilePreview .batch-file-card>img{height:150px}.individual-payment{display:grid;gap:8px}.merged-payment .individual-payment{display:none}.row-pay-thumb{display:inline-block;max-width:100px;margin:5px;overflow-wrap:anywhere}.row-pay-thumb img{height:65px!important}#batchPayment[hidden]{display:none}

.ocr-lines:not(.show-optional) th:nth-child(7),.ocr-lines:not(.show-optional) td:nth-child(7),.ocr-lines:not(.show-optional) th:nth-child(8),.ocr-lines:not(.show-optional) td:nth-child(8){display:none}.draft-readiness{color:#9a5429;margin-top:8px}

.problem-focus{outline:3px solid #d48c35!important;outline-offset:3px;scroll-margin:80px}.form-error button{margin-left:12px}.recon-row-issue button{text-align:left;white-space:normal}

.cost-overview{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px}.cost-overview aside{min-width:0}.cost-overview .thumbs img{max-width:220px;height:170px;object-fit:contain}.cost-ocr-status{display:block;clear:both}.cost-ocr-status .alert{display:block;margin:10px 0;padding:14px;line-height:1.6}.cost-ocr-status pre{max-height:240px;overflow:auto}@media(max-width:760px){.cost-overview{grid-template-columns:1fr}}

.cost-detail-list{min-width:1100px}.cost-detail-list td[rowspan]{vertical-align:top}.cost-list-images{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;max-width:200px}.cost-list-images img{width:90px;height:100px;object-fit:contain;border:1px solid #d8e2dc;border-radius:6px}.cost-detail-list .cost-sheet-first td{border-top:2px solid #d8e2dc}

/* Cost editor: readable fields, with calculation actions on their own line. */
#costForm .cost-row-main{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 20px;align-items:end}
#costForm .cost-row-main>label{display:block;margin:0;font-size:15px;line-height:1.5;color:#3d5a50}
#costForm .cost-row-main input{font-size:17px;line-height:1.5;height:46px;padding:9px 12px;margin:6px 0 0;font-variant-numeric:tabular-nums}
#costForm .cost-row-main .combo{width:100%;display:flex;align-items:stretch}
#costForm .cost-row-main .combo button{margin-top:6px;flex-shrink:0}
#costForm .cost-row-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px;padding-top:14px;border-top:1px solid #dce5df}
#costForm .cost-row-actions button{white-space:nowrap;font-size:15px;padding:10px 16px;margin:0}
#costForm [data-cost-remove]{margin-left:auto;color:#a34436}
#costForm .cost-row{padding:20px;background:#fff}
#costForm .cost-row details{padding-top:12px;margin-top:14px;border-top:1px solid #edf1ee}
@media(max-width:800px){#costForm .cost-row-main{grid-template-columns:repeat(2,minmax(0,1fr))}#costForm .cost-row-main>label:first-child{grid-column:1/-1}}
@media(max-width:480px){#costForm .cost-row-main{grid-template-columns:minmax(0,1fr)}#costForm .cost-row{padding:12px}#costForm [data-cost-remove]{margin-left:0}}

.cost-summary-list{width:100%;min-width:900px}.cost-summary-list td{padding:12px 14px;vertical-align:middle}.cost-summary-image{display:block;width:56px;height:64px;object-fit:contain;border:1px solid #dce5df;border-radius:5px;background:white}.cost-summary-list td:nth-child(6){white-space:normal;min-width:140px}.cost-summary-list td:nth-child(2){min-width:150px}

.recon-import-table .import-quantity{width:310px}.quantity-reference{margin-top:12px;padding:12px;background:#f0f5f1;border:1px solid #d6e2d9;border-radius:8px;font-size:14px;line-height:1.65}.quantity-record{padding:8px 0;border-bottom:1px solid #d6e2d9}.quantity-totals{padding:10px 0;font-size:15px}.quantity-reference small{font-size:12px}
.recon-progress-bar {position:sticky;top:0;z-index:3;background:#fff;padding:10px 0;display:flex;align-items:center;gap:16px;border-bottom:1px solid #d8e3dd;flex-wrap:wrap}
.recon-progress-bar span {font-size:14px;color:#52695e}
.recon-import-table .compact-reference,.recon-import-table .row-cost-reference .hint {padding:12px;line-height:1.55;font-size:15px}
.recon-import-table .compact-reference details {margin-top:8px}
.recon-import-table .suspect-reference>div {margin-top:6px}
.recon-import-table .row-cost-reference .alert {margin:8px 0;padding:10px;font-size:14px}
.recon-import-table .row-cost-reference p {margin:6px 0}
.recon-import-table [data-apply-cost-price] {padding:8px;font-size:14px}
/* Keep reconciliation columns predictable: mixed % and px widths squeezed prices. */
.recon-import-table table{min-width:1330px;table-layout:fixed}
.recon-import-table .import-source{width:90px}
.recon-import-table .import-style{width:190px}
.recon-import-table .import-factory{width:140px}
.recon-import-table .import-quantity{width:320px}
.recon-import-table .import-money{width:300px}
.recon-import-table .import-notes{width:190px}
.recon-import-table .row-cost-reference .hint{padding:10px;margin:8px 0;font-size:14px}
.recon-import-table .row-cost-reference .alert{padding:8px 0 0;margin:6px 0 0;border:0;border-top:1px solid #dac8a4;border-radius:0;background:transparent}
.recon-import-table .row-cost-reference .cost-candidate{margin:5px 0}
.recon-import-table .cost-candidate-style{font-weight:600;overflow-wrap:normal}
.recon-import-table .cost-candidate-price{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.recon-import-table .cost-candidate-price strong{white-space:nowrap}
.recon-import-table .cost-candidate-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px}
.recon-import-table [data-apply-cost-price],.recon-import-table [data-cost-source-preview],.recon-import-table [data-use-shipment-quantity]{white-space:nowrap;overflow-wrap:normal;font-size:13px;padding:6px 8px;min-height:32px;line-height:1.4}
#applyStyleCorrection[hidden]{display:none!important}

.batch-shortcut{border-top:1px solid #d9dfd5;margin-top:14px;padding-top:8px}.batch-shortcut button.link{font-size:14px;padding:4px 0}

.batch-image-open{display:block;width:100%;padding:0;border:0;background:transparent;cursor:zoom-in}.batch-image-open img{display:block;width:100%;object-fit:contain}.batch-image-open .small{display:block;padding:5px;text-align:center}

.ocr-row-formula{min-width:170px;max-width:260px;white-space:normal;margin-top:6px}.ocr-lines input[aria-invalid="true"]{border-color:#c45138;background:#fff8f3}

.whole-source-preview{margin:12px 0}.whole-source-preview img{max-height:420px;object-fit:contain}.whole-source-preview iframe{width:100%;height:480px;border:1px solid #dce5db}

.comparison-different{background:#fff6e7}.comparison-different td{font-weight:600}

/* Keep the description and its calculation selector stacked inside one cell. */
.ocr-lines td{vertical-align:top;white-space:normal}
.ocr-lines input,.ocr-lines select{display:block;width:100%;max-width:none;min-width:0;box-sizing:border-box}
.ocr-lines td:nth-child(2){min-width:150px}
.ocr-lines td:nth-child(3){min-width:210px}
.ocr-lines td:nth-child(4),.ocr-lines td:nth-child(5){min-width:110px}
.ocr-lines td:nth-child(6){min-width:190px}
.ocr-lines select[data-ocr-field="calculation"]{margin:8px 0 0;padding:8px;font-size:13px}
.ocr-lines input:disabled{background:#f3f5f2;color:#718078}

.draft-group-summary td{background:#eaf3ed;padding:18px;white-space:normal}.draft-group-summary label{font-size:16px}.draft-group-summary p{margin:10px 0}

.worksheet-style-search{margin:14px 0}.worksheet-style-search input{width:280px;max-width:100%;margin:0}

.expense-payment-group td{background:#eaf3ed}.group-style-summary{max-width:280px;white-space:normal;overflow-wrap:anywhere}

/* Hide numeric steppers throughout the ledger, including dialogs. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.expense-lines-wrap { min-width: 0; width: 100%; }
.expense-lines-editor, .expense-lines-editor tbody { display: block; width: 100%; border: 0; }
.expense-lines-editor thead { display: none; }
.expense-lines-editor tbody tr { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; padding: 20px; margin-bottom: 16px; border: 1px solid #ccdcd2; border-radius: 12px; background: #f8fbf8; }
.expense-lines-editor td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; }
.expense-lines-editor .expense-line-description { grid-column: span 2; }
.expense-lines-editor label { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.expense-lines-editor input, .expense-lines-editor .combo { width: 100%; min-width: 0; box-sizing: border-box; }
.expense-lines-editor .combo input { flex: 1; width: 0; min-width: 0; }
.expense-lines-editor .expense-line-actions { grid-column: 1 / -1; justify-self: end; }
.expense-line-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
@media (max-width: 700px) {
 .expense-lines-editor tbody tr { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 14px; }
 .expense-lines-editor .expense-line-style, .expense-lines-editor .expense-line-description { grid-column: 1 / -1; }
}
.amount-search { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.amount-search input { width:230px; }
.amount-search select { width:200px; }

/* Expense filters: keep related controls together at every viewport width. */
.filters.expense-filters { display:grid; gap:18px; padding:20px; }
.expense-filters .filter-date-row { display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.expense-filters label { margin:0; }
.expense-filters .filter-date { display:flex; flex-direction:column; gap:7px; flex:0 1 210px; min-width:160px; }
.expense-filters .date-separator { align-self:flex-end; line-height:44px; color:#768579; }
.expense-filters .date-shortcuts { display:flex; gap:8px; }
.expense-filters .filter-search-row { display:grid; grid-template-columns:minmax(180px,1fr) minmax(390px,2fr); gap:16px; }
.expense-filters .filter-style { display:flex; flex-direction:column; gap:7px; min-width:0; }
.expense-filters .filter-caption { display:block; margin-bottom:7px; }
.expense-filters .filter-money { min-width:0; }
.expense-filters .amount-search { display:grid; grid-template-columns:minmax(150px,1fr) minmax(130px,1fr) auto; gap:8px; }
.expense-filters .filter-options-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.expense-filters input:not([type=checkbox]), .expense-filters select, .expense-filters button { height:44px; margin:0; }
.expense-filters input:not([type=checkbox]), .expense-filters select { width:100%; max-width:none; min-width:0; }
.expense-filters button { white-space:nowrap; }
.expense-filters .filter-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding-top:14px; border-top:1px solid #e1e8e2; }
.expense-filters .filter-flags { display:flex; flex-wrap:wrap; gap:20px; }
.expense-filters .filter-flags label { display:flex; align-items:center; gap:7px; white-space:nowrap; }
.expense-filters .filter-flags input { margin:0; width:17px; height:17px; }
@media(max-width:900px) { .expense-filters .filter-search-row { grid-template-columns:1fr; } }
@media(max-width:520px) {
 .filters.expense-filters { padding:14px; gap:14px; }
 .expense-filters .filter-date { flex:1 1 120px; min-width:0; }
 .expense-filters .date-shortcuts { flex-basis:100%; }
 .expense-filters .amount-search { grid-template-columns:1fr 1fr; }
 .expense-filters .amount-search button { grid-column:1 / -1; }
 .expense-filters .filter-options-row { grid-template-columns:1fr; gap:10px; }
}
.customer-split{display:grid;grid-template-columns:minmax(260px,2fr) minmax(160px,1fr) auto;gap:12px;align-items:end;margin:16px 0;padding:16px;border:1px solid #dce5df;border-radius:12px}
@media(max-width:700px){.customer-split{grid-template-columns:1fr}.customer-split button{justify-self:end}}

.expense-sort-row {display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding-top:14px;border-top:1px solid #e1e8e2}
.expense-sort-buttons {display:flex;gap:8px}

.expense-list-toggle td {text-align:center;padding:18px;background:#f5f9f6}
.expense-list-toggle .small {display:block;margin-top:8px}

.subcategory-cards {display:grid;gap:12px;min-width:0;}
.subcategory-card {border:1px solid #d6e2da;border-radius:10px;background:#fff;padding:18px;min-width:0;overflow-wrap:anywhere;white-space:normal;}
.subcategory-card > header {display:flex;justify-content:space-between;align-items:flex-start;gap:16px;background:transparent;color:inherit;padding:0;border:0;position:static;height:auto;min-height:0;box-shadow:none;}
.subcategory-card > header > strong {white-space:nowrap;font-size:20px;}
.subcategory-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0;}
.subcategory-metrics span {display:block;color:#6b7e73;font-size:13px;margin-bottom:6px;}
.subcategory-metrics strong {font-weight:500;}
.subcategory-card details {min-width:0;max-width:100%;margin:0;height:auto;min-height:0;}
.subcategory-card summary {cursor:pointer;white-space:normal;color:#155d4b;}
.subcategory-card details p {white-space:normal;overflow-wrap:anywhere;}
@media(max-width:600px){.subcategory-metrics{grid-template-columns:1fr 1fr}.subcategory-card > header{flex-wrap:wrap}}

.monthly-check-table{max-height:65vh;background:white}.monthly-check-table table{min-width:1250px}.monthly-check-table th{position:sticky;top:0;background:#d7eddf;z-index:1;white-space:nowrap}.monthly-check-table td{vertical-align:top;padding:12px;min-width:56px}.monthly-check-table td:last-child{min-width:260px}.monthly-check-table .monthly-warning{background:#fff2e8}.monthly-check-table .monthly-skipped{color:#718078;background:#f0f2f1}.monthly-check-table tr[hidden]{display:none}

.recon-edit-details{margin:16px 0}.recon-edit-details>summary{padding:14px;background:#edf3ef;border-radius:8px;cursor:pointer}.monthly-check-table table{min-width:1000px}.monthly-check-table td:last-child{min-width:180px}

.monthly-factory-ledger {scroll-margin-top:20px}.factory-bill {padding:10px 0;border-bottom:1px solid #e1e8e2}.factory-bill .small {display:block;margin:6px 0}.factory-ledger-drop {display:block;min-width:170px;padding:16px;border:2px dashed #9fbaa8;border-radius:10px;background:#f5f9f6;cursor:pointer;text-align:center}.factory-ledger-drop input {display:block;max-width:200px;margin-top:10px}.monthly-factory-ledger .filters {align-items:end;flex-wrap:wrap}

.style-filter-suggestions {position:fixed;z-index:10000;max-height:270px;overflow:auto;padding:6px;background:white;border:1px solid #b4c8bc;border-radius:10px;box-shadow:0 6px 22px #203d3626;box-sizing:border-box}.style-filter-suggestions button {display:block;width:100%;text-align:left;border:0;margin:0;padding:10px 12px;background:white;color:#203d36}.style-filter-suggestions button:hover,.style-filter-suggestions button:focus {background:#e8f1ec}.style-filter-suggestions .small {display:block;padding:10px}

.style-filter-control {display:flex;align-items:stretch;min-width:0;width:100%}.expense-filters .style-filter-control input {flex:1;min-width:0;border-radius:8px 0 0 8px}.expense-filters .style-filter-control button {flex:0 0 42px;padding:0;border-radius:0 8px 8px 0;border-left:0;background:#edf4ee}

/* Reconciliation categories: only the selected workspace is visible. */
.recon-section-tabs{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0 24px;padding-bottom:16px;border-bottom:1px solid #d8e4dc}
.recon-section-tabs button{font-weight:600}
[data-recon-panel][hidden]{display:none!important}
[data-recon-panel]>h2:first-child{margin-top:0}

.factory-month-summary{margin:24px 0}
.factory-month-summary tfoot{background:#e3eee7;font-weight:600}
.factory-month-summary td:last-child,.factory-month-summary th:last-child{text-align:right;white-space:nowrap}

.batch-style-photo {width:56px;height:64px;object-fit:contain;vertical-align:middle;margin-right:10px;border-radius:6px;background:#f1f5ef}

.shipment-month-picker{padding:12px;border:1px solid #cadbd0;border-radius:10px;background:white}
.shipment-month-options{display:flex;flex-wrap:wrap;gap:16px;max-width:650px;margin-top:12px}
.shipment-month-options label{display:flex;align-items:center;gap:8px}
.shipment-month-options input{width:auto}

.choice-popup .choice-option-row{display:flex;align-items:center}
.choice-popup .choice-option-row>button:first-child{flex:1;min-width:0}
.choice-popup .choice-option-row>.choice-remove{width:40px;flex:0 0 40px;text-align:center;color:#ad4337;font-size:24px;padding:6px}
.operator-list{display:grid;gap:10px;margin:12px 0 24px}.operator-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border:1px solid #d8e4dc;border-radius:12px;background:#fff}.operator-card .actions{margin:0}.operator-card .small{margin-top:5px}
