/* Shared mobile layout. Desktop styles and business data remain unchanged. */
.mobile-menu-toggle{display:none}
@media(max-width:800px){
 html{scroll-padding-top:12px}body{overflow-wrap:break-word}
 header{padding:8px 12px;gap:8px;align-items:center;flex-wrap:wrap}
 header .brand{flex:0 0 90px}.brand .logo{width:85px;height:48px}.brandversion{font-size:6px}
 header .headeractions{order:1;min-width:0;max-width:calc(100% - 98px);gap:4px;flex-wrap:wrap;justify-content:flex-end}
 .headeractions #who{max-width:140px;font-size:12px;overflow:hidden;text-overflow:ellipsis}
 .headeractions button{min-height:44px;padding:9px;font-size:12px}
 #userMenuWrap{max-width:100%}.user-menu{position:fixed;top:76px;right:12px;max-height:calc(100dvh - 96px);overflow-y:auto;z-index:50;width:min(300px,calc(100vw - 24px))}
 .user-menu button{min-height:44px}#who::after{flex-shrink:0}
 .mobile-menu-toggle{display:flex;order:2;flex:1 0 100%;align-items:center;justify-content:space-between;min-height:44px;background:var(--bg);margin-top:2px}
 .auth .mobile-menu-toggle{display:none}
 header #nav{display:none;order:3;flex:1 0 100%;width:100%;padding:6px 0;overflow:visible;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 header.mobile-nav-open #nav{display:grid}header #nav button{min-height:48px;white-space:normal;text-align:left;padding:10px;font-size:13px}
 main{padding:20px 12px;min-width:0;max-width:100%}main>*{min-width:0}
 h1{font-size:24px;overflow-wrap:anywhere}h2{overflow-wrap:anywhere}
 button,a,input,select,textarea{touch-action:manipulation}button{min-height:44px}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px;min-width:0;max-width:100%;min-height:44px}textarea{min-height:100px}
 input[type=checkbox],input[type=radio]{min-width:20px;min-height:20px}
 .titlebar,.panelhead,.dash-panel-head,.work-heading{flex-wrap:wrap;gap:12px}.titlebar{align-items:flex-start;margin-bottom:18px}.titlebar .primary{font-size:13px;white-space:normal}
 .panelhead,.detail,.settings,.searchpanel,.customer-directory,.ops-content{padding:16px}
 .toolbar,.customer-controls,.detailactions,.pro-tabs,.helper-toolbar,.ops-toolbar{flex-wrap:wrap;gap:8px}
 .toolbar>*{min-width:0;max-width:100%}.toolbar input,.toolbar select{flex:1 1 180px;max-width:100%}
 .pro-fields,.profile-grid,.detail dl,.customer-fields,.ops-details,.receipt-layout,.authlayout{grid-template-columns:minmax(0,1fr)}
 .pro-fields>*,.profile-grid>*,#fields>*,.customer-fields>*{min-width:0}.customer-fields>label.wide{grid-column:1/-1}
 .dash-layout,.dashcolumns,.work-overview{grid-template-columns:minmax(0,1fr)}.dash-tools{flex-direction:column;align-items:stretch}.dash-search{flex:auto}.dash-quick{align-self:stretch}.dash-quick button{flex:1}
 .modulegrid,.billing-module-grid,.ops-card-grid,.employee-grid,.helper-module-grid{grid-template-columns:minmax(0,1fr);gap:12px}
 .billing-module-card{min-height:150px;padding:20px;gap:10px}.billing-module-card>.emoji-icon{font-size:32px}
 .module{flex-wrap:nowrap;min-width:0}.moduletext{min-width:0}.moduletext small{font-size:12px}
 .time-status,.time-control{padding:18px}.time-status-top{flex-direction:column;gap:16px}.time-now{text-align:left}.time-now strong{font-size:36px}.time-facts{gap:8px}.time-facts>div{padding:10px;min-width:0}.time-links{grid-template-columns:1fr}
 .finance-intro{grid-template-columns:1fr}.finance-filter-panel{padding:14px}.finance-filter-panel>label{flex-basis:140px}.finance-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.finance-metric{padding:16px 10px;min-height:160px}.finance-metric>strong{font-size:21px}
 .file-row,.session-row,.helper-row{flex-wrap:wrap;align-items:flex-start}.file-row .detailactions{margin:8px 0}.chat-history article{max-width:95%}.conversation-row time{flex-shrink:0}
 .company-explorer{min-width:0}.company-explorer-toolbar{flex-wrap:wrap}.company-explorer-actions{width:100%;margin-left:0;display:flex;gap:8px}.company-explorer-actions button{flex:1}.company-entry-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}
 .company-folder-tree{max-height:180px;overflow:auto}.company-explorer-main{min-width:0}.company-breadcrumb{min-width:0;overflow:auto}
 dialog{position:fixed;width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;max-height:calc(100dvh - 16px);margin:auto;border-radius:12px;overflow:auto}
 #modal form{display:flex;flex-direction:column;max-height:calc(100dvh - 20px);min-height:0}.modalhead,.modalfoot{padding:14px 16px;flex-shrink:0;background:var(--panel)}.modalhead h2{font-size:18px}.modalhead>button{min-width:44px;min-height:44px}
 #fields{display:grid;grid-template-columns:minmax(0,1fr);max-height:none;min-height:0;overflow:auto;padding:16px;gap:16px;overscroll-behavior:contain}
 #fields label{grid-column:1/-1}.modalfoot{position:sticky;bottom:0;z-index:3;gap:8px;padding-bottom:max(14px,env(safe-area-inset-bottom))}.modalfoot button{flex:1;min-width:0}
 .position-row{grid-template-columns:repeat(2,minmax(0,1fr))}.position-row label:nth-child(n){grid-column:1/-1}.position-row>button{justify-self:stretch}
 .ops-calc-line,.ops-summary,.ops-payment-stage,.ops-public-position,.checkgroup{grid-template-columns:minmax(0,1fr)}.ops-calc-navigation{top:-16px}.ops-calc-navigation nav button{min-height:44px}
 .tablewrap{max-width:100%;overscroll-behavior-x:contain}.mobile-card-table{display:block;min-width:0!important;width:100%}.mobile-card-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .mobile-card-table tbody{display:grid;gap:10px;padding:10px}.mobile-card-table tr{display:block;background:var(--panel);border:1px solid var(--line);border-radius:9px;padding:6px 12px;min-width:0}
 .mobile-card-table td{display:grid;grid-template-columns:minmax(80px,.7fr) minmax(0,1.3fr);align-items:start;gap:12px;width:auto!important;min-width:0!important;padding:10px 0!important;white-space:normal!important;border-bottom:1px solid var(--line);text-align:left!important;font-size:13px}
 .mobile-card-table td::before{content:attr(data-mobile-label);font-size:11px;color:var(--muted);font-weight:600;overflow-wrap:anywhere}.mobile-card-table td:last-child{border-bottom:0}.mobile-card-table td.mobile-full-cell{display:block}.mobile-card-table td.mobile-full-cell::before{display:none}
 .mobile-cell-content{min-width:0;overflow-wrap:anywhere}.mobile-cell-content>button{max-width:100%;white-space:normal}.mobile-cell-content .inventory-compact-actions{justify-content:flex-start;flex-wrap:wrap}.mobile-cell-content .detailactions{margin:0;flex-wrap:wrap}
 .mobile-cell-content input{width:100%;min-width:0!important}.mobile-cell-content>div{max-width:100%}.inventory-actions-column{white-space:normal}.stock-take{flex-wrap:wrap}
 .week{grid-template-columns:repeat(7,minmax(220px,1fr));scroll-snap-type:x proximity}.day{scroll-snap-align:start;min-height:230px}
 footer{padding:16px 0;margin:0 12px;flex-wrap:wrap;gap:8px}#toast{bottom:max(16px,env(safe-area-inset-bottom));max-width:calc(100vw - 24px);width:max-content;z-index:100}
}
@media(max-width:380px){.headeractions #who{max-width:110px}.time-facts{grid-template-columns:1fr}.finance-metrics{grid-template-columns:1fr}.mobile-card-table td{grid-template-columns:1fr;gap:5px}.helper-stats{grid-template-columns:1fr}.dash-metrics{grid-template-columns:1fr 1fr}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

@media(max-width:800px){.mobile-cell-content form[data-take-stock]{min-width:0!important;width:100%;flex-wrap:wrap!important}.mobile-cell-content form[data-take-stock] input{width:75px!important;flex:1 1 65px}.mobile-cell-content form[data-take-stock] button{flex:1 0 100%;width:100%}.mobile-cell-content form[data-take-stock] span{flex:0 0 auto}.company-explorer-sidebar{max-height:190px;overflow:auto}}
