/* Small screens keep the selected record readable; desktop navigation is unchanged. */
@media(max-width:600px){
 body[data-resource-page] #resource-layout[data-resource-stage=section],
 body[data-resource-page] #resource-layout[data-resource-stage=detail]{grid-template-columns:minmax(0,1fr);gap:14px}
 body[data-resource-page] #resource-sidebar{position:static;top:auto;max-height:180px;width:100%;padding:0 0 8px;border-right:0;border-bottom:1px solid var(--line);scrollbar-gutter:stable}
 body[data-resource-page] .resource-category-button{font-size:14px;min-height:44px}
 body[data-resource-page] #resource-sidebar .resource-row-copy strong{font-size:14px}
 body[data-resource-page] #resource-layout #resource-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr))}
 body[data-resource-page] #resource-detail .resource-hero-link{flex-wrap:wrap;gap:8px;min-width:0}
 body[data-resource-page] #resource-detail .resource-hero-link>strong{margin-left:auto;white-space:normal}
 body[data-resource-page] #resource-detail .resource-output{flex-wrap:wrap;gap:5px 10px}
 body[data-resource-page] #resource-detail .resource-output strong{margin-left:auto;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 body[data-catalog-page=heroes] .hero-alliance-tooltip{position:fixed;inset:auto 16px 16px;width:auto;max-width:none;max-height:50dvh;overflow:auto;pointer-events:auto;font-size:13px;z-index:110}
 body[data-catalog-page=heroes] .hero-alliance-tooltip>strong{font-size:15px}
 .quick-preview{max-height:calc(100dvh - 24px);overflow:auto}
}
/* Avoid automatic input zoom and tightly packed hero controls on touch devices. */
@media(pointer:coarse){
 .workspace input:not([type=checkbox]):not([type=radio]),.workspace select{font-size:16px!important}
 body[data-catalog-page=heroes] .hero-rarity-options{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))}
 body[data-catalog-page=heroes] button.hero-rarity-option{min-height:44px;height:44px}
 body[data-catalog-page=heroes] .hero-star-groups{grid-template-columns:repeat(auto-fit,minmax(min(100%,188px),1fr))}
 body[data-catalog-page=heroes] button.hero-star-button,body[data-catalog-page=heroes] button.hero-stat-toggle{min-height:44px}
 body.cards-compact .cards-console .console-stepper{height:46px;grid-template-columns:44px minmax(0,1fr) 44px}
 body.cards-compact .cards-console .console-stepper button{width:44px;height:44px;min-height:44px!important}
 body.cards-compact .cards-console .console-stepper input{height:44px;min-height:44px!important}
}
