body:has(.s4-ribbon){padding-bottom:calc(80px + env(safe-area-inset-bottom,0px))}
.s4-ribbon{position:fixed;z-index:2000;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));background:#263342;padding-bottom:env(safe-area-inset-bottom,0px);box-shadow:0 -2px 12px #0002}
.s4-ribbon a{box-sizing:border-box;min-width:0;height:64px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;color:white;text-decoration:none;font:500 12px/1.1 system-ui,sans-serif;border-top:3px solid transparent}
.s4-ribbon a[aria-current=page]{background:#af4b14;border-top-color:#fff}.s4-ribbon a:focus-visible{outline:3px solid #fff;outline-offset:-4px}.s4-ribbon svg{width:24px;height:24px;flex:none}.s4-ribbon span{white-space:nowrap}
#hc-preview .s4-panel{padding:16px;margin:16px 0;background:var(--paper,#1b2226);color:var(--ink,#f1f4f5);border:1px solid var(--line,#3b474e);border-radius:12px}
/* One shared, contiguous payment ribbon for draft, saved and correction views. */
#hc-preview .s4-payment-ribbon{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:16px 0;padding:0;background:var(--paper,#1b2226);color:var(--ink,#f1f4f5);border:1px solid var(--line,#3b474e);border-radius:8px;overflow:hidden}
#hc-preview .s4-payment-ribbon>div{min-width:0;margin:0;padding:12px 8px;background:transparent;border:0;border-radius:0}
#hc-preview .s4-payment-ribbon>div+div{border-inline-start:1px solid var(--line,#3b474e)}
#hc-preview .s4-payment-ribbon dt{font-size:12px;line-height:1.3;color:var(--soft,#b5c0c6);overflow-wrap:anywhere}
#hc-preview .s4-payment-ribbon dd{margin:6px 0 0;font-size:clamp(13px,3.5vw,18px);line-height:1.35;font-weight:700;color:var(--ink,#f1f4f5);overflow-wrap:anywhere}
#hc-preview .s4-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}
body.workshop #hc-preview .s4-actions>:is(button,.button){box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:56px;margin:0;padding:7px;font-size:16px;line-height:1.2;text-align:center;white-space:normal;overflow-wrap:normal}
#hc-preview .s4-editor .s4-actions,#hc-preview .record-form>.s4-actions{margin-inline:17px}
#hc-preview .s4-response-actions>button:last-child:nth-child(odd){grid-column:1/-1}
#hc-preview .s4-panel :is(label,.muted){color:var(--soft,#b5c0c6)}

#hc-preview .s4-check{display:flex;align-items:center;gap:12px;min-height:44px;font-size:16px}#hc-preview .s4-check input{width:20px;height:20px;margin:0;flex:none}
#hc-preview .s4-panel input:not([type=checkbox]),#hc-preview .s4-panel select,#hc-preview .s4-editor input,#hc-preview .s4-editor select{min-height:44px;font-size:16px}
#hc-preview .s4-panel button,#hc-preview .s4-panel .button,#hc-preview .s4-editor button{min-height:44px;font-size:16px}
#hc-preview .vehicle-row-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px}#hc-preview .vehicle-view-icon{min-height:44px;display:flex;justify-content:center;align-items:center}
#hc-preview .vehicle-job-open{box-sizing:border-box;width:120px;min-width:120px;text-align:center;white-space:nowrap}#hc-preview .workshop-vin{font-family:inherit;font-size:inherit;letter-spacing:normal}
#s4-unsaved{max-width:480px;border:0;border-radius:14px;padding:24px;margin:auto;background:white;color:#263342}#s4-unsaved::backdrop{background:#0007}#s4-unsaved button{padding:12px;min-height:44px;font-size:16px}
#hc-preview .s4-warning{padding:12px;border-left:4px solid #df7b3b;background:#33271e;color:var(--ink,#f1f4f5)}#hc-preview .s4-history{font-size:14px}#hc-preview .s4-history li{margin:8px 0}

html:has(.s4-ribbon){scroll-padding-bottom:calc(90px + env(safe-area-inset-bottom,0px))}
body:has(.s4-ribbon) #hc-preview input:not([type=checkbox]):not([type=hidden]),body:has(.s4-ribbon) #hc-preview select,body:has(.s4-ribbon) #hc-preview textarea{font-size:16px;min-height:44px;scroll-margin-bottom:100px}
body:has(.s4-ribbon) #hc-preview .actions:not(.s4-actions) button,body:has(.s4-ribbon) #hc-preview .actions:not(.s4-actions) .button{min-height:44px}

/* MOT overview action: keep icon and label visibly separated. */
body.workshop #hc-preview a.mot-data-button{display:inline-flex;align-items:center;justify-content:center;gap:2ch}
body.workshop #hc-preview .mot-data-button img{display:block;width:28px;height:28px;flex:none;object-fit:contain}

/* Compact customer actions: clear symbols with phone-sized touch targets. */
body.workshop #hc-preview[data-theme=workshop] .customer-heading-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
body.workshop #hc-preview[data-theme=workshop] .customer-heading-actions a.customer-action-icon{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;max-height:44px!important;padding:10px!important;flex:0 0 44px;margin:0;color:#f1f4f5!important}
body.workshop #hc-preview .customer-action-icon svg{display:block;width:20px;height:20px;flex:none}

/* Shared edit-form save: one native submit, fixed within reach. */
body:has(.edit-floating-save){padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
body.workshop #hc-preview[data-theme=workshop] button.edit-floating-save{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:1500;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;min-width:48px;height:48px;min-height:48px;padding:12px;border-radius:50%;background:#df7b3b!important;color:#101416!important;border-color:#df7b3b!important;box-shadow:0 3px 12px #0006}
#hc-preview .edit-floating-save svg{display:block;width:24px;height:24px;flex:none}

/* Match the Job workspace side spacing on phones and iPads only. */
@media(max-width:1100px),(pointer:coarse){
body.workshop #hc-preview:is([data-screen=documents],[data-screen=diagnostic])>article.admin-panel:has(.job-hub){width:calc(100% - 24px);max-width:none;margin-inline:auto}
}
@media(max-width:650px){
body.workshop #hc-preview:is([data-screen=documents],[data-screen=diagnostic])>article.admin-panel:has(.job-hub){width:calc(100% - 8px)}
}

/* Workspace saves sit above the fixed job-navigation ribbon. */
body.workshop:has(.s4-ribbon) #hc-preview[data-theme=workshop] button.edit-floating-save{bottom:calc(80px + env(safe-area-inset-bottom,0px))}
body:has(.s4-ribbon):has(.edit-floating-save){padding-bottom:calc(144px + env(safe-area-inset-bottom,0px))}
#hc-preview .s4-preview-actions{grid-template-columns:minmax(0,1fr)}

/* Compact Invoice actions, with preview immediately above issue. */
body.workshop #hc-preview .s4-invoice-screen .s4-actions>:is(button,.button){min-height:44px;padding:6px 8px;font-size:14px;line-height:1.2}
#hc-preview .s4-invoice-screen .s4-invoice-issue{margin:8px 17px 0}
body.workshop #hc-preview .s4-invoice-issue>button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;min-height:44px;margin:0;padding:6px 8px;font-size:14px;line-height:1.2}
#hc-preview .s4-invoice-screen .s4-payment-ribbon>div{display:flex;flex-direction:column;padding:10px 6px}
#hc-preview .s4-invoice-screen .s4-payment-ribbon dt{min-height:2.6em;font-size:12px;line-height:1.3;overflow-wrap:normal}
#hc-preview .s4-invoice-screen .s4-payment-ribbon dd{margin:6px 0 0;font-size:clamp(11px,3.3vw,16px);line-height:1.35}
#hc-preview .s4-payment-amount{display:block;white-space:nowrap;font-variant-numeric:tabular-nums}
#hc-preview .s4-balance-state{display:block;margin-top:3px;font-size:11px;line-height:1.3;font-weight:400;color:var(--soft,#b5c0c6)}

/* Sharing is app UI; it does not use the white customer document theme. */
body.workshop #hc-preview .document-share-panel{padding:14px;margin:16px 0;background:var(--paper,#1b2226);color:var(--ink,#f1f4f5);border:1px solid var(--line,#3b474e);border-radius:10px;scroll-margin-top:12px}
#hc-preview .document-share-panel label,#hc-preview .document-share-panel .muted{color:var(--soft,#b5c0c6)}
#hc-preview .document-share-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin-top:16px}
body.workshop #hc-preview .document-share-actions .share-action{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:100%;min-width:0;min-height:60px;margin:0;padding:9px 12px;text-align:center;white-space:normal;text-decoration:none}
#hc-preview .share-action-label{font-size:14px;line-height:1.3;font-weight:600}
#hc-preview .document-share-actions .share-action small{font-size:12px;line-height:1.35;font-weight:400;color:var(--soft,#b5c0c6)}
#hc-preview .document-share-panel input,#hc-preview .document-share-panel textarea{color:var(--ink,#f1f4f5);background:#131a1e;font-size:16px}

/* Compact WhatsApp marks remain beside the action text. */
.whatsapp-icon{display:inline-block!important;width:17px!important;height:17px!important;min-width:17px;flex:0 0 17px;vertical-align:-3px;margin-left:6px;pointer-events:none}
.whatsapp-label{display:inline-flex;align-items:center;white-space:nowrap}
.share-action-heading{display:inline-flex;align-items:center;justify-content:center}

#hc-preview .document-share-actions a.share-action small{color:inherit}

/* Respect conditional floating-save visibility despite its flex layout. */
body.workshop #hc-preview[data-theme=workshop] button.edit-floating-save[hidden]{display:none!important}
