.material-entry-links{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:18px}
/* A visible, equal-weight choice of receipt kind, not a small help link. */
.ledger-shell #app .receipt-kind-tabs{display:flex;gap:0;align-items:stretch;flex-wrap:wrap;border-bottom:1px solid #c8d6e1;margin:0 0 12px;padding:0;background:#f6f8fa}
.ledger-shell #app .receipt-kind-tabs>:is(button,strong){display:block;flex:0 1 auto;width:auto;min-width:132px;min-height:44px;box-sizing:border-box;margin:0;padding:10px 20px;border:0;border-bottom:3px solid transparent;border-radius:0;font:600 17px/1.35 "Microsoft YaHei",sans-serif;white-space:nowrap;background:transparent;color:#304858;box-shadow:none}
.ledger-shell #app .receipt-kind-tabs>[aria-current=page]{border-bottom-color:#176fab;color:#125786;background:white}
.ledger-shell #app .receipt-kind-tabs>button:hover{background:#e5eff6}
.ledger-shell #app .receipt-kind-tabs>button:focus-visible{outline:2px solid #176fab;outline-offset:-3px}
@media(max-width:600px){.ledger-shell #app .receipt-kind-tabs>:is(button,strong){flex:1;min-width:0;padding:10px 8px;font-size:16px}}
.ledger-shell #app .material-page #matEntryTable col:first-child{width:52px}
.ledger-shell #app .material-page #matEntryTable th:first-child{white-space:nowrap}
.ledger-shell #app .material-page .mat-fields :is(input,.editable-choice){height:38px;min-height:38px;font-size:16px}
.ledger-shell #app .material-page .mat-fields label{line-height:1.4;font-weight:500}
@media(max-width:700px){.ledger-shell #app .material-page .mat-fields :is(input,.editable-choice){height:44px;min-height:44px}}
.material-page{width:100%;min-width:0;font-size:17px;color:#203e35}
.material-page .mat-panel{background:#fff;border:1px solid #dbe4df;border-radius:10px;padding:20px;margin-bottom:18px;min-width:0}
.material-page h2{font-size:24px;margin:0 0 12px}.material-page p{margin:10px 0;line-height:1.5}
.material-page .mat-toolbar{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:12px 0}
.material-page .mat-detail-actions,.material-page .mat-history-scopes{display:flex;gap:8px;flex-wrap:wrap;min-width:0;max-width:100%}
.material-page .mat-detail-actions button,.material-page .mat-history-scopes button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.material-page .mat-history-scopes button[aria-pressed=true]{background:#176fab;color:#fff;border-color:#176fab}
.material-page #matHistoryCount{font-size:15px;color:#536775;overflow-wrap:anywhere}
.material-page .mat-history-query{display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin:12px 0 4px}
.material-page .mat-history-query .mat-history-search{flex:1 1 260px;max-width:640px}
.material-page .mat-history-query button{flex:0 0 auto;max-width:100%;white-space:normal}
.material-page #matSearchStatus{min-height:1.5em;overflow-wrap:anywhere}
.material-page #matSearchStatus[data-state=error]{color:#a32222}
.material-page .mat-history-materials div{overflow-wrap:anywhere;line-height:1.5}
.material-page .mat-history-materials div+div{margin-top:5px}
.material-page .mat-history-materials strong{font-weight:500}
.material-page #matHistoryStock[hidden],.material-page #matHistoryDrafts[hidden],.material-page #matDeletedNote[hidden]{display:none!important}
.material-page .mat-fields{display:grid;grid-template-columns:160px minmax(220px,1fr) minmax(180px,1fr);gap:16px;align-items:start}
.material-page label{display:flex;flex-direction:column;gap:6px;min-width:0}
.material-page input,.material-page textarea{font:inherit;min-width:0;width:100%;min-height:44px;box-sizing:border-box}
.material-page button{font:inherit;min-height:44px}.material-page .mat-note{color:#546b63;font-size:15px}.material-page .mat-error{color:#ab2424;white-space:pre-wrap}
.material-page .mat-scroll{overflow:auto;max-width:100%;border:1px solid #bfcfc6;margin:12px 0;max-height:65vh;overscroll-behavior:contain}
.material-page table.mat-grid{width:100%;min-width:1030px;border-collapse:collapse;table-layout:fixed;margin:0}
.material-page #matEntryTable col:nth-child(1){width:38px}.material-page #matEntryTable col:nth-child(2){width:190px}.material-page #matEntryTable col:nth-child(3){width:110px}.material-page #matEntryTable col:nth-child(4){width:85px}.material-page #matEntryTable col:nth-child(5){width:110px}.material-page #matEntryTable col:nth-child(6){width:110px}.material-page #matEntryTable col:nth-child(7){width:110px}.material-page #matEntryTable col:nth-child(8){width:130px}.material-page #matEntryTable col:nth-child(9){width:64px}
.material-page table.mat-grid thead{display:table-header-group}.material-page table.mat-grid tbody{display:table-row-group}.material-page table.mat-grid tr{display:table-row;background:none;border:0;box-shadow:none}
.material-page table.mat-grid th,.material-page table.mat-grid td{display:table-cell;vertical-align:middle;border:1px solid #d8e2dc;padding:5px 7px;text-align:left;word-break:normal;white-space:normal;overflow-wrap:anywhere;font-size:16px;min-width:0}
.material-page table.mat-grid th{position:sticky;top:0;background:#e9f3ed;z-index:1;font-weight:600;height:38px}.material-page table.mat-grid td:before{display:none}.material-page table.mat-grid tbody tr:nth-child(even){background:#f6faf7}
.material-page .mat-grid input{border:1px solid transparent;border-radius:0;background:transparent;box-shadow:none;padding:6px 2px;min-height:40px;font-size:16px;height:40px;width:100%}
.material-page .mat-grid input:focus{outline:2px solid #11805c;outline-offset:-1px;background:#fff}.material-page .mat-grid .mat-amount{font-variant-numeric:tabular-nums;text-align:right}
.material-page .mat-grid button{padding:4px 8px;min-width:36px;min-height:36px;border-radius:3px}
.material-page .mat-editbar{display:grid;grid-template-columns:100px 1fr;align-items:start;gap:8px;background:#f4f7f5;border:1px solid #d8e2dc;padding:8px}
.material-page .mat-editbar textarea{height:44px;resize:vertical;line-height:1.4;border-radius:2px}.material-page .mat-locked{background:#fff5d9;padding:10px}
.mat-choices{position:fixed;z-index:9999;box-shadow:0 8px 24px #163b352c;background:#fff;border:1px solid #b6d0c3;border-radius:6px;overflow-y:auto;padding:4px;box-sizing:border-box}
.mat-choices[hidden]{display:none!important}.mat-choices button{display:block;min-height:44px;width:100%;background:#fff;color:#153d31;text-align:left;padding:8px;font-size:16px;border:0;border-radius:2px;white-space:normal;overflow-wrap:anywhere}.mat-choices button:hover,.mat-choices button[aria-selected=true]{background:#e4f4ea}.mat-choices .mat-message{padding:10px;display:block;color:#53665f}
.material-page .mat-status{display:inline-block;padding:3px 8px;border-radius:4px;background:#fff1d1;white-space:nowrap}.material-page .mat-status[data-state=已付清]{background:#dff3e7}.material-page .mat-status[data-state=已作废]{background:#ecefed;color:#67746b}
.material-page .mat-total{font-weight:700;font-size:20px}.material-page a{color:#067553;text-decoration:underline}.material-page .mat-history-search{max-width:480px}
.material-page .mat-drafts{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:8px 0 14px;padding:10px 12px;background:#f4f7f5;border:1px solid #d8e2dc;font-size:14px}
.material-page .mat-drafts label{display:flex;flex:1 1 260px;flex-direction:row;align-items:center;gap:8px;min-width:0}
.material-page .mat-drafts label>span{white-space:nowrap;flex:0 0 auto}
.material-page .mat-drafts .editable-choice{flex:1;min-width:0;width:auto}
.ledger-shell #app .material-page .mat-drafts :is(.editable-choice,input){height:40px;min-height:40px;font-size:16px}
.material-page .mat-drafts select{flex:1;min-width:0;max-width:100%;height:40px;padding:6px;font:inherit}
.material-page .mat-drafts button{font-size:15px;min-height:40px;white-space:nowrap}
@media(max-width:700px){.material-page .mat-drafts{padding:8px}.material-page .mat-drafts label{flex-basis:100%;flex-direction:column;align-items:stretch}.material-page .mat-drafts select{min-height:44px;width:100%}.ledger-shell #app .material-page .mat-drafts :is(.editable-choice,input){height:44px;min-height:44px}}
@media(max-width:1100px){.material-page .mat-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.material-page .mat-fields>label:nth-child(3){grid-column:1/-1}}
@media(max-width:700px){.material-page .mat-panel{padding:12px}.material-page .mat-fields{grid-template-columns:1fr}.material-page h2{font-size:22px}.material-page .mat-toolbar{align-items:stretch}.material-page .mat-scroll{max-height:64vh}.material-page .mat-editbar{grid-template-columns:78px 1fr}.material-page button{min-height:46px}}
@media print{.material-entry-links,.material-page button,.material-page .mat-editbar{display:none!important}.material-page .mat-scroll{max-height:none;overflow:visible}.material-page table.mat-grid{min-width:0}.material-page .mat-panel{border:0}}

/* Q42: explicit corrections in a compact ledger, without changing other pages. */
.ledger-shell #app .material-master-panel{min-width:0;padding:16px}
.material-master-panel .material-master-search{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:16px 0 10px}
.material-master-search label{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1 1 180px}
.material-master-search label:first-child{flex:2 1 260px}
.material-master-search #masterFindCount{font-size:15px;align-self:center}
.material-master-scroll{max-width:100%;overflow:auto;border:1px solid #ccd7df;max-height:65vh;overscroll-behavior:contain}
.ledger-shell #app #materialMasterTable{width:100%;min-width:820px;table-layout:fixed;border-collapse:collapse;margin:0}
.ledger-shell #app #materialMasterTable thead{display:table-header-group}
.ledger-shell #app #materialMasterTable tbody{display:table-row-group}
.ledger-shell #app #materialMasterTable tr{display:table-row;background:#fff;box-shadow:none}
.ledger-shell #app #materialMasterTable tr[hidden]{display:none!important}
.ledger-shell #app #materialMasterTable th,.ledger-shell #app #materialMasterTable td{display:table-cell;border:1px solid #d8e0e5;padding:8px 10px;vertical-align:middle;text-align:left;white-space:normal;overflow-wrap:anywhere;font-size:16px;line-height:1.5}
.ledger-shell #app #materialMasterTable th{white-space:nowrap}
.ledger-shell #app #materialMasterTable td:nth-child(4){white-space:nowrap;overflow-wrap:normal;font-variant-numeric:tabular-nums}
.ledger-shell #app #materialMasterTable td::before{display:none}
.ledger-shell #app #materialMasterTable th{background:#edf2f6;position:sticky;top:0;z-index:2}
.ledger-shell #app #materialMasterTable th:first-child{width:21%}
.ledger-shell #app #materialMasterTable th:nth-child(2){width:15%}
.ledger-shell #app #materialMasterTable th:nth-child(3){width:12%}
.ledger-shell #app #materialMasterTable th:nth-child(4){width:15%}
.ledger-shell #app #materialMasterTable th:nth-child(5){width:10%}
.ledger-shell #app #materialMasterTable th:last-child{width:235px}
.ledger-shell #app #materialMasterTable tbody tr:nth-child(even){background:#f7f9fa}
.ledger-shell #app #materialMasterTable small{display:block;font-size:13px;line-height:1.4;color:#5e707d;overflow-wrap:anywhere}
.ledger-shell #app #materialMasterTable .material-master-actions{white-space:normal}
.ledger-shell #app #materialMasterTable .material-master-actions button{display:inline-block;min-width:52px;min-height:40px;width:auto;margin:2px;padding:6px 8px;font-size:16px;white-space:nowrap}
.material-page .mat-receipt-number{display:block;font-size:13px;overflow-wrap:anywhere;color:#5b6c76}
.material-page #matHistoryTable td:last-child button{display:block;width:100%;margin:3px 0;min-height:40px;white-space:normal}
#dialog .material-correction-dialog{width:min(620px,calc(100vw - 32px));max-width:100%;max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;color:#213f48}
#dialog .material-correction-dialog h2{font-size:24px;line-height:1.4;margin:0 0 12px}
#dialog .material-correction-dialog p{font-size:16px;line-height:1.65;overflow-wrap:anywhere}
#dialog .material-correction-dialog>label{display:flex;flex-direction:column;gap:6px;margin-top:14px;font-size:17px}
#dialog .material-correction-dialog textarea{box-sizing:border-box;width:100%;min-height:90px;resize:vertical;font-size:17px;line-height:1.5}
#dialog .material-correction-dialog .material-correction-check{display:flex;flex-direction:row;align-items:flex-start;gap:10px}
#dialog .material-correction-dialog .material-correction-check input{width:22px;min-width:22px;height:22px;min-height:22px;margin:3px 0;flex:0 0 22px}
#dialog .material-correction-dialog .material-correction-check span{line-height:1.6}
#dialog .material-correction-dialog .dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:18px}
#dialog .material-correction-dialog button{min-height:44px;font-size:16px;white-space:normal}
#dialog .material-correction-dialog [hidden]{display:none!important}
#dialog .material-correction-summary{display:grid;grid-template-columns:100px minmax(0,1fr);gap:8px 12px;background:#f4f7f9;border:1px solid #d8e0e5;padding:14px;font-size:17px;line-height:1.5}
#dialog .material-correction-summary dt{color:#5b6c76}
#dialog .material-correction-summary dd{margin:0;font-weight:600;overflow-wrap:anywhere}
#dialog .mat-correction-warning{background:#fff3d5;border:1px solid #ecd59f;padding:12px;line-height:1.65;color:#775210}
@media(max-width:700px){
  .ledger-shell #app .material-page .receipt-kind-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;max-width:100%}
  .ledger-shell #app .material-page .receipt-kind-tabs>:is(button,strong){width:100%;max-width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere;padding:10px 8px}
  .ledger-shell #app .material-page .receipt-kind-tabs>#matManageMasters{grid-column:1/-1}
  .ledger-shell #app .material-master-panel{padding:10px}
  .material-master-search label{flex-basis:100%}
  /* Use the real worksheet width before fixed-column layout, not 100% of a narrow viewport. */
  .ledger-shell #app #materialMasterTable{width:820px;min-width:820px}
  .ledger-shell #app #materialMasterTable th:first-child{width:200px}
  .ledger-shell #app #materialMasterTable th:nth-child(2){width:170px}
  .ledger-shell #app #materialMasterTable th:nth-child(3){width:90px}
  .ledger-shell #app #materialMasterTable th:nth-child(4){width:140px}
  .ledger-shell #app #materialMasterTable th:nth-child(5){width:110px}
  .ledger-shell #app #materialMasterTable th:last-child,.ledger-shell #app #materialMasterTable td:last-child{position:sticky;right:0;background:#f5f8fa;border-left:2px solid #ccd7df;z-index:1;width:110px}
  .ledger-shell #app #materialMasterTable th:last-child{z-index:3}
  .ledger-shell #app #materialMasterTable .material-master-actions button{display:block;width:100%;min-height:44px;margin:4px 0}
  #dialog .material-correction-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:16px}
  #dialog .material-correction-dialog .dialog-actions button{flex:1 1 130px}
  #dialog .material-correction-summary{grid-template-columns:80px minmax(0,1fr);padding:10px;font-size:16px}
}
@media print{.material-master-panel .material-master-search,.material-master-panel .material-master-actions,.material-master-panel #foundationForm{display:none!important}.material-master-panel .material-master-scroll{overflow:visible;max-height:none}}
