/* Mobile overrides shared by the existing platform; desktop remains unchanged. */
.mobile-menu-toggle{display:none}
.mobile-table-scroll{max-width:100%;overflow:auto;overscroll-behavior-x:contain}
@media(max-width:900px){
 .calc-layout,.calculator-layout,.planner-layout{grid-template-columns:minmax(0,1fr)!important}
 .calc-results{position:static!important}
 .main-content,.vehicle-main,.settings-shell{min-width:0}
}
@media(max-width:700px){
 html{scroll-padding-top:135px}
 body{margin:0;min-width:0;-webkit-text-size-adjust:100%}
 *,*::before,*::after{box-sizing:border-box}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;max-width:100%;min-width:0}
 button,input,select,textarea,a{-webkit-tap-highlight-color:transparent}
 button,summary,.btn,.entity-secondary,.scanner-button{touch-action:manipulation}
 button:not([hidden]),select,input:not([type=checkbox]):not([type=radio]){min-height:44px}
 input[type=checkbox],input[type=radio]{width:20px!important;height:20px!important;flex-shrink:0;accent-color:#173b58}
 :focus-visible{outline:2px solid #447da6;outline-offset:3px}
 .main-content{padding:18px 12px!important}
 .vehicle-main,.settings-shell{width:100%;padding:20px 12px!important}
 h1{font-size:clamp(24px,6vw,32px)!important;line-height:1.2!important;overflow-wrap:anywhere}
 .page-header,.finance-header,.settings-hero,.vehicle-header,.results-detail-heading{flex-wrap:wrap;gap:16px;padding:20px!important}
 .header-actions,.page-actions,.finance-actions,.ksef-buttons{display:flex;flex-wrap:wrap;gap:8px;width:100%}
 .header-actions>button,.page-actions>button,.finance-actions>button{flex:1 1 140px}
 body:has(.app-container>.sidebar) .sidebar{padding:10px 12px 6px!important;position:sticky!important;max-width:100%;z-index:100}
 body .sidebar .logo{font-size:18px;margin-bottom:6px!important}
 body .sidebar .nav-menu{gap:6px!important;min-width:0}
 body .sidebar .nav-menu>.nav-item{display:none!important}
 body .sidebar .nav-menu.mobile-menu-open>.nav-item{display:flex!important;flex:1 0 100%;order:1;min-height:44px}
 .mobile-menu-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid #dae5ed;background:#f1f6fa;color:#173b58;border-radius:9px;padding:8px 12px;font:600 14px 'Segoe UI',sans-serif;order:-2;min-height:44px}
 body .sidebar .profile-menu{margin-left:auto}
 .profile-popover{position:fixed!important;top:112px!important;right:12px!important;max-height:calc(100dvh - 132px);overflow:auto!important}
 body .sidebar .sub-menu{max-width:100%;min-width:0;flex-basis:100%;order:3!important}
 body .sidebar #workspaceSubnav{padding-right:48px!important}
 body .sidebar #workspaceSubnav>.workspace-tab-list{max-width:100%!important;min-width:0;overscroll-behavior-x:contain;scrollbar-width:thin}
 body .workspace-tab-list>.sub-item,body .workspace-tab-list>button{font-size:14px!important;padding:10px 12px!important;min-height:44px!important}
 #workspaceSubnav .workspace-subnav-toggle{width:40px;height:44px;top:10px}
 .settings-header{padding:12px!important;flex-wrap:wrap;gap:12px}
 .settings-header>nav{display:flex;flex-wrap:wrap;gap:8px;max-width:100%}
 .settings-index{max-width:100%;min-width:0}
 .ledger-command-bar,.ledger-chart-panel{padding:16px!important}
 .ledger-period{flex-direction:column;align-items:stretch;gap:14px}
 .ledger-period-main{min-width:0;width:100%}
 .ledger-period-nav{display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px;gap:6px;width:100%;max-width:380px}
 .ledger-period-trigger{width:100%;min-width:0!important;justify-content:center;padding:6px!important;font-size:15px!important}
 .ledger-period-trigger .ledger-chevron{margin-left:4px}
 .ledger-icon-button{width:44px;height:44px}
 .ledger-period-panel{left:0!important;width:100%;max-width:100%;padding:14px}
 .ledger-presets{justify-content:flex-start;gap:4px}
 .ledger-presets button{font-size:12px;padding:8px}
 .ledger-filter-row{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
 .ledger-search,.ledger-filter{min-width:0;max-width:none;width:100%}
 .ledger-search-field{height:46px}
 .ledger-extra{margin-top:0}
 .ledger-extra>div{left:0;right:auto;max-width:100%}
 .ledger-table-heading,.ledger-section-head,.results-section-head,.results-toolbar{flex-wrap:wrap;padding:16px;gap:12px}
 .ledger-table-heading>*,.ledger-section-head>*{min-width:0;max-width:100%}
 .ledger-payment-panel{right:auto;left:0;width:min(280px,calc(100vw - 58px))}
 .ledger-graph-controls,.results-profit-options{display:flex;flex-wrap:wrap;gap:12px}
 .ledger-summary-grid,.results-cards,.vehicle-stats,.vehicle-details,.entity-grid,.settings-grid,.company-stat-grid,.stats-grid,.summary-cards,.tax-cards{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 .vehicle-card,.settings-card,.results-panel{padding:18px!important;min-width:0}
 .entity-data{grid-template-columns:minmax(0,1fr);gap:16px}
 .vehicle-tabs,.results-detail-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;max-width:100%;justify-content:flex-start!important;scrollbar-width:thin}
 .vehicle-tabs>*{flex:0 0 auto;min-width:125px}
 .vehicle-mileage-editor,.fleet-form,.entity-fields,#fleetDialog .entity-fields,.settings-grid,.form-grid,.correction-prices{grid-template-columns:minmax(0,1fr)!important}
 .fleet-wide,.full-width,.settings-full{grid-column:1/-1!important}
 .vehicle-mileage-editor>button{width:100%}
 .entity-section-title,.employee-card-heading{flex-wrap:wrap;align-items:flex-start}
 .table-container,.vehicle-table-wrap,.results-table-wrap,.mobile-table-scroll{width:100%;min-width:0;max-width:100%;overflow:auto!important;-webkit-overflow-scrolling:touch}
 body .ledger-documents td,body .ledger-documents th,.fleet-table td,.fleet-table th{font-size:13px!important;line-height:1.5!important;padding:12px 10px!important}
 body .ledger-documents small{font-size:11px!important}
 body .ledger-documents th:first-child,body .ledger-documents td:first-child{min-width:105px;max-width:125px;white-space:normal}
 .mobile-scroll-hint{font-size:12px;color:#627c91;margin:8px 12px;line-height:1.5}
 .mobile-table-scroll:focus-visible{outline-offset:-2px}
 dialog[open]{margin:auto!important;max-width:calc(100vw - 16px)!important;width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;padding:18px!important;overflow:auto;overscroll-behavior:contain}
 dialog header{gap:12px}
 dialog header h3{font-size:20px!important;line-height:1.3}
 dialog label,.form-group label{font-size:14px!important;line-height:1.5}
 dialog .entity-fields,dialog .fleet-form{gap:14px!important}
 dialog .reminder-actions,dialog .funding-actions{flex-wrap:wrap;gap:10px}
 dialog .reminder-actions>button,dialog .funding-actions>button{flex:1 1 180px}
 .modal-overlay,#ksefModal{padding:8px!important;overflow-y:auto;overscroll-behavior:contain}
 .modal-container,.ksef-card{width:100%!important;max-width:100%!important;max-height:calc(100dvh - 16px)!important;padding:18px!important;margin:auto}
 #invoiceModal.invoice-scan-open{flex-direction:column;align-items:stretch;justify-content:flex-start;gap:10px}
 #invoiceModal.invoice-scan-open #modalCard{width:100%!important;max-width:none!important;max-height:none!important;flex:none}
 #invoiceModal.invoice-scan-open .invoice-scan-preview{width:100%!important;max-width:none;height:40dvh;min-height:200px;flex:none}
 .invoice-doc-item{grid-template-columns:minmax(0,1fr)!important}
 .invoice-doc-actions{justify-self:stretch!important;width:100%!important}
 dialog.scanner-dialog{padding:0!important}
 .scanner-heading{padding:16px}
 .scanner-body{padding:12px}
 .scanner-list,.scanner-item:only-child .scanner-fields{grid-template-columns:minmax(0,1fr)!important}
 .scanner-item{padding:16px}
 .scanner-results-bar{position:static;flex-wrap:wrap}
 .scanner-status{white-space:normal}
 .scanner-item-head{flex-wrap:wrap}
 .scanner-button{min-height:44px;font-size:14px}
 .scanner-item input,.scanner-item select{height:46px}
 .scanner-upload-actions,.scanner-results-bar>div:last-child{gap:10px}
 .scanner-item-actions{display:flex;flex-wrap:wrap}
 .results-equation,.results-calculation-row,.results-source{min-width:0;overflow-wrap:anywhere}
 .results-calculation-row{gap:12px}
 .settings-save-bar,.settings-footer{position:static!important;flex-wrap:wrap;gap:10px}
 .settings-save-bar button,.settings-footer button{flex:1 1 140px}
 .account-card{padding:24px 18px!important;width:100%;min-width:0}
 .account-shell{padding:20px 12px!important}
 .account-actions{flex-wrap:wrap;gap:10px}
 .landing-nav{flex-wrap:wrap;gap:12px}
 .landing-hero{min-height:100svh}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important} .landing-hero *, .hero *{animation:none!important;transition:none!important}}

@media(max-width:700px){
 .field-grid,.lp-layout,.lp-grid,.company-access{grid-template-columns:minmax(0,1fr)!important}
 .top-header{flex-wrap:wrap;gap:16px!important;align-items:flex-start!important}
 .top-header>div{min-width:0;max-width:100%}
 #tab-income .invoice-ten-row-window,#tab-expense .invoice-ten-row-window,#tab-fuel .invoice-ten-row-window,body .ledger-documents .finance-workspace-invoices>.table-container{max-height:70dvh!important}
 .tax-summary-grid{grid-template-columns:minmax(0,1fr)!important}
 .tax-detail-row{flex-wrap:wrap;gap:8px}
 .settings-card-heading,.company-overview-heading{flex-wrap:wrap;gap:12px}
 .scanner-auto,.ledger-search-scope{min-height:44px}
 .lp-view{min-height:300px;max-width:100%}
 .lp-fields{grid-template-columns:minmax(0,1fr)!important}
 .landing-header{flex-wrap:wrap}
}
