/* Only the confirmation dialog; base fonts, buttons and surfaces stay shared. */
#document-preview .cc-detail-table{table-layout:fixed;min-width:690px}
#document-preview .cc-detail-table th:nth-child(1){width:15%}#document-preview .cc-detail-table th:nth-child(2){width:44%}#document-preview .cc-detail-table th:nth-child(3){width:19%}
#document-preview .cc-material{display:grid;grid-template-columns:36px minmax(0,1fr);gap:8px;margin-bottom:6px}
#document-preview .cc-material strong{font-weight:500}#document-preview .cc-multiline{white-space:pre-wrap;overflow-wrap:anywhere}
#document-preview .cc-sign-grid{display:grid;grid-template-columns:180px minmax(240px,1fr);gap:16px;padding:16px;align-items:end}
#document-preview .cc-sign-grid input{height:40px;width:100%}#document-preview .cc-check{display:flex;flex-direction:row;align-items:center;gap:8px;padding:0 16px 16px}#document-preview .cc-check input{min-height:18px;width:18px;height:18px;flex:none}
#document-preview .cc-photos{display:flex;gap:12px;flex-wrap:wrap}#document-preview .cc-photos details{width:100%}#document-preview .cc-photos summary{cursor:pointer;color:var(--d-blue)}#document-preview .cc-photos img{display:block;max-width:100%;max-height:60vh;object-fit:contain;border:1px solid var(--d-line);margin-top:12px}
#document-preview #cc-status:not(:empty){border-left:3px solid var(--d-blue);background:var(--d-soft)}
@media(max-width:680px){#document-preview .cc-sign-grid{grid-template-columns:1fr}}

#document-preview dialog.cc-confirmation-dialog>header{position:sticky;top:0;z-index:2}

/* Cabinet sections keep the document typography and controls. */
#document-preview .cc-cabinet{margin:16px;border:1px solid var(--d-line);border-radius:4px;overflow:hidden}
#document-preview .cc-cabinet>.bar{padding:12px 16px;background:var(--d-soft);border-bottom:1px solid var(--d-line);margin:0}
#document-preview .cc-cabinet h3{font-size:16px;font-weight:600;margin:0}
#document-preview .cc-cabinet-body{padding:16px}
#document-preview .cc-material-table{table-layout:fixed;width:100%;min-width:0}
#document-preview .cc-material-table th{font-weight:500;vertical-align:top}
#document-preview .cc-material-table small{display:block}
#document-preview .cc-subtitle{margin:18px 0 12px!important}
#document-preview .cc-image-tools{display:grid;grid-template-columns:minmax(180px,1fr) auto minmax(220px,1fr);gap:12px;align-items:end}
#document-preview .cc-image-tools label{min-width:0;display:flex;flex-direction:column;gap:6px}
#document-preview .cc-image-tools input,#document-preview .cc-image-tools select,#document-preview .cc-image-tools button{height:40px;min-height:40px;box-sizing:border-box;width:100%;margin:0;font-size:14px}
#document-preview .cc-image-tools input[type=file]{padding:6px}
#document-preview .cc-image-help{display:block;margin:8px 0 12px;color:var(--d-muted)}
#document-preview .cc-design-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
#document-preview .cc-drawing{border:1px solid var(--d-line);padding:10px;border-radius:4px;min-width:0}
#document-preview .cc-drawing summary{cursor:pointer;list-style:none;overflow-wrap:anywhere;font-size:14px}
#document-preview .cc-drawing summary img{display:block;width:100%;height:180px;object-fit:contain;background:var(--d-soft);margin-bottom:8px}
#document-preview .cc-drawing:has(details[open]){grid-column:1/-1}
#document-preview .cc-drawing details[open] summary img{display:none}
#document-preview .cc-large-image{display:block;max-width:100%;max-height:70vh;margin:12px auto;object-fit:contain}
#document-preview .cc-drawing button{margin-top:8px}
#document-preview .cc-special{margin-top:16px}
#document-preview .cc-special label{display:flex;flex-direction:column;gap:6px}
#document-preview .cc-special textarea{width:100%;min-height:76px;box-sizing:border-box}
#document-preview .cc-cabinet .print-notes{white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0}
#document-preview .cc-cabinet .print-notes strong{display:block}
@media(max-width:780px){#document-preview .cc-image-tools{grid-template-columns:minmax(0,1fr) auto}#document-preview .cc-image-tools label:last-child{grid-column:1/-1}#document-preview .cc-design-images{grid-template-columns:1fr}}
/* The same scoped sheet rules are also loaded in this preview's print shell. */
.document-print-paper .cc-cabinet{margin:18px 0 24px}
.document-print-paper .cc-cabinet>.bar{background:#f0f3f6;border-bottom:1px solid #9ba8b5;padding:8px}
.document-print-paper .cc-cabinet>.bar h3{margin:0}
.document-print-paper .cc-print-drawing{break-inside:avoid;margin:12px 0}
.document-print-paper .cc-print-drawing img{display:block;max-width:100%;width:auto;height:auto;max-height:195mm;margin:0 auto;object-fit:contain}
.document-print-paper .cc-print-drawing p{font-size:12px;text-align:center;margin:6px 0}
.document-print-paper .cc-special{break-inside:avoid}

/* Optional sections share the existing sheet typography and control variables. */
#document-preview .cc-overview{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0}
#document-preview .cc-overview h2{margin:0;font-size:18px}
#document-preview .cc-section{margin:14px 0}
#document-preview .cc-section>.bar{padding:12px 16px;background:var(--d-soft);border-bottom:1px solid var(--d-line)}
#document-preview .cc-section>.bar h2{margin:0;font-size:18px;font-weight:600}
#document-preview .cc-section>.pad{padding:16px}
#document-preview .cc-muted{display:block;color:var(--d-muted);margin:10px 0}
#document-preview .cc-entry-block+ .cc-entry-block{margin-top:20px;padding-top:16px;border-top:1px solid var(--d-line)}
#document-preview .cc-entry-block h3{font-size:16px;margin:0 0 12px}
#document-preview .cc-picks{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
#document-preview .cc-picks button{height:36px;font-size:14px;min-width:74px}
#document-preview .cc-picks button[aria-pressed=true]{color:var(--d-blue);border-color:var(--d-blue);background:var(--d-soft)}
#document-preview .cc-picks button[aria-pressed=true]::before{content:'✓ ';font-weight:700}
#document-preview .cc-import{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end;margin:12px 0}
#document-preview .cc-import label{display:flex;flex-direction:column;gap:6px;min-width:0}
#document-preview .cc-import select,#document-preview .cc-import button{height:40px;min-height:40px;font-size:14px;box-sizing:border-box;margin:0}
#document-preview .cc-import select{width:100%;min-width:0}
#document-preview .cc-entry-table{table-layout:fixed;width:100%;min-width:0}
#document-preview .cc-entry-table td{vertical-align:top;padding:10px 8px}
#document-preview .cc-entry-table input,#document-preview .cc-entry-table textarea,#document-preview .cc-entry-table button{box-sizing:border-box;min-height:64px;height:64px;margin:0;width:100%;font-size:14px;line-height:20px}
#document-preview .cc-entry-table textarea{resize:vertical}
#document-preview .cc-section textarea{width:100%;box-sizing:border-box}
#document-preview .cc-main-actions{flex-wrap:wrap;gap:12px}
#document-preview .cc-paper-sign{margin:16px 0}
#document-preview .cc-paper-sign>summary{cursor:pointer;padding:14px 16px;font-size:16px;font-weight:600}
#document-preview .cc-customer{width:100%;max-width:720px;margin:0 auto;padding:16px;box-sizing:border-box}
#document-preview .cc-customer h2{font-size:20px}
#document-preview .cc-customer h3{font-size:16px;margin-top:24px}
#document-preview .cc-customer .cc-cabinet{margin:16px 0}
#document-preview .cc-customer .cc-design-images{grid-template-columns:1fr}
#document-preview .cc-customer-sign{display:grid;gap:12px;margin-top:24px}
#document-preview .cc-customer-sign label{display:flex;flex-direction:column;gap:8px}
#document-preview .cc-customer-sign h3,#document-preview .cc-sign-consent{margin:0}
#document-preview .cc-sign-actions{display:flex;gap:12px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
#document-preview .cc-sign-actions button{height:40px;margin:0;font-size:14px}
#document-preview .cc-sign-consent{font-size:14px;line-height:1.6;color:var(--d-muted,#52647a)}
#document-preview .cc-signature{display:block;width:100%;max-width:700px;height:180px;background:#fff;border:1px solid var(--d-line);border-radius:4px;box-sizing:border-box;touch-action:none}
@media(max-width:680px){#document-preview .cc-overview{align-items:flex-start;flex-direction:column}#document-preview .cc-entry-table td{padding:8px 4px}#document-preview .cc-entry-table input,#document-preview .cc-entry-table textarea,#document-preview .cc-entry-table button{font-size:13px}#document-preview .cc-customer{padding:4px}#document-preview .cc-main-actions .actions{display:flex;flex-wrap:wrap}}

#document-preview .cc-material-refresh{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0;flex-wrap:wrap}
#document-preview .cc-material-refresh button{height:40px;font-size:14px}

/* Material confirmation uses one grid in designer and customer views. */
#document-preview .cc-material-scroll,.document-print-paper .cc-material-scroll{width:100%;overflow-x:auto}
#document-preview .cc-material-grid,.document-print-paper .cc-material-grid{border-collapse:collapse;table-layout:auto;min-width:600px}
#document-preview .cc-material-grid th,#document-preview .cc-material-grid td,.document-print-paper .cc-material-grid th,.document-print-paper .cc-material-grid td{border:1px solid var(--d-line,#9ba8b5);padding:6px 10px;text-align:center;vertical-align:middle;font-size:14px;line-height:20px;font-weight:400;white-space:nowrap;overflow-wrap:normal}
#document-preview .cc-material-grid th,.document-print-paper .cc-material-grid th{background:var(--d-soft,#f0f3f6);font-weight:600}

/* Hardware uses the material grid and existing form controls, one line per item. */
#document-preview .cc-hardware-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
#document-preview .cc-hardware-heading h3{margin:0}
#document-preview .cc-hardware-picker{display:grid;grid-template-columns:220px minmax(260px,1fr) auto;gap:8px;align-items:center;margin:10px 0}
#document-preview .cc-hardware-picker input,#document-preview .cc-hardware-picker select,#document-preview .cc-hardware-picker button,#document-preview .cc-hardware-heading button,#document-preview .cc-hardware-grid input,#document-preview .cc-hardware-grid button{height:32px;min-height:32px;font-size:14px;line-height:20px;box-sizing:border-box;margin:0;padding:5px 8px;white-space:nowrap}
#document-preview .cc-hardware-grid input{width:100%;min-width:100px;text-align:center}
#document-preview .cc-hardware-grid td{padding:4px 8px}
#document-preview .cc-hardware-grid button{width:100%}
#document-preview .cc-hardware-defaults{margin:12px 0}
#document-preview .cc-hardware-defaults .cc-picks{margin:12px 0 0}
@media(max-width:680px){#document-preview .cc-hardware-picker{grid-template-columns:160px minmax(200px,1fr) auto;overflow-x:auto}}
