/* The inspected item stays nearest its source; comparison content is read-only. */
#detailGroup:has(.interfaceHelpDetail){z-index:16}
#detailGroup:has(.skillTooltip){z-index:16}
@media (min-width: 641px){
 #detailGroup.comparing.opensLeft #detail{order:2}
 #detailGroup.comparing.opensLeft #equippedComparison{order:1}
}
/* One scroll container owns both complete cards on a phone. Grid auto rows
   could shrink a tall card while its visible contents covered the next one. */
@media (max-width: 640px){
 #detailGroup,#detailGroup.comparing{display:flex;flex-direction:column;max-height:var(--detail-available-height,calc(100dvh - 16px));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y pinch-zoom;-webkit-overflow-scrolling:touch}
 #detailGroup #detail,#detailGroup #equippedComparison,#detailGroup.comparing #detail,#detailGroup.comparing #equippedComparison{flex:none;order:0;max-height:none;overflow:visible;touch-action:pan-y pinch-zoom}
 #detailGroup.pinned{pointer-events:auto}
}
/* Pack real actions at their content width; start a new row only when full. */
#detailGroup .detailActions.tooltipActions{display:flex;flex-wrap:wrap;gap:6px;align-items:stretch;justify-content:flex-start}
#detailGroup .detailActions.tooltipActions>button,
#detailGroup .detailActions.tooltipActions>.socketStashActions>button{flex:0 1 auto;width:auto;max-width:100%;min-width:0;min-height:42px;margin:0;padding:6px 8px;white-space:normal;overflow-wrap:anywhere;font-size:11px;line-height:1.35}
#detailGroup .detailActions.tooltipActions:has(>.socketStashActions){align-items:flex-start}
#detailGroup .detailActions.tooltipActions>.socketStashActions{display:flex;flex-direction:column;align-items:stretch;gap:6px;flex:0 1 auto;min-width:0;max-width:100%}
#detailGroup .detailActions.tooltipActions.stackItemActions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
#detailGroup .stackItemActions>.stackTransferActions{display:flex;flex-direction:column;gap:6px;min-width:0}
#detailGroup .stackItemActions :is(.socketStashActions,.stackTransferActions)>button{box-sizing:border-box;width:100%;min-width:0;min-height:42px;margin:0;padding:6px 8px;white-space:normal;overflow-wrap:anywhere;font-size:11px;line-height:1.35}
