/* Shared layout rules. Tables scroll in their own containers, not the page. */
html{scroll-padding-top:110px}
body{min-width:320px}
body>nav>div,body>main{width:100%;max-width:1800px!important}
body>nav .app-nav-row{height:auto!important;min-height:72px;gap:12px;padding-block:10px}
.app-nav-main{min-width:0;flex:1}
.app-nav-links{min-width:0;align-items:center;scrollbar-width:thin}
.app-company-filter{flex-shrink:0;gap:8px}
.app-company-filter>div{width:clamp(180px,18vw,256px)}
main>div[id^="view-"],main>div[id^="view-"]>div{min-width:0}
main input,main select,main textarea,.ts-wrapper{max-width:100%}
:is(.recon-scroll,.ac-table-wrap,.tablewrap,#view-transactions .overflow-y-auto,#modal-statement .overflow-y-auto){overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.recon-panel,.sc-transfer-panel,.settings-hub-detail-content{min-width:0}
.recon-toolbar,.recon-setup-summary,.sc-transfer-panel-heading{flex-wrap:wrap}
.recon-toolbar>div,.recon-setup-summary-actions{min-width:0;flex-wrap:wrap}
.modal-enter{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-y:auto}
#modal-statement .overflow-y-auto{min-height:0}
.sc-drawer{max-height:calc(100dvh - 32px)}
@media(min-width:1600px){body>main{padding-inline:40px!important}#view-dashboard .dash-workspace{grid-template-columns:minmax(0,1fr) 360px}}
@media(max-width:1200px){
 body>nav .app-nav-row{flex-wrap:wrap}
 .app-nav-main{flex-wrap:wrap;flex-basis:100%;gap:10px}
 nav .app-nav-links{display:flex!important;flex:1;margin-left:12px!important;overflow-x:auto}
 .app-company-filter{margin-left:auto}
 .app-company-filter>div{width:240px}
 #view-dashboard .dash-section-title{flex-wrap:wrap}
 #view-dashboard .dash-workspace{height:clamp(460px,calc(100dvh - 320px),620px)}
}
@media(max-width:900px){
 .recon-map-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .sc-transfer-head{flex-wrap:wrap}
 #view-settings .settings-card-grid{grid-template-columns:1fr}
 .ac-user-controls label{min-width:0;flex-basis:240px}
}
@media(max-width:767px){
 input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px}
 body>main>section{min-width:0}
 body>main .tablewrap{max-width:100%;overflow-x:auto}
 body>main .buttons{flex-wrap:wrap}
 body>nav{position:relative!important;margin-bottom:18px!important}
 body>nav .app-nav-row{gap:8px;padding-block:12px}
 .app-nav-main{gap:8px}
 nav .app-nav-links{flex-basis:100%;width:100%;margin:4px 0 0!important;flex-wrap:nowrap;white-space:nowrap}
 nav .app-nav-links>button{flex-shrink:0;min-height:44px}
 .app-company-filter{width:100%;justify-content:space-between}
 .app-company-filter>span{display:block!important;font-size:12px;white-space:nowrap}
 .app-company-filter>div{width:auto;flex:1;max-width:380px}
 main{padding-inline:16px!important;padding-bottom:32px!important}
 #view-dashboard .dash-workspace{height:auto}
 #view-dashboard .dash-period-tabs{max-width:100%;flex-wrap:wrap}
 #view-dashboard .dash-period-tabs button{min-height:40px}
 .sc-plan-toolbar{flex-wrap:wrap;align-items:flex-start}
 .recon-panel{padding:16px}
 .recon-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .recon-toolbar-actions{align-items:stretch}
 .recon-tabs{max-width:100%;overflow-x:auto;flex-wrap:nowrap}
 .recon-tab{flex-shrink:0}
 .sc-drawer{max-height:100dvh}
 #modal-statement-edit>div{max-height:calc(100dvh - 24px);padding:16px}
 #modal-statement-edit .sc-record-footer>div{flex-wrap:wrap;gap:10px}
 .help-modal__panel{max-height:calc(100dvh - 32px);margin:16px auto}
}
@media(max-width:480px){
 body>main .buttons>button{flex:1 1 100%;min-height:44px}
 main{padding-inline:12px!important}
 #view-dashboard .dash-kpis{grid-template-columns:1fr}
 #view-dashboard .dash-kpis .dash-card{padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
 #view-dashboard .dash-kpis .dash-number{font-size:23px;white-space:nowrap}
 #view-dashboard .dash-kpis .dash-label{font-size:12px}
 #view-dashboard .dash-main-chart{height:380px}
 .settings-hub-tile{padding:16px 12px;gap:10px}
 .settings-hub-detail-head{padding:14px}
 .recon-grid,.recon-map-grid{grid-template-columns:1fr}
 .sc-transfer-context{white-space:normal}
 .sc-transfer-buttons input[type="file"]{width:100%;min-width:0}
 .sc-add-plan{width:100%;min-height:44px;text-align:center}
 #frequency-option-form>label{min-width:0!important;width:100%;flex-basis:100%}
 #company-create-form{flex-wrap:wrap}
 #modal-statement-edit #statement-edit-save,#modal-statement-edit #statement-edit-cancel{min-width:0;flex:1;padding-inline:12px}
 .history-edit{width:44px;height:44px}
}
@media(max-height:500px) and (orientation:landscape){
 body>nav{position:relative!important}
 .sc-drawer{top:0;bottom:0;max-height:100dvh}
 .sc-drawer-header{position:relative}
}
