:root{--hm-safe-bottom:env(safe-area-inset-bottom,0px)}
html{-webkit-text-size-adjust:100%;min-height:100%}
body{min-height:100vh;min-height:100dvh}
.hm-install-button{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:calc(16px + var(--hm-safe-bottom));z-index:1100;min-height:44px;padding:11px 16px;border:1px solid #d5e0e3;border-radius:24px;background:#173740;color:white;box-shadow:0 4px 18px #102e3630;font:600 13px system-ui;cursor:pointer}
.hm-install-dialog{box-sizing:border-box;width:min(460px,calc(100% - 32px));max-height:calc(100dvh - 40px);overflow:auto;padding:26px;border:1px solid #dfe7e9;border-radius:22px;background:#fff;color:#173740;box-shadow:0 20px 80px #102e3640;font:15px/1.6 system-ui}
.hm-install-dialog::backdrop{background:#102e3680}
.hm-install-dialog img{display:block;width:64px;height:64px;border-radius:15px;margin-bottom:16px}
.hm-install-dialog h2{font:700 23px/1.25 system-ui;margin:0 0 14px}
.hm-install-dialog p,.hm-install-dialog li{font-size:15px;line-height:1.65}
.hm-install-dialog ol{padding-left:22px}.hm-install-dialog li{padding:5px 0}
.hm-install-dialog button{min-height:44px;padding:10px 18px;background:#173740;color:white;border:0;border-radius:10px;font:600 15px system-ui;cursor:pointer}
.hm-network-note{position:fixed;left:12px;right:12px;bottom:calc(70px + var(--hm-safe-bottom));z-index:1090;padding:12px 16px;border:1px solid #dfbd78;border-radius:12px;background:#fff7e5;color:#67491e;font:14px/1.5 system-ui;box-shadow:0 3px 15px #102e3620}
@media(max-width:850px){
 body{padding-bottom:calc(78px + var(--hm-safe-bottom))}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}
 button,.button{min-height:44px;touch-action:manipulation}
 main{min-width:0;overflow-wrap:anywhere;padding-left:max(18px,env(safe-area-inset-left));padding-right:max(18px,env(safe-area-inset-right))}
 dialog:not(.hm-install-dialog){max-height:calc(100dvh - 32px - var(--hm-safe-bottom));overflow:auto}
 .topbar,.top-actions{flex-wrap:wrap}.header-heading{min-width:0}.header-actions{max-width:100%}
 .shell>aside{padding-top:max(24px,env(safe-area-inset-top));padding-bottom:calc(20px + var(--hm-safe-bottom))}
 .layout>aside nav{scrollbar-width:thin;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
 .table-wrap,.table-scroll{max-width:100%;-webkit-overflow-scrolling:touch}
 .two,.field-grid,.service-grid{grid-template-columns:minmax(0,1fr)}
 .layout>main{padding-bottom:30px}
}
@media(display-mode:standalone){body{padding-top:env(safe-area-inset-top,0px)}.hm-install-button{display:none}}
@media print{.hm-install-button,.hm-network-note,.hm-install-dialog{display:none!important}body{padding:0}}
/* Mobile layout repair: names, dates and actions keep their own full-width rows. */
@media(max-width:760px){
 main{overflow-wrap:break-word}
 .business-maintenance .panel-heading{flex-direction:column;align-items:flex-start;gap:10px;margin-bottom:16px}
 .business-maintenance .panel-heading>div{width:100%}
 .business-maintenance .panel-heading h2{font-size:20px;line-height:1.35;margin:7px 0 0}
 .business-maintenance .panel-heading .text-button{white-space:normal;text-align:left;font-size:13px;min-height:44px;padding:8px 0;justify-content:flex-start}
 .business-due{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:9px;padding:16px;margin:0 0 12px;border:1px solid #e1e9e5;border-radius:12px;background:#f8faf9}
 .business-due strong{display:block;flex:none;width:100%;min-width:0;max-width:100%;font-size:14px;line-height:1.55;white-space:normal;word-break:normal;overflow-wrap:break-word}
 .business-due span{display:block;min-width:0;font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:break-word}
 .business-due>button{justify-self:stretch;width:100%;min-height:44px;margin-top:4px;font-size:14px;background:white}
 .business-order-card{display:grid;grid-template-columns:50px minmax(0,1fr);align-items:start;gap:10px 12px;padding:16px 0}
 .business-order-date{width:50px}
 .business-order-body{min-width:0;width:100%;flex:none}
 .business-order-body strong{display:block;line-height:1.5;overflow-wrap:break-word}
 .business-order-body p,.business-order-body small{overflow-wrap:break-word}
 .business-order-card>.business-badge,.business-order-card>.business-urgent{grid-column:2;justify-self:start;margin-left:0;white-space:normal}
 .business-order-card>button{grid-column:1/-1;width:100%;font-size:14px;min-height:44px;margin-top:4px}
 .business-line{flex-direction:column;align-items:stretch;gap:10px}
 .business-line>span{min-width:0;width:100%;overflow-wrap:break-word}
 .business-line button{width:100%;min-height:44px;font-size:13px}
 .business-toolbar>label{min-width:0;flex-basis:100%}
 .business-toolbar>.primary{width:100%;min-height:44px}
 .business-welcome h2{font-size:26px;line-height:1.25;letter-spacing:-.7px}
 .business-client-card h3{font-size:16px;line-height:1.4;overflow-wrap:break-word}
 #businessDialog{width:calc(100% - 24px);padding:18px}
}
