/* BadgersClaw Mobile Balanced Panel Scale v1.0.6
   Login intentionally untouched. Targets authenticated panel pages only. */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100% !important; text-size-adjust: 100% !important; }
  body:not(.auth-body-bg),
  body:not(.auth-body-bg) .page-content,
  body:not(.auth-body-bg) .main-content {
    font-size: 15.5px !important;
    line-height: 1.45 !important;
  }

  /* Mobile topbar/header: readable but not oversized */
  body:not(.auth-body-bg) .navbar-header,
  body:not(.auth-body-bg) .topbar,
  body:not(.auth-body-bg) .app-topbar,
  body:not(.auth-body-bg) .hud-mobile-topbar {
    min-height: 64px !important;
  }
  body:not(.auth-body-bg) .navbar-brand-box,
  body:not(.auth-body-bg) .mobile-title,
  body:not(.auth-body-bg) .page-title-box h4,
  body:not(.auth-body-bg) .dashboard-ref-heading h1 {
    font-size: clamp(1.45rem, 6.2vw, 2.05rem) !important;
    line-height: 1.12 !important;
  }

  /* Sidebar drawer remains usable and touch-friendly */
  body:not(.auth-body-bg) .vertical-menu,
  body:not(.auth-body-bg) .app-sidebar,
  body:not(.auth-body-bg) .left-side-menu {
    width: min(86vw, 330px) !important;
    max-width: 330px !important;
  }
  body:not(.auth-body-bg) .vertical-menu a,
  body:not(.auth-body-bg) .app-sidebar a,
  body:not(.auth-body-bg) #sidebar-menu a,
  body:not(.auth-body-bg) .metismenu a {
    font-size: 15px !important;
    min-height: 46px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    line-height: 1.25 !important;
  }
  body:not(.auth-body-bg) #sidebar-menu .menu-title,
  body:not(.auth-body-bg) .menu-title {
    font-size: 12px !important;
    letter-spacing: .06em !important;
    margin-top: 12px !important;
  }

  /* Global panel cards: readable without giant vertical bloat */
  body:not(.auth-body-bg) .container-fluid,
  body:not(.auth-body-bg) .dashboard-shell,
  body:not(.auth-body-bg) .nxt-api-helper-shell {
    width: 100% !important;
    max-width: none !important;
  }
  body:not(.auth-body-bg) .dashboard-shell,
  body:not(.auth-body-bg) .container-fluid {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  body:not(.auth-body-bg) .card,
  body:not(.auth-body-bg) .badgersclaw-card,
  body:not(.auth-body-bg) .dashboard-ref-panel,
  body:not(.auth-body-bg) .hud-card {
    border-radius: 18px !important;
  }
  body:not(.auth-body-bg) .card-body,
  body:not(.auth-body-bg) .dashboard-ref-panel .card-body {
    padding: 16px !important;
  }
  body:not(.auth-body-bg) .btn,
  body:not(.auth-body-bg) button,
  body:not(.auth-body-bg) input,
  body:not(.auth-body-bg) select,
  body:not(.auth-body-bg) textarea,
  body:not(.auth-body-bg) .form-control {
    font-size: 15px !important;
    min-height: 44px !important;
  }

  /* API Link Helper was too small: convert to large mobile cards */
  body:not(.auth-body-bg) .nxt-api-helper-shell {
    padding: 14px 14px 28px !important;
    margin: 0 auto !important;
  }
  body:not(.auth-body-bg) .nxt-api-hero {
    padding: 18px !important;
    border-radius: 20px !important;
    gap: 14px !important;
  }
  body:not(.auth-body-bg) .nxt-api-hero h2 {
    font-size: 1.65rem !important;
    line-height: 1.12 !important;
    margin-bottom: 6px !important;
  }
  body:not(.auth-body-bg) .nxt-api-hero p,
  body:not(.auth-body-bg) .nxt-api-list-head p {
    font-size: 13.5px !important;
    line-height: 1.35 !important;
  }
  body:not(.auth-body-bg) .nxt-api-toolbar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body:not(.auth-body-bg) .nxt-api-search input {
    font-size: 15px !important;
    min-height: 46px !important;
  }
  body:not(.auth-body-bg) .nxt-api-pills {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
  }
  body:not(.auth-body-bg) .nxt-api-pill {
    flex: 0 0 auto !important;
    font-size: 13px !important;
    padding: 9px 12px !important;
    min-height: 38px !important;
  }
  body:not(.auth-body-bg) .nxt-api-grid-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  body:not(.auth-body-bg) .nxt-api-cats {
    display: none !important;
  }
  body:not(.auth-body-bg) .nxt-api-list-head {
    padding: 15px !important;
  }
  body:not(.auth-body-bg) .nxt-api-list-head h3 {
    font-size: 1.15rem !important;
  }
  body:not(.auth-body-bg) .nxt-api-row {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "left open"
      "badge code" !important;
    gap: 8px 10px !important;
    min-height: auto !important;
    padding: 15px !important;
    align-items: center !important;
    border-radius: 14px !important;
    margin: 8px 8px !important;
    background: rgba(255,255,255,.035) !important;
  }
  body:not(.auth-body-bg) .nxt-api-left { grid-area: left !important; min-width: 0 !important; }
  body:not(.auth-body-bg) .nxt-api-open { grid-area: open !important; }
  body:not(.auth-body-bg) .nxt-api-badge { grid-area: badge !important; justify-self: start !important; }
  body:not(.auth-body-bg) .nxt-api-codepill { grid-area: code !important; justify-self: end !important; }
  body:not(.auth-body-bg) .nxt-api-mod-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
  }
  body:not(.auth-body-bg) .nxt-api-mod-name {
    font-size: 15.5px !important;
    line-height: 1.18 !important;
  }
  body:not(.auth-body-bg) .nxt-api-mod-desc {
    font-size: 13px !important;
    line-height: 1.35 !important;
    max-height: none !important;
    opacity: .9 !important;
  }
  body:not(.auth-body-bg) .nxt-api-open {
    font-size: 13.5px !important;
    padding: 10px 14px !important;
    min-height: 42px !important;
    border-radius: 11px !important;
  }
  body:not(.auth-body-bg) .nxt-api-badge,
  body:not(.auth-body-bg) .nxt-api-codepill,
  body:not(.auth-body-bg) .nxt-api-visible-badge {
    font-size: 12.5px !important;
    padding: 7px 10px !important;
  }
  body:not(.auth-body-bg) .nxt-api-endpoint-drawer {
    padding: 8px 12px 14px !important;
  }
  body:not(.auth-body-bg) .nxt-api-endpoint-grid {
    grid-template-columns: 1fr !important;
  }
  body:not(.auth-body-bg) .nxt-api-endpoint-name,
  body:not(.auth-body-bg) .nxt-api-endpoint-item code,
  body:not(.auth-body-bg) .nxt-api-copy-mini {
    font-size: 13px !important;
  }

  /* Native generated module pages were too huge: compact them while staying readable */
  body:not(.auth-body-bg) .dashboard-ref-header {
    padding-top: 18px !important;
    margin-bottom: 18px !important;
    display: block !important;
  }
  body:not(.auth-body-bg) .dashboard-ref-kicker {
    font-size: 14px !important;
    letter-spacing: .10em !important;
    line-height: 1.35 !important;
  }
  body:not(.auth-body-bg) .dashboard-ref-header .btn,
  body:not(.auth-body-bg) .dashboard-ref-header a.btn {
    margin-top: 14px !important;
    width: 100% !important;
    min-height: 46px !important;
  }
  body:not(.auth-body-bg) .nx-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }
  body:not(.auth-body-bg) .nx-stat {
    padding: 14px !important;
    min-height: 94px !important;
    border-radius: 16px !important;
  }
  body:not(.auth-body-bg) .nx-stat span {
    font-size: 12px !important;
    letter-spacing: .07em !important;
  }
  body:not(.auth-body-bg) .nx-stat strong {
    font-size: 1.45rem !important;
    line-height: 1.2 !important;
    word-break: break-word !important;
  }
  body:not(.auth-body-bg) .nx-shell,
  body:not(.auth-body-bg) .nx-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  body:not(.auth-body-bg) .nx-workspace-card {
    position: static !important;
  }
  body:not(.auth-body-bg) .nx-menu {
    display: flex !important;
    overflow-x: auto !important;
    gap: 10px !important;
    padding-bottom: 4px !important;
  }
  body:not(.auth-body-bg) .nx-link {
    flex: 0 0 78% !important;
    padding: 13px !important;
    border-radius: 15px !important;
  }
  body:not(.auth-body-bg) .nx-link span {
    font-size: 15px !important;
  }
  body:not(.auth-body-bg) .nx-link small {
    font-size: 12px !important;
    -webkit-line-clamp: 2 !important;
  }
}

@media (max-width: 390px) {
  body:not(.auth-body-bg) .dashboard-shell,
  body:not(.auth-body-bg) .container-fluid,
  body:not(.auth-body-bg) .nxt-api-helper-shell {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  body:not(.auth-body-bg) .nx-stats {
    grid-template-columns: 1fr !important;
  }
  body:not(.auth-body-bg) .nxt-api-row {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "left"
      "badge"
      "code"
      "open" !important;
  }
  body:not(.auth-body-bg) .nxt-api-open,
  body:not(.auth-body-bg) .nxt-api-codepill {
    justify-self: stretch !important;
    width: 100% !important;
    text-align: center !important;
  }
}