/* Commercial reference layouts. Screen design and printable paper have distinct rules. */
.sb-reference-formats{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:14px 18px;background:var(--panel,#fff);border-block:1px solid var(--line,#d6e2e9);}
.sb-reference-formats>div{flex:1 1 220px;}
.sb-reference-formats strong{font-size:14px;}
.sb-reference-formats small{display:block;font-size:12px;color:var(--muted,#52677a);margin-top:5px;}
.sb-reference-formats label{display:flex;align-items:center;gap:8px;font-size:13px;}
.sb-reference-formats select,.sb-cust-pick select{min-height:38px;max-width:100%;border:1px solid var(--line,#d6e2e9);border-radius:8px;padding:8px;background:var(--panel,#fff);color:var(--ink,#102b46);}
.sb-cust-pick{display:flex;align-items:center;gap:8px;}
html body :is(#app,#sb-form-layer) .sb-inv-paper{font-variant-numeric:tabular-nums;line-height:1.45;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table :is(th,td){vertical-align:top!important;padding:7px 6px!important;line-height:1.4!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;hyphens:none;text-overflow:clip!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table th{background:#eef3f6!important;color:#15364d!important;font-weight:700!important;border-bottom:1.5px solid #15364d!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table tbody tr:nth-child(even) td{background:#f8fafb!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) :is(.sb-col-num,.sb-align-right){text-align:right!important;text-align-last:right!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-align-center{text-align:center!important;text-align-last:center!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-align-left{text-align:left!important;text-align-last:left!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-company-top{margin:0 0 16px;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .total-row{display:flex!important;justify-content:space-between;align-items:baseline;gap:16px;padding:8px 10px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .total-row>b{white-space:nowrap;flex-shrink:0;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-paid-stamp{position:static!important;transform:none!important;width:fit-content!important;margin:14px 0 0 auto!important;opacity:1!important;}
.esb-order-paper{background:white!important;color:#172b3a!important;font-family:Arial,Helvetica,sans-serif!important;font-size:11px!important;line-height:1.45;}
.esb-order-paper header{display:flex;justify-content:space-between;gap:24px;}
.esb-order-paper header>div{min-width:0;}
.esb-order-paper header>div:last-child{text-align:right;}
.esb-order-paper header h1{font-size:27px;margin:0 0 8px;}
.esb-order-paper header h2{font-size:20px;margin:0 0 6px;}
.esb-order-paper p{white-space:pre-line;overflow-wrap:anywhere;}
.esb-order-parties{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:22px 0;}
.esb-order-parties section{padding:12px;border:1px solid #d5dfe7;}
.esb-order-parties h3{font-size:11px;text-transform:uppercase;color:#52677a;margin:0 0 8px;}
.esb-order-facts{display:flex;flex-wrap:wrap;gap:16px;padding:12px;background:#f4f7f9;margin:0 0 18px;}
.esb-order-facts>span{flex:1;min-width:120px;}
.esb-order-facts small{display:block;font-size:10px;color:#52677a;margin-bottom:5px;}
.esb-order-paper table{width:100%;border-collapse:collapse;table-layout:fixed;}
.esb-order-paper :is(th,td){padding:8px 6px!important;font-size:11px!important;line-height:1.45;vertical-align:top;white-space:normal!important;overflow-wrap:break-word;border-bottom:1px solid #d5dfe7;}
.esb-order-paper th{background:#edf3f6!important;color:#15364d!important;text-align:left;}
.esb-order-paper .num{text-align:right!important;font-variant-numeric:tabular-nums;}
.esb-order-totals{width:300px;max-width:100%;margin:18px 0 18px auto;break-inside:avoid;}
.esb-order-totals>div{display:flex;justify-content:space-between;gap:16px;padding:8px;border-bottom:1px solid #d5dfe7;}
.esb-order-totals .grand{font-weight:700;font-size:14px;border-bottom:2px solid #15364d;}
.esb-order-paper footer{display:flex;gap:24px;justify-content:space-between;margin-top:40px;break-inside:avoid;}
.esb-order-paper footer span{border-top:1px solid #7a8d9b;padding-top:8px;flex:1;}
.listpage-previewbar label{display:flex;align-items:center;gap:8px;color:var(--ink,#15364d);}
.listpage-previewbar select{padding:8px;min-height:38px;border:1px solid #cbd9e3;border-radius:8px;background:var(--panel,#fff);color:var(--ink,#15364d);}
@media screen and (max-width:768px){.sb-reference-formats{gap:10px;padding:12px;}.sb-reference-formats label{width:100%;}.sb-reference-formats select{flex:1;min-width:0;font-size:16px;}.sb-cust-pick{max-width:100%;}.listpage-previewbar{flex-wrap:wrap;}.listpage-previewbar label{width:100%;}.listpage-previewbar select{min-width:0;max-width:100%;}.esb-order-parties{grid-template-columns:1fr;}}
@media print{.esb-order-paper table thead{display:table-header-group;}.esb-order-paper tr{break-inside:avoid;}.esb-order-paper footer,.esb-order-totals{break-inside:avoid;}.sb-reference-formats{display:none!important;}}
.esb-customer-date-filter{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 14px;background:var(--panel);border-bottom:1px solid var(--line);}
.esb-customer-date-filter label{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);}
.esb-customer-date-filter input{min-height:36px;padding:6px;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--ink);}
.esb-customer-date-filter>span{margin-left:auto;font-size:12px;color:var(--muted);}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-box p{white-space:pre-line!important;}
@media(max-width:768px){.esb-customer-date-filter label{flex:1 1 140px;}.esb-customer-date-filter input{min-width:0;width:100%;min-height:44px;font-size:16px;}}
/* Branded document masthead: compact identity, strong title, and generous description space. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-reference-masthead{display:flex!important;align-items:flex-start;justify-content:space-between;gap:24px;margin:0 0 22px;padding:0 0 18px;border-bottom:3px solid var(--format-accent,#15364d);break-inside:avoid;}
.sb-reference-brand{display:flex;align-items:center;gap:14px;min-width:0;flex:1;}
.sb-reference-logo{width:62px;height:62px;object-fit:contain;flex:0 0 62px;}
.sb-reference-monogram{display:grid;place-items:center;flex:0 0 52px;width:52px;height:52px;border-radius:12px;background:#15364d;color:#fff;font-size:21px;font-weight:700;letter-spacing:-.04em;}
html body :is(#app,#sb-form-layer) .sb-reference-brand .print-company h1{font-size:20px!important;line-height:1.2!important;margin:0 0 5px!important;}
html body :is(#app,#sb-form-layer) .sb-reference-masthead .print-title{margin:0!important;min-width:0!important;max-width:45%;}
html body :is(#app,#sb-form-layer) .sb-reference-masthead .sb-doc-name{font-size:24px!important;letter-spacing:-.025em!important;line-height:1.15!important;text-transform:none!important;color:#15364d!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-box{border-radius:8px!important;background:#fafcfd!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-inv-facts{margin-top:16px!important;margin-bottom:16px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .totals{margin-top:16px!important;min-width:280px;max-width:100%;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .total-row.grand{background:#edf4f6!important;border-bottom:2px solid #15364d!important;font-size:12px!important;}
@media screen and (max-width:600px){.sb-reference-masthead{flex-wrap:wrap;}.sb-reference-brand{flex-basis:100%;}html body :is(#app,#sb-form-layer) .sb-reference-masthead .print-title{max-width:100%;margin-left:auto!important;}}
/* Keep printed reference pages identical to preview and avoid cramped reference cells. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-inv-facts{grid-template-columns:repeat(4,minmax(0,1fr))!important;border-radius:6px!important;overflow:visible!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-fact{border-bottom:1px solid #d5dee8;padding:9px 10px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-fact span{font-size:8pt!important;line-height:1.4!important;overflow-wrap:normal!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-fact b{font-size:10pt!important;font-weight:600!important;line-height:1.4!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table :is(th,td){font-size:9pt!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-signatures{margin-top:18mm!important;gap:18px!important;}
@media screen and (max-width:600px){html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-inv-facts{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media print{
 html body #app .sb-reference-masthead{display:flex!important;flex-direction:row!important;align-items:flex-start!important;flex-wrap:nowrap!important;}
 html body #app .sb-reference-monogram{display:flex!important;align-items:center!important;justify-content:center!important;print-color-adjust:exact;-webkit-print-color-adjust:exact;}
 html body #app .sb-reference-brand{display:flex!important;align-items:center!important;}
 html body #app .sb-inv-paper{line-height:1.45!important;}
 html body #app .sb-inv-paper:not(.sb-free) .totals{break-inside:avoid;}
}
/* Line table sizing: columns follow their content, words and headers wrap only at spaces, number and date values never split,
   and tables with ten or more columns use a compact size so a full invoice fits one page. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .table-wrap{overflow:visible!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) table.print-table{table-layout:auto!important;width:100%!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table td:is(.sb-col-num,.sb-col-mid){white-space:nowrap!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table:has(> thead > tr > th:nth-child(10)) :is(th,td){font-size:8pt!important;padding:5px 4px!important;}

/* Shared commercial paper geometry; independent of workspace theme and grid controls. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-reference-masthead{padding-top:6mm!important;padding-bottom:6mm!important;margin-bottom:6mm!important;gap:8mm!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-reference-brand{align-items:flex-start!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-reference-brand .print-company{font-size:10pt!important;line-height:1.5!important;text-align:left!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-reference-brand .print-company p{margin:4px 0 0!important;white-space:pre-line!important;overflow-wrap:anywhere!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-inv-facts{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:0!important;border:1px solid #ced9e2!important;background:#f7fafc!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-fact{padding:1.8mm 3mm!important;min-height:10mm!important;box-sizing:border-box!important;border:0!important;border-right:1px solid #dde5ec!important;border-bottom:1px solid #dde5ec!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-fact span{display:block!important;font-size:8pt!important;font-weight:600!important;letter-spacing:.025em!important;color:#526578!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-fact b{display:block!important;margin-top:.7mm!important;font-size:9.5pt!important;line-height:1.3!important;color:#142c40!important;overflow-wrap:anywhere!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table th{padding:2mm 1.4mm!important;line-height:1.35!important;vertical-align:middle!important;text-transform:none!important;letter-spacing:0!important;font-size:9pt!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-signatures{display:flex!important;justify-content:space-between!important;gap:8mm!important;margin-top:16mm!important;padding-top:8mm!important;break-inside:avoid!important;page-break-inside:avoid!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-signatures>div{flex:1!important;width:auto!important;padding-top:3mm!important;min-height:12mm!important;text-align:center!important;border-top:1px solid #6b7d88!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-doc-foot{margin-top:5mm!important;gap:8mm!important;}

/* Printed identities remain ink on white, even inside the authenticated dark shell. */
html[data-theme="dark"] body[data-auth-state="authenticated"] :is(#app,#sb-form-layer) .sb-inv-paper :is(h1,h2,h3,.sb-doc-name,.sb-box-title){color:#17394f!important;-webkit-text-fill-color:#17394f!important;background:transparent!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper .sb-reference-monogram{display:grid!important;place-items:center!important;width:52px!important;height:52px!important;min-width:52px!important;min-height:52px!important;background:#17394f!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border-radius:10px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper .sb-doc-name{white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;}
/* The preview sheet is exactly as wide as the paper, with the printer's 12 mm side margins, so text wraps in
   Print preview exactly where it wraps on paper. Narrow screens scale it down. */
@media screen{html body :is(#app,.sb-fmt-preview) .sb-inv-paper:not(.sb-free){width:210mm!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;padding-left:12mm!important;padding-right:12mm!important;}
 html body :is(#app,.sb-fmt-preview) .sb-inv-paper[data-paper="letter" i]:not(.sb-free){width:215.9mm!important;}
 html body :is(#app,.sb-fmt-preview) .sb-inv-paper[data-orientation="landscape"]:not(.sb-free){width:297mm!important;}
 html body :is(#app,.sb-fmt-preview) .sb-inv-paper[data-paper="letter" i][data-orientation="landscape"]:not(.sb-free){width:279.4mm!important;}}

@media print{
 /* Totals stay right under the last line; if space runs out, only the signatures move to the next page.
    Each block stays whole. */
 html body #app .sb-inv-paper:not(.sb-free) .sb-document-closing{display:block!important;width:100%!important;break-inside:auto!important;page-break-inside:auto!important;}
 html body #app .sb-inv-paper:not(.sb-free) .sb-document-closing>:is(.sb-doc-foot,.totals,.print-signatures){break-inside:avoid!important;page-break-inside:avoid!important;}
 /* Totals may start the next page on their own; the line table is never dragged after them. */
}

/* The format designer is a light editing surface; workspace theme does not tint paper. */
html body #sb-form-layer{color-scheme:light;--panel:#fff;--ink:#17394f;--muted:#526578;--line:#d3dfe7;--soft:#f4f7fb;color:#17394f!important;background:#f4f7fb!important;}
html body #sb-form-layer :is(.sb-form-win,.sb-cust-head,.sb-reference-formats,.sb-form-win-bar,.sb-form-win-foot,.sb-cust-edit){background:#fff!important;color:#17394f!important;}

html body #sb-form-layer :is(input:not([type=checkbox]),select,select option,textarea,button){background:#fff!important;color:#17394f!important;-webkit-text-fill-color:#17394f!important;border-color:#c6d4df!important;color-scheme:light!important;}
html body #sb-form-layer .sb-cust-edit :is(th,td){background:#fff!important;color:#17394f!important;-webkit-text-fill-color:#17394f!important;}
html body #sb-form-layer .sb-cust-edit th{background:#edf3f7!important;}
html body #sb-form-layer .sb-reference-formats{border-block:1px solid #d3dfe7!important;}
html body #sb-form-layer .sb-cust-font-control{display:flex;align-items:center;gap:8px;white-space:nowrap;}
html body #sb-form-layer [data-document-font-size]{width:72px!important;padding:7px 9px!important;border:1px solid #c6d4df!important;border-radius:6px;}
html body :is(#app,#sb-form-layer) .sb-inv-paper .print-table :is(th,td){font-size:var(--document-font-size,9pt)!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper .sb-fact b{font-size:var(--document-font-size,9pt)!important;}

html body #sb-form-layer #sb-cust-preview .sb-inv-paper .print-table :is(th,td){font-size:var(--document-font-size,9pt)!important;}

/* Format papers: professional spacing (standard accounting software density), identical on screen and paper,
   and the format's own column widths (colgroup) win over older per-cell width rules. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-table :is(th,td){width:auto!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-reference-masthead{padding-bottom:12px!important;margin-bottom:14px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-box h3{margin:2px 0 4px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-box p{margin:0 0 2px!important;line-height:1.4!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-inv-facts{margin:12px 0!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .totals{margin-top:12px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .totals .total-row{padding-top:5px!important;padding-bottom:5px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .print-signatures{margin-top:34px!important;padding-top:16px!important;}

/* Party blocks (customer, ship-to, seller): name, address lines, contact, labelled tax IDs. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-name{margin:2px 0 3px!important;font-size:1.15em!important;font-weight:700!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) :is(.sb-party-address,.sb-party-contact){margin:0 0 2px!important;line-height:1.4!important;color:#374151!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-ids{display:grid!important;grid-template-columns:max-content 1fr;column-gap:10px;row-gap:1px;margin:5px 0 0!important;padding:0!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-ids>div{display:contents;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-ids dt{margin:0!important;font-size:.78em!important;font-weight:700!important;letter-spacing:.06em;text-transform:uppercase;color:#6b7280!important;align-self:center;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-ids dd{margin:0!important;font-weight:600!important;font-variant-numeric:tabular-nums;color:#111827!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-company-pro h1{margin:0 0 3px!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-company-pro .sb-party-ids{max-width:320px;}

/* Customer + document details band: details as a labelled list on the right. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band{display:flex!important;align-items:stretch;gap:14px;margin:0 0 14px!important;break-inside:avoid;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band>.sb-inv-head{flex:1 1 auto;min-width:0;margin:0!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band>.sb-inv-head :is(.sb-inv-parties,.print-parties,.sb-party-box){height:100%;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band>.sb-inv-facts{flex:0 0 36%;display:block!important;margin:0!important;padding:8px 12px!important;border:1px solid #d6dee6!important;border-radius:8px;background:#fff!important;grid-template-columns:none!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band .sb-fact{display:flex!important;justify-content:space-between;align-items:baseline;gap:12px;padding:4px 0!important;margin:0!important;border:0!important;border-bottom:1px solid #eef2f6!important;background:transparent!important;min-height:0!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band .sb-fact:last-child{border-bottom:0!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band .sb-fact span{font-size:.78em!important;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#6b7280!important;white-space:nowrap;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-party-band .sb-fact b{text-align:right;font-variant-numeric:tabular-nums;}
@media screen and (max-width:640px){html body #app .sb-inv-paper:not(.sb-free) .sb-party-band{flex-direction:column;}}

/* Notes and payment details on the left, totals on the right of the same row. */
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper:not(.sb-free) .sb-doc-foot{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,38%)!important;align-items:start!important;gap:24px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper:not(.sb-free) .sb-doc-foot>.sb-doc-notes{grid-area:1/1!important;order:0!important;min-width:0!important;margin:0!important;overflow-wrap:anywhere;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper:not(.sb-free) .sb-doc-foot>.totals{grid-area:1/2!important;order:1!important;width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-doc-notes .sb-note p>span{display:block;font-size:.78em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#6b7280;margin-bottom:2px;}

/* Document details in one row across the page: headings above values. */
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-inv-facts.sb-facts-row{display:grid!important;grid-template-columns:repeat(var(--facts-n),minmax(0,1fr))!important;gap:0!important;margin:12px 0!important;padding:0!important;border:1px solid #9fb0bf!important;border-radius:0!important;background:#fff!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-facts-row .sb-fact{display:flex!important;flex-direction:column!important;gap:0!important;margin:0!important;padding:0!important;border:0!important;border-left:1px solid #9fb0bf!important;background:transparent!important;min-height:0!important;text-align:center!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-facts-row .sb-fact:first-child{border-left:0!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-facts-row .sb-fact span{display:block!important;padding:4px 6px!important;background:#eef3f7!important;border-bottom:1px solid #9fb0bf!important;font-size:.78em!important;font-weight:700!important;letter-spacing:.04em;text-transform:uppercase;color:#334155!important;}
html body :is(#app,#sb-form-layer) .sb-inv-paper:not(.sb-free) .sb-facts-row .sb-fact b{display:block!important;padding:5px 6px!important;font-variant-numeric:tabular-nums;}
/* Long documents: column headings repeat on each page unless the format switches that off. */
@media print{html body #app .sb-inv-paper[data-repeat-head="0"] .print-table thead{display:table-row-group!important;}}

/* Compact commercial print typography; document font controls remain authoritative. */
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper:not(.sb-free) .sb-reference-brand .print-company h1{font-size:17px!important;line-height:1.2!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper:not(.sb-free) .sb-reference-masthead .sb-doc-name{font-size:20px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper:not(.sb-free) .print-table td{padding:1.6mm 1.4mm!important;line-height:1.25!important;}

/* Keep print typography independent of workspace theme and generic table sizes. */
html:root body :is(#app,#sb-form-layer,.sb-fmt-preview) .doc-print.sb-inv-paper .print-table :is(th,td){font-size:var(--document-font-size,9pt)!important;}

/* Compact hero invoice: natural-height sections, one issuer header and no saved absolute gaps. */
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"]{padding-top:0!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-reference-masthead{padding:0 0 10px!important;margin:0 0 12px!important;gap:18px!important;border-bottom-width:2px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-reference-logo{width:44px;height:44px;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-reference-monogram{width:40px;height:40px;flex-basis:40px;border-radius:8px;font-size:17px;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-reference-masthead .print-title{max-width:45%!important;min-width:0!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-reference-masthead .sb-doc-name{font-size:20px!important;line-height:1.15!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-party-band{align-items:start!important;margin-bottom:12px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-party-band .sb-party-box{height:auto!important;min-height:0!important;padding:10px 12px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-party-band>.sb-inv-head :is(.sb-inv-parties,.print-parties){height:auto!important;min-height:0!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-party-band>.sb-inv-facts{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px 12px!important;padding:9px 12px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-party-band .sb-fact{display:block!important;padding:0!important;border:0!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-party-band .sb-fact b{text-align:left!important;margin-top:2px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .sb-doc-foot{margin-top:12px!important;gap:20px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .print-signatures{margin-top:26px!important;padding-top:10px!important;gap:24px!important;}
html body :is(#app,#sb-form-layer,.sb-fmt-preview) .sb-inv-paper[data-compact-hero="1"] .print-signatures>div{min-height:26px!important;padding-top:6px!important;}
