/* Mobile overrides keep the original desktop layout and accounting UI intact. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
html{-webkit-text-size-adjust:100%;scroll-padding-top:80px}
.install-entry{border:1px solid #d9e0d3;border-radius:18px;color:var(--green);background:#fff;padding:7px 12px;font-size:12px;min-height:36px;white-space:nowrap}
.install-body{padding:22px 27px}.install-body section+section{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}.install-body h3{font-size:15px;margin:0 0 12px;color:var(--green)}.install-body ol{padding-left:23px;margin:0;color:#66755e;font-size:13px;line-height:1.9}.install-body li+li{margin-top:7px}.install-body strong{font-weight:600;color:var(--ink)}.install-environment{font-size:12px;line-height:1.8;color:var(--muted);margin:15px 0 0}.install-body #native-install{margin-top:15px}
@media(max-width:800px){
  /* iOS zooms focused controls smaller than 16px. */
  input:not([type=checkbox]):not([type=radio]),select,textarea,.field input,.field select,.field textarea,.filters input,.filters select{font-size:16px;line-height:1.4;min-height:44px}
  input[type=checkbox],input[type=radio]{width:20px;height:20px;margin:4px 6px 4px 0;flex-shrink:0}
  .btn,.btn.small,.link-btn,.close-btn{min-height:44px}.btn{font-size:13px}.link-btn{padding:8px 4px}.close-btn{min-width:44px;min-height:44px;font-size:24px}
  .filters label{min-height:44px}.filters .search svg{top:14px}.filters input[type=date]{max-width:100%;min-width:0}
  .table-wrap{overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.row-actions{gap:12px}.row-actions .link-btn{min-width:44px}
  dialog{max-height:calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));max-height:calc(100vh - 24px - var(--safe-top) - var(--safe-bottom));overscroll-behavior:contain;scrollbar-width:thin}
  @supports(height:100dvh){dialog{max-height:calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom))}}
  .dialog-foot{position:sticky;bottom:0;background:#fff;z-index:2;flex-wrap:wrap;padding-bottom:max(16px,var(--safe-bottom))}.dialog-foot .btn{flex:1;min-width:100px}
  .form-error{font-size:13px}.field{font-size:13px}.field small,.small-note{font-size:11px}.form-calc{font-size:13px}.note-box{font-size:11px}
}
@media(max-width:520px){
  body{padding-top:var(--safe-top)}
  .sidebar{height:calc(64px + var(--safe-bottom));padding-bottom:var(--safe-bottom);padding-left:var(--safe-left);padding-right:var(--safe-right);background:#fbfcf8;box-shadow:0 -3px 18px #234c3e06}
  nav a{font-size:10px;min-height:64px;justify-content:center;padding:8px 1px;gap:4px}nav a svg{width:21px;height:21px}
  main{min-height:calc(100vh - var(--safe-top));padding-bottom:calc(76px + var(--safe-bottom))}
  .content{padding-left:max(16px,var(--safe-left));padding-right:max(16px,var(--safe-right));padding-bottom:24px}
  .topbar{height:60px;padding-left:max(16px,var(--safe-left));padding-right:max(16px,var(--safe-right));gap:8px}
  .top-right{gap:8px}.topbar .device-badge{display:none}.install-entry{min-height:44px;font-size:12px;padding:8px 12px}.breadcrumb span{padding:0 8px}.breadcrumb{white-space:nowrap}
  .metric-value{font-size:25px}.metric-value small{font-size:11px}.metric{padding:15px 13px}.metric-label{font-size:11px}.metric-foot{font-size:10px;line-height:1.7}
  .page-heading p{font-size:12px;line-height:1.8}.panel-head{flex-wrap:wrap;align-items:center;gap:10px}.panel-head .btn{padding:9px 11px;font-size:12px}.panel-head h2{font-size:17px}
  .welcome p{font-size:12px}.welcome .actions{gap:8px}.welcome .btn{flex:1}
  .filters{gap:10px}.filters label{font-size:12px}.filters select{width:100%}.filters .search{min-width:0}.filters .filter-count{font-size:12px}
  th{font-size:11px}td{font-size:13px}.item-name{font-size:13px}.item-code{font-size:11px}.table-foot{font-size:11px}
  .form-grid{grid-template-columns:1fr}.field.wide,.form-grid .mobile-wide{grid-column:auto}.form-body{padding:18px}.dialog-head{padding:18px;gap:10px}.dialog-head h2{font-size:21px}.dialog-head p{font-size:12px;line-height:1.7}.dialog-foot{padding-left:18px;padding-right:18px}
  .detail-grid{padding:18px;gap:10px;font-size:13px}.detail-grid small{font-size:11px}.confirm-body{padding:18px;font-size:14px}.install-body{padding:18px}.install-body ol{font-size:14px}.install-body h3{font-size:16px}
  .backup-card p,.rules p{font-size:13px}.backup-card .actions .btn{flex:1}.backup-state{font-size:12px}.below-table{font-size:12px}
  .demo-banner{font-size:12px;flex-wrap:wrap}.demo-banner button{min-height:44px;min-width:88px}.fatal{font-size:13px}
  #toast{bottom:calc(82px + var(--safe-bottom));font-size:13px;max-width:calc(100vw - 32px);width:max-content;padding:12px 18px;line-height:1.7}
  footer{font-size:10px;padding-left:max(18px,var(--safe-left));padding-right:max(18px,var(--safe-right))}
}
@media(max-width:360px){.breadcrumb{font-size:10px}.install-entry{padding:8px 9px;font-size:11px}.metric-value{font-size:22px}.metric{padding:13px 10px}}

@media(max-width:520px){nav a{font-size:9px;white-space:nowrap}.report-cutoff{padding:14px;align-items:flex-start}.report-cutoff label{width:100%;justify-content:space-between}.report-cutoff input{width:165px}.report-cutoff>span{min-width:140px;font-size:11px;line-height:1.8}.report-cutoff .btn{min-height:40px}.outbound-summary{padding:15px;display:grid;grid-template-columns:1fr;gap:7px}.outbound-summary span{display:flex;justify-content:space-between;gap:12px}.accounting-notes{padding:18px}.accounting-notes div{font-size:12px}.page-heading .actions{gap:8px}.page-heading .actions .btn{padding-left:10px;padding-right:10px;font-size:12px}.report-cutoff input{font-size:16px;min-height:44px}}
