.sales-tabs,.sale-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:18px}.sale-controls form{margin:0}.sales-list td,.sales-list th{padding:8px}.sales-list td{font-variant-numeric:tabular-nums}.money{text-align:right;white-space:nowrap}.sales-editor,.sales-controls-panel{padding:22px;margin:20px 0}.sales-lines{min-width:1100px;table-layout:fixed}.sales-lines th,.sales-lines td{padding:4px}.sales-lines th:nth-child(1){width:95px}.sales-lines th:nth-child(2){width:210px}.sales-lines th:nth-child(3){width:75px}.sales-lines th:nth-child(4){width:60px}.sales-lines th:nth-child(5),.sales-lines th:nth-child(6){width:105px}.sales-lines th:nth-child(7){width:65px}.sales-lines th:nth-child(8){width:92px}.sales-lines th:last-child{width:44px}.sales-lines input,.sales-lines select{padding:8px 5px;min-height:44px}.sales-product-pick{margin:22px 0}.sales-product-pick>div{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.sales-payment-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.sale-payment{padding:14px;border-bottom:1px solid #dce8f2}.sales-danger{margin-top:25px;padding-top:18px;border-top:1px solid #ead2d7}.sales-danger input[type=checkbox],.sale-consent input,.sales-months input{width:22px;min-height:22px;vertical-align:middle}.sale-consent{display:flex;gap:12px;align-items:center;margin:18px 0}.sale-signature{display:block;width:100%;max-width:700px;height:200px;border:2px solid #8cbde7;border-radius:8px;touch-action:none;background:#fff;margin:16px 0}.sales-months{display:flex;flex-wrap:wrap;gap:10px}.sales-period{display:flex;gap:12px;align-items:flex-end;margin-bottom:15px}.sales-period label{max-width:140px}.sales-period select{max-width:260px}.sales-stats strong{font-size:23px}.sales-revisions{margin:20px 0}.sale-sheet{page:sales;background:#fff;color:#172a3e;max-width:794px;margin:18px auto;padding:30px;border:1px solid #b9ccdd;line-height:1.4;overflow-wrap:anywhere}.sale-doc-header{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #3083c4;margin-bottom:14px;padding-bottom:8px}.sale-doc-header h1{font-size:25px}.sale-doc-header span{font-size:11px}.sale-parties{display:grid;grid-template-columns:1fr 1fr;gap:28px;font-size:12px}.sale-parties p{margin:8px 0}.sale-parties h2{font-size:17px}.sale-logo{display:flex;gap:7px;align-items:center}.sale-logo img{object-fit:contain;max-width:75%;height:auto}.sale-subject{display:flex;justify-content:space-between;gap:12px;font-size:13px;margin:15px 0}.sale-total{border:1px solid #69a5d9;background:#f0f8ff;border-radius:6px;text-align:center;padding:10px;font-size:14px;margin-bottom:12px}.sale-total strong{font-size:22px;margin-left:20px}.sale-doc-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11px}.sale-doc-table th,.sale-doc-table td{border:1px solid #81b8e2;padding:5px 4px;color:#172a3e;white-space:normal;vertical-align:top}.sale-doc-table th{background:#e2f2ff;font-size:11px}.sale-doc-table th:first-child{width:31%}.sale-doc-table th:nth-child(2){width:6%}.sale-doc-table th:nth-child(3){width:7%}.sale-doc-table th:nth-child(4){width:6%}.sale-doc-table th:nth-child(5),.sale-doc-table th:nth-child(6){width:15%}.sale-doc-table small{display:block;color:#6e8194;font-size:8px;margin:0}.sale-doc-table .money{white-space:normal}.sale-totals{width:300px;max-width:100%;margin:12px 0 12px auto;font-size:12px}.sale-totals>div{display:flex;justify-content:space-between;padding:5px;border-bottom:1px solid #bfd7ea}.sale-totals>div:last-child{background:#e2f2ff}.sale-notes{font-size:11px;white-space:normal}.sale-signed{border:1px solid #8ab2d5;width:340px;max-width:100%;padding:8px;font-size:12px}.sale-signed img{display:block;width:100%;height:85px;object-fit:contain}.sale-sheet footer{font-size:10px;color:#6c8197;text-align:center;padding:14px 0 0;margin:0}.sale-public{background:#eef4fa;font-family:Meiryo,sans-serif;margin:0;padding:20px}.sale-public .button{min-height:44px;padding:12px 20px;border:1px solid #8ab2d5;border-radius:6px;background:white;color:#215e91;cursor:pointer}@media(max-width:600px){.sales-tabs .button{font-size:13px;padding:8px;flex:1;min-width:100px}.sales-editor,.sales-controls-panel{padding:14px}.sales-payment-form{grid-template-columns:1fr}.sales-list{font-size:12px}.sales-list td,.sales-list th{padding:6px 4px}.sales-list td strong{font-size:13px}.sales-stats{grid-template-columns:1fr 1fr}.sales-period{flex-wrap:wrap}.sale-sheet{padding:12px}.sale-parties{gap:12px;font-size:10px}.sale-parties h2{font-size:14px}.sale-doc-table,.sale-doc-table th{font-size:9px}.sale-doc-table td{padding:4px 2px}.sale-subject{font-size:11px}.sale-total strong{font-size:20px}.sale-public{padding:8px}}
@page sales{size:A4 portrait;margin:12mm}@media print{body,.sale-public{background:#fff!important;padding:0!important}.sidebar,.topbar,.page-heading,.sales-tabs,.sale-controls,.sales-controls-panel,.sales-revisions,.notice,.error,.workspace>footer{display:none!important}.workspace{margin:0!important}.main{padding:0!important;max-width:none!important}.sale-sheet{width:100%;max-width:none;border:0;margin:0;padding:0;break-after:page;page-break-after:always}.sale-sheet:last-of-type{break-after:auto;page-break-after:auto}.sale-doc-table thead{display:table-header-group}.sale-doc-table tr,.sale-parties,.sale-totals,.sale-signed{break-inside:avoid;page-break-inside:avoid}.sale-sheet footer{display:block!important}.sale-doc-table th{-webkit-print-color-adjust:exact;print-color-adjust:exact}.sale-doc-table td,.sale-doc-table th{border:1px solid #81b8e2!important}.sale-doc-table{font-size:10px}.sale-notes{white-space:normal}}

@media(max-width:900px){.sales-lines{display:block;min-width:0}.sales-lines thead{display:none}.sales-lines tbody{display:block}.sales-lines tr{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:12px 0;border-bottom:2px solid #c7def0}.sales-lines td{display:block;border:0;min-width:0;padding:0}.sales-lines td:before{content:attr(data-label);display:block;font-size:12px;color:#607f9d}.sales-lines td:nth-child(2),.sales-lines td:nth-child(9){grid-column:span 2}.sales-lines input,.sales-lines select{font-size:16px;min-height:48px}.sales-editor .table-wrap{overflow:visible}}
@media(max-width:500px){.sales-lines tr{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Keep the customer/title search field visible beside the document selector. */
.sales-tabs+.toolbar .search{display:grid;grid-template-columns:120px minmax(0,1fr) auto;gap:8px}.sales-tabs+.toolbar .search select{width:100%}.sales-tabs+.toolbar .search input{width:100%;min-width:0}@media(max-width:400px){.sales-tabs+.toolbar .search{grid-template-columns:85px minmax(0,1fr) auto;gap:5px}.sales-tabs+.toolbar .search .button{padding:8px 10px}}
.sale-line-description{display:block;font-size:9px;line-height:1.5;color:#425a71;white-space:normal}@media print{.sale-line-description{font-size:8.5pt}}

/* Preserve original issuer flow and layer the seal behind the right end of the name. */
.sale-issuer{position:relative;isolation:isolate;break-inside:avoid}
.sale-issuer-content{position:relative;z-index:1;min-width:0}
.sale-issuer-seal{position:absolute;z-index:0;left:min(160px,calc(100% - 20mm));top:14px;width:20mm;pointer-events:none}
.sale-issuer-seal img{display:block;width:100%;height:auto;object-fit:contain;max-width:100%}
@media(max-width:600px){.sale-issuer-seal{left:min(160px,calc(100% - 42px));top:10px;width:42px}}
@media print{.sale-issuer{break-inside:avoid;page-break-inside:avoid}.sale-issuer-seal{left:min(160px,calc(100% - 20mm));top:14px;width:20mm}}

/* Align the complete issuer block to the right as in the supplied paper sample. */
.sale-parties:has(.sale-issuer.with-seal){grid-template-columns:minmax(0,1fr) minmax(0,260px)}
@media(max-width:600px){.sale-parties:has(.sale-issuer.with-seal){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{.sale-parties:has(.sale-issuer.with-seal){grid-template-columns:minmax(0,1fr) minmax(0,260px)}}

/* One paper size and column geometry for quote, delivery and invoice. */
.sale-pages{width:100%;min-width:0}
.sale-page-frame{position:relative;width:100%;max-width:210mm;margin:18px auto;overflow:hidden}
.sale-pages .sale-sheet{box-sizing:border-box;width:210mm;max-width:none;min-height:297mm;height:auto;margin:0;padding:12mm;border:1px solid #b9ccdd;display:flex;flex-direction:column;transform-origin:top left;font-size:11px;line-height:1.25}
.sale-pages .sale-sheet.sale-paginated{height:297mm;min-height:0}
.sale-page-body{flex:1;min-height:0;display:flow-root}
.sale-pages .sale-doc-header{margin-bottom:3mm;padding-bottom:2mm}
.sale-pages .sale-doc-header h1{font-size:22px;line-height:1.3}
.sale-pages .sale-parties{grid-template-columns:minmax(0,1fr) 260px;gap:7mm;font-size:11px;line-height:1.35}
.sale-pages .sale-parties p{margin:1mm 0}
.sale-pages .sale-parties h2{font-size:16px;line-height:1.3;margin:2mm 0}
.sale-pages .sale-subject{margin:2mm 0;font-size:12px}
.sale-pages .sale-total{padding:2mm;margin-bottom:3mm;font-size:12px}
.sale-pages .sale-total strong{font-size:20px}
.sale-pages .sale-doc-table{font-size:10px;line-height:1.2}
.sale-pages .sale-doc-table th,.sale-pages .sale-doc-table td{padding:.25mm .8mm;font-size:10px;line-height:1.2}
.sale-pages .sale-doc-table th:nth-child(1){width:40%}
.sale-pages .sale-doc-table th:nth-child(2){width:10%}
.sale-pages .sale-doc-table th:nth-child(3){width:6%}
.sale-pages .sale-doc-table th:nth-child(4){width:6%}
.sale-pages .sale-doc-table th:nth-child(5),.sale-pages .sale-doc-table th:nth-child(6){width:12%}
.sale-pages .sale-doc-table th:nth-child(7){width:14%}
.sale-pages .sale-doc-table tbody tr{height:8.5mm}
.sale-pages .sale-doc-table small{font-size:7px;line-height:1.15}
.sale-pages .sale-line-description{font-size:8px;line-height:1.2}
.sale-pages .sale-totals{width:72mm;font-size:11px;margin:2mm 0 2mm auto}
.sale-pages .sale-totals>div{padding:.25mm}
.sale-pages .sale-notes{font-size:10px;line-height:1.3;white-space:pre-wrap;margin:2mm 0}
.sale-pages .sale-signed{width:80mm;font-size:10px;padding:1mm;margin-top:2mm}
.sale-pages .sale-signed img{height:18mm}
.sale-pages .sale-sheet footer{flex:none;display:block;line-height:1.2;font-size:9px;padding:2mm 0 0;margin:0;min-height:5mm}
.sale-pages .sale-issuer-seal{left:min(160px,calc(100% - 20mm));top:14px;width:20mm}
.sale-measure{position:absolute;left:-10000px;top:0;width:210mm;visibility:hidden;pointer-events:none}
@media print{
 .sale-pages{width:186mm}
 .sale-page-frame{width:186mm;max-width:none;height:auto!important;margin:0;overflow:visible;break-after:page;page-break-after:always}
 .sale-page-frame:last-child{break-after:auto;page-break-after:auto}
 .sale-pages .sale-sheet{width:186mm;min-height:273mm;padding:0;border:0;transform:none!important;break-after:auto;page-break-after:auto}
 .sale-pages .sale-sheet.sale-paginated{height:273mm;min-height:0}
 .sale-pages .sale-doc-table th,.sale-pages .sale-total,.sale-pages .sale-totals>div:last-child{print-color-adjust:exact;-webkit-print-color-adjust:exact}
 .sale-pages .sale-doc-tail{break-inside:auto}
 .sale-pages .sale-sheet footer{display:block!important}
 .catalog-record{display:none!important}
}

.sale-pages .sale-receipt-blank{height:18mm;color:#718398;font-size:9px}

.sale-pages .sale-doc-tail{display:flow-root}

/* The touch header uses display:flex!important. Exclude the entire application
   chrome from paper, including when print preview activates the touch breakpoint. */
@media print{
 body:has([data-sale-pages])>:not(.workspace):not([data-sale-pages]):not(.sale-measure),
 body:has([data-sale-pages]) .workspace>:not(.main),
 body:has([data-sale-pages]) .main>:not([data-sale-pages]){display:none!important}
 body:has([data-sale-pages]),body:has([data-sale-pages]) .workspace,
 body:has([data-sale-pages]) .main,body:has([data-sale-pages]) [data-sale-pages]{display:block!important;position:static!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important;break-before:auto!important;page-break-before:auto!important}
 body:has([data-sale-pages]) .sale-page-frame:first-child{break-before:auto!important;page-break-before:auto!important}
}

/* Screen documents follow their content; only paper keeps blank ruled rows and
   a fixed A4 height. The off-screen pagination ruler always uses paper geometry. */
.sale-pages .sale-blank-row{display:none}
@media screen{
 .sale-pages .sale-sheet,.sale-pages .sale-sheet.sale-paginated{height:auto;min-height:0}
 .sale-measure .sale-sheet.sale-paginated{height:297mm;min-height:0}
 .sale-measure .sale-blank-row{display:table-row}
}
@media print{
 .sale-pages .sale-sheet.sale-paginated{height:273mm;min-height:0}
 .sale-pages .sale-blank-row{display:table-row}
}

/* Align classification and unit consistently on screen and paper. */
.sale-pages .sale-doc-table th:nth-child(2),.sale-pages .sale-doc-table td:nth-child(2),.sale-pages .sale-doc-table th:nth-child(4),.sale-pages .sale-doc-table td:nth-child(4){text-align:center}

/* Keep the supplied logo pixels intact while letting the seal show through
   the white logo background within the issuer's isolated stacking group. */
.sale-issuer.with-seal .sale-issuer-content{mix-blend-mode:multiply}

/* Match the lower rule of each item row without changing horizontal alignment. */
.sale-pages .sale-doc-table tbody td:nth-child(n+2):nth-child(-n+6){vertical-align:bottom}

/* Cancelled records remain readable; action buttons retain their normal styles. */
.work-row[data-sales-state="void"]{background:#f0f2f4}
.work-row[data-sales-state="void"] .work-primary,.work-row[data-sales-state="void"] .work-secondary,.work-row[data-sales-state="void"] .work-meta,.work-row[data-sales-state="void"] .work-date,.work-row[data-sales-state="void"] .work-date small,.work-row[data-sales-state="void"] .work-date strong,.work-row[data-sales-state="void"] .work-side>.work-amount{color:#70777f}
.work-row[data-sales-state="void"] .work-side>.work-state{color:#666e76;background:#e3e7eb;border-color:#cdd3d9}
.sales-next-docs{display:grid;grid-template-columns:minmax(0,1fr);gap:5px;width:100%;max-width:260px}
.sales-next-docs>form{margin:0;min-width:0}
.sales-next-docs .button{width:100%;white-space:normal;min-height:44px;padding:8px 7px;font-size:13px;line-height:1.3}
.work-row[data-sales-document]:has(>.work-side>.sales-next-docs){grid-template-columns:58px minmax(0,1fr) 290px}
.work-side>.sales-next-docs{max-width:none;grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:760px){.work-row[data-sales-document]:has(>.work-side>.sales-next-docs){grid-template-columns:42px minmax(0,1fr) 104px}.work-side>.sales-next-docs{grid-template-columns:minmax(0,1fr)}.work-side>.sales-next-docs .button{font-size:12px;padding:8px 4px}}
@media(max-width:360px){.work-row[data-sales-document]:has(>.work-side>.sales-next-docs){grid-template-columns:37px minmax(0,1fr) 98px}}
@media print{.sales-next-docs{display:none!important}}

.sale-pages .sale-issuer-details{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:0 4px;font-size:10px;line-height:1.35}
.sale-pages .sale-issuer-details>span{white-space:nowrap}

.work-row[data-quote-response="revise"] .work-side>.work-state{background:#fff0d9;color:#9a4e00;border:1px solid #e9a344;font-weight:700}
.work-row[data-quote-response="approve"] .work-side>.work-state{background:#e2f5e9;color:#186237;border:1px solid #79ba91;font-weight:700}
.sales-revision-alert{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:14px 16px;margin:0 0 14px;border:1px solid #e9a344;border-left:5px solid #e58a16;border-radius:10px;background:#fff0d9;color:#864500;text-decoration:none;line-height:1.5}
.sales-revision-alert span{white-space:nowrap;font-weight:700}.sales-revision-filter{margin:0 0 12px;color:#864500}

/* Customer document receipts are separate from staff unread notifications. */
.document-read-badge{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;font-size:11px;font-weight:600;color:#687480}.document-read-badge.is-open{color:#005fcc}.document-read-badge.is-unread{color:#d9480f}.document-read-badge>span{font-size:13px}.document-read-panel h2{font-size:18px}.document-read-panel p{margin:10px 0;line-height:1.8}@media print{.document-read-panel,.document-read-badge{display:none!important}}

/* Hidden notifications must not depend on inline styles (blocked by CSP). */
[data-easy-alert][hidden],[data-easy-badge][hidden],[data-drone-badge][hidden]{display:none!important}

/* Read status shares the existing amount line; it never creates another row. */
.document-amount-line{display:inline-flex;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap;max-width:100%}
button.document-read-dot{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 16px;width:16px;height:16px;min-height:0;min-width:0;padding:0;margin:0;border:0;background:transparent;box-shadow:none;line-height:1;vertical-align:middle;cursor:pointer}
button.document-read-dot:focus-visible{outline:2px solid currentColor;outline-offset:1px;border-radius:3px}
.document-read-popover{position:fixed;z-index:2000;max-width:min(280px,calc(100vw - 24px));padding:10px 12px;border:1px solid #aac4d6;border-radius:6px;background:#fff;color:#163a60;box-shadow:0 3px 14px #19364a26;font-size:12px;line-height:1.7;white-space:pre-line}
.document-read-popover[hidden]{display:none!important}.work-row[data-sales-state="void"] .document-amount-line .work-amount{color:#70777f}
@media print{.document-read-popover,.document-read-dot{display:none!important}}

button.document-read-dot>span{font-size:13px;line-height:1}button.document-read-dot::after{content:"";position:absolute;inset:-4px}
