/* CodexMatematico Pro — adattamenti esclusivamente per smartphone/tablet.
   Nessuna modifica ai calcoli o ai dati. */
@media (max-width: 760px) {
  html, body.app-body { width:100%; max-width:100%; overflow-x:hidden; }
  body.app-body .app { display:block!important; width:100%!important; max-width:100%!important; min-width:0!important; }
  body.app-body .main { min-width:0!important; width:100%!important; max-width:100%!important; padding:12px!important; }
  body.app-body .workspace { min-width:0!important; max-width:100%!important; padding:12px!important; overflow-x:clip; }
  body.app-body .top { display:flex!important; flex-wrap:wrap!important; align-items:center!important; gap:9px!important; min-width:0!important; }
  body.app-body .top .title { flex:1 1 190px!important; min-width:0!important; }
  body.app-body .top .title h1 { font-size:clamp(23px,6vw,30px)!important; line-height:1.15!important; overflow-wrap:anywhere; }
  body.app-body .top .title p { font-size:12px!important; line-height:1.35!important; }
  body.app-body .top .user-pill { max-width:100%!important; min-width:0!important; }
  body.app-body .top .user-pill strong { overflow-wrap:anywhere; }
  body.app-body .codex-sidebar-toggle { min-width:44px!important; width:44px!important; min-height:44px!important; }
  body.app-body .side { overflow-y:auto!important; overscroll-behavior:contain; }
  body.app-body .stats, body.app-body .codex-dashboard-metrics,
  body.app-body .dashboard-grid, body.app-body .codex-dashboard-charts,
  body.app-body .book-cash { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  body.app-body .codex-dashboard-layout { display:block!important; }
  body.app-body .stat, body.app-body .box, body.app-body .summary-card,
  body.app-body .dash-chart-card, body.app-body .calc-panel { min-width:0!important; max-width:100%!important; }
  body.app-body .stat { padding:12px!important; }
  body.app-body .stat .value { font-size:clamp(19px,5vw,26px)!important; overflow-wrap:anywhere; }
  body.app-body .tabs { display:flex!important; flex-wrap:nowrap!important; overflow-x:auto!important; max-width:100%!important; scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch; }
  body.app-body .tabs .tab { flex:0 0 auto!important; white-space:nowrap!important; scroll-snap-align:start; min-height:44px!important; }
  body.app-body .calc-actions-row, body.app-body .multi-actions { display:flex!important; flex-wrap:wrap!important; gap:9px!important; }
  body.app-body .calc-actions-row button, body.app-body .multi-actions button { min-height:44px!important; max-width:100%!important; }
  body.app-body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  body.app-body select, body.app-body textarea { max-width:100%!important; min-width:0; font-size:16px!important; box-sizing:border-box; }
  body.app-body input[type="checkbox"], body.app-body input[type="radio"] { flex-shrink:0; }
  body.app-body .table-wrap, body.app-body .archive-linear-wrap,
  body.app-body .multi-table-wrap, body.app-body .step8-table-wrap,
  body.app-body .security-table-wrap, body.app-body .maint-table-wrap,
  body.app-body .reconcile-table-wrap { display:block; max-width:100%!important; overflow-x:auto!important; -webkit-overflow-scrolling:touch; }
  body.app-body .archive-linear-table { width:max-content!important; min-width:100%!important; }
  body.app-body .archive-filter-bar { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:9px!important; }
  body.app-body .archive-filter-bar > * { min-width:0!important; max-width:100%!important; }
  body.app-body .archive-pl-summary { gap:10px!important; flex-wrap:wrap!important; }
  body.app-body .archive-pl-summary-number { font-size:clamp(24px,7vw,34px)!important; }
  body.app-body .result-grid, body.app-body .multi-summary { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  body.app-body .reconcile-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  body.app-body img, body.app-body canvas, body.app-body svg { max-width:100%; }
}
@media (max-width: 480px) {
  body.app-body .main { padding:8px!important; }
  body.app-body .workspace { padding:10px!important; border-radius:13px!important; }
  body.app-body .stats, body.app-body .codex-dashboard-metrics,
  body.app-body .dashboard-grid, body.app-body .codex-dashboard-charts,
  body.app-body .book-cash { grid-template-columns:1fr!important; }
  body.app-body .archive-filter-bar { grid-template-columns:1fr!important; }
  body.app-body .top .user-pill { padding:5px 8px!important; }
  body.app-body .reconcile-summary-grid { grid-template-columns:1fr!important; }
}
