.hardware-page{max-width:1200px;margin:auto;padding-bottom:32px}
.hardware-page [hidden]{display:none!important}
.hardware-page input[type=hidden]{display:none!important}
.hardware-wide{grid-column:1/-1}
.hardware-choice-group{border:1px solid #d5dfeb;border-radius:9px;margin:0;min-width:0;background:#fafcff}
.hardware-choice-group legend{font-size:14px;font-weight:600;color:#2c3e54;padding:0 6px}
.hardware-page .hardware-choice-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.hardware-page .hardware-choice-list label{display:flex;align-items:center;justify-content:flex-start;gap:9px;margin:0;padding:3px 0;font-size:13px;cursor:pointer;line-height:1.4}
.hardware-page .hardware-choice-list input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;min-width:18px;padding:0;margin:0;accent-color:#0b61dc}
.hardware-page .hardware-choice-list label:has(input:checked){color:#145da4;font-weight:600}
@media(max-width:650px){}
@media(max-width:450px){.hardware-page .hardware-choice-list{grid-template-columns:1fr}}
.hardware-test-banner{padding:14px 18px;background:#e9f2fc;border:1px solid #ccdef1;border-radius:10px;color:#234466;display:flex;gap:8px 16px;flex-wrap:wrap;margin-bottom:18px}

.hardware-heading,.hardware-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:18px 0}
.hardware-heading h2,.hardware-heading h3,.hardware-heading h4{margin:0}
.hardware-heading p{margin:5px 0;color:#617289}
.hardware-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}

.hardware-page label{display:block;font-weight:600;font-size:14px;color:#2c3e54}
.hardware-page input:not([type=checkbox]),.hardware-page select,.hardware-page textarea{width:100%;min-width:0;display:block;border:1px solid #d5dfeb;border-radius:7px;background:#fff;color:#25384e;font:inherit;font-weight:400}
.hardware-page textarea{resize:vertical}
.hardware-page small,.hardware-note{font-size:12px;font-weight:400;color:#64758b}
.hardware-page summary{font-weight:600;cursor:pointer}
.hardware-actions{display:flex;gap:10px;flex-wrap:wrap}
.hardware-page .btn{white-space:normal}


.hardware-page .hardware-check{display:flex;align-items:center;justify-content:flex-start;gap:9px;padding:3px 0;font-weight:400;margin:10px 0;max-width:100%;line-height:1.4}
.hardware-page .hardware-check input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;min-width:18px;padding:0;margin:0;accent-color:#0b61dc}
.hardware-inline-action{align-self:end;display:flex;gap:8px;flex-wrap:wrap}
.hardware-accessory{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto;gap:14px;align-items:end;margin-bottom:12px}
.hardware-attachment{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid #e0e6ef;overflow-wrap:anywhere}
.hardware-errors{padding:16px 20px;border:1px solid #e0acb1;background:#fff5f5;border-radius:9px;color:#9a2630;margin:16px 0}
.hardware-errors li{margin:5px 0}
.hardware-preview-head{display:flex;justify-content:space-between;align-items:center;gap:20px;border-bottom:2px solid #1c4777;padding-bottom:20px;flex-wrap:wrap}
.hardware-preview-head img{width:190px;max-width:100%}
.hardware-preview-brand p{font-size:12px;line-height:1.5;color:#2c3e54;margin:8px 0 0}
.hardware-preview-entry{break-inside:avoid;border-top:1px solid #d6dfe9;padding-top:14px;margin-top:20px}
.hardware-preview-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px}
.hardware-preview-details p{margin:4px 0;overflow-wrap:anywhere}
.hardware-preview-entry h3{margin:0 0 12px}
.hardware-footer #saveStatus{font-size:13px;color:#617289}
@media(max-width:650px){.hardware-accessory{grid-template-columns:1fr 1fr}.hardware-accessory button{grid-column:1/-1}}
@media(max-width:450px){.hardware-grid,.hardware-preview-details{grid-template-columns:1fr}.hardware-page .card{padding:16px}.hardware-actions{width:100%}.hardware-actions .btn{flex:1}}



/* Compact line items use the same copy/delete symbols as the estimate. */
.hardware-page .card{padding:16px;margin:12px 0}
.hardware-grid{gap:10px 14px;margin-top:12px}
.hardware-page input:not([type=checkbox]),.hardware-page select,.hardware-page textarea{padding:8px 10px;margin-top:4px}
.hardware-page textarea{min-height:70px;margin-bottom:0}
.hardware-choice-group{padding:10px 12px}
.hardware-page .hardware-choice-list{gap:6px 10px;margin:2px 0 4px}
.hardware-page .hardware-choice-list label{min-height:24px}
.hardware-entry-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #d6dfe9;padding-bottom:10px}
.hardware-entry-heading h3{margin:0;font-size:17px;overflow-wrap:anywhere}
.hardware-row-actions{display:flex;gap:6px;flex-shrink:0}
.hardware-row-actions button{display:grid;place-items:center;width:36px;height:36px;border:1px solid #d5dfeb;border-radius:7px;background:#fff;cursor:pointer;font-size:20px;color:#145da4}
.hardware-row-actions .delete-line{color:#a52d36}
.hardware-row-actions button:hover{background:#edf4fc}
.hardware-row-actions button:focus-visible{outline:2px solid #145da4;outline-offset:2px}
.hardware-track-fields{grid-template-columns:minmax(0,1.3fr) minmax(60px,.5fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr)}
.hardware-entry-choices{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
.hardware-entry-choices .hardware-choice-list{grid-template-columns:1fr}
.hardware-entry-extras{margin-top:12px;border-top:1px solid #e0e6ef;padding-top:10px}
.hardware-entry-extras summary{font-size:13px;color:#617289}
.hardware-entry-extras .hardware-heading{margin:10px 0}
@media(max-width:950px){.hardware-track-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.hardware-entry-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.hardware-track-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.hardware-entry-choices{grid-template-columns:1fr}.hardware-entry-choices .hardware-choice-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:450px){.hardware-entry-bottom{grid-template-columns:1fr}.hardware-entry-choices .hardware-choice-list{grid-template-columns:1fr}}

.hardware-operation-row{align-items:stretch}
.hardware-operation-row>[data-region=control]{display:flex;min-width:0}
.hardware-operation-row>[data-region=control]>.hardware-choice-group{flex:1;min-width:0}
.hardware-operation-row [data-region=control] .hardware-choice-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.hardware-operation-row [data-region=control] .hardware-choice-group>label{margin:10px 0 0}

@page{size:letter portrait;margin:0.5in}
@media print{
 html,body{display:block!important;width:auto!important;min-width:0!important;min-height:0!important;height:auto!important;margin:0!important;padding:0!important;background:#fff!important;grid-template-columns:none!important;color:#17243a}
 body>.sidebar,.topbar,.hardware-test-banner,.hardware-page>p,.hardware-page .hardware-heading,.hardware-footer,#hardwareEditor,#newOrder,#savedOrders,#loadOrder,#validationErrors,#hardwareReview>.hardware-actions{display:none!important}
 .app-shell,.hardware-page,#hardwareApp,#hardwareReview,#supplierPreview{display:block!important;width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;padding:0!important}
 #hardwareApp>section.card{display:none!important}
 #supplierPreview{border:0!important;box-shadow:none!important}
 .hardware-preview-head{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;break-inside:avoid}
 .hardware-preview-head>div:last-child{text-align:right}
 
 .hardware-preview-head h2{line-height:1.2}
 
 .hardware-preview-details{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .hardware-preview-details p{overflow-wrap:anywhere}
 .hardware-preview-entry{border-top:1px solid #cbd8e8}
 .hardware-preview-entry h3{line-height:1.3}
 .hardware-preview-entry .hardware-preview-details{margin-top:0}
 .hardware-preview-entry>p{white-space:pre-wrap;overflow-wrap:anywhere}
}

.hardware-operation-row{grid-template-columns:repeat(2,minmax(0,1fr))}
.hardware-entry-bottom{grid-template-columns:1fr}
@media(max-width:650px){.hardware-operation-row{grid-template-columns:1fr}}

/* Workroom production print: compact, readable, and continuous across pages. */
@media print {
 @page { size: letter portrait; margin: .38in .42in; }
 body { font-size: 8pt!important; line-height: 1.18!important; }
 #supplierPreview { font-size: 8pt!important; }
 .hardware-preview-head { gap: 7pt!important; padding-bottom: 5pt!important; }
 .hardware-preview-head img { width: 100px!important; }
 .hardware-preview-head h2 { font-size: 14pt!important; margin: 0 0 2pt!important; }
 .hardware-preview-head p,.hardware-preview-brand p { font-size: 7.5pt!important; line-height: 1.18!important; margin: 2pt 0!important; }
 .hardware-preview-details { gap: 2pt 9pt!important; margin-top: 4pt!important; font-size: 8pt!important; line-height: 1.2!important; }
 .hardware-preview-details p { font-size: 8pt!important; line-height: 1.2!important; margin: 0!important; }
 .hardware-preview-entry { break-inside: auto!important; page-break-inside: auto!important; margin-top: 7pt!important; padding-top: 5pt!important; }
 .hardware-preview-entry h3 { font-size: 10pt!important; margin: 0 0 4pt!important; break-after: avoid!important; }
 .hardware-preview-entry .hardware-preview-details { grid-template-columns: repeat(3,minmax(0,1fr))!important; gap: 2pt 9pt!important; }
 .hardware-preview-entry>p { font-size: 8pt!important; line-height: 1.2!important; margin: 3pt 0!important; }
 .hardware-workroom-diagram { padding: 4pt 6pt!important; margin: 5pt 0!important; break-inside: avoid!important; page-break-inside: avoid!important; }
 .hardware-workroom-diagram h4 { font-size: 8pt!important; margin: 0 0 3pt!important; }
 .hardware-workroom-diagram p { font-size: 7pt!important; line-height: 1.2!important; margin: 2pt 0!important; }
 .hardware-workroom-diagram figure { margin: 2pt 0!important; }
 .hardware-workroom-diagram img { max-width: 100%!important; max-height: 1.8in!important; width: auto!important; height: auto!important; }
 .hardware-workroom-diagram figcaption { font-size: 7pt!important; margin-top: 2pt!important; }
 #supplierPreview>section:not(.hardware-preview-entry) { padding: 5pt!important; margin: 5pt 0!important; }
 #supplierPreview>section:not(.hardware-preview-entry) h3 { font-size: 9pt!important; margin: 0 0 3pt!important; }
 #supplierPreview>section:not(.hardware-preview-entry) p { margin: 2pt 0!important; font-size: 8pt!important; }
}

/* Smaller master-carrier reference drawings on screen and in downloaded PDFs. */
#supplierPreview .hardware-workroom-diagram img{width:65%!important;max-width:468px!important;height:auto!important;max-height:none!important;object-fit:contain!important;margin:0 auto!important}
#supplierPreview .hardware-workroom-diagram{break-inside:avoid;page-break-inside:avoid}
@media print{#supplierPreview .hardware-workroom-diagram img{width:65%!important;max-width:468px!important;max-height:1.2in!important}}

/* Dedicated, isolated layout for downloadable workroom PDFs (html2pdf uses screen CSS). */
#workroomPdfSheet{
  box-sizing:border-box!important;display:block!important;position:static!important;
  width:720px!important;min-width:720px!important;max-width:720px!important;
  margin:0!important;padding:8px 12px!important;background:#fff!important;
  color:#17243a!important;font-family:Arial,Helvetica,sans-serif!important;
  font-size:10px!important;line-height:1.22!important;letter-spacing:normal!important;
  overflow:visible!important;transform:none!important;
}
#workroomPdfSheet *,#workroomPdfSheet *::before,#workroomPdfSheet *::after{box-sizing:border-box!important}
#workroomPdfSheet .hardware-preview-head{
  display:grid!important;grid-template-columns:1fr 1fr!important;gap:12px!important;
  align-items:center!important;margin:0 0 8px!important;padding:0 0 7px!important;
  border-bottom:1px solid #345475!important;flex-wrap:nowrap!important;
}
#workroomPdfSheet .hardware-preview-head>div:last-child{text-align:right!important}
#workroomPdfSheet .hardware-preview-head img{width:110px!important;max-height:58px!important;object-fit:contain!important}
#workroomPdfSheet .hardware-preview-head h2{font-size:17px!important;line-height:1.2!important;margin:0 0 3px!important}
#workroomPdfSheet .hardware-preview-head p,#workroomPdfSheet .hardware-preview-brand p{
  font-size:9px!important;line-height:1.25!important;margin:2px 0!important;
}
#workroomPdfSheet .hardware-preview-details{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:3px 14px!important;margin:5px 0!important;padding:0!important;
  font-size:10px!important;line-height:1.24!important;
}
#workroomPdfSheet .hardware-preview-details p{
  font-size:10px!important;line-height:1.24!important;margin:0!important;
  padding:0!important;overflow-wrap:anywhere!important;
}
#workroomPdfSheet .hardware-preview-entry{
  display:block!important;margin:10px 0 0!important;padding:7px 0 0!important;
  border-top:1px solid #c8d4df!important;break-inside:auto!important;page-break-inside:auto!important;
}
#workroomPdfSheet .hardware-preview-entry h3{
  font-size:12px!important;line-height:1.2!important;margin:0 0 4px!important;
}
#workroomPdfSheet .hardware-preview-entry .hardware-preview-details{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3px 10px!important;
}
#workroomPdfSheet .hardware-preview-entry>p{font-size:10px!important;margin:3px 0!important;line-height:1.25!important}
#workroomPdfSheet .hardware-workroom-diagram{
  width:100%!important;max-width:100%!important;min-height:0!important;
  margin:7px 0!important;padding:5px!important;border:1px solid #d8e0e8!important;
  break-inside:avoid!important;page-break-inside:avoid!important;
}
#workroomPdfSheet .hardware-workroom-diagram h4{font-size:10px!important;margin:0 0 4px!important}
#workroomPdfSheet .hardware-workroom-diagram figure{margin:2px 0!important}
#workroomPdfSheet .hardware-workroom-diagram img{
  display:block!important;width:auto!important;max-width:280px!important;
  max-height:165px!important;height:auto!important;object-fit:contain!important;margin:0!important;
}
#workroomPdfSheet .hardware-workroom-diagram p,#workroomPdfSheet .hardware-workroom-diagram figcaption{
  font-size:9px!important;margin:2px 0!important;line-height:1.2!important;
}
#workroomPdfSheet>section:not(.hardware-preview-entry){
  margin:6px 0!important;padding:6px!important;font-size:10px!important;
}
#workroomPdfSheet>section:not(.hardware-preview-entry) h3{font-size:11px!important;margin:0 0 4px!important}
#workroomPdfSheet>section:not(.hardware-preview-entry) p{font-size:10px!important;margin:2px 0!important}

/* Tighten only the whitespace between workroom form rows. Preserve input sizes. */
@media screen {
 .hardware-page .hardware-grid{row-gap:3px;column-gap:14px;margin-top:7px}
 /* Global styles.css gives each label 13px top + 6px bottom margin,
    creating the apparent double spacing despite the 3px grid gap. */
 .hardware-page .hardware-grid > label{margin:0!important}
 .hardware-page .hardware-grid > label > input,
 .hardware-page .hardware-grid > label > select,
 .hardware-page .hardware-grid > label > textarea{margin-top:5px}
 .hardware-page .hardware-grid > .hardware-wide{margin-top:2px;margin-bottom:2px}

 
 
 .hardware-page .hardware-entry-extras{margin-top:8px;padding-top:7px}
 .hardware-page .hardware-heading{margin:9px 0}
}

/* Detailed PDF export: allow long order sections to flow instead of creating blank pages. */



/* Internal copy: print the same DOM that the user reviews on screen. */
@media print {
  
  
  
  
  
  
  
}

/* Order totals bar: stays visible at the bottom of the editor while scrolling */
.workroom-totals{position:sticky;bottom:0;z-index:5;margin:18px 0 0;border:2px solid #164b73;background:#f0f7fc;box-shadow:0 -4px 14px rgba(15,23,42,.08)}
.workroom-totals-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.workroom-totals-grid>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.workroom-totals-grid small{font-weight:700;letter-spacing:.04em;color:#164b73}
.workroom-totals-grid strong{font-weight:800;color:#0f172a}
.workroom-totals-grid span{color:#64758b}
.workroom-totals>p{margin:10px 0 0;color:#64758b}
@media (max-width:640px){.workroom-totals-grid{grid-template-columns:1fr 1fr}.workroom-totals-grid strong{font-size:20px}}
@media print{.workroom-totals{display:none!important}}

/* Compact input boxes on the workroom order form: shorter height and less
   vertical padding (default 42px / 10px). Widths are unchanged. */
@media screen {
 .hardware-page input:not([type=checkbox]):not([type=radio]):not([type=file]),
 .hardware-page select{height:32px;min-height:32px;padding-top:4px;padding-bottom:4px;line-height:1.3}
 .hardware-page textarea{min-height:64px;padding-top:6px;padding-bottom:6px}
}

/* Draft controls: blue New Draft, compact green Open / red Delete buttons. */
.hardware-page #newOrder{background:linear-gradient(180deg,#0c64df,#0a57c6);border-color:#0a57c6;color:#fff;box-shadow:0 6px 16px #0b61dc24}
.hardware-page #newOrder:hover{background:#084fb6}
.hardware-page #loadOrder,.hardware-page #deleteDraft{height:32px;min-height:32px;padding:0 14px;font-size:13px;width:auto}
.hardware-page #loadOrder{background:#e7f6ec;border-color:#86c79c;color:#17663a}
.hardware-page #loadOrder:hover{background:#d3efdd}
.hardware-page #deleteDraft{background:#fdecec;border-color:#e7a3a3;color:#a12626}
.hardware-page #deleteDraft:hover{background:#fadada}

/* Compact Fabric Requirements strip (per line) */
.hardware-page .workroom-fabric-result{display:flex;align-items:center;flex-wrap:wrap;gap:6px 22px;border:1px solid #164b73;border-radius:8px;padding:6px 12px;background:#f0f7fc;margin:8px 0 4px}
.hardware-page .workroom-fabric-result>strong{font-size:11px;letter-spacing:.04em;color:#164b73}
.hardware-page .workroom-fabric-result span{display:inline-flex;align-items:baseline;gap:6px}
.hardware-page .workroom-fabric-result small{font-size:10px;font-weight:700;color:#475569}
.hardware-page .workroom-fabric-result b{font-size:17px;font-weight:800;color:#0f172a}

/* Compact order totals bar */
.workroom-totals{padding:8px 14px!important;margin-top:12px}
.workroom-totals-grid{gap:10px}
.workroom-totals-grid small{font-size:10px}
.workroom-totals-grid strong{font-size:18px;line-height:1.2}
.workroom-totals-grid span{font-size:11px}
.workroom-totals>p{margin-top:4px;font-size:11px}
.hardware-page .workroom-fabric-result .labor-cost{font-style:normal;font-weight:700;color:#0f6b3a;font-size:15px}
.hardware-page .workroom-fabric-result .labor-note{font-style:normal;font-size:11px;color:#9a5b00}

/* 2026-10-15 density pass — shared by the Hardware and Workroom order forms */
/* Shipping address in two rows: Ship to | Street | Address 2, then City | State | ZIP | Phone. */
.hardware-page .ship-address-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));column-gap:14px;row-gap:3px}
.hardware-page .ship-address-grid > .ship-col-2{grid-column:span 2}
.hardware-page .ship-address-grid > label{margin:0!important}
.hardware-page .ship-address-grid > label > input{margin-top:5px}
@media(max-width:650px){
  .hardware-page .ship-address-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hardware-page .ship-address-grid > .ship-col-2{grid-column:1/-1}
}
/* Shorter shared-drafts note. */
.hardware-test-banner{padding:7px 14px;margin-bottom:10px;font-size:13px;align-items:baseline}
/* Single-choice checkbox groups already allow only one choice; drop the "Select one." hint line. */
.hardware-choice-group > small{display:none}
