/* JobStacc v78.8 — mobile ergonomics and entitlement-state resilience */

/* Preserve visible keyboard focus across touch and keyboard layouts. */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:3px solid rgba(0,155,123,.32)!important;
  outline-offset:3px!important;
}

/* Long labels and live data must wrap inside cards instead of widening the page. */
:where(.job-card,.dash-card,.summary-card,.member-card,.pricing-card,.compare-card,
  .profile-card,.resource-card,.filter-panel,.detail-card,.ci-insight-card){
  min-width:0;
  overflow-wrap:anywhere;
}

@media (max-width:760px){
  /* Prevent iOS form zoom while keeping controls readable. */
  input,select,textarea{font-size:16px!important}

  /* WCAG-sized controls for the high-frequency mobile workflow. */
  .btn,button,input[type="button"],input[type="submit"],
  .search-tool-link,.filter-toggle,.sort-control,.compare-role-button,
  .compare-role-button-prominent{
    min-height:44px;
  }
  button,input[type="button"],input[type="submit"],.btn{min-width:44px}
  a,button,input,select,textarea{touch-action:manipulation}

  .navlinks a,.member-links a{
    min-height:44px!important;
    display:inline-flex!important;
    align-items:center!important;
    padding-top:8px!important;
    padding-bottom:8px!important;
  }

  /* Keep the active navigation item visible and make horizontal scrolling obvious by touch. */
  .navlinks,.member-links{
    scroll-snap-type:x proximity;
    overscroll-behavior-inline:contain;
  }
  .navlinks a,.member-links a{scroll-snap-align:start}

  /* Search and filter controls stack in reading order on phones. */
  .searchbar,.results-top,.filter-actions,.sort-row,.pagination,
  .member-page-head,.section-head{
    width:100%;
    min-width:0;
  }
  .searchbar input,.searchbar button,.filter-actions>*{max-width:100%}
  .filter-panel{max-height:none!important;overflow:visible!important}

  /* Comparison and billing actions remain usable above browser chrome and notches. */
  .compare-tray{
    padding-bottom:max(12px,env(safe-area-inset-bottom))!important;
  }
  .compare-tray .btn,.compare-auth-actions .btn,.ci-daily-action-buttons .btn,
  .stacc-compare-job-actions .btn{
    min-width:0;
    white-space:normal;
  }

  /* Data tables can scroll without forcing the whole document wider. */
  .table-wrap,.comparison-table-wrap,.account-table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
  }

  .global-footer{
    padding-bottom:max(28px,env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:390px){
  .nav-actions .btn{min-height:40px!important}
  .search-hero h1,.member-page-head h1,.dash-welcome h1{
    overflow-wrap:break-word;
    hyphens:auto;
  }
  .stacc-compare-job-actions,.compare-auth-actions,.ci-daily-action-buttons{
    grid-template-columns:1fr!important;
  }
  .stacc-compare-job-actions>*{width:100%;flex-basis:100%}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}
