/* Shared screen layout; printed forms retain their existing page rules. */
@media screen {
 *,*::before,*::after{box-sizing:border-box}
 html,body{min-width:0;max-width:100%}
 body main,body .wrap,body .reports-page .wrap,body.reports-page .wrap,body .page{width:100%;max-width:none!important;margin-left:auto;margin-right:auto;padding-left:24px!important;padding-right:24px!important}
 .wrap.login,body .login{width:calc(100% - 32px);max-width:560px!important}
 .card,.doc,.req,.view,.grid>*,.grid3>*,.field-grid>*,.edit-grid>*,.reports-page .filters>*{min-width:0;max-width:100%}
 .header{min-width:0;gap:16px;flex-wrap:wrap}
 .portal-brand,.portal-header-user,.portal-system-title{min-width:0!important;overflow-wrap:anywhere}
 img,svg,canvas{max-width:100%}
 input,select,textarea{max-width:100%;min-width:0}
 .portal-table-scroll{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:12px 0;}
 .portal-table-scroll:focus-visible{outline:2px solid #2180b0;outline-offset:2px}
 .portal-table-scroll table{min-width:600px}
 .b2-global-nav,.tab-bar,.manager-app-tabs{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 .modal-box,.auth-box,.modal.wide,#employee-edit-modal .employee-edit-box{max-width:calc(100vw - 32px)!important;max-height:calc(100dvh - 32px);overflow:auto}
 .reports-page .filters{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
}
@media screen and (min-width:601px) and (max-width:1024px){
 body main,body .wrap,body .page{padding-left:16px!important;padding-right:16px!important}
 .grid3,.field-grid.three,.req-grid.bv-grid,.edit-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .doc-top{grid-template-columns:1fr!important;gap:16px}
 .header{padding:16px!important}
}
@media screen and (max-width:600px){
 body main,body .wrap,body .page{padding-left:12px!important;padding-right:12px!important}
 .header{padding:12px!important;flex-direction:column;align-items:flex-start!important}
 .header .portal-system-title{text-align:left!important;font-size:14px!important;line-height:1.4}
 .portal-header-user{text-align:left!important;width:100%}
 .card,.doc,.req{padding:16px!important;border-radius:10px}
 .grid,.grid3,.field-grid,.field-grid.three,.field-grid.full,.edit-grid,.req-grid,.req-grid.bv-grid,.doc-top,.doc-grid,.project-form-head,.leave-choice-row,.reports-page .filters{grid-template-columns:minmax(0,1fr)!important}
 .grid>*,.grid3>*,.field-grid>*,.edit-grid>*,.doc-top>*{grid-column:auto!important}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;min-height:44px}
 button,.btn{min-height:44px;max-width:100%;white-space:normal}
 .actions,.req-actions,.modal-actions{flex-wrap:wrap;gap:8px}
 .actions>*,.req-actions>*{max-width:100%}
 #ems-allowance-form>div:first-child{flex-wrap:wrap;align-items:stretch!important}
 #ems-allowance-form>div:first-child label:first-child{flex-basis:100%!important}
 #ems-allowance-form>div:nth-child(2){grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
 #ems-allowance-form>div:nth-child(2)>:nth-child(1){grid-row:1}
 #ems-allowance-form>div:nth-child(2)>:nth-child(3){grid-row:2;margin-bottom:12px}
 #ems-allowance-form>div:nth-child(2)>:nth-child(2){grid-row:3}
 #ems-allowance-form>div:nth-child(2)>:nth-child(4){grid-row:4}
 #ems-allowance-form button{width:100%;justify-self:stretch!important}
 .ems-bulk-grid{grid-template-columns:minmax(0,1fr)!important}
 .ems-bulk-grid>:nth-child(1){grid-row:1}.ems-bulk-grid>:nth-child(3){grid-row:2}.ems-bulk-grid>:nth-child(2){grid-row:3}.ems-bulk-grid>:nth-child(4){grid-row:4}
 .b2-global-nav a,.tab-btn{min-height:44px;display:inline-flex;align-items:center}
 .hero h1,.title{font-size:24px!important;overflow-wrap:anywhere}
 .modal-box,.auth-box,.modal.wide{padding:16px!important}
}
@media print{.portal-table-scroll{display:contents}}
