/* v0.3.64 — scoped layout and KLM; all original PDF/event code is retained. */
body.ed-klm-layout .app-shell{display:block;min-width:0}
body.ed-klm-layout .sidebar{position:relative!important;left:auto!important;top:auto!important;bottom:auto!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;display:flex!important;flex-direction:row!important;align-items:center;flex-wrap:wrap;gap:10px 20px;padding:12px 22px;box-sizing:border-box;z-index:20}
body.ed-klm-layout .sidebar .brand{display:flex!important;margin:0!important;padding:0!important;min-width:152px;gap:10px}
body.ed-klm-layout .brand>div:last-child{display:flex!important;flex-direction:column}
body.ed-klm-layout .sidebar nav{display:flex!important;flex-direction:row!important;flex-wrap:wrap;align-items:center;gap:3px;flex:1;margin:0!important}
body.ed-klm-layout .sidebar nav a{display:flex;gap:6px;padding:9px 10px!important;font-size:12px!important;justify-content:flex-start!important;white-space:nowrap}
body.ed-klm-layout .sidebar nav span{display:inline!important}
body.ed-klm-layout .sidebar-bottom{display:flex;flex-direction:row;align-items:center;gap:12px;margin:0!important;flex-wrap:wrap}
body.ed-klm-layout .sidebar-bottom .zsoft-partner-mark{width:auto!important;margin:0!important;padding:0!important;border:0!important;font-size:11px!important}
body.ed-klm-layout .sidebar .user-chip{margin:0;gap:6px}
body.ed-klm-layout .user-chip div{display:block!important}
body.ed-klm-layout .user-chip .avatar{width:26px;height:26px;font-size:11px}
body.ed-klm-layout .sidebar-bottom button{padding:8px 10px;font-size:12px}
body.ed-klm-layout .main{margin:0!important;width:100%!important;max-width:100%;min-width:0}
body.ed-klm-layout .topbar{min-height:62px;height:auto;flex-wrap:wrap;padding:12px 22px;gap:10px;box-sizing:border-box}
body.ed-klm-layout .mobile-menu{display:none!important}
body.ed-klm-layout .content{max-width:100%;min-width:0;box-sizing:border-box;padding:20px 22px}
body.ed-klm-layout .doc-layout{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(390px,550px)!important;gap:16px!important;width:100%;min-width:0}
body.ed-klm-layout .doc-layout>section{width:auto!important;min-width:0;max-width:100%;box-sizing:border-box}
body.ed-klm-layout .panel{min-width:0;box-sizing:border-box}
body.ed-klm-layout .form-actions,body.ed-klm-layout .heading-actions{flex-wrap:wrap}
.klm-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin:12px 0}
.klm-bottom{justify-content:flex-end;margin-top:16px}
.klm-expand{margin-top:16px}.klm-expand[hidden]{display:none!important}
.klm-view{width:100%;max-width:100%;min-width:0}
.klm-scroll{max-height:580px;overflow:auto;max-width:100%;border:1px solid #d9e5e1;border-radius:8px}
.klm-client-table{min-width:1280px;width:100%;table-layout:fixed}
.klm-client-table th:nth-child(4){width:200px}.klm-client-table th:nth-child(3){width:102px}.klm-client-table th:nth-child(6){width:56px}.klm-client-table th:nth-child(5){width:108px}
.klm-calculation-table{min-width:1960px;table-layout:fixed;width:100%}
.klm-calculation-table colgroup{display:none}
.klm-calculation-table th:nth-child(1){width:44px}.klm-calculation-table th:nth-child(2){width:80px}.klm-calculation-table th:nth-child(3){width:280px}.klm-calculation-table th:nth-child(4){width:54px}.klm-calculation-table th:nth-child(11),.klm-calculation-table th:nth-child(17){width:150px}
.klm-full-table{min-width:2900px}.klm-full-table .klm-name{min-width:230px}
.klm-scroll th{white-space:normal;text-transform:none;letter-spacing:0;line-height:1.4;font-size:11px;background:#edf7f3;position:sticky;top:0;z-index:2;vertical-align:middle}
.klm-scroll td{vertical-align:top!important;padding:9px 7px;white-space:normal;font-size:12px;word-break:normal;overflow-wrap:normal}
.klm-name{white-space:normal!important;word-break:normal!important;line-height:1.45}
.klm-cell{display:grid;grid-template-rows:36px minmax(16px,auto) minmax(16px,auto);gap:2px;min-width:0;align-content:start;align-items:start}
.klm-value{display:flex;align-items:center;justify-content:flex-end;height:36px;font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}
.klm-origin,.klm-field-state{font-size:10px!important;line-height:16px;min-height:16px;color:#73847e!important;font-weight:400;white-space:normal!important;margin:0!important}
.klm-sales-input{height:36px!important;width:100%!important;max-width:132px;min-width:75px;box-sizing:border-box;padding:7px!important;border:1px solid #bacfc7;border-radius:6px;text-align:right;font-size:12px;font-variant-numeric:tabular-nums;background:white;color:#183c30}
[data-klm-dirty='1']{outline:2px solid #d3a539;outline-offset:1px}
.klm-margin-negative{color:#b52530!important;background:#fff0f1!important;border-color:#d9a5a9!important}
.klm-margin-low{color:#855600!important;background:#fff2c9!important;border-color:#d5b970!important}
.klm-head-grid{display:grid;grid-template-columns:1fr 1.4fr 1fr;gap:10px;margin-bottom:14px}
.klm-head-grid>section{padding:12px;border:1px solid #b8c9c1;border-radius:8px;min-width:0}
.klm-head-grid h3{font-size:15px;margin:0 0 10px;white-space:normal}
.klm-head-grid p{margin:5px 0;font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.klm-form-caption{text-align:right;color:#6d8178;font-size:10px;margin-bottom:6px}
.klm-totals td,.klm-totals th{background:#edf4f0!important;font-weight:700;text-align:right;font-variant-numeric:tabular-nums}
.klm-totals th{text-align:left}.klm-source-link{font-size:11px;padding:7px 0}
.klm-recap-row{display:flex;justify-content:space-between;gap:30px;align-items:flex-end}
.klm-recap{width:min(530px,100%);white-space:normal;border:1px solid #c7d5ce}
.klm-recap th,.klm-recap td{padding:7px 9px;font-size:11px}.klm-recap td:last-child{text-align:right;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.klm-recap small{font-size:9px}.klm-stamp{white-space:nowrap;font-size:12px;margin:20px 30px}
.klm-draft{margin-top:16px;padding:10px;border-left:3px solid #b77e24;background:#fff9ec;color:#715221;font-size:11px;line-height:1.5}
.klm-draft p{margin:5px 0 0}.klm-info{display:flex;align-items:center;gap:14px;justify-content:space-between;padding:10px 12px;background:#f5f8f6;border:1px solid #d9e3de;border-radius:8px;font-size:12px;margin:10px 0}
.klm-info button{flex-shrink:0}.klm-message{padding:10px 12px;border:1px solid #d8e4df;border-radius:7px;background:#f1f8f4;font-size:12px;color:#24553e;white-space:normal}
.klm-message.error{background:#fff3f3;border-color:#e7c4c7;color:#912d38}
.klm-restore-button{color:#8b4b2b!important;border-color:#d8c0af!important}
.klm-dialog{width:min(820px,calc(100vw - 40px));max-height:85vh;box-sizing:border-box;padding:24px;border:1px solid #bacfc5;border-radius:14px;color:#183b2f;background:white;box-shadow:0 20px 65px #0004}
.klm-dialog::backdrop{background:#123b2d77}.klm-dialog h2{font-size:20px;margin:0 0 12px}.klm-dialog p{font-size:13px;line-height:1.6;white-space:pre-line}
.klm-dialog table{width:100%;font-size:12px;white-space:normal}.klm-dialog th{font-size:11px;text-transform:none}.klm-dialog td,.klm-dialog th{padding:7px}
.klm-preview-scroll{max-height:260px;overflow:auto;border:1px solid #dbe5df}.klm-ack{display:flex;gap:8px;align-items:center;margin:18px 0;font-size:13px;font-weight:700}.klm-ack input{width:18px;height:18px}.klm-dialog .klm-actions{justify-content:flex-end}
body.ed-klm-layout .items-table td{vertical-align:top!important}
body.ed-klm-layout .items-table td>input{height:36px!important;box-sizing:border-box}
body.ed-klm-layout .items-table td small{min-height:16px;line-height:16px;white-space:normal;font-size:10px}
body.ed-klm-layout .items-table td{min-width:80px}.items-table .wide-input{min-width:210px}
#klm-print-root{display:none}
@media(max-width:1000px){body.ed-klm-layout .doc-layout{grid-template-columns:minmax(0,1fr)!important}.klm-head-grid{grid-template-columns:1fr}.klm-recap-row{flex-direction:column;align-items:stretch}.klm-info{flex-direction:column;align-items:flex-start}.klm-stamp{margin:12px 0}.klm-dialog{padding:16px}}
@media print{
 @page{size:A4 landscape;margin:8mm}
 html,body{width:auto!important;min-width:0!important;height:auto!important;overflow:visible!important;background:white!important}
 body.klm-printing{font-size:0!important;line-height:0!important}
 body.klm-printing>*{display:none!important}
 body.klm-printing>#klm-print-root{display:block!important}
 #klm-print-root{font:8px Arial,sans-serif!important;color:#111;background:white;width:100%}
 .klm-print-sheet{width:100%;font-size:8px;page-break-after:auto}
 .klm-print-sheet .klm-form-caption{font-size:8px;color:#222}
 .klm-print-sheet .klm-head-grid{display:grid!important;grid-template-columns:1fr 1.4fr 1fr;gap:2mm;break-inside:avoid;margin:0 0 3mm}
 .klm-print-sheet .klm-head-grid>section{border:.25mm solid #555;border-radius:2mm;padding:2mm}
 .klm-print-sheet .klm-head-grid h3{font-size:12px;margin:0 0 2mm;color:#111}
 .klm-print-sheet .klm-head-grid p{font-size:8px;line-height:1.3;margin:1mm 0;color:#111}
 .klm-print-table{table-layout:fixed;width:100%;border-collapse:collapse;white-space:normal}
 .klm-print-table thead{display:table-header-group}
 .klm-print-table th,.klm-print-table td{border:.18mm solid #888!important;padding:1mm .8mm!important;vertical-align:middle;font-size:7.6px!important;line-height:1.35;white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;text-transform:none!important;letter-spacing:0!important;color:#111}
 .klm-print-table th{background:#eff7d1!important;text-align:center;font-weight:bold;position:static!important}
 .klm-print-table td{text-align:right;font-variant-numeric:tabular-nums}
 .klm-print-table .klm-name{text-align:left}
 .klm-print-table tr{break-inside:avoid;page-break-inside:avoid}
 .klm-print-table .klm-totals{break-inside:avoid}
 .klm-print-sheet .klm-recap-row{display:flex;flex-direction:row;align-items:flex-end;break-inside:avoid;gap:10mm}
 .klm-print-sheet .klm-recap{width:95mm;font-size:9px;border:.18mm solid #888}
 .klm-print-sheet .klm-recap td,.klm-print-sheet .klm-recap th{border:.18mm solid #888;padding:1mm 2mm;font-size:8px}
 .klm-print-sheet .klm-recap small{font-size:7px}
 .klm-print-sheet .klm-stamp{font-size:10px}
 .klm-print-sheet .klm-source-link{font-size:8px;margin:1mm 0;padding:1mm 0}.klm-print-sheet a{color:#111;text-decoration:none}
 .klm-print-sheet .klm-draft{font-size:8px;break-inside:avoid;padding:1mm 2mm;margin-top:2mm}
 .klm-print-draft{margin:1mm 0 2mm;font-size:9px;color:#8a3030}
 .klm-print-footer{font-size:7px;color:#555;margin-top:3mm}
 .klm-print-sheet *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

body.ed-klm-layout .user-chip b,body.ed-klm-layout .user-chip small{display:block;line-height:1.35}
body.ed-klm-layout .sidebar-bottom .zsoft-partner-mark{color:#92b8b1;white-space:nowrap}
.klm-calculation-table td:last-child,.klm-calculation-table th:last-child{position:sticky;right:0;z-index:3;background:#f8fbf9;box-shadow:-2px 0 3px #1232}
.klm-calculation-table th:last-child{z-index:5;background:#edf7f3}

.klm-preview-scroll table{width:100%;table-layout:fixed}.klm-preview-scroll th:nth-child(1){width:9%}.klm-preview-scroll th:nth-child(2){width:27%}.klm-preview-scroll th:nth-child(3),.klm-preview-scroll th:nth-child(4){width:18%}.klm-preview-scroll td{white-space:normal;overflow-wrap:anywhere}

/* ED 2026-09-08: editable invoice-source values for client portal. */
.klm-client-table.klm-client-editable{min-width:2060px;width:2060px;table-layout:fixed}
.klm-client-table.klm-client-editable th:nth-child(1){width:48px}
.klm-client-table.klm-client-editable th:nth-child(2){width:92px}
.klm-client-table.klm-client-editable th:nth-child(3){width:92px}
.klm-client-table.klm-client-editable th:nth-child(4){width:110px}
.klm-client-table.klm-client-editable th:nth-child(5){width:250px}
.klm-client-table.klm-client-editable th:nth-child(6){width:110px}
.klm-client-table.klm-client-editable th:nth-child(7){width:56px}
.klm-client-table.klm-client-editable th:nth-child(8){width:86px}
.klm-client-table.klm-client-editable th:nth-child(9){width:110px}
.klm-client-table.klm-client-editable th:nth-child(10),.klm-client-table.klm-client-editable th:nth-child(11),.klm-client-table.klm-client-editable th:nth-child(12),.klm-client-table.klm-client-editable th:nth-child(13){width:84px}
.klm-client-table.klm-client-editable th:nth-child(14){width:116px}
.klm-client-table.klm-client-editable th:nth-child(15){width:126px}
.klm-client-table.klm-client-editable th:nth-child(16){width:70px}
.klm-client-table.klm-client-editable th:nth-child(17){width:104px}
.klm-client-table.klm-client-editable th:nth-child(18){width:126px}
.klm-client-table.klm-client-editable td{min-width:0;box-sizing:border-box}
.klm-client-table.klm-client-editable td:nth-child(1){text-align:center;font-weight:800;white-space:nowrap}
.klm-client-table.klm-client-editable td:nth-child(5){white-space:normal;line-height:1.35}
.klm-client-table.klm-client-editable td:not(:nth-child(5)){overflow-wrap:anywhere}
.klm-client-table.klm-client-editable .klm-invoice-input,.klm-client-table.klm-client-editable .klm-sales-input{min-width:0!important;max-width:100%!important;width:100%!important}
.klm-client-table.klm-client-editable .klm-origin,.klm-client-table.klm-client-editable .klm-field-state{font-size:9px!important;line-height:13px;min-height:13px}
.klm-client-table.klm-client-editable .klm-cell{grid-template-rows:34px minmax(13px,auto) minmax(13px,auto);gap:1px}
.klm-invoice-input{height:34px;width:100%;min-width:72px;box-sizing:border-box;padding:7px 8px;border:1px solid #bacfc7;border-radius:7px;text-align:right;background:#fff;color:#183c30;font-variant-numeric:tabular-nums}
.klm-invoice-input:focus{outline:2px solid rgba(84,200,173,.22);border-color:var(--mint)}
.klm-invoice-edit-cell .klm-origin,.klm-invoice-edit-cell .ed-math-delta{font-size:9px}
.klm-client-savebar{display:flex;align-items:center;justify-content:flex-end;gap:14px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.klm-client-savebar .ed-math-confirm{display:flex;align-items:center;gap:8px;margin-right:auto;font-weight:700;color:#4d6762}
.ui365-price-loading{padding:28px 16px;text-align:center;color:var(--muted);font-weight:700}

/* 0.3.80.9 — line review classification */
.ed-line-review-summary{display:flex;align-items:center;gap:10px 16px;flex-wrap:wrap;margin:10px 0 12px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#f8fbfa;font-size:12px}
.ed-line-review-summary>span{white-space:nowrap}.ed-line-review-actions{margin-left:auto;display:flex;gap:8px}
.ed-line-review-badge{display:inline-flex;align-items:center;margin:5px 0 0 6px;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}
.ed-line-review-message{display:block;margin-top:5px;line-height:1.35;max-width:520px}
.ed-line-review-verified .ed-line-review-badge{background:#eaf7f1;color:#23634f}
.ed-line-review-rounding_review{background:#fffaf0}.ed-line-review-rounding_review .ed-line-review-badge{background:#fff0bd;color:#795b00}
.ed-line-review-reading_review{background:#fff5f4}.ed-line-review-reading_review .ed-line-review-badge{background:#ffe0dd;color:#922f26}
.ed-line-review-missing_input{background:#fff7f2}.ed-line-review-missing_input .ed-line-review-badge{background:#ffe8d9;color:#85471f}
.klm-invoice-input.ed-line-review-suspect{border-color:#d95b50;box-shadow:0 0 0 2px rgba(217,91,80,.12)}
.klm-invoice-input.ed-line-review-suspect:focus{border-color:#bd4036;outline:2px solid rgba(217,91,80,.18)}
@media(max-width:900px){.ed-line-review-actions{margin-left:0;width:100%}.ed-line-review-actions button{flex:1}}
