/* Preserve the established design while making touch, keyboard and small screens usable. */
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:3px solid #1677ff;outline-offset:3px}
button:disabled{opacity:.6;cursor:wait}
aside{overflow-y:auto;overscroll-behavior:contain}
main,.panel,.workspace-card,.stats article,.invoice-stats article{min-width:0}
header{height:auto;min-height:104px;gap:12px;padding-top:14px;padding-bottom:14px}
header h1,.stats strong,.kv strong,.workspace-notes,.doc strong,.evidence-row strong{overflow-wrap:anywhere}
.doc>div,.evidence-row>div{min-width:0}.doc button{flex-shrink:0}
dialog{max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
.modal-head>div{min-width:0}.modal-head .icon-btn{flex-shrink:0}
.modal-actions,.workspace-actions,.table-actions{display:flex;flex-wrap:wrap;gap:8px}
.portal-notice{position:fixed;z-index:1000;top:max(12px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(620px,calc(100% - 24px));background:#fff;border:1px solid #1677ff;border-radius:12px;box-shadow:0 10px 40px #061a3040;padding:16px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:14px;color:#142033}
.portal-notice[hidden]{display:none}.portal-notice span{flex:1 1 250px}.portal-notice a{color:#075bc4}
.fi-mobile-sheet,.mobile-sheet{max-height:calc(100dvh - 110px - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain}
body.fi-menu-open{overflow:hidden}
@media(max-width:850px){
 input,select,textarea{font-size:16px!important;max-width:100%;min-width:0}
 button,.mini-btn,.mini,.icon-btn{min-height:44px}
 .icon-btn,[data-sheet-close],#closeMobileSheet{min-width:44px;min-height:44px}
 .stats strong{font-size:clamp(20px,5.5vw,28px)}
 .login,.auth-shell{min-height:100dvh;padding:20px 14px}
 .app main{padding-bottom:calc(100px + env(safe-area-inset-bottom))!important}
 .form-grid,.workspace-grid,.tm-columns{grid-template-columns:minmax(0,1fr)}
 .form-grid .full{grid-column:auto}.evidence-row{flex-wrap:wrap}
 .toolbar{display:flex;align-items:flex-start;flex-wrap:wrap}.toolbar>div{flex:1 1 200px}
 .table-wrap,.table{max-width:100%;-webkit-overflow-scrolling:touch}
 .workspace-shell{padding:18px}.modal-head h2{overflow-wrap:anywhere}
 .fi-mobile-nav button small,.mobile-nav button small{font-size:10px}
 .fi-sheet-items button strong,.sheet-items button{font-size:13px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
