/* BadgersClaw Mobile API Helper + Module Page Balance v1.0.7 */
@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100% !important; text-size-adjust: 100% !important; }

  /* Generated/native module pages: prevent the over-zoomed blown-out look */
  body .main-content,
  body .page-content,
  body .dashboard-page {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body .dashboard-shell,
  body .dashboard-shell--reference,
  body .container-fluid,
  body .chd-page {
    width: 100% !important;
    max-width: 100vw !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  body .dashboard-ref-header {
    padding-top: 14px !important;
    margin-bottom: 16px !important;
    gap: 12px !important;
  }
  body .dashboard-ref-heading h1,
  body .chd-title,
  body h1 {
    font-size: clamp(28px, 8vw, 38px) !important;
    line-height: 1.08 !important;
    letter-spacing: -.02em !important;
  }
  body .dashboard-ref-kicker,
  body .chd-kicker {
    font-size: 15px !important;
    line-height: 1.35 !important;
    letter-spacing: .13em !important;
  }

  body .nx-shell,
  body .chd-shell,
  body .chd-two-col,
  body .chd-update-grid,
  body .nx-grid,
  body .chd-grid,
  body .nx-stats,
  body .chd-stats {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  body .nx-workspace-card,
  body .chd-shell > aside.chd-card {
    position: relative !important;
    top: auto !important;
    max-height: none !important;
  }

  body .card,
  body .badgersclaw-card,
  body .dashboard-ref-panel,
  body .chd-card {
    border-radius: 18px !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  body .card-body,
  body .chd-frame-body {
    padding: 16px !important;
  }

  body label,
  body .nx-field label,
  body .chd-field label {
    font-size: 17px !important;
    line-height: 1.25 !important;
    margin-bottom: 8px !important;
  }
  body input,
  body select,
  body textarea,
  body .form-control,
  body .form-select,
  body .chd-field .form-control,
  body .chd-field select,
  body .chd-compact-input {
    font-size: 17px !important;
    line-height: 1.35 !important;
    min-height: 50px !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  body textarea,
  body textarea.form-control,
  body .chd-field textarea.form-control {
    min-height: 108px !important;
  }

  body .btn,
  body button,
  body .nxt-btn,
  body .chd-actions .btn {
    min-height: 44px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
  }

  /* Tables on generated module pages: stop forcing giant columns off-screen */
  body .table-responsive,
  body .chd-frame,
  body .chd-portal-table,
  body .chd-table-clean {
    max-width: 100% !important;
  }
  body .chd-portal-table,
  body .chd-table-clean,
  body table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }
  body .chd-portal-table thead,
  body .chd-table-clean thead,
  body .chd-portal-table tbody,
  body .chd-table-clean tbody,
  body .chd-portal-table tr,
  body .chd-table-clean tr {
    width: max-content !important;
    min-width: 100% !important;
  }
  body .chd-portal-table th,
  body .chd-portal-table td,
  body .chd-table-clean th,
  body .chd-table-clean td {
    font-size: 14px !important;
    padding: 11px 14px !important;
    white-space: nowrap !important;
  }

  /* Sidebar drawer: keep usable but not tiny */
  body .vertical-menu,
  body #sidebar-menu,
  body .app-menu {
    font-size: 16px !important;
  }
  body #sidebar-menu a,
  body .metismenu a,
  body .vertical-menu a {
    min-height: 44px !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
  }
}