Sun bears use 14-year-old previously logged forest more than primary forest in Sabah, Malaysia

Sun bears (Helarctos malayanus), arguably the least-known bear species, are endemic to Southeast Asia and are believed to be in rapid decline due to forest loss and poaching, which are severe threats across this region. It has been asserted that, unlike other forest-dependent, omnivorous bears, sun bears are especially sensitive to changes in forest composition and canopy closure because they often feed on fruits in the canopy. We investigated habitat use of sun bears in a region of Sabah, Malaysian Borneo, containing primary forest adjacent to a 14-yr-old selectively logged forest. We used strip transects to quantify trees that sun bears climbed to forage or rest; these were easily recognized by distinctive claw marks. We found 1.8× the density of bear-climbed trees in the logged vs. the primary forest. Dead wood, a home for various insects eaten by sun bears, was more common in logged forests. Except during masting years, when fruits are exceptionally abundant in this area, sun bears commonly consume termites and bees, both of which were more common in the logged forest and had a positive effect on sun bear presence. Sun bear presence was also positively associated with canopy closure, which on average was higher in primary forest, but some portions of logged forest had very high canopy cover. The logged forest had higher vegetative greenness, which up to a point was attractive to bears, but very high greenness, likely indicative of thick underbrush, appeared to be less attractive. These results indicate that previously logged areas can be valuable habitats for sun bears, providing rich supplies of food––both fruits and insects. A number of recent biodiversity surveys using camera traps have also shown high use of logged areas by sun bears, but here we connected this use to food resources. Conservation of this species is better served by appreciating its omnivorous diet and adaptiveness to varying habitats and thus recognizing the importance of preventing logged areas from deteriorating into agriculture. We warn against focusing only on saving primary forests, and predicting declines of this species from forest cutting, without considering forest regeneration.


INTRODUCTION
Forest-dependent species have been severely impacted by loss, fragmentation, conversion, and degradation of forests across the tropics. These impacts have been particularly severe in Southeast Asia (Achard et al. 2002, Sodhi et al. 2004, 2010a, b, FAO 2011a, Hansen et al. 2020. Forest loss in Southeast Asia has been driven by logging, fires, mining, and expansion of commercial plantations of oil palm, rubber, and fiber (e.g., Acacia) (Abood et al. 2015, Hughes 2017). All of these intrusions also increase human access to the forest (more roads, more edge, reduced travel distance to forest interior) leading to heightened rates of illegal exploitation (Clements et al. 2014, Kleinschroth andHealey 2017). Harrison et al. (2016), in a recent review paper, described what they called "a wave of unsustainable hunting that has spread across Southeast Asia over the past 20-30 years," and Di Minin et al. (2019) highlighted Southeast Asia as having the highest level of unsustainable commercial harvesting of wildlife. Habitat alteration and poaching thus act synergistically as drivers in loss of tropical biodiversity (Symes et al. 2018).
Large charismatic mammals, especially tigers (Panthera tigris) and orangutans (Pongo spp.), have been the poster species for biodiversity loss in Southeast Asia due to their reliance on intact forests and their vulnerability to poaching. A lesser-known forest-dependent large mammal of Southeast Asia is the sun bear (Helarctos malayanus). This species ranges from Northeast India through mainland Southeast Asia to the islands of Sumatra and Borneo. An estimated 35-44% of present sun bear range occurs in the insular region, which is often considered their stronghold in terms of remaining expanses of intact forest (Crudge et al. 2019). However, this part of the sun bear range experiences the highest rate of deforestation (Miettinen et al. 2011, Margono et al. 2012. Cushman et al. (2017) estimated a 23% loss of forested areas within Malaysian Borneo and 15% in Kalimantan (Indonesian Borneo) during the decade 2000-2010 and predicted that these same rates of loss would continue through the next decade. By 2012, the annual rate of loss of primary forest in Indonesia was estimated to be nearly double that of Brazil (Margono et al. 2014), which leads the world in total forest loss by area (FAO 2020).
Sun bears have been described as being not only forest-dependent, but particularly reliant on undisturbed primary forest (Augeri 2005, Scotson et al. 2017a), a notion that derives, in part, from their restricted distribution in Southeast Asia, an area with historically diverse, dense, tall, and shady tropical forests. The diet of sun bears is comprised of a high diversity of tree-borne fruits, which ripen at varying times and differ in abundance from year to year (Fredriksson et al. 2006, Cheah 2013, Steinmetz et al. 2013); thus, their use of the forest is strongly related to the density of fruiting trees and the abundance of fruit produced . At a site in Thailand, productivity of fruits eaten by bears was greater in primary than in secondary logged forest (Ngoprasert et al. 2011). However, habitats and food supply differ markedly between the seasonal tropical forests of the Indochinese bioregion, north the Isthmus of Kra on Peninsular Malaysia (10°30 0 N), and the aseasonal rain forests of the Sundaic region to the south, including the islands of Sumatra and Borneo (Woodruff 2003). The dipterocarp rainforests of the Sundaic region experience synchronized masting events, followed by inter-mast periods of 2-9 yr with little fruiting (Curran and Leighton 2000, Sakai 2001, 2002. During these inter-mast periods, sun bears rely on insects to a varying degree (Wong et al. 2002, Fredriksson et al. 2006. Whereas fruit production is viewed as crucial for this species, little attention has been paid to their use of insects. It has been observed that during extended inter-masting periods, when reliant on a diet of insects, sun bears lose considerable weight and some die of starvation (Wong et al. 2005, Fredriksson et al. 2007. The use and importance of disturbed habitats for sun bears remains an open question, and views on this topic appear to be evolving as more information becomes available. There is good evidence that sun bears attempt to avoid roads, settlements, and other sources of human activities (Augeri 2005, Linkie et al. 2007, Nazeri et al. 2012, Guharajan et al. 2018. However, the few radio-collared sun bears that have been studied in an area with both primary and logged forests commonly used both (Wong et al. 2004). Likewise, recent camera-trapping data from a host of biodiversity surveys indicate that this species is adaptive and resilient to certain types and amounts of forest change. At a number of sites in Malaysian Borneo (states of Sabah and Sarawak), Brodie et al. (2015) found that recent logging reduced sun bear occupancy, but older logging (>10 yr) did not, compared to contiguous unlogged forest patches. Sun bears were the most widespread and frequently photographed carnivore in an actively logged forest in Sarawak, just before it became a national park (Mohd-Azlan et al. 2019). At sites in Sabah that had undergone sustainable forest management, including reduced-impact logging within 10 yr, sun bears were encountered on camera traps at rates similar to or higher than in forests not logged for 20+ yr (Samejima et al. 2012, Wearn et al. 2017. In Indonesian Borneo, 1-3 yr after switching from conventional to reducedimpact logging, sun bears selected sites with more intact forest, but 6-8 yr after such logging they were camera-trapped more frequently and showed no selection for the more intact forest sites (Jati et al. 2018). In a degraded, previously heavily logged site in Sumatra, sun bears were camera-trapped at rates equivalent to unlogged sites (Lindsell et al. 2015), but based on climbing marks on trees, they selected feeding sites with larger trees and a more closed canopy (Lee et al. 2019). At another site in Sumatra, Linkie et al. (2007) observed higher occupancy of sun bears in a degraded hill-forest than in primary forest; 4-6 yr later, occupancy in the degraded area precipitously declined, possibly due to continued high rates of deforestation, whereas occupancy in primary forest increased despite that site undergoing deforestation .
Uncertainties regarding effects of habitat alteration on sun bears hamper the development of conservation strategies for this species (Crudge et al. 2019). If sun bear populations cannot persist in forests that have been logged or heavily degraded (Scotson et al. 2017b), then their conservation must be cast in crisis mode, as pristine forests are quickly disappearing, and the species may soon be more threatened than its current Vulnerable IUCN Red List status (Scotson et al. 2017a). On the other hand, if sun bears can effectively use certain types of previously logged forest, as suggested by data from various camera-trapping efforts, then conservation should be directed not just at saving forests from logging, but also ensuring less intrusive logging techniques, as well as preventing logged forests from further conversion to agriculture (Gaveau et al. 2016). Our aim was to help resolve these uncertainties and discrepancies by investigating sun bear use of habitat at a Sundaic site containing both primary and logged forest.

Study area
This study was conducted on the eastern side of Sabah, Malaysian Borneo (4°57'40″ N, 117°48'00″ E), within the lowland tropical rainforests of Ulu Segama Forest Reserve (USFR) and adjacent Danum Valley Conservation Area (DVCA). The USFR is a 2028-km 2 selectively logged forest, whereas the DVCA is a 438-km 2 totally protected primary forest. The USFR is one of a complex of forest reserves, totaling 10,000 km 2 , that act as buffer areas around the pristine DVCA (Reynolds et al. 2011). The Danum Valley Field Center, at the border of DVCA and USFR, is an international research center that facilitates studies of the ecology of tropical forest flora and fauna and the effects of logging on various ecosystem components, thus contributing to improved forest management (Marsh and Greer 1992).
Elevations within the study area ranged from 100 m to 1200 m, but 90% was lowlands (<760 m). Daily temperature averaged 26.7°C, relative humidity was high (78-95%), and rain was frequent. During our study in 2006, it rained for 246 d, with an average of 21 rainy days per month amounting to over 3000 mm of annual precipitation (Hinz 2008).
Dipterocarpaceae are the dominant trees, composing about 90% of the volume of large trees in the primary forest (Marsh and Greer 1992). Selective logging in USFR, focused on these dipterocarps, started in 1978 and ended in 1992, 14 yr before the start of our study. Other adjacent forest reserves were logged on different schedules, some with multiple rotations and more recently (Ancrenaz et al. 2010, Reynolds et al. 2011. Logging regulations in Malaysia are controlled by each state. In the state of Sabah, selective logging followed the 1986 Forest Act, which stipulates a 60-yr harvest rotation with removal restricted to trees on gentle slopes (<20°) with a diameter at breast height (dbh) >60 cm (Marsh 1995). Nevertheless, selective logging operations, including felling and transport of timber, also impacted steeper slopes and many non-target trees resulting in~50% loss of tree cover and widespread damage to understory plants (Johns 1988, Saiful and Latiff 2014, Matangaran et al. 2019. However, forest regeneration in these v www.esajournals.org logged forests is rapid, initially (first~6 yr) due to the high solar radiation in openings and later to an abundance and high growth rate of pioneering species such as Macaranga and Mallotus (Euphorbiaceae) (Bischoff et al. 2005). At a site near our study area and at the same successional stage (13 yr after selective logging), Bischoff et al. (2005) documented higher densities of trees of the size climbed by sun bears (≥10 cm dbh), mainly pioneers, and equal densities of large trees (≥50 cm dbh) compared to the primary forest in DVCA.

Data collection
We used sign surveys to assess habitat use of sun bears. Sun bears create distinctive claw marks on trees that they climb ( Fig. 1) when seeking food (fruits or insects) or a safe, cooler place to rest (Steinmetz and Garshelis 2008Fredriksson 2012). We used this climbing sign, which hereafter are called bear trees, as a measure of their habitat use.
We selected a 10 × 20 km 2 study region, containing both primary forest (40%) and logged forest (60%) and divided this into a grid of 100 2-km 2 (1 × 2 km) cells. During May 2006 to January 2007, the same field team of two or three observers sampled 39 grid cells in primary forest and 55 in logged forest. We conducted a strip transect survey starting at a randomly selected departure point within each cell. Each east-west transect was 400 m long by 10 m wide. We examined every tree within 5 m of the centerline of the transect, looking for claw marks of sun bears, and estimated whether the marks looked <1 month (fresh), <1 yr, or >1 yr old (Steinmetz and Garshelis 2010). We classified each bear tree to the lowest possible taxon (family, genus, or species), estimated height, and measured dbh. We divided transects into 25-m sections and summed the number of bear trees in each.
We measured 10 ecological factors in the field. The following were measured at each bear tree: (1) slope was measured with a clinometer; and (2) elevation was obtained with a global positioning system. The following were measured every 25 m along each transect (16 times per transect) and then averaged for the transect: (3) canopy cover, measured with a model C spherical densitometer, and categorized in five levels, ≤20%, 21-40%, 41-60%, 61-80%, and 81-100%; (4) ground vegetative cover below 1 m was estimated visually and recorded into the same five levels. The following were summed within each 25-m transect section: (5) number of intersecting trails; (6) number of big trees with dbh >60 cm; (7) volume of dead wood (which may contain valuable bear forage such as beetles and their larvae, termites, Fig. 1. Sun bears are highly arboreal. They regularly climb trees to obtain fruits and insects, and to rest in a cooler, safer place. In the process, they leave conspicuous claw marks, which can remain on trees for several years, and are readily identified in the field. v www.esajournals.org or ants; Wong et al. 2002) was estimated by measuring the length and diameter of dead wood with a dbh > 30 cm; (8) termite nests (nests within 1 m of each other were counted as a single nest); and (9) fig (Ficus) trees (a staple food source for sun bears; Wong et al. 2002, Fredriksson et al. 2006. Additionally, we recorded (10) the presence or absence of bee nests.
We derived five additional ecological factors through geographic information system (GIS) layers obtained from the Malaysian Government Survey and Mapping Department (Jabatan Ukur dan Pemetaan Malaysia, JUPEM). For each transect section, we calculated the following attributes in program R (R Core Team 2019): (11) distance (m) to the nearest river; (12) distance (m) to the nearest active forest road; (13) distance (m) to the nearest inactive forest road; (14) length (m) of active forest roads within 500 m; and (15) length (m) of inactive forest roads within 500 m. Finally, we estimated (16) the average vegetative greenness by obtaining the enhanced vegetation index (EVI) for the study site using remotely sensed data from the National Aeronautics and Space Administration (Didan 2015). We downloaded the EVI raster layers for the year 2006 with the "MODIS" package (Mattiuzzi and Detsch 2019) in program R, and matched them to each transect section.

Data analysis
To assess which ecological and anthropogenic factors were associated with sun bear space use, we modeled the counts of sun bear trees within each transect section using the 16 covariates described above. We scaled and centered all variables so that the estimated model coefficients would be comparable and represent the change in count of bear sign per 1 standard deviation of change in the covariate. We assessed collinearity among our covariates by calculating variance inflation factors (VIFs) using a linear regression model that contained all variables using the "vif" function from the "car" package (Fox and Weisberg 2019) in program R. All variables had a VIF ≤ 2 and consequently were retained for the modeling process.
We created a global model that included all main covariates and second-order polynomial terms (regression splines with 2 degrees of freedom) for variables that we believed could have a non-linear relationship with sun bear sign: canopy cover, ground vegetation cover, distance to nearest active logging road, distance to nearest inactive logging road, length of active logging road, length of inactive logging road, and EVI. We also included interactions between canopy cover and the following variables to better assess how canopy cover may alter the relationship of the variable with the abundance of bear sign: polynomial for EVI with 2 degrees of freedom, ground vegetation cover, big tree density, presence of bees, termite mound count, deadwood volume, and count of fig trees. We fit the global model as a generalized linear model using the "glmer" function in the R package "lme4" (Bates et al. 2015) with a Poisson distribution. We included a random intercept based on transect number to account for the autocorrelation among sampled plot sections within each transect and to reduce overdispersion (Harrison 2014).
We used a backward stepwise model selection approach to determine a top model using the "GLMERSelect" function in the "Statistical Models" package (Kaplan 2019). The "GLMERSelect" function works by fitting the global model and then testing the interaction terms for significance, followed by the main effects, removing terms based on comparisons of fit from likelihood-ratio tests. We checked our top model for overdispersion using squared Pearson residuals with a function from Bolker et al. (2009). Using the terms from the top model, we created effect plots for each by plotting the predicted mean and 95% confidence intervals (CIs) while holding all other covariates from the top model at their mean values. The values of each plotted covariate ranged between the minimum and maximum values within which we demarcated the lower and upper 95% quantile distribution (except when noted in the figures).
We also explicitly aimed to determine how logging activity influenced sun bear space use. Each transect (and hence every 25-m section within that transect) was assigned either as primary or logged forest. Models that included forest type and random intercepts for transect number did not converge because each transect (and all data collected within each transect section) was entirely within either forest type category. We calculated the density of bear trees in both forest types and assessed the differences in the v www.esajournals.org recorded sections for the covariates from our top model by forest type. Here, we were interested in differentiating the habitat characteristics between logged and primary forests, so we treated each 25-m section within transects as our sampling unit and performed Mann-Whitney tests to assess the significance of the differences of covariate values. We reported sample means and 95% CIs of bear sign density and that of all top covariates within each forest type using the "boot" and "boot.ci" functions in program R (R Core Team 2019) package "boot" (Davison andHinkley 1997, Canty andRipley 2017). We used 10,000 bootstrap replicates with the adjusted bootstrap percentile method when calculating non-parametric 95% CIs.

RESULTS
We observed 265 bear trees within 94 strip transects; 75 transects (80%) had at least one bear tree (range 1-11). We identified only 74 (28%) of bear trees to 21 different families and 37 genera (Appendix S1: Table S1), indicating that the diversity was substantially higher than we could recognize. Bear trees ranged from 9 to 132 cm dbh; 93% were <60 cm (logged x = 36 cm, 8% >60 cm, not significantly different than primary x = 33 cm, 6% >60 cm). Most bear trees in both forests were mid-sized (20-40 cm dbh; Appendix S1: Fig. S1). Only one tree had marks judged to be <1 month old; 10% were judged to be >1 yr old. We observed no nests made by bears in trees, although we may have missed some as they are generally uncommon, often difficult to detect in the canopy, mistaken as orangutan nests, and decay quicker than claw marks.
Sun bear-climbed trees occurred at a density of 7.05 trees/ha throughout the study area. Bear sign was positively associated with bees and termites, both sun bear foods (Table 1; Fig. 2), but deadwood volume was not included in the top model. Bear sign occurred more frequently in forests with more canopy cover (Table 1, Fig. 3a). Our remotely sensed metric of vegetative greenness, EVI, had a quadratic relationship with bear sign counts (Table 1). Transects with higher levels of greenness had a positive association with bear sign up to the mean value of EVI, above which the relationship declined (Fig. 3b). Bear sign increased at higher elevations (Table 1, Fig. 4), in closer proximity to inactive logging roads, and when more active logging roads were found within 500 m of the transect (Table 1

DISCUSSION
Three-fourths of bear species are forestdependent omnivores (only the polar bear [Ursus maritimus] and giant panda [Ailuropoda melanoleuca] are dietary specialists); these omnivorous ursids range across a wide array of forested habitats on four continents, including habitats significantly disturbed by humans. The degree to  which these species tolerate, adapt to, or take advantage of human disturbances varies. For example, American black bears (U. americanus) thrive in previously logged forests that are a patchwork of different ages, providing a variety of fruits in the shrub layer, which tend to be more productive with increased light penetration to the forest floor (Brodeur et al. 2008, Garshelis andNoyce 2008). Conversely, it has been asserted that sun bears-which are arguably the least-studied bear species-have low tolerance for disturbance to their forest habitat because instead of finding food in the shrub layer, the fruits they consume are produced mainly in the forest canopy.
Much of the sun bear range in Southeast Asia has been logged or will be logged in the future (FAO 2011a). In fact, 3 of the 10 sun bear range countries are among the top 10 countries in the world in terms of net forest loss during the most recent decade (2010-2020; FAO 2020). Thus, an important question is whether current logging practices represent a serious threat to the persistence of this species, and if so, how can it be ameliorated? Further, can the status of sun bear populations be monitored using forest cover as a surrogate for population density? Here, we add to the growing body of evidence that suggests that this species is not so different from the other omnivorous bears in its adaptable use of changing forest composition and structure. This should not be surprising given that this species evolved in an environment with extreme year-to-year fluctuations in fruit availability, due to periodic masting events (Wong et al. 2005, Fredriksson et al. 2006. Indeed, although this is the smallest species of bear, it has an especially long tongue and a large heavy skull with large strong canines and a high bite force, all of which are clearly not adaptations for frugivory, but rather for tearing into termite nests or into trees to eat stingless bees (Tetragonilla [Trigona]) (Christiansen 2007, Fredriksson 2012.

Resources for sun bears in primary vs. logged forests
A number of recent studies using camera traps have shown that sun bears use logged forests to a considerable extent after several years of regeneration (Linkie et al. 2007, Samejima et al. 2012, Brodie et al. 2015, Lindsell et al. 2015, Wearn et al. 2017, Jati et al. 2018, Guharajan et al. 2021, Laneng et al. 2021. Camera traps are useful for detecting bears, but only on the ground. Sun bears spend much of their time in the trees, foraging on fruits or bees, or resting. Hence, camera-trap photographs may not necessarily reflect essential activities. Our method of detection, claw-marked trees, was more apt to capture sun bear feeding activity. However, we expected this type of sign to be biased against insect feeding, which occurs mainly on the ground (e.g., in rotten logs or the soil). Wong et al. (2002) studied the food habits of sun bears at this same study site (both logged and primary forest) during 1998-2000, based on v www.esajournals.org scats and feeding sign of radio-collared bears, and found that insects (especially beetles and termites) dominated the diet; notably, that study occurred during an extended period of limited fruiting (Wong et al. 2005). The most common fresh feeding sign was in decayed logs or stumps.
Although the amount of dead wood observed along our transects did not directly relate to sun bear detections, it seems likely that logging increased woody debris (Pfeifer et al. 2015) and thus enhanced the habitat for termites and other insects, and this may partly explain the nearly twofold greater detection of sun bears in the logged parts of our study area vs. the primary forest. Dead wood accumulates directly from the logging operations and also continues at a high rate for more than a decade afterward, due to high mortality of pioneering species (Bischoff et al. 2005). Termite biomass in our study site is dominated by wood-feeders and decayed-wood inhabitants , and dead wood left on the ground has been found to increase abundance of these termites ). Had we recorded sun bear sign on the ground (digging into termite colonies and breaking rotten logs; Wong et al. 2002, Augeri 2005, Fredriksson 2012, the difference in detections between the logged and primary forest may have been even greater. We opted not to try to count such sign, however, because it decayed faster and became much less recognizable than claw marks on trees (Fredriksson 2012), and we could not definitively distinguish it from sign left by bearded pigs (Sus barbatus), pangolins (Manis javanica), and Malay badgers (Mydaus javanensis).
Our reliance on trees to detect sun bear sign means that higher sun bear detection in logged forests was also related to resources provided by those trees. One of the resources in trees is bees. Visible bee nests had a strong positive association with sun bear claw marks and also occurred more in logged forests. Whereas stingless bee nests tend to occur more often in large trees, a study of these bees in lowland areas of Sabah (including our study site) found that it is not nesting sites but food (specifically pollen) that dictates bee density, and floral resources can be particularly rich along some forest edges with high light penetration and understory plants (Eltz et al. 2002).
Fruit is the most obvious important sun bear food. Of the 21 families of trees that we observed claw marks on, only 3 were not previously reported to be a source of fruits eaten by sun bears (Fredriksson et al. 2006, Steinmetz et al. 2013, Lee et al. 2019, Appendix S1: Table S1). One commonly climbed tree family, Euphorbiaceae, contains some genera with fruits consumed by sun bears, but also some, including the commonly climbed pioneering genus Macaranga, that provided fruits not known to be eaten by sun bears (Fredriksson et al. 2007). This genus often harbors ant colonies, which serve as a defense against herbivores (Fiala andMaschwitz 1992, Shimizu-Kaya et al. 2015), and that is likely what attracted sun bears. Sun bears do not consume fruits of Dipterocarpaceae, but these large trees may provide bees' nests and resting sites (Wong et al. 2002, Padmanaba et al. 2013, Steinmetz et al. 2013. Likewise, sun bears in this study and in a previously logged site in Sumatra commonly climbed Ochanostachys amentacea (Family Olacaceae), which apparently substitutes as a resting tree where dipterocarps had been harvested (Padmanaba et al. 2013, Lee et al. 2019. Sun bears also use hollow tree cavities as resting sites. At this same study site, Wong et al. (2004) frequently tracked radio-collared bears to resting sites inside standing hollow trees in primary forest as well as hollow trees that had been felled and left after logging because they had no value. Our claw mark survey would have detected the former but not the latter.
During this study and at the same site, Wong (unpublished manuscript) conducted a companion study to investigate and monitor fruit production. Three 2-km transects in primary forest and three in logged forest were searched for fallen fruits every 2 weeks over a period of Fig. 7. Observed values (gray points) and means (red point) of variables within the top fitting model explaining occurrence of sun bear sign in Sabah, Malaysia, in transects within logged vs. primary forest. Horizontal lines represent the 25th, 50th, and 75th quantile values. 34 months (April 2005-January 2008). Over 143,000 fruits from 50 tree families were collected, dried, and weighed. Some types of fruits were more common in the primary forest and some in the logged forest, but overall fruit production and temporal fruiting patterns were not significantly different (dry fruit kg/ha/mo: logged forest x = 2.33 AE 0.87 SE; primary forest x = 1.81 AE 0.56). Of 16 tree families producing fruits commonly consumed by sun bears (Fredriksson et al. 2006, Steinmetz et al. 2013, two (Elaeocarpaceae, Euphorbiaceae) produced more fruit in logged forest and two (Annonaceae, Myristicaceae) produced more in primary forest. However, during the period of our study (May 2006-January 2007 fruiting was low both in the primary and logged forest. In fact, fruiting had been low since the previous fruiting episode (May-August 2005), which ended 9 months before our study began. This explains the virtual absence of fresh tree-climbing sign during our study, and also, the overall low incidence of claw-marked trees compared to other sign surveys of this species (Augeri 2005, Fredriksson 2012. It also emphasizes the importance of insects as a dietary staple. We had expected that bears would have utilized figs, which tend to be available even in non-masting years, but none of the fig trees within our transects were climbed by bears, possibly because the specific species of Ficus were not preferred or produced sparse fruits, or the fruits were consumed by other animals before the bears had a chance (many had been climbed by civets). Also, bears may have eaten fruits that had fallen to the ground.

Conservation value of logged forests
Our results indicate that previously logged forests can have appreciable conservation value for sun bears. Fourteen years after the cessation of logging, our study site produced abundant and diverse foods (both insects and fruits) and resting sites, and tree climbing was even more prevalent than in primary forest. We recognize that the speed of forest regeneration and what that regenerating forest eventually becomes can vary substantially, depending on the type of forest that was logged, the extent of logging's impact, the local site conditions, and the proximity to nearby forested areas. It seems conceivable that, over the long term, abutting primary and successional forests might act synergistically in provision of a variety of food resources that would benefit sun bears, given the enormous fluctuations that occur in fruiting.
Of particular significance is our finding that sun bear tree-climbing events increased in local areas with termites or bees, and these insects were more common in logged areas. Fredriksson et al. (2006) observed that sun bears at a site in Indonesian Borneo spent more time feeding in a habitat that was drier and less productive for fruits, but more productive for insects during non-masting years. When fruits are not abundant, as is the case most of the time in the Sundaic region, insects are a crucial resource for this omnivore (Wong et al. 2002, Fredriksson et al. 2006. Even on the mainland, where fruiting is less episodic, sign surveys have revealed the importance of insects in the sun bear diet (especially termites, bees, and beetles), enough that it may account for the coexistence of this species with more frugivorous Asiatic black bears (U. thibetanus) (Steinmetz et al. , 2013. Signs of insect feeding, though, are hard to detect and thus may underestimate actual use of this food. One study in Northeast India, based on scats, found that insects composed nearly half the annual diet (Sethy and Chauhan 2018), and another found that sun bears commonly used a degraded bamboo forest due to an abundance of termites (Gouda et al. 2020). This dimension of the sun bear diet is often neglected when conservationists debate the value of logged areas.
We did not investigate sun bear use of a recently logged forest. This is an important caveat. For several years after logging (the time being dependent on local conditions), fruiting is drastically reduced. Our study sites were part of a mosaic of forested parcels, some of which were logged much more recently, and multiple times (Reynolds et al. 2011). The chief wildlife species of concern with respect to logging in this region is the orangutan, whose diet greatly overlaps that of the sun bear (Fredriksson et al. 2006, Kanamori et al. 2010, and whose population densities on our study site are directly linked to fruit abundance (Kanamori et al. 2017). A population survey of orangutans in this forest complex in 2007 revealed densities in lightly logged forests to be as high or higher than in v www.esajournals.org neighboring mature primary forest, with peak densities in forests logged >15 yr in the past (Ancrenaz et al. 2010), akin to results of our sun bear survey.
One of the compounding factors of logging, aside from the removal of trees and disturbance of the soil and seed bank, is the creation of roads. We found, surprisingly, that sun bear habitat use was positively influenced by the proximity of inactive logging roads and also by the length of active logging roads within 500 m. This was unexpected because other studies have found that sun bears shun human activity in the forest, including roads or even foot trails (Augeri 2005, Fredriksson et al. 2006, Nazeri et al. 2012, Guharajan et al. 2018. We surmise that in our study, habitat quality for insects and some fruits was enhanced along the roadsides. In some areas, though, the real threat of roads is the access provided to poachers. A key feature of our study site is that poaching was low, due in part to the presence of the Danum Valley Field Center, INFAPRO (Innoprise-FACE Rainforest Rehabilitation Project) nursery, and the Bornean Rainforest Lodge, and the numerous people and activities associated with each. Bears likely learned that roads in this area were not a threat. This important factor differs enormously among sites and may account for what some perceived to be effects of logging, which may in fact have been differences in poaching pressure. Severe population declines of orangutans on Borneo were found to be linked more to direct killing than to habitat loss and degradation (Voigt et al. 2018). Likewise, camera-trapping surveys have shown much more severe effects of snaring than of moderate habitat degradation (logging but not clear-cutting) on populations of a host of forestdwelling Southeast Asian mammals, including sun bears (Tilker et al. 2019). Yet, logging, roadbuilding, access, poaching, and wildlife trade are all intertwined Gumal 2001, Morton et al. 2021).

Projecting decline of sun bears from tree cover
A seemingly logical and straightforward approach for tracking population change in a forest-dependent species like the sun bear is to assume that abundance is roughly proportional to forest area at a local scale (Watling et al. 2020).
A fundamental problem with this assumption, though, is that hunting may seriously confound the relationship between species abundance and habitat (Brodie et al. 2015). For example, whereas total forest area has been increasing in Vietnam (FAO 2020), there is scant definitive evidence (a few camera-trap photographs) of persistence of sun bears in that range country, due to pervasive illegal hunting (Cano and Tellería 2013, Crudge et al. 2016, personal communication, 2020. In other areas, sun bears persist despite hunting, but at well below carrying capacity, so if the area of a patch of habitat is reduced, bears living in the affected area could move into the remaining habitat, increasing density but with total abundance unchanged. That is likely what occurred at a site on Indonesian Borneo, where a fire killed 80% of the live trees and also burned the woody debris harboring insects: Sun bear use of the burned area was reduced to zero as they apparently moved into the adjacent unburned forest, but returned to the burned site after it began to recover (Fredriksson et al. 2007, Fredriksson 2012. The confounding issues related to hunting notwithstanding, Scotson et al. (2017b) proposed that sun bear abundance could be effectively monitored via changes in forest cover, as assessed from Landsat satellite photos (30 × 30-m pixels; Hansen et al. 2013). These data did not distinguish natural forest from tree plantations (e.g., rubber, eucalyptus, teak, Acacia), so these authors included only forest losses but not forest gains, reasoning that the latter included monocultural plantations that were not likely to support bears. Others have made the point that estimates of the area of loss or gain of forest coverage depend on how a forest is defined and measured (Keenan et al. 2015, Chazdon et al. 2016). Among Southeast Asian countries, recent forest gains have been significant (Paradis 2020) and have occurred both from planting and from regeneration of natural forests (Keenan et al. 2015, Table S3), but these two types of forest gain are difficult to distinguish on a large scale using satellite data (Sloan et al. 2019). Based on country-reports to FAO (2011a), Indonesia and Thailand are the only sun bear range countries where primary (unlogged) forests comprise a significant (>20%) proportion of the total forested area (50% and 35%, respectively), and Vietnam and Thailand are v www.esajournals.org the only countries where planted forests represent a significant proportion (25%, 21%, respectively). Natural regenerating forests thus make up the bulk (63%) of the forested area in sun bear range (an order of magnitude more than planted forests; FAO 2011a), which our study, and another recent study in Sabah (Guharajan et al. 2021), showed to be valuable habitat for this species. Scotson et al. (2017b) observed that the rate of encountering sun bears on camera-trap photographs, collected (as by-catch) from various studies across the range, was correlated to canopy cover in the vicinity of the camera trap. Similarly, we found that bear trees were positively related to canopy closure, and further that logged areas had, on average, lower canopy closure. Yet, this relationship conceals one critical element-very high variation in canopy closure in logged sites. The lower average canopy closure in logged sites was due to patches where the canopy was very open. However, the logged area also had patches with thicker canopy than the average in the primary forest (Fig. 7), due to a high density of mid-level pioneering trees. These were the areas with particularly high use by sun bears. Thus, there were portions of the logged forest with higher use than the primary forest, and portions with lower use. Notably, the Enhanced Vegetation Index was higher in the logged forest (Fig. 7), and bears used these very green sites to a high degree, but there appeared to be a threshold in greenness above which it was no longer attractive (Fig. 3b); these may have been sites with a high density of impenetrable shrubs and vines that deterred use by sun bears (Fredriksson 2012). Guharajan et al. (2018) found, at another site in Sabah, that sun bear tree climbing was inversely related to density of understory shrubs.
Sign surveys conducted by Scotson et al. (2021) indicated a complex relationship between tree cover and bear use (sun bears and Asiatic black bears combined) in a non-Sundaic range country (Laos): Total bear sign showed a positive relationship, but newer sign (<1 yr old) showed no clear relationship because use was high in some sites with very little cover. Thus, even if there appears to be some general relationship between sun bear presence and tree canopy at a very broad scale, that relationship is much more complex when viewed on the ground, and also not likely to provide useful projections of sun bear population change following logging. Indeed, we found aspects of regenerating forests that promoted sun bear use, and we also found, unexpectedly, that sun bears climbed mainly mid-sized trees, even in primary forests, so reduction in the density of large trees would not per se be limiting to their resource use.
To estimate rates of sun bear decline, Scotson et al. (2017b) equated bear density to camera-trap encounter rates and then related this to canopy cover. That is, they used one purported index of abundance, which was likely flawed due to overdispersion (Gopalaswamy et al. 2019), as the basis for creating another index. Higher photographic rates may reflect higher use, but use is not equivalent to density. A portion of the forest where a bear spends a lot of time is not necessarily a place with more bears. Because bears do not move around the forest at random, ecological and sampling-related factors can confound the relationship between number of photos and local bear density. It is now widely recognized that camera-trap encounter rates are an unreliable indicator of spatial differences in density, due to differences in detection (Sollmann et al. 2013, Bischof et al. 2014. Density is one factor that affects detection, but so do the movements of the animals (Neilson et al. 2018), which vary with local resources and animal behaviors (Harmsen et al. 2010). Accordingly, our study of sign (which accumulated over a long period of time) was not intended as a measure of density, but of relative use, and as we argued above, the use that we measured was of an important resource that bears were attracted to (trees climbed for food or refuge), not just animals passing by.
If changes in sun bear populations could be predicted from habitat features, that would be of great benefit for designing and targeting conservation actions for this species (Crudge et al. 2019). However, we do not believe that canopy cover alone captures the intricacies in the biology of this species (e.g., their diverse diet and adaptability to changing environments) nor the complexities of both resource availability and human-related threats across Southeast Asia. Given that hunting is such a driving force in many sun bear populations (Brodie et al. 2015, Crudge et al. 2019, Gomez et al. 2019, we are skeptical of monitoring schemes that rely v www.esajournals.org solely on habitat, especially in light of recent data indicating that illegal hunting may be higher in denser habitats, where poachers find better concealment and higher animal densities . Novel ways of combining habitat features with some measure of hunting pressure are needed for monitoring species that are heavily hunted (e.g., Petersen et al. 2020).

CONCLUSIONS
A bleak future has been projected for sun bears, due to mounting threats from forest loss and poaching (Augeri 2005, Scotson et al. 2017a. Yet, findings like those from our study offer hope. This species' reliance on primary forests has generally been overstated, and its reliance on insects understated. Total forest loss is certain to have a very large impact, but succession following sustainable forest cutting provides a mosaic of habitats of varying quality, some with richer resources for sun bears than primary forest, at least in some seasons or years. There are many benefits, though, in maintaining primary forests near forests that are logged, as these would provide a refuge for bears trying to escape the disturbance of the logging operations and a place to live during the early succession, a seed source for the regenerating forest, and a high diversity of food resources to help buffer the annual variations.
Forestry practices in Southeast Asia are gradually improving (Keenan et al. 2015, MacDicken et al. 2015, but regulations, targets, and effectiveness vary widely, and reduced-impact logging techniques are mainly limited to a few countries in the region (FAO 2011a). Deforestation and fires remain serious problems (Miettinen et al. 2011, Wilcove et al. 2013, Dong et al. 2014, Margono et al. 2014, Hansen et al. 2020, especially in the lowlands (Namkhan et al. 2020), but also with worrying, previously unrecognized increases in higher elevations (Zeng et al. 2018). Moreover, forests can become degraded while seemingly remaining intact, due to the limits of resolution of remote sensing (FAO 2011b, Margono et al. 2012, Bryan et al. 2013, Miettinen et al. 2014. Models projecting the future state of Southeast Asian forests are highly uncertain because substantially different pathways are possible and the socioeconomic factors affecting these are complex (d' Annunzio et al. 2015, Estoque et al. 2019, Paradis 2021. Key for sun bears is that logged forests are not converted to agriculture under the erroneous assumption that they are already lost. Other studies have highlighted the importance of successional Southeast Asian forests for a number of species and ecological functions (Meijaard and Sheil 2008, Edwards et al. 2011, 2014, Samejima et al. 2012, Wearn et al. 2013, 2017, Jati et al. 2018, Voigt et al. 2018, and here, we add sun bears to the growing list. The conservation focus for this species must be on saving all habitats where they can live, and reducing the threat of hunting (Harrison et al. 2016, Gray et al. 2018, Crudge et al. 2019, Gomez et al. 2019, which can extirpate bears in even the best of habitats.

ACKNOWLEDGMENTS
We thank the Economic Planning Unit of the Malaysia Federal Government, Danum Valley Management Committee, and Sabah Wildlife Department for permission to conduct this study in Sabah. Financial support was provided by the International Association for Bear Research and Management. Tzung-Su Ding provided thoughtful insights and Thomas Lahousse translated the original M.S. thesis. We thank Mike Bernadus for identifying many of the trees. We are most grateful to the staff at Danum Valley Field Center, especially Teck-Chai Koh, for help in this research. We dedicate this article to Teck-Chai Koh, who was a victim of a fatal accident during the fieldwork, for his lasting contribution to tropical rainforest.