/* Production adapters reuse the accepted editor controls and paper styles. */
#document-preview .production-workspace .production-editor-table table{min-width:0!important;width:100%;table-layout:fixed}
#document-preview .production-workspace .production-editor-table th:nth-child(n){width:auto!important}
#document-preview .production-workspace .production-editor-table td,#document-preview .production-workspace .production-editor-table th{padding:8px 3px;vertical-align:middle;white-space:nowrap;text-align:center}
#document-preview .production-workspace .hardware-product-control{display:flex;align-items:center;gap:2px;height:36px}
#document-preview .production-workspace .hardware-product-control input{flex:1;width:0}
#document-preview .production-workspace .hardware-product-control button{flex:0 0 36px;width:36px;height:36px;padding:0}
#document-preview .production-workspace .hardware-reference{display:inline;font-size:12px;margin-left:4px;white-space:nowrap}
#document-preview .production-workspace .hardware-divider .bar{padding:0;margin:0;min-height:36px}
#document-preview .production-workspace .hardware-divider td{padding:6px 10px}
#document-preview .production-workspace .hardware-divider strong{font-size:16px}
#document-preview .production-workspace .edge-formula{display:flex;align-items:center;gap:4px;white-space:nowrap}
#document-preview .production-workspace .edge-formula input{width:50px;flex:none}
#document-preview .production-workspace .cw-small{display:inline;white-space:nowrap}
#document-preview .production-workspace .note{font-size:12px}
:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper{max-width:none;margin:0;border:0;padding:12px 8px}
:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper .sales-table th,:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper .sales-table td{padding:5px!important;white-space:nowrap!important;text-align:center!important;vertical-align:middle!important}
:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper .print-summary{margin:8px 0 14px;padding:6px 10px;background:#f5f7fa;display:flex;align-items:center;justify-content:flex-end;gap:24px;font-size:12px;white-space:nowrap}
:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper .print-notes{margin-top:14px;padding-top:10px;font-size:12px;display:flex;gap:16px}
#document-preview .production-preview-switch{display:flex;align-items:center;gap:8px;padding:12px 16px;flex-wrap:wrap;background:var(--d-soft);border-bottom:1px solid var(--d-line)}
#document-preview .production-preview-switch strong{margin-right:auto}
#document-preview .production-preview-switch button{height:36px;font-size:14px;white-space:nowrap}

/* Default production page; handoff has its own landscape page below. */
.document-print-paper:has(.production-paper){width:210mm;padding:10mm;page:production-paper}
#document-print-host .document-print-paper .production-paper.sales-paper .sales-table th,#document-print-host .document-print-paper .production-paper.sales-paper .sales-table td{font-size:12px;padding:3px!important}
@page production-paper{size:A4 portrait;margin:10mm}
@media print{
 .document-print-paper:has(.production-paper){width:auto;max-width:none;padding:0;margin:0;page:production-paper}
 #document-print-host .production-paper.sales-paper{padding:0}
 .production-paper thead{display:table-header-group}
 .production-paper tr{break-inside:avoid}
 .production-paper .sales-heading,.production-paper .sales-section{break-after:avoid}
}
/* Hardware paper uses the saved alias instead of duplicate identity columns. */
:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper .hardware-output-table th,:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper .hardware-output-table td{font-size:14px!important;padding:5px!important}

/* Handoff is A4 landscape; shipment and hardware retain the portrait default. */
.document-print-paper:has(.handoff-paper){width:297mm;page:production-handoff}
:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper.handoff-paper .sales-table th,:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper.handoff-paper .sales-table td{font-size:16px!important;padding:5px!important}
:is(#document-preview,#document-print-host,.production-submitted-paper) .handoff-paper .sales-meta strong,:is(#document-preview,#document-print-host,.production-submitted-paper) .handoff-paper .print-summary,:is(#document-preview,#document-print-host,.production-submitted-paper) .handoff-paper .print-notes{font-size:16px}
:is(#document-preview,#document-print-host,.production-submitted-paper) .handoff-paper .sales-meta span{font-size:12px}
@page production-handoff{size:A4 landscape;margin:10mm}
@media print{
 .document-print-paper:has(.handoff-paper){width:auto;max-width:none;padding:0;margin:0;page:production-handoff}
}

/* Row size editor reuses the sales table and symbol actions. */
#cabinet-whole #document-preview #doc-dialog:has(.hardware-size-editor){width:min(760px,calc(100vw - 48px));max-width:calc(100vw - 48px)}
#document-preview .hardware-size-editor .fields{display:grid;grid-template-columns:160px minmax(0,1fr);gap:12px;margin:16px 0}
#cabinet-whole #document-preview .hardware-size-editor label{display:flex;flex-direction:column;gap:6px;min-width:0;width:auto!important;max-width:none!important;margin:0;padding:0;align-items:stretch}
#cabinet-whole #document-preview .hardware-size-editor input{height:36px;text-align:left;font-size:14px;width:100%!important;max-width:none!important;min-width:0;margin:0;box-sizing:border-box}
#document-preview .hardware-size-editor .sales-entry-table{max-height:340px;overflow:auto}
#document-preview .hardware-size-editor .sales-entry-table table{width:100%;min-width:0;table-layout:fixed}
#document-preview .hardware-size-editor .sales-entry-table th,#document-preview .hardware-size-editor .sales-entry-table td{text-align:center;white-space:nowrap;vertical-align:middle;padding:6px}
#document-preview .hardware-size-editor .sales-entry-table thead{position:sticky;top:0;z-index:1}
#document-preview .hardware-size-editor .sales-row-actions{display:flex;justify-content:center;gap:4px;white-space:nowrap}
#cabinet-whole #document-preview .hardware-size-editor .sales-row-actions button{width:36px!important;min-width:36px!important;height:36px!important;padding:0!important;margin:0}
#document-preview .hardware-size-editor .hardware-size-summary{margin-top:12px}
#document-preview .hardware-size-editor .actions{justify-content:flex-end}

#document-preview .hardware-size-editor{padding:16px;box-sizing:border-box}
#document-preview .hardware-size-editor>.note{padding:0}
#document-preview .hardware-size-editor .fields{padding:0;margin:12px 0}
#document-preview .hardware-size-editor .actions{padding:0;margin-top:12px}
#document-preview .hardware-size-editor [data-hardware-size-status]{margin:8px 0}

#document-preview .hardware-size-defaults-editor .fields{grid-template-columns:minmax(0,1fr)}
#document-preview .hardware-size-defaults-editor .sales-entry-table{max-height:340px}
#document-preview .hardware-size-defaults-editor td:nth-child(2){overflow:hidden;text-overflow:ellipsis}
#document-preview .hardware-size-defaults-editor [data-hardware-size-defaults-status]{margin:8px 0}

/* Linkage adds no table columns and shares the existing controls. */
#document-preview .hardware-linked-quantity{position:relative;min-width:0}
#document-preview .hardware-linked-quantity>input{padding-right:26px!important}
#document-preview .hardware-linked-quantity>[data-hardware-link-state]{position:absolute;right:3px;top:7px;width:22px;height:22px;display:flex;align-items:center;justify-content:center}
#cabinet-whole #document-preview .hardware-linked-quantity button{width:22px!important;min-width:22px!important;height:22px!important;min-height:22px!important;padding:0!important;margin:0;font-size:14px}
#document-preview .hardware-link-auto{font-size:12px;color:var(--d-muted);cursor:help}
#cabinet-whole #document-preview #doc-dialog:has(.hardware-links-editor){width:min(960px,calc(100vw - 48px));max-width:calc(100vw - 48px)}
#document-preview .hardware-link-rule{border:1px solid var(--d-line);padding:12px;margin:12px 0}
#document-preview .hardware-link-rule>.bar{padding:0;margin:0;min-height:36px}
#document-preview .hardware-links-editor .hardware-link-main-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 100px 140px;align-items:end}
#cabinet-whole #document-preview .hardware-links-editor select{width:100%!important;min-width:0;max-width:none;height:36px;font-size:14px;text-align:left;margin:0;box-sizing:border-box}
#document-preview .hardware-link-source-line{min-width:0}
#document-preview .hardware-link-source-line:has(.hardware-link-sources:empty){display:none}
#document-preview .hardware-link-sources{display:flex;gap:6px;flex-wrap:wrap;align-items:center;min-height:36px}
#document-preview .hardware-link-sources>span{display:inline-flex;align-items:center;white-space:nowrap;border:1px solid var(--d-line);padding-left:8px;height:36px;box-sizing:border-box;font-size:14px}
#cabinet-whole #document-preview .hardware-link-sources button{width:28px;min-height:28px;height:28px;padding:0;margin:0 2px;border:0}
#document-preview .hardware-link-rule>.note{padding:8px 0 0;margin:0}
#document-preview .hardware-links-editor>.bar{padding:0;align-items:center;gap:12px}
#document-preview .hardware-links-editor [data-hardware-link-status]{font-size:14px;flex:1}

#document-preview .hardware-links-editor [data-hardware-link-rules]{max-height:45vh;overflow:auto;padding-right:4px;overscroll-behavior:contain}

/* Template uses existing product editor controls; columns include the concrete hardware kind. */
#cabinet-whole .pm-slot-template-table table{min-width:1050px}
#cabinet-whole .pm-slot-template-table th:nth-child(1){width:150px}
#cabinet-whole .pm-slot-template-table th:nth-child(2){width:170px}
#cabinet-whole .pm-slot-template-table th:nth-child(3){width:180px}
#cabinet-whole .pm-slot-template-table th:nth-child(4){width:390px}
#cabinet-whole .pm-slot-template-table th:nth-child(5){width:132px}
#cabinet-whole .pm-slot-template-table .cw-btn{width:36px;min-width:36px;padding:0}
#cabinet-whole .pm-slot-change-note{border:1px solid var(--cw-line);padding:12px;margin:12px 0}

/* A single brand-spec control keeps the original row specification editable. */
#document-preview .production-workspace .hardware-brand-spec{display:flex;align-items:center;flex:1;min-width:0;height:36px;box-sizing:border-box;border:1px solid var(--d-line);border-radius:2px;background:#fff;text-align:left;overflow:hidden}
#document-preview .production-workspace .hardware-brand-spec .hardware-brand{flex:0 1 auto;min-width:0;max-width:45%;padding-left:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
#cabinet-whole #document-preview .production-workspace .hardware-brand-spec input{flex:1;min-width:0;width:0!important;height:34px!important;margin:0;padding:0 8px 0 0!important;border:0!important;border-radius:0;box-shadow:none;background:transparent;font-size:14px;text-align:left}
#document-preview .production-workspace .hardware-brand-spec:focus-within{border-color:var(--d-blue,#2b609b)}

/* One aligned hardware header; filled bands use the header color and continuous table borders. */
:is(#document-preview,#document-print-host,.production-submitted-paper) .production-paper.sales-paper .hardware-grouped-output tr.hardware-group-gap td{height:8px;padding:0!important;line-height:0;background:#f0f4f7;print-color-adjust:exact;-webkit-print-color-adjust:exact}

/* Administrator review reuses the production paper and existing dialog controls. */
#cabinet-whole .cw-dialog.shipment-review-dialog{width:min(1120px,calc(100% - 28px));max-width:calc(100% - 28px)}
#cabinet-whole .shipment-review-dialog .cw-quickbody{padding:12px 16px}
#cabinet-whole .shipment-review-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 8px 8px}
#cabinet-whole .shipment-review-tools .cw-btn{flex:none}
#cabinet-whole .shipment-review-dialog .production-submitted-paper>.cw-pad{padding:8px}
